@pibit.ai/cure-design-system 0.6.27 → 0.6.28

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.
@@ -0,0 +1,10 @@
1
+ /** Wrap a layer's children in this, with the depth `useEscapeLayer` returned, so layers inside it nest. */
2
+ export declare const EscapeLayerProvider: import('react').Provider<number>;
3
+ /**
4
+ * While `isActive`, registers this overlay for Escape; Escape then calls `onEscape` when this is the
5
+ * innermost open layer. Pass `onEscape: null` for a layer that must swallow Escape without closing
6
+ * (a non-dismissable modal). The callback is read through a ref, so an inline function is fine.
7
+ * Returns this layer's depth for `EscapeLayerProvider`.
8
+ */
9
+ export declare function useEscapeLayer(isActive: boolean, onEscape: (() => void) | null): number;
10
+ //# sourceMappingURL=use-escape-layer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-escape-layer.d.ts","sourceRoot":"","sources":["../../src/hooks/use-escape-layer.ts"],"names":[],"mappings":"AA0BA,2GAA2G;AAC3G,eAAO,MAAM,mBAAmB,kCAA4B,CAAC;AAE7D;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,MAAM,CAsBvF"}
@@ -0,0 +1,35 @@
1
+ import { createContext as l, useContext as p, useRef as f, useEffect as a } from "react";
2
+ const s = [];
3
+ let h = 0, u = !1;
4
+ const y = () => {
5
+ u || typeof document > "u" || (document.addEventListener("keydown", (r) => {
6
+ if (r.key !== "Escape" || s.length === 0 || r.defaultPrevented) return;
7
+ s.reduce((t, e) => e.depth > t.depth || e.depth === t.depth && e.order > t.order ? e : t).close();
8
+ }), u = !0);
9
+ }, i = l(0), m = i.Provider;
10
+ function x(r, o) {
11
+ const t = p(i) + 1, e = f(o);
12
+ e.current = o;
13
+ const c = o !== null;
14
+ return a(() => {
15
+ if (!r) return;
16
+ y();
17
+ const d = {
18
+ close: c ? () => {
19
+ var n;
20
+ return (n = e.current) == null ? void 0 : n.call(e);
21
+ } : () => {
22
+ },
23
+ depth: t,
24
+ order: ++h
25
+ };
26
+ return s.push(d), () => {
27
+ const n = s.indexOf(d);
28
+ n >= 0 && s.splice(n, 1);
29
+ };
30
+ }, [r, c, t]), t;
31
+ }
32
+ export {
33
+ m as EscapeLayerProvider,
34
+ x as useEscapeLayer
35
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/patterns/drawer/drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAWxD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,8GAA8G;IAC9G,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6FAA6F;IAC7F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iDAAiD;IACjD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,iFAAiF;IACjF,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sBAAsB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,0CAA0C;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAuPxC,CAAC"}
1
+ {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/patterns/drawer/drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAYxD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,8GAA8G;IAC9G,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6FAA6F;IAC7F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iDAAiD;IACjD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,iFAAiF;IACjF,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sBAAsB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,0CAA0C;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA6QxC,CAAC"}
@@ -1,150 +1,161 @@
1
- import { jsxs as l, Fragment as lt, jsx as r } from "react/jsx-runtime";
2
- import { Minimize01 as P, Expand01 as j, X as it } from "@untitledui/icons";
3
- import { useId as ct, useRef as nt, useEffect as dt } from "react";
4
- import { ClickAwayListener as ut } from "../click-away/click-away-listener.js";
5
- const xt = ({
6
- isOpen: s,
7
- onClose: k,
8
- title: v,
9
- subtitle: $,
10
- children: L,
11
- width: X = "max-w-lg",
12
- footer: q,
13
- showDefaultFooter: E = !1,
14
- className: A = "",
15
- side: n = "right",
16
- style: _,
17
- leftOffset: h = 0,
18
- headerClassName: K = "",
19
- bodyClassName: T = "",
1
+ import { jsxs as l, Fragment as dt, jsx as e } from "react/jsx-runtime";
2
+ import { Minimize01 as M, Expand01 as j, X as ut } from "@untitledui/icons";
3
+ import { useId as mt, useRef as X, useEffect as q } from "react";
4
+ import { useEscapeLayer as ft, EscapeLayerProvider as vt } from "../../hooks/use-escape-layer.js";
5
+ import { ClickAwayListener as yt } from "../click-away/click-away-listener.js";
6
+ const kt = ({
7
+ isOpen: o,
8
+ onClose: y,
9
+ title: p,
10
+ subtitle: I,
11
+ children: A,
12
+ width: _ = "max-w-lg",
13
+ footer: K,
14
+ showDefaultFooter: T = !1,
15
+ className: B = "",
16
+ side: i = "right",
17
+ style: U,
18
+ leftOffset: $ = 0,
19
+ headerClassName: V = "",
20
+ bodyClassName: Y = "",
20
21
  header: d = null,
21
- onClickOutside: U,
22
- showBackDrop: B = !1,
23
- footerClassName: V = "",
24
- expanded: i = !1,
22
+ onClickOutside: G,
23
+ showBackDrop: H = !1,
24
+ footerClassName: J = "",
25
+ expanded: c = !1,
25
26
  onExpandedChange: u,
26
- maxWidth: I = "90vw",
27
- resizableWidth: e,
28
- minResizableWidth: p = 476,
29
- maxResizableWidth: Y,
30
- onResizableWidthChange: o,
31
- headerActions: G,
32
- fullscreenOpen: x = !1,
27
+ maxWidth: h = "90vw",
28
+ resizableWidth: s,
29
+ minResizableWidth: x = 476,
30
+ maxResizableWidth: Q,
31
+ onResizableWidthChange: a,
32
+ headerActions: Z,
33
+ fullscreenOpen: b = !1,
33
34
  onFullscreenOpenChange: m,
34
- "data-testid": H
35
+ "data-testid": F
35
36
  }) => {
36
- const f = u !== void 0, J = m !== void 0, y = e !== void 0 && o !== void 0, b = Math.max(Y ?? Number.POSITIVE_INFINITY, p), w = s && y, N = (t) => Math.min(Math.max(t, p), b), S = ct(), c = nt(null);
37
- dt(() => () => {
37
+ const f = u !== void 0, z = m !== void 0, v = s !== void 0 && a !== void 0, w = Math.max(Q ?? Number.POSITIVE_INFINITY, x), N = o && v, g = (t) => Math.min(Math.max(t, x), w), E = mt(), S = X(null), C = ft(o, y);
38
+ q(() => {
39
+ if (!o) return;
40
+ const t = document.activeElement, r = S.current;
41
+ return r && !r.contains(document.activeElement) && r.focus({ preventScroll: !0 }), () => {
42
+ (!document.activeElement || document.activeElement === document.body || !!(r != null && r.contains(document.activeElement))) && (t != null && t.isConnected) && t.focus({ preventScroll: !0 });
43
+ };
44
+ }, [o]);
45
+ const n = X(null);
46
+ q(() => () => {
38
47
  var t;
39
- return (t = c.current) == null ? void 0 : t.call(c);
48
+ return (t = n.current) == null ? void 0 : t.call(n);
40
49
  }, []);
41
- const Q = (t) => {
42
- if (!w || e === void 0) return;
50
+ const R = (t) => {
51
+ if (!N || s === void 0) return;
43
52
  t.preventDefault(), t.stopPropagation();
44
- const a = t.clientX, et = e, ot = document.body.style.cursor, st = document.body.style.userSelect;
53
+ const r = t.clientX, D = s, ct = document.body.style.cursor, nt = document.body.style.userSelect;
45
54
  document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
46
- const M = (at) => {
47
- o == null || o(N(et + a - at.clientX));
48
- }, g = () => {
49
- document.body.style.cursor = ot, document.body.style.userSelect = st, window.removeEventListener("pointermove", M), window.removeEventListener("pointerup", g), c.current = null;
55
+ const P = (it) => {
56
+ a == null || a(g(D + r - it.clientX));
57
+ }, k = () => {
58
+ document.body.style.cursor = ct, document.body.style.userSelect = nt, window.removeEventListener("pointermove", P), window.removeEventListener("pointerup", k), n.current = null;
50
59
  };
51
- c.current = g, window.addEventListener("pointermove", M), window.addEventListener("pointerup", g);
52
- }, Z = (t) => {
53
- if (!w || e === void 0) return;
54
- const a = t.shiftKey ? 50 : 16;
55
- t.key === "ArrowLeft" && (t.preventDefault(), o == null || o(N(e + a))), t.key === "ArrowRight" && (t.preventDefault(), o == null || o(N(e - a)));
56
- }, F = n === "left" ? s ? "left-4" : "left-0" : s ? "right-[6px]" : "right-0", D = n === "left" && h > 0, z = (() => {
57
- const t = { ..._ };
58
- if (D) {
59
- const a = s ? `${h}px` : "calc(-100%)";
60
- t.transform = `translateX(${a})`;
60
+ n.current = k, window.addEventListener("pointermove", P), window.addEventListener("pointerup", k);
61
+ }, O = (t) => {
62
+ if (!N || s === void 0) return;
63
+ const r = t.shiftKey ? 50 : 16;
64
+ t.key === "ArrowLeft" && (t.preventDefault(), a == null || a(g(s + r))), t.key === "ArrowRight" && (t.preventDefault(), a == null || a(g(s - r)));
65
+ }, W = i === "left" ? o ? "left-4" : "left-0" : o ? "right-[6px]" : "right-0", L = i === "left" && $ > 0, tt = (() => {
66
+ const t = { ...U };
67
+ if (L) {
68
+ const r = o ? `${$}px` : "calc(-100%)";
69
+ t.transform = `translateX(${r})`;
61
70
  }
62
- return y && e !== void 0 ? (t.width = e, t.maxWidth = e) : f && (t.width = i ? I : "32rem", t.maxWidth = i ? I : "32rem"), t;
63
- })(), C = D ? "" : n === "left" ? s ? "translate-x-0" : "-translate-x-full" : s ? "translate-x-0" : "translate-x-full", R = `
64
- ${F}
71
+ return v && s !== void 0 ? (t.width = s, t.maxWidth = s) : f && (t.width = c ? h : "32rem", t.maxWidth = c ? h : "32rem"), t;
72
+ })(), et = L ? "" : i === "left" ? o ? "translate-x-0" : "-translate-x-full" : o ? "translate-x-0" : "translate-x-full", rt = `
73
+ ${W}
65
74
  fixed h-[calc(100vh-12px)] my-[6px] bottom-0
66
- ${y || f ? "" : `w-full ${X}`}
75
+ ${v || f ? "" : `w-full ${_}`}
67
76
  transform transition-transform duration-300 ease-in-out z-[100]
68
- ${y ? "" : "transition-[width] duration-300 ease-in-out"}
69
- ${C} ${A}`, O = {
77
+ ${v ? "" : "transition-[width] duration-300 ease-in-out"}
78
+ ${et} ${B}`, ot = {
70
79
  backgroundImage: "linear-gradient(90deg, rgba(6, 132, 240, 0.1) 0%, rgba(6, 132, 240, 0.1) 100%), linear-gradient(0deg, rgba(255, 255, 255, 0) 60.66%, rgba(255, 255, 255, 0.5) 100%), linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.3) 100%)"
71
- }, W = `flex items-center justify-between pl-6 pr-2 border-b border-secondary gap-2 py-4 ${K} h-[60px]`, tt = `px-5 pb-3 overflow-y-auto flex-grow ${T}`, rt = `p-4 ${V}`;
72
- return /* @__PURE__ */ l(lt, { children: [
73
- s && B && /* @__PURE__ */ r("div", { className: "fixed inset-0 z-[99] bg-black/40", onClick: U, "aria-hidden": "true" }),
74
- /* @__PURE__ */ r("div", { className: s ? "w-[100vw-64px] h-[100vh] fixed inset-0 z-[9999]" : "hidden", children: /* @__PURE__ */ r(ut, { onClickAway: k, as: "div", children: /* @__PURE__ */ r(
80
+ }, st = `flex items-center justify-between pl-6 pr-2 border-b border-secondary gap-2 py-4 ${V} h-[60px]`, at = `px-5 pb-3 overflow-y-auto flex-grow ${Y}`, lt = `p-4 ${J}`;
81
+ return /* @__PURE__ */ l(dt, { children: [
82
+ o && H && /* @__PURE__ */ e("div", { className: "fixed inset-0 z-[99] bg-black/40", onClick: G, "aria-hidden": "true" }),
83
+ /* @__PURE__ */ e("div", { className: o ? "w-[100vw-64px] h-[100vh] fixed inset-0 z-[9999]" : "hidden", children: /* @__PURE__ */ e(yt, { onClickAway: y, as: "div", children: /* @__PURE__ */ e(
75
84
  "div",
76
85
  {
77
- className: R,
78
- style: z,
86
+ ref: S,
87
+ tabIndex: -1,
88
+ className: `${rt} outline-none`,
89
+ style: tt,
79
90
  role: "dialog",
80
91
  "aria-modal": "true",
81
- "aria-labelledby": d ? void 0 : S,
82
- "aria-label": d && v ? v : void 0,
83
- "data-testid": H,
92
+ "aria-labelledby": d ? void 0 : E,
93
+ "aria-label": d && p ? p : void 0,
94
+ "data-testid": F,
84
95
  onClick: (t) => t.stopPropagation(),
85
96
  children: /* @__PURE__ */ l(
86
97
  "div",
87
98
  {
88
- className: `relative h-full w-full backdrop-blur-[3px] rounded-2xl p-2 ${n === "right" ? "border-l border-t border-b border-white" : "border border-white"}`,
89
- style: O,
99
+ className: `relative h-full w-full backdrop-blur-[3px] rounded-2xl p-2 ${i === "right" ? "border-l border-t border-b border-white" : "border border-white"}`,
100
+ style: ot,
90
101
  children: [
91
- w && /* @__PURE__ */ r(
102
+ N && /* @__PURE__ */ e(
92
103
  "div",
93
104
  {
94
105
  role: "separator",
95
106
  "aria-label": "Resize drawer",
96
107
  "aria-orientation": "vertical",
97
- "aria-valuemin": p,
98
- "aria-valuemax": Number.isFinite(b) ? b : void 0,
99
- "aria-valuenow": Math.round(e),
108
+ "aria-valuemin": x,
109
+ "aria-valuemax": Number.isFinite(w) ? w : void 0,
110
+ "aria-valuenow": Math.round(s),
100
111
  tabIndex: 0,
101
- onPointerDown: Q,
102
- onKeyDown: Z,
103
- className: "absolute left-0 top-0 z-10 h-full w-2 -translate-x-1 cursor-col-resize touch-none focus-visible:outline-none"
112
+ onPointerDown: R,
113
+ onKeyDown: O,
114
+ className: "absolute left-0 top-0 z-10 h-full w-2 -translate-x-1 cursor-col-resize touch-none rounded-full outline-none focus-visible:bg-brand-solid"
104
115
  }
105
116
  ),
106
117
  /* @__PURE__ */ l("div", { className: "h-full w-full bg-white rounded-lg overflow-hidden flex flex-col", children: [
107
- d || /* @__PURE__ */ l("header", { className: W, children: [
118
+ d || /* @__PURE__ */ l("header", { className: st, children: [
108
119
  /* @__PURE__ */ l("div", { className: `flex-1 flex flex-col gap-0 ${f ? "pr-2" : "pr-16"}`, children: [
109
- /* @__PURE__ */ r("h2", { id: S, className: "text-lg font-semibold leading-7 text-[#06060a]", children: v }),
110
- $ && /* @__PURE__ */ r("p", { className: "text-sm text-secondary", children: $ })
120
+ /* @__PURE__ */ e("h2", { id: E, className: "text-lg font-semibold leading-7 text-[#06060a]", children: p }),
121
+ I && /* @__PURE__ */ e("p", { className: "text-sm text-secondary", children: I })
111
122
  ] }),
112
123
  /* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
113
- G,
114
- J && /* @__PURE__ */ r(
124
+ Z,
125
+ z && /* @__PURE__ */ e(
115
126
  "button",
116
127
  {
117
128
  type: "button",
118
- onClick: () => m == null ? void 0 : m(!x),
129
+ onClick: () => m == null ? void 0 : m(!b),
119
130
  className: "flex items-center justify-center p-2 rounded-lg hover:bg-primary_hover transition-colors cursor-pointer",
120
- "aria-label": x ? "Exit full screen" : "Open full screen",
121
- children: x ? /* @__PURE__ */ r(P, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 }) : /* @__PURE__ */ r(j, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 })
131
+ "aria-label": b ? "Exit full screen" : "Open full screen",
132
+ children: b ? /* @__PURE__ */ e(M, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 }) : /* @__PURE__ */ e(j, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 })
122
133
  }
123
134
  ),
124
- f && /* @__PURE__ */ r(
135
+ f && /* @__PURE__ */ e(
125
136
  "button",
126
137
  {
127
138
  type: "button",
128
- onClick: () => u == null ? void 0 : u(!i),
139
+ onClick: () => u == null ? void 0 : u(!c),
129
140
  className: "flex items-center justify-center p-2 rounded-lg hover:bg-primary_hover transition-colors cursor-pointer",
130
- "aria-label": i ? "Collapse sidebar" : "Expand sidebar",
131
- children: i ? /* @__PURE__ */ r(P, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 }) : /* @__PURE__ */ r(j, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 })
141
+ "aria-label": c ? "Collapse sidebar" : "Expand sidebar",
142
+ children: c ? /* @__PURE__ */ e(M, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 }) : /* @__PURE__ */ e(j, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 })
132
143
  }
133
144
  ),
134
- /* @__PURE__ */ r(
145
+ /* @__PURE__ */ e(
135
146
  "button",
136
147
  {
137
148
  type: "button",
138
- onClick: k,
149
+ onClick: y,
139
150
  "aria-label": "Close",
140
151
  className: "flex items-center justify-center p-2 rounded-lg hover:bg-primary_hover transition-colors cursor-pointer",
141
- children: /* @__PURE__ */ r(it, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 })
152
+ children: /* @__PURE__ */ e(ut, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 })
142
153
  }
143
154
  )
144
155
  ] })
145
156
  ] }),
146
- /* @__PURE__ */ r("main", { className: tt, children: L }),
147
- E && /* @__PURE__ */ r("footer", { className: rt, children: q })
157
+ /* @__PURE__ */ e("main", { className: at, children: /* @__PURE__ */ e(vt, { value: C, children: A }) }),
158
+ T && /* @__PURE__ */ e("footer", { className: lt, children: K })
148
159
  ] })
149
160
  ]
150
161
  }
@@ -154,5 +165,5 @@ const xt = ({
154
165
  ] });
155
166
  };
156
167
  export {
157
- xt as Drawer
168
+ kt as Drawer
158
169
  };
@@ -4,7 +4,7 @@ import { useState as U, useId as Y, useRef as G, useEffect as J } from "react";
4
4
  import { motion as Q } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
5
5
  const Z = 512, W = "calc(100vw - 140px)", C = { type: "tween", duration: 0.3, ease: "easeInOut" }, se = ({
6
6
  state: o,
7
- onClose: g,
7
+ onClose: I,
8
8
  header: s,
9
9
  title: u = "",
10
10
  subtitle: y,
@@ -23,7 +23,7 @@ const Z = 512, W = "calc(100vw - 140px)", C = { type: "tween", duration: 0.3, ea
23
23
  }) => {
24
24
  const [w, L] = U(!1), m = o !== "hidden";
25
25
  m && !w && L(!0);
26
- const N = c !== void 0, b = o === "expanded", l = o === "hidden" ? 0 : o === "expanded" ? k : R ?? D, f = Math.max(M ?? Number.POSITIVE_INFINITY, a), p = o === "normal" && m && typeof l == "number" && r !== void 0, v = (e) => Math.min(Math.max(e, a), f), h = Y(), i = G(null);
26
+ const N = c !== void 0, b = o === "expanded", l = o === "hidden" ? 0 : o === "expanded" ? k : R ?? D, f = Math.max(M ?? Number.POSITIVE_INFINITY, a), p = o === "normal" && m && typeof l == "number" && r !== void 0, v = (e) => Math.min(Math.max(e, a), f), g = Y(), i = G(null);
27
27
  J(() => () => {
28
28
  var e;
29
29
  return (e = i.current) == null ? void 0 : e.call(i);
@@ -33,12 +33,12 @@ const Z = 512, W = "calc(100vw - 140px)", C = { type: "tween", duration: 0.3, ea
33
33
  e.preventDefault(), e.stopPropagation();
34
34
  const d = e.clientX, $ = l, O = document.body.style.cursor, q = document.body.style.userSelect;
35
35
  document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
36
- const I = (B) => {
36
+ const h = (B) => {
37
37
  r == null || r(v($ + d - B.clientX));
38
38
  }, x = () => {
39
- document.body.style.cursor = O, document.body.style.userSelect = q, window.removeEventListener("pointermove", I), window.removeEventListener("pointerup", x), i.current = null;
39
+ document.body.style.cursor = O, document.body.style.userSelect = q, window.removeEventListener("pointermove", h), window.removeEventListener("pointerup", x), i.current = null;
40
40
  };
41
- i.current = x, window.addEventListener("pointermove", I), window.addEventListener("pointerup", x);
41
+ i.current = x, window.addEventListener("pointermove", h), window.addEventListener("pointerup", x);
42
42
  }, X = (e) => {
43
43
  if (!p || typeof l != "number") return;
44
44
  const d = e.shiftKey ? 50 : 16;
@@ -60,7 +60,7 @@ const Z = 512, W = "calc(100vw - 140px)", C = { type: "tween", duration: 0.3, ea
60
60
  "div",
61
61
  {
62
62
  role: "region",
63
- "aria-labelledby": s == null ? h : void 0,
63
+ "aria-labelledby": s == null ? g : void 0,
64
64
  "aria-label": s != null && u ? u : void 0,
65
65
  className: "h-full w-full min-w-0 flex flex-col rounded-2xl border-l border-t border-b border-white backdrop-blur-[3px] p-2",
66
66
  style: _,
@@ -77,13 +77,13 @@ const Z = 512, W = "calc(100vw - 140px)", C = { type: "tween", duration: 0.3, ea
77
77
  tabIndex: 0,
78
78
  onPointerDown: T,
79
79
  onKeyDown: X,
80
- className: "absolute left-0 top-0 z-10 h-full w-2 -translate-x-1 cursor-col-resize touch-none focus-visible:outline-none"
80
+ className: "absolute left-0 top-0 z-10 h-full w-2 -translate-x-1 cursor-col-resize touch-none rounded-full outline-none focus-visible:bg-brand-solid"
81
81
  }
82
82
  ),
83
83
  /* @__PURE__ */ n("div", { className: "h-full w-full bg-white rounded-lg overflow-hidden flex flex-col min-w-0", children: [
84
84
  s ?? /* @__PURE__ */ n("header", { className: j, children: [
85
85
  /* @__PURE__ */ n("div", { className: `flex-1 flex flex-col gap-0 min-w-0 ${N ? "pr-2" : "pr-16"}`, children: [
86
- /* @__PURE__ */ t("h2", { id: h, className: "text-lg font-semibold leading-7 text-[#06060a] truncate", children: u }),
86
+ /* @__PURE__ */ t("h2", { id: g, className: "text-lg font-semibold leading-7 text-[#06060a] truncate", children: u }),
87
87
  y && /* @__PURE__ */ t("p", { className: "text-sm text-secondary truncate", children: y })
88
88
  ] }),
89
89
  /* @__PURE__ */ n("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
@@ -102,7 +102,7 @@ const Z = 512, W = "calc(100vw - 140px)", C = { type: "tween", duration: 0.3, ea
102
102
  "button",
103
103
  {
104
104
  type: "button",
105
- onClick: g,
105
+ onClick: I,
106
106
  className: "flex items-center justify-center p-2 rounded-lg hover:bg-primary_hover transition-colors cursor-pointer",
107
107
  "aria-label": "Close",
108
108
  children: /* @__PURE__ */ t(F, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 })
@@ -1,51 +1,51 @@
1
- import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
- import { MinusSquare as v } from "@untitledui/icons";
3
- import { cx as p } from "../../utils/cn.js";
4
- import { Checkbox as u } from "../../primitives/checkbox/checkbox.js";
5
- import { Button as y } from "../../primitives/button/button.js";
1
+ import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
+ import { MinusSquare as N } from "@untitledui/icons";
3
+ import { cx as f } from "../../utils/cn.js";
4
+ import { Checkbox as h } from "../../primitives/checkbox/checkbox.js";
5
+ import { Button as b } from "../../primitives/button/button.js";
6
6
  function D({
7
- options: x,
7
+ options: p,
8
8
  selectedKeys: c,
9
9
  onChange: l,
10
10
  onApply: d,
11
11
  onReset: m,
12
- onClose: n,
13
- className: b
12
+ onClose: o,
13
+ className: y
14
14
  }) {
15
- const a = x.map((e) => e.key).filter(Boolean), i = new Set(c), f = a.length > 0 && i.size === a.length, h = i.size > 0 && i.size < a.length, o = () => {
16
- f || h ? l == null || l([]) : l == null || l(a);
15
+ const s = p.map((e) => e.key).filter(Boolean), t = new Set(c), u = s.length > 0 && t.size === s.length, x = t.size > 0 && t.size < s.length, n = () => {
16
+ u || x ? l == null || l([]) : l == null || l(s);
17
17
  }, k = (e) => {
18
- const t = new Set(c);
19
- t.has(e) ? t.delete(e) : t.add(e), l == null || l(Array.from(t));
18
+ const a = new Set(c);
19
+ a.has(e) ? a.delete(e) : a.add(e), l == null || l(Array.from(a));
20
20
  }, S = () => {
21
- d == null || d(c), n == null || n();
22
- }, N = () => {
21
+ d == null || d(c), o == null || o();
22
+ }, v = () => {
23
23
  m == null || m();
24
24
  };
25
- return /* @__PURE__ */ s(
25
+ return /* @__PURE__ */ i(
26
26
  "div",
27
27
  {
28
- className: p(
28
+ className: f(
29
29
  "flex flex-col rounded-xl bg-primary shadow-sm ring-1 ring-primary",
30
- b
30
+ y
31
31
  ),
32
32
  "data-slot": "checklist-select",
33
33
  children: [
34
- /* @__PURE__ */ s("div", { className: "flex flex-col gap-0 p-3", children: [
35
- /* @__PURE__ */ s(
34
+ /* @__PURE__ */ i("div", { className: "flex flex-col gap-0 p-3", children: [
35
+ /* @__PURE__ */ i(
36
36
  "label",
37
37
  {
38
- className: p(
38
+ className: f(
39
39
  "flex cursor-pointer items-center gap-3 rounded-md py-2 pr-2 pl-0 outline-hidden",
40
40
  "hover:bg-primary_hover"
41
41
  ),
42
42
  children: [
43
- h ? /* @__PURE__ */ r(
44
- v,
43
+ x ? /* @__PURE__ */ r(
44
+ N,
45
45
  {
46
46
  size: 18,
47
- className: "text-utility-brand-600",
48
- onClick: o,
47
+ className: "text-utility-brand-600 rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
48
+ onClick: n,
49
49
  cursor: "pointer",
50
50
  "aria-hidden": !1,
51
51
  role: "checkbox",
@@ -53,14 +53,14 @@ function D({
53
53
  "aria-label": "Select all options",
54
54
  tabIndex: 0,
55
55
  onKeyDown: (e) => {
56
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o());
56
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n());
57
57
  }
58
58
  }
59
59
  ) : /* @__PURE__ */ r(
60
- u,
60
+ h,
61
61
  {
62
- isSelected: f,
63
- onChange: o,
62
+ isSelected: u,
63
+ onChange: n,
64
64
  size: "sm",
65
65
  "aria-label": "Select all options"
66
66
  }
@@ -69,18 +69,18 @@ function D({
69
69
  ]
70
70
  }
71
71
  ),
72
- x.map((e) => /* @__PURE__ */ s(
72
+ p.map((e) => /* @__PURE__ */ i(
73
73
  "label",
74
74
  {
75
- className: p(
75
+ className: f(
76
76
  "flex cursor-pointer items-center gap-3 rounded-md py-2 pr-2 pl-0 outline-hidden",
77
77
  "hover:bg-primary_hover"
78
78
  ),
79
79
  children: [
80
80
  /* @__PURE__ */ r(
81
- u,
81
+ h,
82
82
  {
83
- isSelected: i.has(e.key),
83
+ isSelected: t.has(e.key),
84
84
  onChange: () => k(e.key),
85
85
  size: "sm",
86
86
  "aria-label": e.value
@@ -92,19 +92,19 @@ function D({
92
92
  e.key
93
93
  ))
94
94
  ] }),
95
- /* @__PURE__ */ s("div", { className: "flex gap-2 border-primary p-3", children: [
95
+ /* @__PURE__ */ i("div", { className: "flex gap-2 border-primary p-3", children: [
96
96
  /* @__PURE__ */ r(
97
- y,
97
+ b,
98
98
  {
99
99
  size: "xs",
100
100
  color: "secondary",
101
101
  className: "flex-1 bg-secondary border-none text-primary",
102
- onClick: N,
102
+ onClick: v,
103
103
  children: "Reset"
104
104
  }
105
105
  ),
106
106
  /* @__PURE__ */ r(
107
- y,
107
+ b,
108
108
  {
109
109
  size: "xs",
110
110
  color: "primary",