@devalok/shilp-sutra 0.6.2 → 0.7.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.
Files changed (84) hide show
  1. package/dist/_virtual/client.js +5 -0
  2. package/dist/_virtual/index.js +5 -0
  3. package/dist/_virtual/react-dom-client.development.js +5 -0
  4. package/dist/_virtual/react-dom-client.production.js +5 -0
  5. package/dist/_virtual/scheduler.development.js +5 -0
  6. package/dist/_virtual/scheduler.production.js +5 -0
  7. package/dist/_virtual/shilp-sutra.js +5 -0
  8. package/dist/_virtual/shilp-sutra2.js +5 -0
  9. package/dist/composed/confirm-dialog.d.ts +27 -0
  10. package/dist/composed/confirm-dialog.d.ts.map +1 -0
  11. package/dist/composed/confirm-dialog.js +45 -0
  12. package/dist/composed/extensions/emoji-suggestion.d.ts +8 -0
  13. package/dist/composed/extensions/emoji-suggestion.d.ts.map +1 -0
  14. package/dist/composed/extensions/emoji-suggestion.js +119 -0
  15. package/dist/composed/extensions/file-attachment.d.ts +3 -0
  16. package/dist/composed/extensions/file-attachment.d.ts.map +1 -0
  17. package/dist/composed/extensions/file-attachment.js +55 -0
  18. package/dist/composed/extensions/mention-suggestion.d.ts +10 -0
  19. package/dist/composed/extensions/mention-suggestion.d.ts.map +1 -0
  20. package/dist/composed/extensions/mention-suggestion.js +79 -0
  21. package/dist/composed/index.d.ts +3 -1
  22. package/dist/composed/index.d.ts.map +1 -1
  23. package/dist/composed/index.js +28 -26
  24. package/dist/composed/rich-text-editor.d.ts +19 -0
  25. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  26. package/dist/composed/rich-text-editor.js +320 -161
  27. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.development.js +17062 -0
  28. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js +9790 -0
  29. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js +20 -0
  30. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js +237 -0
  31. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js +234 -0
  32. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js +11 -0
  33. package/dist/primitives/_internal/react-arrow.js +8 -19
  34. package/dist/primitives/_internal/react-compose-refs.js +14 -14
  35. package/dist/primitives/_internal/react-context.js +41 -39
  36. package/dist/primitives/_internal/react-dismissable-layer.js +62 -90
  37. package/dist/primitives/_internal/react-popper.js +107 -169
  38. package/dist/primitives/_internal/react-portal.js +1 -1
  39. package/dist/primitives/_internal/react-primitive.js +1 -1
  40. package/dist/primitives/_internal/react-use-size.js +8 -8
  41. package/dist/primitives/react-slot.js +12 -12
  42. package/dist/shell/app-command-palette.d.ts +3 -1
  43. package/dist/shell/app-command-palette.d.ts.map +1 -1
  44. package/dist/shell/app-command-palette.js +35 -34
  45. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  46. package/dist/shell/bottom-navbar.js +31 -31
  47. package/dist/shell/index.d.ts +1 -1
  48. package/dist/shell/index.d.ts.map +1 -1
  49. package/dist/shell/notification-center.d.ts +10 -0
  50. package/dist/shell/notification-center.d.ts.map +1 -1
  51. package/dist/shell/notification-center.js +129 -117
  52. package/dist/shell/top-bar.d.ts +20 -0
  53. package/dist/shell/top-bar.d.ts.map +1 -1
  54. package/dist/shell/top-bar.js +100 -70
  55. package/dist/tailwind/index.cjs +1 -0
  56. package/dist/tailwind/preset.d.ts.map +1 -1
  57. package/dist/tailwind/preset.js +1 -0
  58. package/dist/tokens/semantic.css +7 -0
  59. package/dist/ui/alert.js +42 -63
  60. package/dist/ui/avatar.js +20 -62
  61. package/dist/ui/badge.d.ts +1 -1
  62. package/dist/ui/badge.d.ts.map +1 -1
  63. package/dist/ui/badge.js +88 -112
  64. package/dist/ui/button-group.js +14 -29
  65. package/dist/ui/button.js +64 -108
  66. package/dist/ui/card.js +18 -62
  67. package/dist/ui/checkbox.js +1 -21
  68. package/dist/ui/color-input.d.ts +17 -0
  69. package/dist/ui/color-input.d.ts.map +1 -0
  70. package/dist/ui/color-input.js +87 -0
  71. package/dist/ui/index.d.ts +1 -0
  72. package/dist/ui/index.d.ts.map +1 -1
  73. package/dist/ui/index.js +314 -312
  74. package/dist/ui/input.js +25 -51
  75. package/dist/ui/label.js +1 -15
  76. package/dist/ui/popover.js +6 -6
  77. package/dist/ui/separator.js +4 -19
  78. package/dist/ui/spinner.js +1 -36
  79. package/dist/ui/switch.js +1 -20
  80. package/dist/ui/tabs.js +20 -47
  81. package/dist/ui/tooltip.js +6 -17
  82. package/llms-full.txt +117 -9
  83. package/llms.txt +9 -6
  84. package/package.json +592 -528
