@devalok/shilp-sutra 0.8.4 → 0.9.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/_chunks/avatar.js +50 -0
- package/dist/_chunks/button.js +95 -0
- package/dist/_chunks/card.js +40 -0
- package/dist/_chunks/checkbox.js +14 -0
- package/dist/_chunks/form.js +27 -0
- package/dist/_chunks/primitives.js +6965 -0
- package/dist/_chunks/sidebar.js +592 -0
- package/dist/_chunks/spinner.js +34 -0
- package/dist/_chunks/tiptap.js +15254 -0
- package/dist/_chunks/tooltip.js +13 -0
- package/dist/_chunks/tree-view.js +304 -0
- package/dist/_chunks/use-calendar.js +990 -0
- package/dist/_chunks/utils.js +15 -0
- package/dist/_chunks/vendor.js +5823 -0
- package/dist/composed/avatar-group.js +20 -20
- package/dist/composed/command-palette.js +1 -1
- package/dist/composed/confirm-dialog.js +5 -5
- package/dist/composed/content-card.d.ts +1 -1
- package/dist/composed/content-card.js +6 -6
- package/dist/composed/date-picker/index.js +13 -0
- package/dist/composed/empty-state.js +10 -10
- package/dist/composed/error-boundary.js +2 -2
- package/dist/composed/global-loading.js +4 -4
- package/dist/composed/index.js +45 -53
- package/dist/composed/loading-skeleton.js +2 -2
- package/dist/composed/member-picker.js +5 -5
- package/dist/composed/page-header.js +4 -4
- package/dist/composed/page-skeletons.js +1 -1
- package/dist/composed/priority-indicator.js +6 -6
- package/dist/composed/rich-text-editor.js +422 -209
- package/dist/composed/schedule-view.js +1 -1
- package/dist/composed/simple-tooltip.js +6 -6
- package/dist/composed/status-badge.d.ts +1 -1
- package/dist/composed/status-badge.js +2 -2
- package/dist/shell/bottom-navbar.js +1 -1
- package/dist/shell/notification-center.js +2 -2
- package/dist/shell/notification-preferences.js +32 -33
- package/dist/shell/sidebar.js +24 -24
- package/dist/shell/top-bar.js +22 -22
- package/dist/ui/accordion.js +17 -17
- package/dist/ui/alert-dialog.js +29 -29
- package/dist/ui/alert.d.ts +2 -2
- package/dist/ui/alert.js +65 -44
- package/dist/ui/aspect-ratio.js +1 -1
- package/dist/ui/autocomplete.js +11 -11
- package/dist/ui/avatar.d.ts +1 -1
- package/dist/ui/avatar.js +67 -25
- package/dist/ui/badge.d.ts +2 -2
- package/dist/ui/badge.js +115 -91
- package/dist/ui/banner.d.ts +1 -1
- package/dist/ui/banner.js +5 -5
- package/dist/ui/breadcrumb.js +14 -14
- package/dist/ui/button-group.js +30 -15
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/button.js +114 -71
- package/dist/ui/card.js +66 -22
- package/dist/ui/charts/index.js +1221 -18
- package/dist/ui/checkbox.js +25 -5
- package/dist/ui/chip.d.ts +4 -4
- package/dist/ui/chip.js +2 -2
- package/dist/ui/code.js +1 -1
- package/dist/ui/collapsible.js +5 -5
- package/dist/ui/color-input.js +11 -11
- package/dist/ui/combobox.js +12 -12
- package/dist/ui/container.js +4 -4
- package/dist/ui/context-menu.js +37 -37
- package/dist/ui/data-table-toolbar.js +18 -18
- package/dist/ui/data-table.js +2 -2
- package/dist/ui/dialog.js +33 -33
- package/dist/ui/dropdown-menu.js +60 -60
- package/dist/ui/file-upload.js +1 -1
- package/dist/ui/form.js +36 -15
- package/dist/ui/hover-card.js +7 -7
- package/dist/ui/icon-button.js +9 -9
- package/dist/ui/index.js +523 -325
- package/dist/ui/input-otp.d.ts +2 -2
- package/dist/ui/input-otp.js +14 -14
- package/dist/ui/input.js +56 -28
- package/dist/ui/label.js +18 -4
- package/dist/ui/lib/utils.js +4 -5
- package/dist/ui/link.js +9 -9
- package/dist/ui/menubar.js +81 -81
- package/dist/ui/navigation-menu.js +42 -42
- package/dist/ui/number-input.js +13 -13
- package/dist/ui/pagination.js +5 -5
- package/dist/ui/popover.js +9 -9
- package/dist/ui/progress.d.ts +1 -1
- package/dist/ui/progress.js +15 -15
- package/dist/ui/radio.js +10 -10
- package/dist/ui/search-input.js +5 -5
- package/dist/ui/segmented-control.js +91 -83
- package/dist/ui/select.js +52 -52
- package/dist/ui/separator.js +20 -5
- package/dist/ui/sheet.js +28 -28
- package/dist/ui/sidebar.js +36 -560
- package/dist/ui/skeleton.d.ts +1 -1
- package/dist/ui/skeleton.js +9 -9
- package/dist/ui/slider.js +11 -11
- package/dist/ui/spinner.js +37 -2
- package/dist/ui/stack.js +1 -1
- package/dist/ui/stat-card.js +1 -1
- package/dist/ui/stepper.js +15 -15
- package/dist/ui/switch.js +22 -3
- package/dist/ui/table.js +1 -1
- package/dist/ui/tabs.js +59 -32
- package/dist/ui/text.js +2 -2
- package/dist/ui/textarea.js +7 -7
- package/dist/ui/toast.d.ts +1 -1
- package/dist/ui/toast.js +28 -28
- package/dist/ui/toggle-group.js +11 -11
- package/dist/ui/toggle.js +9 -9
- package/dist/ui/tooltip.js +17 -6
- package/dist/ui/transitions.js +68 -58
- package/dist/ui/tree-view/index.js +7 -0
- package/dist/ui/visually-hidden.js +3 -3
- package/llms-full.txt +1 -1
- package/llms.txt +7 -0
- package/package.json +656 -706
- package/dist/_virtual/client.js +0 -5
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/react-dom-client.development.js +0 -5
- package/dist/_virtual/react-dom-client.production.js +0 -5
- package/dist/_virtual/scheduler.development.js +0 -5
- package/dist/_virtual/scheduler.production.js +0 -5
- package/dist/composed/date-picker/calendar-grid.js +0 -194
- package/dist/composed/date-picker/date-picker.js +0 -124
- package/dist/composed/date-picker/date-range-picker.js +0 -167
- package/dist/composed/date-picker/date-time-picker.js +0 -193
- package/dist/composed/date-picker/month-picker.js +0 -53
- package/dist/composed/date-picker/presets.js +0 -84
- package/dist/composed/date-picker/time-picker.js +0 -181
- package/dist/composed/date-picker/use-calendar.js +0 -17
- package/dist/composed/date-picker/year-picker.js +0 -45
- package/dist/composed/extensions/emoji-suggestion.js +0 -119
- package/dist/composed/extensions/file-attachment.js +0 -55
- package/dist/composed/extensions/mention-suggestion.js +0 -79
- package/dist/node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.js +0 -40141
- package/dist/node_modules/.pnpm/@emoji-mart_react@1.1.1_emoji-mart@5.6.0_react@19.2.4/node_modules/@emoji-mart/react/dist/module.js +0 -17
- package/dist/node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.js +0 -2958
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.development.js +0 -17062
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js +0 -9790
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js +0 -20
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js +0 -237
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js +0 -234
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js +0 -11
- package/dist/primitives/_internal/number.js +0 -6
- package/dist/primitives/_internal/primitive.js +0 -9
- package/dist/primitives/_internal/react-arrow.js +0 -13
- package/dist/primitives/_internal/react-collection.js +0 -48
- package/dist/primitives/_internal/react-compose-refs.js +0 -29
- package/dist/primitives/_internal/react-context.js +0 -76
- package/dist/primitives/_internal/react-direction.js +0 -10
- package/dist/primitives/_internal/react-dismissable-layer.js +0 -103
- package/dist/primitives/_internal/react-focus-guards.js +0 -17
- package/dist/primitives/_internal/react-focus-scope.js +0 -137
- package/dist/primitives/_internal/react-id.js +0 -14
- package/dist/primitives/_internal/react-popper.js +0 -137
- package/dist/primitives/_internal/react-portal.js +0 -16
- package/dist/primitives/_internal/react-presence.js +0 -71
- package/dist/primitives/_internal/react-primitive.js +0 -36
- package/dist/primitives/_internal/react-use-callback-ref.js +0 -13
- package/dist/primitives/_internal/react-use-controllable-state.js +0 -44
- package/dist/primitives/_internal/react-use-escape-keydown.js +0 -14
- package/dist/primitives/_internal/react-use-is-hydrated.js +0 -15
- package/dist/primitives/_internal/react-use-layout-effect.js +0 -6
- package/dist/primitives/_internal/react-use-previous.js +0 -8
- package/dist/primitives/_internal/react-use-size.js +0 -27
- package/dist/primitives/react-accordion.js +0 -239
- package/dist/primitives/react-alert-dialog.js +0 -127
- package/dist/primitives/react-aspect-ratio.js +0 -43
- package/dist/primitives/react-avatar.js +0 -75
- package/dist/primitives/react-checkbox.js +0 -251
- package/dist/primitives/react-collapsible.js +0 -120
- package/dist/primitives/react-context-menu.js +0 -240
- package/dist/primitives/react-dialog.js +0 -262
- package/dist/primitives/react-dropdown-menu.js +0 -227
- package/dist/primitives/react-hover-card.js +0 -187
- package/dist/primitives/react-label.js +0 -20
- package/dist/primitives/react-menu.js +0 -652
- package/dist/primitives/react-menubar.js +0 -355
- package/dist/primitives/react-navigation-menu.js +0 -607
- package/dist/primitives/react-popover.js +0 -243
- package/dist/primitives/react-progress.js +0 -84
- package/dist/primitives/react-radio-group.js +0 -238
- package/dist/primitives/react-roving-focus.js +0 -183
- package/dist/primitives/react-select.js +0 -862
- package/dist/primitives/react-separator.js +0 -24
- package/dist/primitives/react-slider.js +0 -437
- package/dist/primitives/react-slot.js +0 -70
- package/dist/primitives/react-switch.js +0 -132
- package/dist/primitives/react-tabs.js +0 -163
- package/dist/primitives/react-toast.js +0 -446
- package/dist/primitives/react-toggle-group.js +0 -137
- package/dist/primitives/react-toggle.js +0 -33
- package/dist/primitives/react-tooltip.js +0 -338
- package/dist/primitives/react-visually-hidden.js +0 -32
- package/dist/ui/charts/_internal/animation.js +0 -18
- package/dist/ui/charts/_internal/axes.js +0 -42
- package/dist/ui/charts/_internal/colors.js +0 -21
- package/dist/ui/charts/_internal/grid-lines.js +0 -43
- package/dist/ui/charts/_internal/legend.js +0 -29
- package/dist/ui/charts/_internal/tooltip.js +0 -39
- package/dist/ui/charts/_internal/types.js +0 -10
- package/dist/ui/charts/area-chart.js +0 -245
- package/dist/ui/charts/bar-chart.js +0 -153
- package/dist/ui/charts/chart-container.js +0 -27
- package/dist/ui/charts/gauge-chart.js +0 -72
- package/dist/ui/charts/line-chart.js +0 -163
- package/dist/ui/charts/pie-chart.js +0 -132
- package/dist/ui/charts/radar-chart.js +0 -223
- package/dist/ui/charts/sparkline.js +0 -124
- package/dist/ui/lib/motion.js +0 -32
- package/dist/ui/lib/use-reduced-motion.js +0 -15
- package/dist/ui/lib/use-ripple.js +0 -14
- package/dist/ui/tree-view/tree-item.js +0 -139
- package/dist/ui/tree-view/tree-view.js +0 -140
- package/dist/ui/tree-view/use-tree.js +0 -38
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { jsx as R } from "react/jsx-runtime";
|
|
2
|
-
import * as r from "react";
|
|
3
|
-
import { composeEventHandlers as m } from "./primitive.js";
|
|
4
|
-
import { Primitive as g, dispatchDiscreteCustomEvent as z } from "./react-primitive.js";
|
|
5
|
-
import { useComposedRefs as w } from "./react-compose-refs.js";
|
|
6
|
-
import { useCallbackRef as B } from "./react-use-callback-ref.js";
|
|
7
|
-
import { useEscapeKeydown as H } from "./react-use-escape-keydown.js";
|
|
8
|
-
const M = "DismissableLayer", y = "dismissableLayer.update", j = "dismissableLayer.pointerDownOutside", X = "dismissableLayer.focusOutside";
|
|
9
|
-
let L;
|
|
10
|
-
const T = r.createContext({
|
|
11
|
-
layers: /* @__PURE__ */ new Set(),
|
|
12
|
-
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
13
|
-
branches: /* @__PURE__ */ new Set()
|
|
14
|
-
}), x = r.forwardRef((i, e) => {
|
|
15
|
-
const { disableOutsidePointerEvents: o = !1, onEscapeKeyDown: a, onPointerDownOutside: t, onFocusOutside: c, onInteractOutside: l, onDismiss: d, ...v } = i, s = r.useContext(T), [u, W] = r.useState(null), f = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, A] = r.useState({}), N = w(e, (n) => W(n)), p = Array.from(s.layers), [I] = [...s.layersWithOutsidePointerEventsDisabled].slice(-1), _ = p.indexOf(I), b = u ? p.indexOf(u) : -1, k = s.layersWithOutsidePointerEventsDisabled.size > 0, P = b >= _, U = q((n) => {
|
|
16
|
-
const E = n.target, C = [...s.branches].some((h) => h.contains(E));
|
|
17
|
-
!P || C || (t == null || t(n), l == null || l(n), n.defaultPrevented || d == null || d());
|
|
18
|
-
}, f), D = G((n) => {
|
|
19
|
-
const E = n.target;
|
|
20
|
-
[...s.branches].some((h) => h.contains(E)) || (c == null || c(n), l == null || l(n), n.defaultPrevented || d == null || d());
|
|
21
|
-
}, f);
|
|
22
|
-
return H((n) => {
|
|
23
|
-
b === s.layers.size - 1 && (a == null || a(n), !n.defaultPrevented && d && (n.preventDefault(), d()));
|
|
24
|
-
}, f), r.useEffect(() => {
|
|
25
|
-
if (u)
|
|
26
|
-
return o && (s.layersWithOutsidePointerEventsDisabled.size === 0 && (L = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), s.layersWithOutsidePointerEventsDisabled.add(u)), s.layers.add(u), O(), () => {
|
|
27
|
-
o && s.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = L);
|
|
28
|
-
};
|
|
29
|
-
}, [u, f, o, s]), r.useEffect(() => () => {
|
|
30
|
-
u && (s.layers.delete(u), s.layersWithOutsidePointerEventsDisabled.delete(u), O());
|
|
31
|
-
}, [u, s]), r.useEffect(() => {
|
|
32
|
-
const n = () => A({});
|
|
33
|
-
return document.addEventListener(y, n), () => document.removeEventListener(y, n);
|
|
34
|
-
}, []), R(g.div, { ...v, ref: N, style: {
|
|
35
|
-
pointerEvents: k ? P ? "auto" : "none" : void 0,
|
|
36
|
-
...i.style
|
|
37
|
-
}, onFocusCapture: m(i.onFocusCapture, D.onFocusCapture), onBlurCapture: m(i.onBlurCapture, D.onBlurCapture), onPointerDownCapture: m(i.onPointerDownCapture, U.onPointerDownCapture) });
|
|
38
|
-
});
|
|
39
|
-
x.displayName = M;
|
|
40
|
-
const Y = "DismissableLayerBranch", S = r.forwardRef((i, e) => {
|
|
41
|
-
const o = r.useContext(T), a = r.useRef(null), t = w(e, a);
|
|
42
|
-
return r.useEffect(() => {
|
|
43
|
-
const c = a.current;
|
|
44
|
-
if (c)
|
|
45
|
-
return o.branches.add(c), () => {
|
|
46
|
-
o.branches.delete(c);
|
|
47
|
-
};
|
|
48
|
-
}, [o.branches]), R(g.div, { ...i, ref: t });
|
|
49
|
-
});
|
|
50
|
-
S.displayName = Y;
|
|
51
|
-
function q(i, e = globalThis == null ? void 0 : globalThis.document) {
|
|
52
|
-
const o = B(i), a = r.useRef(!1), t = r.useRef(() => {
|
|
53
|
-
});
|
|
54
|
-
return r.useEffect(() => {
|
|
55
|
-
const c = (d) => {
|
|
56
|
-
if (d.target && !a.current) {
|
|
57
|
-
let s = function() {
|
|
58
|
-
F(j, o, v, { discrete: !0 });
|
|
59
|
-
};
|
|
60
|
-
const v = { originalEvent: d };
|
|
61
|
-
d.pointerType === "touch" ? (e.removeEventListener("click", t.current), t.current = s, e.addEventListener("click", t.current, { once: !0 })) : s();
|
|
62
|
-
} else
|
|
63
|
-
e.removeEventListener("click", t.current);
|
|
64
|
-
a.current = !1;
|
|
65
|
-
}, l = window.setTimeout(() => {
|
|
66
|
-
e.addEventListener("pointerdown", c);
|
|
67
|
-
}, 0);
|
|
68
|
-
return () => {
|
|
69
|
-
window.clearTimeout(l), e.removeEventListener("pointerdown", c), e.removeEventListener("click", t.current);
|
|
70
|
-
};
|
|
71
|
-
}, [e, o]), {
|
|
72
|
-
onPointerDownCapture: () => a.current = !0
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
function G(i, e = globalThis == null ? void 0 : globalThis.document) {
|
|
76
|
-
const o = B(i), a = r.useRef(!1);
|
|
77
|
-
return r.useEffect(() => {
|
|
78
|
-
const t = (c) => {
|
|
79
|
-
c.target && !a.current && F(X, o, { originalEvent: c }, {
|
|
80
|
-
discrete: !1
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
return e.addEventListener("focusin", t), () => e.removeEventListener("focusin", t);
|
|
84
|
-
}, [e, o]), {
|
|
85
|
-
onFocusCapture: () => a.current = !0,
|
|
86
|
-
onBlurCapture: () => a.current = !1
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function O() {
|
|
90
|
-
const i = new CustomEvent(y);
|
|
91
|
-
document.dispatchEvent(i);
|
|
92
|
-
}
|
|
93
|
-
function F(i, e, o, { discrete: a }) {
|
|
94
|
-
const t = o.originalEvent.target, c = new CustomEvent(i, { bubbles: !1, cancelable: !0, detail: o });
|
|
95
|
-
e && t.addEventListener(i, e, { once: !0 }), a ? z(t, c) : t.dispatchEvent(c);
|
|
96
|
-
}
|
|
97
|
-
const ee = x, te = S;
|
|
98
|
-
export {
|
|
99
|
-
te as Branch,
|
|
100
|
-
x as DismissableLayer,
|
|
101
|
-
S as DismissableLayerBranch,
|
|
102
|
-
ee as Root
|
|
103
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as r from "react";
|
|
2
|
-
let t = 0;
|
|
3
|
-
function u() {
|
|
4
|
-
r.useEffect(() => {
|
|
5
|
-
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
6
|
-
return document.body.insertAdjacentElement("afterbegin", e[0] ?? n()), document.body.insertAdjacentElement("beforeend", e[1] ?? n()), t++, () => {
|
|
7
|
-
t === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((o) => o.remove()), t--;
|
|
8
|
-
};
|
|
9
|
-
}, []);
|
|
10
|
-
}
|
|
11
|
-
function n() {
|
|
12
|
-
const e = document.createElement("span");
|
|
13
|
-
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
u as useFocusGuards
|
|
17
|
-
};
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { jsx as R } from "react/jsx-runtime";
|
|
2
|
-
import * as d from "react";
|
|
3
|
-
import { useComposedRefs as M } from "./react-compose-refs.js";
|
|
4
|
-
import { Primitive as _ } from "./react-primitive.js";
|
|
5
|
-
import { useCallbackRef as y } from "./react-use-callback-ref.js";
|
|
6
|
-
const F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount", N = { bubbles: !1, cancelable: !0 }, K = "FocusScope", k = d.forwardRef((e, n) => {
|
|
7
|
-
const {
|
|
8
|
-
loop: t = !1,
|
|
9
|
-
trapped: u = !1,
|
|
10
|
-
onMountAutoFocus: p,
|
|
11
|
-
onUnmountAutoFocus: L,
|
|
12
|
-
...g
|
|
13
|
-
} = e, [o, U] = d.useState(null), E = y(p), v = y(L), b = d.useRef(null), A = M(n, (s) => U(s)), a = d.useRef({
|
|
14
|
-
paused: !1,
|
|
15
|
-
pause() {
|
|
16
|
-
this.paused = !0;
|
|
17
|
-
},
|
|
18
|
-
resume() {
|
|
19
|
-
this.paused = !1;
|
|
20
|
-
}
|
|
21
|
-
}).current;
|
|
22
|
-
d.useEffect(() => {
|
|
23
|
-
if (u) {
|
|
24
|
-
let s = function(i) {
|
|
25
|
-
if (a.paused || !o) return;
|
|
26
|
-
const c = i.target;
|
|
27
|
-
o.contains(c) ? b.current = c : f(b.current, { select: !0 });
|
|
28
|
-
}, l = function(i) {
|
|
29
|
-
if (a.paused || !o) return;
|
|
30
|
-
const c = i.relatedTarget;
|
|
31
|
-
c !== null && (o.contains(c) || f(b.current, { select: !0 }));
|
|
32
|
-
}, r = function(i) {
|
|
33
|
-
if (document.activeElement === document.body)
|
|
34
|
-
for (const h of i)
|
|
35
|
-
h.removedNodes.length > 0 && f(o);
|
|
36
|
-
};
|
|
37
|
-
document.addEventListener("focusin", s), document.addEventListener("focusout", l);
|
|
38
|
-
const m = new MutationObserver(r);
|
|
39
|
-
return o && m.observe(o, { childList: !0, subtree: !0 }), () => {
|
|
40
|
-
document.removeEventListener("focusin", s), document.removeEventListener("focusout", l), m.disconnect();
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}, [u, o, a.paused]), d.useEffect(() => {
|
|
44
|
-
if (o) {
|
|
45
|
-
S.add(a);
|
|
46
|
-
const s = document.activeElement;
|
|
47
|
-
if (!o.contains(s)) {
|
|
48
|
-
const r = new CustomEvent(F, N);
|
|
49
|
-
o.addEventListener(F, E), o.dispatchEvent(r), r.defaultPrevented || (w(W(I(o)), { select: !0 }), document.activeElement === s && f(o));
|
|
50
|
-
}
|
|
51
|
-
return () => {
|
|
52
|
-
o.removeEventListener(F, E), setTimeout(() => {
|
|
53
|
-
const r = new CustomEvent(T, N);
|
|
54
|
-
o.addEventListener(T, v), o.dispatchEvent(r), r.defaultPrevented || f(s ?? document.body, { select: !0 }), o.removeEventListener(T, v), S.remove(a);
|
|
55
|
-
}, 0);
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
}, [o, E, v, a]);
|
|
59
|
-
const P = d.useCallback(
|
|
60
|
-
(s) => {
|
|
61
|
-
if (!t && !u || a.paused) return;
|
|
62
|
-
const l = s.key === "Tab" && !s.altKey && !s.ctrlKey && !s.metaKey, r = document.activeElement;
|
|
63
|
-
if (l && r) {
|
|
64
|
-
const m = s.currentTarget, [i, c] = x(m);
|
|
65
|
-
i && c ? !s.shiftKey && r === c ? (s.preventDefault(), t && f(i, { select: !0 })) : s.shiftKey && r === i && (s.preventDefault(), t && f(c, { select: !0 })) : r === m && s.preventDefault();
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
[t, u, a.paused]
|
|
69
|
-
);
|
|
70
|
-
return /* @__PURE__ */ R(_.div, { tabIndex: -1, ...g, ref: A, onKeyDown: P });
|
|
71
|
-
});
|
|
72
|
-
k.displayName = K;
|
|
73
|
-
function w(e, { select: n = !1 } = {}) {
|
|
74
|
-
const t = document.activeElement;
|
|
75
|
-
for (const u of e)
|
|
76
|
-
if (f(u, { select: n }), document.activeElement !== t) return;
|
|
77
|
-
}
|
|
78
|
-
function x(e) {
|
|
79
|
-
const n = I(e), t = O(n, e), u = O(n.reverse(), e);
|
|
80
|
-
return [t, u];
|
|
81
|
-
}
|
|
82
|
-
function I(e) {
|
|
83
|
-
const n = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
84
|
-
acceptNode: (u) => {
|
|
85
|
-
const p = u.tagName === "INPUT" && u.type === "hidden";
|
|
86
|
-
return u.disabled || u.hidden || p ? NodeFilter.FILTER_SKIP : u.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
for (; t.nextNode(); ) n.push(t.currentNode);
|
|
90
|
-
return n;
|
|
91
|
-
}
|
|
92
|
-
function O(e, n) {
|
|
93
|
-
for (const t of e)
|
|
94
|
-
if (!D(t, { upTo: n })) return t;
|
|
95
|
-
}
|
|
96
|
-
function D(e, { upTo: n }) {
|
|
97
|
-
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
98
|
-
for (; e; ) {
|
|
99
|
-
if (n !== void 0 && e === n) return !1;
|
|
100
|
-
if (getComputedStyle(e).display === "none") return !0;
|
|
101
|
-
e = e.parentElement;
|
|
102
|
-
}
|
|
103
|
-
return !1;
|
|
104
|
-
}
|
|
105
|
-
function H(e) {
|
|
106
|
-
return e instanceof HTMLInputElement && "select" in e;
|
|
107
|
-
}
|
|
108
|
-
function f(e, { select: n = !1 } = {}) {
|
|
109
|
-
if (e && e.focus) {
|
|
110
|
-
const t = document.activeElement;
|
|
111
|
-
e.focus({ preventScroll: !0 }), e !== t && H(e) && n && e.select();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
const S = V();
|
|
115
|
-
function V() {
|
|
116
|
-
let e = [];
|
|
117
|
-
return {
|
|
118
|
-
add(n) {
|
|
119
|
-
const t = e[0];
|
|
120
|
-
n !== t && (t == null || t.pause()), e = C(e, n), e.unshift(n);
|
|
121
|
-
},
|
|
122
|
-
remove(n) {
|
|
123
|
-
var t;
|
|
124
|
-
e = C(e, n), (t = e[0]) == null || t.resume();
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
function C(e, n) {
|
|
129
|
-
const t = [...e], u = t.indexOf(n);
|
|
130
|
-
return u !== -1 && t.splice(u, 1), t;
|
|
131
|
-
}
|
|
132
|
-
function W(e) {
|
|
133
|
-
return e.filter((n) => n.tagName !== "A");
|
|
134
|
-
}
|
|
135
|
-
export {
|
|
136
|
-
k as FocusScope
|
|
137
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as e from "react";
|
|
2
|
-
import { useLayoutEffect as s } from "./react-use-layout-effect.js";
|
|
3
|
-
const n = e[" useId ".trim().toString()] || (() => {
|
|
4
|
-
});
|
|
5
|
-
let a = 0;
|
|
6
|
-
function i(t) {
|
|
7
|
-
const [o, r] = e.useState(n());
|
|
8
|
-
return s(() => {
|
|
9
|
-
r((u) => u ?? String(a++));
|
|
10
|
-
}, [t]), t || (o ? `radix-${o}` : "");
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
i as useId
|
|
14
|
-
};
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import * as p from "react";
|
|
3
|
-
import { useFloating as xe, offset as Pe, shift as ye, limitShift as Ae, flip as Ce, size as Se, arrow as be, hide as Oe, autoUpdate as Re } from "@floating-ui/react-dom";
|
|
4
|
-
import { Root as Ee } from "./react-arrow.js";
|
|
5
|
-
import { useComposedRefs as j } from "./react-compose-refs.js";
|
|
6
|
-
import { createContextScope as ve } from "./react-context.js";
|
|
7
|
-
import { Primitive as z } from "./react-primitive.js";
|
|
8
|
-
import { useCallbackRef as Ne } from "./react-use-callback-ref.js";
|
|
9
|
-
import { useLayoutEffect as T } from "./react-use-layout-effect.js";
|
|
10
|
-
import { useSize as _e } from "./react-use-size.js";
|
|
11
|
-
const N = "Popper", [Z, Le] = ve(N), [$e, L] = Z(N), U = (e) => {
|
|
12
|
-
const { __scopePopper: a, children: i } = e, [t, s] = p.useState(null);
|
|
13
|
-
return f($e, { scope: a, anchor: t, onAnchorChange: s, children: i });
|
|
14
|
-
};
|
|
15
|
-
U.displayName = N;
|
|
16
|
-
const q = "PopperAnchor", G = p.forwardRef((e, a) => {
|
|
17
|
-
const { __scopePopper: i, virtualRef: t, ...s } = e, o = L(q, i), r = p.useRef(null), w = j(a, r), n = p.useRef(null);
|
|
18
|
-
return p.useEffect(() => {
|
|
19
|
-
const c = n.current;
|
|
20
|
-
n.current = (t == null ? void 0 : t.current) || r.current, c !== n.current && o.onAnchorChange(n.current);
|
|
21
|
-
}), t ? null : f(z.div, { ...s, ref: w });
|
|
22
|
-
});
|
|
23
|
-
G.displayName = q;
|
|
24
|
-
const _ = "PopperContent", [He, We] = Z(_), J = p.forwardRef((e, a) => {
|
|
25
|
-
var I, X, M, D, F, k;
|
|
26
|
-
const { __scopePopper: i, side: t = "bottom", sideOffset: s = 0, align: o = "center", alignOffset: r = 0, arrowPadding: w = 0, avoidCollisions: n = !0, collisionBoundary: c = [], collisionPadding: x = 0, sticky: m = "partial", hideWhenDetached: y = !1, updatePositionStrategy: A = "optimized", onPlaced: l, ...d } = e, C = L(_, i), [h, S] = p.useState(null), ee = j(a, (P) => S(P)), [v, te] = p.useState(null), u = _e(v), oe = (u == null ? void 0 : u.width) ?? 0, $ = (u == null ? void 0 : u.height) ?? 0, re = t + (o !== "center" ? "-" + o : ""), ne = typeof x == "number" ? x : { top: 0, right: 0, bottom: 0, left: 0, ...x }, H = Array.isArray(c) ? c : [c], ie = H.length > 0, b = {
|
|
27
|
-
padding: ne,
|
|
28
|
-
boundary: H.filter(Ie),
|
|
29
|
-
altBoundary: ie
|
|
30
|
-
}, { refs: se, floatingStyles: W, placement: ae, isPositioned: O, middlewareData: g } = xe({
|
|
31
|
-
strategy: "fixed",
|
|
32
|
-
placement: re,
|
|
33
|
-
whileElementsMounted: (...P) => Re(...P, { animationFrame: A === "always" }),
|
|
34
|
-
elements: { reference: C.anchor },
|
|
35
|
-
middleware: [
|
|
36
|
-
Pe({ mainAxis: s + $, alignmentAxis: r }),
|
|
37
|
-
n && ye({
|
|
38
|
-
mainAxis: !0,
|
|
39
|
-
crossAxis: !1,
|
|
40
|
-
limiter: m === "partial" ? Ae() : void 0,
|
|
41
|
-
...b
|
|
42
|
-
}),
|
|
43
|
-
n && Ce({ ...b }),
|
|
44
|
-
Se({
|
|
45
|
-
...b,
|
|
46
|
-
apply: ({ elements: P, rects: B, availableWidth: he, availableHeight: ue }) => {
|
|
47
|
-
const { width: ge, height: we } = B.reference, E = P.floating.style;
|
|
48
|
-
E.setProperty("--radix-popper-available-width", `${he}px`), E.setProperty("--radix-popper-available-height", `${ue}px`), E.setProperty("--radix-popper-anchor-width", `${ge}px`), E.setProperty("--radix-popper-anchor-height", `${we}px`);
|
|
49
|
-
}
|
|
50
|
-
}),
|
|
51
|
-
v && be({ element: v, padding: w }),
|
|
52
|
-
Xe({ arrowWidth: oe, arrowHeight: $ }),
|
|
53
|
-
y && Oe({ strategy: "referenceHidden", ...b })
|
|
54
|
-
]
|
|
55
|
-
}), [Y, ce] = V(ae), R = Ne(l);
|
|
56
|
-
T(() => {
|
|
57
|
-
O && (R == null || R());
|
|
58
|
-
}, [O, R]);
|
|
59
|
-
const pe = (I = g.arrow) == null ? void 0 : I.x, de = (X = g.arrow) == null ? void 0 : X.y, le = ((M = g.arrow) == null ? void 0 : M.centerOffset) !== 0, [fe, me] = p.useState();
|
|
60
|
-
return T(() => {
|
|
61
|
-
h && me(window.getComputedStyle(h).zIndex);
|
|
62
|
-
}, [h]), f("div", { ref: se.setFloating, "data-radix-popper-content-wrapper": "", style: {
|
|
63
|
-
...W,
|
|
64
|
-
transform: O ? W.transform : "translate(0, -200%)",
|
|
65
|
-
minWidth: "max-content",
|
|
66
|
-
zIndex: fe,
|
|
67
|
-
"--radix-popper-transform-origin": [
|
|
68
|
-
(D = g.transformOrigin) == null ? void 0 : D.x,
|
|
69
|
-
(F = g.transformOrigin) == null ? void 0 : F.y
|
|
70
|
-
].join(" "),
|
|
71
|
-
...((k = g.hide) == null ? void 0 : k.referenceHidden) && {
|
|
72
|
-
visibility: "hidden",
|
|
73
|
-
pointerEvents: "none"
|
|
74
|
-
}
|
|
75
|
-
}, dir: e.dir, children: f(He, { scope: i, placedSide: Y, onArrowChange: te, arrowX: pe, arrowY: de, shouldHideArrow: le, children: f(z.div, { "data-side": Y, "data-align": ce, ...d, ref: ee, style: {
|
|
76
|
-
...d.style,
|
|
77
|
-
animation: O ? void 0 : "none"
|
|
78
|
-
} }) }) });
|
|
79
|
-
});
|
|
80
|
-
J.displayName = _;
|
|
81
|
-
const K = "PopperArrow", Ye = {
|
|
82
|
-
top: "bottom",
|
|
83
|
-
right: "left",
|
|
84
|
-
bottom: "top",
|
|
85
|
-
left: "right"
|
|
86
|
-
}, Q = p.forwardRef(function(a, i) {
|
|
87
|
-
const { __scopePopper: t, ...s } = a, o = We(K, t), r = Ye[o.placedSide];
|
|
88
|
-
return f("span", { ref: o.onArrowChange, style: {
|
|
89
|
-
position: "absolute",
|
|
90
|
-
left: o.arrowX,
|
|
91
|
-
top: o.arrowY,
|
|
92
|
-
[r]: 0,
|
|
93
|
-
transformOrigin: {
|
|
94
|
-
top: "",
|
|
95
|
-
right: "0 0",
|
|
96
|
-
bottom: "center 0",
|
|
97
|
-
left: "100% 0"
|
|
98
|
-
}[o.placedSide],
|
|
99
|
-
transform: {
|
|
100
|
-
top: "translateY(100%)",
|
|
101
|
-
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
102
|
-
bottom: "rotate(180deg)",
|
|
103
|
-
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
104
|
-
}[o.placedSide],
|
|
105
|
-
visibility: o.shouldHideArrow ? "hidden" : void 0
|
|
106
|
-
}, children: f(Ee, { ...s, ref: i, style: { ...s.style, display: "block" } }) });
|
|
107
|
-
});
|
|
108
|
-
Q.displayName = K;
|
|
109
|
-
function Ie(e) {
|
|
110
|
-
return e !== null;
|
|
111
|
-
}
|
|
112
|
-
const Xe = (e) => ({
|
|
113
|
-
name: "transformOrigin",
|
|
114
|
-
options: e,
|
|
115
|
-
fn(a) {
|
|
116
|
-
var C, h, S;
|
|
117
|
-
const { placement: i, rects: t, middlewareData: s } = a, r = ((C = s.arrow) == null ? void 0 : C.centerOffset) !== 0, w = r ? 0 : e.arrowWidth, n = r ? 0 : e.arrowHeight, [c, x] = V(i), m = { start: "0%", center: "50%", end: "100%" }[x], y = (((h = s.arrow) == null ? void 0 : h.x) ?? 0) + w / 2, A = (((S = s.arrow) == null ? void 0 : S.y) ?? 0) + n / 2;
|
|
118
|
-
let l = "", d = "";
|
|
119
|
-
return c === "bottom" ? (l = r ? m : `${y}px`, d = `${-n}px`) : c === "top" ? (l = r ? m : `${y}px`, d = `${t.floating.height + n}px`) : c === "right" ? (l = `${-n}px`, d = r ? m : `${A}px`) : c === "left" && (l = `${t.floating.width + n}px`, d = r ? m : `${A}px`), { data: { x: l, y: d } };
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
function V(e) {
|
|
123
|
-
const [a, i = "center"] = e.split("-");
|
|
124
|
-
return [a, i];
|
|
125
|
-
}
|
|
126
|
-
const Ue = U, qe = G, Ge = J, Je = Q;
|
|
127
|
-
export {
|
|
128
|
-
qe as Anchor,
|
|
129
|
-
Je as Arrow,
|
|
130
|
-
Ge as Content,
|
|
131
|
-
U as Popper,
|
|
132
|
-
G as PopperAnchor,
|
|
133
|
-
Q as PopperArrow,
|
|
134
|
-
J as PopperContent,
|
|
135
|
-
Ue as Root,
|
|
136
|
-
Le as createPopperScope
|
|
137
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import * as r from "react";
|
|
3
|
-
import f from "react-dom";
|
|
4
|
-
import { Primitive as l } from "./react-primitive.js";
|
|
5
|
-
import { useLayoutEffect as p } from "./react-use-layout-effect.js";
|
|
6
|
-
const u = "Portal", d = r.forwardRef((e, a) => {
|
|
7
|
-
var o;
|
|
8
|
-
const { container: n, ...i } = e, [m, s] = r.useState(!1);
|
|
9
|
-
p(() => s(!0), []);
|
|
10
|
-
const t = n || m && ((o = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : o.body);
|
|
11
|
-
return t ? f.createPortal(c(l.div, { ...i, ref: a }), t) : null;
|
|
12
|
-
});
|
|
13
|
-
d.displayName = u;
|
|
14
|
-
export {
|
|
15
|
-
d as Portal
|
|
16
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import * as a from "react";
|
|
2
|
-
import { useComposedRefs as T } from "./react-compose-refs.js";
|
|
3
|
-
import { useLayoutEffect as A } from "./react-use-layout-effect.js";
|
|
4
|
-
function E(n, e) {
|
|
5
|
-
return a.useReducer((r, t) => e[r][t] ?? r, n);
|
|
6
|
-
}
|
|
7
|
-
const R = (n) => {
|
|
8
|
-
const { present: e, children: r } = n, t = P(e), i = typeof r == "function" ? r({ present: t.isPresent }) : a.Children.only(r), c = T(t.ref, S(i));
|
|
9
|
-
return typeof r == "function" || t.isPresent ? a.cloneElement(i, { ref: c }) : null;
|
|
10
|
-
};
|
|
11
|
-
R.displayName = "Presence";
|
|
12
|
-
function P(n) {
|
|
13
|
-
const [e, r] = a.useState(), t = a.useRef(null), i = a.useRef(n), c = a.useRef("none"), p = n ? "mounted" : "unmounted", [N, s] = E(p, {
|
|
14
|
-
mounted: {
|
|
15
|
-
UNMOUNT: "unmounted",
|
|
16
|
-
ANIMATION_OUT: "unmountSuspended"
|
|
17
|
-
},
|
|
18
|
-
unmountSuspended: {
|
|
19
|
-
MOUNT: "mounted",
|
|
20
|
-
ANIMATION_END: "unmounted"
|
|
21
|
-
},
|
|
22
|
-
unmounted: {
|
|
23
|
-
MOUNT: "mounted"
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
return a.useEffect(() => {
|
|
27
|
-
const o = l(t.current);
|
|
28
|
-
c.current = N === "mounted" ? o : "none";
|
|
29
|
-
}, [N]), A(() => {
|
|
30
|
-
const o = t.current, m = i.current;
|
|
31
|
-
if (m !== n) {
|
|
32
|
-
const f = c.current, u = l(o);
|
|
33
|
-
n ? s("MOUNT") : u === "none" || (o == null ? void 0 : o.display) === "none" ? s("UNMOUNT") : s(m && f !== u ? "ANIMATION_OUT" : "UNMOUNT"), i.current = n;
|
|
34
|
-
}
|
|
35
|
-
}, [n, s]), A(() => {
|
|
36
|
-
if (e) {
|
|
37
|
-
let o;
|
|
38
|
-
const m = e.ownerDocument.defaultView ?? window, d = (u) => {
|
|
39
|
-
const g = l(t.current).includes(CSS.escape(u.animationName));
|
|
40
|
-
if (u.target === e && g && (s("ANIMATION_END"), !i.current)) {
|
|
41
|
-
const O = e.style.animationFillMode;
|
|
42
|
-
e.style.animationFillMode = "forwards", o = m.setTimeout(() => {
|
|
43
|
-
e.style.animationFillMode === "forwards" && (e.style.animationFillMode = O);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}, f = (u) => {
|
|
47
|
-
u.target === e && (c.current = l(t.current));
|
|
48
|
-
};
|
|
49
|
-
return e.addEventListener("animationstart", f), e.addEventListener("animationcancel", d), e.addEventListener("animationend", d), () => {
|
|
50
|
-
m.clearTimeout(o), e.removeEventListener("animationstart", f), e.removeEventListener("animationcancel", d), e.removeEventListener("animationend", d);
|
|
51
|
-
};
|
|
52
|
-
} else
|
|
53
|
-
s("ANIMATION_END");
|
|
54
|
-
}, [e, s]), {
|
|
55
|
-
isPresent: ["mounted", "unmountSuspended"].includes(N),
|
|
56
|
-
ref: a.useCallback((o) => {
|
|
57
|
-
t.current = o ? getComputedStyle(o) : null, r(o);
|
|
58
|
-
}, [])
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function l(n) {
|
|
62
|
-
return (n == null ? void 0 : n.animationName) || "none";
|
|
63
|
-
}
|
|
64
|
-
function S(n) {
|
|
65
|
-
var t, i;
|
|
66
|
-
let e = (t = Object.getOwnPropertyDescriptor(n.props, "ref")) == null ? void 0 : t.get, r = e && "isReactWarning" in e && e.isReactWarning;
|
|
67
|
-
return r ? n.ref : (e = (i = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : i.get, r = e && "isReactWarning" in e && e.isReactWarning, r ? n.props.ref : n.props.ref || n.ref);
|
|
68
|
-
}
|
|
69
|
-
export {
|
|
70
|
-
R as Presence
|
|
71
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import * as f from "react";
|
|
3
|
-
import * as p from "react-dom";
|
|
4
|
-
import { createSlot as l } from "../react-slot.js";
|
|
5
|
-
const u = [
|
|
6
|
-
"a",
|
|
7
|
-
"button",
|
|
8
|
-
"div",
|
|
9
|
-
"form",
|
|
10
|
-
"h2",
|
|
11
|
-
"h3",
|
|
12
|
-
"img",
|
|
13
|
-
"input",
|
|
14
|
-
"label",
|
|
15
|
-
"li",
|
|
16
|
-
"nav",
|
|
17
|
-
"ol",
|
|
18
|
-
"p",
|
|
19
|
-
"select",
|
|
20
|
-
"span",
|
|
21
|
-
"svg",
|
|
22
|
-
"ul"
|
|
23
|
-
], h = u.reduce((t, i) => {
|
|
24
|
-
const r = l(`Primitive.${i}`), o = f.forwardRef((e, s) => {
|
|
25
|
-
const { asChild: m, ...n } = e, c = m ? r : i;
|
|
26
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), a(c, { ...n, ref: s });
|
|
27
|
-
});
|
|
28
|
-
return o.displayName = `Primitive.${i}`, { ...t, [i]: o };
|
|
29
|
-
}, {});
|
|
30
|
-
function w(t, i) {
|
|
31
|
-
t && p.flushSync(() => t.dispatchEvent(i));
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
h as Primitive,
|
|
35
|
-
w as dispatchDiscreteCustomEvent
|
|
36
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as r from "react";
|
|
2
|
-
function o(t) {
|
|
3
|
-
const e = r.useRef(t);
|
|
4
|
-
return r.useEffect(() => {
|
|
5
|
-
e.current = t;
|
|
6
|
-
}), r.useMemo(() => (...n) => {
|
|
7
|
-
var u;
|
|
8
|
-
return (u = e.current) == null ? void 0 : u.call(e, ...n);
|
|
9
|
-
}, []);
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
o as useCallbackRef
|
|
13
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as n from "react";
|
|
2
|
-
import { useLayoutEffect as v } from "./react-use-layout-effect.js";
|
|
3
|
-
const E = n[" useInsertionEffect ".trim().toString()] || v;
|
|
4
|
-
function I({
|
|
5
|
-
prop: t,
|
|
6
|
-
defaultProp: o,
|
|
7
|
-
onChange: e = () => {
|
|
8
|
-
},
|
|
9
|
-
caller: l
|
|
10
|
-
}) {
|
|
11
|
-
const [s, r, c] = S({
|
|
12
|
-
defaultProp: o,
|
|
13
|
-
onChange: e
|
|
14
|
-
}), f = t !== void 0, d = f ? t : s, m = n.useCallback(
|
|
15
|
-
(u) => {
|
|
16
|
-
var i;
|
|
17
|
-
if (f) {
|
|
18
|
-
const a = b(u) ? u(t) : u;
|
|
19
|
-
a !== t && ((i = c.current) == null || i.call(c, a));
|
|
20
|
-
} else
|
|
21
|
-
r(u);
|
|
22
|
-
},
|
|
23
|
-
[f, t, r, c]
|
|
24
|
-
);
|
|
25
|
-
return [d, m];
|
|
26
|
-
}
|
|
27
|
-
function S({
|
|
28
|
-
defaultProp: t,
|
|
29
|
-
onChange: o
|
|
30
|
-
}) {
|
|
31
|
-
const [e, l] = n.useState(t), s = n.useRef(e), r = n.useRef(o);
|
|
32
|
-
return E(() => {
|
|
33
|
-
r.current = o;
|
|
34
|
-
}, [o]), n.useEffect(() => {
|
|
35
|
-
var c;
|
|
36
|
-
s.current !== e && ((c = r.current) == null || c.call(r, e), s.current = e);
|
|
37
|
-
}, [e, s]), [e, l, r];
|
|
38
|
-
}
|
|
39
|
-
function b(t) {
|
|
40
|
-
return typeof t == "function";
|
|
41
|
-
}
|
|
42
|
-
export {
|
|
43
|
-
I as useControllableState
|
|
44
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as r from "react";
|
|
2
|
-
import { useCallbackRef as s } from "./react-use-callback-ref.js";
|
|
3
|
-
function p(n, e = globalThis == null ? void 0 : globalThis.document) {
|
|
4
|
-
const t = s(n);
|
|
5
|
-
r.useEffect(() => {
|
|
6
|
-
const o = (a) => {
|
|
7
|
-
a.key === "Escape" && t(a);
|
|
8
|
-
};
|
|
9
|
-
return e.addEventListener("keydown", o, { capture: !0 }), () => e.removeEventListener("keydown", o, { capture: !0 });
|
|
10
|
-
}, [t, e]);
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
p as useEscapeKeydown
|
|
14
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as u from "react";
|
|
2
|
-
function t(r) {
|
|
3
|
-
const e = u.useRef({ value: r, previous: r });
|
|
4
|
-
return u.useMemo(() => (e.current.value !== r && (e.current.previous = e.current.value, e.current.value = r), e.current.previous), [r]);
|
|
5
|
-
}
|
|
6
|
-
export {
|
|
7
|
-
t as usePrevious
|
|
8
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as u from "react";
|
|
2
|
-
import { useLayoutEffect as h } from "./react-use-layout-effect.js";
|
|
3
|
-
function c(r) {
|
|
4
|
-
const [b, e] = u.useState(void 0);
|
|
5
|
-
return h(() => {
|
|
6
|
-
if (r) {
|
|
7
|
-
e({ width: r.offsetWidth, height: r.offsetHeight });
|
|
8
|
-
const f = new ResizeObserver((i) => {
|
|
9
|
-
if (!Array.isArray(i) || !i.length)
|
|
10
|
-
return;
|
|
11
|
-
const n = i[0];
|
|
12
|
-
let o, t;
|
|
13
|
-
if ("borderBoxSize" in n) {
|
|
14
|
-
const s = n.borderBoxSize, d = Array.isArray(s) ? s[0] : s;
|
|
15
|
-
o = d.inlineSize, t = d.blockSize;
|
|
16
|
-
} else
|
|
17
|
-
o = r.offsetWidth, t = r.offsetHeight;
|
|
18
|
-
e({ width: o, height: t });
|
|
19
|
-
});
|
|
20
|
-
return f.observe(r, { box: "border-box" }), () => f.unobserve(r);
|
|
21
|
-
} else
|
|
22
|
-
e(void 0);
|
|
23
|
-
}, [r]), b;
|
|
24
|
-
}
|
|
25
|
-
export {
|
|
26
|
-
c as useSize
|
|
27
|
-
};
|