@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,636 @@
|
|
|
1
|
+
import { jsx as u, jsxs as Y } from "react/jsx-runtime";
|
|
2
|
+
import { c as Re } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { Heading as be } from "../heading/index.js";
|
|
4
|
+
import { Surface as Se } from "../surface/index.js";
|
|
5
|
+
import { Text as ye } from "../text/index.js";
|
|
6
|
+
import { t as ae, T as Oe } from "../../tooltip-arrow-C1qXdi5T.js";
|
|
7
|
+
import { View as Ie } from "../view/index.js";
|
|
8
|
+
import { R as xe, P as Ne, c as x, h as Me, d as Fe, e as de, u as _e, i as ke, f as we, j as Ae, k as De, p as ee, t as He } from "../../transitions.module-CWX8e5cx.js";
|
|
9
|
+
import * as n from "react";
|
|
10
|
+
import { u as Ve, a as Be, b as Le, I as Ue, F as Ge } from "../../InternalBackdrop-jYAiOJ8v.js";
|
|
11
|
+
import { f as q } from "../../formatErrorMessage-BqPuTBN-.js";
|
|
12
|
+
import * as Q from "react-dom";
|
|
13
|
+
import { T as Ke } from "../../useTimeout-CflX-kz3.js";
|
|
14
|
+
import { a as je, u as K } from "../../useRenderElement-DwToLA61.js";
|
|
15
|
+
import { u as ze } from "../../useOnMount-VRW6CK2u.js";
|
|
16
|
+
import { j as Ye, C as We, k as qe, i as Je, l as Qe, b as Xe, F as ce, h as Ze, P as $e } from "../../FloatingPortal-tWyuKRSN.js";
|
|
17
|
+
import { p as et, c as tt, u as ot, a as nt, b as st, d as rt } from "../../useSyncedFloatingRootContext-Dorsv-jf.js";
|
|
18
|
+
import { t as J, a as X, e as it, f as Z, c as $, i as at } from "../../createBaseUIEventDetails-D8M2Yl-a.js";
|
|
19
|
+
import { u as ct } from "../../useRole-oDBdbuwQ.js";
|
|
20
|
+
import { u as pe } from "../../useStableCallback-CkTrVkNX.js";
|
|
21
|
+
import { u as pt } from "../../useButton-DfIwsdb8.js";
|
|
22
|
+
import { u as te } from "../../useBaseUiId-B7WyxtIE.js";
|
|
23
|
+
import { u as ut, a as lt } from "../../useHoverReferenceInteraction-SfOBPoXM.js";
|
|
24
|
+
import { s as dt } from "../../safePolygon-DWy1dGKJ.js";
|
|
25
|
+
import { f as ft } from "../../element-CZEOj04G.js";
|
|
26
|
+
import { i as mt } from "../../inertValue-BCYGsdmf.js";
|
|
27
|
+
import { u as oe } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
|
|
28
|
+
import { a as gt, g as fe, b as vt } from "../../getDisabledMountTransitionStyles-YfHPge6T.js";
|
|
29
|
+
import { u as ht, a as Pt, t as Et } from "../../useOpenChangeComplete-Dse9kY9E.js";
|
|
30
|
+
import { i as Ct } from "../../floating-ui.utils.dom-C7FS5id0.js";
|
|
31
|
+
import { u as Tt } from "../../usePopupAutoResize-CNR6Ekmx.js";
|
|
32
|
+
import { u as Rt } from "../../DirectionContext-C2o_MF_i.js";
|
|
33
|
+
import { C as bt } from "../../composite-C9L5QmZL.js";
|
|
34
|
+
import { u as St } from "../../ToolbarRootContext-CvvL0Tk1.js";
|
|
35
|
+
import '../../index29.css';const ne = /* @__PURE__ */ n.createContext(void 0);
|
|
36
|
+
process.env.NODE_ENV !== "production" && (ne.displayName = "PopoverRootContext");
|
|
37
|
+
function V(t) {
|
|
38
|
+
const s = n.useContext(ne);
|
|
39
|
+
if (s === void 0 && !t)
|
|
40
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>." : q(47));
|
|
41
|
+
return s;
|
|
42
|
+
}
|
|
43
|
+
function yt() {
|
|
44
|
+
return {
|
|
45
|
+
...tt(),
|
|
46
|
+
disabled: !1,
|
|
47
|
+
modal: !1,
|
|
48
|
+
instantType: void 0,
|
|
49
|
+
openMethod: null,
|
|
50
|
+
openChangeReason: null,
|
|
51
|
+
titleElementId: void 0,
|
|
52
|
+
descriptionElementId: void 0,
|
|
53
|
+
stickIfOpen: !0,
|
|
54
|
+
nested: !1,
|
|
55
|
+
openOnHover: !1,
|
|
56
|
+
closeDelay: 0
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const Ot = {
|
|
60
|
+
...et,
|
|
61
|
+
disabled: x((t) => t.disabled),
|
|
62
|
+
instantType: x((t) => t.instantType),
|
|
63
|
+
openMethod: x((t) => t.openMethod),
|
|
64
|
+
openChangeReason: x((t) => t.openChangeReason),
|
|
65
|
+
modal: x((t) => t.modal),
|
|
66
|
+
stickIfOpen: x((t) => t.stickIfOpen),
|
|
67
|
+
titleElementId: x((t) => t.titleElementId),
|
|
68
|
+
descriptionElementId: x((t) => t.descriptionElementId),
|
|
69
|
+
openOnHover: x((t) => t.openOnHover),
|
|
70
|
+
closeDelay: x((t) => t.closeDelay)
|
|
71
|
+
};
|
|
72
|
+
class se extends xe {
|
|
73
|
+
constructor(s) {
|
|
74
|
+
const o = {
|
|
75
|
+
...yt(),
|
|
76
|
+
...s
|
|
77
|
+
};
|
|
78
|
+
o.open && s?.mounted === void 0 && (o.mounted = !0), super(o, {
|
|
79
|
+
popupRef: /* @__PURE__ */ n.createRef(),
|
|
80
|
+
backdropRef: /* @__PURE__ */ n.createRef(),
|
|
81
|
+
internalBackdropRef: /* @__PURE__ */ n.createRef(),
|
|
82
|
+
onOpenChange: void 0,
|
|
83
|
+
onOpenChangeComplete: void 0,
|
|
84
|
+
triggerFocusTargetRef: /* @__PURE__ */ n.createRef(),
|
|
85
|
+
beforeContentFocusGuardRef: /* @__PURE__ */ n.createRef(),
|
|
86
|
+
stickIfOpenTimeout: new Ke(),
|
|
87
|
+
triggerElements: new Ne()
|
|
88
|
+
}, Ot);
|
|
89
|
+
}
|
|
90
|
+
setOpen = (s, o) => {
|
|
91
|
+
const f = o.reason === J, P = o.reason === X && o.event.detail === 0, i = !s && (o.reason === it || o.reason == null);
|
|
92
|
+
if (o.preventUnmountOnClose = () => {
|
|
93
|
+
this.set("preventUnmountingOnClose", !0);
|
|
94
|
+
}, this.context.onOpenChange?.(s, o), o.isCanceled)
|
|
95
|
+
return;
|
|
96
|
+
const a = {
|
|
97
|
+
open: s,
|
|
98
|
+
nativeEvent: o.event,
|
|
99
|
+
reason: o.reason,
|
|
100
|
+
nested: this.state.nested,
|
|
101
|
+
triggerElement: o.trigger
|
|
102
|
+
};
|
|
103
|
+
this.state.floatingRootContext.context.events?.emit("openchange", a);
|
|
104
|
+
const e = () => {
|
|
105
|
+
const m = {
|
|
106
|
+
open: s,
|
|
107
|
+
openChangeReason: o.reason
|
|
108
|
+
}, r = o.trigger?.id ?? null;
|
|
109
|
+
(r || s) && (m.activeTriggerId = r, m.activeTriggerElement = o.trigger ?? null), this.update(m);
|
|
110
|
+
};
|
|
111
|
+
f ? (this.set("stickIfOpen", !0), this.context.stickIfOpenTimeout.start(Ye, () => {
|
|
112
|
+
this.set("stickIfOpen", !1);
|
|
113
|
+
}), Q.flushSync(e)) : e(), P || i ? this.set("instantType", P ? "click" : "dismiss") : o.reason === Z ? this.set("instantType", "focus") : this.set("instantType", void 0);
|
|
114
|
+
};
|
|
115
|
+
static useStore(s, o) {
|
|
116
|
+
const f = je(() => s ?? new se(o)).current;
|
|
117
|
+
return ze(f.disposeEffect), f;
|
|
118
|
+
}
|
|
119
|
+
disposeEffect = () => this.context.stickIfOpenTimeout.disposeEffect();
|
|
120
|
+
}
|
|
121
|
+
function ue({
|
|
122
|
+
props: t
|
|
123
|
+
}) {
|
|
124
|
+
const {
|
|
125
|
+
children: s,
|
|
126
|
+
open: o,
|
|
127
|
+
defaultOpen: f = !1,
|
|
128
|
+
onOpenChange: P,
|
|
129
|
+
onOpenChangeComplete: i,
|
|
130
|
+
modal: a = !1,
|
|
131
|
+
handle: l,
|
|
132
|
+
triggerId: e,
|
|
133
|
+
defaultTriggerId: m = null
|
|
134
|
+
} = t, r = se.useStore(l?.store, {
|
|
135
|
+
open: o ?? f,
|
|
136
|
+
modal: a,
|
|
137
|
+
activeTriggerId: e !== void 0 ? e : m
|
|
138
|
+
});
|
|
139
|
+
r.useControlledProp("open", o, f), r.useControlledProp("activeTriggerId", e, m);
|
|
140
|
+
const v = r.useState("open"), R = r.useState("positionerElement"), N = r.useState("payload"), M = r.useState("openChangeReason");
|
|
141
|
+
r.useContextCallback("onOpenChange", P), r.useContextCallback("onOpenChangeComplete", i);
|
|
142
|
+
const {
|
|
143
|
+
openMethod: p,
|
|
144
|
+
triggerProps: h,
|
|
145
|
+
reset: k
|
|
146
|
+
} = Ve(v);
|
|
147
|
+
ot(r);
|
|
148
|
+
const {
|
|
149
|
+
forceUnmount: c
|
|
150
|
+
} = nt(v, r, () => {
|
|
151
|
+
r.update({
|
|
152
|
+
stickIfOpen: !0,
|
|
153
|
+
openChangeReason: null
|
|
154
|
+
}), k();
|
|
155
|
+
});
|
|
156
|
+
Be(v && a === !0 && M !== J && p !== "touch", R), n.useEffect(() => {
|
|
157
|
+
v || r.context.stickIfOpenTimeout.clear();
|
|
158
|
+
}, [r, v]);
|
|
159
|
+
const F = n.useCallback((H) => {
|
|
160
|
+
const S = $(H);
|
|
161
|
+
return S.preventUnmountOnClose = () => {
|
|
162
|
+
r.set("preventUnmountingOnClose", !0);
|
|
163
|
+
}, S;
|
|
164
|
+
}, [r]), E = n.useCallback(() => {
|
|
165
|
+
r.setOpen(!1, F(at));
|
|
166
|
+
}, [r, F]);
|
|
167
|
+
n.useImperativeHandle(t.actionsRef, () => ({
|
|
168
|
+
unmount: c,
|
|
169
|
+
close: E
|
|
170
|
+
}), [c, E]);
|
|
171
|
+
const O = st({
|
|
172
|
+
popupStore: r,
|
|
173
|
+
onOpenChange: r.setOpen
|
|
174
|
+
}), I = Fe(O, {
|
|
175
|
+
outsidePressEvent: {
|
|
176
|
+
// Ensure `aria-hidden` on outside elements is removed immediately
|
|
177
|
+
// on outside press when trapping focus.
|
|
178
|
+
mouse: a === "trap-focus" ? "sloppy" : "intentional",
|
|
179
|
+
touch: "sloppy"
|
|
180
|
+
}
|
|
181
|
+
}), C = ct(O), {
|
|
182
|
+
getReferenceProps: w,
|
|
183
|
+
getFloatingProps: _,
|
|
184
|
+
getTriggerProps: b
|
|
185
|
+
} = de([I, C]), B = n.useMemo(() => w(h), [w, h]), A = n.useMemo(() => b(h), [b, h]), L = n.useMemo(() => _(), [_]);
|
|
186
|
+
r.useSyncedValues({
|
|
187
|
+
modal: a,
|
|
188
|
+
openMethod: p,
|
|
189
|
+
activeTriggerProps: B,
|
|
190
|
+
inactiveTriggerProps: A,
|
|
191
|
+
popupProps: L,
|
|
192
|
+
floatingRootContext: O,
|
|
193
|
+
nested: _e() != null
|
|
194
|
+
});
|
|
195
|
+
const D = n.useMemo(() => ({
|
|
196
|
+
store: r
|
|
197
|
+
}), [r]);
|
|
198
|
+
return /* @__PURE__ */ u(ne.Provider, {
|
|
199
|
+
value: D,
|
|
200
|
+
children: typeof s == "function" ? s({
|
|
201
|
+
payload: N
|
|
202
|
+
}) : s
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
function It(t) {
|
|
206
|
+
return V(!0) ? /* @__PURE__ */ u(ue, {
|
|
207
|
+
props: t
|
|
208
|
+
}) : /* @__PURE__ */ u(Me, {
|
|
209
|
+
children: /* @__PURE__ */ u(ue, {
|
|
210
|
+
props: t
|
|
211
|
+
})
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
const xt = 300, me = /* @__PURE__ */ n.forwardRef(function(s, o) {
|
|
215
|
+
const {
|
|
216
|
+
render: f,
|
|
217
|
+
className: P,
|
|
218
|
+
disabled: i = !1,
|
|
219
|
+
nativeButton: a = !0,
|
|
220
|
+
handle: l,
|
|
221
|
+
payload: e,
|
|
222
|
+
openOnHover: m = !1,
|
|
223
|
+
delay: r = xt,
|
|
224
|
+
closeDelay: v = 0,
|
|
225
|
+
id: R,
|
|
226
|
+
...N
|
|
227
|
+
} = s, M = V(!0), p = l?.store ?? M?.store;
|
|
228
|
+
if (!p)
|
|
229
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle." : q(74));
|
|
230
|
+
const h = te(R), k = p.useState("isTriggerActive", h), c = p.useState("floatingRootContext"), F = p.useState("isOpenedByTrigger", h), E = n.useRef(null), {
|
|
231
|
+
registerTrigger: O,
|
|
232
|
+
isMountedByThisTrigger: I
|
|
233
|
+
} = rt(h, E, p, {
|
|
234
|
+
payload: e,
|
|
235
|
+
disabled: i,
|
|
236
|
+
openOnHover: m,
|
|
237
|
+
closeDelay: v
|
|
238
|
+
}), C = p.useState("openChangeReason"), w = p.useState("stickIfOpen"), _ = p.useState("openMethod"), b = ut(c, {
|
|
239
|
+
enabled: c != null && m && (_ !== "touch" || C !== X),
|
|
240
|
+
mouseOnly: !0,
|
|
241
|
+
move: !1,
|
|
242
|
+
handleClose: dt(),
|
|
243
|
+
restMs: r,
|
|
244
|
+
delay: {
|
|
245
|
+
close: v
|
|
246
|
+
},
|
|
247
|
+
triggerElementRef: E,
|
|
248
|
+
isActiveTrigger: k
|
|
249
|
+
}), B = Le(c, {
|
|
250
|
+
enabled: c != null,
|
|
251
|
+
stickIfOpen: w
|
|
252
|
+
}), A = de([B]), L = p.useState("triggerProps", I), D = n.useMemo(() => ({
|
|
253
|
+
disabled: i,
|
|
254
|
+
open: F
|
|
255
|
+
}), [i, F]), {
|
|
256
|
+
getButtonProps: H,
|
|
257
|
+
buttonRef: S
|
|
258
|
+
} = pt({
|
|
259
|
+
disabled: i,
|
|
260
|
+
native: a
|
|
261
|
+
}), G = n.useMemo(() => ({
|
|
262
|
+
open(d) {
|
|
263
|
+
return d && C === X ? ke.open(d) : we.open(d);
|
|
264
|
+
}
|
|
265
|
+
}), [C]), T = K("button", s, {
|
|
266
|
+
state: D,
|
|
267
|
+
ref: [S, o, O, E],
|
|
268
|
+
props: [A.getReferenceProps(), b, L, {
|
|
269
|
+
[We]: "",
|
|
270
|
+
id: h
|
|
271
|
+
}, N, H],
|
|
272
|
+
stateAttributesMapping: G
|
|
273
|
+
}), U = n.useRef(null), j = pe((d) => {
|
|
274
|
+
Q.flushSync(() => {
|
|
275
|
+
p.setOpen(!1, $(Z, d.nativeEvent, d.currentTarget));
|
|
276
|
+
}), qe(U.current)?.focus();
|
|
277
|
+
}), z = pe((d) => {
|
|
278
|
+
const g = p.select("positionerElement");
|
|
279
|
+
if (g && Je(d, g))
|
|
280
|
+
p.context.beforeContentFocusGuardRef.current?.focus();
|
|
281
|
+
else {
|
|
282
|
+
Q.flushSync(() => {
|
|
283
|
+
p.setOpen(!1, $(Z, d.nativeEvent, d.currentTarget));
|
|
284
|
+
});
|
|
285
|
+
let y = Qe(E.current);
|
|
286
|
+
for (; y !== null && ft(g, y) || y?.hasAttribute("aria-hidden"); ) {
|
|
287
|
+
const W = y;
|
|
288
|
+
if (y = Xe(y), y === W)
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
y?.focus();
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
return k ? /* @__PURE__ */ Y(n.Fragment, {
|
|
295
|
+
children: [/* @__PURE__ */ u(ce, {
|
|
296
|
+
ref: U,
|
|
297
|
+
onFocus: j
|
|
298
|
+
}), /* @__PURE__ */ u(n.Fragment, {
|
|
299
|
+
children: T
|
|
300
|
+
}, h), /* @__PURE__ */ u(ce, {
|
|
301
|
+
ref: p.context.triggerFocusTargetRef,
|
|
302
|
+
onFocus: z
|
|
303
|
+
})]
|
|
304
|
+
}) : /* @__PURE__ */ u(n.Fragment, {
|
|
305
|
+
children: T
|
|
306
|
+
}, h);
|
|
307
|
+
});
|
|
308
|
+
process.env.NODE_ENV !== "production" && (me.displayName = "PopoverTrigger");
|
|
309
|
+
const re = /* @__PURE__ */ n.createContext(void 0);
|
|
310
|
+
process.env.NODE_ENV !== "production" && (re.displayName = "PopoverPortalContext");
|
|
311
|
+
function Nt() {
|
|
312
|
+
const t = n.useContext(re);
|
|
313
|
+
if (t === void 0)
|
|
314
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Popover.Portal> is missing." : q(45));
|
|
315
|
+
return t;
|
|
316
|
+
}
|
|
317
|
+
const ge = /* @__PURE__ */ n.forwardRef(function(s, o) {
|
|
318
|
+
const {
|
|
319
|
+
keepMounted: f = !1,
|
|
320
|
+
...P
|
|
321
|
+
} = s, {
|
|
322
|
+
store: i
|
|
323
|
+
} = V();
|
|
324
|
+
return i.useState("mounted") || f ? /* @__PURE__ */ u(re.Provider, {
|
|
325
|
+
value: f,
|
|
326
|
+
children: /* @__PURE__ */ u(Ze, {
|
|
327
|
+
ref: o,
|
|
328
|
+
...P,
|
|
329
|
+
renderGuards: !1
|
|
330
|
+
})
|
|
331
|
+
}) : null;
|
|
332
|
+
});
|
|
333
|
+
process.env.NODE_ENV !== "production" && (ge.displayName = "PopoverPortal");
|
|
334
|
+
const ie = /* @__PURE__ */ n.createContext(void 0);
|
|
335
|
+
process.env.NODE_ENV !== "production" && (ie.displayName = "PopoverPositionerContext");
|
|
336
|
+
function ve() {
|
|
337
|
+
const t = n.useContext(ie);
|
|
338
|
+
if (!t)
|
|
339
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>." : q(46));
|
|
340
|
+
return t;
|
|
341
|
+
}
|
|
342
|
+
const he = /* @__PURE__ */ n.forwardRef(function(s, o) {
|
|
343
|
+
const {
|
|
344
|
+
render: f,
|
|
345
|
+
className: P,
|
|
346
|
+
anchor: i,
|
|
347
|
+
positionMethod: a = "absolute",
|
|
348
|
+
side: l = "bottom",
|
|
349
|
+
align: e = "center",
|
|
350
|
+
sideOffset: m = 0,
|
|
351
|
+
alignOffset: r = 0,
|
|
352
|
+
collisionBoundary: v = "clipping-ancestors",
|
|
353
|
+
collisionPadding: R = 5,
|
|
354
|
+
arrowPadding: N = 5,
|
|
355
|
+
sticky: M = !1,
|
|
356
|
+
disableAnchorTracking: p = !1,
|
|
357
|
+
collisionAvoidance: h = $e,
|
|
358
|
+
...k
|
|
359
|
+
} = s, {
|
|
360
|
+
store: c
|
|
361
|
+
} = V(), F = Nt(), E = Ae(), O = c.useState("floatingRootContext"), I = c.useState("mounted"), C = c.useState("open"), w = c.useState("openChangeReason"), _ = c.useState("activeTriggerElement"), b = c.useState("modal"), B = c.useState("positionerElement"), A = c.useState("instantType"), L = c.useState("transitionStatus"), D = n.useRef(null), H = ht(B, !1, !1), S = gt({
|
|
362
|
+
anchor: i,
|
|
363
|
+
floatingRootContext: O,
|
|
364
|
+
positionMethod: a,
|
|
365
|
+
mounted: I,
|
|
366
|
+
side: l,
|
|
367
|
+
sideOffset: m,
|
|
368
|
+
align: e,
|
|
369
|
+
alignOffset: r,
|
|
370
|
+
arrowPadding: N,
|
|
371
|
+
collisionBoundary: v,
|
|
372
|
+
collisionPadding: R,
|
|
373
|
+
sticky: M,
|
|
374
|
+
disableAnchorTracking: p,
|
|
375
|
+
keepMounted: F,
|
|
376
|
+
nodeId: E,
|
|
377
|
+
collisionAvoidance: h,
|
|
378
|
+
adaptiveOrigin: vt
|
|
379
|
+
}), G = n.useMemo(() => {
|
|
380
|
+
const g = {};
|
|
381
|
+
return C || (g.pointerEvents = "none"), {
|
|
382
|
+
role: "presentation",
|
|
383
|
+
hidden: !I,
|
|
384
|
+
style: {
|
|
385
|
+
...S.positionerStyles,
|
|
386
|
+
...g
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
}, [C, I, S.positionerStyles]), T = n.useMemo(() => ({
|
|
390
|
+
props: G,
|
|
391
|
+
...S
|
|
392
|
+
}), [G, S]), U = O?.select("domReferenceElement");
|
|
393
|
+
oe(() => {
|
|
394
|
+
const g = U, y = D.current;
|
|
395
|
+
if (g && (D.current = g), y && g && g !== y) {
|
|
396
|
+
c.set("instantType", void 0);
|
|
397
|
+
const W = new AbortController();
|
|
398
|
+
return H(() => {
|
|
399
|
+
c.set("instantType", "trigger-change");
|
|
400
|
+
}, W.signal), () => {
|
|
401
|
+
W.abort();
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
}, [U, H, c]);
|
|
405
|
+
const j = n.useMemo(() => ({
|
|
406
|
+
open: C,
|
|
407
|
+
side: T.side,
|
|
408
|
+
align: T.align,
|
|
409
|
+
anchorHidden: T.anchorHidden,
|
|
410
|
+
instant: A
|
|
411
|
+
}), [C, T.side, T.align, T.anchorHidden, A]), z = n.useCallback((g) => {
|
|
412
|
+
c.set("positionerElement", g);
|
|
413
|
+
}, [c]), d = K("div", s, {
|
|
414
|
+
state: j,
|
|
415
|
+
props: [T.props, fe(L), k],
|
|
416
|
+
ref: [o, z],
|
|
417
|
+
stateAttributesMapping: ee
|
|
418
|
+
});
|
|
419
|
+
return /* @__PURE__ */ Y(ie.Provider, {
|
|
420
|
+
value: T,
|
|
421
|
+
children: [I && b === !0 && w !== J && /* @__PURE__ */ u(Ue, {
|
|
422
|
+
ref: c.context.internalBackdropRef,
|
|
423
|
+
inert: mt(!C),
|
|
424
|
+
cutout: _
|
|
425
|
+
}), /* @__PURE__ */ u(De, {
|
|
426
|
+
id: E,
|
|
427
|
+
children: d
|
|
428
|
+
})]
|
|
429
|
+
});
|
|
430
|
+
});
|
|
431
|
+
process.env.NODE_ENV !== "production" && (he.displayName = "PopoverPositioner");
|
|
432
|
+
const Mt = {
|
|
433
|
+
...ee,
|
|
434
|
+
...Et
|
|
435
|
+
}, Pe = /* @__PURE__ */ n.forwardRef(function(s, o) {
|
|
436
|
+
const {
|
|
437
|
+
className: f,
|
|
438
|
+
render: P,
|
|
439
|
+
initialFocus: i,
|
|
440
|
+
finalFocus: a,
|
|
441
|
+
...l
|
|
442
|
+
} = s, {
|
|
443
|
+
store: e
|
|
444
|
+
} = V(), m = ve(), r = St() != null, v = Rt(), R = e.useState("open"), N = e.useState("openMethod"), M = e.useState("instantType"), p = e.useState("transitionStatus"), h = e.useState("popupProps"), k = e.useState("titleElementId"), c = e.useState("descriptionElementId"), F = e.useState("modal"), E = e.useState("mounted"), O = e.useState("openChangeReason"), I = e.useState("popupElement"), C = e.useState("payload"), w = e.useState("positionerElement"), _ = e.useState("activeTriggerElement"), b = e.useState("floatingRootContext");
|
|
445
|
+
Pt({
|
|
446
|
+
open: R,
|
|
447
|
+
ref: e.context.popupRef,
|
|
448
|
+
onComplete() {
|
|
449
|
+
R && e.context.onOpenChangeComplete?.(!0);
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
const B = e.useState("disabled"), A = e.useState("openOnHover"), L = e.useState("closeDelay");
|
|
453
|
+
lt(b, {
|
|
454
|
+
enabled: A && !B,
|
|
455
|
+
closeDelay: L
|
|
456
|
+
});
|
|
457
|
+
function D(d) {
|
|
458
|
+
return d === "touch" ? e.context.popupRef.current : !0;
|
|
459
|
+
}
|
|
460
|
+
const H = i === void 0 ? D : i, S = n.useMemo(() => ({
|
|
461
|
+
open: R,
|
|
462
|
+
side: m.side,
|
|
463
|
+
align: m.align,
|
|
464
|
+
instant: M,
|
|
465
|
+
transitionStatus: p
|
|
466
|
+
}), [R, m.side, m.align, M, p]), G = n.useCallback((d) => {
|
|
467
|
+
e.set("popupElement", d);
|
|
468
|
+
}, [e]);
|
|
469
|
+
function T() {
|
|
470
|
+
b.context.events.emit("measure-layout");
|
|
471
|
+
}
|
|
472
|
+
function U(d, g) {
|
|
473
|
+
b.context.events.emit("measure-layout-complete", {
|
|
474
|
+
previousDimensions: d,
|
|
475
|
+
nextDimensions: g
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
const j = n.useCallback(() => e.context.triggerElements.size > 1, [e]);
|
|
479
|
+
Tt({
|
|
480
|
+
popupElement: I,
|
|
481
|
+
positionerElement: w,
|
|
482
|
+
mounted: E,
|
|
483
|
+
content: C,
|
|
484
|
+
enabled: j,
|
|
485
|
+
onMeasureLayout: T,
|
|
486
|
+
onMeasureLayoutComplete: U,
|
|
487
|
+
side: m.side,
|
|
488
|
+
direction: v
|
|
489
|
+
});
|
|
490
|
+
const z = K("div", s, {
|
|
491
|
+
state: S,
|
|
492
|
+
ref: [o, e.context.popupRef, G],
|
|
493
|
+
props: [h, {
|
|
494
|
+
"aria-labelledby": k,
|
|
495
|
+
"aria-describedby": c,
|
|
496
|
+
onKeyDown(d) {
|
|
497
|
+
r && bt.has(d.key) && d.stopPropagation();
|
|
498
|
+
}
|
|
499
|
+
}, fe(p), l],
|
|
500
|
+
stateAttributesMapping: Mt
|
|
501
|
+
});
|
|
502
|
+
return /* @__PURE__ */ u(Ge, {
|
|
503
|
+
context: b,
|
|
504
|
+
openInteractionType: N,
|
|
505
|
+
modal: F === "trap-focus",
|
|
506
|
+
disabled: !E || O === J,
|
|
507
|
+
initialFocus: H,
|
|
508
|
+
returnFocus: a,
|
|
509
|
+
restoreFocus: "popup",
|
|
510
|
+
previousFocusableElement: Ct(_) ? _ : void 0,
|
|
511
|
+
nextFocusableElement: e.context.triggerFocusTargetRef,
|
|
512
|
+
beforeContentFocusGuardRef: e.context.beforeContentFocusGuardRef,
|
|
513
|
+
children: z
|
|
514
|
+
});
|
|
515
|
+
});
|
|
516
|
+
process.env.NODE_ENV !== "production" && (Pe.displayName = "PopoverPopup");
|
|
517
|
+
const Ee = /* @__PURE__ */ n.forwardRef(function(s, o) {
|
|
518
|
+
const {
|
|
519
|
+
className: f,
|
|
520
|
+
render: P,
|
|
521
|
+
...i
|
|
522
|
+
} = s, {
|
|
523
|
+
store: a
|
|
524
|
+
} = V(), l = a.useState("open"), {
|
|
525
|
+
arrowRef: e,
|
|
526
|
+
side: m,
|
|
527
|
+
align: r,
|
|
528
|
+
arrowUncentered: v,
|
|
529
|
+
arrowStyles: R
|
|
530
|
+
} = ve(), N = n.useMemo(() => ({
|
|
531
|
+
open: l,
|
|
532
|
+
side: m,
|
|
533
|
+
align: r,
|
|
534
|
+
uncentered: v
|
|
535
|
+
}), [l, m, r, v]);
|
|
536
|
+
return K("div", s, {
|
|
537
|
+
state: N,
|
|
538
|
+
ref: [o, e],
|
|
539
|
+
props: [{
|
|
540
|
+
style: R,
|
|
541
|
+
"aria-hidden": !0
|
|
542
|
+
}, i],
|
|
543
|
+
stateAttributesMapping: ee
|
|
544
|
+
});
|
|
545
|
+
});
|
|
546
|
+
process.env.NODE_ENV !== "production" && (Ee.displayName = "PopoverArrow");
|
|
547
|
+
const Ce = /* @__PURE__ */ n.forwardRef(function(s, o) {
|
|
548
|
+
const {
|
|
549
|
+
render: f,
|
|
550
|
+
className: P,
|
|
551
|
+
...i
|
|
552
|
+
} = s, {
|
|
553
|
+
store: a
|
|
554
|
+
} = V(), l = te(i.id);
|
|
555
|
+
return oe(() => (a.set("titleElementId", l), () => {
|
|
556
|
+
a.set("titleElementId", void 0);
|
|
557
|
+
}), [a, l]), K("h2", s, {
|
|
558
|
+
ref: o,
|
|
559
|
+
props: [{
|
|
560
|
+
id: l
|
|
561
|
+
}, i]
|
|
562
|
+
});
|
|
563
|
+
});
|
|
564
|
+
process.env.NODE_ENV !== "production" && (Ce.displayName = "PopoverTitle");
|
|
565
|
+
const Te = /* @__PURE__ */ n.forwardRef(function(s, o) {
|
|
566
|
+
const {
|
|
567
|
+
render: f,
|
|
568
|
+
className: P,
|
|
569
|
+
...i
|
|
570
|
+
} = s, {
|
|
571
|
+
store: a
|
|
572
|
+
} = V(), l = te(i.id);
|
|
573
|
+
return oe(() => (a.set("descriptionElementId", l), () => {
|
|
574
|
+
a.set("descriptionElementId", void 0);
|
|
575
|
+
}), [a, l]), K("p", s, {
|
|
576
|
+
ref: o,
|
|
577
|
+
props: [{
|
|
578
|
+
id: l
|
|
579
|
+
}, i]
|
|
580
|
+
});
|
|
581
|
+
});
|
|
582
|
+
process.env.NODE_ENV !== "production" && (Te.displayName = "PopoverDescription");
|
|
583
|
+
const Ft = "_popover_lm3eb_1", _t = "_popover__header_lm3eb_6", le = {
|
|
584
|
+
popover: Ft,
|
|
585
|
+
popover__header: _t
|
|
586
|
+
};
|
|
587
|
+
function lo({
|
|
588
|
+
align: t,
|
|
589
|
+
side: s,
|
|
590
|
+
title: o,
|
|
591
|
+
description: f,
|
|
592
|
+
background: P = "root",
|
|
593
|
+
trigger: i,
|
|
594
|
+
className: a,
|
|
595
|
+
children: l,
|
|
596
|
+
...e
|
|
597
|
+
}) {
|
|
598
|
+
return /* @__PURE__ */ Y(It, { ...e, children: [
|
|
599
|
+
i ? /* @__PURE__ */ u(me, { render: i }) : null,
|
|
600
|
+
/* @__PURE__ */ u(ge, { children: /* @__PURE__ */ u(he, { align: t, side: s, sideOffset: 8, children: /* @__PURE__ */ Y(
|
|
601
|
+
Pe,
|
|
602
|
+
{
|
|
603
|
+
render: /* @__PURE__ */ u(Se, { background: P }),
|
|
604
|
+
className: Re(
|
|
605
|
+
ae.tooltip,
|
|
606
|
+
le.popover,
|
|
607
|
+
He.transition_scale,
|
|
608
|
+
a
|
|
609
|
+
),
|
|
610
|
+
children: [
|
|
611
|
+
/* @__PURE__ */ u(Ee, { className: ae.tooltip__arrow, children: /* @__PURE__ */ u(Oe, {}) }),
|
|
612
|
+
o || f ? /* @__PURE__ */ Y(Ie, { className: le.popover__header, children: [
|
|
613
|
+
o ? /* @__PURE__ */ u(
|
|
614
|
+
Ce,
|
|
615
|
+
{
|
|
616
|
+
render: /* @__PURE__ */ u(be, { level: 2, size: "2xl" }),
|
|
617
|
+
children: o
|
|
618
|
+
}
|
|
619
|
+
) : null,
|
|
620
|
+
f ? /* @__PURE__ */ u(
|
|
621
|
+
Te,
|
|
622
|
+
{
|
|
623
|
+
render: /* @__PURE__ */ u(ye, { color: "dimmer" }),
|
|
624
|
+
children: f
|
|
625
|
+
}
|
|
626
|
+
) : null
|
|
627
|
+
] }) : null,
|
|
628
|
+
l
|
|
629
|
+
]
|
|
630
|
+
}
|
|
631
|
+
) }) })
|
|
632
|
+
] });
|
|
633
|
+
}
|
|
634
|
+
export {
|
|
635
|
+
lo as Popover
|
|
636
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PreviewCard as PreviewCardPrimitive } from '@base-ui/react/preview-card';
|
|
2
|
+
import { ReactElement, ReactNode } from 'react';
|
|
3
|
+
import { Background } from '../surface';
|
|
4
|
+
export type PreviewCardProps = PreviewCardPrimitive.Root.Props & Pick<PreviewCardPrimitive.Positioner.Props, "align" | "side"> & {
|
|
5
|
+
/**
|
|
6
|
+
* Specify trigger to open preview.
|
|
7
|
+
* You should use an Anchor component.
|
|
8
|
+
*/
|
|
9
|
+
trigger?: ReactElement;
|
|
10
|
+
/** Surface background preview card should use. Defaults to "root". */
|
|
11
|
+
background?: Background;
|
|
12
|
+
/** Apply styles to preview card content. */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Preview card content */
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
export declare function PreviewCard({ align, side, background, trigger, children, className, ...props }: PreviewCardProps): import("react/jsx-runtime").JSX.Element;
|