@@ -1,5 +1,5 @@
1
1
  import { jsx as R } from "react/jsx-runtime";
2
- import * as n from "react";
2
+ import * as r from "react";
3
3
  import { composeEventHandlers as m } from "./primitive.js";
4
4
  import { Primitive as g, dispatchDiscreteCustomEvent as z } from "./react-primitive.js";
5
5
  import { useComposedRefs as w } from "./react-compose-refs.js";
@@ -7,120 +7,92 @@ import { useCallbackRef as B } from "./react-use-callback-ref.js";
7
7
  import { useEscapeKeydown as H } from "./react-use-escape-keydown.js";
8
8
  const M = "DismissableLayer", y = "dismissableLayer.update", j = "dismissableLayer.pointerDownOutside", X = "dismissableLayer.focusOutside";
9
9
  let L;
10
- const T = n.createContext({
10
+ const T = r.createContext({
11
11
  layers: /* @__PURE__ */ new Set(),
12
12
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
13
13
  branches: /* @__PURE__ */ new Set()
14
- }), x = n.forwardRef(
15
- (r, e) => {
16
- const {
17
- disableOutsidePointerEvents: i = !1,
18
- onEscapeKeyDown: o,
19
- onPointerDownOutside: t,
20
- onFocusOutside: a,
21
- onInteractOutside: l,
22
- onDismiss: d,
23
- ...E
24
- } = r, c = n.useContext(T), [u, W] = n.useState(null), f = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, A] = n.useState({}), N = w(e, (s) => W(s)), p = Array.from(c.layers), [I] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), _ = p.indexOf(I), b = u ? p.indexOf(u) : -1, k = c.layersWithOutsidePointerEventsDisabled.size > 0, P = b >= _, U = q((s) => {
25
- const v = s.target, C = [...c.branches].some((h) => h.contains(v));
26
- !P || C || (t == null || t(s), l == null || l(s), s.defaultPrevented || d == null || d());
27
- }, f), D = G((s) => {
28
- const v = s.target;
29
- [...c.branches].some((h) => h.contains(v)) || (a == null || a(s), l == null || l(s), s.defaultPrevented || d == null || d());
30
- }, f);
31
- return H((s) => {
32
- b === c.layers.size - 1 && (o == null || o(s), !s.defaultPrevented && d && (s.preventDefault(), d()));
33
- }, f), n.useEffect(() => {
34
- if (u)
35
- return i && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (L = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(u)), c.layers.add(u), O(), () => {
36
- i && c.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = L);
37
- };
38
- }, [u, f, i, c]), n.useEffect(() => () => {
39
- u && (c.layers.delete(u), c.layersWithOutsidePointerEventsDisabled.delete(u), O());
40
- }, [u, c]), n.useEffect(() => {
41
- const s = () => A({});
42
- return document.addEventListener(y, s), () => document.removeEventListener(y, s);
43
- }, []), /* @__PURE__ */ R(
44
- g.div,
45
- {
46
- ...E,
47
- ref: N,
48
- style: {
49
- pointerEvents: k ? P ? "auto" : "none" : void 0,
50
- ...r.style
51
- },
52
- onFocusCapture: m(r.onFocusCapture, D.onFocusCapture),
53
- onBlurCapture: m(r.onBlurCapture, D.onBlurCapture),
54
- onPointerDownCapture: m(
55
- r.onPointerDownCapture,
56
- U.onPointerDownCapture
57
- )
58
- }
59
- );
60
- }
61
- );
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
+ });
62
39
  x.displayName = M;
