@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.
@@ -1,105 +1,105 @@
1
- import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
- import { MinusSquare as N } from "@untitledui/icons";
3
- import g from "../../primitives/select/SearchInput.js";
4
- import { Checkbox as m, CheckboxBase as b } from "../../primitives/checkbox/checkbox.js";
1
+ import { jsxs as n, jsx as a } from "react/jsx-runtime";
2
+ import { MinusSquare as y } from "@untitledui/icons";
3
+ import N from "../../primitives/select/SearchInput.js";
4
+ import { Checkbox as u, CheckboxBase as g } from "../../primitives/checkbox/checkbox.js";
5
5
  import { Avatar as S } from "../../primitives/avatar/avatar.js";
6
- function C(a) {
7
- return a.label ?? String(a.value ?? "");
6
+ function C(r) {
7
+ return r.label ?? String(r.value ?? "");
8
8
  }
9
- function k(a) {
10
- return a.value ?? String(a.id ?? "");
9
+ function k(r) {
10
+ return r.value ?? String(r.id ?? "");
11
11
  }
12
- function w(a) {
13
- return a.id ?? a.value;
12
+ function w(r) {
13
+ return r.id ?? r.value;
14
14
  }
15
15
  function _({
16
- title: a,
17
- items: c,
18
- selectedValues: t,
19
- selectAll: o,
16
+ title: r,
17
+ items: o,
18
+ selectedValues: i,
19
+ selectAll: c,
20
20
  search: l,
21
- placeholder: u = "Search",
22
- showAvatar: h,
23
- getItemLabel: i = C,
24
- getItemValue: f = k,
21
+ placeholder: f = "Search",
22
+ showAvatar: m,
23
+ getItemLabel: t = C,
24
+ getItemValue: h = k,
25
25
  getItemKey: x = w,
26
26
  onSearchChange: p,
27
27
  onToggleSelectAll: s,
28
28
  onToggleItem: v
29
29
  }) {
30
- const y = c.filter(
31
- (e) => i(e).toLowerCase().includes(l.toLowerCase())
30
+ const b = o.filter(
31
+ (e) => t(e).toLowerCase().includes(l.toLowerCase())
32
32
  );
33
33
  return /* @__PURE__ */ n("div", { children: [
34
34
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2 mb-4", children: [
35
- /* @__PURE__ */ r("h3", { className: "text-sm font-medium text-gray-900", children: a }),
36
- t.length > 0 && /* @__PURE__ */ n("span", { className: "text-xs", children: [
37
- t.length,
35
+ /* @__PURE__ */ a("h3", { className: "text-sm font-medium text-gray-900", children: r }),
36
+ i.length > 0 && /* @__PURE__ */ n("span", { className: "text-xs", children: [
37
+ i.length,
38
38
  " selected"
39
39
  ] })
40
40
  ] }),
41
41
  /* @__PURE__ */ n("div", { className: "space-y-1", children: [
42
- (c.length > 10 || l) && /* @__PURE__ */ r(
43
- g,
42
+ (o.length > 10 || l) && /* @__PURE__ */ a(
43
+ N,
44
44
  {
45
45
  className: "bg-secondary_subtle ring-0 rounded-md",
46
46
  size: "sm",
47
- placeholder: u,
47
+ placeholder: f,
48
48
  value: l,
49
49
  onChange: p
50
50
  }
51
51
  ),
52
52
  /* @__PURE__ */ n("div", { className: "max-h-48 overflow-y-auto", children: [
53
53
  /* @__PURE__ */ n("div", { className: "flex items-center gap-3 p-2", children: [
54
- o ? /* @__PURE__ */ r(
55
- m,
54
+ c ? /* @__PURE__ */ a(
55
+ u,
56
56
  {
57
57
  className: "cursor-pointer",
58
58
  "aria-label": "Select all",
59
- isSelected: o,
59
+ isSelected: c,
60
60
  onChange: s
61
61
  }
62
- ) : /* @__PURE__ */ r(
62
+ ) : /* @__PURE__ */ a(
63
63
  "div",
64
64
  {
65
65
  onClick: s,
66
66
  role: "checkbox",
67
- "aria-checked": t.length > 0 ? "mixed" : !1,
67
+ "aria-checked": i.length > 0 ? "mixed" : !1,
68
68
  "aria-label": "Select all",
69
69
  tabIndex: 0,
70
70
  onKeyDown: (e) => {
71
71
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), s());
72
72
  },
73
- className: "h-4 w-4 flex items-center justify-center overflow-hidden cursor-pointer",
74
- children: t.length > 0 ? /* @__PURE__ */ r(N, { size: 18, className: "text-utility-brand-600" }) : /* @__PURE__ */ r(b, { isSelected: !1 })
73
+ className: "h-4 w-4 flex items-center justify-center overflow-hidden cursor-pointer rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
74
+ children: i.length > 0 ? /* @__PURE__ */ a(y, { size: 18, className: "text-utility-brand-600" }) : /* @__PURE__ */ a(g, { isSelected: !1 })
75
75
  }
76
76
  ),
77
- /* @__PURE__ */ r("span", { className: "text-sm font-medium text-gray-900", children: "Select All" })
77
+ /* @__PURE__ */ a("span", { className: "text-sm font-medium text-gray-900", children: "Select All" })
78
78
  ] }),
79
- y.map((e) => {
80
- const d = f(e);
79
+ b.map((e) => {
80
+ const d = h(e);
81
81
  return /* @__PURE__ */ n(
82
82
  "div",
83
83
  {
84
84
  className: "flex items-center gap-3 hover:bg-primary_hover rounded-md p-2",
85
85
  children: [
86
- /* @__PURE__ */ r(
87
- m,
86
+ /* @__PURE__ */ a(
87
+ u,
88
88
  {
89
- "aria-label": i(e),
90
- isSelected: t.includes(d),
89
+ "aria-label": t(e),
90
+ isSelected: i.includes(d),
91
91
  onChange: () => v(d)
92
92
  }
93
93
  ),
94
- h ? /* @__PURE__ */ r(
94
+ m ? /* @__PURE__ */ a(
95
95
  S,
96
96
  {
97
97
  size: "xs",
98
- initials: i(e).charAt(0),
99
- alt: i(e)
98
+ initials: t(e).charAt(0),
99
+ alt: t(e)
100
100
  }
101
101
  ) : null,
102
- /* @__PURE__ */ r("span", { className: "text-sm text-gray-700", children: i(e) })
102
+ /* @__PURE__ */ a("span", { className: "text-sm text-gray-700", children: t(e) })
103
103
  ]
104
104
  },
105
105
  x(e)
@@ -1 +1 @@
1
- {"version":3,"file":"status-filter-dropdown.d.ts","sourceRoot":"","sources":["../../../src/patterns/filters/status-filter-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAgBnE,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAA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AAE,EAAE,CAAC,yBAAyB,CAyP9D,CAAC"}
1
+ {"version":3,"file":"status-filter-dropdown.d.ts","sourceRoot":"","sources":["../../../src/patterns/filters/status-filter-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAgBnE,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,OAAO,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,KAAK,uBAAuB,GAAG;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yFAAyF;IACzF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yFAAyF;IACzF,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,KAAK,iCAAiC,GAAG,uBAAuB,GAAG;IACjE,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,oBAAoB,EAAE,aAAa,CAAC;IACpC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,aAAa,EAAE,kBAAkB,EAAE,CAAC;IACpC,2GAA2G;IAC3G,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,KAAK,+BAA+B,GAAG,uBAAuB,GAAG;IAC/D,aAAa,EAAE,QAAQ,CAAC;IACxB,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,iGAAiG;IACjG,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GACjC,iCAAiC,GACjC,+BAA+B,CAAC;AAQpC,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA0Q9D,CAAC"}
@@ -1,109 +1,118 @@
1
- import { jsx as l, jsxs as s, Fragment as j } from "react/jsx-runtime";
2
- import { useRef as v, useState as L, useLayoutEffect as b } from "react";
3
- import { ChevronDown as O, MinusSquare as T } from "@untitledui/icons";
4
- import { cx as B } from "../../utils/cn.js";
5
- import { Dropdown as k } from "../../primitives/dropdown/dropdown.js";
6
- import { Button as m } from "../../primitives/button/button.js";
7
- import { RadioButtonBase as K } from "../../primitives/radio/radio.js";
8
- import { CheckboxBase as _ } from "../../primitives/checkbox/checkbox.js";
9
- const w = ({ isSelected: t }) => /* @__PURE__ */ l("div", { className: "pointer-events-none", "aria-hidden": !0, children: /* @__PURE__ */ l(_, { isSelected: t }) }), W = (t) => {
1
+ import { jsx as l, jsxs as s, Fragment as _ } from "react/jsx-runtime";
2
+ import { useRef as C, useState as q, useLayoutEffect as D } from "react";
3
+ import { ChevronDown as I, MinusSquare as P } from "@untitledui/icons";
4
+ import { cx as $ } from "../../utils/cn.js";
5
+ import { Dropdown as p } from "../../primitives/dropdown/dropdown.js";
6
+ import { Button as y } from "../../primitives/button/button.js";
7
+ import { RadioButtonBase as U } from "../../primitives/radio/radio.js";
8
+ import { CheckboxBase as G } from "../../primitives/checkbox/checkbox.js";
9
+ const N = ({ isSelected: t }) => /* @__PURE__ */ l("div", { className: "pointer-events-none", "aria-hidden": !0, children: /* @__PURE__ */ l(G, { isSelected: t }) }), le = (t) => {
10
10
  const {
11
- isOpen: c,
12
- onOpenChange: C,
13
- onApply: S,
14
- onReset: D,
15
- className: p,
11
+ isOpen: u,
12
+ onOpenChange: A,
13
+ onApply: F,
14
+ onReset: R,
15
+ className: V,
16
16
  buttonLabel: d = "Status",
17
- isDisabled: N = !1,
18
- isApplyDisabled: F,
19
- isResetDisabled: R
20
- } = t, r = t.selectionMode === "single", o = r ? t.options : t.statusOptions, i = (o == null ? void 0 : o.length) ?? 0, u = r ? 0 : Object.entries(t.appliedStatusFilters).filter(
17
+ isDisabled: M = !1,
18
+ isApplyDisabled: z,
19
+ isResetDisabled: T
20
+ } = t, i = t.selectionMode === "single", o = i ? t.options : t.statusOptions, a = (o == null ? void 0 : o.length) ?? 0, f = i ? 0 : Object.entries(t.appliedStatusFilters).filter(
21
21
  ([e, n]) => e !== "all" && n
22
- ).length, A = !r && t.defaultSelectAll === !0, M = (() => {
23
- if (r) {
22
+ ).length, E = !i && t.defaultSelectAll === !0, H = (() => {
23
+ if (i) {
24
24
  const e = t.defaultValue ?? "all";
25
25
  return t.value !== e;
26
26
  }
27
- return i === 0 ? !1 : A ? u < i : u > 0;
28
- })(), h = r ? 0 : Object.entries(t.statusFilters).filter(
27
+ return a === 0 ? !1 : E ? f < a : f > 0;
28
+ })(), m = i ? 0 : Object.entries(t.statusFilters).filter(
29
29
  ([e, n]) => e !== "all" && n
30
- ).length, y = h === i && i > 0, g = h > 0 && h < i, z = (() => {
30
+ ).length, g = m === a && a > 0, b = m > 0 && m < a, L = (() => {
31
31
  var n;
32
- if (!r)
33
- return !(u === i && i > 0) && u > 0 ? `${d} ${u} selected` : d;
32
+ if (!i)
33
+ return !(f === a && a > 0) && f > 0 ? `${d} ${f} selected` : d;
34
34
  const e = t.defaultValue ?? "all";
35
- return t.value === e ? d : ((n = o.find((a) => a.key === t.value)) == null ? void 0 : n.label) ?? d;
36
- })(), f = v(null), x = v(0), [V, E] = L(
35
+ return t.value === e ? d : ((n = o.find((c) => c.key === t.value)) == null ? void 0 : n.label) ?? d;
36
+ })(), h = C(null), k = C(0), [j, O] = q(
37
37
  () => typeof window > "u" ? 400 : Math.round(window.innerHeight * 0.5)
38
- ), H = r ? t.pendingValue : t.statusFilters;
39
- return b(() => {
40
- if (!c) return;
38
+ ), B = i ? t.pendingValue : t.statusFilters;
39
+ return D(() => {
40
+ if (!u) return;
41
41
  const e = () => {
42
- E(Math.round(window.innerHeight * 0.5));
42
+ O(Math.round(window.innerHeight * 0.5));
43
43
  };
44
44
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
45
- }, [c]), b(() => {
45
+ }, [u]), D(() => {
46
46
  const e = () => {
47
- f.current && (f.current.scrollTop = x.current);
47
+ h.current && (h.current.scrollTop = k.current);
48
48
  };
49
49
  e();
50
50
  const n = requestAnimationFrame(e);
51
51
  return () => cancelAnimationFrame(n);
52
- }, [H]), /* @__PURE__ */ l("div", { className: "relative", children: /* @__PURE__ */ s(k.Root, { isOpen: c, onOpenChange: C, children: [
52
+ }, [B]), /* @__PURE__ */ l("div", { className: "relative", children: /* @__PURE__ */ s(p.Root, { isOpen: u, onOpenChange: A, children: [
53
53
  /* @__PURE__ */ l(
54
- m,
54
+ y,
55
55
  {
56
56
  size: "xs",
57
57
  color: "secondary",
58
- iconTrailing: /* @__PURE__ */ l(O, { size: 12 }),
59
- className: B(
58
+ iconTrailing: /* @__PURE__ */ l(I, { size: 12 }),
59
+ className: $(
60
60
  "relative",
61
- M && !c && "ring-1 ring-brand-600 bg-brand-primary text-brand-600 hover:bg-brand-primary hover:text-brand-600",
62
- p,
63
- c && "shadow-[0_0_0_4px_rgba(102,112,133,0.14)]"
61
+ H && !u && "ring-1 ring-brand-600 bg-brand-primary text-brand-600 hover:bg-brand-primary hover:text-brand-600",
62
+ V,
63
+ u && "shadow-[0_0_0_4px_rgba(102,112,133,0.14)]"
64
64
  ),
65
- isDisabled: N,
66
- children: z
65
+ isDisabled: M,
66
+ children: L
67
67
  }
68
68
  ),
69
69
  /* @__PURE__ */ l(
70
- k.Popover,
70
+ p.Popover,
71
71
  {
72
72
  className: "overflow-hidden",
73
73
  style: { overflow: "hidden" },
74
- maxHeight: V,
75
- scrollRef: f,
74
+ maxHeight: j,
75
+ scrollRef: h,
76
76
  children: /* @__PURE__ */ s("div", { className: "flex max-h-[50vh] flex-col overflow-hidden text-secondary text-xs", children: [
77
77
  /* @__PURE__ */ l(
78
78
  "div",
79
79
  {
80
- ref: f,
80
+ ref: h,
81
81
  className: "min-h-0 flex-1 space-y-3 overflow-y-auto p-3",
82
- role: r ? "radiogroup" : void 0,
83
- "aria-label": r ? d : void 0,
82
+ role: i ? "radiogroup" : void 0,
83
+ "aria-label": i ? d : void 0,
84
84
  onScroll: (e) => {
85
- x.current = e.currentTarget.scrollTop;
85
+ k.current = e.currentTarget.scrollTop;
86
86
  },
87
- children: r ? o.map((e) => {
88
- const n = t.pendingValue === e.key;
87
+ children: i ? o.map((e, n) => {
88
+ const c = t.pendingValue === e.key, K = o.some((r) => r.key === t.pendingValue);
89
89
  return /* @__PURE__ */ s(
90
90
  "div",
91
91
  {
92
92
  role: "radio",
93
- "aria-checked": n,
94
- tabIndex: 0,
95
- className: "flex cursor-pointer items-center gap-3",
96
- onMouseDownCapture: (a) => a.preventDefault(),
93
+ "aria-checked": c,
94
+ tabIndex: c || !K && n === 0 ? 0 : -1,
95
+ className: "flex cursor-pointer items-center gap-3 rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
96
+ onMouseDownCapture: (r) => r.preventDefault(),
97
97
  onClick: () => t.onValueChange(e.key),
98
- onKeyDown: (a) => {
99
- (a.key === "Enter" || a.key === " ") && (a.preventDefault(), t.onValueChange(e.key));
98
+ onKeyDown: (r) => {
99
+ var w, S;
100
+ if (r.key === "Enter" || r.key === " ") {
101
+ r.preventDefault(), t.onValueChange(e.key);
102
+ return;
103
+ }
104
+ const v = r.key === "ArrowDown" || r.key === "ArrowRight" ? 1 : r.key === "ArrowUp" || r.key === "ArrowLeft" ? -1 : 0;
105
+ if (!v) return;
106
+ r.preventDefault();
107
+ const x = (n + v + o.length) % o.length;
108
+ t.onValueChange(o[x].key), (S = (w = h.current) == null ? void 0 : w.querySelectorAll('[role="radio"]')[x]) == null || S.focus();
100
109
  },
101
110
  children: [
102
111
  /* @__PURE__ */ l("div", { className: "pointer-events-none", children: /* @__PURE__ */ l(
103
- K,
112
+ U,
104
113
  {
105
114
  size: "sm",
106
- isSelected: n,
115
+ isSelected: c,
107
116
  "aria-hidden": !0
108
117
  }
109
118
  ) }),
@@ -112,28 +121,28 @@ const w = ({ isSelected: t }) => /* @__PURE__ */ l("div", { className: "pointer-
112
121
  },
113
122
  e.key
114
123
  );
115
- }) : /* @__PURE__ */ s(j, { children: [
124
+ }) : /* @__PURE__ */ s(_, { children: [
116
125
  /* @__PURE__ */ s(
117
126
  "div",
118
127
  {
119
128
  role: "checkbox",
120
- "aria-checked": g ? "mixed" : y,
129
+ "aria-checked": b ? "mixed" : g,
121
130
  tabIndex: 0,
122
- className: "flex cursor-pointer items-center gap-3",
131
+ className: "flex cursor-pointer items-center gap-3 rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
123
132
  onMouseDownCapture: (e) => e.preventDefault(),
124
133
  onClick: () => t.onStatusChange("all"),
125
134
  onKeyDown: (e) => {
126
135
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), t.onStatusChange("all"));
127
136
  },
128
137
  children: [
129
- g ? /* @__PURE__ */ l(
130
- T,
138
+ b ? /* @__PURE__ */ l(
139
+ P,
131
140
  {
132
141
  size: 18,
133
142
  className: "text-utility-brand-600",
134
143
  "aria-hidden": !0
135
144
  }
136
- ) : /* @__PURE__ */ l(w, { isSelected: y }),
145
+ ) : /* @__PURE__ */ l(N, { isSelected: g }),
137
146
  /* @__PURE__ */ l("span", { children: "All" })
138
147
  ]
139
148
  }
@@ -144,7 +153,7 @@ const w = ({ isSelected: t }) => /* @__PURE__ */ l("div", { className: "pointer-
144
153
  role: "checkbox",
145
154
  "aria-checked": t.statusFilters[e.key],
146
155
  tabIndex: 0,
147
- className: "flex cursor-pointer items-center gap-3",
156
+ className: "flex cursor-pointer items-center gap-3 rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
148
157
  onMouseDownCapture: (n) => n.preventDefault(),
149
158
  onClick: () => t.onStatusChange(e.key),
150
159
  onKeyDown: (n) => {
@@ -152,7 +161,7 @@ const w = ({ isSelected: t }) => /* @__PURE__ */ l("div", { className: "pointer-
152
161
  },
153
162
  children: [
154
163
  /* @__PURE__ */ l(
155
- w,
164
+ N,
156
165
  {
157
166
  isSelected: t.statusFilters[e.key]
158
167
  }
@@ -167,24 +176,24 @@ const w = ({ isSelected: t }) => /* @__PURE__ */ l("div", { className: "pointer-
167
176
  ),
168
177
  /* @__PURE__ */ s("div", { className: "flex shrink-0 justify-end gap-2 bg-primary p-3", children: [
169
178
  /* @__PURE__ */ l(
170
- m,
179
+ y,
171
180
  {
172
181
  size: "xs",
173
182
  color: "secondary",
174
183
  className: "flex-1 p-2",
175
- onClick: D,
176
- isDisabled: R,
184
+ onClick: R,
185
+ isDisabled: T,
177
186
  children: "Reset"
178
187
  }
179
188
  ),
180
189
  /* @__PURE__ */ l(
181
- m,
190
+ y,
182
191
  {
183
192
  size: "xs",
184
193
  color: "primary",
185
194
  className: "flex-1 p-2",
186
- onClick: S,
187
- isDisabled: F,
195
+ onClick: F,
196
+ isDisabled: z,
188
197
  children: "Apply"
189
198
  }
190
199
  )
@@ -195,5 +204,5 @@ const w = ({ isSelected: t }) => /* @__PURE__ */ l("div", { className: "pointer-
195
204
  ] }) });
196
205
  };
197
206
  export {
198
- W as StatusFilterDropdown
207
+ le as StatusFilterDropdown
199
208
  };
@@ -1 +1 @@
1
- {"version":3,"file":"modal-wrapper.d.ts","sourceRoot":"","sources":["../../../src/patterns/modal/modal-wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA8BvC,MA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AAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,4JAW1B,iBAAiB,4CAwDnB,CAAC"}
@@ -1,39 +1,25 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { useRef as h, useEffect as y } from "react";
3
- import { DialogTrigger as v } from "react-aria-components";
4
- import { cx as f } from "../../utils/cn.js";
5
- import { ModalOverlay as w, Modal as E, Dialog as k } from "./modal.js";
6
- const r = [];
7
- let m = !1;
8
- const N = () => {
9
- m || typeof document > "u" || (document.addEventListener("keydown", (e) => {
10
- if (e.key !== "Escape" || r.length === 0 || e.defaultPrevented) return;
11
- const n = r[r.length - 1];
12
- n();
13
- }), m = !0);
14
- }, z = ({
15
- isOpen: e,
16
- onClose: n,
17
- children: s,
18
- showOverlay: c = !0,
19
- isDismissable: a = !0,
20
- allowBackgroundInteraction: u = !1,
21
- ignoreClickAway: p = !1,
22
- overlayClassName: x,
23
- bare: g = !1,
24
- "data-testid": l
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { useRef as x } from "react";
3
+ import { DialogTrigger as g } from "react-aria-components";
4
+ import { useEscapeLayer as h, EscapeLayerProvider as s } from "../../hooks/use-escape-layer.js";
5
+ import { cx as d } from "../../utils/cn.js";
6
+ import { ModalOverlay as v, Modal as y, Dialog as w } from "./modal.js";
7
+ const M = ({
8
+ isOpen: a,
9
+ onClose: r,
10
+ children: n,
11
+ showOverlay: l = !0,
12
+ isDismissable: t = !0,
13
+ allowBackgroundInteraction: m = !1,
14
+ ignoreClickAway: f = !1,
15
+ overlayClassName: p,
16
+ bare: u = !1,
17
+ "data-testid": i
25
18
  }) => {
26
- const o = h(n);
27
- return o.current = n, y(() => {
28
- if (!e) return;
29
- N();
30
- const d = a ? () => o.current(!1) : () => {
31
- };
32
- return r.push(d), () => {
33
- const i = r.lastIndexOf(d);
34
- i >= 0 && r.splice(i, 1);
35
- };
36
- }, [e, a]), u && e ? /* @__PURE__ */ t(
19
+ const o = x(r);
20
+ o.current = r;
21
+ const c = h(a, t ? () => o.current(!1) : null);
22
+ return m && a ? /* @__PURE__ */ e(
37
23
  "div",
38
24
  {
39
25
  className: "fixed inset-0 z-50 flex items-center justify-center",
@@ -42,23 +28,23 @@ const N = () => {
42
28
  paddingLeft: "calc(var(--floating-modal-inset-left, 0px) + 16px)",
43
29
  paddingRight: "16px"
44
30
  },
45
- children: /* @__PURE__ */ t("div", { className: "w-[max-content] max-w-full", style: { pointerEvents: "auto" }, "data-testid": l, children: s })
31
+ children: /* @__PURE__ */ e("div", { className: "w-[max-content] max-w-full", style: { pointerEvents: "auto" }, "data-testid": i, children: /* @__PURE__ */ e(s, { value: c, children: n }) })
46
32
  }
47
- ) : /* @__PURE__ */ t(v, { isOpen: e, onOpenChange: n, children: /* @__PURE__ */ t(
48
- w,
33
+ ) : /* @__PURE__ */ e(g, { isOpen: a, onOpenChange: r, children: /* @__PURE__ */ e(
34
+ v,
49
35
  {
50
- isDismissable: a,
51
- isKeyboardDismissDisabled: !a,
52
- ...p ? { "data-ignore-click-away": !0 } : {},
53
- className: f(
36
+ isDismissable: t,
37
+ isKeyboardDismissDisabled: !t,
38
+ ...f ? { "data-ignore-click-away": !0 } : {},
39
+ className: d(
54
40
  "max-h-screen max-w-screen overflow-hidden z-100000 flex justify-center items-center",
55
- !c && "bg-transparent! backdrop-blur-none!",
56
- c && x
41
+ !l && "bg-transparent! backdrop-blur-none!",
42
+ l && p
57
43
  ),
58
- children: /* @__PURE__ */ t(E, { className: f(!g && "modal-bg-gradient", "w-max!"), children: /* @__PURE__ */ t(k, { className: "w-max!", "data-testid": l, children: s }) })
44
+ children: /* @__PURE__ */ e(y, { className: d(!u && "modal-bg-gradient", "w-max!"), children: /* @__PURE__ */ e(w, { className: "w-max!", "data-testid": i, children: /* @__PURE__ */ e(s, { value: c, children: n }) }) })
59
45
  }
60
46
  ) });
61
47
  };
62
48
  export {
63
- z as ModalWrapper
49
+ M as ModalWrapper
64
50
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sub-sidebar.d.ts","sourceRoot":"","sources":["../../../src/patterns/sub-sidebar/sub-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAQf,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAEf,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAajB,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,MAAM,EAAE,gBAAgB,CAAC;IACzB,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,sDAAsD;IACtD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,SAAS,CAAC;IACvD,yFAAyF;IACzF,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD,eAAO,MAAM,UAAU,GAAI,wFAQxB,eAAe,4CAmZjB,CAAC"}
1
+ {"version":3,"file":"sub-sidebar.d.ts","sourceRoot":"","sources":["../../../src/patterns/sub-sidebar/sub-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAQf,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAEf,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAajB,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,MAAM,EAAE,gBAAgB,CAAC;IACzB,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,sDAAsD;IACtD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,SAAS,CAAC;IACvD,yFAAyF;IACzF,KAAK,CAAC,EA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