@konstructio/ui 0.1.2-alpha.105 → 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.
- package/README.md +118 -31
- package/dist/{AdditionalOptions-D0BAS2HG.js → AdditionalOptions-Crcnz0_g.js} +1 -1
- package/dist/{AlertDialogTrigger-BGo_acd5.js → AlertDialogTrigger-ouMGAlJW.js} +39 -39
- package/dist/{Breadcrumb-Cp3abB2w.js → Breadcrumb-MrF1Z6w2.js} +3 -3
- package/dist/{Checkbox-B_ngk9Dj.js → Checkbox-8KnRLpQG.js} +60 -61
- package/dist/{CommandInput-BLq69pOT.js → CommandInput-CGnqfudl.js} +4 -4
- package/dist/{Counter-BV680M5r.js → Counter-CDXdP1Af.js} +3 -3
- package/dist/{DayPicker-kweJz134.js → DayPicker-C22j0Y-u.js} +539 -518
- package/dist/{DropdownButton-DfNojmCW.js → DropdownButton-D4QlKGg7.js} +7 -7
- package/dist/{FlagSelectorList-CkTR3j6O.js → FlagSelectorList-tYZNl-tz.js} +31 -24
- package/dist/{HamburgerTrigger-DRylBL2d.js → HamburgerTrigger-B_NGSZ2r.js} +20 -20
- package/dist/{ImageUpload-DiwymQcU.js → ImageUpload-D7HKSXK8.js} +71 -66
- package/dist/Input-is8n7emP.js +195 -0
- package/dist/{Loading-DUh9PMJN.js → Loading-DO8JOWBV.js} +1 -1
- package/dist/{Modal-Dyn088X7.js → Modal-Dq9BHD_9.js} +4 -4
- package/dist/{Spinner-CUwE2bLm.js → Spinner-BJE79VTl.js} +1 -1
- package/dist/{StepIndicatorContent-CjbjVjS1.js → StepIndicatorContent-BGDvxLzV.js} +1 -1
- package/dist/Switch-C7286Bcu.js +199 -0
- package/dist/{Toast-3NEz7LLa.js → Toast-jSx3Lao8.js} +8 -7
- package/dist/Wrapper-2AUlYAHQ.js +195 -0
- package/dist/{Wrapper-CVJSuYWx.js → Wrapper-CyHxGs4E.js} +4 -4
- package/dist/{Wrapper-DP6Sxngx.js → Wrapper-a7RVCcrn.js} +248 -242
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/components/Autocomplete/components/List/List.js +1 -1
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +27 -25
- package/dist/components/Autocomplete/hooks/useNavigationList.js +2 -3
- package/dist/components/Badge/Badge.js +2 -2
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/BackButton/BackButton.js +2 -2
- package/dist/components/Breadcrumb/components/Item/Item.js +2 -2
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +65 -60
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +2 -2
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.js +10 -9
- package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.js +8 -6
- package/dist/components/Card/Card.js +25 -22
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +2 -2
- package/dist/components/Command/components/CommandInput.js +1 -1
- package/dist/components/Command/components/CommandItem.js +2 -2
- package/dist/components/Command/components/CommandList.js +2 -2
- package/dist/components/Command/components/CommandSeparator.js +2 -2
- package/dist/components/Command/components/CommandShortcut.js +1 -1
- package/dist/components/Command/components/DialogContent.js +3 -3
- package/dist/components/Command/components/DialogOverlay.js +2 -2
- package/dist/components/Command/components/index.js +1 -1
- package/dist/components/Counter/Counter.js +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarDivider/CalendarDivider.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +3 -3
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +3 -3
- package/dist/components/DateRangePicker/components/CalendarPanel/components/NavigationButton/NavigationButton.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +2 -2
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +30 -28
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +23 -21
- package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +48 -41
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +48 -41
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +2 -2
- package/dist/components/Divider/Divider.js +7 -7
- package/dist/components/Drawer/Drawer.js +28 -26
- package/dist/components/Drawer/components/Body/Body.js +1 -1
- package/dist/components/Drawer/components/Footer/Footer.js +1 -1
- package/dist/components/Drawer/components/Header/Header.js +1 -1
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +51 -36
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +40 -38
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +1 -1
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.js +1 -1
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +2 -2
- package/dist/components/Filter/components/ResetButton/ResetButton.js +1 -1
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +43 -41
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +1 -1
- package/dist/components/Filter/utils/index.js +1 -1
- package/dist/components/ImageUpload/ImageUpload.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/LineChart/LineChart.js +2 -2
- package/dist/components/Loading/Loading.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +1 -1
- package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/MultiSelectDropdown/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +4 -3
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +17 -16
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +11 -11
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +3 -3
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +3 -3
- package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
- package/dist/components/PhoneNumberInput/components/index.js +2 -2
- package/dist/components/PhoneNumberInput/contexts/index.js +1 -1
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1 -1
- package/dist/components/PhoneNumberInput/utils/index.js +1 -1
- package/dist/components/PieChart/PieChart.js +31 -28
- package/dist/components/ProgressBar/ProgressBar.js +1 -1
- package/dist/components/Radio/Radio.js +1 -1
- package/dist/components/RadioCard/RadioCard.js +1 -1
- package/dist/components/RadioCardGroup/RadioCardGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +2 -2
- package/dist/components/Select/Select.js +43 -36
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +1 -1
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.variants.js +1 -1
- package/dist/components/Select/components/List/List.js +78 -67
- package/dist/components/Select/components/ListItem/ListItem.js +1 -1
- package/dist/components/Select/components/Wrapper.js +1 -1
- package/dist/components/Select/components/index.js +2 -2
- package/dist/components/Select/hooks/useNavigationList.js +2 -3
- package/dist/components/Select/hooks/useSelect.js +8 -8
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.js +1 -1
- package/dist/components/Sidebar/components/Footer/Footer.js +1 -1
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
- package/dist/components/Sidebar/components/Label/Label.js +1 -1
- package/dist/components/Sidebar/components/Logo/Logo.js +1 -1
- package/dist/components/Sidebar/components/Navigation/Navigation.js +1 -1
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +1 -1
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +2 -2
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +1 -1
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +1 -1
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +25 -24
- package/dist/components/Sidebar/components/index.js +1 -1
- package/dist/components/Slider/Slider.js +2 -2
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Stepper/Stepper.js +1 -1
- package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +2 -2
- package/dist/components/Stepper/components/StepConnector/StepConnector.js +1 -1
- package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +1 -1
- package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +2 -2
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Switch/Switch.variants.js +15 -7
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/components/Body.js +1 -1
- package/dist/components/Table/components/Filter.js +1 -1
- package/dist/components/Table/components/Head.js +1 -1
- package/dist/components/Table/components/Row.js +1 -1
- package/dist/components/Tabs/Tabs.js +2 -2
- package/dist/components/Tabs/components/Content.js +2 -2
- package/dist/components/Tabs/components/List.js +2 -2
- package/dist/components/Tabs/components/Trigger.js +2 -2
- package/dist/components/Tag/Tag.js +8 -8
- package/dist/components/TagSelect/TagSelect.js +1 -1
- package/dist/components/TagSelect/components/Item/Item.js +1 -1
- package/dist/components/TagSelect/components/List/List.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/TagSelect/components/index.js +1 -1
- package/dist/components/TagSelect/hooks/useTagSelect.js +11 -11
- package/dist/components/TextArea/TextArea.js +71 -26
- package/dist/components/TextArea/TextArea.variants.js +49 -13
- package/dist/components/TimePicker/components/HoursList/HoursList.js +1 -1
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +1 -1
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +1 -1
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +114 -99
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +19 -18
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +2 -2
- package/dist/components/Typography/Typography.js +19 -16
- package/dist/components/VirtualizedTable/VirtualizedTable.js +2 -2
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +1 -1
- package/dist/components/VirtualizedTable/components/Body/Body.js +2 -2
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +2 -2
- package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +1 -1
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +4 -4
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Header/Header.js +2 -2
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +1 -1
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +3 -3
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +1 -1
- package/dist/components/VirtualizedTable/contexts/index.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
- package/dist/components/index.js +12 -12
- package/dist/{components-Cf345jTv.js → components-CaEW5ge4.js} +32 -32
- package/dist/{constants-CxJJRVK3.js → constants-HQIXhj2t.js} +2 -2
- package/dist/contexts/index.js +1 -1
- package/dist/contexts/theme.provider.js +1 -1
- package/dist/{debounce-C5Ycjilj.js → debounce-BdyZeJQk.js} +2 -2
- package/dist/{dist-DFCz63oC2.js → dist-9WbMf_jT.js} +158 -159
- package/dist/{dist-tGUUcv8n.js → dist-AxOGvL82.js} +114 -115
- package/dist/{dist-DDck_2lb.js → dist-BIBFLVt1.js} +117 -116
- package/dist/{dist-BZNE2Tnx.js → dist-BbX4Nrk2.js} +1 -1
- package/dist/{dist-BaPW7qXd2.js → dist-BnCbAI-c.js} +1 -1
- package/dist/{dist-BdobXn93.js → dist-CszFjHAP.js} +2 -2
- package/dist/{dist-C3YVLapk.js → dist-DO3apbIh.js} +24 -24
- package/dist/{dist-CzKqHuqJ2.js → dist-DwxO2RoR.js} +38 -38
- package/dist/{dist-AihTpWdF.js → dist-iUAHw-3y.js} +272 -272
- package/dist/{dist-BlPTJNIm.js → dist-pxvIAJzo.js} +2 -2
- package/dist/es2015-B_07N-UL.js +796 -0
- package/dist/hooks/useMediaQuery.js +1 -1
- package/dist/index.js +14 -14
- package/dist/{isObject-BeFFiVJK.js → isObject-pLoSfdr0.js} +1 -1
- package/dist/lib/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.types.d.ts +1 -1
- package/dist/lib/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.types.d.ts +2 -0
- package/dist/lib/components/Card/Card.types.d.ts +1 -0
- package/dist/lib/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/lib/components/Checkbox/Checkbox.types.d.ts +2 -1
- package/dist/lib/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.types.d.ts +1 -0
- package/dist/lib/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.types.d.ts +1 -0
- package/dist/lib/components/Divider/Divider.d.ts +3 -2
- package/dist/lib/components/Divider/Divider.types.d.ts +4 -0
- package/dist/lib/components/Input/Input.types.d.ts +4 -0
- package/dist/lib/components/MultiSelectDropdown/MultiSelectDropdown.types.d.ts +2 -0
- package/dist/lib/components/MultiSelectDropdown/contexts/MultiSelectDropdown.types.d.ts +2 -0
- package/dist/lib/components/Select/Select.types.d.ts +2 -0
- package/dist/lib/components/Select/components/List/List.types.d.ts +3 -0
- package/dist/lib/components/Select/components/Wrapper.d.ts +2 -0
- package/dist/lib/components/Sidebar/Sidebar.types.d.ts +2 -0
- package/dist/lib/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.types.d.ts +2 -0
- package/dist/lib/components/Switch/Switch.variants.d.ts +3 -1
- package/dist/lib/components/Tag/Tag.types.d.ts +1 -0
- package/dist/lib/components/TextArea/TextArea.d.ts +6 -0
- package/dist/lib/components/TextArea/TextArea.types.d.ts +13 -2
- package/dist/lib/components/TextArea/TextArea.variants.d.ts +4 -1
- package/dist/lib/components/TimePicker/TimePicker.types.d.ts +4 -0
- package/dist/lib/components/TimePicker/components/WrapperList/WrapperList.types.d.ts +1 -0
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/{libphonenumber-hGupNnJu.js → libphonenumber-BMq3Thej.js} +356 -347
- package/dist/package.json +27 -27
- package/dist/{phone-number.provider-BxQCTxp8.js → phone-number.provider-Dkq_p1Gi.js} +2 -2
- package/dist/{prop-types-CfEYxTbR.js → prop-types-BCUW56rg.js} +1 -1
- package/dist/{react-CvUtBTMg.js → react-7zQ6bvbE.js} +837 -828
- package/dist/{rolldown-runtime-Ck3dxwZt.js → rolldown-runtime-Dw9YIBcH.js} +1 -1
- package/dist/styles.css +1 -1
- package/dist/{table.provider-B0BafHuU.js → table.provider-CWzODR1t.js} +96 -96
- package/dist/{theme.provider-Dw4O3ocC.js → theme.provider-CSL1WCYG.js} +1 -1
- package/dist/{useBreadcrumb-DYfZL_2p.js → useBreadcrumb-Ds_9BeFz.js} +7 -6
- package/dist/utils/index.js +6 -5
- package/dist/{utils-Cx-WzRZF.js → utils-B-6R7kNE.js} +8 -4
- package/dist/{utils-B-BTGYA5.js → utils-DVYdP0CJ.js} +2 -3
- package/dist/{x-BI9jmc7e.js → x-Ierxf0uI.js} +2 -2
- package/package.json +27 -27
- package/dist/Input-Cf44DzfE.js +0 -188
- package/dist/Switch-aPhL5rNG.js +0 -196
- package/dist/Wrapper-R8fik3ah.js +0 -182
- package/dist/es2015-DigR3dar.js +0 -795
- /package/dist/{dist-DGOjiAnB2.js → dist-DGOjiAnB.js} +0 -0
- /package/dist/{dist-pWlMx4Fi2.js → dist-pWlMx4Fi.js} +0 -0
- /package/dist/{x-a_LpoXzG2.js → x-a_LpoXzG.js} +0 -0
package/README.md
CHANGED
|
@@ -1,62 +1,149 @@
|
|
|
1
|
-
|
|
2
|
-
>
|
|
3
|
-
> ⚠️ This library is currently under construction. Features may change and documentation is incomplete. ⚠️
|
|
1
|
+
# @konstructio/ui
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@konstructio/ui)
|
|
4
|
+
[](./LICENSE.md)
|
|
5
|
+
[](https://konstructio.github.io/konstruct-ui)
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
9
|
+
> **Note**: This library is in active development (alpha). APIs may change between releases.
|
|
10
10
|
|
|
11
|
-
|
|
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
|
-
|
|
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
|
-
|
|
19
|
+
## Requirements
|
|
20
20
|
|
|
21
|
-
|
|
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
|
-
|
|
28
|
+
## Installation
|
|
24
29
|
|
|
25
30
|
```bash
|
|
26
31
|
npm install @konstructio/ui
|
|
27
32
|
```
|
|
28
33
|
|
|
29
|
-
|
|
34
|
+
## Setup
|
|
30
35
|
|
|
31
|
-
###
|
|
36
|
+
### 1. Import the styles
|
|
32
37
|
|
|
33
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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-
|
|
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,52 +1,52 @@
|
|
|
1
1
|
import { a as A } from "./dist-xCbHbMLA.js";
|
|
2
|
-
import { t as
|
|
3
|
-
import { i as
|
|
4
|
-
import { a as
|
|
5
|
-
import { Button as
|
|
2
|
+
import { t as m } from "./utils-B-6R7kNE.js";
|
|
3
|
+
import { i as _, r as C } from "./dist-D-yS0HN8.js";
|
|
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
|
+
import { Button as h } from "./components/Button/Button.js";
|
|
6
6
|
import * as n from "react";
|
|
7
|
-
import { forwardRef as
|
|
7
|
+
import { forwardRef as x } from "react";
|
|
8
8
|
import { jsx as i } from "react/jsx-runtime";
|
|
9
|
-
var
|
|
9
|
+
var b = Object.defineProperty, c = (l, o) => b(l, "name", {
|
|
10
10
|
value: o,
|
|
11
11
|
configurable: !0
|
|
12
|
-
}), [
|
|
12
|
+
}), [E, Y] = _("AlertDialog", [u]), s = u(), N = /* @__PURE__ */ c((l) => {
|
|
13
13
|
const { __scopeAlertDialog: o, ...r } = l, e = s(o);
|
|
14
|
-
return /* @__PURE__ */ i(
|
|
14
|
+
return /* @__PURE__ */ i(y, {
|
|
15
15
|
...e,
|
|
16
16
|
...r,
|
|
17
17
|
modal: !0
|
|
18
18
|
});
|
|
19
|
-
}, "AlertDialog"),
|
|
19
|
+
}, "AlertDialog"), j = n.forwardRef(/* @__PURE__ */ c(function(o, r) {
|
|
20
20
|
const { __scopeAlertDialog: e, ...a } = o, t = s(e);
|
|
21
|
-
return /* @__PURE__ */ i(
|
|
21
|
+
return /* @__PURE__ */ i(R, {
|
|
22
22
|
...t,
|
|
23
23
|
...a,
|
|
24
24
|
ref: r
|
|
25
25
|
});
|
|
26
|
-
}, "AlertDialogTrigger")),
|
|
26
|
+
}, "AlertDialogTrigger")), F = /* @__PURE__ */ c((l) => {
|
|
27
27
|
const { __scopeAlertDialog: o, ...r } = l, e = s(o);
|
|
28
|
-
return /* @__PURE__ */ i(
|
|
28
|
+
return /* @__PURE__ */ i(T, {
|
|
29
29
|
...e,
|
|
30
30
|
...r
|
|
31
31
|
});
|
|
32
|
-
}, "AlertDialogPortal"),
|
|
32
|
+
}, "AlertDialogPortal"), $ = n.forwardRef(/* @__PURE__ */ c(function(o, r) {
|
|
33
33
|
const { __scopeAlertDialog: e, ...a } = o, t = s(e);
|
|
34
|
-
return /* @__PURE__ */ i(
|
|
34
|
+
return /* @__PURE__ */ i(P, {
|
|
35
35
|
...t,
|
|
36
36
|
...a,
|
|
37
37
|
ref: r
|
|
38
38
|
});
|
|
39
|
-
}, "AlertDialogOverlay")), [
|
|
40
|
-
const { __scopeAlertDialog: e, children: a, ...t } = o, g = s(e), p =
|
|
41
|
-
return /* @__PURE__ */ i(
|
|
39
|
+
}, "AlertDialogOverlay")), [k, B] = E("AlertDialogContent"), H = n.forwardRef(/* @__PURE__ */ c(function(o, r) {
|
|
40
|
+
const { __scopeAlertDialog: e, children: a, ...t } = o, g = s(e), p = n.useRef(null), d = A(r, p), f = n.useRef(null);
|
|
41
|
+
return /* @__PURE__ */ i(k, {
|
|
42
42
|
scope: e,
|
|
43
43
|
cancelRef: f,
|
|
44
|
-
children: /* @__PURE__ */ i(
|
|
44
|
+
children: /* @__PURE__ */ i(O, {
|
|
45
45
|
role: "alertdialog",
|
|
46
46
|
...g,
|
|
47
47
|
...t,
|
|
48
|
-
ref:
|
|
49
|
-
onOpenAutoFocus:
|
|
48
|
+
ref: d,
|
|
49
|
+
onOpenAutoFocus: C(t.onOpenAutoFocus, (D) => {
|
|
50
50
|
D.preventDefault(), f.current?.focus({ preventScroll: !0 });
|
|
51
51
|
}),
|
|
52
52
|
onPointerDownOutside: (D) => D.preventDefault(),
|
|
@@ -54,42 +54,42 @@ var x = Object.defineProperty, c = (l, o) => x(l, "name", {
|
|
|
54
54
|
children: a
|
|
55
55
|
})
|
|
56
56
|
});
|
|
57
|
-
}, "AlertDialogContent")),
|
|
57
|
+
}, "AlertDialogContent")), I = n.forwardRef(/* @__PURE__ */ c(function(o, r) {
|
|
58
58
|
const { __scopeAlertDialog: e, ...a } = o, t = s(e);
|
|
59
|
-
return /* @__PURE__ */ i(
|
|
59
|
+
return /* @__PURE__ */ i(w, {
|
|
60
60
|
...t,
|
|
61
61
|
...a,
|
|
62
62
|
ref: r
|
|
63
63
|
});
|
|
64
|
-
}, "AlertDialogTitle")),
|
|
64
|
+
}, "AlertDialogTitle")), L = n.forwardRef(/* @__PURE__ */ c(function(o, r) {
|
|
65
65
|
const { __scopeAlertDialog: e, ...a } = o, t = s(e);
|
|
66
|
-
return /* @__PURE__ */ i(
|
|
66
|
+
return /* @__PURE__ */ i(S, {
|
|
67
67
|
...t,
|
|
68
68
|
...a,
|
|
69
69
|
ref: r
|
|
70
70
|
});
|
|
71
|
-
}, "AlertDialogDescription")),
|
|
71
|
+
}, "AlertDialogDescription")), M = n.forwardRef(/* @__PURE__ */ c(function(o, r) {
|
|
72
72
|
const { __scopeAlertDialog: e, ...a } = o, t = s(e);
|
|
73
73
|
return /* @__PURE__ */ i(v, {
|
|
74
74
|
...t,
|
|
75
75
|
...a,
|
|
76
76
|
ref: r
|
|
77
77
|
});
|
|
78
|
-
}, "AlertDialogAction")),
|
|
79
|
-
const { __scopeAlertDialog: e, ...a } = o, { cancelRef: t } =
|
|
78
|
+
}, "AlertDialogAction")), q = "AlertDialogCancel", z = n.forwardRef(/* @__PURE__ */ c(function(o, r) {
|
|
79
|
+
const { __scopeAlertDialog: e, ...a } = o, { cancelRef: t } = B(q, e), g = s(e), p = A(r, t);
|
|
80
80
|
return /* @__PURE__ */ i(v, {
|
|
81
81
|
...g,
|
|
82
82
|
...a,
|
|
83
83
|
ref: p
|
|
84
84
|
});
|
|
85
|
-
}, "AlertDialogCancel")),
|
|
85
|
+
}, "AlertDialogCancel")), Z = N, G = j, oo = F, eo = $, ro = H, to = M, ao = z, lo = I, io = L, no = x(({ "data-theme": l, className: o, text: r, variant: e, onOpen: a, onClick: t }, g) => /* @__PURE__ */ i(G, {
|
|
86
86
|
asChild: !0,
|
|
87
|
-
children: /* @__PURE__ */ i(
|
|
87
|
+
children: /* @__PURE__ */ i(h, {
|
|
88
88
|
ref: g,
|
|
89
89
|
type: "button",
|
|
90
90
|
variant: e,
|
|
91
91
|
"data-theme": l,
|
|
92
|
-
className:
|
|
92
|
+
className: m(o),
|
|
93
93
|
onClick: () => {
|
|
94
94
|
a(), t?.();
|
|
95
95
|
},
|
|
@@ -97,13 +97,13 @@ var x = Object.defineProperty, c = (l, o) => x(l, "name", {
|
|
|
97
97
|
})
|
|
98
98
|
}));
|
|
99
99
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
io as a,
|
|
101
|
+
Z as c,
|
|
102
|
+
ro as i,
|
|
103
|
+
lo as l,
|
|
104
|
+
to as n,
|
|
105
|
+
eo as o,
|
|
106
|
+
ao as r,
|
|
107
|
+
oo as s,
|
|
108
|
+
no as t
|
|
109
109
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as b } from "./rolldown-runtime-
|
|
2
|
-
import { t as y } from "./prop-types-
|
|
3
|
-
import { t as u } from "./utils-
|
|
1
|
+
import { o as b } from "./rolldown-runtime-Dw9YIBcH.js";
|
|
2
|
+
import { t as y } from "./prop-types-BCUW56rg.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";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { o as X } from "./rolldown-runtime-
|
|
2
|
-
import { t as J } from "./prop-types-
|
|
1
|
+
import { o as X } from "./rolldown-runtime-Dw9YIBcH.js";
|
|
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-
|
|
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-
|
|
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";
|
|
13
|
-
import { Fragment as ce, jsx as
|
|
13
|
+
import { Fragment as ce, jsx as p, jsxs as $ } from "react/jsx-runtime";
|
|
14
14
|
var w = /* @__PURE__ */ X(J());
|
|
15
15
|
function j() {
|
|
16
16
|
return j = Object.assign || function(e) {
|
|
@@ -63,45 +63,45 @@ var ie = Object.defineProperty, x = (e, o) => ie(e, "name", {
|
|
|
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: l, onCheckedChange: s, required: d, value: C = "on", internal_do_not_use_render:
|
|
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
69
|
onChange: s,
|
|
70
70
|
caller: T
|
|
71
|
-
}), [v,
|
|
72
|
-
checked:
|
|
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
|
+
checked: h,
|
|
73
73
|
disabled: c,
|
|
74
|
-
setChecked:
|
|
74
|
+
setChecked: k,
|
|
75
75
|
control: v,
|
|
76
|
-
setControl:
|
|
76
|
+
setControl: I,
|
|
77
77
|
name: l,
|
|
78
78
|
form: a,
|
|
79
79
|
value: C,
|
|
80
80
|
hasConsumerStoppedPropagationRef: _,
|
|
81
81
|
userInteractionCount: i,
|
|
82
|
-
onUserInteraction:
|
|
82
|
+
onUserInteraction: f,
|
|
83
83
|
required: d,
|
|
84
84
|
defaultChecked: g(r) ? !1 : r,
|
|
85
85
|
isFormControl: P,
|
|
86
86
|
bubbleInput: y,
|
|
87
87
|
setBubbleInput: R
|
|
88
88
|
};
|
|
89
|
-
return /* @__PURE__ */
|
|
89
|
+
return /* @__PURE__ */ p(le, {
|
|
90
90
|
scope: o,
|
|
91
91
|
...E,
|
|
92
|
-
children: H(
|
|
92
|
+
children: H(m) ? m(E) : t
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
x(D, "CheckboxProvider");
|
|
96
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:
|
|
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
99
|
const i = a?.form;
|
|
100
100
|
if (i) {
|
|
101
|
-
const
|
|
102
|
-
return i.addEventListener("reset",
|
|
101
|
+
const f = /* @__PURE__ */ x(() => h(_.current), "reset");
|
|
102
|
+
return i.addEventListener("reset", f), () => i.removeEventListener("reset", f);
|
|
103
103
|
}
|
|
104
|
-
}, [a,
|
|
104
|
+
}, [a, h]), /* @__PURE__ */ p(N.button, {
|
|
105
105
|
type: "button",
|
|
106
106
|
role: "checkbox",
|
|
107
107
|
"aria-checked": g(d) ? "mixed" : d,
|
|
@@ -116,12 +116,12 @@ var de = "CheckboxTrigger", fe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ x(
|
|
|
116
116
|
i.key === "Enter" && i.preventDefault();
|
|
117
117
|
}),
|
|
118
118
|
onClick: S(t, (i) => {
|
|
119
|
-
v(),
|
|
119
|
+
v(), h((f) => g(f) ? !0 : !f), y && I && (k.current = i.isPropagationStopped(), k.current || i.stopPropagation());
|
|
120
120
|
})
|
|
121
121
|
});
|
|
122
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:
|
|
124
|
-
return /* @__PURE__ */
|
|
123
|
+
const { __scopeCheckbox: t, name: r, checked: c, defaultChecked: a, required: l, disabled: s, value: d, onCheckedChange: C, form: m, ...h } = o;
|
|
124
|
+
return /* @__PURE__ */ p(D, {
|
|
125
125
|
__scopeCheckbox: t,
|
|
126
126
|
checked: c,
|
|
127
127
|
defaultChecked: a,
|
|
@@ -129,19 +129,19 @@ var de = "CheckboxTrigger", fe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ x(
|
|
|
129
129
|
required: l,
|
|
130
130
|
onCheckedChange: C,
|
|
131
131
|
name: r,
|
|
132
|
-
form:
|
|
132
|
+
form: m,
|
|
133
133
|
value: d,
|
|
134
|
-
internal_do_not_use_render: ({ isFormControl:
|
|
135
|
-
...
|
|
134
|
+
internal_do_not_use_render: ({ isFormControl: k }) => /* @__PURE__ */ $(ce, { children: [/* @__PURE__ */ p(fe, {
|
|
135
|
+
...h,
|
|
136
136
|
ref: n,
|
|
137
137
|
__scopeCheckbox: t
|
|
138
|
-
}),
|
|
138
|
+
}), k && /* @__PURE__ */ p(ke, { __scopeCheckbox: t })] })
|
|
139
139
|
});
|
|
140
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
|
-
return /* @__PURE__ */
|
|
142
|
+
return /* @__PURE__ */ p(Z, {
|
|
143
143
|
present: r || g(a.checked) || a.checked === !0,
|
|
144
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ p(N.span, {
|
|
145
145
|
"data-state": F(a.checked),
|
|
146
146
|
"data-disabled": a.disabled ? "" : void 0,
|
|
147
147
|
...c,
|
|
@@ -153,41 +153,41 @@ var de = "CheckboxTrigger", fe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ x(
|
|
|
153
153
|
})
|
|
154
154
|
});
|
|
155
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:
|
|
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
|
|
159
|
-
if (!
|
|
158
|
+
const b = I;
|
|
159
|
+
if (!b) return;
|
|
160
160
|
const K = window.HTMLInputElement.prototype, L = Object.getOwnPropertyDescriptor(K, "checked").set, M = l !== P.current;
|
|
161
161
|
P.current = l;
|
|
162
|
-
const W =
|
|
163
|
-
|
|
162
|
+
const W = f.current !== s;
|
|
163
|
+
f.current = s;
|
|
164
164
|
const G = !(M && a.current);
|
|
165
165
|
if (W && L) {
|
|
166
166
|
i.current = !M;
|
|
167
167
|
const V = new Event("click", { bubbles: G });
|
|
168
|
-
|
|
168
|
+
b.indeterminate = g(s), L.call(b, g(s) ? !1 : s), b.dispatchEvent(V), i.current = !1;
|
|
169
169
|
}
|
|
170
170
|
}, [
|
|
171
|
-
|
|
171
|
+
I,
|
|
172
172
|
s,
|
|
173
173
|
a,
|
|
174
174
|
l
|
|
175
175
|
]);
|
|
176
176
|
const E = u.useRef(g(s) ? !1 : s);
|
|
177
|
-
return /* @__PURE__ */
|
|
177
|
+
return /* @__PURE__ */ p(N.input, {
|
|
178
178
|
type: "checkbox",
|
|
179
179
|
"aria-hidden": !0,
|
|
180
180
|
defaultChecked: d ?? E.current,
|
|
181
181
|
required: C,
|
|
182
|
-
disabled:
|
|
183
|
-
name:
|
|
184
|
-
value:
|
|
182
|
+
disabled: m,
|
|
183
|
+
name: h,
|
|
184
|
+
value: k,
|
|
185
185
|
form: v,
|
|
186
186
|
...t,
|
|
187
187
|
tabIndex: -1,
|
|
188
188
|
ref: R,
|
|
189
|
-
onClick: S(n, (
|
|
190
|
-
i.current &&
|
|
189
|
+
onClick: S(n, (b) => {
|
|
190
|
+
i.current && b.stopPropagation();
|
|
191
191
|
}),
|
|
192
192
|
style: {
|
|
193
193
|
...t.style,
|
|
@@ -212,34 +212,33 @@ function F(e) {
|
|
|
212
212
|
return g(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
213
213
|
}
|
|
214
214
|
x(F, "getState");
|
|
215
|
-
var Ce = A(({ ariaLabelledBy: e,
|
|
216
|
-
const [
|
|
217
|
-
|
|
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",
|
|
221
|
-
"data-theme":
|
|
222
|
-
children: [/* @__PURE__ */
|
|
223
|
-
id:
|
|
224
|
-
checked:
|
|
225
|
-
ref:
|
|
226
|
-
name:
|
|
227
|
-
disabled:
|
|
220
|
+
className: O("flex items-center gap-4", s),
|
|
221
|
+
"data-theme": C,
|
|
222
|
+
children: [/* @__PURE__ */ p(pe, {
|
|
223
|
+
id: P,
|
|
224
|
+
checked: i,
|
|
225
|
+
ref: I,
|
|
226
|
+
name: d,
|
|
227
|
+
disabled: r,
|
|
228
228
|
"aria-labelledby": e,
|
|
229
|
-
title:
|
|
229
|
+
title: m,
|
|
230
230
|
className: O(re({
|
|
231
|
-
className:
|
|
231
|
+
className: n,
|
|
232
232
|
variant: h,
|
|
233
|
-
checked:
|
|
233
|
+
checked: i
|
|
234
234
|
})),
|
|
235
|
-
onCheckedChange:
|
|
236
|
-
...
|
|
237
|
-
children: /* @__PURE__ */
|
|
238
|
-
}),
|
|
239
|
-
htmlFor:
|
|
240
|
-
className: O(oe({ className:
|
|
241
|
-
|
|
242
|
-
children: c
|
|
235
|
+
onCheckedChange: E,
|
|
236
|
+
...v,
|
|
237
|
+
children: /* @__PURE__ */ p(be, { children: /* @__PURE__ */ p(B, { className: "w-4 h-4 stroke-2" }) })
|
|
238
|
+
}), a ? /* @__PURE__ */ p("label", {
|
|
239
|
+
htmlFor: P,
|
|
240
|
+
className: O(oe({ className: l }), { "cursor-not-allowed": r }),
|
|
241
|
+
children: a
|
|
243
242
|
}) : null]
|
|
244
243
|
});
|
|
245
244
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { o as v } from "./rolldown-runtime-
|
|
2
|
-
import { t as y } from "./prop-types-
|
|
3
|
-
import { t as c } from "./utils-
|
|
1
|
+
import { o as v } from "./rolldown-runtime-Dw9YIBcH.js";
|
|
2
|
+
import { t as y } from "./prop-types-BCUW56rg.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
|
-
import { t as m } from "./dist-
|
|
5
|
+
import { t as m } from "./dist-BbX4Nrk2.js";
|
|
6
6
|
import p, { forwardRef as u } from "react";
|
|
7
7
|
import { jsx as f, jsxs as b } from "react/jsx-runtime";
|
|
8
8
|
var a = /* @__PURE__ */ v(y());
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { o as D } from "./rolldown-runtime-
|
|
2
|
-
import { t as R } from "./prop-types-
|
|
1
|
+
import { o as D } from "./rolldown-runtime-Dw9YIBcH.js";
|
|
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-
|
|
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";
|