63
- const Y = "DismissableLayerBranch", S = n.forwardRef((r, e) => {
64
- const i = n.useContext(T), o = n.useRef(null), t = w(e, o);
65
- return n.useEffect(() => {
66
- const a = o.current;
67
- if (a)
68
- return i.branches.add(a), () => {
69
- i.branches.delete(a);
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);
70
47
  };
71
- }, [i.branches]), /* @__PURE__ */ R(g.div, { ...r, ref: t });
48
+ }, [o.branches]), R(g.div, { ...i, ref: t });
72
49
  });
73
50
  S.displayName = Y;
74
- function q(r, e = globalThis == null ? void 0 : globalThis.document) {
75
- const i = B(r), o = n.useRef(!1), t = n.useRef(() => {
51
+ function q(i, e = globalThis == null ? void 0 : globalThis.document) {
52
+ const o = B(i), a = r.useRef(!1), t = r.useRef(() => {
76
53
  });
77
- return n.useEffect(() => {
78
- const a = (d) => {
79
- if (d.target && !o.current) {
80
- let E = function() {
81
- F(
82
- j,
83
- i,
84
- c,
85
- { discrete: !0 }
86
- );
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 });
87
59
  };
88
- const c = { originalEvent: d };
89
- d.pointerType === "touch" ? (e.removeEventListener("click", t.current), t.current = E, e.addEventListener("click", t.current, { once: !0 })) : E();
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();
90
62
  } else
91
63
  e.removeEventListener("click", t.current);
92
- o.current = !1;
64
+ a.current = !1;
93
65
  }, l = window.setTimeout(() => {
94
- e.addEventListener("pointerdown", a);
66
+ e.addEventListener("pointerdown", c);
95
67
  }, 0);
96
68
  return () => {
97
- window.clearTimeout(l), e.removeEventListener("pointerdown", a), e.removeEventListener("click", t.current);
69
+ window.clearTimeout(l), e.removeEventListener("pointerdown", c), e.removeEventListener("click", t.current);
98
70
  };
99
- }, [e, i]), {
100
- onPointerDownCapture: () => o.current = !0
71
+ }, [e, o]), {
72
+ onPointerDownCapture: () => a.current = !0
101
73
  };
102
74
  }
103
- function G(r, e = globalThis == null ? void 0 : globalThis.document) {
104
- const i = B(r), o = n.useRef(!1);
105
- return n.useEffect(() => {
106
- const t = (a) => {
107
- a.target && !o.current && F(X, i, { originalEvent: a }, {
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 }, {
108
80
  discrete: !1
109
81
  });
110
82
  };
111
83
  return e.addEventListener("focusin", t), () => e.removeEventListener("focusin", t);
112
- }, [e, i]), {
113
- onFocusCapture: () => o.current = !0,
114
- onBlurCapture: () => o.current = !1
84
+ }, [e, o]), {
85
+ onFocusCapture: () => a.current = !0,
86
+ onBlurCapture: () => a.current = !1
115
87
  };
116
88
  }
117
89
  function O() {
118
- const r = new CustomEvent(y);
119
- document.dispatchEvent(r);
90
+ const i = new CustomEvent(y);
91
+ document.dispatchEvent(i);
120
92
  }
121
- function F(r, e, i, { discrete: o }) {
122
- const t = i.originalEvent.target, a = new CustomEvent(r, { bubbles: !1, cancelable: !0, detail: i });
123
- e && t.addEventListener(r, e, { once: !0 }), o ? z(t, a) : t.dispatchEvent(a);
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);
124
96
  }
125
97
  const ee = x, te = S;
