@koide-labs/ui 0.0.0 → 0.0.1
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 +23 -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,402 @@
|
|
|
1
|
+
import { jsx as P, jsxs as q } from "react/jsx-runtime";
|
|
2
|
+
import { c as pe } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { Surface as fe } from "../surface/index.js";
|
|
4
|
+
import { t as z, T as me } from "../../tooltip-arrow-C1qXdi5T.js";
|
|
5
|
+
import { d as Pe, e as Ce, f as we, p as U, t as ge } from "../../transitions.module-CWX8e5cx.js";
|
|
6
|
+
import * as e from "react";
|
|
7
|
+
import * as ve from "react-dom";
|
|
8
|
+
import { u as Ee } from "../../useControlled-Du4sJyMj.js";
|
|
9
|
+
import { u as V } from "../../useStableCallback-CkTrVkNX.js";
|
|
10
|
+
import { f as F } from "../../formatErrorMessage-BqPuTBN-.js";
|
|
11
|
+
import { d as ye, i as Re } from "../../floating-ui.utils.dom-C7FS5id0.js";
|
|
12
|
+
import { u as he } from "../../useTimeout-CflX-kz3.js";
|
|
13
|
+
import { c as G, b as L, t as J, a as Ne, e as Oe } from "../../createBaseUIEventDetails-D8M2Yl-a.js";
|
|
14
|
+
import { h as Q, f as X, d as xe } from "../../element-CZEOj04G.js";
|
|
15
|
+
import { a as ee, t as Se } from "../../useOpenChangeComplete-Dse9kY9E.js";
|
|
16
|
+
import { u as De } from "../../useTransitionStatus-CUfcuGAV.js";
|
|
17
|
+
import { u as Me, a as _e, g as be } from "../../getDisabledMountTransitionStyles-YfHPge6T.js";
|
|
18
|
+
import { u as Ve, s as Ae } from "../../safePolygon-DWy1dGKJ.js";
|
|
19
|
+
import { u as Te } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
|
|
20
|
+
import { u as A } from "../../useRenderElement-DwToLA61.js";
|
|
21
|
+
import { F as Ie } from "../../FloatingPortalLite-DVyq6YhV.js";
|
|
22
|
+
import { P as Le } from "../../FloatingPortal-tWyuKRSN.js";
|
|
23
|
+
import '../../index28.css';const H = /* @__PURE__ */ e.createContext(void 0);
|
|
24
|
+
process.env.NODE_ENV !== "production" && (H.displayName = "PreviewCardRootContext");
|
|
25
|
+
function x() {
|
|
26
|
+
const t = e.useContext(H);
|
|
27
|
+
if (t === void 0)
|
|
28
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: PreviewCardRootContext is missing. PreviewCard parts must be placed within <PreviewCard.Root>." : F(50));
|
|
29
|
+
return t;
|
|
30
|
+
}
|
|
31
|
+
const Z = 600, $ = 300;
|
|
32
|
+
function Ue(t, s = {}) {
|
|
33
|
+
const d = t.useState("domReferenceElement"), f = t.context.dataRef, {
|
|
34
|
+
delay: u
|
|
35
|
+
} = s, a = he(), n = e.useRef(!1);
|
|
36
|
+
e.useEffect(() => {
|
|
37
|
+
const r = ye(d);
|
|
38
|
+
function c() {
|
|
39
|
+
const i = t.select("domReferenceElement");
|
|
40
|
+
!t.select("open") && Re(i) && i === Q(xe(i)) && (n.current = !0);
|
|
41
|
+
}
|
|
42
|
+
return r.addEventListener("blur", c), () => {
|
|
43
|
+
r.removeEventListener("blur", c);
|
|
44
|
+
};
|
|
45
|
+
}, [t, d]);
|
|
46
|
+
const p = e.useMemo(() => ({
|
|
47
|
+
onFocus(r) {
|
|
48
|
+
const {
|
|
49
|
+
nativeEvent: c
|
|
50
|
+
} = r, i = typeof u == "function" ? u() : u;
|
|
51
|
+
a.start(i ?? 0, () => {
|
|
52
|
+
t.setOpen(!0, G(L, c));
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
onBlur(r) {
|
|
56
|
+
n.current = !1;
|
|
57
|
+
const {
|
|
58
|
+
relatedTarget: c,
|
|
59
|
+
nativeEvent: i
|
|
60
|
+
} = r;
|
|
61
|
+
a.start(0, () => {
|
|
62
|
+
const l = t.select("domReferenceElement"), m = Q(l ? l.ownerDocument : document);
|
|
63
|
+
!c && m === l || X(f.current.floatingContext?.refs.floating.current, m) || X(l, m) || t.setOpen(!1, G(L, i));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}), [u, t, f, a]);
|
|
67
|
+
return e.useMemo(() => ({
|
|
68
|
+
reference: p
|
|
69
|
+
}), [p]);
|
|
70
|
+
}
|
|
71
|
+
function Fe(t) {
|
|
72
|
+
const {
|
|
73
|
+
open: s,
|
|
74
|
+
defaultOpen: d,
|
|
75
|
+
onOpenChange: f,
|
|
76
|
+
onOpenChangeComplete: u,
|
|
77
|
+
actionsRef: a
|
|
78
|
+
} = t, n = e.useRef(Z), p = e.useRef($), r = V((v) => {
|
|
79
|
+
n.current = v.delay ?? Z, p.current = v.closeDelay ?? $;
|
|
80
|
+
}), [c, i] = e.useState(null), [l, m] = e.useState(null), [w, h] = e.useState(), S = e.useRef(null), [C, T] = Ee({
|
|
81
|
+
controlled: s,
|
|
82
|
+
default: d,
|
|
83
|
+
name: "PreviewCard",
|
|
84
|
+
state: "open"
|
|
85
|
+
}), y = V(f), {
|
|
86
|
+
mounted: R,
|
|
87
|
+
setMounted: N,
|
|
88
|
+
transitionStatus: D
|
|
89
|
+
} = De(C), O = V(() => {
|
|
90
|
+
N(!1), u?.(!1);
|
|
91
|
+
});
|
|
92
|
+
ee({
|
|
93
|
+
enabled: !a,
|
|
94
|
+
open: C,
|
|
95
|
+
ref: S,
|
|
96
|
+
onComplete() {
|
|
97
|
+
C || O();
|
|
98
|
+
}
|
|
99
|
+
}), e.useImperativeHandle(a, () => ({
|
|
100
|
+
unmount: O
|
|
101
|
+
}), [O]);
|
|
102
|
+
const o = V((v, E) => {
|
|
103
|
+
const de = E.reason === J, Y = v && E.reason === L, ue = !v && (E.reason === Ne || E.reason === Oe);
|
|
104
|
+
if (y(v, E), E.isCanceled)
|
|
105
|
+
return;
|
|
106
|
+
function K() {
|
|
107
|
+
T(v);
|
|
108
|
+
}
|
|
109
|
+
de ? ve.flushSync(K) : K(), Y || ue ? h(Y ? "focus" : "dismiss") : E.reason === J && h(void 0);
|
|
110
|
+
}), g = Me({
|
|
111
|
+
elements: {
|
|
112
|
+
reference: c,
|
|
113
|
+
floating: l
|
|
114
|
+
},
|
|
115
|
+
open: C,
|
|
116
|
+
onOpenChange: o
|
|
117
|
+
}), M = w, _ = () => n.current, I = () => p.current, b = Ve(g, {
|
|
118
|
+
mouseOnly: !0,
|
|
119
|
+
move: !1,
|
|
120
|
+
handleClose: Ae(),
|
|
121
|
+
restMs: _,
|
|
122
|
+
delay: () => ({
|
|
123
|
+
close: I()
|
|
124
|
+
})
|
|
125
|
+
}), ie = Ue(g, {
|
|
126
|
+
delay: _
|
|
127
|
+
}), ce = Pe(g), {
|
|
128
|
+
getReferenceProps: j,
|
|
129
|
+
getFloatingProps: W
|
|
130
|
+
} = Ce([b, ie, ce]), le = e.useMemo(() => ({
|
|
131
|
+
open: C,
|
|
132
|
+
setOpen: o,
|
|
133
|
+
mounted: R,
|
|
134
|
+
setMounted: N,
|
|
135
|
+
setTriggerElement: i,
|
|
136
|
+
positionerElement: l,
|
|
137
|
+
setPositionerElement: m,
|
|
138
|
+
popupRef: S,
|
|
139
|
+
triggerProps: j(),
|
|
140
|
+
popupProps: W(),
|
|
141
|
+
floatingRootContext: g,
|
|
142
|
+
instantType: M,
|
|
143
|
+
transitionStatus: D,
|
|
144
|
+
onOpenChangeComplete: u,
|
|
145
|
+
writeDelayRefs: r
|
|
146
|
+
}), [C, o, R, N, l, j, W, g, M, D, u, r]);
|
|
147
|
+
return /* @__PURE__ */ P(H.Provider, {
|
|
148
|
+
value: le,
|
|
149
|
+
children: t.children
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
const k = /* @__PURE__ */ e.createContext(void 0);
|
|
153
|
+
process.env.NODE_ENV !== "production" && (k.displayName = "PreviewCardPortalContext");
|
|
154
|
+
function He() {
|
|
155
|
+
const t = e.useContext(k);
|
|
156
|
+
if (t === void 0)
|
|
157
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <PreviewCard.Portal> is missing." : F(48));
|
|
158
|
+
return t;
|
|
159
|
+
}
|
|
160
|
+
const te = /* @__PURE__ */ e.forwardRef(function(s, d) {
|
|
161
|
+
const {
|
|
162
|
+
keepMounted: f = !1,
|
|
163
|
+
...u
|
|
164
|
+
} = s, {
|
|
165
|
+
mounted: a
|
|
166
|
+
} = x();
|
|
167
|
+
return a || f ? /* @__PURE__ */ P(k.Provider, {
|
|
168
|
+
value: f,
|
|
169
|
+
children: /* @__PURE__ */ P(Ie, {
|
|
170
|
+
ref: d,
|
|
171
|
+
...u
|
|
172
|
+
})
|
|
173
|
+
}) : null;
|
|
174
|
+
});
|
|
175
|
+
process.env.NODE_ENV !== "production" && (te.displayName = "PreviewCardPortal");
|
|
176
|
+
const oe = /* @__PURE__ */ e.forwardRef(function(s, d) {
|
|
177
|
+
const {
|
|
178
|
+
render: f,
|
|
179
|
+
className: u,
|
|
180
|
+
delay: a,
|
|
181
|
+
closeDelay: n,
|
|
182
|
+
...p
|
|
183
|
+
} = s, {
|
|
184
|
+
open: r,
|
|
185
|
+
triggerProps: c,
|
|
186
|
+
setTriggerElement: i,
|
|
187
|
+
writeDelayRefs: l
|
|
188
|
+
} = x();
|
|
189
|
+
Te(() => {
|
|
190
|
+
l({
|
|
191
|
+
delay: a,
|
|
192
|
+
closeDelay: n
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
const m = e.useMemo(() => ({
|
|
196
|
+
open: r
|
|
197
|
+
}), [r]);
|
|
198
|
+
return A("a", s, {
|
|
199
|
+
ref: [i, d],
|
|
200
|
+
state: m,
|
|
201
|
+
props: [c, p],
|
|
202
|
+
stateAttributesMapping: we
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
process.env.NODE_ENV !== "production" && (oe.displayName = "PreviewCardTrigger");
|
|
206
|
+
const B = /* @__PURE__ */ e.createContext(void 0);
|
|
207
|
+
process.env.NODE_ENV !== "production" && (B.displayName = "PreviewCardPositionerContext");
|
|
208
|
+
function ne() {
|
|
209
|
+
const t = e.useContext(B);
|
|
210
|
+
if (t === void 0)
|
|
211
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <PreviewCard.Popup> and <PreviewCard.Arrow> must be used within the <PreviewCard.Positioner> component" : F(49));
|
|
212
|
+
return t;
|
|
213
|
+
}
|
|
214
|
+
const re = /* @__PURE__ */ e.forwardRef(function(s, d) {
|
|
215
|
+
const {
|
|
216
|
+
render: f,
|
|
217
|
+
className: u,
|
|
218
|
+
anchor: a,
|
|
219
|
+
positionMethod: n = "absolute",
|
|
220
|
+
side: p = "bottom",
|
|
221
|
+
align: r = "center",
|
|
222
|
+
sideOffset: c = 0,
|
|
223
|
+
alignOffset: i = 0,
|
|
224
|
+
collisionBoundary: l = "clipping-ancestors",
|
|
225
|
+
collisionPadding: m = 5,
|
|
226
|
+
arrowPadding: w = 5,
|
|
227
|
+
sticky: h = !1,
|
|
228
|
+
disableAnchorTracking: S = !1,
|
|
229
|
+
collisionAvoidance: C = Le,
|
|
230
|
+
...T
|
|
231
|
+
} = s, {
|
|
232
|
+
open: y,
|
|
233
|
+
mounted: R,
|
|
234
|
+
floatingRootContext: N,
|
|
235
|
+
setPositionerElement: D
|
|
236
|
+
} = x(), O = He(), o = _e({
|
|
237
|
+
anchor: a,
|
|
238
|
+
floatingRootContext: N,
|
|
239
|
+
positionMethod: n,
|
|
240
|
+
mounted: R,
|
|
241
|
+
side: p,
|
|
242
|
+
sideOffset: c,
|
|
243
|
+
align: r,
|
|
244
|
+
alignOffset: i,
|
|
245
|
+
arrowPadding: w,
|
|
246
|
+
collisionBoundary: l,
|
|
247
|
+
collisionPadding: m,
|
|
248
|
+
sticky: h,
|
|
249
|
+
disableAnchorTracking: S,
|
|
250
|
+
keepMounted: O,
|
|
251
|
+
collisionAvoidance: C
|
|
252
|
+
}), g = e.useMemo(() => {
|
|
253
|
+
const b = {};
|
|
254
|
+
return y || (b.pointerEvents = "none"), {
|
|
255
|
+
role: "presentation",
|
|
256
|
+
hidden: !R,
|
|
257
|
+
style: {
|
|
258
|
+
...o.positionerStyles,
|
|
259
|
+
...b
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
}, [y, R, o.positionerStyles]), M = e.useMemo(() => ({
|
|
263
|
+
open: y,
|
|
264
|
+
side: o.side,
|
|
265
|
+
align: o.align,
|
|
266
|
+
anchorHidden: o.anchorHidden
|
|
267
|
+
}), [y, o.side, o.align, o.anchorHidden]), _ = e.useMemo(() => ({
|
|
268
|
+
side: o.side,
|
|
269
|
+
align: o.align,
|
|
270
|
+
arrowRef: o.arrowRef,
|
|
271
|
+
arrowUncentered: o.arrowUncentered,
|
|
272
|
+
arrowStyles: o.arrowStyles
|
|
273
|
+
}), [o.side, o.align, o.arrowRef, o.arrowUncentered, o.arrowStyles]), I = A("div", s, {
|
|
274
|
+
state: M,
|
|
275
|
+
ref: [D, d],
|
|
276
|
+
props: [g, T],
|
|
277
|
+
stateAttributesMapping: U
|
|
278
|
+
});
|
|
279
|
+
return /* @__PURE__ */ P(B.Provider, {
|
|
280
|
+
value: _,
|
|
281
|
+
children: I
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
process.env.NODE_ENV !== "production" && (re.displayName = "PreviewCardPositioner");
|
|
285
|
+
const ke = {
|
|
286
|
+
...U,
|
|
287
|
+
...Se
|
|
288
|
+
}, se = /* @__PURE__ */ e.forwardRef(function(s, d) {
|
|
289
|
+
const {
|
|
290
|
+
className: f,
|
|
291
|
+
render: u,
|
|
292
|
+
...a
|
|
293
|
+
} = s, {
|
|
294
|
+
open: n,
|
|
295
|
+
transitionStatus: p,
|
|
296
|
+
popupRef: r,
|
|
297
|
+
onOpenChangeComplete: c,
|
|
298
|
+
popupProps: i
|
|
299
|
+
} = x(), {
|
|
300
|
+
side: l,
|
|
301
|
+
align: m
|
|
302
|
+
} = ne();
|
|
303
|
+
ee({
|
|
304
|
+
open: n,
|
|
305
|
+
ref: r,
|
|
306
|
+
onComplete() {
|
|
307
|
+
n && c?.(!0);
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
const w = e.useMemo(() => ({
|
|
311
|
+
open: n,
|
|
312
|
+
side: l,
|
|
313
|
+
align: m,
|
|
314
|
+
transitionStatus: p
|
|
315
|
+
}), [n, l, m, p]);
|
|
316
|
+
return A("div", s, {
|
|
317
|
+
ref: [r, d],
|
|
318
|
+
state: w,
|
|
319
|
+
props: [i, be(p), a],
|
|
320
|
+
stateAttributesMapping: ke
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
process.env.NODE_ENV !== "production" && (se.displayName = "PreviewCardPopup");
|
|
324
|
+
const ae = /* @__PURE__ */ e.forwardRef(function(s, d) {
|
|
325
|
+
const {
|
|
326
|
+
render: f,
|
|
327
|
+
className: u,
|
|
328
|
+
...a
|
|
329
|
+
} = s, {
|
|
330
|
+
open: n
|
|
331
|
+
} = x(), {
|
|
332
|
+
arrowRef: p,
|
|
333
|
+
side: r,
|
|
334
|
+
align: c,
|
|
335
|
+
arrowUncentered: i,
|
|
336
|
+
arrowStyles: l
|
|
337
|
+
} = ne(), m = e.useMemo(() => ({
|
|
338
|
+
open: n,
|
|
339
|
+
side: r,
|
|
340
|
+
align: c,
|
|
341
|
+
uncentered: i
|
|
342
|
+
}), [n, r, c, i]);
|
|
343
|
+
return A("div", s, {
|
|
344
|
+
state: m,
|
|
345
|
+
ref: [p, d],
|
|
346
|
+
props: [{
|
|
347
|
+
style: l,
|
|
348
|
+
"aria-hidden": !0
|
|
349
|
+
}, a],
|
|
350
|
+
stateAttributesMapping: U
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
process.env.NODE_ENV !== "production" && (ae.displayName = "PreviewCardArrow");
|
|
354
|
+
const Be = {
|
|
355
|
+
"preview-card": "_preview-card_1o167_1"
|
|
356
|
+
};
|
|
357
|
+
function ct({
|
|
358
|
+
align: t,
|
|
359
|
+
side: s,
|
|
360
|
+
background: d,
|
|
361
|
+
trigger: f,
|
|
362
|
+
children: u,
|
|
363
|
+
className: a,
|
|
364
|
+
...n
|
|
365
|
+
}) {
|
|
366
|
+
return /* @__PURE__ */ q(Fe, { ...n, children: [
|
|
367
|
+
f ? /* @__PURE__ */ P(oe, { render: f }) : null,
|
|
368
|
+
/* @__PURE__ */ P(te, { children: /* @__PURE__ */ P(
|
|
369
|
+
re,
|
|
370
|
+
{
|
|
371
|
+
align: t,
|
|
372
|
+
side: s,
|
|
373
|
+
sideOffset: 8,
|
|
374
|
+
children: /* @__PURE__ */ q(
|
|
375
|
+
se,
|
|
376
|
+
{
|
|
377
|
+
render: /* @__PURE__ */ P(fe, { background: d }),
|
|
378
|
+
className: pe(
|
|
379
|
+
z.tooltip,
|
|
380
|
+
Be["preview-card"],
|
|
381
|
+
ge.transition_scale,
|
|
382
|
+
a
|
|
383
|
+
),
|
|
384
|
+
children: [
|
|
385
|
+
/* @__PURE__ */ P(
|
|
386
|
+
ae,
|
|
387
|
+
{
|
|
388
|
+
className: z.tooltip__arrow,
|
|
389
|
+
children: /* @__PURE__ */ P(me, {})
|
|
390
|
+
}
|
|
391
|
+
),
|
|
392
|
+
u
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
)
|
|
396
|
+
}
|
|
397
|
+
) })
|
|
398
|
+
] });
|
|
399
|
+
}
|
|
400
|
+
export {
|
|
401
|
+
ct as PreviewCard
|
|
402
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Radio as RadioPrimitive } from '@base-ui/react/radio';
|
|
2
|
+
import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';
|
|
3
|
+
import { Color } from '../view';
|
|
4
|
+
export declare function RadioGroup({ color, className, ...props }: RadioGroupPrimitive.Props & {
|
|
5
|
+
/** Optional color for child radio elements. Defaults to "primary". */
|
|
6
|
+
color?: Color;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function Radio({ color, label, className, ...props }: RadioPrimitive.Root.Props & {
|
|
9
|
+
/** Optional label. If one is provided, we wrap radio in a label element. Otherwise, we just return a standard radio. */
|
|
10
|
+
label?: string;
|
|
11
|
+
/** Optional color. Defaults to the radio group color, often primary. */
|
|
12
|
+
color?: Color;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|