@pibit.ai/cure-design-system 0.6.26 → 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.
Files changed (30) hide show
  1. package/dist/hooks/use-escape-layer.d.ts +10 -0
  2. package/dist/hooks/use-escape-layer.d.ts.map +1 -0
  3. package/dist/hooks/use-escape-layer.js +35 -0
  4. package/dist/patterns/alert/alert.d.ts +1 -2
  5. package/dist/patterns/alert/alert.d.ts.map +1 -1
  6. package/dist/patterns/alert/alert.js +22 -22
  7. package/dist/patterns/drawer/drawer.d.ts.map +1 -1
  8. package/dist/patterns/drawer/drawer.js +104 -93
  9. package/dist/patterns/empty-state/empty-state.d.ts +2 -1
  10. package/dist/patterns/empty-state/empty-state.d.ts.map +1 -1
  11. package/dist/patterns/empty-state/empty-state.js +16 -16
  12. package/dist/patterns/expandable-drawer/expandable-drawer.d.ts.map +1 -1
  13. package/dist/patterns/expandable-drawer/expandable-drawer.js +43 -40
  14. package/dist/patterns/filters/checklist-select.js +36 -36
  15. package/dist/patterns/filters/filter-list-section.d.ts.map +1 -1
  16. package/dist/patterns/filters/filter-list-section.js +30 -30
  17. package/dist/patterns/filters/status-filter-dropdown.d.ts.map +1 -1
  18. package/dist/patterns/filters/status-filter-dropdown.js +83 -74
  19. package/dist/patterns/modal/modal-wrapper.d.ts.map +1 -1
  20. package/dist/patterns/modal/modal-wrapper.js +32 -46
  21. package/dist/patterns/sub-sidebar/sub-sidebar.d.ts.map +1 -1
  22. package/dist/patterns/sub-sidebar/sub-sidebar.js +93 -86
  23. package/dist/patterns/tabs/tabs.d.ts.map +1 -1
  24. package/dist/patterns/tabs/tabs.js +33 -36
  25. package/dist/patterns/tree-view/indented-tree.d.ts.map +1 -1
  26. package/dist/patterns/tree-view/indented-tree.js +136 -118
  27. package/dist/primitives/featured-icon/featured-icon.d.ts +2 -1
  28. package/dist/primitives/featured-icon/featured-icon.d.ts.map +1 -1
  29. package/dist/styles/components.css +1 -1
  30. package/package.json +1 -1
@@ -1,70 +1,76 @@
1
- import { jsxs as o, jsx as r, Fragment as S } from "react/jsx-runtime";
2
- import { useState as A, useEffect as z, Fragment as u } from "react";
3
- import { Minus as F, Plus as I } from "@untitledui/icons";
4
- import { CollapseLeft as D } from "../../primitives/custom-icon/icons/collapse-left.js";
5
- import { CollapseRight as H } from "../../primitives/custom-icon/icons/collapse-right.js";
1
+ import { jsxs as i, jsx as r, Fragment as z } from "react/jsx-runtime";
2
+ import { useState as F, useRef as I, useEffect as E, Fragment as f } from "react";
3
+ import { Minus as D, Plus as H } from "@untitledui/icons";
4
+ import { CollapseLeft as K } from "../../primitives/custom-icon/icons/collapse-left.js";
5
+ import { CollapseRight as R } from "../../primitives/custom-icon/icons/collapse-right.js";
6
6
  import { cx as n } from "../../utils/cn.js";
