@pibit.ai/cure-design-system 0.3.7 → 0.3.8

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,95 +1,104 @@
1
- import { jsx as o, jsxs as u, Fragment as W } from "react/jsx-runtime";
2
- import { forwardRef as F, useContext as v, createContext as G, useState as N, isValidElement as O, useRef as L, useEffect as M, Children as q, cloneElement as I } from "react";
3
- import { Table as k, useTableOptions as x, Cell as T, TableBody as J, Column as z, Group as Q, TableHeader as X, Collection as A, Row as B } from "react-aria-components";
4
- import { cn as d } from "../../utils/cn.js";
1
+ import { jsx as o, jsxs as x, Fragment as V } from "react/jsx-runtime";
2
+ import { forwardRef as W, useContext as g, createContext as F, useState as T, isValidElement as A, useRef as G, useEffect as L, Children as M, cloneElement as I } from "react";
3
+ import { Table as B, useTableOptions as C, Cell as S, TableBody as J, Column as z, Group as Q, TableHeader as X, Collection as P, Row as O } from "react-aria-components";
4
+ import { cn as c } from "../../utils/cn.js";
5
5
  import { Badge as Y } from "../../primitives/badge/badge.js";
6
- import { Icon as S } from "../../primitives/icon/icon.js";
7
- import { Checkbox as P } from "../../primitives/checkbox/checkbox.js";
8
- const y = G({
6
+ import { Icon as w } from "../../primitives/icon/icon.js";
7
+ import { Checkbox as D } from "../../primitives/checkbox/checkbox.js";
8
+ const b = F({
9
9
  size: "md",
10
10
  expandedRows: /* @__PURE__ */ new Set(),
11
11
  toggleRow: () => {
12
12
  }
13
- }), D = F(
14
- ({ children: s, className: l, size: n = "md", ...c }, e) => {
15
- const a = L(null), [i, f] = N(!1), [h, t] = N(/* @__PURE__ */ new Set());
16
- M(() => {
17
- const r = a.current;
18
- if (!r) return;
19
- const p = () => {
20
- const { scrollWidth: R, clientWidth: C } = r;
21
- f(R > C);
13
+ }), E = W(
14
+ ({ children: r, className: n, size: i = "md", ...d }, e) => {
15
+ const s = G(null), [a, f] = T(!1), [p, l] = T(/* @__PURE__ */ new Set());
16
+ L(() => {
17
+ const t = s.current;
18
+ if (!t) return;
19
+ const u = () => {
20
+ const { scrollWidth: R, clientWidth: N } = t;
21
+ f(R > N);
22
22
  };
23
- p();
24
- const m = new ResizeObserver(p);
25
- return m.observe(r), () => {
26
- m.disconnect();
23
+ u();
24
+ const h = new ResizeObserver(u);
25
+ return h.observe(t), () => {
26
+ h.disconnect();
27
27
  };
28
28
  }, []);
29
- const b = (r) => {
30
- t((p) => {
31
- const m = new Set(p);
32
- return m.has(r) ? m.delete(r) : m.add(r), m;
29
+ const m = (t) => {
30
+ l((u) => {
31
+ const h = new Set(u);
32
+ return h.has(t) ? h.delete(t) : h.add(t), h;
33
33
  });
34
34
  };
35
- return /* @__PURE__ */ o(y.Provider, { value: { size: n, hasOverflow: i, expandedRows: h, toggleRow: b }, children: /* @__PURE__ */ o(
35
+ return /* @__PURE__ */ o(b.Provider, { value: { size: i, hasOverflow: a, expandedRows: p, toggleRow: m }, children: /* @__PURE__ */ o(
36
36
  "div",
37
37
  {
38
- ref: (r) => {
39
- a.current = r, typeof e == "function" ? e(r) : e && (e.current = r);
38
+ ref: (t) => {
39
+ s.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
40
40
  },
41
- ...c,
42
- className: d("overflow-hidden rounded-lg bg-primary", l),
43
- children: s
41
+ ...d,
42
+ className: c("overflow-hidden rounded-lg bg-primary", n),
43
+ children: r
44
44
  }
45
45
  ) });
46
46
  }
47
47
  );
48
- D.displayName = "TableCardRoot";
49
- const E = ({ title: s, badge: l, description: n, contentTrailing: c, className: e }) => {
50
- const { size: a } = v(y);
51
- return /* @__PURE__ */ u(
48
+ E.displayName = "TableCardRoot";
49
+ const _ = ({ title: r, badge: n, description: i, contentTrailing: d, className: e }) => {
50
+ const { size: s } = g(b);
51
+ return /* @__PURE__ */ x(
52
52
  "div",
53
53
  {
54
- className: d(
55
- "relative flex flex-col items-start gap-4 border-b border-border-secondary bg-primary px-4 md:flex-row",
56
- a === "sm" ? "py-2 md:px-4" : "py-3 md:px-6",
54
+ className: c(
55
+ "relative flex flex-col items-start gap-4 border-b border-tertiary bg-primary px-4 md:flex-row",
56
+ s === "sm" ? "py-2 md:px-4" : s === "xs" ? "py-0 md:px-3" : "py-3 md:px-6",
57
57
  e
58
58
  ),
59
59
  children: [
60
- /* @__PURE__ */ u("div", { className: "flex flex-1 flex-col gap-0.5", children: [
61
- /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
62
- /* @__PURE__ */ o("h2", { className: d("font-semibold text-primary", a === "sm" ? "text-md" : "text-lg"), children: s }),
63
- l ? O(l) ? l : /* @__PURE__ */ o(Y, { color: "brand", size: "sm", children: l }) : null
60
+ /* @__PURE__ */ x("div", { className: "flex flex-1 flex-col gap-0.5", children: [
61
+ /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
62
+ /* @__PURE__ */ o(
63
+ "h2",
64
+ {
65
+ className: c(
66
+ "font-semibold text-primary",
67
+ s === "sm" ? "text-md" : s === "xs" ? "text-sm" : "text-lg"
68
+ ),
69
+ children: r
70
+ }
71
+ ),
72
+ n ? A(n) ? n : /* @__PURE__ */ o(Y, { color: "brand", size: "sm", children: n }) : null
64
73
  ] }),
65
- n && /* @__PURE__ */ o("p", { className: "text-sm text-tertiary", children: n })
74
+ i && /* @__PURE__ */ o("p", { className: c("text-tertiary", s === "xs" ? "text-xs" : "text-sm"), children: i })
66
75
  ] }),
67
- c
76
+ d
68
77
  ]
69
78
  }
70
79
  );
71
80
  };
72
- E.displayName = "TableCardHeader";
73
- const j = ({ className: s, size: l = "md", isEditable: n = !1, ...c }) => {
74
- const e = v(y), [a, i] = N(/* @__PURE__ */ new Set()), f = (e == null ? void 0 : e.expandedRows) ?? a, h = (e == null ? void 0 : e.toggleRow) ?? ((t) => {
75
- i((b) => {
76
- const r = new Set(b);
77
- return r.has(t) ? r.delete(t) : r.add(t), r;
81
+ _.displayName = "TableCardHeader";
82
+ const j = ({ className: r, size: n = "md", isEditable: i = !1, ...d }) => {
83
+ const e = g(b), [s, a] = T(/* @__PURE__ */ new Set()), f = (e == null ? void 0 : e.expandedRows) ?? s, p = (e == null ? void 0 : e.toggleRow) ?? ((l) => {
84
+ a((m) => {
85
+ const t = new Set(m);
86
+ return t.has(l) ? t.delete(l) : t.add(l), t;
78
87
  });
79
88
  });
80
89
  return /* @__PURE__ */ o(
81
- y.Provider,
90
+ b.Provider,
82
91
  {
83
92
  value: {
84
- size: (e == null ? void 0 : e.size) ?? l,
93
+ size: (e == null ? void 0 : e.size) ?? n,
85
94
  hasOverflow: e == null ? void 0 : e.hasOverflow,
86
95
  expandedRows: f,
87
- toggleRow: h
96
+ toggleRow: p
88
97
  },
89
- children: n ? /* @__PURE__ */ o(
98
+ children: i ? /* @__PURE__ */ o(
90
99
  "div",
91
100
  {
92
- onKeyDownCapture: (t) => {
101
+ onKeyDownCapture: (l) => {
93
102
  if ((/* @__PURE__ */ new Set([
94
103
  "ArrowLeft",
95
104
  "ArrowRight",
@@ -101,219 +110,232 @@ const j = ({ className: s, size: l = "md", isEditable: n = !1, ...c }) => {
101
110
  "PageDown",
102
111
  " "
103
112
  // space
104
- ])).has(t.key)) {
105
- const r = t.target;
106
- r && (r.closest('[contenteditable]:not([contenteditable="false"])') || r.closest("input, textarea") || r.closest('[role="textbox"]')) && t.stopPropagation();
113
+ ])).has(l.key)) {
114
+ const t = l.target;
115
+ t && (t.closest('[contenteditable]:not([contenteditable="false"])') || t.closest("input, textarea") || t.closest('[role="textbox"]')) && l.stopPropagation();
107
116
  }
108
117
  },
109
118
  children: /* @__PURE__ */ o(
110
- k,
119
+ B,
111
120
  {
112
- className: (t) => d("w-full overflow-x-hidden", typeof s == "function" ? s(t) : s),
113
- ...c
121
+ className: (l) => c(
122
+ "w-full overflow-x-hidden",
123
+ n === "xs" && "px-3 py-0",
124
+ typeof r == "function" ? r(l) : r
125
+ ),
126
+ ...d
114
127
  }
115
128
  )
116
129
  }
117
130
  ) : /* @__PURE__ */ o(
118
- k,
131
+ B,
119
132
  {
120
- className: (t) => d("w-full overflow-x-hidden", typeof s == "function" ? s(t) : s),
121
- ...c
133
+ className: (l) => c(
134
+ "w-full overflow-x-hidden",
135
+ n === "xs" && "px-3 py-0",
136
+ typeof r == "function" ? r(l) : r
137
+ ),
138
+ ...d
122
139
  }
123
140
  )
124
141
  }
125
142
  );
126
143
  };
127
144
  j.displayName = "Table";
128
- const K = ({
129
- columns: s,
130
- children: l,
131
- bordered: n = !1,
132
- hasExpandableRows: c = !1,
145
+ const q = ({
146
+ columns: r,
147
+ children: n,
148
+ bordered: i = !1,
149
+ hasExpandableRows: d = !1,
133
150
  className: e,
134
- ...a
151
+ ...s
135
152
  }) => {
136
- const { size: i } = v(y), { selectionBehavior: f, selectionMode: h } = x();
137
- return /* @__PURE__ */ u(
153
+ const { size: a } = g(b), { selectionBehavior: f, selectionMode: p } = C();
154
+ return /* @__PURE__ */ x(
138
155
  X,
139
156
  {
140
- ...a,
141
- className: (t) => d(
157
+ ...s,
158
+ className: (l) => c(
142
159
  "sticky top-0 z-30 bg-secondary_subtle rounded-lg h-9",
143
160
  // Row border—using an "after" pseudo-element to avoid the border taking up space.
144
- n && "[&>tr>th]:after:pointer-events-none [&>tr>th]:after:absolute [&>tr>th]:after:inset-x-0 [&>tr>th]:after:bottom-0 [&>tr>th]:after:h-px [&>tr>th]:after:bg-border-tertiary [&>tr>th]:focus-visible:after:bg-transparent",
145
- typeof e == "function" ? e(t) : e
161
+ i && "[&>tr>th]:after:pointer-events-none [&>tr>th]:after:absolute [&>tr>th]:after:inset-x-0 [&>tr>th]:after:bottom-0 [&>tr>th]:after:h-px [&>tr>th]:after:bg-border-tertiary [&>tr>th]:focus-visible:after:bg-transparent",
162
+ typeof e == "function" ? e(l) : e
146
163
  ),
147
164
  children: [
148
- c && /* @__PURE__ */ o(z, { className: d("relative p-0", i === "sm" ? "w-9" : "w-11") }),
149
- f === "toggle" && /* @__PURE__ */ o(z, { className: d("relative p-0", i === "sm" ? "w-9" : "w-11"), children: h === "multiple" && /* @__PURE__ */ o("div", { className: "flex items-start", children: /* @__PURE__ */ o(P, { slot: "selection" }) }) }),
150
- /* @__PURE__ */ o(A, { items: s, children: l })
165
+ d && /* @__PURE__ */ o(z, { className: c("relative p-0", a === "sm" || a === "xs" ? "w-9" : "w-11") }),
166
+ f === "toggle" && /* @__PURE__ */ o(z, { className: c("relative p-0", a === "sm" || a === "xs" ? "w-9" : "w-11"), children: p === "multiple" && /* @__PURE__ */ o("div", { className: "flex items-start", children: /* @__PURE__ */ o(D, { slot: "selection" }) }) }),
167
+ /* @__PURE__ */ o(P, { items: r, children: n })
151
168
  ]
152
169
  }
153
170
  );
154
171
  };
155
- K.displayName = "TableHeader";
156
- const $ = ({
157
- className: s,
158
- label: l,
159
- children: n,
160
- sticky: c,
161
- stickyOffset: e = 0,
172
+ q.displayName = "TableHeader";
173
+ const K = ({
174
+ className: r,
175
+ tooltip: n,
176
+ label: i,
177
+ children: d,
178
+ sticky: e,
179
+ stickyOffset: s = 0,
162
180
  headerCellClass: a,
163
- ...i
181
+ tooltipHeader: f = !1,
182
+ ...p
164
183
  }) => {
165
- const { selectionBehavior: f } = x(), { size: h } = v(y);
184
+ const { selectionBehavior: l } = C(), { size: m } = g(b);
166
185
  return /* @__PURE__ */ o(
167
186
  z,
168
187
  {
169
- ...i,
188
+ ...p,
170
189
  style: (t) => {
171
- const b = c ? {
190
+ const u = e ? {
172
191
  position: "sticky",
173
- [c]: e,
192
+ [e]: s,
174
193
  zIndex: 30
175
194
  } : {};
176
- return { ...typeof i.style == "function" ? i.style(t) : i.style || {}, ...b };
195
+ return { ...typeof p.style == "function" ? p.style(t) : p.style || {}, ...u };
177
196
  },
178
- className: (t) => d(
197
+ className: (t) => c(
179
198
  "relative p-0 outline-hidden focus-visible:z-1 focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-bg-primary focus-visible:ring-inset",
180
- h === "sm" && "px-4 py-2",
181
- h === "md" && "px-6 py-2",
182
- f === "toggle" && "nth-2:pl-3",
183
- c && "bg-secondary_subtle",
199
+ m === "xs" && "px-3 py-0",
200
+ m === "sm" && "px-4 py-2",
201
+ m === "md" && "px-6 py-2",
202
+ l === "toggle" && "nth-2:pl-3",
203
+ e && "bg-secondary",
184
204
  t.allowsSorting && "cursor-pointer",
185
- typeof s == "function" ? s(t) : s
205
+ typeof r == "function" ? r(t) : r
186
206
  ),
187
- children: (t) => /* @__PURE__ */ u(Q, { className: d("flex items-center gap-1", a), children: [
188
- /* @__PURE__ */ u("div", { className: "flex items-center gap-1 overflow-hidden", children: [
189
- l && /* @__PURE__ */ o("span", { className: "text-xs font-semibold whitespace-nowrap overflow-hidden text-ellipsis text-secondary", children: l }),
190
- typeof n == "function" ? n(t) : n
207
+ children: (t) => /* @__PURE__ */ x(Q, { className: c("flex items-center gap-1", a), children: [
208
+ /* @__PURE__ */ x("div", { className: "flex items-center gap-1 overflow-hidden", children: [
209
+ i && /* @__PURE__ */ o("span", { className: "text-xs font-medium whitespace-nowrap overflow-hidden text-ellipsis text-secondary", children: i }),
210
+ typeof d == "function" ? d(t) : d
191
211
  ] }),
212
+ n && /* @__PURE__ */ o(w, { name: "HelpCircle", size: 16, className: "text-fg-quaternary" }),
192
213
  t.allowsSorting && (t.sortDirection ? /* @__PURE__ */ o(
193
- S,
214
+ w,
194
215
  {
195
216
  name: "ArrowDown",
196
217
  size: 12,
197
- className: d(
198
- "stroke-[3px] text-secondary",
218
+ className: c(
219
+ "stroke-[3px] text-fg-quaternary",
199
220
  t.sortDirection === "ascending" && "rotate-180"
200
221
  )
201
222
  }
202
- ) : /* @__PURE__ */ o(S, { name: "ChevronSelectorVertical", size: 12, className: "text-secondary" }))
223
+ ) : /* @__PURE__ */ o(w, { name: "ChevronSelectorVertical", size: 12, className: "text-fg-quaternary" }))
203
224
  ] })
204
225
  }
205
226
  );
206
227
  };
207
- $.displayName = "TableHead";
208
- const U = ({
209
- columns: s,
210
- children: l,
211
- className: n,
212
- highlightSelectedRow: c = !0,
228
+ K.displayName = "TableHead";
229
+ const $ = ({
230
+ columns: r,
231
+ children: n,
232
+ className: i,
233
+ highlightSelectedRow: d = !0,
213
234
  isExpandable: e = !1,
214
- renderExpandedContent: a,
215
- ...i
235
+ renderExpandedContent: s,
236
+ ...a
216
237
  }) => {
217
- const { size: f, expandedRows: h, toggleRow: t } = v(y), { selectionBehavior: b } = x(), r = typeof i.id == "string" ? i.id : String(i.id), p = h.has(r), R = e ? /* @__PURE__ */ o(
238
+ const { size: f, expandedRows: p, toggleRow: l } = g(b), { selectionBehavior: m } = C(), t = typeof a.id == "string" ? a.id : String(a.id), u = p.has(t), R = e ? /* @__PURE__ */ o(
218
239
  "button",
219
240
  {
220
241
  type: "button",
221
- onClick: (g) => {
222
- g.stopPropagation(), t(r);
242
+ onClick: (y) => {
243
+ y.stopPropagation(), l(t);
223
244
  },
224
- className: d(
245
+ className: c(
225
246
  "flex items-center justify-center transition-transform duration-200 ease-in-out cursor-pointer hover:bg-secondary_subtle rounded p-1 flex-shrink-0 -ml-1 mr-2",
226
- p && "rotate-90"
247
+ u && "rotate-90"
227
248
  ),
228
- "aria-label": p ? "Collapse row" : "Expand row",
229
- children: /* @__PURE__ */ o(S, { name: "ChevronRight", size: 16, className: "text-secondary" })
249
+ "aria-label": u ? "Collapse row" : "Expand row",
250
+ children: /* @__PURE__ */ o(w, { name: "ChevronRight", size: 16, className: "text-secondary" })
230
251
  }
231
- ) : null, C = e ? (() => {
232
- const g = q.toArray(l);
233
- if (g.length > 0 && O(g[0])) {
234
- const H = g[0], _ = H.props;
252
+ ) : null, N = e ? (() => {
253
+ const y = M.toArray(n);
254
+ if (y.length > 0 && A(y[0])) {
255
+ const H = y[0], k = H.props;
235
256
  return [
236
257
  I(H, {
237
- ..._,
238
- children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
258
+ ...k,
259
+ children: /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
239
260
  R,
240
- _.children
261
+ k.children
241
262
  ] })
242
263
  }),
243
- ...g.slice(1)
264
+ ...y.slice(1)
244
265
  ];
245
266
  }
246
- return l;
247
- })() : l;
248
- return /* @__PURE__ */ u(W, { children: [
249
- /* @__PURE__ */ u(
250
- B,
267
+ return n;
268
+ })() : n;
269
+ return /* @__PURE__ */ x(V, { children: [
270
+ /* @__PURE__ */ x(
271
+ O,
251
272
  {
252
- ...i,
253
- className: (g) => d(
273
+ ...a,
274
+ className: (y) => c(
254
275
  "relative outline-focus-ring transition-colors after:pointer-events-none hover:bg-secondary_subtle focus-visible:outline-2 focus-visible:-outline-offset-2",
255
- f === "sm" ? "h-12" : "h-18",
256
- c && "selected:bg-secondary",
276
+ f === "xs" ? "h-10" : f === "sm" ? "h-12" : f === "md" ? "h-18" : "h-10",
277
+ d && "selected:bg-secondary",
257
278
  // Row border—using an "after" pseudo-element to avoid the border taking up space.
258
- !p && "[&>td]:after:absolute [&>td]:after:inset-x-0 [&>td]:after:bottom-0 [&>td]:after:h-px [&>td]:after:w-full [&>td]:after:bg-border-tertiary last:[&>td]:after:hidden [&>td]:focus-visible:after:opacity-0 focus-visible:[&>td]:after:opacity-0",
259
- typeof n == "function" ? n(g) : n
279
+ !u && "[&>td]:after:absolute [&>td]:after:inset-x-0 [&>td]:after:bottom-0 [&>td]:after:h-px [&>td]:after:w-full [&>td]:after:bg-border-tertiary last:[&>td]:after:hidden [&>td]:focus-visible:after:opacity-0 focus-visible:[&>td]:after:opacity-0",
280
+ typeof i == "function" ? i(y) : i
260
281
  ),
261
282
  children: [
262
- b === "toggle" && /* @__PURE__ */ o(T, { className: d("relative p-0", f === "sm" ? "w-9" : "w-11"), children: /* @__PURE__ */ o("div", { className: "flex items-end", children: /* @__PURE__ */ o(P, { className: "hidden", slot: "selection" }) }) }),
263
- /* @__PURE__ */ o(A, { items: s, children: C })
283
+ m === "toggle" && /* @__PURE__ */ o(S, { className: c("relative p-0", f === "sm" || f === "xs" ? "w-9" : "w-11"), children: /* @__PURE__ */ o("div", { className: "flex items-end", children: /* @__PURE__ */ o(D, { className: "hidden", slot: "selection" }) }) }),
284
+ /* @__PURE__ */ o(P, { items: r, children: N })
264
285
  ]
265
286
  }
266
287
  ),
267
- e && p && a && /* @__PURE__ */ o(B, { id: `${r}-expanded`, className: "relative bg-secondary_hover", children: /* @__PURE__ */ o(
268
- T,
288
+ e && u && s && /* @__PURE__ */ o(O, { id: `${t}-expanded`, className: "relative bg-secondary_subtle", children: /* @__PURE__ */ o(
289
+ S,
269
290
  {
270
291
  className: "p-0",
271
- colSpan: (s == null ? void 0 : s.length) || 0,
272
- children: /* @__PURE__ */ o("div", { className: d("w-full"), children: a(i.value) })
292
+ colSpan: (r == null ? void 0 : r.length) || 0,
293
+ children: /* @__PURE__ */ o("div", { className: c("w-full"), children: s(a.value) })
273
294
  }
274
295
  ) })
275
296
  ] });
276
297
  };
277
- U.displayName = "TableRow";
278
- const V = ({ className: s, children: l, sticky: n, stickyOffset: c = 0, ...e }) => {
279
- const { size: a } = v(y), { selectionBehavior: i } = x();
298
+ $.displayName = "TableRow";
299
+ const U = ({ className: r, children: n, sticky: i, stickyOffset: d = 0, ...e }) => {
300
+ const { size: s } = g(b), { selectionBehavior: a } = C();
280
301
  return /* @__PURE__ */ o(
281
- T,
302
+ S,
282
303
  {
283
304
  ...e,
284
305
  style: (f) => {
285
- const h = n ? {
306
+ const p = i ? {
286
307
  position: "sticky",
287
- [n]: c,
288
- zIndex: 20
308
+ [i]: d,
309
+ zIndex: 20,
310
+ backgroundColor: "white",
311
+ boxShadow: i === "right" ? "inset 2px 0 0px 0px var(--color-border-tertiary)" : "inset -2px 0 0px 0px var(--color-border-tertiary)"
289
312
  } : {};
290
- return { ...typeof e.style == "function" ? e.style(f) : e.style || {}, ...h };
313
+ return { ...typeof e.style == "function" ? e.style(f) : e.style || {}, ...p };
291
314
  },
292
- className: (f) => d(
293
- "relative text-sm text-secondary outline-focus-ring focus-visible:z-1 focus-visible:outline-2 focus-visible:-outline-offset-2",
294
- a === "sm" && "p-0 px-4 py-2",
295
- a === "md" && "p-0 px-6 py-2",
296
- i === "toggle" && "nth-2:pl-3",
297
- n === "left" && "before:absolute before:top-0 before:right-0 before:h-full before:shadow-[4px_0_8px_2px_rgba(0,0,0,0.15)]",
298
- n === "right" && "z-[2000] bg-white hover:bg-inherit before:absolute before:top-0 before:left-0 before:h-full before:shadow-[-4px_0_8px_2px_rgba(0,0,0,0.15)]",
299
- typeof s == "function" ? s(f) : s
315
+ className: (f) => c(
316
+ "relative text-secondary outline-focus-ring focus-visible:z-1 focus-visible:outline-2 focus-visible:-outline-offset-2",
317
+ s === "xs" && "p-0 px-3 py-0 text-xs",
318
+ s === "sm" && "p-0 px-4 py-2 text-sm",
319
+ s === "md" && "p-0 px-6 py-2 text-base",
320
+ a === "toggle" && "nth-2:pl-3",
321
+ typeof r == "function" ? r(f) : r
300
322
  ),
301
- children: l
323
+ children: n
302
324
  }
303
325
  );
304
326
  };
305
- V.displayName = "TableCell";
327
+ U.displayName = "TableCell";
306
328
  const le = {
307
- Root: D,
308
- Header: E
309
- }, w = j;
310
- w.Body = J;
311
- w.Cell = V;
312
- w.Head = $;
313
- w.Header = K;
314
- w.Row = U;
329
+ Root: E,
330
+ Header: _
331
+ }, v = j;
332
+ v.Body = J;
333
+ v.Cell = U;
334
+ v.Head = K;
335
+ v.Header = q;
336
+ v.Row = $;
315
337
  export {
316
- w as Table,
338
+ v as Table,
317
339
  le as TableCard,
318
- V as TableCell
340
+ U as TableCell
319
341
  };
@@ -6,7 +6,7 @@ export declare const badgeTypes: {
6
6
  };
7
7
  export type BadgeTypes = (typeof badgeTypes)[keyof typeof badgeTypes];
8
8
  export type BadgeColors = "clear" | "gray" | "brand" | "error" | "warning" | "success" | "gray-blue" | "blue-light" | "blue" | "indigo" | "purple" | "pink" | "orange";
9
- export type Sizes = "xs" | "sm" | "md" | "lg";
9
+ export type Sizes = "sm" | "md" | "lg";
10
10
  export type FlagTypes = string;
11
11
  export type IconComponentType = ComponentType<SVGProps<SVGSVGElement>>;
12
12
  export type BadgeTypeToColorMap<T extends Record<string, {
@@ -1 +1 @@
1
- {"version":3,"file":"badge-types.d.ts","sourceRoot":"","sources":["../../../src/primitives/badge/badge-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErD,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEtE,MAAM,MAAM,WAAW,GACjB,OAAO,GACP,MAAM,GACN,OAAO,GACP,OAAO,GACP,SAAS,GACT,SAAS,GACT,WAAW,GACX,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,QAAQ,CAAC;AAEf,MAAM,MAAM,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAEvE,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC,IAAI;KAC5F,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;CACvC,CAAC"}
1
+ {"version":3,"file":"badge-types.d.ts","sourceRoot":"","sources":["../../../src/primitives/badge/badge-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErD,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEtE,MAA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