@konstructio/ui 0.1.2-alpha.106 → 0.1.2-alpha.107

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/README.md +118 -31
  2. package/dist/{AdditionalOptions-D0BAS2HG.js → AdditionalOptions-Crcnz0_g.js} +1 -1
  3. package/dist/{AlertDialogTrigger-BOrb536P.js → AlertDialogTrigger-ouMGAlJW.js} +1 -1
  4. package/dist/{Breadcrumb-DVBxqgW_.js → Breadcrumb-MrF1Z6w2.js} +1 -1
  5. package/dist/{Checkbox-B20uoUKD.js → Checkbox-8KnRLpQG.js} +86 -87
  6. package/dist/{CommandInput-BWt6-vUK.js → CommandInput-CGnqfudl.js} +1 -1
  7. package/dist/{Counter-DiQb-he2.js → Counter-CDXdP1Af.js} +1 -1
  8. package/dist/{DropdownButton-hCVYZ1LA.js → DropdownButton-D4QlKGg7.js} +5 -5
  9. package/dist/{FlagSelectorList-CnJjnsp6.js → FlagSelectorList-tYZNl-tz.js} +22 -18
  10. package/dist/{HamburgerTrigger-BT2yUUJ-.js → HamburgerTrigger-B_NGSZ2r.js} +19 -19
  11. package/dist/{ImageUpload-DgCBCa5X.js → ImageUpload-D7HKSXK8.js} +71 -66
  12. package/dist/Input-is8n7emP.js +195 -0
  13. package/dist/{Loading-DUh9PMJN.js → Loading-DO8JOWBV.js} +1 -1
  14. package/dist/{Modal-CkAf9UY7.js → Modal-Dq9BHD_9.js} +2 -2
  15. package/dist/{Spinner-CUwE2bLm.js → Spinner-BJE79VTl.js} +1 -1
  16. package/dist/{StepIndicatorContent-CjbjVjS1.js → StepIndicatorContent-BGDvxLzV.js} +1 -1
  17. package/dist/{Switch-CyJXptgc.js → Switch-C7286Bcu.js} +2 -2
  18. package/dist/{Toast-DLJDExxw.js → Toast-jSx3Lao8.js} +2 -2
  19. package/dist/Wrapper-2AUlYAHQ.js +195 -0
  20. package/dist/{Wrapper-CvDRHgN4.js → Wrapper-CyHxGs4E.js} +1 -1
  21. package/dist/{Wrapper-B8Ja3k4j.js → Wrapper-a7RVCcrn.js} +238 -232
  22. package/dist/components/Alert/Alert.js +1 -1
  23. package/dist/components/AlertDialog/AlertDialog.js +2 -2
  24. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  25. package/dist/components/AlertDialog/components/index.js +1 -1
  26. package/dist/components/Autocomplete/Autocomplete.js +1 -1
  27. package/dist/components/Autocomplete/components/List/List.js +1 -1
  28. package/dist/components/Autocomplete/hooks/useAutocomplete.js +1 -1
  29. package/dist/components/Badge/Badge.js +2 -2
  30. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  31. package/dist/components/Breadcrumb/components/BackButton/BackButton.js +1 -1
  32. package/dist/components/Breadcrumb/components/Item/Item.js +1 -1
  33. package/dist/components/Button/Button.js +1 -1
  34. package/dist/components/ButtonGroup/ButtonGroup.js +65 -60
  35. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +2 -2
  36. package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.js +10 -9
  37. package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.js +8 -6
  38. package/dist/components/Card/Card.js +25 -22
  39. package/dist/components/Checkbox/Checkbox.js +1 -1
  40. package/dist/components/Command/Command.js +1 -1
  41. package/dist/components/Command/components/CommandGroup.js +1 -1
  42. package/dist/components/Command/components/CommandInput.js +1 -1
  43. package/dist/components/Command/components/CommandItem.js +1 -1
  44. package/dist/components/Command/components/CommandList.js +1 -1
  45. package/dist/components/Command/components/CommandSeparator.js +1 -1
  46. package/dist/components/Command/components/CommandShortcut.js +1 -1
  47. package/dist/components/Command/components/DialogContent.js +1 -1
  48. package/dist/components/Command/components/DialogOverlay.js +1 -1
  49. package/dist/components/Command/components/index.js +1 -1
  50. package/dist/components/Counter/Counter.js +1 -1
  51. package/dist/components/DateRangePicker/DateRangePicker.js +1 -1
  52. package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarDivider/CalendarDivider.js +1 -1
  53. package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +2 -2
  54. package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +3 -3
  55. package/dist/components/DateRangePicker/components/CalendarPanel/components/NavigationButton/NavigationButton.js +1 -1
  56. package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +2 -2
  57. package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
  58. package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
  59. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
  60. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +1 -1
  61. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +1 -1
  62. package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
  63. package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +1 -1
  64. package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +48 -41
  65. package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +48 -41
  66. package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.js +1 -1
  67. package/dist/components/Datepicker/DatePicker.js +1 -1
  68. package/dist/components/Divider/Divider.js +7 -7
  69. package/dist/components/Drawer/Drawer.js +1 -1
  70. package/dist/components/Drawer/components/Body/Body.js +1 -1
  71. package/dist/components/Drawer/components/Footer/Footer.js +1 -1
  72. package/dist/components/Drawer/components/Header/Header.js +1 -1
  73. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  74. package/dist/components/Filter/Filter.js +1 -1
  75. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +2 -2
  76. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
  77. package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.js +1 -1
  78. package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +2 -2
  79. package/dist/components/Filter/components/ResetButton/ResetButton.js +1 -1
  80. package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +2 -2
  81. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +1 -1
  82. package/dist/components/ImageUpload/ImageUpload.js +1 -1
  83. package/dist/components/Input/Input.js +1 -1
  84. package/dist/components/LineChart/LineChart.js +1 -1
  85. package/dist/components/Loading/Loading.js +1 -1
  86. package/dist/components/Modal/Modal.js +1 -1
  87. package/dist/components/Modal/components/Body/Body.js +1 -1
  88. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  89. package/dist/components/Modal/components/Header/Header.js +1 -1
  90. package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
  91. package/dist/components/Modal/components/index.js +1 -1
  92. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
  93. package/dist/components/MultiSelectDropdown/components/Item/Item.js +1 -1
  94. package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
  95. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
  96. package/dist/components/MultiSelectDropdown/components/index.js +1 -1
  97. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +4 -3
  98. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +17 -16
  99. package/dist/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
  100. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +1 -1
  101. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
  102. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +3 -3
  103. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
  104. package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
  105. package/dist/components/PhoneNumberInput/components/index.js +2 -2
  106. package/dist/components/PieChart/PieChart.js +1 -1
  107. package/dist/components/ProgressBar/ProgressBar.js +1 -1
  108. package/dist/components/Radio/Radio.js +1 -1
  109. package/dist/components/RadioCard/RadioCard.js +1 -1
  110. package/dist/components/RadioCardGroup/RadioCardGroup.js +1 -1
  111. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  112. package/dist/components/Range/Range.js +2 -2
  113. package/dist/components/Select/Select.js +32 -28
  114. package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +1 -1
  115. package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.variants.js +1 -1
  116. package/dist/components/Select/components/List/List.js +78 -67
  117. package/dist/components/Select/components/ListItem/ListItem.js +1 -1
  118. package/dist/components/Select/components/Wrapper.js +1 -1
  119. package/dist/components/Select/components/index.js +2 -2
  120. package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.js +1 -1
  121. package/dist/components/Sidebar/components/Footer/Footer.js +1 -1
  122. package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
  123. package/dist/components/Sidebar/components/Label/Label.js +1 -1
  124. package/dist/components/Sidebar/components/Logo/Logo.js +1 -1
  125. package/dist/components/Sidebar/components/Navigation/Navigation.js +1 -1
  126. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +1 -1
  127. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +2 -2
  128. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +1 -1
  129. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +1 -1
  130. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +25 -24
  131. package/dist/components/Sidebar/components/index.js +1 -1
  132. package/dist/components/Slider/Slider.js +2 -2
  133. package/dist/components/Spinner/Spinner.js +1 -1
  134. package/dist/components/Stepper/Stepper.js +1 -1
  135. package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +2 -2
  136. package/dist/components/Stepper/components/StepConnector/StepConnector.js +1 -1
  137. package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +1 -1
  138. package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +2 -2
  139. package/dist/components/Switch/Switch.js +1 -1
  140. package/dist/components/Table/Table.js +1 -1
  141. package/dist/components/Table/components/Body.js +1 -1
  142. package/dist/components/Table/components/Filter.js +1 -1
  143. package/dist/components/Table/components/Head.js +1 -1
  144. package/dist/components/Table/components/Row.js +1 -1
  145. package/dist/components/Tabs/Tabs.js +2 -2
  146. package/dist/components/Tabs/components/Content.js +2 -2
  147. package/dist/components/Tabs/components/List.js +2 -2
  148. package/dist/components/Tabs/components/Trigger.js +2 -2
  149. package/dist/components/Tag/Tag.js +8 -8
  150. package/dist/components/TagSelect/TagSelect.js +1 -1
  151. package/dist/components/TagSelect/components/Item/Item.js +1 -1
  152. package/dist/components/TagSelect/components/List/List.js +1 -1
  153. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
  154. package/dist/components/TagSelect/components/index.js +1 -1
  155. package/dist/components/TextArea/TextArea.js +71 -26
  156. package/dist/components/TextArea/TextArea.variants.js +49 -13
  157. package/dist/components/TimePicker/components/HoursList/HoursList.js +1 -1
  158. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +1 -1
  159. package/dist/components/TimePicker/components/MinutesList/MinutesList.js +1 -1
  160. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +113 -98
  161. package/dist/components/TimePicker/components/WrapperList/WrapperList.js +19 -18
  162. package/dist/components/Toast/Toast.js +1 -1
  163. package/dist/components/Tooltip/Tooltip.js +2 -2
  164. package/dist/components/Typography/Typography.js +1 -1
  165. package/dist/components/VirtualizedTable/VirtualizedTable.js +2 -2
  166. package/dist/components/VirtualizedTable/components/Actions/Actions.js +1 -1
  167. package/dist/components/VirtualizedTable/components/Body/Body.js +2 -2
  168. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +1 -1
  169. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +2 -2
  170. package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +1 -1
  171. package/dist/components/VirtualizedTable/components/Filter/Filter.js +2 -2
  172. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
  173. package/dist/components/VirtualizedTable/components/Header/Header.js +2 -2
  174. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +1 -1
  175. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +1 -1
  176. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
  177. package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +1 -1
  178. package/dist/components/VirtualizedTable/contexts/index.js +1 -1
  179. package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
  180. package/dist/components/index.js +12 -12
  181. package/dist/{components-MnxnhLqM.js → components-CaEW5ge4.js} +32 -32
  182. package/dist/{constants-CSsr7_YV.js → constants-HQIXhj2t.js} +1 -1
  183. package/dist/contexts/index.js +1 -1
  184. package/dist/contexts/theme.provider.js +1 -1
  185. package/dist/{dist-Z0F27ATp2.js → dist-9WbMf_jT.js} +1 -1
  186. package/dist/{dist-oJzmvhAb.js → dist-AxOGvL82.js} +1 -1
  187. package/dist/{dist-CqNOgbfR.js → dist-BIBFLVt1.js} +3 -3
  188. package/dist/{dist-B6ExqXM_2.js → dist-BnCbAI-c.js} +1 -1
  189. package/dist/{dist-C87gsBDM.js → dist-CszFjHAP.js} +2 -2
  190. package/dist/{dist-ut_BEHii.js → dist-pxvIAJzo.js} +2 -2
  191. package/dist/hooks/useMediaQuery.js +1 -1
  192. package/dist/index.js +14 -14
  193. package/dist/lib/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.types.d.ts +1 -1
  194. package/dist/lib/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.types.d.ts +2 -0
  195. package/dist/lib/components/Card/Card.types.d.ts +1 -0
  196. package/dist/lib/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.types.d.ts +1 -0
  197. package/dist/lib/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.types.d.ts +1 -0
  198. package/dist/lib/components/Divider/Divider.d.ts +3 -2
  199. package/dist/lib/components/Divider/Divider.types.d.ts +4 -0
  200. package/dist/lib/components/Input/Input.types.d.ts +4 -0
  201. package/dist/lib/components/MultiSelectDropdown/MultiSelectDropdown.types.d.ts +2 -0
  202. package/dist/lib/components/MultiSelectDropdown/contexts/MultiSelectDropdown.types.d.ts +2 -0
  203. package/dist/lib/components/Select/Select.types.d.ts +2 -0
  204. package/dist/lib/components/Select/components/List/List.types.d.ts +3 -0
  205. package/dist/lib/components/Select/components/Wrapper.d.ts +2 -0
  206. package/dist/lib/components/Sidebar/Sidebar.types.d.ts +2 -0
  207. package/dist/lib/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.types.d.ts +2 -0
  208. package/dist/lib/components/Tag/Tag.types.d.ts +1 -0
  209. package/dist/lib/components/TextArea/TextArea.d.ts +6 -0
  210. package/dist/lib/components/TextArea/TextArea.types.d.ts +13 -2
  211. package/dist/lib/components/TextArea/TextArea.variants.d.ts +4 -1
  212. package/dist/lib/components/TimePicker/TimePicker.types.d.ts +4 -0
  213. package/dist/lib/components/TimePicker/components/WrapperList/WrapperList.types.d.ts +1 -0
  214. package/dist/lib/utils/index.d.ts +1 -0
  215. package/dist/package.json +21 -21
  216. package/dist/{react-B6Nc0Fib.js → react-7zQ6bvbE.js} +290 -289
  217. package/dist/styles.css +1 -1
  218. package/dist/{table.provider-DfZ74xMZ.js → table.provider-CWzODR1t.js} +1 -1
  219. package/dist/{theme.provider-Dw4O3ocC.js → theme.provider-CSL1WCYG.js} +1 -1
  220. package/dist/utils/index.js +6 -5
  221. package/dist/{utils-Cx-WzRZF.js → utils-B-6R7kNE.js} +8 -4
  222. package/package.json +21 -21
  223. package/dist/Input-wp-rsCmX.js +0 -188
  224. package/dist/Wrapper-R8fik3ah.js +0 -182
  225. /package/dist/{dist-DGOjiAnB2.js → dist-DGOjiAnB.js} +0 -0
  226. /package/dist/{dist-DwxO2RoR2.js → dist-DwxO2RoR.js} +0 -0
  227. /package/dist/{dist-pWlMx4Fi2.js → dist-pWlMx4Fi.js} +0 -0
  228. /package/dist/{x-a_LpoXzG2.js → x-a_LpoXzG.js} +0 -0