126
98
  export {
@@ -1,199 +1,137 @@
1
1
  import { jsx as f } from "react/jsx-runtime";
2
2
  import * as p from "react";
3
- import { useFloating as xt, offset as Pt, shift as yt, limitShift as At, flip as Ct, size as bt, arrow as St, hide as Ot, autoUpdate as Rt } from "@floating-ui/react-dom";
4
- import { Root as vt } from "./react-arrow.js";
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
5
  import { useComposedRefs as j } from "./react-compose-refs.js";
6
- import { createContextScope as Et } from "./react-context.js";
6
+ import { createContextScope as ve } from "./react-context.js";
7
7
  import { Primitive as z } from "./react-primitive.js";
8
- import { useCallbackRef as Nt } from "./react-use-callback-ref.js";
8
+ import { useCallbackRef as Ne } from "./react-use-callback-ref.js";
9
9
  import { useLayoutEffect as T } from "./react-use-layout-effect.js";
10
- import { useSize as _t } from "./react-use-size.js";
11
- const N = "Popper", [Z, Lt] = Et(N), [$t, L] = Z(N), U = (t) => {
12
- const { __scopePopper: a, children: i } = t, [e, s] = p.useState(null);
13
- return /* @__PURE__ */ f($t, { scope: a, anchor: e, onAnchorChange: s, children: i });
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
14
  };
15
15
  U.displayName = N;
16
- const q = "PopperAnchor", G = p.forwardRef(
17
- (t, a) => {
18
- const { __scopePopper: i, virtualRef: e, ...s } = t, o = L(q, i), r = p.useRef(null), w = j(a, r), n = p.useRef(null);
19
- return p.useEffect(() => {
20
- const c = n.current;
21
- n.current = (e == null ? void 0 : e.current) || r.current, c !== n.current && o.onAnchorChange(n.current);
22
- }), e ? null : /* @__PURE__ */ f(z.div, { ...s, ref: w });
23
- }
24
- );
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
+ });
25
23
  G.displayName = q;
26
- const _ = "PopperContent", [Ht, Wt] = Z(_), J = p.forwardRef(
27
- (t, a) => {
28
- var Y, M, X, D, F, k;
29
- const {
30
- __scopePopper: i,
31
- side: e = "bottom",
32
- sideOffset: s = 0,
33
- align: o = "center",
34
- alignOffset: r = 0,
35
- arrowPadding: w = 0,
36
- avoidCollisions: n = !0,
37
- collisionBoundary: c = [],
38
- collisionPadding: x = 0,
39
- sticky: m = "partial",
40
- hideWhenDetached: y = !1,
41
- updatePositionStrategy: A = "optimized",
42
- onPlaced: l,
43
- ...d
44
- } = t, C = L(_, i), [h, b] = p.useState(null), tt = j(a, (P) => b(P)), [E, et] = p.useState(null), u = _t(E), ot = (u == null ? void 0 : u.width) ?? 0, $ = (u == null ? void 0 : u.height) ?? 0, rt = e + (o !== "center" ? "-" + o : ""), nt = typeof x == "number" ? x : { top: 0, right: 0, bottom: 0, left: 0, ...x }, H = Array.isArray(c) ? c : [c], it = H.length > 0, S = {
45
- padding: nt,
46
- boundary: H.filter(Yt),
47
- altBoundary: it
48
- }, { refs: st, floatingStyles: W, placement: at, isPositioned: O, middlewareData: g } = xt({
49
- strategy: "fixed",
50
- placement: rt,
51
- whileElementsMounted: (...P) => Rt(...P, { animationFrame: A === "always" }),
52
- elements: { reference: C.anchor },
53
- middleware: [
54
- Pt({ mainAxis: s + $, alignmentAxis: r }),
55
- n && yt({
56
- mainAxis: !0,
57
- crossAxis: !1,
58
- limiter: m === "partial" ? At() : void 0,
59
- ...S
60
- }),
61
- n && Ct({ ...S }),
62
- bt({
63
- ...S,
64
- apply: ({ elements: P, rects: B, availableWidth: ht, availableHeight: ut }) => {
65
- const { width: gt, height: wt } = B.reference, v = P.floating.style;
66
- v.setProperty("--radix-popper-available-width", `${ht}px`), v.setProperty("--radix-popper-available-height", `${ut}px`), v.setProperty("--radix-popper-anchor-width", `${gt}px`), v.setProperty("--radix-popper-anchor-height", `${wt}px`);
67
- }
68
- }),
69
- E && St({ element: E, padding: w }),
70
- Mt({ arrowWidth: ot, arrowHeight: $ }),
71
- y && Ot({ strategy: "referenceHidden", ...S })
72
- ]
73
- }), [I, ct] = V(at), R = Nt(l);
74
- T(() => {
75
- O && (R == null || R());
76
- }, [O, R]);
77
- const pt = (Y = g.arrow) == null ? void 0 : Y.x, dt = (M = g.arrow) == null ? void 0 : M.y, lt = ((X = g.arrow) == null ? void 0 : X.centerOffset) !== 0, [ft, mt] = p.useState();
78
- return T(() => {
79
- h && mt(window.getComputedStyle(h).zIndex);
80
- }, [h]), /* @__PURE__ */ f(
81
- "div",
82
- {
83
- ref: st.setFloating,
84
- "data-radix-popper-content-wrapper": "",
85
- style: {
86
- ...W,
87
- transform: O ? W.transform : "translate(0, -200%)",
88
- minWidth: "max-content",
89
- zIndex: ft,
90
- "--radix-popper-transform-origin": [
91
- (D = g.transformOrigin) == null ? void 0 : D.x,
92
- (F = g.transformOrigin) == null ? void 0 : F.y
93
- ].join(" "),
94
- ...((k = g.hide) == null ? void 0 : k.referenceHidden) && {
95
- visibility: "hidden",
96
- pointerEvents: "none"
97
- }
98
- },
99
- dir: t.dir,
100
- children: /* @__PURE__ */ f(
101
- Ht,
102
- {
103
- scope: i,
104
- placedSide: I,
105
- onArrowChange: et,
106
- arrowX: pt,
107
- arrowY: dt,
108
- shouldHideArrow: lt,
109
- children: /* @__PURE__ */ f(
110
- z.div,
111
- {
112
- "data-side": I,
113
- "data-align": ct,
114
- ...d,
115
- ref: tt,
116
- style: {
117
- ...d.style,
118
- animation: O ? void 0 : "none"
119
- }
120
- }
121
- )
122
- }
123
- )
124
- }
125
- );
126
- }
127
- );
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
+ });
128
80
  J.displayName = _;
