@koide-labs/ui 0.0.0 → 0.0.2
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 +53 -3
- package/{src/-types.ts → dist/-types.d.ts} +1 -6
- package/dist/-types.js +1 -0
- package/dist/-utils.d.ts +19 -0
- package/dist/-utils.js +33 -0
- package/dist/Button-DrPFFzo7.js +31 -0
- package/dist/CompositeRoot-CVk5a-pR.js +233 -0
- package/dist/DirectionContext-C2o_MF_i.js +9 -0
- package/dist/FieldItemContext-DAvk99to.js +11 -0
- package/dist/FloatingPortal-tWyuKRSN.js +435 -0
- package/dist/FloatingPortalLite-DVyq6YhV.js +28 -0
- package/dist/InternalBackdrop-jYAiOJ8v.js +574 -0
- package/dist/LabelableContext-BMvjVwor.js +169 -0
- package/dist/ToolbarRootContext-CvvL0Tk1.js +9 -0
- package/dist/clamp-D0KDAQIz.js +6 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/accordion/index.d.ts +12 -0
- package/dist/components/accordion/index.js +699 -0
- package/dist/components/alert-dialog/index.d.ts +26 -0
- package/dist/components/alert-dialog/index.js +136 -0
- package/dist/components/anchor/index.d.ts +8 -0
- package/dist/components/anchor/index.js +38 -0
- package/dist/components/avatar/index.d.ts +21 -0
- package/dist/components/avatar/index.js +161 -0
- package/dist/components/badge/index.d.ts +16 -0
- package/dist/components/badge/index.js +40 -0
- package/dist/components/button/index.d.ts +24 -0
- package/dist/components/button/index.js +47 -0
- package/dist/components/checkbox/index.d.ts +9 -0
- package/dist/components/checkbox/index.js +269 -0
- package/dist/components/code/index.d.ts +9 -0
- package/dist/components/code/index.js +10 -0
- package/dist/components/collapse/index.d.ts +11 -0
- package/dist/components/collapse/index.js +41 -0
- package/dist/components/command/index.d.ts +14 -0
- package/dist/components/command/index.js +1695 -0
- package/dist/components/context-menu/index.d.ts +42 -0
- package/dist/components/context-menu/index.js +1444 -0
- package/dist/components/dialog/index.d.ts +48 -0
- package/dist/components/dialog/index.js +138 -0
- package/dist/components/heading/index.d.ts +44 -0
- package/dist/components/heading/index.js +56 -0
- package/dist/components/icon/icon-names.d.ts +1 -0
- package/dist/components/icon/icon-names.js +1 -0
- package/dist/components/icon/index.d.ts +24 -0
- package/dist/components/icon/index.js +43 -0
- package/dist/components/icon-button/index.d.ts +12 -0
- package/dist/components/icon-button/index.js +45 -0
- package/dist/components/inline-code/index.d.ts +6 -0
- package/dist/components/inline-code/index.js +22 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/index.js +119 -0
- package/dist/components/meter/index.d.ts +18 -0
- package/dist/components/meter/index.js +165 -0
- package/dist/components/multiline-input/index.d.ts +6 -0
- package/dist/components/multiline-input/index.js +100 -0
- package/dist/components/number-input/index.d.ts +10 -0
- package/dist/components/number-input/index.js +1169 -0
- package/dist/components/password-input/index.d.ts +2 -0
- package/dist/components/password-input/index.js +29 -0
- package/dist/components/pill/index.d.ts +13 -0
- package/dist/components/pill/index.js +38 -0
- package/dist/components/popover/index.d.ts +21 -0
- package/dist/components/popover/index.js +636 -0
- package/dist/components/preview-card/index.d.ts +17 -0
- package/dist/components/preview-card/index.js +402 -0
- package/dist/components/radio/index.d.ts +13 -0
- package/dist/components/radio/index.js +404 -0
- package/dist/components/search-bar/index.d.ts +12 -0
- package/dist/components/search-bar/index.js +48 -0
- package/dist/components/select/index.d.ts +16 -0
- package/dist/components/select/index.js +1263 -0
- package/dist/components/separator/index.d.ts +7 -0
- package/dist/components/separator/index.js +6 -0
- package/dist/components/slider/index.d.ts +5 -0
- package/dist/components/slider/index.js +902 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/index.js +13 -0
- package/dist/components/stacked-avatars/index.d.ts +14 -0
- package/dist/components/stacked-avatars/index.js +92 -0
- package/dist/components/status-banner/index.d.ts +17 -0
- package/dist/components/status-banner/index.js +69 -0
- package/dist/components/surface/index.d.ts +27 -0
- package/dist/components/surface/index.js +41 -0
- package/dist/components/switch/index.d.ts +5 -0
- package/dist/components/switch/index.js +196 -0
- package/dist/components/tabs/index.d.ts +18 -0
- package/dist/components/tabs/index.js +509 -0
- package/dist/components/text/index.d.ts +26 -0
- package/dist/components/text/index.js +51 -0
- package/dist/components/theme-provider/index.d.ts +2 -0
- package/dist/components/theme-provider/index.js +6 -0
- package/dist/components/theme-provider/theme-context.d.ts +9 -0
- package/dist/components/theme-provider/theme-context.js +13 -0
- package/dist/components/theme-provider/theme-provider.d.ts +17 -0
- package/dist/components/theme-provider/theme-provider.js +30 -0
- package/dist/components/timestamp/index.d.ts +23 -0
- package/dist/components/timestamp/index.js +1392 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/index.js +7 -0
- package/dist/components/toast/toast.d.ts +2 -0
- package/dist/components/toast/toast.js +878 -0
- package/dist/components/toast/use-toast-manager.d.ts +27 -0
- package/dist/components/toast/use-toast-manager.js +4 -0
- package/dist/components/tooltip/index.d.ts +14 -0
- package/dist/components/tooltip/index.js +712 -0
- package/dist/components/tooltip/tooltip-arrow.d.ts +3 -0
- package/dist/components/tooltip/tooltip-arrow.js +6 -0
- package/dist/components/view/index.d.ts +30 -0
- package/dist/components/view/index.js +84 -0
- package/dist/components/visually-hidden/index.d.ts +1 -0
- package/dist/components/visually-hidden/index.js +4 -0
- package/dist/composite-Bx7Szd_T.js +208 -0
- package/dist/composite-C9L5QmZL.js +66 -0
- package/dist/createBaseUIEventDetails-D8M2Yl-a.js +59 -0
- package/dist/detectBrowser-I-s3yzIE.js +43 -0
- package/dist/dialog.css +1 -0
- package/dist/dialog.module-BeF-6XAo.js +415 -0
- package/dist/element-CZEOj04G.js +80 -0
- package/dist/event-CKoGyQEJ.js +30 -0
- package/dist/floating-ui.utils-C7pRWMZ_.js +128 -0
- package/dist/floating-ui.utils.dom-C7FS5id0.js +135 -0
- package/dist/formatErrorMessage-BqPuTBN-.js +7 -0
- package/dist/formatNumber-1UNwjeqf.js +25 -0
- package/dist/getDisabledMountTransitionStyles-YfHPge6T.js +1510 -0
- package/dist/index-BX1XbbRk.js +1206 -0
- package/dist/index-CeuccO-T.js +109 -0
- package/dist/index-DN9Bn1qm.js +29 -0
- package/dist/index-FMoPxlJ2.js +52 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +108 -0
- package/dist/index10.css +1 -0
- package/dist/index11.css +1 -0
- package/dist/index12.css +1 -0
- package/dist/index13.css +1 -0
- package/dist/index14.css +1 -0
- package/dist/index15.css +1 -0
- package/dist/index16.css +1 -0
- package/dist/index17.css +1 -0
- package/dist/index18.css +1 -0
- package/dist/index19.css +1 -0
- package/dist/index2.css +1 -0
- package/dist/index20.css +1 -0
- package/dist/index21.css +1 -0
- package/dist/index22.css +1 -0
- package/dist/index23.css +1 -0
- package/dist/index24.css +1 -0
- package/dist/index25.css +1 -0
- package/dist/index26.css +1 -0
- package/dist/index27.css +1 -0
- package/dist/index28.css +1 -0
- package/dist/index29.css +1 -0
- package/dist/index3.css +1 -0
- package/dist/index30.css +1 -0
- package/dist/index31.css +1 -0
- package/dist/index32.css +1 -0
- package/dist/index33.css +1 -0
- package/dist/index34.css +1 -0
- package/dist/index35.css +1 -0
- package/dist/index36.css +1 -0
- package/dist/index37.css +1 -0
- package/dist/index4.css +1 -0
- package/dist/index5.css +1 -0
- package/dist/index6.css +1 -0
- package/dist/index7.css +1 -0
- package/dist/index8.css +1 -0
- package/dist/index9.css +1 -0
- package/dist/inertValue-BCYGsdmf.js +7 -0
- package/dist/input.css +1 -0
- package/dist/input.module-DDQY_Ij6.js +7 -0
- package/dist/integrations/react-markdown/index.d.ts +5 -0
- package/dist/integrations/react-markdown/index.js +6895 -0
- package/dist/integrations/remix/index.d.ts +9 -0
- package/{src/integrations/remix.ts → dist/integrations/remix/index.js} +7 -4
- package/dist/integrations/tailwind.css +1 -0
- package/dist/integrations/twemoij/index.d.ts +3 -0
- package/dist/integrations/twemoij/index.js +18 -0
- package/dist/isElementDisabled-Cbd8W9kH.js +6 -0
- package/dist/owner-rKN292Q9.js +6 -0
- package/dist/safePolygon-DWy1dGKJ.js +308 -0
- package/dist/styles/core.css +1 -0
- package/dist/styles/tokens.d.ts +400 -0
- package/{src/styles/tokens.ts → dist/styles/tokens.js} +54 -96
- package/dist/toast.css +1 -0
- package/dist/tooltip-arrow-C1qXdi5T.js +24 -0
- package/dist/tooltip-arrow.css +1 -0
- package/dist/transitions.css +1 -0
- package/dist/transitions.module-CWX8e5cx.js +1343 -0
- package/dist/use-toast-manager-Dq-44AuW.js +37 -0
- package/dist/useAnimationFrame-451ugS_6.js +68 -0
- package/dist/useBaseUiId-B7WyxtIE.js +7 -0
- package/dist/useButton-DfIwsdb8.js +127 -0
- package/dist/useCompositeListItem-OkcAim_1.js +148 -0
- package/dist/useControlled-Du4sJyMj.js +31 -0
- package/dist/useHoverReferenceInteraction-SfOBPoXM.js +264 -0
- package/dist/useId-C5kyn6tA.js +22 -0
- package/dist/useIsoLayoutEffect-CIDbvm3Q.js +6 -0
- package/dist/useLabelableId-Ci_jDvmv.js +29 -0
- package/dist/useOnMount-VRW6CK2u.js +8 -0
- package/dist/useOpenChangeComplete-Dse9kY9E.js +61 -0
- package/dist/usePopupAutoResize-CNR6Ekmx.js +85 -0
- package/dist/useRender-CLx7dR_1.js +7 -0
- package/dist/useRenderElement-DwToLA61.js +244 -0
- package/dist/useRole-oDBdbuwQ.js +77 -0
- package/dist/useStableCallback-CkTrVkNX.js +29 -0
- package/dist/useSyncedFloatingRootContext-Dorsv-jf.js +167 -0
- package/dist/useTimeout-CflX-kz3.js +32 -0
- package/dist/useTransitionStatus-CUfcuGAV.js +42 -0
- package/dist/useTypeahead-D85V2IUx.js +333 -0
- package/dist/useValueAsRef-HURLzret.js +19 -0
- package/dist/useValueChanged-DL757-yD.js +14 -0
- package/dist/valueToPercent-DaP9qN4u.js +6 -0
- package/dist/view.css +1 -0
- package/dist/view.module-DfDLgJE0.js +6 -0
- package/dist/visuallyHidden-CpJ-mhai.js +16 -0
- package/dist/warn-CKtX8MLJ.js +11 -0
- package/package.json +18 -2
- package/.husky/pre-commit +0 -1
- package/.storybook/main.ts +0 -25
- package/.storybook/preview-head.html +0 -6
- package/.storybook/preview.tsx +0 -48
- package/.storybook/vitest.setup.ts +0 -8
- package/eslint.config.mjs +0 -29
- package/lint-staged.config.js +0 -15
- package/pnpm-workspace.yaml +0 -2
- package/postcss.config.mjs +0 -7
- package/prettier.config.mjs +0 -24
- package/scripts/build-icon-types.ts +0 -38
- package/src/-utils.tsx +0 -64
- package/src/components/accordion/accordion.module.css +0 -44
- package/src/components/accordion/accordion.stories.tsx +0 -36
- package/src/components/accordion/index.tsx +0 -67
- package/src/components/alert-dialog/alert-dialog.module.css +0 -5
- package/src/components/alert-dialog/alert-dialog.stories.tsx +0 -53
- package/src/components/alert-dialog/index.tsx +0 -138
- package/src/components/anchor/anchor.module.css +0 -18
- package/src/components/anchor/anchor.stories.tsx +0 -28
- package/src/components/anchor/index.tsx +0 -45
- package/src/components/avatar/avatar.module.css +0 -56
- package/src/components/avatar/avatar.stories.tsx +0 -61
- package/src/components/avatar/index.tsx +0 -82
- package/src/components/badge/badge.module.css +0 -35
- package/src/components/badge/badge.stories.tsx +0 -60
- package/src/components/badge/index.tsx +0 -71
- package/src/components/button/button.module.css +0 -42
- package/src/components/button/button.stories.tsx +0 -108
- package/src/components/button/index.tsx +0 -63
- package/src/components/checkbox/checkbox.module.css +0 -36
- package/src/components/checkbox/checkbox.stories.tsx +0 -21
- package/src/components/checkbox/index.tsx +0 -41
- package/src/components/code/code.module.css +0 -20
- package/src/components/code/code.stories.tsx +0 -42
- package/src/components/code/index.tsx +0 -73
- package/src/components/collapse/collapse.module.css +0 -27
- package/src/components/collapse/collapse.stories.tsx +0 -27
- package/src/components/collapse/index.tsx +0 -59
- package/src/components/command/command.module.css +0 -95
- package/src/components/command/command.stories.tsx +0 -38
- package/src/components/command/index.tsx +0 -108
- package/src/components/context-menu/context-menu.module.css +0 -36
- package/src/components/context-menu/context-menu.stories.tsx +0 -99
- package/src/components/context-menu/index.tsx +0 -242
- package/src/components/dialog/dialog.module.css +0 -71
- package/src/components/dialog/dialog.stories.tsx +0 -29
- package/src/components/dialog/index.tsx +0 -148
- package/src/components/heading/heading.module.css +0 -3
- package/src/components/heading/heading.stories.tsx +0 -52
- package/src/components/heading/index.tsx +0 -112
- package/src/components/icon/icon-names.ts +0 -3189
- package/src/components/icon/icon.module.css +0 -36
- package/src/components/icon/icon.stories.tsx +0 -40
- package/src/components/icon/index.tsx +0 -60
- package/src/components/icon-button/icon-button.module.css +0 -33
- package/src/components/icon-button/icon-button.stories.tsx +0 -59
- package/src/components/icon-button/index.tsx +0 -48
- package/src/components/inline-code/index.tsx +0 -29
- package/src/components/inline-code/inline-code.module.css +0 -13
- package/src/components/inline-code/inline-code.stories.tsx +0 -31
- package/src/components/input/index.tsx +0 -22
- package/src/components/input/input.module.css +0 -23
- package/src/components/input/input.stories.tsx +0 -52
- package/src/components/meter/index.tsx +0 -55
- package/src/components/meter/meter.module.css +0 -23
- package/src/components/meter/meter.stories.tsx +0 -31
- package/src/components/multiline-input/index.tsx +0 -58
- package/src/components/multiline-input/multiline-input.stories.tsx +0 -26
- package/src/components/number-input/index.tsx +0 -74
- package/src/components/number-input/number-input.module.css +0 -41
- package/src/components/number-input/number-input.stories.tsx +0 -24
- package/src/components/password-input/index.tsx +0 -24
- package/src/components/password-input/password-input.module.css +0 -10
- package/src/components/password-input/password-input.stories.tsx +0 -24
- package/src/components/pill/index.tsx +0 -45
- package/src/components/pill/pill.module.css +0 -22
- package/src/components/pill/pill.stories.tsx +0 -83
- package/src/components/popover/index.tsx +0 -94
- package/src/components/popover/popover.module.css +0 -8
- package/src/components/popover/popover.stories.tsx +0 -53
- package/src/components/preview-card/index.tsx +0 -68
- package/src/components/preview-card/preview-card.module.css +0 -5
- package/src/components/preview-card/preview-card.stories.tsx +0 -58
- package/src/components/radio/index.tsx +0 -67
- package/src/components/radio/radio-group.module.css +0 -5
- package/src/components/radio/radio.module.css +0 -36
- package/src/components/radio/radio.stories.tsx +0 -27
- package/src/components/search-bar/index.tsx +0 -60
- package/src/components/search-bar/search-bar.module.css +0 -29
- package/src/components/search-bar/search-bar.stories.tsx +0 -37
- package/src/components/select/index.tsx +0 -132
- package/src/components/select/select.module.css +0 -63
- package/src/components/select/select.stories.tsx +0 -49
- package/src/components/separator/index.tsx +0 -28
- package/src/components/separator/separator.module.css +0 -24
- package/src/components/separator/separator.stories.tsx +0 -40
- package/src/components/slider/index.tsx +0 -28
- package/src/components/slider/slider.module.css +0 -52
- package/src/components/slider/slider.stories.tsx +0 -53
- package/src/components/spinner/index.tsx +0 -14
- package/src/components/spinner/spinner.module.css +0 -13
- package/src/components/spinner/spinner.stories.tsx +0 -17
- package/src/components/stacked-avatars/index.tsx +0 -88
- package/src/components/stacked-avatars/stacked-avatars.module.css +0 -79
- package/src/components/stacked-avatars/stacked-avatars.stories.tsx +0 -48
- package/src/components/status-banner/index.tsx +0 -96
- package/src/components/status-banner/status-banner.module.css +0 -52
- package/src/components/status-banner/status-banner.stories.tsx +0 -44
- package/src/components/surface/index.tsx +0 -83
- package/src/components/surface/surface.module.css +0 -35
- package/src/components/surface/surface.stories.tsx +0 -84
- package/src/components/switch/index.tsx +0 -23
- package/src/components/switch/switch.module.css +0 -45
- package/src/components/switch/switch.stories.tsx +0 -48
- package/src/components/tabs/index.tsx +0 -126
- package/src/components/tabs/tabs.module.css +0 -134
- package/src/components/tabs/tabs.stories.tsx +0 -88
- package/src/components/text/index.tsx +0 -69
- package/src/components/text/text.module.css +0 -76
- package/src/components/text/text.stories.tsx +0 -107
- package/src/components/theme-provider/index.ts +0 -2
- package/src/components/theme-provider/theme-context.tsx +0 -18
- package/src/components/theme-provider/theme-provider.stories.tsx +0 -47
- package/src/components/theme-provider/theme-provider.tsx +0 -77
- package/src/components/timestamp/index.tsx +0 -131
- package/src/components/timestamp/timestamp.module.css +0 -8
- package/src/components/timestamp/timestamp.stories.tsx +0 -37
- package/src/components/toast/index.ts +0 -2
- package/src/components/toast/toast.module.css +0 -163
- package/src/components/toast/toast.stories.tsx +0 -53
- package/src/components/toast/toast.tsx +0 -104
- package/src/components/toast/use-toast-manager.ts +0 -63
- package/src/components/tooltip/index.tsx +0 -61
- package/src/components/tooltip/tooltip-arrow.tsx +0 -17
- package/src/components/tooltip/tooltip.module.css +0 -44
- package/src/components/tooltip/tooltip.stories.tsx +0 -76
- package/src/components/view/index.tsx +0 -137
- package/src/components/view/view.module.css +0 -11
- package/src/components/view/view.stories.tsx +0 -131
- package/src/components/view/view_colorway.module.css +0 -280
- package/src/components/view/view_interactive.module.css +0 -127
- package/src/components/view/view_loading.module.css +0 -58
- package/src/components/visually-hidden/index.ts +0 -1
- package/src/index.ts +0 -49
- package/src/integrations/react-markdown/index.tsx +0 -134
- package/src/integrations/react-markdown/react-markdown.module.css +0 -62
- package/src/integrations/react-markdown/react-markdown.stories.tsx +0 -31
- package/src/integrations/tailwind.css +0 -173
- package/src/integrations/twemoij/index.tsx +0 -13
- package/src/integrations/twemoij/twemoji.module.css +0 -7
- package/src/integrations/twemoij/twemoji.stories.tsx +0 -40
- package/src/stories/components/all-variants.tsx +0 -40
- package/src/stories/data.ts +0 -72
- package/src/stories/utils.ts +0 -20
- package/src/styles/core.css +0 -153
- package/src/styles/themes/dark.css +0 -86
- package/src/styles/themes/light.css +0 -86
- package/src/styles/transitions.module.css +0 -31
- package/stylelint.config.mjs +0 -29
- package/tsconfig.app.json +0 -35
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -26
- package/vite.config.ts +0 -103
- package/vitest.shims.d.ts +0 -1
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { jsxs as A, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as we } from "../icon/index.js";
|
|
3
|
+
import { Text as Fe } from "../text/index.js";
|
|
4
|
+
import { View as Te } from "../view/index.js";
|
|
5
|
+
import * as r from "react";
|
|
6
|
+
import { f as ee } from "../../formatErrorMessage-BqPuTBN-.js";
|
|
7
|
+
import { N as qe, c as Ue, m as je, E as De, u as te } from "../../useRenderElement-DwToLA61.js";
|
|
8
|
+
import { f as ne, c as He, a as Le, u as $e, b as ze } from "../../LabelableContext-BMvjVwor.js";
|
|
9
|
+
import { a as Je, t as Ke } from "../../useOpenChangeComplete-Dse9kY9E.js";
|
|
10
|
+
import { u as We } from "../../useTransitionStatus-CUfcuGAV.js";
|
|
11
|
+
import { u as Xe } from "../../useControlled-Du4sJyMj.js";
|
|
12
|
+
import { u as Ye } from "../../useStableCallback-CkTrVkNX.js";
|
|
13
|
+
import { u as Y } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
|
|
14
|
+
import { v as Qe } from "../../visuallyHidden-CpJ-mhai.js";
|
|
15
|
+
import { u as Q } from "../../useBaseUiId-B7WyxtIE.js";
|
|
16
|
+
import { u as Ze } from "../../useButton-DfIwsdb8.js";
|
|
17
|
+
import { u as Ae } from "../../FieldItemContext-DAvk99to.js";
|
|
18
|
+
import { c as et, n as tt } from "../../createBaseUIEventDetails-D8M2Yl-a.js";
|
|
19
|
+
import { u as nt } from "../../useValueChanged-DL757-yD.js";
|
|
20
|
+
import '../../index24.css';let Z = /* @__PURE__ */ (function(e) {
|
|
21
|
+
return e.checked = "data-checked", e.unchecked = "data-unchecked", e.disabled = "data-disabled", e.readonly = "data-readonly", e.required = "data-required", e.valid = "data-valid", e.invalid = "data-invalid", e.touched = "data-touched", e.dirty = "data-dirty", e.filled = "data-filled", e.focused = "data-focused", e;
|
|
22
|
+
})({});
|
|
23
|
+
function oe(e) {
|
|
24
|
+
return r.useMemo(() => ({
|
|
25
|
+
checked(n) {
|
|
26
|
+
return e.indeterminate ? {} : n ? {
|
|
27
|
+
[Z.checked]: ""
|
|
28
|
+
} : {
|
|
29
|
+
[Z.unchecked]: ""
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
...ne
|
|
33
|
+
}), [e.indeterminate]);
|
|
34
|
+
}
|
|
35
|
+
const re = /* @__PURE__ */ r.createContext(void 0);
|
|
36
|
+
process.env.NODE_ENV !== "production" && (re.displayName = "CheckboxGroupContext");
|
|
37
|
+
function ot(e = !0) {
|
|
38
|
+
const n = r.useContext(re);
|
|
39
|
+
if (n === void 0 && !e)
|
|
40
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>." : ee(3));
|
|
41
|
+
return n;
|
|
42
|
+
}
|
|
43
|
+
const U = /* @__PURE__ */ r.createContext(void 0);
|
|
44
|
+
process.env.NODE_ENV !== "production" && (U.displayName = "CheckboxRootContext");
|
|
45
|
+
function rt() {
|
|
46
|
+
const e = r.useContext(U);
|
|
47
|
+
if (e === void 0)
|
|
48
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>." : ee(14));
|
|
49
|
+
return e;
|
|
50
|
+
}
|
|
51
|
+
const at = "data-parent", ae = /* @__PURE__ */ r.forwardRef(function(n, k) {
|
|
52
|
+
const {
|
|
53
|
+
checked: x,
|
|
54
|
+
className: se,
|
|
55
|
+
defaultChecked: O = !1,
|
|
56
|
+
disabled: B = !1,
|
|
57
|
+
id: s,
|
|
58
|
+
indeterminate: c = !1,
|
|
59
|
+
inputRef: _,
|
|
60
|
+
name: G,
|
|
61
|
+
onCheckedChange: E,
|
|
62
|
+
parent: i = !1,
|
|
63
|
+
readOnly: l = !1,
|
|
64
|
+
render: j,
|
|
65
|
+
required: f = !1,
|
|
66
|
+
uncheckedValue: N,
|
|
67
|
+
value: P,
|
|
68
|
+
nativeButton: ce = !1,
|
|
69
|
+
...de
|
|
70
|
+
} = n, {
|
|
71
|
+
clearErrors: ue
|
|
72
|
+
} = He(), {
|
|
73
|
+
disabled: le,
|
|
74
|
+
name: fe,
|
|
75
|
+
setDirty: pe,
|
|
76
|
+
setFilled: S,
|
|
77
|
+
setFocused: D,
|
|
78
|
+
setTouched: me,
|
|
79
|
+
state: H,
|
|
80
|
+
validationMode: he,
|
|
81
|
+
validityData: Ce,
|
|
82
|
+
shouldValidateOnChange: ke,
|
|
83
|
+
validation: xe
|
|
84
|
+
} = Le(), be = Ae(), {
|
|
85
|
+
labelId: ge,
|
|
86
|
+
controlId: ve,
|
|
87
|
+
setControlId: V,
|
|
88
|
+
getDescriptionProps: L
|
|
89
|
+
} = $e(), t = ot(), b = t?.parent, y = b && t.allValues, p = le || be.disabled || t?.disabled || B, h = fe ?? G, a = P ?? h, $ = Q(), _e = Q();
|
|
90
|
+
let g = ve;
|
|
91
|
+
y ? g = i ? _e : `${b.id}-${a}` : s && (g = s);
|
|
92
|
+
let w = {};
|
|
93
|
+
y && (i ? w = t.parent.getParentProps() : a && (w = t.parent.getChildProps(a)));
|
|
94
|
+
const Ee = Ye(E), {
|
|
95
|
+
checked: z = x,
|
|
96
|
+
indeterminate: I = c,
|
|
97
|
+
onCheckedChange: Ne,
|
|
98
|
+
...Pe
|
|
99
|
+
} = w, C = t?.value, J = t?.setValue, K = t?.defaultValue, F = r.useRef(null), {
|
|
100
|
+
getButtonProps: Ve,
|
|
101
|
+
buttonRef: ye
|
|
102
|
+
} = Ze({
|
|
103
|
+
disabled: p,
|
|
104
|
+
native: ce
|
|
105
|
+
}), d = t?.validation ?? xe, [o, Ie] = Xe({
|
|
106
|
+
controlled: a && C && !i ? C.includes(a) : z,
|
|
107
|
+
default: a && K && !i ? K.includes(a) : O,
|
|
108
|
+
name: "Checkbox",
|
|
109
|
+
state: "checked"
|
|
110
|
+
});
|
|
111
|
+
Y(() => {
|
|
112
|
+
if (V !== qe)
|
|
113
|
+
return V(g), () => {
|
|
114
|
+
V(void 0);
|
|
115
|
+
};
|
|
116
|
+
}, [g, t, V, i]), ze({
|
|
117
|
+
enabled: !t,
|
|
118
|
+
id: $,
|
|
119
|
+
commit: d.commit,
|
|
120
|
+
value: o,
|
|
121
|
+
controlRef: F,
|
|
122
|
+
name: h,
|
|
123
|
+
getValue: () => o
|
|
124
|
+
});
|
|
125
|
+
const v = r.useRef(null), Re = Ue(_, v, d.inputRef);
|
|
126
|
+
Y(() => {
|
|
127
|
+
v.current && (v.current.indeterminate = I, o && S(!0));
|
|
128
|
+
}, [o, I, S]), nt(o, () => {
|
|
129
|
+
t && !i || (ue(h), S(o), pe(o !== Ce.initialValue), ke() ? d.commit(o) : d.commit(o, !0));
|
|
130
|
+
});
|
|
131
|
+
const Me = je(
|
|
132
|
+
{
|
|
133
|
+
checked: o,
|
|
134
|
+
disabled: p,
|
|
135
|
+
// parent checkboxes unset `name` to be excluded from form submission
|
|
136
|
+
name: i ? void 0 : h,
|
|
137
|
+
// Set `id` to stop Chrome warning about an unassociated input
|
|
138
|
+
id: g ?? void 0,
|
|
139
|
+
required: f,
|
|
140
|
+
ref: Re,
|
|
141
|
+
style: Qe,
|
|
142
|
+
tabIndex: -1,
|
|
143
|
+
type: "checkbox",
|
|
144
|
+
"aria-hidden": !0,
|
|
145
|
+
onChange(u) {
|
|
146
|
+
if (u.nativeEvent.defaultPrevented)
|
|
147
|
+
return;
|
|
148
|
+
const R = u.target.checked, M = et(tt, u.nativeEvent);
|
|
149
|
+
if (Ne?.(R, M), Ee(R, M), !M.isCanceled && (Ie(R), a && C && J && !i)) {
|
|
150
|
+
const Ge = R ? [...C, a] : C.filter((Se) => Se !== a);
|
|
151
|
+
J(Ge, M);
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
onFocus() {
|
|
155
|
+
F.current?.focus();
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
// React <19 sets an empty value if `undefined` is passed explicitly
|
|
159
|
+
// To avoid this, we only set the value if it's defined
|
|
160
|
+
P !== void 0 ? {
|
|
161
|
+
value: (t ? o && P : P) || ""
|
|
162
|
+
} : De,
|
|
163
|
+
L,
|
|
164
|
+
t ? d.getValidationProps : d.getInputValidationProps
|
|
165
|
+
), W = y ? !!z : o, X = y && I || c;
|
|
166
|
+
r.useEffect(() => {
|
|
167
|
+
b && a && b.disabledStatesRef.current.set(a, p);
|
|
168
|
+
}, [b, p, a]);
|
|
169
|
+
const T = r.useMemo(() => ({
|
|
170
|
+
...H,
|
|
171
|
+
checked: W,
|
|
172
|
+
disabled: p,
|
|
173
|
+
readOnly: l,
|
|
174
|
+
required: f,
|
|
175
|
+
indeterminate: X
|
|
176
|
+
}), [H, W, p, l, f, X]), Oe = oe(T), Be = te("span", n, {
|
|
177
|
+
state: T,
|
|
178
|
+
ref: [ye, F, k, t?.registerControlRef],
|
|
179
|
+
props: [{
|
|
180
|
+
id: $,
|
|
181
|
+
role: "checkbox",
|
|
182
|
+
"aria-checked": I ? "mixed" : o,
|
|
183
|
+
"aria-readonly": l || void 0,
|
|
184
|
+
"aria-required": f || void 0,
|
|
185
|
+
"aria-labelledby": ge,
|
|
186
|
+
[at]: i ? "" : void 0,
|
|
187
|
+
onFocus() {
|
|
188
|
+
D(!0);
|
|
189
|
+
},
|
|
190
|
+
onBlur() {
|
|
191
|
+
const u = v.current;
|
|
192
|
+
u && (me(!0), D(!1), he === "onBlur" && d.commit(t ? C : u.checked));
|
|
193
|
+
},
|
|
194
|
+
onClick(u) {
|
|
195
|
+
l || p || (u.preventDefault(), v.current?.click());
|
|
196
|
+
}
|
|
197
|
+
}, L, d.getValidationProps, de, Pe, Ve],
|
|
198
|
+
stateAttributesMapping: Oe
|
|
199
|
+
});
|
|
200
|
+
return /* @__PURE__ */ A(U.Provider, {
|
|
201
|
+
value: T,
|
|
202
|
+
children: [Be, !o && !t && h && !i && N !== void 0 && /* @__PURE__ */ m("input", {
|
|
203
|
+
type: "hidden",
|
|
204
|
+
name: h,
|
|
205
|
+
value: N
|
|
206
|
+
}), /* @__PURE__ */ m("input", {
|
|
207
|
+
...Me
|
|
208
|
+
})]
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
process.env.NODE_ENV !== "production" && (ae.displayName = "CheckboxRoot");
|
|
212
|
+
const ie = /* @__PURE__ */ r.forwardRef(function(n, k) {
|
|
213
|
+
const {
|
|
214
|
+
render: x,
|
|
215
|
+
className: se,
|
|
216
|
+
keepMounted: O = !1,
|
|
217
|
+
...B
|
|
218
|
+
} = n, s = rt(), c = s.checked || s.indeterminate, {
|
|
219
|
+
transitionStatus: _,
|
|
220
|
+
setMounted: G
|
|
221
|
+
} = We(c), E = r.useRef(null), i = r.useMemo(() => ({
|
|
222
|
+
...s,
|
|
223
|
+
transitionStatus: _
|
|
224
|
+
}), [s, _]);
|
|
225
|
+
Je({
|
|
226
|
+
open: c,
|
|
227
|
+
ref: E,
|
|
228
|
+
onComplete() {
|
|
229
|
+
c || G(!1);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
const l = oe(s), j = r.useMemo(() => ({
|
|
233
|
+
...l,
|
|
234
|
+
...Ke,
|
|
235
|
+
...ne
|
|
236
|
+
}), [l]), f = O || c, N = te("span", n, {
|
|
237
|
+
enabled: f,
|
|
238
|
+
ref: [k, E],
|
|
239
|
+
state: i,
|
|
240
|
+
stateAttributesMapping: j,
|
|
241
|
+
props: B
|
|
242
|
+
});
|
|
243
|
+
return f ? N : null;
|
|
244
|
+
});
|
|
245
|
+
process.env.NODE_ENV !== "production" && (ie.displayName = "CheckboxIndicator");
|
|
246
|
+
const it = "_checkbox__label_4s2il_1", st = "_checkbox_4s2il_1", ct = "_checkbox__indicator_4s2il_29", q = {
|
|
247
|
+
checkbox__label: it,
|
|
248
|
+
checkbox: st,
|
|
249
|
+
checkbox__indicator: ct
|
|
250
|
+
};
|
|
251
|
+
function yt({ color: e, label: n, ...k }) {
|
|
252
|
+
const x = /* @__PURE__ */ m(
|
|
253
|
+
Te,
|
|
254
|
+
{
|
|
255
|
+
color: e,
|
|
256
|
+
interactive: "fill-outline",
|
|
257
|
+
render: /* @__PURE__ */ m(ae, { "aria-label": n, ...k }),
|
|
258
|
+
className: q.checkbox,
|
|
259
|
+
children: /* @__PURE__ */ m(ie, { className: q.checkbox__indicator, children: /* @__PURE__ */ m(we, { name: "check-line", size: "sm" }) })
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
return n ? /* @__PURE__ */ A("label", { className: q.checkbox__label, children: [
|
|
263
|
+
x,
|
|
264
|
+
/* @__PURE__ */ m(Fe, { children: n })
|
|
265
|
+
] }) : x;
|
|
266
|
+
}
|
|
267
|
+
export {
|
|
268
|
+
yt as Checkbox
|
|
269
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface CodeProps {
|
|
2
|
+
/** Use a specific language (you must import the themes you need) */
|
|
3
|
+
language?: string;
|
|
4
|
+
/** Optional file name or title */
|
|
5
|
+
title?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
children?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function Code({ language, children, title, className, }: CodeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
interface CollapseProps extends useRender.ComponentProps<"div"> {
|
|
4
|
+
/** Shrink or expand the div. Defaults to true. */
|
|
5
|
+
expand?: boolean;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** Supplied as a dependency to recalculate the height of the children */
|
|
8
|
+
recalculate?: unknown;
|
|
9
|
+
}
|
|
10
|
+
export declare function Collapse({ expand, render, recalculate, ...props }: CollapseProps): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { c as p } from "../../clsx-OuTLNxxd.js";
|
|
2
|
+
import { useRef as d, useState as i, useLayoutEffect as m } from "react";
|
|
3
|
+
import { u } from "../../useRender-CLx7dR_1.js";
|
|
4
|
+
import { m as _ } from "../../useRenderElement-DwToLA61.js";
|
|
5
|
+
import '../../index9.css';const f = "_collapse_ejmjl_1", h = "_collapse_expand_ejmjl_12", x = "_collapse_hidden_ejmjl_17", t = {
|
|
6
|
+
collapse: f,
|
|
7
|
+
collapse_expand: h,
|
|
8
|
+
collapse_hidden: x
|
|
9
|
+
};
|
|
10
|
+
function R({
|
|
11
|
+
expand: o = !0,
|
|
12
|
+
render: s,
|
|
13
|
+
recalculate: c,
|
|
14
|
+
...a
|
|
15
|
+
}) {
|
|
16
|
+
const l = d(null), [n, r] = i(0);
|
|
17
|
+
return m(() => {
|
|
18
|
+
if (!l.current)
|
|
19
|
+
return;
|
|
20
|
+
const e = l.current.cloneNode(!0);
|
|
21
|
+
e.removeAttribute("style"), e.style.width = `${l.current.offsetWidth}px`, e.className = t.collapse_hidden, document.body.appendChild(e), r(e.offsetHeight), e.remove();
|
|
22
|
+
}, [c]), u({
|
|
23
|
+
defaultTagName: "div",
|
|
24
|
+
render: s,
|
|
25
|
+
ref: l,
|
|
26
|
+
props: _(
|
|
27
|
+
{
|
|
28
|
+
"aria-hidden": !o,
|
|
29
|
+
className: p(
|
|
30
|
+
t.collapse,
|
|
31
|
+
o && t.collapse_expand
|
|
32
|
+
),
|
|
33
|
+
style: { "--collapse-height": `${n}px` }
|
|
34
|
+
},
|
|
35
|
+
a
|
|
36
|
+
)
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
R as Collapse
|
|
41
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import { BaseDialogProps } from '../dialog';
|
|
4
|
+
import { IconName } from '../icon/icon-names';
|
|
5
|
+
export type CommandDialogProps = Omit<BaseDialogProps, "title" | "description" | "background"> & {
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function CommandDialog({ placeholder, children, ...props }: CommandDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function CommandGroup({ className, ...props }: ComponentProps<typeof CommandPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function CommandSeparator(props: ComponentProps<typeof CommandPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function CommandItem({ shortcut, icon, className, children, ...props }: ComponentProps<typeof CommandPrimitive.Item> & {
|
|
12
|
+
shortcut?: string;
|
|
13
|
+
icon?: IconName;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|