package/README.md CHANGED
@@ -1,62 +1,149 @@
1
- > 🚧🚨 **Work in Progress** 🚨🚧
2
- >
3
- > ⚠️ This library is currently under construction. Features may change and documentation is incomplete. ⚠️
1
+ # @konstructio/ui
4
2
 
5
- # Konstruct React Component Library
3
+ [![npm version](https://img.shields.io/npm/v/@konstructio/ui.svg)](https://www.npmjs.com/package/@konstructio/ui)
4
+ [![license](https://img.shields.io/npm/l/@konstructio/ui.svg)](./LICENSE.md)
5
+ [![Storybook](https://img.shields.io/badge/docs-storybook-ff4785.svg)](https://konstructio.github.io/konstruct-ui)
6
6
 
7
- This repository contains a set of reusable and customizable React components built for **Konstruct**'s infrastructure and Kubernetes products. These components aim to streamline the development process, ensuring consistency and high-quality UI for **Kubefirst**, **Colony**, and other future projects.
7
+ A React component library for [Konstruct](https://konstruct.io) infrastructure products (Kubefirst, Colony) and the Civo dashboard. Built with React, TypeScript, Tailwind CSS v4, and Radix UI primitives.
8
8
 
9
- ## Features:
9
+ > **Note**: This library is in active development (alpha). APIs may change between releases.
10
10
 
11
- - **Reusable**: Designed to be used across different projects, reducing development time and effort.
12
- - **Customizable**: Easily adjustable to fit specific needs or branding requirements.
13
- - **Responsive**: Optimized for all screen sizes, ensuring a seamless experience on both desktop and mobile.
14
- - **Accessible**: Built with accessibility in mind, following best practices to ensure compatibility with all users.
15
- - **Tailwind CSS Integration**: Seamlessly integrated with Tailwind CSS for rapid UI development and easy theming.
11
+ ## Features
16
12
 
17
- ## **Installation Guide**
13
+ - **40+ components** — forms, tables, modals, charts, navigation, and more
14
+ - **Accessible** — built on Radix UI primitives, tested with jest-axe
15
+ - **Themeable** — light, dark, and brand themes switchable at runtime
16
+ - **Tree-shakeable** — ESM build with component-level code splitting
17
+ - **Broad React support** — compatible with React 16.8+, 17, 18, and 19
18
18
 
19
- Follow these steps to integrate `@konstructio/ui` into your project:
19
+ ## Requirements
20
20
 
21
- ### Step 1: Install the Library
21
+ | Peer dependency | Version |
22
+ | ----------------------- | -------------------------- |
23
+ | `react` / `react-dom` | `^16.8 \|\| ^17 \|\| ^18 \|\| ^19` |
24
+ | `tailwindcss` | `^4` |
25
+ | `@tanstack/react-query` | `^5.90` |
26
+ | `react-router-dom` | `^7` |
22
27
 
23
- Run the following command to install the package:
28
+ ## Installation
24
29
 
25
30
  ```bash
26
31
  npm install @konstructio/ui
27
32
  ```
28
33
 
29
- ---
34
+ ## Setup
30
35
 
31
- ### Step 2: Install Tailwind CSS v4
36
+ ### 1. Import the styles
32
37
 
33
- Tailwind CSS v4 is a peer dependency. If you don't already have it installed, follow the official [Tailwind CSS installation guide](https://tailwindcss.com/docs/installation).
34
-
35
- ---
36
-
37
- ### Step 3: Import the theme styles
38
-
39
- In your global CSS file, import Tailwind and the library theme, plus the brand theme you need:
38
+ In your global CSS file, import Tailwind, the library theme, and the brand theme you need:
40
39
 
41
40
  ```css
42
41
  @import 'tailwindcss';
42
+
43
43
  @import '@konstructio/ui/ui/theme.css';
44
- @import '@konstructio/ui/ui/utilities.css';
45
44
  @import '@konstructio/ui/ui/civo-theme.css'; /* or kubefirst-theme.css */
45
+ @import '@konstructio/ui/ui/utilities.css';
46
46
  ```
47
47
 
48
48
  Component styles are bundled with the components and injected automatically — no extra CSS import is needed.
49
49
 
50
- ---
51
-
52
- ### Step 4: Include `@konstructio/ui` in Tailwind's source detection
50
+ ### 2. Register the package with Tailwind
53
51
 
54
- So Tailwind generates the utility classes used by the components, add the package to your global CSS with `@source` (the path is relative to your CSS file):
52
+ Add the package to Tailwind's source detection so it generates the utility classes used by the components. The path is relative to your CSS file:
55
53
 
56
54
  ```css
57
55
  @source '../node_modules/@konstructio/ui/dist';
58
56
  ```
59
57
 
60
- ## Final Steps
58
+ ### 3. Wrap your app in the theme provider
59
+
60
+ ```tsx
61
+ import { ThemeProvider } from '@konstructio/ui';
62
+
63
+ const App = () => {
64
+ return (
65
+ <ThemeProvider theme="light">
66
+ <YourApp />
67
+ </ThemeProvider>
68
+ );
69
+ };
70
+ ```
71
+
72
+ ## Usage
73
+
74
+ ```tsx
75
+ import { Alert, Button, Input, Modal, Typography } from '@konstructio/ui';
76
+
77
+ const Example = () => {
78
+ return (
79
+ <form>
80
+ <Typography variant="h3">Create instance</Typography>
81
+ <Input label="Hostname" isRequired helperText="Must be unique" />
82
+ <Button variant="primary" type="submit">
83
+ Create
84
+ </Button>
85
+ </form>
86
+ );
87
+ };
88
+ ```
89
+
90
+ Icons ship as a separate entry point:
91
+
92
+ ```tsx
93
+ import { AlertOutlineIcon, InfoCircleIcon } from '@konstructio/ui/icons';
94
+ ```
95
+
96
+ Utilities such as the `cn` class-merging helper are exported from the root:
97
+
98
+ ```tsx
99
+ import { cn } from '@konstructio/ui';
100
+
101
+ <div className={cn('flex items-center', isActive && 'bg-primary')} />;
102
+ ```
103
+
104
+ ## Theming
105
+
106
+ Four themes are available: `light` (default styling), `dark`, `kubefirst`, and `kubefirst-dark`. The active theme is applied through the `data-theme` attribute on `<body>` and persisted in a cookie.
107
+
108
+ Switch themes at runtime with the `useTheme` hook:
109
+
110
+ ```tsx
111
+ import { useTheme } from '@konstructio/ui';
112
+
113
+ const { theme, setTheme } = useTheme();
114
+ setTheme('dark');
115
+ ```
116
+
117
+ Alternatively, set `data-theme` directly on the document root — useful when the theme is controlled by a host application, such as a micro-frontend shell:
118
+
119
+ ```html
120
+ <html data-theme="dark"></html>
121
+ ```
122
+
123
+ ## Components
124
+
125
+ | Category | Components |
126
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
127
+ | Forms | Input, TextArea, Select, Checkbox, Switch, Radio, RadioGroup, RadioCard, Counter, Datepicker, TimePicker, PhoneNumberInput, Range, Slider, Autocomplete, Filter, TagSelect, MultiSelectDropdown, ImageUpload |
128
+ | UI | Button, Badge, Card, Alert, AlertDialog, Modal, Breadcrumb, Divider, Tag, Tooltip, Toast, Tabs, Typography |
129
+ | Data display | Table, VirtualizedTable, PieChart, ProgressBar, Loading, Spinner |
130
+ | Layout | Sidebar |
131
+ | Other | DropdownButton, Command |
132
+
133
+ Full documentation with live examples is available in the [Storybook](https://konstructio.github.io/konstruct-ui).
134
+
135
+ ## Development
136
+
137
+ ```bash
138
+ npm install && npm run setup # install dependencies and rebuild trusted packages
139
+ npm run storybook # dev server on http://localhost:6006
140
+ npm run test # run tests with coverage
141
+ npm run lint # lint
142
+ npm run check:types # type check
143
+ npm run build # production build
144
+ npm run ci # full CI pipeline
145
+ ```
146
+
147
+ ## License
61
148
 
62
- After completing the above steps, you can now use `@konstructio/ui` components in your project. Restart your development server to apply the changes.
149
+ [MIT](./LICENSE.md)
@@ -1,5 +1,5 @@
1
1
  import { t as i } from "./dist-xCbHbMLA.js";
2
- import { t as p } from "./utils-Cx-WzRZF.js";
2
+ import { t as p } from "./utils-B-6R7kNE.js";
3
3
  import { useSelectContext as s } from "./components/Select/contexts/select.hook.js";
4
4
  import { listGroupLabelVariants as m } from "./components/Select/components/List/List.variants.js";
5
5
  import { additionalOptionSlotClassName as l } from "./components/Select/components/AdditionalOptions/AdditionalOptions.variants.js";
@@ -1,5 +1,5 @@
1
1
  import { a as A } from "./dist-xCbHbMLA.js";
2
- import { t as m } from "./utils-Cx-WzRZF.js";
2
+ import { t as m } from "./utils-B-6R7kNE.js";
3
3
  import { i as _, r as C } from "./dist-D-yS0HN8.js";
4
4
  import { a as P, c as R, i as S, l as u, n as v, o as T, r as O, s as w, t as y } from "./dist-DO3apbIh.js";
5
5
  import { Button as h } from "./components/Button/Button.js";
@@ -1,6 +1,6 @@
1
1
  import { o as b } from "./rolldown-runtime-Dw9YIBcH.js";
2
2
  import { t as y } from "./prop-types-BCUW56rg.js";
3
- import { t as u } from "./utils-Cx-WzRZF.js";
3
+ import { t as u } from "./utils-B-6R7kNE.js";
4
4
  import { breadcrumbVariants as O, breadcrumbWrapperVariants as j } from "./components/Breadcrumb/Breadcrumb.variants.js";
5
5
  import { BackButton as w } from "./components/Breadcrumb/components/BackButton/BackButton.js";
6
6
  import { Item as _ } from "./components/Breadcrumb/components/Item/Item.js";
@@ -2,11 +2,11 @@ import { o as X } from "./rolldown-runtime-Dw9YIBcH.js";
2
2
  import { t as J } from "./prop-types-BCUW56rg.js";
3
3
  import { a as U } from "./dist-xCbHbMLA.js";
4
4
  import { t as N } from "./dist-CCdbu9GU.js";
5
- import { t as O } from "./utils-Cx-WzRZF.js";
5
+ import { t as O } from "./utils-B-6R7kNE.js";
6
6
  import { i as Q, r as S, t as Y } from "./dist-D-yS0HN8.js";
7
7
  import { t as Z } from "./dist-BUocnzkM.js";
8
8
  import { useToggle as ee } from "./hooks/useToggle.js";
9
- import { t as te } from "./dist-pWlMx4Fi2.js";
9
+ import { t as te } from "./dist-pWlMx4Fi.js";
10
10
  import { checkboxVariants as re, labelVariants as oe } from "./components/Checkbox/Checkbox.variants.js";
11
11
  import * as u from "react";
12
12
  import q, { forwardRef as A, useId as ne } from "react";
@@ -58,30 +58,30 @@ B.propTypes = {
58
58
  size: w.default.oneOfType([w.default.string, w.default.number])
59
59
  };
60
60
  B.displayName = "Check";
61
- var ie = Object.defineProperty, g = (e, o) => ie(e, "name", {
61
+ var ie = Object.defineProperty, x = (e, o) => ie(e, "name", {
62
62
  value: o,
63
63
  configurable: !0
64
64
  }), T = "Checkbox", [ue, je] = Q(T), [le, z] = ue(T);
65
65
  function D(e) {
66
- const { __scopeCheckbox: o, checked: n, children: t, defaultChecked: r, disabled: c, form: a, name: d, onCheckedChange: i, required: l, value: k = "on", internal_do_not_use_render: b } = e, [h, m] = Y({
66
+ const { __scopeCheckbox: o, checked: n, children: t, defaultChecked: r, disabled: c, form: a, name: l, onCheckedChange: s, required: d, value: C = "on", internal_do_not_use_render: m } = e, [h, k] = Y({
67
67
  prop: n,
68
68
  defaultProp: r ?? !1,
69
- onChange: i,
69
+ onChange: s,
70
70
  caller: T
71
- }), [C, x] = u.useState(null), [y, R] = u.useState(null), I = u.useRef(!1), [s, f] = u.useReducer((_) => _ + 1, 0), P = C ? !!a || !!C.closest("form") : !0, E = {
71
+ }), [v, I] = u.useState(null), [y, R] = u.useState(null), _ = u.useRef(!1), [i, f] = u.useReducer((b) => b + 1, 0), P = v ? !!a || !!v.closest("form") : !0, E = {
72
72
  checked: h,
73
73
  disabled: c,
74
- setChecked: m,
75
- control: C,
76
- setControl: x,
77
- name: d,
74
+ setChecked: k,
75
+ control: v,
76
+ setControl: I,
77
+ name: l,
78
78
  form: a,
79
- value: k,
80
- hasConsumerStoppedPropagationRef: I,
81
- userInteractionCount: s,
79
+ value: C,
80
+ hasConsumerStoppedPropagationRef: _,
81
+ userInteractionCount: i,
82
82
  onUserInteraction: f,
83
- required: l,
84
- defaultChecked: v(r) ? !1 : r,
83
+ required: d,
84
+ defaultChecked: g(r) ? !1 : r,
85
85
  isFormControl: P,
86
86
  bubbleInput: y,
87
87
  setBubbleInput: R
@@ -89,58 +89,58 @@ function D(e) {
89
89
  return /* @__PURE__ */ p(le, {
90
90
  scope: o,
91
91
  ...E,
92
- children: H(b) ? b(E) : t
92
+ children: H(m) ? m(E) : t
93
93
  });
94
94
  }
95
- g(D, "CheckboxProvider");
96
- var de = "CheckboxTrigger", fe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ g(function({ __scopeCheckbox: o, onKeyDown: n, onClick: t, ...r }, c) {
97
- const { control: a, value: d, disabled: i, checked: l, required: k, setControl: b, setChecked: h, hasConsumerStoppedPropagationRef: m, onUserInteraction: C, isFormControl: x, bubbleInput: y } = z(de, o), R = U(c, b), I = u.useRef(l);
95
+ x(D, "CheckboxProvider");
96
+ var de = "CheckboxTrigger", fe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ x(function({ __scopeCheckbox: o, onKeyDown: n, onClick: t, ...r }, c) {
97
+ const { control: a, value: l, disabled: s, checked: d, required: C, setControl: m, setChecked: h, hasConsumerStoppedPropagationRef: k, onUserInteraction: v, isFormControl: I, bubbleInput: y } = z(de, o), R = U(c, m), _ = u.useRef(d);
98
98
  return u.useEffect(() => {
99
- const s = a?.form;
100
- if (s) {
101
- const f = /* @__PURE__ */ g(() => h(I.current), "reset");
102
- return s.addEventListener("reset", f), () => s.removeEventListener("reset", f);
99
+ const i = a?.form;
100
+ if (i) {
101
+ const f = /* @__PURE__ */ x(() => h(_.current), "reset");
102
+ return i.addEventListener("reset", f), () => i.removeEventListener("reset", f);
103
103
  }
104
104
  }, [a, h]), /* @__PURE__ */ p(N.button, {
105
105
  type: "button",
106
106
  role: "checkbox",
107
- "aria-checked": v(l) ? "mixed" : l,
108
- "aria-required": k,
109
- "data-state": F(l),
110
- "data-disabled": i ? "" : void 0,
111
- disabled: i,
112
- value: d,
107
+ "aria-checked": g(d) ? "mixed" : d,
108
+ "aria-required": C,
109
+ "data-state": F(d),
110
+ "data-disabled": s ? "" : void 0,
111
+ disabled: s,
112
+ value: l,
113
113
  ...r,
114
114
  ref: R,
115
- onKeyDown: S(n, (s) => {
116
- s.key === "Enter" && s.preventDefault();
115
+ onKeyDown: S(n, (i) => {
116
+ i.key === "Enter" && i.preventDefault();
117
117
  }),
118
- onClick: S(t, (s) => {
119
- C(), h((f) => v(f) ? !0 : !f), y && x && (m.current = s.isPropagationStopped(), m.current || s.stopPropagation());
118
+ onClick: S(t, (i) => {
119
+ v(), h((f) => g(f) ? !0 : !f), y && I && (k.current = i.isPropagationStopped(), k.current || i.stopPropagation());
120
120
  })
121
121
  });
122
- }, "CheckboxTrigger")), pe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ g(function(o, n) {
123
- const { __scopeCheckbox: t, name: r, checked: c, defaultChecked: a, required: d, disabled: i, value: l, onCheckedChange: k, form: b, ...h } = o;
122
+ }, "CheckboxTrigger")), pe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ x(function(o, n) {
123
+ const { __scopeCheckbox: t, name: r, checked: c, defaultChecked: a, required: l, disabled: s, value: d, onCheckedChange: C, form: m, ...h } = o;
124
124
  return /* @__PURE__ */ p(D, {
125
125
  __scopeCheckbox: t,
126
126
  checked: c,
127
127
  defaultChecked: a,
128
- disabled: i,
129
- required: d,
130
- onCheckedChange: k,
128
+ disabled: s,
129
+ required: l,
130
+ onCheckedChange: C,
131
131
  name: r,
132
- form: b,
133
- value: l,
134
- internal_do_not_use_render: ({ isFormControl: m }) => /* @__PURE__ */ $(ce, { children: [/* @__PURE__ */ p(fe, {
132
+ form: m,
133
+ value: d,
134
+ internal_do_not_use_render: ({ isFormControl: k }) => /* @__PURE__ */ $(ce, { children: [/* @__PURE__ */ p(fe, {
135
135
  ...h,
136
136
  ref: n,
137
137
  __scopeCheckbox: t
138
- }), m && /* @__PURE__ */ p(ke, { __scopeCheckbox: t })] })
138
+ }), k && /* @__PURE__ */ p(ke, { __scopeCheckbox: t })] })
139
139
  });
140
- }, "Checkbox")), he = "CheckboxIndicator", be = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ g(function(o, n) {
140
+ }, "Checkbox")), he = "CheckboxIndicator", be = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ x(function(o, n) {
141
141
  const { __scopeCheckbox: t, forceMount: r, ...c } = o, a = z(he, t);
142
142
  return /* @__PURE__ */ p(Z, {
143
- present: r || v(a.checked) || a.checked === !0,
143
+ present: r || g(a.checked) || a.checked === !0,
144
144
  children: /* @__PURE__ */ p(N.span, {
145
145
  "data-state": F(a.checked),
146
146
  "data-disabled": a.disabled ? "" : void 0,
@@ -152,46 +152,46 @@ var de = "CheckboxTrigger", fe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ g(
152
152
  }
153
153
  })
154
154
  });
155
- }, "CheckboxIndicator")), me = "CheckboxBubbleInput", ke = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ g(function({ __scopeCheckbox: o, onClick: n, ...t }, r) {
156
- const { control: c, hasConsumerStoppedPropagationRef: a, userInteractionCount: d, checked: i, defaultChecked: l, required: k, disabled: b, name: h, value: m, form: C, bubbleInput: x, setBubbleInput: y } = z(me, o), R = U(r, y), I = te(c), s = u.useRef(!1), f = u.useRef(i), P = u.useRef(d);
155
+ }, "CheckboxIndicator")), me = "CheckboxBubbleInput", ke = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ x(function({ __scopeCheckbox: o, onClick: n, ...t }, r) {
156
+ const { control: c, hasConsumerStoppedPropagationRef: a, userInteractionCount: l, checked: s, defaultChecked: d, required: C, disabled: m, name: h, value: k, form: v, bubbleInput: I, setBubbleInput: y } = z(me, o), R = U(r, y), _ = te(c), i = u.useRef(!1), f = u.useRef(s), P = u.useRef(l);
157
157
  u.useEffect(() => {
158
- const _ = x;
159
- if (!_) return;
160
- const K = window.HTMLInputElement.prototype, L = Object.getOwnPropertyDescriptor(K, "checked").set, M = d !== P.current;
161
- P.current = d;
162
- const W = f.current !== i;
163
- f.current = i;
158
+ const b = I;
159
+ if (!b) return;
160
+ const K = window.HTMLInputElement.prototype, L = Object.getOwnPropertyDescriptor(K, "checked").set, M = l !== P.current;
161
+ P.current = l;
162
+ const W = f.current !== s;
163
+ f.current = s;
164
164
  const G = !(M && a.current);
165
165
  if (W && L) {
166
- s.current = !M;
166
+ i.current = !M;
167
167
  const V = new Event("click", { bubbles: G });
168
- _.indeterminate = v(i), L.call(_, v(i) ? !1 : i), _.dispatchEvent(V), s.current = !1;
168
+ b.indeterminate = g(s), L.call(b, g(s) ? !1 : s), b.dispatchEvent(V), i.current = !1;
169
169
  }
170
170
  }, [
171
- x,
172
- i,
171
+ I,
172
+ s,
173
173
  a,
174
- d
174
+ l
175
175
  ]);
176
- const E = u.useRef(v(i) ? !1 : i);
176
+ const E = u.useRef(g(s) ? !1 : s);
177
177
  return /* @__PURE__ */ p(N.input, {
178
178
  type: "checkbox",
179
179
  "aria-hidden": !0,
180
- defaultChecked: l ?? E.current,
181
- required: k,
182
- disabled: b,
180
+ defaultChecked: d ?? E.current,
181
+ required: C,
182
+ disabled: m,
183
183
  name: h,
184
- value: m,
185
- form: C,
184
+ value: k,
185
+ form: v,
186
186
  ...t,
187
187
  tabIndex: -1,
188
188
  ref: R,
189
- onClick: S(n, (_) => {
190
- s.current && _.stopPropagation();
189
+ onClick: S(n, (b) => {
190
+ i.current && b.stopPropagation();
191
191
  }),
192
192
  style: {
193
193
  ...t.style,
194
- ...I,
194
+ ..._,
195
195
  position: "absolute",
196
196
  pointerEvents: "none",
197
197
  opacity: 0,
@@ -203,42 +203,41 @@ var de = "CheckboxTrigger", fe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ g(
203
203
  function H(e) {
204
204
  return typeof e == "function";
205
205
  }
206
- g(H, "isFunction");
207
- function v(e) {
206
+ x(H, "isFunction");
207
+ function g(e) {
208
208
  return e === "indeterminate";
209
209
  }
210
- g(v, "isIndeterminate");
210
+ x(g, "isIndeterminate");
211
211
  function F(e) {
212
- return v(e) ? "indeterminate" : e ? "checked" : "unchecked";
212
+ return g(e) ? "indeterminate" : e ? "checked" : "unchecked";
213
213
  }
214
- g(F, "getState");
215
- var Ce = A(({ ariaLabelledBy: e, checked: o, className: n, defaultChecked: t, disabled: r, id: c, label: a, labelClassName: d, labelWrapperClassName: i, name: l, theme: k, title: b, variant: h, onChange: m, ...C }, x) => {
216
- const [y, R] = ee(t ?? !1), I = o !== void 0, s = I ? o : y, f = ne(), P = (E) => {
217
- I || R(E), m?.(E);
214
+ x(F, "getState");
215
+ var Ce = A(({ ariaLabelledBy: e, checked: o, className: n, defaultChecked: t, disabled: r, id: c, label: a, labelClassName: l, labelWrapperClassName: s, name: d, theme: C, title: m, variant: h, onChange: k, ...v }, I) => {
216
+ const [y, R] = ee(t ?? !1), _ = o !== void 0, i = _ ? o : y, f = ne(), P = c ?? f, E = (b) => {
217
+ _ || R(b), k?.(b);
218
218
  };
219
219
  return /* @__PURE__ */ $("div", {
220
- className: O("flex items-center gap-4", i),
221
- "data-theme": k,
220
+ className: O("flex items-center gap-4", s),
221
+ "data-theme": C,
222
222
  children: [/* @__PURE__ */ p(pe, {
223
- id: c ?? f,
224
- checked: s,
225
- ref: x,
226
- name: l,
223
+ id: P,
224
+ checked: i,
225
+ ref: I,
226
+ name: d,
227
227
  disabled: r,
228
228
  "aria-labelledby": e,
229
- title: b,
229
+ title: m,
230
230
  className: O(re({
231
231
  className: n,
232
232
  variant: h,
233
- checked: s
233
+ checked: i
234
234
  })),
235
- onCheckedChange: P,
236
- ...C,
235
+ onCheckedChange: E,
236
+ ...v,
237
237
  children: /* @__PURE__ */ p(be, { children: /* @__PURE__ */ p(B, { className: "w-4 h-4 stroke-2" }) })
238
238
  }), a ? /* @__PURE__ */ p("label", {
239
- htmlFor: l ?? c,
240
- className: O(oe({ className: d }), { "cursor-not-allowed": r }),
241
- onClick: () => !r && P(!s),
239
+ htmlFor: P,
240
+ className: O(oe({ className: l }), { "cursor-not-allowed": r }),
242
241
  children: a
243
242
  }) : null]
244
243
  });
@@ -1,6 +1,6 @@
1
1
  import { o as v } from "./rolldown-runtime-Dw9YIBcH.js";
2
2
  import { t as y } from "./prop-types-BCUW56rg.js";
3
- import { t as c } from "./utils-Cx-WzRZF.js";
3
+ import { t as c } from "./utils-B-6R7kNE.js";
4
4
  import { inputVariants as g, searchInconInputVariants as h } from "./components/Command/Command.variants.js";
5
5
  import { t as m } from "./dist-BbX4Nrk2.js";
6
6
  import p, { forwardRef as u } from "react";
@@ -1,7 +1,7 @@
1
1
  import { o as D } from "./rolldown-runtime-Dw9YIBcH.js";
2
2
  import { t as R } from "./prop-types-BCUW56rg.js";
3
3
  import { t as P } from "./dist-DX0sBG3Q.js";
4
- import { t as f } from "./utils-Cx-WzRZF.js";
4
+ import { t as f } from "./utils-B-6R7kNE.js";
5
5
  import { Typography as F } from "./components/Typography/Typography.js";
6
6
  import { buttonVariants as _, counterVariants as q, labelVariants as A } from "./components/Counter/Counter.variants.js";
7
7
  import m, { forwardRef as x, useId as G, useState as H } from "react";
@@ -2,7 +2,7 @@ import { o as Ae } from "./rolldown-runtime-Dw9YIBcH.js";
2
2
  import { t as Le } from "./prop-types-BCUW56rg.js";
3
3
  import { a as D, n as Fe } from "./dist-xCbHbMLA.js";
4
4
  import { n as Ne, t as se } from "./dist-CCdbu9GU.js";
5
- import { t as A } from "./utils-Cx-WzRZF.js";
5
+ import { t as A } from "./utils-B-6R7kNE.js";
6
6
  import { i as le, r as g, t as Ke } from "./dist-D-yS0HN8.js";
7
7
  import { t as ae } from "./dist-DYIabsrY.js";
8
8
  import { t as je } from "./dist-D5XYRjmR.js";
@@ -11,10 +11,10 @@ import { n as Ue, r as Be, t as $e } from "./es2015-CoHq2g4y.js";
11
11
  import { t as Ve } from "./dist-BUocnzkM.js";
12
12
  import { t as ze } from "./Combination-CnMM05mt.js";
13
13
  import { Button as We } from "./components/Button/Button.js";
14
- import { t as Ye } from "./dist-DwxO2RoR2.js";
15
- import { t as Xe } from "./dist-DGOjiAnB2.js";
16
- import { a as de, i as He, r as qe, t as Ze } from "./dist-Z0F27ATp2.js";
17
- import { n as Je, r as fe, t as Qe } from "./dist-C87gsBDM.js";
14
+ import { t as Ye } from "./dist-DwxO2RoR.js";
15
+ import { t as Xe } from "./dist-DGOjiAnB.js";
16
+ import { a as de, i as He, r as qe, t as Ze } from "./dist-9WbMf_jT.js";
17
+ import { n as Je, r as fe, t as Qe } from "./dist-CszFjHAP.js";
18
18
  import * as i from "react";
19
19
  import ce, { forwardRef as et } from "react";
20
20
  import { jsx as s, jsxs as ie } from "react/jsx-runtime";