UI-Kit-ts provides several typescript ui components and functionality used throughout our projects.
Checkout the online demo of the showcase.
library
: library containing all components and functionalityshowcase
: showcase which demonstrates all components and their usage
Run the following command to start the showcase app and open it in your browser:
npm run dev:sc
To build the library use:
npm run build:lib
And the showcase:
npm run build:sc
ui-kit-ts offers integration of FormatJS to support localization, although no component is tight to it.
Use the LocaleProvider in the locale context to automatically fetch translations of defined messages.
With npm run messages:extract
defined messages in FormatJS Message components are extracted into the library/localization/translations directory as Json. Create the translated Json using the locale identifier as file name (i.g. extracted is a 'en.json', so we create a 'de.json'). Compilation of the translated messages happens automatically during the build.
When using the LocaleProvider, it will try to download the compiled translations for a set locale from the public/translations-compiled directory. If none is available, it will default back to the default messages.
ui-kit-ts supports the Atlassian design system, which is basically a mapping of tokens to css variables. If the used component does not seem to have the proper styling, use the 'initTheming()' function in the theming directory, which sets the themeing attribute in the HTML tag.
- Node.js (version 18 or higher)
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/linked-planet/ui-kit-ts.git cd ui-kit-ts
-
Create a new branch
git checkout -b feature/your-feature-name
-
Install dependencies
npm install
-
Start development server
npm run dev:sc
This will start the showcase application and open it in your browser at
http://localhost:5173
.
npm run dev:sc
- Start the showcase development server with hot reloadnpm run dev:lib
- Build the library in watch mode for developmentnpm run preview
- Build and preview the showcase applicationnpm run previewdebug
- Build and preview the showcase in debug mode
npm run build:lib
- Build the UI kit library for productionnpm run build:sc
- Build the showcase application for productionnpm run build:sc-debug
- Build the showcase application in debug mode
npm run test
- Run all tests with Vitestnpm run test:watch
- Run tests in watch mode
npm run eslint
- Run ESLint on all TypeScript filesnpm run stylelint
- Run Stylelint on all CSS filesnpm run bcheck:lib
- Run Biome check and format on library filesnpm run bcheck:sc
- Run Biome check and format on showcase files
npm run messages:extract
- Extract internationalization messagesnpm run messages:compile
- Compile internationalization messagesnpm run messages
- Extract and compile messages
npm run pack
- Build library, run tests, and create a local packagenpm run fastpack
- Quick build and package for testing
To test your changes in another project:
-
Create a local package
npm run pack
-
Install the local package in your test project
npm install /path/to/ui-kit-ts/linked-planet-ui-kit-ts-0.10.0.tgz
library/
- Main UI kit library containing all componentsshowcase/
- Demo application showcasing all componentsbundler_plugins/
- Custom bundler pluginstwThemes/
- Tailwind CSS theme configurations
- Make your changes in a feature branch
- Ensure all tests pass:
npm run test
- Run code quality checks:
npm run bcheck:lib && npm run bcheck:sc
- Create a pull request with a clear description of your changes
- Library builds are output to
dist/
- Showcase builds are output to
dist-showcase/
- Local packages are created as
.tgz
files in the root directory