@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,404 @@
|
|
|
1
|
+
import { jsxs as re, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { c as ue } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import * as o from "react";
|
|
4
|
+
import { createContext as Ee, useContext as Ne } from "react";
|
|
5
|
+
import { Text as Ve } from "../text/index.js";
|
|
6
|
+
import { View as Pe } from "../view/index.js";
|
|
7
|
+
import { u as Ie } from "../../useControlled-Du4sJyMj.js";
|
|
8
|
+
import { E as ce, b as de, u as ne, N as F, c as fe, m as ke } from "../../useRenderElement-DwToLA61.js";
|
|
9
|
+
import { u as G } from "../../useStableCallback-CkTrVkNX.js";
|
|
10
|
+
import { v as pe } from "../../visuallyHidden-CpJ-mhai.js";
|
|
11
|
+
import { u as me } from "../../useBaseUiId-B7WyxtIE.js";
|
|
12
|
+
import { S as Oe } from "../../composite-C9L5QmZL.js";
|
|
13
|
+
import { u as Me, A as Fe, C as Te } from "../../CompositeRoot-CVk5a-pR.js";
|
|
14
|
+
import { f as Ce, a as he, u as Re, c as we, b as Se } from "../../LabelableContext-BMvjVwor.js";
|
|
15
|
+
import { f as ge } from "../../formatErrorMessage-BqPuTBN-.js";
|
|
16
|
+
import { u as Ge } from "../../useValueChanged-DL757-yD.js";
|
|
17
|
+
import { f as qe } from "../../element-CZEOj04G.js";
|
|
18
|
+
import { t as De, a as Be } from "../../useOpenChangeComplete-Dse9kY9E.js";
|
|
19
|
+
import { u as je } from "../../useTransitionStatus-CUfcuGAV.js";
|
|
20
|
+
import { u as ze } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
|
|
21
|
+
import { c as Ke, n as Le } from "../../createBaseUIEventDetails-D8M2Yl-a.js";
|
|
22
|
+
import { u as Ue } from "../../FieldItemContext-DAvk99to.js";
|
|
23
|
+
import { u as Ye } from "../../useLabelableId-Ci_jDvmv.js";
|
|
24
|
+
import { u as He } from "../../useButton-DfIwsdb8.js";
|
|
25
|
+
import '../../index27.css';function Je(e) {
|
|
26
|
+
const {
|
|
27
|
+
render: r,
|
|
28
|
+
className: u,
|
|
29
|
+
state: h = ce,
|
|
30
|
+
props: R = de,
|
|
31
|
+
refs: m = de,
|
|
32
|
+
metadata: n,
|
|
33
|
+
stateAttributesMapping: a,
|
|
34
|
+
tag: s = "div",
|
|
35
|
+
...g
|
|
36
|
+
} = e, {
|
|
37
|
+
compositeProps: b,
|
|
38
|
+
compositeRef: _
|
|
39
|
+
} = Me({
|
|
40
|
+
metadata: n
|
|
41
|
+
});
|
|
42
|
+
return ne(s, e, {
|
|
43
|
+
state: h,
|
|
44
|
+
ref: [...m, _],
|
|
45
|
+
props: [b, ...R, g],
|
|
46
|
+
stateAttributesMapping: a
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
const ye = /* @__PURE__ */ o.createContext({
|
|
50
|
+
legendId: void 0,
|
|
51
|
+
setLegendId: () => {
|
|
52
|
+
},
|
|
53
|
+
disabled: void 0
|
|
54
|
+
});
|
|
55
|
+
process.env.NODE_ENV !== "production" && (ye.displayName = "FieldsetRootContext");
|
|
56
|
+
function We(e = !1) {
|
|
57
|
+
const r = o.useContext(ye);
|
|
58
|
+
if (!r && !e)
|
|
59
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>." : ge(86));
|
|
60
|
+
return r;
|
|
61
|
+
}
|
|
62
|
+
let le = /* @__PURE__ */ (function(e) {
|
|
63
|
+
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;
|
|
64
|
+
})({});
|
|
65
|
+
const oe = {
|
|
66
|
+
checked(e) {
|
|
67
|
+
return e ? {
|
|
68
|
+
[le.checked]: ""
|
|
69
|
+
} : {
|
|
70
|
+
[le.unchecked]: ""
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
...De,
|
|
74
|
+
...Ce
|
|
75
|
+
}, ae = /* @__PURE__ */ o.createContext({
|
|
76
|
+
disabled: void 0,
|
|
77
|
+
readOnly: void 0,
|
|
78
|
+
required: void 0,
|
|
79
|
+
name: void 0,
|
|
80
|
+
checkedValue: "",
|
|
81
|
+
setCheckedValue: F,
|
|
82
|
+
onValueChange: F,
|
|
83
|
+
touched: !1,
|
|
84
|
+
setTouched: F,
|
|
85
|
+
registerControlRef: F
|
|
86
|
+
});
|
|
87
|
+
process.env.NODE_ENV !== "production" && (ae.displayName = "RadioGroupContext");
|
|
88
|
+
function $e() {
|
|
89
|
+
return o.useContext(ae);
|
|
90
|
+
}
|
|
91
|
+
const se = /* @__PURE__ */ o.createContext(void 0);
|
|
92
|
+
process.env.NODE_ENV !== "production" && (se.displayName = "RadioRootContext");
|
|
93
|
+
function Ae() {
|
|
94
|
+
const e = o.useContext(se);
|
|
95
|
+
if (e === void 0)
|
|
96
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: RadioRootContext is missing. Radio parts must be placed within <Radio.Root>." : ge(52));
|
|
97
|
+
return e;
|
|
98
|
+
}
|
|
99
|
+
const be = /* @__PURE__ */ o.forwardRef(function(r, u) {
|
|
100
|
+
const {
|
|
101
|
+
render: h,
|
|
102
|
+
className: R,
|
|
103
|
+
disabled: m = !1,
|
|
104
|
+
readOnly: n = !1,
|
|
105
|
+
required: a = !1,
|
|
106
|
+
value: s,
|
|
107
|
+
inputRef: g,
|
|
108
|
+
nativeButton: b = !1,
|
|
109
|
+
id: _,
|
|
110
|
+
...E
|
|
111
|
+
} = r, {
|
|
112
|
+
disabled: N,
|
|
113
|
+
readOnly: V,
|
|
114
|
+
required: q,
|
|
115
|
+
checkedValue: T,
|
|
116
|
+
setCheckedValue: w,
|
|
117
|
+
touched: H,
|
|
118
|
+
setTouched: J,
|
|
119
|
+
validation: W,
|
|
120
|
+
registerControlRef: P
|
|
121
|
+
} = $e(), {
|
|
122
|
+
setDirty: l,
|
|
123
|
+
validityData: D,
|
|
124
|
+
setTouched: B,
|
|
125
|
+
setFilled: I,
|
|
126
|
+
state: j,
|
|
127
|
+
disabled: $
|
|
128
|
+
} = he(), A = Ue(), {
|
|
129
|
+
labelId: y,
|
|
130
|
+
getDescriptionProps: v
|
|
131
|
+
} = Re(), i = $ || A.disabled || N || m, t = V || n, x = q || a, c = T === s, k = o.useRef(null), C = o.useRef(null), S = fe(g, C);
|
|
132
|
+
ze(() => {
|
|
133
|
+
C.current?.checked && I(!0);
|
|
134
|
+
}, [I]);
|
|
135
|
+
const z = me(), O = Ye({
|
|
136
|
+
id: _,
|
|
137
|
+
implicit: !1,
|
|
138
|
+
controlRef: k
|
|
139
|
+
}), Q = {
|
|
140
|
+
role: "radio",
|
|
141
|
+
"aria-checked": c,
|
|
142
|
+
"aria-required": x || void 0,
|
|
143
|
+
"aria-disabled": i || void 0,
|
|
144
|
+
"aria-readonly": t || void 0,
|
|
145
|
+
"aria-labelledby": y,
|
|
146
|
+
[Fe]: c ? "" : void 0,
|
|
147
|
+
id: z,
|
|
148
|
+
disabled: i,
|
|
149
|
+
onKeyDown(f) {
|
|
150
|
+
f.key === "Enter" && f.preventDefault();
|
|
151
|
+
},
|
|
152
|
+
onClick(f) {
|
|
153
|
+
f.defaultPrevented || i || t || (f.preventDefault(), C.current?.click());
|
|
154
|
+
},
|
|
155
|
+
onFocus(f) {
|
|
156
|
+
f.defaultPrevented || i || t || !H || (C.current?.click(), J(!1));
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
getButtonProps: X,
|
|
160
|
+
buttonRef: K
|
|
161
|
+
} = He({
|
|
162
|
+
disabled: i,
|
|
163
|
+
native: b
|
|
164
|
+
}), Z = o.useMemo(() => ({
|
|
165
|
+
type: "radio",
|
|
166
|
+
ref: S,
|
|
167
|
+
id: O,
|
|
168
|
+
tabIndex: -1,
|
|
169
|
+
style: pe,
|
|
170
|
+
"aria-hidden": !0,
|
|
171
|
+
disabled: i,
|
|
172
|
+
checked: c,
|
|
173
|
+
required: x,
|
|
174
|
+
readOnly: t,
|
|
175
|
+
onChange(f) {
|
|
176
|
+
if (f.nativeEvent.defaultPrevented || i || t || s === void 0)
|
|
177
|
+
return;
|
|
178
|
+
const ie = Ke(Le, f.nativeEvent);
|
|
179
|
+
ie.isCanceled || (B(!0), l(s !== D.initialValue), I(!0), w(s, ie));
|
|
180
|
+
},
|
|
181
|
+
onFocus() {
|
|
182
|
+
k.current?.focus();
|
|
183
|
+
}
|
|
184
|
+
}), [c, i, O, S, t, x, w, l, B, I, D.initialValue, s]), M = o.useMemo(() => ({
|
|
185
|
+
...j,
|
|
186
|
+
required: x,
|
|
187
|
+
disabled: i,
|
|
188
|
+
readOnly: t,
|
|
189
|
+
checked: c
|
|
190
|
+
}), [j, i, t, c, x]), ee = o.useMemo(() => M, [M]), L = w !== F, U = [u, P, k, K], d = [Q, v, W?.getValidationProps ?? ce, E, X], Y = ne("span", r, {
|
|
191
|
+
enabled: !L,
|
|
192
|
+
state: M,
|
|
193
|
+
ref: U,
|
|
194
|
+
props: d,
|
|
195
|
+
stateAttributesMapping: oe
|
|
196
|
+
});
|
|
197
|
+
return /* @__PURE__ */ re(se.Provider, {
|
|
198
|
+
value: ee,
|
|
199
|
+
children: [L ? /* @__PURE__ */ p(Je, {
|
|
200
|
+
tag: "span",
|
|
201
|
+
render: h,
|
|
202
|
+
className: R,
|
|
203
|
+
state: M,
|
|
204
|
+
refs: U,
|
|
205
|
+
props: d,
|
|
206
|
+
stateAttributesMapping: oe
|
|
207
|
+
}) : Y, /* @__PURE__ */ p("input", {
|
|
208
|
+
...Z
|
|
209
|
+
})]
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
process.env.NODE_ENV !== "production" && (be.displayName = "RadioRoot");
|
|
213
|
+
const _e = /* @__PURE__ */ o.forwardRef(function(r, u) {
|
|
214
|
+
const {
|
|
215
|
+
render: h,
|
|
216
|
+
className: R,
|
|
217
|
+
keepMounted: m = !1,
|
|
218
|
+
...n
|
|
219
|
+
} = r, a = Ae(), s = a.checked, {
|
|
220
|
+
transitionStatus: g,
|
|
221
|
+
setMounted: b
|
|
222
|
+
} = je(s), _ = o.useMemo(() => ({
|
|
223
|
+
...a,
|
|
224
|
+
transitionStatus: g
|
|
225
|
+
}), [a, g]), E = o.useRef(null), N = m || s, V = ne("span", r, {
|
|
226
|
+
enabled: N,
|
|
227
|
+
ref: [u, E],
|
|
228
|
+
state: _,
|
|
229
|
+
props: n,
|
|
230
|
+
stateAttributesMapping: oe
|
|
231
|
+
});
|
|
232
|
+
return Be({
|
|
233
|
+
open: s,
|
|
234
|
+
ref: E,
|
|
235
|
+
onComplete() {
|
|
236
|
+
s || b(!1);
|
|
237
|
+
}
|
|
238
|
+
}), N ? V : null;
|
|
239
|
+
});
|
|
240
|
+
process.env.NODE_ENV !== "production" && (_e.displayName = "RadioIndicator");
|
|
241
|
+
const Qe = [Oe], ve = /* @__PURE__ */ o.forwardRef(function(r, u) {
|
|
242
|
+
const {
|
|
243
|
+
render: h,
|
|
244
|
+
className: R,
|
|
245
|
+
disabled: m,
|
|
246
|
+
readOnly: n,
|
|
247
|
+
required: a,
|
|
248
|
+
onValueChange: s,
|
|
249
|
+
value: g,
|
|
250
|
+
defaultValue: b,
|
|
251
|
+
name: _,
|
|
252
|
+
inputRef: E,
|
|
253
|
+
id: N,
|
|
254
|
+
...V
|
|
255
|
+
} = r, {
|
|
256
|
+
setTouched: q,
|
|
257
|
+
setFocused: T,
|
|
258
|
+
shouldValidateOnChange: w,
|
|
259
|
+
validationMode: H,
|
|
260
|
+
name: J,
|
|
261
|
+
disabled: W,
|
|
262
|
+
state: P,
|
|
263
|
+
validation: l,
|
|
264
|
+
setDirty: D,
|
|
265
|
+
setFilled: B,
|
|
266
|
+
validityData: I
|
|
267
|
+
} = he(), {
|
|
268
|
+
labelId: j
|
|
269
|
+
} = Re(), {
|
|
270
|
+
clearErrors: $
|
|
271
|
+
} = we(), A = We(!0), y = W || m, v = J ?? _, i = me(N), [t, x] = Ie({
|
|
272
|
+
controlled: g,
|
|
273
|
+
default: b,
|
|
274
|
+
name: "RadioGroup",
|
|
275
|
+
state: "value"
|
|
276
|
+
}), c = G(s), k = G((d, Y) => {
|
|
277
|
+
c(d, Y), !Y.isCanceled && x(d);
|
|
278
|
+
}), C = o.useRef(null), S = G((d) => {
|
|
279
|
+
C.current == null && d != null && (C.current = d);
|
|
280
|
+
});
|
|
281
|
+
Se({
|
|
282
|
+
id: i,
|
|
283
|
+
commit: l.commit,
|
|
284
|
+
value: t,
|
|
285
|
+
controlRef: C,
|
|
286
|
+
name: v,
|
|
287
|
+
getValue: () => t ?? null
|
|
288
|
+
}), Ge(t, () => {
|
|
289
|
+
$(v), D(t !== I.initialValue), B(t != null), w() ? l.commit(t) : l.commit(t, !0);
|
|
290
|
+
});
|
|
291
|
+
const [z, O] = o.useState(!1), Q = G((d) => {
|
|
292
|
+
qe(d.currentTarget, d.relatedTarget) || (q(!0), T(!1), H === "onBlur" && l.commit(t));
|
|
293
|
+
}), X = G((d) => {
|
|
294
|
+
d.key.startsWith("Arrow") && (q(!0), O(!0), T(!0));
|
|
295
|
+
}), K = o.useMemo(() => t == null ? "" : typeof t == "string" ? t : JSON.stringify(t), [t]), Z = fe(l.inputRef, E), M = ke({
|
|
296
|
+
value: K,
|
|
297
|
+
ref: Z,
|
|
298
|
+
id: i,
|
|
299
|
+
name: K ? v : void 0,
|
|
300
|
+
disabled: y,
|
|
301
|
+
readOnly: n,
|
|
302
|
+
required: a,
|
|
303
|
+
"aria-labelledby": V["aria-labelledby"] ?? A?.legendId,
|
|
304
|
+
"aria-hidden": !0,
|
|
305
|
+
tabIndex: -1,
|
|
306
|
+
style: pe,
|
|
307
|
+
onChange: F,
|
|
308
|
+
// suppress a Next.js error
|
|
309
|
+
onFocus() {
|
|
310
|
+
C.current?.focus();
|
|
311
|
+
}
|
|
312
|
+
}, l.getInputValidationProps), ee = o.useMemo(() => ({
|
|
313
|
+
...P,
|
|
314
|
+
disabled: y ?? !1,
|
|
315
|
+
required: a ?? !1,
|
|
316
|
+
readOnly: n ?? !1
|
|
317
|
+
}), [P, y, n, a]), L = o.useMemo(() => ({
|
|
318
|
+
...P,
|
|
319
|
+
checkedValue: t,
|
|
320
|
+
disabled: y,
|
|
321
|
+
validation: l,
|
|
322
|
+
name: v,
|
|
323
|
+
onValueChange: c,
|
|
324
|
+
readOnly: n,
|
|
325
|
+
registerControlRef: S,
|
|
326
|
+
required: a,
|
|
327
|
+
setCheckedValue: k,
|
|
328
|
+
setTouched: O,
|
|
329
|
+
touched: z
|
|
330
|
+
}), [t, y, l, P, v, c, n, S, a, k, O, z]), U = {
|
|
331
|
+
role: "radiogroup",
|
|
332
|
+
"aria-required": a || void 0,
|
|
333
|
+
"aria-disabled": y || void 0,
|
|
334
|
+
"aria-readonly": n || void 0,
|
|
335
|
+
"aria-labelledby": j,
|
|
336
|
+
onFocus() {
|
|
337
|
+
T(!0);
|
|
338
|
+
},
|
|
339
|
+
onBlur: Q,
|
|
340
|
+
onKeyDownCapture: X
|
|
341
|
+
};
|
|
342
|
+
return /* @__PURE__ */ re(ae.Provider, {
|
|
343
|
+
value: L,
|
|
344
|
+
children: [/* @__PURE__ */ p(Te, {
|
|
345
|
+
render: h,
|
|
346
|
+
className: R,
|
|
347
|
+
state: ee,
|
|
348
|
+
props: [U, l.getValidationProps, V],
|
|
349
|
+
refs: [u],
|
|
350
|
+
stateAttributesMapping: Ce,
|
|
351
|
+
enableHomeAndEndKeys: !1,
|
|
352
|
+
modifierKeys: Qe
|
|
353
|
+
}), /* @__PURE__ */ p("input", {
|
|
354
|
+
...M
|
|
355
|
+
})]
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
process.env.NODE_ENV !== "production" && (ve.displayName = "RadioGroup");
|
|
359
|
+
const Xe = {
|
|
360
|
+
"radio-group": "_radio-group_rje5l_1"
|
|
361
|
+
}, Ze = "_radio_jgw1z_1", et = "_radio__indicator_jgw1z_8", tt = "_radio__label_jgw1z_31", te = {
|
|
362
|
+
radio: Ze,
|
|
363
|
+
radio__indicator: et,
|
|
364
|
+
radio__label: tt
|
|
365
|
+
}, xe = Ee("primary");
|
|
366
|
+
function Nt({
|
|
367
|
+
color: e = "primary",
|
|
368
|
+
className: r,
|
|
369
|
+
...u
|
|
370
|
+
}) {
|
|
371
|
+
return /* @__PURE__ */ p(xe.Provider, { value: e, children: /* @__PURE__ */ p(
|
|
372
|
+
ve,
|
|
373
|
+
{
|
|
374
|
+
className: ue(Xe["radio-group"], r),
|
|
375
|
+
...u
|
|
376
|
+
}
|
|
377
|
+
) });
|
|
378
|
+
}
|
|
379
|
+
function Vt({
|
|
380
|
+
color: e,
|
|
381
|
+
label: r,
|
|
382
|
+
className: u,
|
|
383
|
+
...h
|
|
384
|
+
}) {
|
|
385
|
+
const R = Ne(xe), m = e || R || "primary", n = /* @__PURE__ */ p(
|
|
386
|
+
Pe,
|
|
387
|
+
{
|
|
388
|
+
render: /* @__PURE__ */ p(be, { ...h }),
|
|
389
|
+
interactive: "fill-outline",
|
|
390
|
+
color: m,
|
|
391
|
+
className: ue(te.radio, u),
|
|
392
|
+
children: /* @__PURE__ */ p(_e, { className: te.radio__indicator })
|
|
393
|
+
}
|
|
394
|
+
);
|
|
395
|
+
return r ? /* @__PURE__ */ re("label", { className: te.radio__label, children: [
|
|
396
|
+
n,
|
|
397
|
+
" ",
|
|
398
|
+
/* @__PURE__ */ p(Ve, { children: r })
|
|
399
|
+
] }) : n;
|
|
400
|
+
}
|
|
401
|
+
export {
|
|
402
|
+
Vt as Radio,
|
|
403
|
+
Nt as RadioGroup
|
|
404
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface SearchBarProps extends React.ComponentPropsWithoutRef<"input"> {
|
|
3
|
+
/**
|
|
4
|
+
* Is the search bar loading or processing?
|
|
5
|
+
*/
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Called when the input is cleared
|
|
9
|
+
*/
|
|
10
|
+
onClear?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function SearchBar({ loading, onClear, className, ...props }: SearchBarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as _ } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Icon as o } from "../icon/index.js";
|
|
5
|
+
import { IconButton as m } from "../icon-button/index.js";
|
|
6
|
+
import { Input as t } from "../input/index.js";
|
|
7
|
+
import { Spinner as h } from "../spinner/index.js";
|
|
8
|
+
import { View as s } from "../view/index.js";
|
|
9
|
+
import '../../index4.css';const a = {
|
|
10
|
+
"search-bar": "_search-bar_1ulql_1",
|
|
11
|
+
"search-bar__input": "_search-bar__input_1ulql_6",
|
|
12
|
+
"search-bar__icon": "_search-bar__icon_1ulql_14",
|
|
13
|
+
"search-bar__icon_close": "_search-bar__icon_close_1ulql_26"
|
|
14
|
+
};
|
|
15
|
+
function I({
|
|
16
|
+
loading: e,
|
|
17
|
+
onClear: l,
|
|
18
|
+
className: i,
|
|
19
|
+
...c
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ n(s, { className: _(a["search-bar"], i), children: [
|
|
22
|
+
/* @__PURE__ */ r(t, { className: a["search-bar__input"], ...c }),
|
|
23
|
+
!e && !c.value ? /* @__PURE__ */ r(s, { className: a["search-bar__icon"], children: /* @__PURE__ */ r(o, { name: "search-line" }) }) : null,
|
|
24
|
+
e ? /* @__PURE__ */ r(h, { className: a["search-bar__icon"] }) : null,
|
|
25
|
+
!e && c.value ? /* @__PURE__ */ r(
|
|
26
|
+
s,
|
|
27
|
+
{
|
|
28
|
+
className: _(
|
|
29
|
+
a["search-bar__icon"],
|
|
30
|
+
a["search-bar__icon_close"]
|
|
31
|
+
),
|
|
32
|
+
children: /* @__PURE__ */ r(
|
|
33
|
+
m,
|
|
34
|
+
{
|
|
35
|
+
icon: "close-line",
|
|
36
|
+
alt: "Clear",
|
|
37
|
+
size: "sm",
|
|
38
|
+
disabled: c.disabled,
|
|
39
|
+
onClick: l
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
) : null
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
I as SearchBar
|
|
48
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from '@base-ui/react/select';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
export declare function Select<Value>({ placeholder, className, style, ...props }: SelectPrimitive.Root.Props<Value, boolean> & {
|
|
4
|
+
/**
|
|
5
|
+
* Select placeholder if no value is chosen.
|
|
6
|
+
*
|
|
7
|
+
* Behaves differently depending on the type of select.
|
|
8
|
+
* For a normal select, we simply render an item with a value of null.
|
|
9
|
+
* For a `multiple` select, we replace the {@link https://base-ui.com/react/components/select#multiple-selection renderValue} function.
|
|
10
|
+
*/
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
/** Apply styles to SelectPrimitive.trigger */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Apply styles to SelectPrimitive.trigger */
|
|
15
|
+
style?: CSSProperties;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|