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