129
- const K = "PopperArrow", It = {
81
+ const K = "PopperArrow", Ye = {
130
82
  top: "bottom",
131
83
  right: "left",
132
84
  bottom: "top",
133
85
  left: "right"
134
86
  }, Q = p.forwardRef(function(a, i) {
135
- const { __scopePopper: e, ...s } = a, o = Wt(K, e), r = It[o.placedSide];
136
- return /* @__PURE__ */ f(
137
- "span",
138
- {
139
- ref: o.onArrowChange,
140
- style: {
141
- position: "absolute",
142
- left: o.arrowX,
143
- top: o.arrowY,
144
- [r]: 0,
145
- transformOrigin: {
146
- top: "",
147
- right: "0 0",
148
- bottom: "center 0",
149
- left: "100% 0"
150
- }[o.placedSide],
151
- transform: {
152
- top: "translateY(100%)",
153
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
154
- bottom: "rotate(180deg)",
155
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
156
- }[o.placedSide],
157
- visibility: o.shouldHideArrow ? "hidden" : void 0
158
- },
159
- children: /* @__PURE__ */ f(
160
- vt,
161
- {
162
- ...s,
163
- ref: i,
164
- style: { ...s.style, display: "block" }
165
- }
166
- )
167
- }
168
- );
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" } }) });
169
107
  });
170
108
  Q.displayName = K;
171
- function Yt(t) {
172
- return t !== null;
109
+ function Ie(e) {
110
+ return e !== null;
173
111
  }
174
- const Mt = (t) => ({
112
+ const Xe = (e) => ({
175
113
  name: "transformOrigin",
176
- options: t,
114
+ options: e,
177
115
  fn(a) {
178
- var C, h, b;
179
- const { placement: i, rects: e, middlewareData: s } = a, r = ((C = s.arrow) == null ? void 0 : C.centerOffset) !== 0, w = r ? 0 : t.arrowWidth, n = r ? 0 : t.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 = (((b = s.arrow) == null ? void 0 : b.y) ?? 0) + n / 2;
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;
180
118
  let l = "", d = "";
181
- return c === "bottom" ? (l = r ? m : `${y}px`, d = `${-n}px`) : c === "top" ? (l = r ? m : `${y}px`, d = `${e.floating.height + n}px`) : c === "right" ? (l = `${-n}px`, d = r ? m : `${A}px`) : c === "left" && (l = `${e.floating.width + n}px`, d = r ? m : `${A}px`), { data: { x: l, y: 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 } };
182
120
  }
183
121
  });
184
- function V(t) {
185
- const [a, i = "center"] = t.split("-");
122
+ function V(e) {
123
+ const [a, i = "center"] = e.split("-");
186
124
  return [a, i];
187
125
  }
188
- const Ut = U, qt = G, Gt = J, Jt = Q;
126
+ const Ue = U, qe = G, Ge = J, Je = Q;
189
127
  export {
190
- qt as Anchor,
191
- Jt as Arrow,
192
- Gt as Content,
128
+ qe as Anchor,
129
+ Je as Arrow,
130
+ Ge as Content,
193
131
  U as Popper,
194
132
  G as PopperAnchor,
195
133
  Q as PopperArrow,
196
134
  J as PopperContent,
197
- Ut as Root,
198
- Lt as createPopperScope
135
+ Ue as Root,
136
+ Le as createPopperScope
199
137
  };
@@ -8,7 +8,7 @@ const u = "Portal", d = r.forwardRef((e, a) => {
8
8
  const { container: n, ...i } = e, [m, s] = r.useState(!1);
9
9
  p(() => s(!0), []);
10
10
  const t = n || m && ((o = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : o.body);
11
- return t ? f.createPortal(/* @__PURE__ */ c(l.div, { ...i, ref: a }), t) : null;
11
+ return t ? f.createPortal(c(l.div, { ...i, ref: a }), t) : null;
12
12
  });
13
13
  d.displayName = u;
14
14
  export {
@@ -23,7 +23,7 @@ const u = [
23
23
  ], h = u.reduce((t, i) => {
24
24
  const r = l(`Primitive.${i}`), o = f.forwardRef((e, s) => {
25
25
  const { asChild: m, ...n } = e, c = m ? r : i;
26
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ a(c, { ...n, ref: s });
26
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), a(c, { ...n, ref: s });
27
27
  });
28
28
  return o.displayName = `Primitive.${i}`, { ...t, [i]: o };
29
29
  }, {});
@@ -1,17 +1,17 @@
1
- import * as z from "react";
2
- import { useLayoutEffect as n } from "./react-use-layout-effect.js";
1
+ import * as u from "react";
2
+ import { useLayoutEffect as h } from "./react-use-layout-effect.js";
3
3
  function c(r) {
4
- const [h, e] = z.useState(void 0);
5
- return n(() => {
4
+ const [b, e] = u.useState(void 0);
5
+ return h(() => {
6
6
  if (r) {
7
7
  e({ width: r.offsetWidth, height: r.offsetHeight });
8
8
  const f = new ResizeObserver((i) => {
9
9
  if (!Array.isArray(i) || !i.length)
10
10
  return;
11
- const b = i[0];
11
+ const n = i[0];
12
12
  let o, t;
13
- if ("borderBoxSize" in b) {
14
- const s = b.borderBoxSize, d = Array.isArray(s) ? s[0] : s;
13
+ if ("borderBoxSize" in n) {
14
+ const s = n.borderBoxSize, d = Array.isArray(s) ? s[0] : s;
15
15
  o = d.inlineSize, t = d.blockSize;
16
16
  } else
17
17
  o = r.offsetWidth, t = r.offsetHeight;
@@ -20,7 +20,7 @@ function c(r) {
20
20
  return f.observe(r, { box: "border-box" }), () => f.unobserve(r);
21
21
  } else
22
22
  e(void 0);
23
- }, [r]), h;
23
+ }, [r]), b;
24
24
  }
25
25
  export {
26
26
  c as useSize
@@ -5,29 +5,29 @@ const E = Symbol.for("react.lazy"), p = l[" use ".trim().toString()];
5
5
  function _(t) {
6
6
  return typeof t == "object" && t !== null && "then" in t;
7
7
  }
8
- function d(t) {
8
+ function y(t) {
9
9
  return t != null && typeof t == "object" && "$$typeof" in t && t.$$typeof === E && "_payload" in t && _(t._payload);
10
10
  }
11
11
  // @__NO_SIDE_EFFECTS__
12
12
  function C(t) {
13
- const e = /* @__PURE__ */ R(t), o = l.forwardRef((r, n) => {
13
+ const e = /* @__PURE__ */ h(t), o = l.forwardRef((r, n) => {
14
14
  let { children: i, ...a } = r;
15
- d(i) && typeof p == "function" && (i = p(i._payload));
15
+ y(i) && typeof p == "function" && (i = p(i._payload));
16
16
  const s = l.Children.toArray(i), c = s.find(P);
17
17
  if (c) {
18
- const f = c.props.children, S = s.map((y) => y === c ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : y);
19
- return /* @__PURE__ */ u(e, { ...a, ref: n, children: l.isValidElement(f) ? l.cloneElement(f, void 0, S) : null });
18
+ const f = c.props.children, S = s.map((d) => d === c ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : d);
19
+ return u(e, { ...a, ref: n, children: l.isValidElement(f) ? l.cloneElement(f, void 0, S) : null });
20
20
  }
21
- return /* @__PURE__ */ u(e, { ...a, ref: n, children: i });
21
+ return u(e, { ...a, ref: n, children: i });
22
22
  });
23
23
  return o.displayName = `${t}.Slot`, o;
24
24
  }
25
25
  const I = /* @__PURE__ */ C("Slot");
26
26
  // @__NO_SIDE_EFFECTS__
27
- function R(t) {
27
+ function h(t) {
28
28
  const e = l.forwardRef((o, r) => {
29
29
  let { children: n, ...i } = o;
30
- if (d(n) && typeof p == "function" && (n = p(n._payload)), l.isValidElement(n)) {
30
+ if (y(n) && typeof p == "function" && (n = p(n._payload)), l.isValidElement(n)) {
31
31
  const a = j(n), s = $(i, n.props);
32
32
  return n.type !== l.Fragment && (s.ref = r ? g(r, a) : a), l.cloneElement(n, s);
33
33
  }
@@ -37,11 +37,11 @@ function R(t) {
37
37
  }
38
38
  const m = Symbol("radix.slottable");
39
39
  // @__NO_SIDE_EFFECTS__
40
- function h(t) {
41
- const e = ({ children: o }) => /* @__PURE__ */ u(b, { children: o });
40
+ function R(t) {
41
+ const e = ({ children: o }) => u(b, { children: o });
42
42
  return e.displayName = `${t}.Slottable`, e.__radixId = m, e;
43
43
  }
44
- const V = /* @__PURE__ */ h("Slottable");
44
+ const V = /* @__PURE__ */ R("Slottable");
45
45
  function P(t) {
46
46
  return l.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === m;
47
47
  }
@@ -66,5 +66,5 @@ export {
66
66
  I as Slot,
67
67
  V as Slottable,
68
68
  C as createSlot,
69
- h as createSlottable
69
+ R as createSlottable
70
70
  };
@@ -15,6 +15,8 @@ export interface AppCommandPaletteUser {
15
15
  export interface AppCommandPaletteProps {
16
16
  /** Current user (used to determine admin access) */
17
17
  user?: AppCommandPaletteUser | null;
18
+ /** When true, shows admin command groups regardless of user.role. Takes precedence over role-based detection. */
19
+ isAdmin?: boolean;
18
20
  /** Additional command groups to show */
19
21
  extraGroups?: CommandGroup[];
20
22
  /** Called when the user selects a navigation target */
@@ -28,7 +30,7 @@ export interface AppCommandPaletteProps {
28
30
  /** Called when the user selects a search result */
29
31
  onSearchResultSelect?: (result: SearchResult) => void;
30
32
  }
31
- export declare function AppCommandPalette({ user, extraGroups, onNavigate, onSearch, searchResults, isSearching, onSearchResultSelect, }: AppCommandPaletteProps): import("react/jsx-runtime").JSX.Element;
33
+ export declare function AppCommandPalette({ user, isAdmin: isAdminProp, extraGroups, onNavigate, onSearch, searchResults, isSearching, onSearchResultSelect, }: AppCommandPaletteProps): import("react/jsx-runtime").JSX.Element;
32
34
  export declare namespace AppCommandPalette {
33
35
  var displayName: string;
34
36
  }