@moontra/moonui 2.2.4 → 2.2.6

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/index.js CHANGED
@@ -1445,8 +1445,6 @@ var CheckboxWithLabel = t__namespace.forwardRef(({
1445
1445
  ] });
1446
1446
  });
1447
1447
  CheckboxWithLabel.displayName = "CheckboxWithLabel";
1448
-
1449
- // ../../node_modules/@radix-ui/primitive/dist/index.mjs
1450
1448
  function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
1451
1449
  return function handleEvent(event) {
1452
1450
  originalEventHandler?.(event);
@@ -1713,7 +1711,7 @@ function usePresence(present) {
1713
1711
  const ownerWindow = node.ownerDocument.defaultView ?? window;
1714
1712
  const handleAnimationEnd = (event) => {
1715
1713
  const currentAnimationName = getAnimationName(stylesRef.current);
1716
- const isCurrentAnimation = currentAnimationName.includes(event.animationName);
1714
+ const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
1717
1715
  if (event.target === node && isCurrentAnimation) {
1718
1716
  send("ANIMATION_END");
1719
1717
  if (!prevPresentRef.current) {
@@ -3263,6 +3261,88 @@ function D(_) {
3263
3261
  function W(_, C, h) {
3264
3262
  return _ = h && h.length > 0 ? `${_ + " " + h.join(" ")}` : _, G(_, C, D(_), D(C), 0, 0, {});
3265
3263
  }
3264
+ var NODES2 = [
3265
+ "a",
3266
+ "button",
3267
+ "div",
3268
+ "form",
3269
+ "h2",
3270
+ "h3",
3271
+ "img",
3272
+ "input",
3273
+ "label",
3274
+ "li",
3275
+ "nav",
3276
+ "ol",
3277
+ "p",
3278
+ "select",
3279
+ "span",
3280
+ "svg",
3281
+ "ul"
3282
+ ];
3283
+ var Primitive2 = NODES2.reduce((primitive, node) => {
3284
+ const Slot = reactSlot.createSlot(`Primitive.${node}`);
3285
+ const Node = t__namespace.forwardRef((props, forwardedRef) => {
3286
+ const { asChild, ...primitiveProps } = props;
3287
+ const Comp = asChild ? Slot : node;
3288
+ if (typeof window !== "undefined") {
3289
+ window[Symbol.for("radix-ui")] = true;
3290
+ }
3291
+ return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
3292
+ });
3293
+ Node.displayName = `Primitive.${node}`;
3294
+ return { ...primitive, [node]: Node };
3295
+ }, {});
3296
+ var useLayoutEffect22 = globalThis?.document ? t__namespace.useLayoutEffect : () => {
3297
+ };
3298
+
3299
+ // ../../node_modules/@radix-ui/react-id/dist/index.mjs
3300
+ var useReactId2 = t__namespace[" useId ".trim().toString()] || (() => void 0);
3301
+ var count2 = 0;
3302
+ function useId3(deterministicId) {
3303
+ const [id, setId] = t__namespace.useState(useReactId2());
3304
+ useLayoutEffect22(() => {
3305
+ if (!deterministicId)
3306
+ setId((reactId) => reactId ?? String(count2++));
3307
+ }, [deterministicId]);
3308
+ return deterministicId || (id ? `radix-${id}` : "");
3309
+ }
3310
+ function setRef2(ref, value) {
3311
+ if (typeof ref === "function") {
3312
+ return ref(value);
3313
+ } else if (ref !== null && ref !== void 0) {
3314
+ ref.current = value;
3315
+ }
3316
+ }
3317
+ function composeRefs2(...refs) {
3318
+ return (node) => {
3319
+ let hasCleanup = false;
3320
+ const cleanups = refs.map((ref) => {
3321
+ const cleanup = setRef2(ref, node);
3322
+ if (!hasCleanup && typeof cleanup == "function") {
3323
+ hasCleanup = true;
3324
+ }
3325
+ return cleanup;
3326
+ });
3327
+ if (hasCleanup) {
3328
+ return () => {
3329
+ for (let i = 0; i < cleanups.length; i++) {
3330
+ const cleanup = cleanups[i];
3331
+ if (typeof cleanup == "function") {
3332
+ cleanup();
3333
+ } else {
3334
+ setRef2(refs[i], null);
3335
+ }
3336
+ }
3337
+ };
3338
+ }
3339
+ };
3340
+ }
3341
+ function useComposedRefs2(...refs) {
3342
+ return t__namespace.useCallback(composeRefs2(...refs), refs);
3343
+ }
3344
+
3345
+ // ../../node_modules/cmdk/dist/index.mjs
3266
3346
  var N = '[cmdk-group=""]';
3267
3347
  var Y2 = '[cmdk-group-items=""]';
3268
3348
  var be = '[cmdk-group-heading=""]';
@@ -3280,7 +3360,7 @@ var me = t__namespace.forwardRef((r, o) => {
3280
3360
  let n = L(() => {
3281
3361
  var e, a;
3282
3362
  return { search: "", value: (a = (e = r.value) != null ? e : r.defaultValue) != null ? a : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
3283
- }), u2 = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r), { label: b, children: m2, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true, ...O } = r, $2 = useId2(), q = useId2(), _ = useId2(), I = t__namespace.useRef(null), v = ke();
3363
+ }), u2 = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r), { label: b, children: m2, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true, ...O } = r, $2 = useId3(), q = useId3(), _ = useId3(), I = t__namespace.useRef(null), v = ke();
3284
3364
  k2(() => {
3285
3365
  if (R !== void 0) {
3286
3366
  let e = R.trim();
@@ -3415,7 +3495,7 @@ var me = t__namespace.forwardRef((r, o) => {
3415
3495
  }, se = (e) => {
3416
3496
  e.preventDefault(), e.metaKey ? X8(0) : e.altKey ? re(-1) : Q(-1);
3417
3497
  };
3418
- return t__namespace.createElement(Primitive.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
3498
+ return t__namespace.createElement(Primitive2.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
3419
3499
  var s;
3420
3500
  (s = O.onKeyDown) == null || s.call(O, e);
3421
3501
  let a = e.nativeEvent.isComposing || e.keyCode === 229;
@@ -3460,7 +3540,7 @@ var me = t__namespace.forwardRef((r, o) => {
3460
3540
  });
3461
3541
  var he = t__namespace.forwardRef((r, o) => {
3462
3542
  var _, I;
3463
- let n = useId2(), u2 = t__namespace.useRef(null), c = t__namespace.useContext(fe), d = K2(), f = pe(r), p2 = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount;
3543
+ let n = useId3(), u2 = t__namespace.useRef(null), c = t__namespace.useContext(fe), d = K2(), f = pe(r), p2 = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount;
3464
3544
  k2(() => {
3465
3545
  if (!p2)
3466
3546
  return d.item(n, c == null ? void 0 : c.id);
@@ -3481,23 +3561,23 @@ var he = t__namespace.forwardRef((r, o) => {
3481
3561
  if (!x)
3482
3562
  return null;
3483
3563
  let { disabled: A, value: ge, onSelect: j, forceMount: O, keywords: $2, ...q } = r;
3484
- return t__namespace.createElement(Primitive.div, { ref: composeRefs(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!R, "data-disabled": !!A, "data-selected": !!R, onPointerMove: A || d.getDisablePointerSelection() ? void 0 : S, onClick: A ? void 0 : C }, r.children);
3564
+ return t__namespace.createElement(Primitive2.div, { ref: composeRefs2(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!R, "data-disabled": !!A, "data-selected": !!R, onPointerMove: A || d.getDisablePointerSelection() ? void 0 : S, onClick: A ? void 0 : C }, r.children);
3485
3565
  });
3486
3566
  var Ee = t__namespace.forwardRef((r, o) => {
3487
- let { heading: n, children: u2, forceMount: c, ...d } = r, f = useId2(), p2 = t__namespace.useRef(null), b = t__namespace.useRef(null), m2 = useId2(), R = K2(), x = P((S) => c || R.filter() === false ? true : S.search ? S.filtered.groups.has(f) : true);
3567
+ let { heading: n, children: u2, forceMount: c, ...d } = r, f = useId3(), p2 = t__namespace.useRef(null), b = t__namespace.useRef(null), m2 = useId3(), R = K2(), x = P((S) => c || R.filter() === false ? true : S.search ? S.filtered.groups.has(f) : true);
3488
3568
  k2(() => R.group(f), []), ve(f, p2, [r.value, r.heading, b]);
3489
3569
  let C = t__namespace.useMemo(() => ({ id: f, forceMount: c }), [c]);
3490
- return t__namespace.createElement(Primitive.div, { ref: composeRefs(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x ? void 0 : true }, n && t__namespace.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B2(r, (S) => t__namespace.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, t__namespace.createElement(fe.Provider, { value: C }, S))));
3570
+ return t__namespace.createElement(Primitive2.div, { ref: composeRefs2(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x ? void 0 : true }, n && t__namespace.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B2(r, (S) => t__namespace.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, t__namespace.createElement(fe.Provider, { value: C }, S))));
3491
3571
  });
3492
3572
  var ye = t__namespace.forwardRef((r, o) => {
3493
3573
  let { alwaysRender: n, ...u2 } = r, c = t__namespace.useRef(null), d = P((f) => !f.search);
3494
- return !n && !d ? null : t__namespace.createElement(Primitive.div, { ref: composeRefs(c, o), ...u2, "cmdk-separator": "", role: "separator" });
3574
+ return !n && !d ? null : t__namespace.createElement(Primitive2.div, { ref: composeRefs2(c, o), ...u2, "cmdk-separator": "", role: "separator" });
3495
3575
  });
3496
3576
  var Se = t__namespace.forwardRef((r, o) => {
3497
3577
  let { onValueChange: n, ...u2 } = r, c = r.value != null, d = ee(), f = P((m2) => m2.search), p2 = P((m2) => m2.selectedItemId), b = K2();
3498
3578
  return t__namespace.useEffect(() => {
3499
3579
  r.value != null && d.setState("search", r.value);
3500
- }, [r.value]), t__namespace.createElement(Primitive.input, { ref: o, ...u2, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-autocomplete": "list", role: "combobox", "aria-expanded": true, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": p2, id: b.inputId, type: "text", value: c ? r.value : f, onChange: (m2) => {
3580
+ }, [r.value]), t__namespace.createElement(Primitive2.input, { ref: o, ...u2, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-autocomplete": "list", role: "combobox", "aria-expanded": true, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": p2, id: b.inputId, type: "text", value: c ? r.value : f, onChange: (m2) => {
3501
3581
  c || d.setState("search", m2.target.value), n == null || n(m2.target.value);
3502
3582
  } });
3503
3583
  });
@@ -3515,16 +3595,16 @@ var Ce = t__namespace.forwardRef((r, o) => {
3515
3595
  cancelAnimationFrame(x), C.unobserve(m2);
3516
3596
  };
3517
3597
  }
3518
- }, []), t__namespace.createElement(Primitive.div, { ref: composeRefs(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B2(r, (m2) => t__namespace.createElement("div", { ref: composeRefs(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
3598
+ }, []), t__namespace.createElement(Primitive2.div, { ref: composeRefs2(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B2(r, (m2) => t__namespace.createElement("div", { ref: composeRefs2(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
3519
3599
  });
3520
3600
  var xe = t__namespace.forwardRef((r, o) => {
3521
3601
  let { open: n, onOpenChange: u2, overlayClassName: c, contentClassName: d, container: f, ...p2 } = r;
3522
3602
  return t__namespace.createElement(DialogPrimitive__namespace.Root, { open: n, onOpenChange: u2 }, t__namespace.createElement(DialogPrimitive__namespace.Portal, { container: f }, t__namespace.createElement(DialogPrimitive__namespace.Overlay, { "cmdk-overlay": "", className: c }), t__namespace.createElement(DialogPrimitive__namespace.Content, { "aria-label": r.label, "cmdk-dialog": "", className: d }, t__namespace.createElement(me, { ref: o, ...p2 }))));
3523
3603
  });
3524
- var Ie = t__namespace.forwardRef((r, o) => P((u2) => u2.filtered.count === 0) ? t__namespace.createElement(Primitive.div, { ref: o, ...r, "cmdk-empty": "", role: "presentation" }) : null);
3604
+ var Ie = t__namespace.forwardRef((r, o) => P((u2) => u2.filtered.count === 0) ? t__namespace.createElement(Primitive2.div, { ref: o, ...r, "cmdk-empty": "", role: "presentation" }) : null);
3525
3605
  var Pe = t__namespace.forwardRef((r, o) => {
3526
3606
  let { progress: n, children: u2, label: c = "Loading...", ...d } = r;
3527
- return t__namespace.createElement(Primitive.div, { ref: o, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c }, B2(r, (f) => t__namespace.createElement("div", { "aria-hidden": true }, f)));
3607
+ return t__namespace.createElement(Primitive2.div, { ref: o, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c }, B2(r, (f) => t__namespace.createElement("div", { "aria-hidden": true }, f)));
3528
3608
  });
3529
3609
  var _e = Object.assign(me, { List: Ce, Item: he, Input: Se, Group: Ee, Separator: ye, Dialog: xe, Empty: Ie, Loading: Pe });
3530
3610
  function we(r, o) {
@@ -4677,16 +4757,16 @@ var extent = (columnId, _leafRows, childRows) => {
4677
4757
  return [min2, max2];
4678
4758
  };
4679
4759
  var mean = (columnId, leafRows) => {
4680
- let count3 = 0;
4760
+ let count4 = 0;
4681
4761
  let sum2 = 0;
4682
4762
  leafRows.forEach((row) => {
4683
4763
  let value = row.getValue(columnId);
4684
4764
  if (value != null && (value = +value) >= value) {
4685
- ++count3, sum2 += value;
4765
+ ++count4, sum2 += value;
4686
4766
  }
4687
4767
  });
4688
- if (count3)
4689
- return sum2 / count3;
4768
+ if (count4)
4769
+ return sum2 / count4;
4690
4770
  return;
4691
4771
  };
4692
4772
  var median = (columnId, leafRows) => {
@@ -4710,7 +4790,7 @@ var unique = (columnId, leafRows) => {
4710
4790
  var uniqueCount = (columnId, leafRows) => {
4711
4791
  return new Set(leafRows.map((d) => d.getValue(columnId))).size;
4712
4792
  };
4713
- var count2 = (_columnId, leafRows) => {
4793
+ var count3 = (_columnId, leafRows) => {
4714
4794
  return leafRows.length;
4715
4795
  };
4716
4796
  var aggregationFns = {
@@ -4722,7 +4802,7 @@ var aggregationFns = {
4722
4802
  median,
4723
4803
  unique,
4724
4804
  uniqueCount,
4725
- count: count2
4805
+ count: count3
4726
4806
  };
4727
4807
  var ColumnGrouping = {
4728
4808
  getDefaultColumnDef: () => {
@@ -8444,7 +8524,7 @@ function DatePicker({
8444
8524
  /* @__PURE__ */ jsxRuntime.jsx(
8445
8525
  PopoverContent,
8446
8526
  {
8447
- className: "w-[360px] p-0 shadow-2xl rounded-2xl border border-gray-200 dark:border-gray-700 bg-background/95 backdrop-blur-sm z-[1000]",
8527
+ className: "w-[360px] p-0 shadow-2xl rounded-2xl border border-gray-200 dark:border-gray-700 bg-background/95 backdrop-blur-sm !z-[9999]",
8448
8528
  align: "start",
8449
8529
  sideOffset: 12,
8450
8530
  children: /* @__PURE__ */ jsxRuntime.jsxs(
@@ -8535,7 +8615,7 @@ function DateRangePicker({
8535
8615
  ]
8536
8616
  }
8537
8617
  ) }),
8538
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-0 shadow-2xl rounded-2xl border border-gray-200 dark:border-gray-700 bg-background/95 backdrop-blur-sm z-[1000]", align: "start", sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
8618
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-0 shadow-2xl rounded-2xl border border-gray-200 dark:border-gray-700 bg-background/95 backdrop-blur-sm !z-[9999]", align: "start", sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
8539
8619
  Calendar,
8540
8620
  {
8541
8621
  mode: "range",
@@ -8693,7 +8773,7 @@ function MonthPicker({
8693
8773
  ]
8694
8774
  }
8695
8775
  ) }),
8696
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-64 p-0 shadow-2xl border border-gray-200 dark:border-gray-700 bg-background z-[1000]", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3", children: [
8776
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-64 p-0 shadow-2xl border border-gray-200 dark:border-gray-700 bg-background !z-[9999]", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3", children: [
8697
8777
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-3", children: [
8698
8778
  /* @__PURE__ */ jsxRuntime.jsx(
8699
8779
  Button,
@@ -10101,6 +10181,188 @@ function RichTextEditor({
10101
10181
  )
10102
10182
  ] });
10103
10183
  }
10184
+ function useStateMachine2(initialState, machine) {
10185
+ return t__namespace.useReducer((state, event) => {
10186
+ const nextState = machine[state][event];
10187
+ return nextState ?? state;
10188
+ }, initialState);
10189
+ }
10190
+ var Presence2 = (props) => {
10191
+ const { present, children } = props;
10192
+ const presence = usePresence2(present);
10193
+ const child = typeof children === "function" ? children({ present: presence.isPresent }) : t__namespace.Children.only(children);
10194
+ const ref = useComposedRefs2(presence.ref, getElementRef2(child));
10195
+ const forceMount = typeof children === "function";
10196
+ return forceMount || presence.isPresent ? t__namespace.cloneElement(child, { ref }) : null;
10197
+ };
10198
+ Presence2.displayName = "Presence";
10199
+ function usePresence2(present) {
10200
+ const [node, setNode] = t__namespace.useState();
10201
+ const stylesRef = t__namespace.useRef(null);
10202
+ const prevPresentRef = t__namespace.useRef(present);
10203
+ const prevAnimationNameRef = t__namespace.useRef("none");
10204
+ const initialState = present ? "mounted" : "unmounted";
10205
+ const [state, send] = useStateMachine2(initialState, {
10206
+ mounted: {
10207
+ UNMOUNT: "unmounted",
10208
+ ANIMATION_OUT: "unmountSuspended"
10209
+ },
10210
+ unmountSuspended: {
10211
+ MOUNT: "mounted",
10212
+ ANIMATION_END: "unmounted"
10213
+ },
10214
+ unmounted: {
10215
+ MOUNT: "mounted"
10216
+ }
10217
+ });
10218
+ t__namespace.useEffect(() => {
10219
+ const currentAnimationName = getAnimationName2(stylesRef.current);
10220
+ prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
10221
+ }, [state]);
10222
+ useLayoutEffect22(() => {
10223
+ const styles = stylesRef.current;
10224
+ const wasPresent = prevPresentRef.current;
10225
+ const hasPresentChanged = wasPresent !== present;
10226
+ if (hasPresentChanged) {
10227
+ const prevAnimationName = prevAnimationNameRef.current;
10228
+ const currentAnimationName = getAnimationName2(styles);
10229
+ if (present) {
10230
+ send("MOUNT");
10231
+ } else if (currentAnimationName === "none" || styles?.display === "none") {
10232
+ send("UNMOUNT");
10233
+ } else {
10234
+ const isAnimating = prevAnimationName !== currentAnimationName;
10235
+ if (wasPresent && isAnimating) {
10236
+ send("ANIMATION_OUT");
10237
+ } else {
10238
+ send("UNMOUNT");
10239
+ }
10240
+ }
10241
+ prevPresentRef.current = present;
10242
+ }
10243
+ }, [present, send]);
10244
+ useLayoutEffect22(() => {
10245
+ if (node) {
10246
+ let timeoutId;
10247
+ const ownerWindow = node.ownerDocument.defaultView ?? window;
10248
+ const handleAnimationEnd = (event) => {
10249
+ const currentAnimationName = getAnimationName2(stylesRef.current);
10250
+ const isCurrentAnimation = currentAnimationName.includes(event.animationName);
10251
+ if (event.target === node && isCurrentAnimation) {
10252
+ send("ANIMATION_END");
10253
+ if (!prevPresentRef.current) {
10254
+ const currentFillMode = node.style.animationFillMode;
10255
+ node.style.animationFillMode = "forwards";
10256
+ timeoutId = ownerWindow.setTimeout(() => {
10257
+ if (node.style.animationFillMode === "forwards") {
10258
+ node.style.animationFillMode = currentFillMode;
10259
+ }
10260
+ });
10261
+ }
10262
+ }
10263
+ };
10264
+ const handleAnimationStart = (event) => {
10265
+ if (event.target === node) {
10266
+ prevAnimationNameRef.current = getAnimationName2(stylesRef.current);
10267
+ }
10268
+ };
10269
+ node.addEventListener("animationstart", handleAnimationStart);
10270
+ node.addEventListener("animationcancel", handleAnimationEnd);
10271
+ node.addEventListener("animationend", handleAnimationEnd);
10272
+ return () => {
10273
+ ownerWindow.clearTimeout(timeoutId);
10274
+ node.removeEventListener("animationstart", handleAnimationStart);
10275
+ node.removeEventListener("animationcancel", handleAnimationEnd);
10276
+ node.removeEventListener("animationend", handleAnimationEnd);
10277
+ };
10278
+ } else {
10279
+ send("ANIMATION_END");
10280
+ }
10281
+ }, [node, send]);
10282
+ return {
10283
+ isPresent: ["mounted", "unmountSuspended"].includes(state),
10284
+ ref: t__namespace.useCallback((node2) => {
10285
+ stylesRef.current = node2 ? getComputedStyle(node2) : null;
10286
+ setNode(node2);
10287
+ }, [])
10288
+ };
10289
+ }
10290
+ function getAnimationName2(styles) {
10291
+ return styles?.animationName || "none";
10292
+ }
10293
+ function getElementRef2(element) {
10294
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
10295
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
10296
+ if (mayWarn) {
10297
+ return element.ref;
10298
+ }
10299
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
10300
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
10301
+ if (mayWarn) {
10302
+ return element.props.ref;
10303
+ }
10304
+ return element.props.ref || element.ref;
10305
+ }
10306
+ function createContextScope2(scopeName, createContextScopeDeps = []) {
10307
+ let defaultContexts = [];
10308
+ function createContext32(rootComponentName, defaultContext) {
10309
+ const BaseContext = t__namespace.createContext(defaultContext);
10310
+ const index = defaultContexts.length;
10311
+ defaultContexts = [...defaultContexts, defaultContext];
10312
+ const Provider3 = (props) => {
10313
+ const { scope, children, ...context } = props;
10314
+ const Context = scope?.[scopeName]?.[index] || BaseContext;
10315
+ const value = t__namespace.useMemo(() => context, Object.values(context));
10316
+ return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
10317
+ };
10318
+ Provider3.displayName = rootComponentName + "Provider";
10319
+ function useContext22(consumerName, scope) {
10320
+ const Context = scope?.[scopeName]?.[index] || BaseContext;
10321
+ const context = t__namespace.useContext(Context);
10322
+ if (context)
10323
+ return context;
10324
+ if (defaultContext !== void 0)
10325
+ return defaultContext;
10326
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
10327
+ }
10328
+ return [Provider3, useContext22];
10329
+ }
10330
+ const createScope = () => {
10331
+ const scopeContexts = defaultContexts.map((defaultContext) => {
10332
+ return t__namespace.createContext(defaultContext);
10333
+ });
10334
+ return function useScope(scope) {
10335
+ const contexts = scope?.[scopeName] || scopeContexts;
10336
+ return t__namespace.useMemo(
10337
+ () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
10338
+ [scope, contexts]
10339
+ );
10340
+ };
10341
+ };
10342
+ createScope.scopeName = scopeName;
10343
+ return [createContext32, composeContextScopes2(createScope, ...createContextScopeDeps)];
10344
+ }
10345
+ function composeContextScopes2(...scopes) {
10346
+ const baseScope = scopes[0];
10347
+ if (scopes.length === 1)
10348
+ return baseScope;
10349
+ const createScope = () => {
10350
+ const scopeHooks = scopes.map((createScope2) => ({
10351
+ useScope: createScope2(),
10352
+ scopeName: createScope2.scopeName
10353
+ }));
10354
+ return function useComposedScopes(overrideScopes) {
10355
+ const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
10356
+ const scopeProps = useScope(overrideScopes);
10357
+ const currentScope = scopeProps[`__scope${scopeName}`];
10358
+ return { ...nextScopes2, ...currentScope };
10359
+ }, {});
10360
+ return t__namespace.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
10361
+ };
10362
+ };
10363
+ createScope.scopeName = baseScope.scopeName;
10364
+ return createScope;
10365
+ }
10104
10366
  function useCallbackRef(callback) {
10105
10367
  const callbackRef = t__namespace.useRef(callback);
10106
10368
  t__namespace.useEffect(() => {
@@ -10118,14 +10380,24 @@ function useDirection(localDir) {
10118
10380
  function clamp(value, [min2, max2]) {
10119
10381
  return Math.min(max2, Math.max(min2, value));
10120
10382
  }
10121
- function useStateMachine2(initialState, machine) {
10383
+
10384
+ // ../../node_modules/@radix-ui/primitive/dist/index.mjs
10385
+ function composeEventHandlers2(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
10386
+ return function handleEvent(event) {
10387
+ originalEventHandler?.(event);
10388
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) {
10389
+ return ourEventHandler?.(event);
10390
+ }
10391
+ };
10392
+ }
10393
+ function useStateMachine3(initialState, machine) {
10122
10394
  return t__namespace.useReducer((state, event) => {
10123
10395
  const nextState = machine[state][event];
10124
10396
  return nextState ?? state;
10125
10397
  }, initialState);
10126
10398
  }
10127
10399
  var SCROLL_AREA_NAME = "ScrollArea";
10128
- var [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME);
10400
+ var [createScrollAreaContext, createScrollAreaScope] = createContextScope2(SCROLL_AREA_NAME);
10129
10401
  var [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
10130
10402
  var ScrollArea = t__namespace.forwardRef(
10131
10403
  (props, forwardedRef) => {
@@ -10145,7 +10417,7 @@ var ScrollArea = t__namespace.forwardRef(
10145
10417
  const [cornerHeight, setCornerHeight] = t__namespace.useState(0);
10146
10418
  const [scrollbarXEnabled, setScrollbarXEnabled] = t__namespace.useState(false);
10147
10419
  const [scrollbarYEnabled, setScrollbarYEnabled] = t__namespace.useState(false);
10148
- const composedRefs = useComposedRefs(forwardedRef, (node) => setScrollArea(node));
10420
+ const composedRefs = useComposedRefs2(forwardedRef, (node) => setScrollArea(node));
10149
10421
  const direction = useDirection(dir);
10150
10422
  return /* @__PURE__ */ jsxRuntime.jsx(
10151
10423
  ScrollAreaProvider,
@@ -10170,7 +10442,7 @@ var ScrollArea = t__namespace.forwardRef(
10170
10442
  onCornerWidthChange: setCornerWidth,
10171
10443
  onCornerHeightChange: setCornerHeight,
10172
10444
  children: /* @__PURE__ */ jsxRuntime.jsx(
10173
- Primitive.div,
10445
+ Primitive2.div,
10174
10446
  {
10175
10447
  dir: direction,
10176
10448
  ...scrollAreaProps,
@@ -10195,7 +10467,7 @@ var ScrollAreaViewport = t__namespace.forwardRef(
10195
10467
  const { __scopeScrollArea, children, nonce, ...viewportProps } = props;
10196
10468
  const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);
10197
10469
  const ref = t__namespace.useRef(null);
10198
- const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange);
10470
+ const composedRefs = useComposedRefs2(forwardedRef, ref, context.onViewportChange);
10199
10471
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10200
10472
  /* @__PURE__ */ jsxRuntime.jsx(
10201
10473
  "style",
@@ -10207,7 +10479,7 @@ var ScrollAreaViewport = t__namespace.forwardRef(
10207
10479
  }
10208
10480
  ),
10209
10481
  /* @__PURE__ */ jsxRuntime.jsx(
10210
- Primitive.div,
10482
+ Primitive2.div,
10211
10483
  {
10212
10484
  "data-radix-scroll-area-viewport": "",
10213
10485
  ...viewportProps,
@@ -10276,7 +10548,7 @@ var ScrollAreaScrollbarHover = t__namespace.forwardRef((props, forwardedRef) =>
10276
10548
  };
10277
10549
  }
10278
10550
  }, [context.scrollArea, context.scrollHideDelay]);
10279
- return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsxRuntime.jsx(
10551
+ return /* @__PURE__ */ jsxRuntime.jsx(Presence2, { present: forceMount || visible, children: /* @__PURE__ */ jsxRuntime.jsx(
10280
10552
  ScrollAreaScrollbarAuto,
10281
10553
  {
10282
10554
  "data-state": visible ? "visible" : "hidden",
@@ -10290,7 +10562,7 @@ var ScrollAreaScrollbarScroll = t__namespace.forwardRef((props, forwardedRef) =>
10290
10562
  const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
10291
10563
  const isHorizontal = props.orientation === "horizontal";
10292
10564
  const debounceScrollEnd = useDebounceCallback(() => send("SCROLL_END"), 100);
10293
- const [state, send] = useStateMachine2("hidden", {
10565
+ const [state, send] = useStateMachine3("hidden", {
10294
10566
  hidden: {
10295
10567
  SCROLL: "scrolling"
10296
10568
  },
@@ -10332,14 +10604,14 @@ var ScrollAreaScrollbarScroll = t__namespace.forwardRef((props, forwardedRef) =>
10332
10604
  return () => viewport.removeEventListener("scroll", handleScroll);
10333
10605
  }
10334
10606
  }, [context.viewport, isHorizontal, send, debounceScrollEnd]);
10335
- return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || state !== "hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
10607
+ return /* @__PURE__ */ jsxRuntime.jsx(Presence2, { present: forceMount || state !== "hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
10336
10608
  ScrollAreaScrollbarVisible,
10337
10609
  {
10338
10610
  "data-state": state === "hidden" ? "hidden" : "visible",
10339
10611
  ...scrollbarProps,
10340
10612
  ref: forwardedRef,
10341
- onPointerEnter: composeEventHandlers(props.onPointerEnter, () => send("POINTER_ENTER")),
10342
- onPointerLeave: composeEventHandlers(props.onPointerLeave, () => send("POINTER_LEAVE"))
10613
+ onPointerEnter: composeEventHandlers2(props.onPointerEnter, () => send("POINTER_ENTER")),
10614
+ onPointerLeave: composeEventHandlers2(props.onPointerLeave, () => send("POINTER_LEAVE"))
10343
10615
  }
10344
10616
  ) });
10345
10617
  });
@@ -10357,7 +10629,7 @@ var ScrollAreaScrollbarAuto = t__namespace.forwardRef((props, forwardedRef) => {
10357
10629
  }, 10);
10358
10630
  useResizeObserver(context.viewport, handleResize);
10359
10631
  useResizeObserver(context.content, handleResize);
10360
- return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsxRuntime.jsx(
10632
+ return /* @__PURE__ */ jsxRuntime.jsx(Presence2, { present: forceMount || visible, children: /* @__PURE__ */ jsxRuntime.jsx(
10361
10633
  ScrollAreaScrollbarVisible,
10362
10634
  {
10363
10635
  "data-state": visible ? "visible" : "hidden",
@@ -10445,7 +10717,7 @@ var ScrollAreaScrollbarX = t__namespace.forwardRef((props, forwardedRef) => {
10445
10717
  const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
10446
10718
  const [computedStyle, setComputedStyle] = t__namespace.useState();
10447
10719
  const ref = t__namespace.useRef(null);
10448
- const composeRefs2 = useComposedRefs(forwardedRef, ref, context.onScrollbarXChange);
10720
+ const composeRefs3 = useComposedRefs2(forwardedRef, ref, context.onScrollbarXChange);
10449
10721
  t__namespace.useEffect(() => {
10450
10722
  if (ref.current)
10451
10723
  setComputedStyle(getComputedStyle(ref.current));
@@ -10455,7 +10727,7 @@ var ScrollAreaScrollbarX = t__namespace.forwardRef((props, forwardedRef) => {
10455
10727
  {
10456
10728
  "data-orientation": "horizontal",
10457
10729
  ...scrollbarProps,
10458
- ref: composeRefs2,
10730
+ ref: composeRefs3,
10459
10731
  sizes,
10460
10732
  style: {
10461
10733
  bottom: 0,
@@ -10496,7 +10768,7 @@ var ScrollAreaScrollbarY = t__namespace.forwardRef((props, forwardedRef) => {
10496
10768
  const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
10497
10769
  const [computedStyle, setComputedStyle] = t__namespace.useState();
10498
10770
  const ref = t__namespace.useRef(null);
10499
- const composeRefs2 = useComposedRefs(forwardedRef, ref, context.onScrollbarYChange);
10771
+ const composeRefs3 = useComposedRefs2(forwardedRef, ref, context.onScrollbarYChange);
10500
10772
  t__namespace.useEffect(() => {
10501
10773
  if (ref.current)
10502
10774
  setComputedStyle(getComputedStyle(ref.current));
@@ -10506,7 +10778,7 @@ var ScrollAreaScrollbarY = t__namespace.forwardRef((props, forwardedRef) => {
10506
10778
  {
10507
10779
  "data-orientation": "vertical",
10508
10780
  ...scrollbarProps,
10509
- ref: composeRefs2,
10781
+ ref: composeRefs3,
10510
10782
  sizes,
10511
10783
  style: {
10512
10784
  top: 0,
@@ -10560,7 +10832,7 @@ var ScrollAreaScrollbarImpl = t__namespace.forwardRef((props, forwardedRef) => {
10560
10832
  } = props;
10561
10833
  const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);
10562
10834
  const [scrollbar, setScrollbar] = t__namespace.useState(null);
10563
- const composeRefs2 = useComposedRefs(forwardedRef, (node) => setScrollbar(node));
10835
+ const composeRefs3 = useComposedRefs2(forwardedRef, (node) => setScrollbar(node));
10564
10836
  const rectRef = t__namespace.useRef(null);
10565
10837
  const prevWebkitUserSelectRef = t__namespace.useRef("");
10566
10838
  const viewport = context.viewport;
@@ -10599,12 +10871,12 @@ var ScrollAreaScrollbarImpl = t__namespace.forwardRef((props, forwardedRef) => {
10599
10871
  onThumbPositionChange: handleThumbPositionChange,
10600
10872
  onThumbPointerDown: useCallbackRef(onThumbPointerDown),
10601
10873
  children: /* @__PURE__ */ jsxRuntime.jsx(
10602
- Primitive.div,
10874
+ Primitive2.div,
10603
10875
  {
10604
10876
  ...scrollbarProps,
10605
- ref: composeRefs2,
10877
+ ref: composeRefs3,
10606
10878
  style: { position: "absolute", ...scrollbarProps.style },
10607
- onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
10879
+ onPointerDown: composeEventHandlers2(props.onPointerDown, (event) => {
10608
10880
  const mainPointer = 0;
10609
10881
  if (event.button === mainPointer) {
10610
10882
  const element = event.target;
@@ -10617,8 +10889,8 @@ var ScrollAreaScrollbarImpl = t__namespace.forwardRef((props, forwardedRef) => {
10617
10889
  handleDragScroll(event);
10618
10890
  }
10619
10891
  }),
10620
- onPointerMove: composeEventHandlers(props.onPointerMove, handleDragScroll),
10621
- onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
10892
+ onPointerMove: composeEventHandlers2(props.onPointerMove, handleDragScroll),
10893
+ onPointerUp: composeEventHandlers2(props.onPointerUp, (event) => {
10622
10894
  const element = event.target;
10623
10895
  if (element.hasPointerCapture(event.pointerId)) {
10624
10896
  element.releasePointerCapture(event.pointerId);
@@ -10638,7 +10910,7 @@ var ScrollAreaThumb = t__namespace.forwardRef(
10638
10910
  (props, forwardedRef) => {
10639
10911
  const { forceMount, ...thumbProps } = props;
10640
10912
  const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea);
10641
- return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || scrollbarContext.hasThumb, children: /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaThumbImpl, { ref: forwardedRef, ...thumbProps }) });
10913
+ return /* @__PURE__ */ jsxRuntime.jsx(Presence2, { present: forceMount || scrollbarContext.hasThumb, children: /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaThumbImpl, { ref: forwardedRef, ...thumbProps }) });
10642
10914
  }
10643
10915
  );
10644
10916
  var ScrollAreaThumbImpl = t__namespace.forwardRef(
@@ -10647,7 +10919,7 @@ var ScrollAreaThumbImpl = t__namespace.forwardRef(
10647
10919
  const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);
10648
10920
  const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);
10649
10921
  const { onThumbPositionChange } = scrollbarContext;
10650
- const composedRef = useComposedRefs(
10922
+ const composedRef = useComposedRefs2(
10651
10923
  forwardedRef,
10652
10924
  (node) => scrollbarContext.onThumbChange(node)
10653
10925
  );
@@ -10675,7 +10947,7 @@ var ScrollAreaThumbImpl = t__namespace.forwardRef(
10675
10947
  }
10676
10948
  }, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]);
10677
10949
  return /* @__PURE__ */ jsxRuntime.jsx(
10678
- Primitive.div,
10950
+ Primitive2.div,
10679
10951
  {
10680
10952
  "data-state": scrollbarContext.hasThumb ? "visible" : "hidden",
10681
10953
  ...thumbProps,
@@ -10685,14 +10957,14 @@ var ScrollAreaThumbImpl = t__namespace.forwardRef(
10685
10957
  height: "var(--radix-scroll-area-thumb-height)",
10686
10958
  ...style
10687
10959
  },
10688
- onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, (event) => {
10960
+ onPointerDownCapture: composeEventHandlers2(props.onPointerDownCapture, (event) => {
10689
10961
  const thumb = event.target;
10690
10962
  const thumbRect = thumb.getBoundingClientRect();
10691
10963
  const x = event.clientX - thumbRect.left;
10692
10964
  const y = event.clientY - thumbRect.top;
10693
10965
  scrollbarContext.onThumbPointerDown({ x, y });
10694
10966
  }),
10695
- onPointerUp: composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp)
10967
+ onPointerUp: composeEventHandlers2(props.onPointerUp, scrollbarContext.onThumbPointerUp)
10696
10968
  }
10697
10969
  );
10698
10970
  }
@@ -10725,7 +10997,7 @@ var ScrollAreaCornerImpl = t__namespace.forwardRef((props, forwardedRef) => {
10725
10997
  setWidth(width2);
10726
10998
  });
10727
10999
  return hasSize ? /* @__PURE__ */ jsxRuntime.jsx(
10728
- Primitive.div,
11000
+ Primitive2.div,
10729
11001
  {
10730
11002
  ...cornerProps,
10731
11003
  ref: forwardedRef,
@@ -10814,7 +11086,7 @@ function useDebounceCallback(callback, delay) {
10814
11086
  }
10815
11087
  function useResizeObserver(element, onResize) {
10816
11088
  const handleResize = useCallbackRef(onResize);
10817
- useLayoutEffect2(() => {
11089
+ useLayoutEffect22(() => {
10818
11090
  let rAF = 0;
10819
11091
  if (element) {
10820
11092
  const resizeObserver = new ResizeObserver(() => {
@@ -10982,17 +11254,81 @@ var Separator3 = t__namespace.forwardRef(
10982
11254
  )
10983
11255
  );
10984
11256
  Separator3.displayName = SeparatorPrimitive__namespace.Root.displayName;
11257
+ var useInsertionEffect2 = t__namespace[" useInsertionEffect ".trim().toString()] || useLayoutEffect22;
11258
+ function useControllableState2({
11259
+ prop,
11260
+ defaultProp,
11261
+ onChange = () => {
11262
+ },
11263
+ caller
11264
+ }) {
11265
+ const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState2({
11266
+ defaultProp,
11267
+ onChange
11268
+ });
11269
+ const isControlled = prop !== void 0;
11270
+ const value = isControlled ? prop : uncontrolledProp;
11271
+ {
11272
+ const isControlledRef = t__namespace.useRef(prop !== void 0);
11273
+ t__namespace.useEffect(() => {
11274
+ const wasControlled = isControlledRef.current;
11275
+ if (wasControlled !== isControlled) {
11276
+ const from = wasControlled ? "controlled" : "uncontrolled";
11277
+ const to = isControlled ? "controlled" : "uncontrolled";
11278
+ console.warn(
11279
+ `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
11280
+ );
11281
+ }
11282
+ isControlledRef.current = isControlled;
11283
+ }, [isControlled, caller]);
11284
+ }
11285
+ const setValue = t__namespace.useCallback(
11286
+ (nextValue) => {
11287
+ if (isControlled) {
11288
+ const value2 = isFunction3(nextValue) ? nextValue(prop) : nextValue;
11289
+ if (value2 !== prop) {
11290
+ onChangeRef.current?.(value2);
11291
+ }
11292
+ } else {
11293
+ setUncontrolledProp(nextValue);
11294
+ }
11295
+ },
11296
+ [isControlled, prop, setUncontrolledProp, onChangeRef]
11297
+ );
11298
+ return [value, setValue];
11299
+ }
11300
+ function useUncontrolledState2({
11301
+ defaultProp,
11302
+ onChange
11303
+ }) {
11304
+ const [value, setValue] = t__namespace.useState(defaultProp);
11305
+ const prevValueRef = t__namespace.useRef(value);
11306
+ const onChangeRef = t__namespace.useRef(onChange);
11307
+ useInsertionEffect2(() => {
11308
+ onChangeRef.current = onChange;
11309
+ }, [onChange]);
11310
+ t__namespace.useEffect(() => {
11311
+ if (prevValueRef.current !== value) {
11312
+ onChangeRef.current?.(value);
11313
+ prevValueRef.current = value;
11314
+ }
11315
+ }, [value, prevValueRef]);
11316
+ return [value, setValue, onChangeRef];
11317
+ }
11318
+ function isFunction3(value) {
11319
+ return typeof value === "function";
11320
+ }
10985
11321
  var NAME = "Toggle";
10986
11322
  var Toggle = t__namespace.forwardRef((props, forwardedRef) => {
10987
11323
  const { pressed: pressedProp, defaultPressed, onPressedChange, ...buttonProps } = props;
10988
- const [pressed, setPressed] = useControllableState({
11324
+ const [pressed, setPressed] = useControllableState2({
10989
11325
  prop: pressedProp,
10990
11326
  onChange: onPressedChange,
10991
11327
  defaultProp: defaultPressed ?? false,
10992
11328
  caller: NAME
10993
11329
  });
10994
11330
  return /* @__PURE__ */ jsxRuntime.jsx(
10995
- Primitive.button,
11331
+ Primitive2.button,
10996
11332
  {
10997
11333
  type: "button",
10998
11334
  "aria-pressed": pressed,
@@ -11000,7 +11336,7 @@ var Toggle = t__namespace.forwardRef((props, forwardedRef) => {
11000
11336
  "data-disabled": props.disabled ? "" : void 0,
11001
11337
  ...buttonProps,
11002
11338
  ref: forwardedRef,
11003
- onClick: composeEventHandlers(props.onClick, () => {
11339
+ onClick: composeEventHandlers2(props.onClick, () => {
11004
11340
  if (!props.disabled) {
11005
11341
  setPressed(!pressed);
11006
11342
  }
@@ -11327,7 +11663,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11327
11663
  }
11328
11664
  }, [executeCommand, updateContent]);
11329
11665
  t__namespace.default.useEffect(() => {
11330
- if (editorRef.current && content !== editorRef.current.innerHTML) {
11666
+ if (editorRef.current && content && content !== editorRef.current.innerHTML) {
11331
11667
  editorRef.current.innerHTML = content;
11332
11668
  }
11333
11669
  }, [content]);
@@ -11340,7 +11676,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11340
11676
  const toolbar = showToolbar && /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(
11341
11677
  framerMotion.motion.div,
11342
11678
  {
11343
- className: "flex items-center gap-1 p-2 border-b bg-muted/50",
11679
+ className: "flex items-center gap-1 p-2 border-b bg-gray-50/50 dark:bg-zinc-800/50 backdrop-blur-sm",
11344
11680
  initial: { opacity: 0, y: -10 },
11345
11681
  animate: { opacity: 1, y: 0 },
11346
11682
  children: [
@@ -11387,7 +11723,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11387
11723
  }
11388
11724
  )
11389
11725
  ] }),
11390
- /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6" }),
11726
+ /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6 bg-gray-300 dark:bg-zinc-600" }),
11391
11727
  /* @__PURE__ */ jsxRuntime.jsxs(
11392
11728
  Select,
11393
11729
  {
@@ -11419,7 +11755,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11419
11755
  ]
11420
11756
  }
11421
11757
  ),
11422
- /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6" }),
11758
+ /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6 bg-gray-300 dark:bg-zinc-600" }),
11423
11759
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
11424
11760
  /* @__PURE__ */ jsxRuntime.jsx(
11425
11761
  ToolbarButton,
@@ -11462,7 +11798,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11462
11798
  }
11463
11799
  )
11464
11800
  ] }),
11465
- /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6" }),
11801
+ /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6 bg-gray-300 dark:bg-zinc-600" }),
11466
11802
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
11467
11803
  /* @__PURE__ */ jsxRuntime.jsx(
11468
11804
  ToolbarButton,
@@ -11505,7 +11841,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11505
11841
  }
11506
11842
  )
11507
11843
  ] }),
11508
- /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6" }),
11844
+ /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6 bg-gray-300 dark:bg-zinc-600" }),
11509
11845
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
11510
11846
  /* @__PURE__ */ jsxRuntime.jsx(
11511
11847
  ToolbarButton,
@@ -11526,7 +11862,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11526
11862
  }
11527
11863
  )
11528
11864
  ] }),
11529
- /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6" }),
11865
+ /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6 bg-gray-300 dark:bg-zinc-600" }),
11530
11866
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
11531
11867
  /* @__PURE__ */ jsxRuntime.jsx(
11532
11868
  ToolbarButton,
@@ -11547,7 +11883,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11547
11883
  }
11548
11884
  )
11549
11885
  ] }),
11550
- /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6" }),
11886
+ /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6 bg-gray-300 dark:bg-zinc-600" }),
11551
11887
  /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
11552
11888
  /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
11553
11889
  Button,
@@ -11562,7 +11898,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11562
11898
  ) }),
11563
11899
  /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-0", children: /* @__PURE__ */ jsxRuntime.jsx(ColorPicker2, { onColorSelect: setTextColor }) })
11564
11900
  ] }),
11565
- /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6" }),
11901
+ /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6 bg-gray-300 dark:bg-zinc-600" }),
11566
11902
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
11567
11903
  /* @__PURE__ */ jsxRuntime.jsx(
11568
11904
  ToolbarButton,
@@ -11585,7 +11921,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11585
11921
  ] })
11586
11922
  ] }),
11587
11923
  showPreview && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11588
- !isPreview && /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6" }),
11924
+ !isPreview && /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation: "vertical", className: "h-6 bg-gray-300 dark:bg-zinc-600" }),
11589
11925
  /* @__PURE__ */ jsxRuntime.jsx(
11590
11926
  ToolbarButton,
11591
11927
  {
@@ -11612,7 +11948,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11612
11948
  {
11613
11949
  ref,
11614
11950
  className: cn(
11615
- "border rounded-lg overflow-hidden focus-within:ring-2 focus-within:ring-ring",
11951
+ "border border-gray-200 dark:border-zinc-700 rounded-lg overflow-hidden focus-within:ring-2 focus-within:ring-ring focus-within:border-transparent",
11616
11952
  disabled && "opacity-50 cursor-not-allowed",
11617
11953
  className
11618
11954
  ),
@@ -11625,7 +11961,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11625
11961
  {
11626
11962
  initial: { opacity: 0 },
11627
11963
  animate: { opacity: 1 },
11628
- className: "p-4",
11964
+ className: "bg-slate-50 dark:bg-zinc-900/95",
11629
11965
  style: { minHeight, maxHeight, overflow: "auto" },
11630
11966
  children: /* @__PURE__ */ jsxRuntime.jsx(
11631
11967
  "textarea",
@@ -11633,7 +11969,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11633
11969
  ref: sourceRef,
11634
11970
  value: sourceContent,
11635
11971
  onChange: (e) => setSourceContent(e.target.value),
11636
- className: "w-full h-full bg-muted rounded-lg p-4 font-mono text-sm resize-none focus:outline-none focus:ring-2 focus:ring-ring",
11972
+ className: "w-full h-full bg-transparent p-4 font-mono text-sm text-gray-900 dark:text-gray-100 resize-none focus:outline-none",
11637
11973
  style: { minHeight: minHeight - 32 },
11638
11974
  disabled,
11639
11975
  placeholder: "HTML source code..."
@@ -11648,6 +11984,8 @@ var SimpleEditor = t__namespace.default.forwardRef(
11648
11984
  suppressContentEditableWarning: true,
11649
11985
  className: cn(
11650
11986
  "p-4 outline-none prose prose-sm dark:prose-invert max-w-none overflow-y-auto",
11987
+ "bg-slate-50 dark:bg-zinc-900/95",
11988
+ "text-gray-900 dark:text-gray-100",
11651
11989
  "focus:ring-0",
11652
11990
  "[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mb-4",
11653
11991
  "[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mb-3",
@@ -11678,7 +12016,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11678
12016
  }
11679
12017
  )
11680
12018
  ] }),
11681
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-2 border-t bg-muted/50 text-xs text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(CharacterCount, { content }) })
12019
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-2 border-t bg-gray-50/50 dark:bg-zinc-800/50 backdrop-blur-sm text-xs text-gray-600 dark:text-gray-400", children: /* @__PURE__ */ jsxRuntime.jsx(CharacterCount, { content }) })
11682
12020
  ]
11683
12021
  }
11684
12022
  );
@@ -11686,7 +12024,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
11686
12024
  );
11687
12025
  SimpleEditor.displayName = "SimpleEditor";
11688
12026
  var CharacterCount = ({ content }) => {
11689
- const [count3, setCount] = t.useState(0);
12027
+ const [count4, setCount] = t.useState(0);
11690
12028
  t.useEffect(() => {
11691
12029
  const getPlainText = (html) => {
11692
12030
  const div = document.createElement("div");
@@ -11696,7 +12034,7 @@ var CharacterCount = ({ content }) => {
11696
12034
  setCount(getPlainText(content).length);
11697
12035
  }, [content]);
11698
12036
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11699
- count3,
12037
+ count4,
11700
12038
  " characters"
11701
12039
  ] });
11702
12040
  };