@devalok/shilp-sutra 0.57.0 → 0.59.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/MIGRATION.md +91 -0
- package/dist/_chunks/badge-group.js +75 -188
- package/dist/_chunks/badge-group.js.map +1 -1
- package/dist/_chunks/chat.js +244 -243
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/image-preview.js +71 -70
- package/dist/_chunks/image-preview.js.map +1 -1
- package/dist/_chunks/motion-preference.js +15 -0
- package/dist/_chunks/motion-preference.js.map +1 -0
- package/dist/_chunks/motion-provider.js +1 -1
- package/dist/_chunks/motion-provider.js.map +1 -1
- package/dist/_chunks/popover.js +50 -49
- package/dist/_chunks/popover.js.map +1 -1
- package/dist/_chunks/primitives-internal.js +29 -29
- package/dist/_chunks/primitives-internal.js.map +1 -1
- package/dist/_chunks/shared.js +48 -47
- package/dist/_chunks/shared.js.map +1 -1
- package/dist/_chunks/success.js +34 -34
- package/dist/_chunks/tree-view.js +1 -1
- package/dist/_chunks/tree-view.js.map +1 -1
- package/dist/ai/block-renderer.js +8 -8
- package/dist/ai/command-bar.js +65 -65
- package/dist/ai/command-bar.js.map +1 -1
- package/dist/ai/conversation.js +35 -35
- package/dist/ai/conversation.js.map +1 -1
- package/dist/ai/index.js +4 -4
- package/dist/composed/activity-feed.d.ts.map +1 -1
- package/dist/composed/activity-feed.js +108 -107
- package/dist/composed/activity-feed.js.map +1 -1
- package/dist/composed/command-palette.js +137 -137
- package/dist/composed/command-palette.js.map +1 -1
- package/dist/composed/content-card.js +1 -1
- package/dist/composed/content-card.js.map +1 -1
- package/dist/composed/date-picker/index.js +5 -5
- package/dist/composed/date-picker/index.js.map +1 -1
- package/dist/composed/empty-state.js +4 -4
- package/dist/composed/file-preview/image-preview.d.ts.map +1 -1
- package/dist/composed/file-preview/shared.d.ts.map +1 -1
- package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +151 -150
- package/dist/composed/file-preview.js.map +1 -1
- package/dist/composed/filter-bar.d.ts.map +1 -1
- package/dist/composed/filter-bar.js +53 -52
- package/dist/composed/filter-bar.js.map +1 -1
- package/dist/composed/form-section.d.ts.map +1 -1
- package/dist/composed/form-section.js +38 -37
- package/dist/composed/form-section.js.map +1 -1
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +1 -1
- package/dist/composed/master-detail.js.map +1 -1
- package/dist/composed/multi-select-popover.d.ts.map +1 -1
- package/dist/composed/multi-select-popover.js +109 -108
- package/dist/composed/multi-select-popover.js.map +1 -1
- package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.js +467 -466
- package/dist/composed/rich-chat-input.js.map +1 -1
- package/dist/composed/rich-text-editor.js +3 -3
- package/dist/composed/rich-text-editor.js.map +1 -1
- package/dist/composed/schedule-view.js +2 -2
- package/dist/composed/schedule-view.js.map +1 -1
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js +29 -28
- package/dist/composed/status-badge.js.map +1 -1
- package/dist/motion/index.d.ts +1 -0
- package/dist/motion/index.d.ts.map +1 -1
- package/dist/motion/index.js +2 -15
- package/dist/motion/motion-preference.d.ts +36 -0
- package/dist/motion/motion-preference.d.ts.map +1 -0
- package/dist/motion/motion-provider.d.ts +2 -1
- package/dist/motion/motion-provider.d.ts.map +1 -1
- package/dist/motion/primitives-index.js +103 -102
- package/dist/motion/primitives-index.js.map +1 -1
- package/dist/motion/primitives.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +19 -19
- package/dist/shell/bottom-navbar.js.map +1 -1
- package/dist/shell/index.d.ts +1 -1
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/notification-center.d.ts +17 -0
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +109 -104
- package/dist/shell/notification-center.js.map +1 -1
- package/dist/shell/notification-preferences.js +1 -1
- package/dist/shell/notification-preferences.js.map +1 -1
- package/dist/shell/top-bar.js +1 -1
- package/dist/shell/top-bar.js.map +1 -1
- package/dist/tokens/index.css +1 -0
- package/dist/tokens/palettes.css +292 -0
- package/dist/tokens/semantic.css +72 -8
- package/dist/tokens/shilp-sutra.css +1 -0
- package/dist/tokens/utilities.css +10 -7
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/accordion.js +27 -26
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/alert-dialog.d.ts.map +1 -1
- package/dist/ui/alert-dialog.js +60 -59
- package/dist/ui/alert-dialog.js.map +1 -1
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +55 -113
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/autocomplete.js +80 -80
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +69 -68
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge-indicator.d.ts +4 -8
- package/dist/ui/badge-indicator.d.ts.map +1 -1
- package/dist/ui/badge-indicator.js +3 -8
- package/dist/ui/badge-indicator.js.map +1 -1
- package/dist/ui/badge.d.ts +8 -1
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +42 -40
- package/dist/ui/banner.js.map +1 -1
- package/dist/ui/button-group.d.ts.map +1 -1
- package/dist/ui/button-group.js +3 -23
- package/dist/ui/button-group.js.map +1 -1
- package/dist/ui/button.d.ts +10 -1
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +79 -212
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +75 -72
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/charts/radar-chart.d.ts.map +1 -1
- package/dist/ui/charts/radar-chart.js +1 -1
- package/dist/ui/charts/radar-chart.js.map +1 -1
- package/dist/ui/chat/message-list.d.ts.map +1 -1
- package/dist/ui/chat/message.d.ts.map +1 -1
- package/dist/ui/chat/typing-indicator.d.ts.map +1 -1
- package/dist/ui/code.js +1 -1
- package/dist/ui/code.js.map +1 -1
- package/dist/ui/color-input.d.ts.map +1 -1
- package/dist/ui/color-input.js +151 -150
- package/dist/ui/color-input.js.map +1 -1
- package/dist/ui/combobox.d.ts +14 -0
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +152 -148
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/context-menu.d.ts.map +1 -1
- package/dist/ui/context-menu.js +70 -69
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/data-table-body.js +2 -2
- package/dist/ui/data-table-body.js.map +1 -1
- package/dist/ui/data-table-context.js +2 -2
- package/dist/ui/data-table-context.js.map +1 -1
- package/dist/ui/data-table-header.d.ts.map +1 -1
- package/dist/ui/data-table-header.js +41 -40
- package/dist/ui/data-table-header.js.map +1 -1
- package/dist/ui/data-table-pagination.js +2 -2
- package/dist/ui/data-table-pagination.js.map +1 -1
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +61 -60
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/dot.d.ts.map +1 -1
- package/dist/ui/dot.js +10 -41
- package/dist/ui/dot.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.js +79 -78
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/file-upload.d.ts.map +1 -1
- package/dist/ui/file-upload.js +116 -115
- package/dist/ui/file-upload.js.map +1 -1
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +27 -26
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/hover-card.js +26 -25
- package/dist/ui/hover-card.js.map +1 -1
- package/dist/ui/icon.js +7 -7
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +3 -3
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +73 -72
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +80 -79
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +72 -68
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/radio.js +32 -31
- package/dist/ui/radio.js.map +1 -1
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +28 -27
- package/dist/ui/search-input.js.map +1 -1
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +64 -63
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +4 -4
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/slider.d.ts +63 -9
- package/dist/ui/slider.d.ts.map +1 -1
- package/dist/ui/slider.js +74 -32
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/split-button.d.ts +8 -2
- package/dist/ui/split-button.d.ts.map +1 -1
- package/dist/ui/split-button.js +49 -95
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +89 -88
- package/dist/ui/stat-card.js.map +1 -1
- package/dist/ui/stat-flash.js +16 -16
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +63 -62
- package/dist/ui/stepper.js.map +1 -1
- package/dist/ui/table.js +3 -3
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +67 -66
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/textarea.js.map +1 -1
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +195 -194
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/toggle.d.ts.map +1 -1
- package/dist/ui/toggle.js +24 -22
- package/dist/ui/toggle.js.map +1 -1
- package/dist/ui/tooltip.d.ts.map +1 -1
- package/dist/ui/tooltip.js +37 -36
- package/dist/ui/tooltip.js.map +1 -1
- package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
- package/docs/recipes/customize-brand.md +58 -0
- package/docs/recipes/install-astro.md +1 -1
- package/docs/recipes/install-next-app-router.md +1 -1
- package/docs/recipes/install-next-pages.md +22 -1
- package/docs/recipes/install-remix.md +1 -1
- package/docs/recipes/install-tanstack-start.md +1 -1
- package/docs/recipes/install-vite.md +2 -1
- package/docs/recipes/server-components.md +7 -4
- package/docs/recipes/troubleshoot.md +1 -0
- package/llms.txt +1 -1
- package/mcp-manifest.json +9 -4
- package/package.json +3 -2
- package/skill/SKILL.md +1 -1
- package/skill/references/components.md +1 -1
- package/skill/references/customize-brand.md +58 -0
- package/skill/references/server-components.md +7 -4
- package/skill/references/setup-astro.md +1 -1
- package/skill/references/setup-next-app-router.md +1 -1
- package/skill/references/setup-next-pages.md +22 -1
- package/skill/references/setup-remix.md +1 -1
- package/skill/references/setup-tanstack-start.md +1 -1
- package/skill/references/setup-vite.md +2 -1
- package/skill/references/troubleshoot.md +1 -0
- package/dist/motion/check-motion-provider.d.ts +0 -2
- package/dist/motion/check-motion-provider.d.ts.map +0 -1
- package/dist/motion/index.js.map +0 -1
package/dist/_chunks/popover.js
CHANGED
|
@@ -1,53 +1,54 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { springs as e, tweens as t } from "../ui/lib/motion.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
3
|
+
import { MotionPreference as n } from "./motion-preference.js";
|
|
4
|
+
import { cn as r } from "../ui/lib/utils.js";
|
|
5
|
+
import { Content as i, Overlay as a, Portal as o, Root as s } from "./primitives/react-alert-dialog.js";
|
|
6
|
+
import { useIsMobile as c } from "../hooks/use-mobile.js";
|
|
7
|
+
import { Anchor2 as l, Content2 as u, Portal as d, Root2 as f, Trigger as p } from "./primitives/react-popover.js";
|
|
8
|
+
import { useControllableOpen as m } from "./use-controllable-open.js";
|
|
9
|
+
import * as h from "react";
|
|
10
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
11
|
+
import { AnimatePresence as v, motion as y, useReducedMotion as b } from "framer-motion";
|
|
11
12
|
//#region src/ui/lib/bottom-sheet.tsx
|
|
12
|
-
function
|
|
13
|
-
let
|
|
13
|
+
function x({ open: n, onOpenChange: c, children: l, className: u, dragHandle: d = !0, swipeable: f = !0, title: p }) {
|
|
14
|
+
let m = b(), x = h.useRef(null), S = h.useCallback((e, t) => {
|
|
14
15
|
let n = x.current?.getBoundingClientRect().height ?? 300;
|
|
15
16
|
(t.offset.y > n * .3 || t.velocity.y > 500) && c(!1);
|
|
16
17
|
}, [c]);
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
open:
|
|
18
|
+
return /* @__PURE__ */ g(s, {
|
|
19
|
+
open: n,
|
|
19
20
|
onOpenChange: c,
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
+
children: /* @__PURE__ */ g(v, { children: n && /* @__PURE__ */ _(o, {
|
|
21
22
|
forceMount: !0,
|
|
22
|
-
children: [/* @__PURE__ */
|
|
23
|
+
children: [/* @__PURE__ */ g(a, {
|
|
23
24
|
forceMount: !0,
|
|
24
25
|
asChild: !0,
|
|
25
|
-
children: /* @__PURE__ */
|
|
26
|
+
children: /* @__PURE__ */ g(y.div, {
|
|
26
27
|
className: "fixed inset-0 z-modal bg-overlay",
|
|
27
28
|
initial: { opacity: 0 },
|
|
28
29
|
animate: { opacity: 1 },
|
|
29
30
|
exit: { opacity: 0 },
|
|
30
31
|
transition: t.fade
|
|
31
32
|
})
|
|
32
|
-
}), /* @__PURE__ */
|
|
33
|
+
}), /* @__PURE__ */ g(i, {
|
|
33
34
|
forceMount: !0,
|
|
34
35
|
asChild: !0,
|
|
35
36
|
"aria-label": p,
|
|
36
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ _(y.div, {
|
|
37
38
|
ref: x,
|
|
38
|
-
className:
|
|
39
|
+
className: r("fixed inset-x-0 bottom-0 z-modal max-h-[85vh] overflow-y-auto rounded-t-overlay-lg border-t border-surface-border-strong bg-surface-overlay shadow-overlay outline-hidden", u),
|
|
39
40
|
initial: { y: "100%" },
|
|
40
41
|
animate: { y: 0 },
|
|
41
42
|
exit: { y: "100%" },
|
|
42
|
-
transition:
|
|
43
|
-
drag: f && !
|
|
43
|
+
transition: m ? { duration: 0 } : e.smooth,
|
|
44
|
+
drag: f && !m ? "y" : !1,
|
|
44
45
|
dragConstraints: { top: 0 },
|
|
45
46
|
dragElastic: .2,
|
|
46
47
|
onDragEnd: S,
|
|
47
|
-
children: [d && /* @__PURE__ */
|
|
48
|
+
children: [d && /* @__PURE__ */ g("div", {
|
|
48
49
|
className: "flex justify-center pt-ds-03 pb-ds-02",
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
-
}), /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ g("div", { className: "h-1 w-8 rounded-pill bg-surface-border" })
|
|
51
|
+
}), /* @__PURE__ */ g("div", {
|
|
51
52
|
className: "px-ds-05 pb-ds-06",
|
|
52
53
|
children: l
|
|
53
54
|
})]
|
|
@@ -58,48 +59,48 @@ function b({ open: s, onOpenChange: c, children: l, className: u, dragHandle: d
|
|
|
58
59
|
}
|
|
59
60
|
//#endregion
|
|
60
61
|
//#region src/ui/popover.tsx
|
|
61
|
-
var
|
|
62
|
+
var S = h.createContext({
|
|
62
63
|
open: !1,
|
|
63
64
|
onClose: () => {}
|
|
64
|
-
}),
|
|
65
|
-
let { open: i, setOpen: a, close: o } =
|
|
65
|
+
}), C = ({ open: e, defaultOpen: t = !1, onOpenChange: n, ...r }) => {
|
|
66
|
+
let { open: i, setOpen: a, close: o } = m({
|
|
66
67
|
open: e,
|
|
67
68
|
defaultOpen: t,
|
|
68
69
|
onOpenChange: n
|
|
69
|
-
}), s =
|
|
70
|
+
}), s = h.useMemo(() => ({
|
|
70
71
|
open: i,
|
|
71
72
|
onClose: o
|
|
72
73
|
}), [i, o]);
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ g(S.Provider, {
|
|
74
75
|
value: s,
|
|
75
|
-
children: /* @__PURE__ */
|
|
76
|
+
children: /* @__PURE__ */ g(f, {
|
|
76
77
|
open: i,
|
|
77
78
|
onOpenChange: a,
|
|
78
79
|
...r
|
|
79
80
|
})
|
|
80
81
|
});
|
|
81
82
|
};
|
|
82
|
-
|
|
83
|
-
var
|
|
84
|
-
let
|
|
85
|
-
return
|
|
86
|
-
open:
|
|
83
|
+
C.displayName = "Popover";
|
|
84
|
+
var w = p, T = l, E = h.forwardRef(({ className: i, align: a = "center", sideOffset: o = 4, children: s, ...l }, f) => {
|
|
85
|
+
let p = c(), { open: m, onClose: _ } = h.useContext(S);
|
|
86
|
+
return p ? /* @__PURE__ */ g(x, {
|
|
87
|
+
open: m,
|
|
87
88
|
onOpenChange: (e) => {
|
|
88
|
-
e ||
|
|
89
|
+
e || _();
|
|
89
90
|
},
|
|
90
91
|
title: "Options",
|
|
91
|
-
className:
|
|
92
|
-
children:
|
|
93
|
-
}) : /* @__PURE__ */
|
|
92
|
+
className: i,
|
|
93
|
+
children: s
|
|
94
|
+
}) : /* @__PURE__ */ g(n, { children: /* @__PURE__ */ g(v, { children: m && /* @__PURE__ */ g(d, {
|
|
94
95
|
forceMount: !0,
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
-
ref:
|
|
97
|
-
align:
|
|
98
|
-
sideOffset:
|
|
96
|
+
children: /* @__PURE__ */ g(u, {
|
|
97
|
+
ref: f,
|
|
98
|
+
align: a,
|
|
99
|
+
sideOffset: o,
|
|
99
100
|
forceMount: !0,
|
|
100
101
|
asChild: !0,
|
|
101
|
-
...
|
|
102
|
-
children: /* @__PURE__ */
|
|
102
|
+
...l,
|
|
103
|
+
children: /* @__PURE__ */ g(y.div, {
|
|
103
104
|
initial: {
|
|
104
105
|
opacity: 0,
|
|
105
106
|
scale: .95
|
|
@@ -116,12 +117,12 @@ var C = f, w = c, T = m.forwardRef(({ className: r, align: i = "center", sideOff
|
|
|
116
117
|
...e.snappy,
|
|
117
118
|
opacity: t.fade
|
|
118
119
|
},
|
|
119
|
-
className:
|
|
120
|
-
children:
|
|
120
|
+
className: r("z-popover w-72 rounded-overlay bg-surface-overlay p-ds-05 text-surface-fg shadow-floating outline-hidden", i),
|
|
121
|
+
children: s
|
|
121
122
|
})
|
|
122
123
|
})
|
|
123
|
-
}) });
|
|
124
|
+
}) }) });
|
|
124
125
|
});
|
|
125
|
-
|
|
126
|
+
E.displayName = u.displayName;
|
|
126
127
|
//#endregion
|
|
127
|
-
export {
|
|
128
|
+
export { C as Popover, T as PopoverAnchor, E as PopoverContent, w as PopoverTrigger };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","names":[],"sources":["../../src/ui/lib/bottom-sheet.tsx","../../src/ui/popover.tsx"],"sourcesContent":["'use client'\n\nimport * as DialogPrimitive from '@primitives/react-dialog'\nimport { AnimatePresence, motion, useReducedMotion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { springs, tweens } from './motion'\nimport { cn } from './utils'\n\nexport interface BottomSheetProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n children: React.ReactNode\n className?: string\n /** Show drag handle bar at top. @default true */\n dragHandle?: boolean\n /** Allow swipe-to-dismiss. @default true */\n swipeable?: boolean\n /** Title for accessibility (sets aria-label on the dialog). */\n title?: string\n}\n\nexport function BottomSheet({\n open,\n onOpenChange,\n children,\n className,\n dragHandle = true,\n swipeable = true,\n title,\n}: BottomSheetProps) {\n const isReduced = useReducedMotion()\n const sheetRef = React.useRef<HTMLDivElement>(null)\n\n const handleDragEnd = React.useCallback(\n (_: unknown, info: { offset: { y: number }; velocity: { y: number } }) => {\n const sheetHeight = sheetRef.current?.getBoundingClientRect().height ?? 300\n if (info.offset.y > sheetHeight * 0.3 || info.velocity.y > 500) {\n onOpenChange(false)\n }\n },\n [onOpenChange],\n )\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n <AnimatePresence>\n {open && (\n <DialogPrimitive.Portal forceMount>\n <DialogPrimitive.Overlay forceMount asChild>\n <motion.div\n className=\"fixed inset-0 z-modal bg-overlay\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={tweens.fade}\n />\n </DialogPrimitive.Overlay>\n\n <DialogPrimitive.Content\n forceMount\n asChild\n aria-label={title}\n >\n <motion.div\n ref={sheetRef}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-modal max-h-[85vh] overflow-y-auto rounded-t-overlay-lg border-t border-surface-border-strong bg-surface-overlay shadow-overlay outline-hidden',\n className,\n )}\n initial={{ y: '100%' }}\n animate={{ y: 0 }}\n exit={{ y: '100%' }}\n transition={isReduced ? { duration: 0 } : springs.smooth}\n drag={swipeable && !isReduced ? 'y' : false}\n dragConstraints={{ top: 0 }}\n dragElastic={0.2}\n onDragEnd={handleDragEnd}\n >\n {dragHandle && (\n <div className=\"flex justify-center pt-ds-03 pb-ds-02\">\n <div className=\"h-1 w-8 rounded-pill bg-surface-border\" />\n </div>\n )}\n <div className=\"px-ds-05 pb-ds-06\">\n {children}\n </div>\n </motion.div>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n )}\n </AnimatePresence>\n </DialogPrimitive.Root>\n )\n}\n","'use client'\n\nimport * as PopoverPrimitive from '@primitives/react-popover'\nimport { AnimatePresence,motion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { useIsMobile } from '../hooks/use-mobile'\nimport { BottomSheet } from './lib/bottom-sheet'\nimport { springs, tweens } from './lib/motion'\nimport { useControllableOpen } from './lib/use-controllable-open'\nimport { cn } from './lib/utils'\n\n// ── Internal context to thread `open` state to animated children ──\n\nconst PopoverOpenContext = React.createContext<{ open: boolean; onClose: () => void }>({ open: false, onClose: () => {} })\n\nconst Popover: React.FC<React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>> = ({\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n ...props\n}) => {\n const { open, setOpen, close } = useControllableOpen({ open: controlledOpen, defaultOpen, onOpenChange })\n\n const contextValue = React.useMemo(\n () => ({ open, onClose: close }),\n [open, close],\n )\n\n return (\n <PopoverOpenContext.Provider value={contextValue}>\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen} {...props} />\n </PopoverOpenContext.Provider>\n )\n}\nPopover.displayName = 'Popover'\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, children, ...props }, ref) => {\n const isMobileRaw = useIsMobile()\n const { open, onClose } = React.useContext(PopoverOpenContext)\n\n if (isMobileRaw) {\n return (\n <BottomSheet\n open={open}\n onOpenChange={(v) => { if (!v) onClose() }}\n title=\"Options\"\n className={className}\n >\n {children}\n </BottomSheet>\n )\n }\n\n return (\n <AnimatePresence>\n
|
|
1
|
+
{"version":3,"file":"popover.js","names":[],"sources":["../../src/ui/lib/bottom-sheet.tsx","../../src/ui/popover.tsx"],"sourcesContent":["'use client'\n\nimport * as DialogPrimitive from '@primitives/react-dialog'\nimport { AnimatePresence, motion, useReducedMotion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { springs, tweens } from './motion'\nimport { cn } from './utils'\n\nexport interface BottomSheetProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n children: React.ReactNode\n className?: string\n /** Show drag handle bar at top. @default true */\n dragHandle?: boolean\n /** Allow swipe-to-dismiss. @default true */\n swipeable?: boolean\n /** Title for accessibility (sets aria-label on the dialog). */\n title?: string\n}\n\nexport function BottomSheet({\n open,\n onOpenChange,\n children,\n className,\n dragHandle = true,\n swipeable = true,\n title,\n}: BottomSheetProps) {\n const isReduced = useReducedMotion()\n const sheetRef = React.useRef<HTMLDivElement>(null)\n\n const handleDragEnd = React.useCallback(\n (_: unknown, info: { offset: { y: number }; velocity: { y: number } }) => {\n const sheetHeight = sheetRef.current?.getBoundingClientRect().height ?? 300\n if (info.offset.y > sheetHeight * 0.3 || info.velocity.y > 500) {\n onOpenChange(false)\n }\n },\n [onOpenChange],\n )\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n <AnimatePresence>\n {open && (\n <DialogPrimitive.Portal forceMount>\n <DialogPrimitive.Overlay forceMount asChild>\n <motion.div\n className=\"fixed inset-0 z-modal bg-overlay\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={tweens.fade}\n />\n </DialogPrimitive.Overlay>\n\n <DialogPrimitive.Content\n forceMount\n asChild\n aria-label={title}\n >\n <motion.div\n ref={sheetRef}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-modal max-h-[85vh] overflow-y-auto rounded-t-overlay-lg border-t border-surface-border-strong bg-surface-overlay shadow-overlay outline-hidden',\n className,\n )}\n initial={{ y: '100%' }}\n animate={{ y: 0 }}\n exit={{ y: '100%' }}\n transition={isReduced ? { duration: 0 } : springs.smooth}\n drag={swipeable && !isReduced ? 'y' : false}\n dragConstraints={{ top: 0 }}\n dragElastic={0.2}\n onDragEnd={handleDragEnd}\n >\n {dragHandle && (\n <div className=\"flex justify-center pt-ds-03 pb-ds-02\">\n <div className=\"h-1 w-8 rounded-pill bg-surface-border\" />\n </div>\n )}\n <div className=\"px-ds-05 pb-ds-06\">\n {children}\n </div>\n </motion.div>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n )}\n </AnimatePresence>\n </DialogPrimitive.Root>\n )\n}\n","'use client'\n\nimport * as PopoverPrimitive from '@primitives/react-popover'\nimport { AnimatePresence,motion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { useIsMobile } from '../hooks/use-mobile'\nimport { MotionPreference } from '../motion/motion-preference'\nimport { BottomSheet } from './lib/bottom-sheet'\nimport { springs, tweens } from './lib/motion'\nimport { useControllableOpen } from './lib/use-controllable-open'\nimport { cn } from './lib/utils'\n\n// ── Internal context to thread `open` state to animated children ──\n\nconst PopoverOpenContext = React.createContext<{ open: boolean; onClose: () => void }>({ open: false, onClose: () => {} })\n\nconst Popover: React.FC<React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>> = ({\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n ...props\n}) => {\n const { open, setOpen, close } = useControllableOpen({ open: controlledOpen, defaultOpen, onOpenChange })\n\n const contextValue = React.useMemo(\n () => ({ open, onClose: close }),\n [open, close],\n )\n\n return (\n <PopoverOpenContext.Provider value={contextValue}>\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen} {...props} />\n </PopoverOpenContext.Provider>\n )\n}\nPopover.displayName = 'Popover'\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, children, ...props }, ref) => {\n const isMobileRaw = useIsMobile()\n const { open, onClose } = React.useContext(PopoverOpenContext)\n\n if (isMobileRaw) {\n return (\n <BottomSheet\n open={open}\n onOpenChange={(v) => { if (!v) onClose() }}\n title=\"Options\"\n className={className}\n >\n {children}\n </BottomSheet>\n )\n }\n\n return (\n <MotionPreference>\n <AnimatePresence>\n {open && (\n <PopoverPrimitive.Portal forceMount>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n forceMount\n asChild\n {...props}\n >\n <motion.div\n initial={{ opacity: 0, scale: 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.95 }}\n transition={{ ...springs.snappy, opacity: tweens.fade }}\n className={cn(\n 'z-popover w-72 rounded-overlay bg-surface-overlay p-ds-05 text-surface-fg shadow-floating outline-hidden',\n className,\n )}\n >\n {children}\n </motion.div>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n )}\n </AnimatePresence>\n </MotionPreference>\n )\n})\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport type PopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n\nexport { Popover, PopoverAnchor,PopoverContent, PopoverTrigger }\n"],"mappings":"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"}
|
|
@@ -4,13 +4,13 @@ import t, { useLayoutEffect as n } from "react";
|
|
|
4
4
|
import { Fragment as r, jsx as i } from "react/jsx-runtime";
|
|
5
5
|
import * as a from "react-dom";
|
|
6
6
|
import o from "react-dom";
|
|
7
|
-
//#region src/primitives/_internal/react-context.
|
|
7
|
+
//#region src/primitives/_internal/react-context.tsx
|
|
8
8
|
function s(t, n) {
|
|
9
9
|
let r = e.createContext(n);
|
|
10
10
|
r.displayName = t + "Context";
|
|
11
11
|
let a = (t) => {
|
|
12
12
|
let { children: n, ...a } = t, o = e.useMemo(() => a, Object.values(a));
|
|
13
|
-
return i(r.Provider, {
|
|
13
|
+
return /* @__PURE__ */ i(r.Provider, {
|
|
14
14
|
value: o,
|
|
15
15
|
children: n
|
|
16
16
|
});
|
|
@@ -33,7 +33,7 @@ function c(t, n = []) {
|
|
|
33
33
|
r = [...r, a];
|
|
34
34
|
let c = (n) => {
|
|
35
35
|
let { scope: r, children: a, ...c } = n, l = r?.[t]?.[s] || o, u = e.useMemo(() => c, Object.values(c));
|
|
36
|
-
return i(l.Provider, {
|
|
36
|
+
return /* @__PURE__ */ i(l.Provider, {
|
|
37
37
|
value: u,
|
|
38
38
|
children: a
|
|
39
39
|
});
|
|
@@ -81,7 +81,7 @@ function l(...t) {
|
|
|
81
81
|
return r.scopeName = n.scopeName, r;
|
|
82
82
|
}
|
|
83
83
|
//#endregion
|
|
84
|
-
//#region src/primitives/_internal/react-compose-refs.
|
|
84
|
+
//#region src/primitives/_internal/react-compose-refs.ts
|
|
85
85
|
function u(e, t) {
|
|
86
86
|
if (typeof e == "function") return e(t);
|
|
87
87
|
e != null && (e.current = t);
|
|
@@ -104,7 +104,7 @@ function f(...t) {
|
|
|
104
104
|
return e.useCallback(d(...t), t);
|
|
105
105
|
}
|
|
106
106
|
//#endregion
|
|
107
|
-
//#region src/primitives/react-slot.
|
|
107
|
+
//#region src/primitives/react-slot.tsx
|
|
108
108
|
var p = Symbol.for("react.lazy"), m = e.use;
|
|
109
109
|
function h(e) {
|
|
110
110
|
return typeof e == "object" && !!e && "then" in e;
|
|
@@ -120,13 +120,13 @@ function _(t) {
|
|
|
120
120
|
let s = e.Children.toArray(a), c = s.find(C);
|
|
121
121
|
if (c) {
|
|
122
122
|
let t = c.props.children, a = s.map((n) => n === c ? e.Children.count(t) > 1 ? e.Children.only(null) : e.isValidElement(t) ? t.props.children : null : n);
|
|
123
|
-
return i(n, {
|
|
123
|
+
return /* @__PURE__ */ i(n, {
|
|
124
124
|
...o,
|
|
125
125
|
ref: r,
|
|
126
126
|
children: e.isValidElement(t) ? e.cloneElement(t, void 0, a) : null
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
return i(n, {
|
|
129
|
+
return /* @__PURE__ */ i(n, {
|
|
130
130
|
...o,
|
|
131
131
|
ref: r,
|
|
132
132
|
children: a
|
|
@@ -150,7 +150,7 @@ function y(t) {
|
|
|
150
150
|
var b = Symbol("radix.slottable");
|
|
151
151
|
/* @__NO_SIDE_EFFECTS__ */
|
|
152
152
|
function x(e) {
|
|
153
|
-
let t = ({ children: e }) => i(r, { children: e });
|
|
153
|
+
let t = ({ children: e }) => /* @__PURE__ */ i(r, { children: e });
|
|
154
154
|
return t.displayName = `${e}.Slottable`, t.__radixId = b, t;
|
|
155
155
|
}
|
|
156
156
|
var S = /* @__PURE__ */ x("Slottable");
|
|
@@ -240,7 +240,7 @@ function D(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
242
|
//#endregion
|
|
243
|
-
//#region src/primitives/_internal/react-use-layout-effect.
|
|
243
|
+
//#region src/primitives/_internal/react-use-layout-effect.ts
|
|
244
244
|
var O = globalThis?.document ? e.useLayoutEffect : () => {}, k = e.useInsertionEffect || O;
|
|
245
245
|
function A({ prop: t, defaultProp: n, onChange: r = () => {}, caller: i }) {
|
|
246
246
|
let [a, o, s] = j({
|
|
@@ -275,7 +275,7 @@ function M(e) {
|
|
|
275
275
|
return typeof e == "function";
|
|
276
276
|
}
|
|
277
277
|
//#endregion
|
|
278
|
-
//#region src/primitives/_internal/react-primitive.
|
|
278
|
+
//#region src/primitives/_internal/react-primitive.tsx
|
|
279
279
|
var N = [
|
|
280
280
|
"a",
|
|
281
281
|
"button",
|
|
@@ -297,7 +297,7 @@ var N = [
|
|
|
297
297
|
].reduce((t, n) => {
|
|
298
298
|
let r = /* @__PURE__ */ _(`Primitive.${n}`), a = e.forwardRef((e, t) => {
|
|
299
299
|
let { asChild: a, ...o } = e, s = a ? r : n;
|
|
300
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), i(s, {
|
|
300
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ i(s, {
|
|
301
301
|
...o,
|
|
302
302
|
ref: t
|
|
303
303
|
});
|
|
@@ -389,7 +389,7 @@ function se(t) {
|
|
|
389
389
|
return t || n || "ltr";
|
|
390
390
|
}
|
|
391
391
|
//#endregion
|
|
392
|
-
//#region src/primitives/_internal/react-use-callback-ref.
|
|
392
|
+
//#region src/primitives/_internal/react-use-callback-ref.ts
|
|
393
393
|
function L(t) {
|
|
394
394
|
let n = e.useRef(t);
|
|
395
395
|
return e.useEffect(() => {
|
|
@@ -397,7 +397,7 @@ function L(t) {
|
|
|
397
397
|
}), e.useMemo(() => ((...e) => n.current?.(...e)), []);
|
|
398
398
|
}
|
|
399
399
|
//#endregion
|
|
400
|
-
//#region src/primitives/_internal/react-use-escape-keydown.
|
|
400
|
+
//#region src/primitives/_internal/react-use-escape-keydown.ts
|
|
401
401
|
function ce(t, n = globalThis?.document) {
|
|
402
402
|
let r = L(t);
|
|
403
403
|
e.useEffect(() => {
|
|
@@ -408,7 +408,7 @@ function ce(t, n = globalThis?.document) {
|
|
|
408
408
|
}, [r, n]);
|
|
409
409
|
}
|
|
410
410
|
//#endregion
|
|
411
|
-
//#region src/primitives/_internal/react-dismissable-layer.
|
|
411
|
+
//#region src/primitives/_internal/react-dismissable-layer.tsx
|
|
412
412
|
var le = "DismissableLayer", ue = "dismissableLayer.update", de = "dismissableLayer.pointerDownOutside", fe = "dismissableLayer.focusOutside", pe, me = e.createContext({
|
|
413
413
|
layers: /* @__PURE__ */ new Set(),
|
|
414
414
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
@@ -437,7 +437,7 @@ var le = "DismissableLayer", ue = "dismissableLayer.update", de = "dismissableLa
|
|
|
437
437
|
}, [p, d]), e.useEffect(() => {
|
|
438
438
|
let e = () => g({});
|
|
439
439
|
return document.addEventListener(ue, e), () => document.removeEventListener(ue, e);
|
|
440
|
-
}, []), i(N.div, {
|
|
440
|
+
}, []), /* @__PURE__ */ i(N.div, {
|
|
441
441
|
...u,
|
|
442
442
|
ref: _,
|
|
443
443
|
style: {
|
|
@@ -457,7 +457,7 @@ var ge = "DismissableLayerBranch", _e = e.forwardRef((t, n) => {
|
|
|
457
457
|
if (e) return r.branches.add(e), () => {
|
|
458
458
|
r.branches.delete(e);
|
|
459
459
|
};
|
|
460
|
-
}, [r.branches]), i(N.div, {
|
|
460
|
+
}, [r.branches]), /* @__PURE__ */ i(N.div, {
|
|
461
461
|
...t,
|
|
462
462
|
ref: o
|
|
463
463
|
});
|
|
@@ -646,12 +646,12 @@ function Ie(e) {
|
|
|
646
646
|
return e.filter((e) => e.tagName !== "A");
|
|
647
647
|
}
|
|
648
648
|
//#endregion
|
|
649
|
-
//#region src/primitives/_internal/react-portal.
|
|
649
|
+
//#region src/primitives/_internal/react-portal.tsx
|
|
650
650
|
var Le = "Portal", Re = e.forwardRef((t, n) => {
|
|
651
651
|
let { container: r, ...a } = t, [s, c] = e.useState(!1);
|
|
652
652
|
O(() => c(!0), []);
|
|
653
653
|
let l = r || s && globalThis?.document?.body;
|
|
654
|
-
return l ? o.createPortal(i(N.div, {
|
|
654
|
+
return l ? o.createPortal(/* @__PURE__ */ i(N.div, {
|
|
655
655
|
...a,
|
|
656
656
|
ref: n
|
|
657
657
|
}), l) : null;
|
|
@@ -1748,7 +1748,7 @@ function Vn(t) {
|
|
|
1748
1748
|
return e.useMemo(() => (n.current.value !== t && (n.current.previous = n.current.value, n.current.value = t), n.current.previous), [t]);
|
|
1749
1749
|
}
|
|
1750
1750
|
//#endregion
|
|
1751
|
-
//#region src/primitives/_internal/react-use-size.
|
|
1751
|
+
//#region src/primitives/_internal/react-use-size.ts
|
|
1752
1752
|
function Hn(t) {
|
|
1753
1753
|
let [n, r] = e.useState(void 0);
|
|
1754
1754
|
return O(() => {
|
|
@@ -1774,23 +1774,23 @@ function Hn(t) {
|
|
|
1774
1774
|
}, [t]), n;
|
|
1775
1775
|
}
|
|
1776
1776
|
//#endregion
|
|
1777
|
-
//#region src/primitives/_internal/react-arrow.
|
|
1777
|
+
//#region src/primitives/_internal/react-arrow.tsx
|
|
1778
1778
|
var Un = "Arrow", Wn = e.forwardRef((e, t) => {
|
|
1779
1779
|
let { children: n, width: r = 10, height: a = 5, ...o } = e;
|
|
1780
|
-
return i(N.svg, {
|
|
1780
|
+
return /* @__PURE__ */ i(N.svg, {
|
|
1781
1781
|
...o,
|
|
1782
1782
|
ref: t,
|
|
1783
1783
|
width: r,
|
|
1784
1784
|
height: a,
|
|
1785
1785
|
viewBox: "0 0 30 10",
|
|
1786
1786
|
preserveAspectRatio: "none",
|
|
1787
|
-
children: e.asChild ? n : i("polygon", { points: "0,0 30,0 15,10" })
|
|
1787
|
+
children: e.asChild ? n : /* @__PURE__ */ i("polygon", { points: "0,0 30,0 15,10" })
|
|
1788
1788
|
});
|
|
1789
1789
|
});
|
|
1790
1790
|
Wn.displayName = Un;
|
|
1791
1791
|
var Gn = Wn, Kn = "Popper", [qn, Jn] = c(Kn), [Yn, Xn] = qn(Kn), Zn = (t) => {
|
|
1792
1792
|
let { __scopePopper: n, children: r } = t, [a, o] = e.useState(null);
|
|
1793
|
-
return i(Yn, {
|
|
1793
|
+
return /* @__PURE__ */ i(Yn, {
|
|
1794
1794
|
scope: n,
|
|
1795
1795
|
anchor: a,
|
|
1796
1796
|
onAnchorChange: o,
|
|
@@ -1803,7 +1803,7 @@ var Qn = "PopperAnchor", $n = e.forwardRef((t, n) => {
|
|
|
1803
1803
|
return e.useEffect(() => {
|
|
1804
1804
|
let e = u.current;
|
|
1805
1805
|
u.current = a?.current || c.current, e !== u.current && s.onAnchorChange(u.current);
|
|
1806
|
-
}), a ? null : i(N.div, {
|
|
1806
|
+
}), a ? null : /* @__PURE__ */ i(N.div, {
|
|
1807
1807
|
...o,
|
|
1808
1808
|
ref: l
|
|
1809
1809
|
});
|
|
@@ -1864,7 +1864,7 @@ var er = "PopperContent", [tr, nr] = qn(er), rr = e.forwardRef((t, n) => {
|
|
|
1864
1864
|
let oe = I.arrow?.x, se = I.arrow?.y, ce = I.arrow?.centerOffset !== 0, [le, ue] = e.useState();
|
|
1865
1865
|
return O(() => {
|
|
1866
1866
|
b && ue(window.getComputedStyle(b).zIndex);
|
|
1867
|
-
}, [b]), i("div", {
|
|
1867
|
+
}, [b]), /* @__PURE__ */ i("div", {
|
|
1868
1868
|
ref: ee.setFloating,
|
|
1869
1869
|
"data-radix-popper-content-wrapper": "",
|
|
1870
1870
|
style: {
|
|
@@ -1879,14 +1879,14 @@ var er = "PopperContent", [tr, nr] = qn(er), rr = e.forwardRef((t, n) => {
|
|
|
1879
1879
|
}
|
|
1880
1880
|
},
|
|
1881
1881
|
dir: t.dir,
|
|
1882
|
-
children: i(tr, {
|
|
1882
|
+
children: /* @__PURE__ */ i(tr, {
|
|
1883
1883
|
scope: r,
|
|
1884
1884
|
placedSide: re,
|
|
1885
1885
|
onArrowChange: w,
|
|
1886
1886
|
arrowX: oe,
|
|
1887
1887
|
arrowY: se,
|
|
1888
1888
|
shouldHideArrow: ce,
|
|
1889
|
-
children: i(N.div, {
|
|
1889
|
+
children: /* @__PURE__ */ i(N.div, {
|
|
1890
1890
|
"data-side": re,
|
|
1891
1891
|
"data-align": ie,
|
|
1892
1892
|
...v,
|
|
@@ -1907,7 +1907,7 @@ var ir = "PopperArrow", ar = {
|
|
|
1907
1907
|
left: "right"
|
|
1908
1908
|
}, or = e.forwardRef(function(e, t) {
|
|
1909
1909
|
let { __scopePopper: n, ...r } = e, a = nr(ir, n), o = ar[a.placedSide];
|
|
1910
|
-
return i("span", {
|
|
1910
|
+
return /* @__PURE__ */ i("span", {
|
|
1911
1911
|
ref: a.onArrowChange,
|
|
1912
1912
|
style: {
|
|
1913
1913
|
position: "absolute",
|
|
@@ -1928,7 +1928,7 @@ var ir = "PopperArrow", ar = {
|
|
|
1928
1928
|
}[a.placedSide],
|
|
1929
1929
|
visibility: a.shouldHideArrow ? "hidden" : void 0
|
|
1930
1930
|
},
|
|
1931
|
-
children: i(Gn, {
|
|
1931
|
+
children: /* @__PURE__ */ i(Gn, {
|
|
1932
1932
|
...r,
|
|
1933
1933
|
ref: t,
|
|
1934
1934
|
style: {
|