7
- import { ButtonUtility as K } from "../../primitives/button/button-utility.js";
8
- const T = ({
9
- href: i,
10
- className: c,
11
- children: d
12
- }) => /* @__PURE__ */ r("a", { href: i, className: c, children: d }), $ = (i, c) => c, U = ({
13
- config: i,
14
- currentPath: c,
15
- isCollapsed: d,
16
- onCollapsedChange: k,
17
- renderLink: x = T,
18
- guard: h = $,
19
- className: C
7
+ import { ButtonUtility as T } from "../../primitives/button/button-utility.js";
8
+ const $ = ({
9
+ href: o,
10
+ className: d,
11
+ children: c
12
+ }) => /* @__PURE__ */ r("a", { href: o, className: d, children: c }), q = (o, d) => d, _ = ({
13
+ config: o,
14
+ currentPath: d,
15
+ isCollapsed: c,
16
+ onCollapsedChange: C,
17
+ renderLink: b = $,
18
+ guard: u = q,
19
+ className: j
20
20
  }) => {
21
- const [E, b] = A(/* @__PURE__ */ new Set()), y = (a) => c === a || c.startsWith(a + "/"), m = (a) => a.map((t) => t.href).filter((t) => !!t).filter(y).sort((t, l) => l.length - t.length)[0] ?? null, w = () => {
21
+ const [S, x] = F(/* @__PURE__ */ new Set()), y = (t) => d === t || d.startsWith(t + "/"), h = (t) => t.map((a) => a.href).filter((a) => !!a).filter(y).sort((a, l) => l.length - a.length)[0] ?? null, v = I(null);
22
+ E(() => {
23
+ var t;
24
+ (t = v.current) == null || t.toggleAttribute("inert", c);
25
+ }, [c]);
26
+ const w = () => {
22
27
  var e;
23
- const a = !d;
24
- k(a), (e = i.onToggleCollapse) == null || e.call(i, a);
28
+ const t = !c;
29
+ C(t), (e = o.onToggleCollapse) == null || e.call(o, t);
25
30
  };
26
- z(() => {
27
- const a = /* @__PURE__ */ new Set();
28
- i.sections.forEach((e) => {
29
- e.items.forEach((t) => {
31
+ E(() => {
32
+ const t = /* @__PURE__ */ new Set();
33
+ o.sections.forEach((e) => {
34
+ e.items.forEach((a) => {
30
35
  var l;
31
- if ((l = t.items) != null && l.length && m(t.items) !== null) {
32
- const p = t.href || t.label;
33
- a.add(p);
36
+ if ((l = a.items) != null && l.length && h(a.items) !== null) {
37
+ const p = a.href || a.label;
38
+ t.add(p);
34
39
  }
35
40
  });
36
- }), b((e) => {
37
- const t = new Set(e);
38
- return a.forEach((l) => t.add(l)), t;
41
+ }), x((e) => {
42
+ const a = new Set(e);
43
+ return t.forEach((l) => a.add(l)), a;
39
44
  });
40
- }, [c, i.sections]);
41
- const f = (a) => {
42
- const e = a.href || a.label;
43
- b((t) => {
44
- const l = new Set(t);
45
+ }, [d, o.sections]);
46
+ const m = (t) => {
47
+ const e = t.href || t.label;
48
+ x((a) => {
49
+ const l = new Set(a);
45
50
  return l.has(e) ? l.delete(e) : l.add(e), l;
46
51
  });
47
- }, v = (a) => {
52
+ }, g = (t) => {
48
53
  var e;
49
- return (e = a.items) != null && e.length && m(a.items) !== null ? !0 : a.href ? y(a.href) : !1;
50
- }, j = (a, e) => m(e) === a;
51
- return /* @__PURE__ */ o(
54
+ return (e = t.items) != null && e.length && h(t.items) !== null ? !0 : t.href ? y(t.href) : !1;
55
+ }, A = (t, e) => h(e) === t;
56
+ return /* @__PURE__ */ i(
52
57
  "div",
53
58
  {
54
59
  className: n(
55
60
  "h-full flex-shrink-0 bg-white border-r border-[#EDEFF4] relative transition-all duration-300 ease-in-out",
56
- d ? "w-0 border-r-0" : i.width || "w-[296px]",
57
- C
61
+ c ? "w-0 border-r-0" : o.width || "w-[296px]",
62
+ j
58
63
  ),
59
64
  children: [
60
- i.collapsible !== !1 && d && /* @__PURE__ */ r(
65
+ o.collapsible !== !1 && c && /* @__PURE__ */ r(
61
66
  "button",
62
67
  {
68
+ type: "button",
63
69
  onClick: w,
64
- className: "absolute -right-5 top-5 z-20 flex h-6 w-6 items-center justify-center transition-all duration-300 cursor-pointer",
70
+ className: "absolute -right-5 top-5 z-20 flex h-6 w-6 items-center justify-center transition-all duration-300 cursor-pointer rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
65
71
  "aria-label": "Expand sidebar",
66
72
  children: /* @__PURE__ */ r(
67
- H,
73
+ R,
68
74
  {
69
75
  color: "var(--color-fg-quaternary)",
70
76
  className: "h-4 w-4 text-gray-400 hover:text-gray-600"
@@ -72,25 +78,26 @@ const T = ({
72
78
  )
73
79
  }
74
80
  ),
75
- /* @__PURE__ */ o(
81
+ /* @__PURE__ */ i(
76
82
  "div",
77
83
  {
78
84
  className: n(
79
85
  "pl-4 h-full flex flex-col overflow-hidden transition-opacity duration-300",
80
- d ? "opacity-0 pointer-events-none" : "opacity-100"
86
+ c ? "opacity-0 pointer-events-none" : "opacity-100"
81
87
  ),
82
- inert: d,
88
+ ref: v,
83
89
  children: [
84
- i.title && /* @__PURE__ */ o("div", { className: "pt-6 pb-4 relative flex-shrink-0 flex items-center justify-between", children: [
85
- /* @__PURE__ */ r("h2", { className: "pl-1.5 text-primary font-semibold text-md leading-7 whitespace-nowrap", children: i.title }),
86
- i.collapsible !== !1 && /* @__PURE__ */ r(
90
+ o.title && /* @__PURE__ */ i("div", { className: "pt-6 pb-4 relative flex-shrink-0 flex items-center justify-between", children: [
91
+ /* @__PURE__ */ r("h2", { className: "pl-1.5 text-primary font-semibold text-md leading-7 whitespace-nowrap", children: o.title }),
92
+ o.collapsible !== !1 && /* @__PURE__ */ r(
87
93
  "button",
88
94
  {
95
+ type: "button",
89
96
  onClick: w,
90
- className: "flex h-5 w-5 items-center justify-center transition-all duration-300 hover:scale-110 cursor-pointer",
97
+ className: "flex h-5 w-5 items-center justify-center transition-all duration-300 hover:scale-110 cursor-pointer rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
91
98
  "aria-label": "Collapse sidebar",
92
99
  children: /* @__PURE__ */ r(
93
- D,
100
+ K,
94
101
  {
95
102
  color: "var(--color-fg-quaternary)",
96
103
  className: "h-4 w-4 text-gray-400 hover:text-gray-600"
@@ -99,15 +106,15 @@ const T = ({
99
106
  }
100
107
  )
101
108
  ] }),
102
- /* @__PURE__ */ r("nav", { className: "flex-1 pb-4 pr-2 overflow-y-auto overflow-x-hidden", children: i.sections.map((a) => /* @__PURE__ */ r(u, { children: h(
103
- (a == null ? void 0 : a.permissions) || [],
104
- /* @__PURE__ */ o("div", { className: n("mb-6"), children: [
105
- /* @__PURE__ */ r("div", { className: "py-0.5 px-2", children: /* @__PURE__ */ r("p", { className: "font-medium text-3xs text-[var(--color-text-tertiary)] uppercase tracking-[1.3px] whitespace-nowrap", children: a.label }) }),
106
- /* @__PURE__ */ r("ul", { className: "space-y-1", children: a.items.map((e) => {
107
- const t = e.href || e.label, l = E.has(t), N = e.items && e.items.length > 0, p = v(e);
108
- return N ? /* @__PURE__ */ r(u, { children: h(
109
+ /* @__PURE__ */ r("nav", { className: "flex-1 pb-4 pr-2 overflow-y-auto overflow-x-hidden", children: o.sections.map((t) => /* @__PURE__ */ r(f, { children: u(
110
+ (t == null ? void 0 : t.permissions) || [],
111
+ /* @__PURE__ */ i("div", { className: n("mb-6"), children: [
112
+ /* @__PURE__ */ r("div", { className: "py-0.5 px-2", children: /* @__PURE__ */ r("p", { className: "font-medium text-3xs text-[var(--color-text-tertiary)] uppercase tracking-[1.3px] whitespace-nowrap", children: t.label }) }),
113
+ /* @__PURE__ */ r("ul", { className: "space-y-1", children: t.items.map((e) => {
114
+ const a = e.href || e.label, l = S.has(a), N = e.items && e.items.length > 0, p = g(e);
115
+ return N ? /* @__PURE__ */ r(f, { children: u(
109
116
  e.permissions || [],
110
- /* @__PURE__ */ o(
117
+ /* @__PURE__ */ i(
111
118
  "li",
112
119
  {
113
120
  className: n(
@@ -115,11 +122,11 @@ const T = ({
115
122
  "text-xs"
116
123
  ),
117
124
  children: [
118
- /* @__PURE__ */ o(
125
+ /* @__PURE__ */ i(
119
126
  "div",
120
127
  {
121
128
  className: n(
122
- "flex items-center justify-between px-1 py-2 rounded-md transition-colors cursor-pointer",
129
+ "flex items-center justify-between px-1 py-2 rounded-md transition-colors cursor-pointer outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
123
130
  p ? "bg-active text-primary font-medium" : "text-primary hover:bg-active",
124
131
  e.disabled ? "cursor-not-allowed" : ""
125
132
  ),
@@ -128,21 +135,21 @@ const T = ({
128
135
  "aria-expanded": l,
129
136
  "aria-disabled": e.disabled || void 0,
130
137
  onClick: (s) => {
131
- s.stopPropagation(), !e.disabled && f(e);
138
+ s.stopPropagation(), !e.disabled && m(e);
132
139
  },
133
140
  onKeyDown: (s) => {
134
141
  if (s.target === s.currentTarget && (s.key === "Enter" || s.key === " ")) {
135
142
  if (s.stopPropagation(), e.disabled) return;
136
- f(e);
143
+ m(e);
137
144
  }
138
145
  },
139
146
  children: [
140
147
  /* @__PURE__ */ r("span", { className: "whitespace-nowrap text-primary font-medium", children: e.label }),
141
148
  /* @__PURE__ */ r(
142
- K,
149
+ T,
143
150
  {
144
151
  onClick: (s) => {
145
- s.stopPropagation(), !e.disabled && f(e);
152
+ s.stopPropagation(), !e.disabled && m(e);
146
153
  },
147
154
  className: n(
148
155
  "rounded-md bg-secondary",
@@ -150,36 +157,36 @@ const T = ({
150
157
  ),
151
158
  size: "xs",
152
159
  "aria-label": `${l ? "Collapse" : "Expand"} ${e.label}`,
153
- icon: l ? /* @__PURE__ */ r(F, { size: 12 }) : /* @__PURE__ */ r(I, { size: 12 })
160
+ icon: l ? /* @__PURE__ */ r(D, { size: 12 }) : /* @__PURE__ */ r(H, { size: 12 })
154
161
  }
155
162
  )
156
163
  ]
157
164
  }
158
165
  ),
159
- l && h(
166
+ l && u(
160
167
  e.permissions || [],
161
- /* @__PURE__ */ o("ul", { className: "mt-0.5 ml-4 space-y-0.5 relative", children: [
168
+ /* @__PURE__ */ i("ul", { className: "mt-0.5 ml-4 space-y-0.5 relative", children: [
162
169
  /* @__PURE__ */ r("div", { className: "absolute left-2 top-[15px] bottom-[15px] w-px bg-[var(--color-utility-gray-200)]" }),
163
170
  e.items.map((s) => {
164
- const g = j(
171
+ const k = A(
165
172
  s.href,
166
173
  e.items
167
174
  );
168
- return /* @__PURE__ */ r(u, { children: h(
175
+ return /* @__PURE__ */ r(f, { children: u(
169
176
  s.permissions || [],
170
- /* @__PURE__ */ r("li", { className: "relative", children: x({
177
+ /* @__PURE__ */ r("li", { className: "relative", children: b({
171
178
  href: s.href,
172
179
  className: n(
173
180
  "flex items-center pl-6 pr-2 py-2 rounded-md transition-colors relative",
174
- g ? "text-primary font-medium" : "text-primary hover:bg-active"
181
+ k ? "text-primary font-medium" : "text-primary hover:bg-active"
175
182
  ),
176
- children: /* @__PURE__ */ o(S, { children: [
183
+ children: /* @__PURE__ */ i(z, { children: [
177
184
  /* @__PURE__ */ r(
178
185
  "div",
179
186
  {
180
187
  className: n(
181
188
  "absolute left-1.5 top-1/2 -translate-y-1/2 w-1.5 h-1.5 rounded-full z-10",
182
- g ? "bg-[var(--color-fg-primary)]" : "bg-[var(--color-utility-gray-200)]"
189
+ k ? "bg-[var(--color-fg-primary)]" : "bg-[var(--color-utility-gray-200)]"
183
190
  )
184
191
  }
185
192
  ),
@@ -196,7 +203,7 @@ const T = ({
196
203
  }
197
204
  ),
198
205
  null
199
- ) }, t) : /* @__PURE__ */ r(u, { children: h(
206
+ ) }, a) : /* @__PURE__ */ r(f, { children: u(
200
207
  e.permissions || [],
201
208
  /* @__PURE__ */ r(
202
209
  "li",
@@ -215,7 +222,7 @@ const T = ({
215
222
  "aria-disabled": "true",
216
223
  children: /* @__PURE__ */ r("span", { className: "whitespace-nowrap font-medium", children: e.label })
217
224
  }
218
- ) : x({
225
+ ) : b({
219
226
  href: e.href,
220
227
  className: n(
221
228
  "flex items-center justify-between px-2 py-2 rounded-md transition-colors",
@@ -251,13 +258,13 @@ const T = ({
251
258
  children: e.label
252
259
  }
253
260
  ) : null
254
- ) }, t);
261
+ ) }, a);
255
262
  }) })
256
263
  ] }),
257
- a.showDisabled ? /* @__PURE__ */ o("div", { className: n("mb-6"), children: [
258
- /* @__PURE__ */ r("div", { className: "py-0.5 px-2", children: /* @__PURE__ */ r("p", { className: "font-medium text-3xs text-[var(--color-text-tertiary)] uppercase tracking-[1.3px] whitespace-nowrap", children: a.label }) }),
259
- /* @__PURE__ */ r("ul", { className: "", children: a.items.map((e) => {
260
- const t = e.href || e.label, l = v(e);
264
+ t.showDisabled ? /* @__PURE__ */ i("div", { className: n("mb-6"), children: [
265
+ /* @__PURE__ */ r("div", { className: "py-0.5 px-2", children: /* @__PURE__ */ r("p", { className: "font-medium text-3xs text-[var(--color-text-tertiary)] uppercase tracking-[1.3px] whitespace-nowrap", children: t.label }) }),
266
+ /* @__PURE__ */ r("ul", { className: "", children: t.items.map((e) => {
267
+ const a = e.href || e.label, l = g(e);
261
268
  return /* @__PURE__ */ r(
262
269
  "span",
263
270
  {
@@ -268,11 +275,11 @@ const T = ({
268
275
  "aria-disabled": "true",
269
276
  children: e.label
270
277
  },
271
- t
278
+ a
272
279
  );
273
280
  }) })
274
281
  ] }) : null
275
- ) }, a.id)) })
282
+ ) }, t.id)) })
276
283
  ]
277
284
  }
278
285
  )
@@ -281,5 +288,5 @@ const T = ({
281
288
  );
282
289
  };
283
290
  export {
284
- U as SubSidebar
291
+ _ as SubSidebar
285
292
  };
@@ -1 +1 @@
1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SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAC,CAAC;IAClE,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,oCAAoC;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAKD,eAAO,MAAM,GAAG,GAAI,OAAO,iBAAiB,4CA8C3C,CAAC;AAEF,eAAO,MAAM,IAAI;8BAA6B,qBAAqB,CAAC,OAAO,QAAQ,CAAC;mBA9EpD,qBAAqB,CAAC,OAAO,YAAY,CAAC;WA/ClD,CAAC,SAAS,WAAW,sGAS1C,qBAAqB,CAAC,iBAAiB,EAAE,CAAC,CAAC;kBAoEnB,iBAAiB;CA6D3C,CAAC"}
@@ -1,9 +1,9 @@
1
- import { jsx as b, jsxs as h } from "react/jsx-runtime";
2
- import { createContext as _, useContext as v, Fragment as T } from "react";
3
- import { Tabs as w, useSlottedContext as z, TabsContext as N, TabList as C, Tab as B, TabPanel as L } from "react-aria-components";
1
+ import { jsx as b, jsxs as _ } from "react/jsx-runtime";
2
+ import { createContext as v, useContext as T, Fragment as w } from "react";
3
+ import { Tabs as z, useSlottedContext as N, TabsContext as B, TabList as C, Tab as L, TabPanel as P } from "react-aria-components";
4
4
  import { cx as e } from "../../utils/cn.js";
5
5
  import { Badge as p } from "../../primitives/badge/badge.js";
6
- const P = ({ isFocusVisible: t, isSelected: n, isHovered: o, isDisabled: a }) => ({
6
+ const j = ({ isFocusVisible: t, isSelected: n, isHovered: o, isDisabled: a }) => ({
7
7
  "button-brand": e(
8
8
  "outline-focus-ring",
9
9
  t && "outline-2 -outline-offset-2",
@@ -51,7 +51,7 @@ const P = ({ isFocusVisible: t, isSelected: n, isHovered: o, isDisabled: a }) =>
51
51
  !n && "before:shadow-[4px_4px_0_0_transparent] after:shadow-[-4px_4px_0_0_transparent]",
52
52
  !n && !a && o && "bg-primary_hover text-primary"
53
53
  )
54
- }), j = {
54
+ }), $ = {
55
55
  xs: {
56
56
  "button-brand": "text-xs font-semibold px-2",
57
57
  "button-gray": "text-xs font-semibold px-2",
@@ -78,7 +78,7 @@ const P = ({ isFocusVisible: t, isSelected: n, isHovered: o, isDisabled: a }) =>
78
78
  line: "text-md font-semibold pr-3.5 pl-3 py-1",
79
79
  "button-curved": "py-2.5 px-5"
80
80
  }
81
- }, $ = ({ size: t, fullWidth: n }) => ({
81
+ }, I = ({ size: t, fullWidth: n }) => ({
82
82
  "button-brand": "gap-1",
83
83
  "button-gray": "gap-1",
84
84
  "button-border": e(
@@ -90,14 +90,14 @@ const P = ({ isFocusVisible: t, isSelected: n, isHovered: o, isDisabled: a }) =>
90
90
  line: "gap-2",
91
91
  "button-curved": "gap-0"
92
92
  });
93
- function I(t) {
93
+ function k(t) {
94
94
  return t.some((n) => {
95
95
  if (!("badge" in n)) return !1;
96
96
  const o = n.badge;
97
97
  return o != null && String(o).length > 0;
98
98
  });
99
99
  }
100
- const k = {
100
+ const A = {
101
101
  xs: "!min-h-8",
102
102
  sm: "!min-h-9",
103
103
  md: "!min-h-10"
@@ -109,11 +109,11 @@ const k = {
109
109
  underline: t || n ? "brand" : "gray",
110
110
  line: t || n ? "brand" : "gray",
111
111
  "button-curved": "gray"
112
- }), c = _({
112
+ }), y = v({
113
113
  size: "sm",
114
114
  type: "button-brand",
115
115
  reserveBadgeSlot: !1
116
- }), A = ({
116
+ }), M = ({
117
117
  size: t = "sm",
118
118
  type: n = "button-brand",
119
119
  orientation: o,
@@ -123,15 +123,15 @@ const k = {
123
123
  items: u,
124
124
  ...r
125
125
  }) => {
126
- const i = z(N), s = o ?? (i == null ? void 0 : i.orientation) ?? "horizontal", l = s === "horizontal" && n === "underline" && I(u);
127
- return /* @__PURE__ */ b(c.Provider, { value: { size: t, type: n, orientation: s, fullWidth: a, reserveBadgeSlot: l }, children: /* @__PURE__ */ b(
126
+ const i = N(B), s = o ?? (i == null ? void 0 : i.orientation) ?? "horizontal", l = s === "horizontal" && n === "underline" && k(u);
127
+ return /* @__PURE__ */ b(y.Provider, { value: { size: t, type: n, orientation: s, fullWidth: a, reserveBadgeSlot: l }, children: /* @__PURE__ */ b(
128
128
  C,
129
129
  {
130
130
  ...r,
131
131
  items: u,
132
132
  className: (f) => e(
133
133
  "group flex",
134
- $({
134
+ I({
135
135
  size: t,
136
136
  fullWidth: a
137
137
  })[n],
@@ -140,11 +140,11 @@ const k = {
140
140
  s === "horizontal" && n === "underline" && "relative before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-border-secondary",
141
141
  typeof d == "function" ? d(f) : d
142
142
  ),
143
- children: m ?? ((f) => /* @__PURE__ */ b(y, { ...f, children: f.children }))
143
+ children: m ?? ((f) => /* @__PURE__ */ b(h, { ...f, children: f.children }))
144
144
  }
145
145
  ) });
146
- }, M = (t) => /* @__PURE__ */ b(
147
- L,
146
+ }, W = (t) => /* @__PURE__ */ b(
147
+ P,
148
148
  {
149
149
  ...t,
150
150
  className: (n) => e(
@@ -152,23 +152,23 @@ const k = {
152
152
  typeof t.className == "function" ? t.className(n) : t.className
153
153
  )
154
154
  }
155
- ), y = (t) => {
156
- const { label: n, children: o, badge: a, leadingBadge: d, badgeClassName: m, ...u } = t, { size: r = "sm", type: i = "button-brand", fullWidth: s } = v(c);
155
+ ), c = (t) => t != null && t !== "", h = (t) => {
156
+ const { label: n, children: o, badge: a, leadingBadge: d, badgeClassName: m, ...u } = t, { size: r = "sm", type: i = "button-brand", fullWidth: s } = T(y);
157
157
  return /* @__PURE__ */ b(
158
- B,
158
+ L,
159
159
  {
160
160
  ...u,
161
161
  className: (l) => e(
162
162
  "z-10 flex h-max cursor-pointer items-center justify-center gap-1 rounded-md whitespace-nowrap text-secondary transition duration-100 ease-linear",
163
163
  "group-orientation-vertical:justify-start",
164
164
  s && "w-full flex-1",
165
- k[r],
166
- j[r][i],
167
- P(l)[i],
165
+ A[r],
166
+ $[r][i],
167
+ j(l)[i],
168
168
  typeof t.className == "function" ? t.className(l) : t.className
169
169
  ),
170
- children: (l) => /* @__PURE__ */ h(T, { children: [
171
- d && /* @__PURE__ */ b(
170
+ children: (l) => /* @__PURE__ */ _(w, { children: [
171
+ c(d) && /* @__PURE__ */ b(
172
172
  p,
173
173
  {
174
174
  size: r === "xs" ? "sm" : r,
@@ -179,7 +179,7 @@ const k = {
179
179
  }
180
180
  ),
181
181
  typeof o == "function" ? o(l) : o || n,
182
- a && /* @__PURE__ */ b(
182
+ c(a) && /* @__PURE__ */ b(
183
183
  p,
184
184
  {
185
185
  size: r === "xs" ? "sm" : r,
@@ -193,25 +193,22 @@ const k = {
193
193
  }
194
194
  );
195
195
  }, x = ({ className: t, ...n }) => /* @__PURE__ */ b(
196
- w,
196
+ z,
197
197
  {
198
198
  keyboardActivation: "manual",
199
199
  ...n,
200
200
  className: (o) => e(
201
- // RAC marks the root `data-focus-visible` whenever anything inside it has keyboard focus, and the
202
- // design system's global `[data-focus-visible]` outline would ring the whole tab section.
203
- // The focused tab or control draws its own ring.
204
- "flex w-full flex-col outline-hidden",
201
+ "flex w-full flex-col",
205
202
  typeof t == "function" ? t(o) : t
206
203
  )
207
204
  }
208
205
  );
209
- x.Panel = M;
210
- x.List = A;
211
- x.Item = y;
206
+ x.Panel = W;
207
+ x.List = M;
208
+ x.Item = h;
212
209
  export {
213
- y as Tab,
214
- A as TabList,
215
- M as TabPanel,
210
+ h as Tab,
211
+ M as TabList,
212
+ W as TabPanel,
216
213
  x as Tabs
217
214
  };
@@ -1 +1 @@
1
- {"version":3,"file":"indented-tree.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/indented-tree.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,KAAK,UAAU,GAAG,KAAK,CAAC,EAAE,CAAC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC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