@cascivo/react 0.11.1 → 0.13.0

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 (124) hide show
  1. package/README.md +1 -1
  2. package/dist/alert-dialog/alert-dialog.js +2 -4
  3. package/dist/app-shell/app-shell.js +24 -23
  4. package/dist/badge/badge.js +17 -10
  5. package/dist/button/button.css +1 -1
  6. package/dist/button/button.module.js +1 -1
  7. package/dist/card/card.css +1 -1
  8. package/dist/card/card.js +21 -11
  9. package/dist/card/card.module.js +8 -5
  10. package/dist/checkbox/checkbox.js +2 -2
  11. package/dist/combobox/combobox.css +1 -1
  12. package/dist/combobox/combobox.module.js +15 -15
  13. package/dist/command-menu/command-menu.js +67 -71
  14. package/dist/data-table/data-table.css +1 -1
  15. package/dist/data-table/data-table.js +7 -1
  16. package/dist/data-table/data-table.module.js +29 -29
  17. package/dist/date-picker/date-picker.css +1 -1
  18. package/dist/date-picker/date-picker.module.js +19 -19
  19. package/dist/dropdown/dropdown.js +48 -50
  20. package/dist/file-uploader/file-uploader.css +1 -1
  21. package/dist/file-uploader/file-uploader.module.js +14 -14
  22. package/dist/filter/filter.js +10 -9
  23. package/dist/header-panel/header-panel.js +2 -4
  24. package/dist/icon-button/icon-button.css +1 -1
  25. package/dist/icon-button/icon-button.js +10 -10
  26. package/dist/icon-button/icon-button.module.js +1 -1
  27. package/dist/index.d.ts +1300 -69
  28. package/dist/input/input.css +1 -1
  29. package/dist/input/input.module.js +5 -5
  30. package/dist/item/item.css +1 -1
  31. package/dist/item/item.module.js +6 -6
  32. package/dist/layouts/src/page-header/page-header.css +1 -0
  33. package/dist/layouts/src/page-header/page-header.js +33 -0
  34. package/dist/layouts/src/page-header/page-header.module.js +13 -0
  35. package/dist/link/link.js +12 -12
  36. package/dist/modal/modal.js +4 -4
  37. package/dist/multi-select/multi-select.css +1 -1
  38. package/dist/multi-select/multi-select.module.js +11 -11
  39. package/dist/node/alert-dialog/alert-dialog.js +2 -4
  40. package/dist/node/app-shell/app-shell.js +24 -23
  41. package/dist/node/badge/badge.js +17 -10
  42. package/dist/node/button/button.module.js +1 -1
  43. package/dist/node/card/card.js +21 -11
  44. package/dist/node/card/card.module.js +8 -5
  45. package/dist/node/checkbox/checkbox.js +2 -2
  46. package/dist/node/combobox/combobox.module.js +15 -15
  47. package/dist/node/command-menu/command-menu.js +67 -71
  48. package/dist/node/data-table/data-table.js +7 -1
  49. package/dist/node/data-table/data-table.module.js +29 -29
  50. package/dist/node/date-picker/date-picker.module.js +19 -19
  51. package/dist/node/dropdown/dropdown.js +48 -50
  52. package/dist/node/file-uploader/file-uploader.module.js +14 -14
  53. package/dist/node/filter/filter.js +10 -9
  54. package/dist/node/header-panel/header-panel.js +2 -4
  55. package/dist/node/icon-button/icon-button.js +10 -10
  56. package/dist/node/icon-button/icon-button.module.js +1 -1
  57. package/dist/node/input/input.module.js +5 -5
  58. package/dist/node/item/item.module.js +6 -6
  59. package/dist/node/layouts/src/page-header/page-header.js +33 -0
  60. package/dist/node/layouts/src/page-header/page-header.module.js +12 -0
  61. package/dist/node/link/link.js +12 -12
  62. package/dist/node/modal/modal.js +4 -4
  63. package/dist/node/multi-select/multi-select.module.js +11 -11
  64. package/dist/node/notification/notification.js +50 -44
  65. package/dist/node/notification/notification.module.js +7 -7
  66. package/dist/node/number-input/number-input.module.js +8 -8
  67. package/dist/node/otp-input/otp-input.module.js +2 -2
  68. package/dist/node/overflow-menu/overflow-menu.js +18 -13
  69. package/dist/node/password-input/password-input.module.js +7 -7
  70. package/dist/node/popover/use-popover.js +9 -9
  71. package/dist/node/progress/progress.js +3 -2
  72. package/dist/node/react/src/index.js +63 -62
  73. package/dist/node/search/search.js +19 -22
  74. package/dist/node/search/search.module.js +5 -5
  75. package/dist/node/sheet/sheet.js +2 -4
  76. package/dist/node/stat/stat.js +6 -5
  77. package/dist/node/stat/stat.module.js +7 -7
  78. package/dist/node/status/status.js +18 -11
  79. package/dist/node/steps/steps.js +23 -23
  80. package/dist/node/structured-list/structured-list.js +14 -13
  81. package/dist/node/tag/tag.js +22 -15
  82. package/dist/node/tags-input/tags-input.module.js +4 -4
  83. package/dist/node/tile/tile.module.js +3 -3
  84. package/dist/node/time-picker/time-picker.module.js +5 -5
  85. package/dist/node/timeline/timeline.js +22 -16
  86. package/dist/node/visually-hidden/visually-hidden.js +2 -13
  87. package/dist/notification/notification.css +1 -1
  88. package/dist/notification/notification.js +50 -44
  89. package/dist/notification/notification.module.js +7 -7
  90. package/dist/number-input/number-input.css +1 -1
  91. package/dist/number-input/number-input.module.js +8 -8
  92. package/dist/otp-input/otp-input.css +1 -1
  93. package/dist/otp-input/otp-input.module.js +2 -2
  94. package/dist/overflow-menu/overflow-menu.js +18 -13
  95. package/dist/password-input/password-input.css +1 -1
  96. package/dist/password-input/password-input.module.js +7 -7
  97. package/dist/popover/use-popover.js +9 -9
  98. package/dist/progress/progress.js +3 -2
  99. package/dist/react/src/index.js +63 -62
  100. package/dist/search/search.css +1 -1
  101. package/dist/search/search.js +19 -22
  102. package/dist/search/search.module.js +5 -5
  103. package/dist/sheet/sheet.js +2 -4
  104. package/dist/stat/stat.css +1 -1
  105. package/dist/stat/stat.js +6 -5
  106. package/dist/stat/stat.module.js +7 -7
  107. package/dist/status/status.js +18 -11
  108. package/dist/steps/steps.js +23 -23
  109. package/dist/structured-list/structured-list.js +14 -13
  110. package/dist/styles.css +33 -21
  111. package/dist/tag/tag.js +22 -15
  112. package/dist/tags-input/tags-input.css +1 -1
  113. package/dist/tags-input/tags-input.module.js +4 -4
  114. package/dist/tile/tile.css +1 -1
  115. package/dist/tile/tile.module.js +3 -3
  116. package/dist/time-picker/time-picker.css +1 -1
  117. package/dist/time-picker/time-picker.module.js +5 -5
  118. package/dist/timeline/timeline.js +22 -16
  119. package/dist/visually-hidden/visually-hidden.js +2 -13
  120. package/package.json +4 -4
  121. package/readme.body.md +1 -1
  122. package/dist/node/visually-hidden/visually-hidden.module.js +0 -5
  123. package/dist/visually-hidden/visually-hidden.css +0 -1
  124. package/dist/visually-hidden/visually-hidden.module.js +0 -6
@@ -3,10 +3,10 @@
3
3
  import { Spinner as e } from "../spinner/spinner.js";
4
4
  import { Kbd as t } from "../kbd/kbd.js";
5
5
  import n from "./command-menu.module.js";
6
- import { batch as r, cn as i, useSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
6
+ import { batch as r, cn as i, useEffectPropSignal as a, useSignal as o, useSignalEffect as s, useSignals as ee } from "@cascivo/core";
7
7
  import { builtin as c, t as l } from "@cascivo/i18n";
8
8
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
- import { useId as ee, useRef as f } from "react";
9
+ import { useId as te, useRef as f } from "react";
10
10
  //#region ../components/src/command-menu/command-menu.tsx
11
11
  function p(e, t) {
12
12
  if (e.length === 0) return {
@@ -66,46 +66,42 @@ function _(e, t) {
66
66
  }
67
67
  return null;
68
68
  }
69
- function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b, hotkey: x = !0, label: S, loading: C = !1, onQueryChange: w, scopes: T = [], className: E }) {
70
- s();
71
- let D = S ?? l(c.commandMenu.label), ne = b ?? l(c.commandMenu.empty), O = ee(), k = `${O}-listbox`, A = f(null), j = f(null), M = f([]), N = f(v);
72
- N.current = v;
73
- let P = f(w);
74
- P.current = w;
75
- let F = a(m);
76
- F.value = m;
77
- let I = a(x);
78
- I.value = x;
79
- let L = a(""), R = a(0), z = a([]), B = a(null), re = z.value.at(-1)?.groups ?? te, ie = y ?? z.value.at(-1)?.placeholder ?? l(c.commandMenu.placeholder), V = T.find((e) => e.id === B.value) ?? null, H = re.filter((e) => !B.value || !e.scope || e.scope === B.value).map((e) => ({
69
+ function v({ open: m, onOpenChange: v, groups: ne, placeholder: re, emptyLabel: ie, hotkey: y = !0, label: b, loading: x = !1, onQueryChange: S, scopes: C = [], className: ae }) {
70
+ ee();
71
+ let w = b ?? l(c.commandMenu.label), T = ie ?? l(c.commandMenu.empty), E = te(), D = `${E}-listbox`, O = f(null), k = f(null), A = f([]), j = f(v);
72
+ j.current = v;
73
+ let M = f(S);
74
+ M.current = S;
75
+ let N = a(m), P = a(y), F = o(""), I = o(0), L = o([]), R = o(null), z = L.value.at(-1)?.groups ?? ne, B = re ?? L.value.at(-1)?.placeholder ?? l(c.commandMenu.placeholder), V = C.find((e) => e.id === R.value) ?? null, H = z.filter((e) => !R.value || !e.scope || e.scope === R.value).map((e) => ({
80
76
  heading: e.heading,
81
77
  items: e.items.map((e) => ({
82
78
  item: e,
83
- score: h(L.value, e)
79
+ score: h(F.value, e)
84
80
  })).filter(({ score: e }) => e > 0).sort((e, t) => t.score - e.score).map(({ item: e }) => ({
85
81
  item: e,
86
- indices: p(L.value, e.label)?.indices ?? []
82
+ indices: p(F.value, e.label)?.indices ?? []
87
83
  }))
88
- })).filter((e) => e.items.length > 0), U = H.flatMap((e) => e.items.map((e) => e.item)), W = U.flatMap((e, t) => e.disabled ? [] : [t]), G = W.includes(R.value) ? R.value : W[0] ?? -1, K = (e) => `${O}-option-${e}`;
89
- o(() => {
90
- let e = A.current;
91
- e && (F.value ? e.open || (r(() => {
92
- L.value = "", R.value = 0, z.value = [], B.value = null;
93
- }), typeof e.showModal == "function" && e.showModal(), j.current?.focus()) : e.open && (z.value = [], e.close()));
94
- }), o(() => {
95
- let e = A.current;
84
+ })).filter((e) => e.items.length > 0), U = H.flatMap((e) => e.items.map((e) => e.item)), W = U.flatMap((e, t) => e.disabled ? [] : [t]), G = W.includes(I.value) ? I.value : W[0] ?? -1, K = (e) => `${E}-option-${e}`;
85
+ s(() => {
86
+ let e = O.current;
87
+ e && (N.value ? e.open || (r(() => {
88
+ F.value = "", I.value = 0, L.value = [], R.value = null;
89
+ }), typeof e.showModal == "function" && e.showModal(), k.current?.focus()) : e.open && (L.value = [], e.close()));
90
+ }), s(() => {
91
+ let e = O.current;
96
92
  if (!e) return;
97
- let t = () => N.current(!1);
93
+ let t = () => j.current(!1);
98
94
  return e.addEventListener("close", t), () => e.removeEventListener("close", t);
99
- }), o(() => {
100
- if (!I.value) return;
95
+ }), s(() => {
96
+ if (!P.value) return;
101
97
  let e = (e) => {
102
- (e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k" && (e.preventDefault(), N.current(!F.value));
98
+ (e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k" && (e.preventDefault(), j.current(!N.value));
103
99
  };
104
100
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
105
101
  });
106
102
  let q = (e) => {
107
- R.value = e;
108
- let t = M.current[e];
103
+ I.value = e;
104
+ let t = A.current[e];
109
105
  t && typeof t.scrollIntoView == "function" && t.scrollIntoView({ block: "nearest" });
110
106
  }, J = (e) => {
111
107
  if (W.length === 0) return;
@@ -118,7 +114,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
118
114
  if (e.page) {
119
115
  if (t === "secondary") return;
120
116
  r(() => {
121
- z.value = [...z.value, e.page], L.value = "", R.value = 0;
117
+ L.value = [...L.value, e.page], F.value = "", I.value = 0;
122
118
  });
123
119
  return;
124
120
  }
@@ -129,21 +125,21 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
129
125
  }
130
126
  t !== "secondary" && (e.onSelect?.(), v(!1));
131
127
  }
132
- }, ae = (e) => {
133
- if (T.length === 0) return;
134
- let t = [null, ...T.map((e) => e.id)], n = t[(t.indexOf(B.value) + e + t.length) % t.length];
128
+ }, oe = (e) => {
129
+ if (C.length === 0) return;
130
+ let t = [null, ...C.map((e) => e.id)], n = t[(t.indexOf(R.value) + e + t.length) % t.length];
135
131
  r(() => {
136
- B.value = n ?? null, R.value = 0;
132
+ R.value = n ?? null, I.value = 0;
137
133
  });
138
134
  }, Z = () => {
139
135
  r(() => {
140
- B.value = null, R.value = 0;
141
- }), j.current?.focus();
136
+ R.value = null, I.value = 0;
137
+ }), k.current?.focus();
142
138
  }, Q = () => {
143
139
  r(() => {
144
- z.value = z.value.slice(0, -1), L.value = "", R.value = 0;
140
+ L.value = L.value.slice(0, -1), F.value = "", I.value = 0;
145
141
  });
146
- }, oe = (e) => {
142
+ }, se = (e) => {
147
143
  switch (e.key) {
148
144
  case "ArrowDown":
149
145
  e.preventDefault(), J(1);
@@ -152,7 +148,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
152
148
  e.preventDefault(), J(-1);
153
149
  break;
154
150
  case "Tab":
155
- T.length > 0 && (e.preventDefault(), ae(e.shiftKey ? -1 : 1));
151
+ C.length > 0 && (e.preventDefault(), oe(e.shiftKey ? -1 : 1));
156
152
  break;
157
153
  case "Home":
158
154
  e.preventDefault(), W[0] !== void 0 && q(W[0]);
@@ -167,20 +163,20 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
167
163
  e.preventDefault(), G >= 0 && X(U[G], e.metaKey || e.ctrlKey ? "secondary" : "primary");
168
164
  break;
169
165
  case "Backspace":
170
- L.value === "" && (z.value.length > 0 ? (e.preventDefault(), Q()) : B.value && (e.preventDefault(), Z()));
166
+ F.value === "" && (L.value.length > 0 ? (e.preventDefault(), Q()) : R.value && (e.preventDefault(), Z()));
171
167
  break;
172
168
  }
173
- }, se = (e) => {
174
- e.key === "Escape" && (e.preventDefault(), z.value.length > 0 ? Q() : A.current?.close());
175
169
  }, ce = (e) => {
176
- e.target === A.current && A.current?.close();
170
+ e.key === "Escape" && (e.preventDefault(), L.value.length > 0 ? Q() : O.current?.close());
171
+ }, le = (e) => {
172
+ e.target === O.current && O.current?.close();
177
173
  }, $ = -1;
178
174
  return /* @__PURE__ */ u("dialog", {
179
- ref: A,
180
- "aria-label": D,
181
- className: i(n.dialog, E),
182
- onClick: ce,
183
- onKeyDown: se,
175
+ ref: O,
176
+ "aria-label": w,
177
+ className: i(n.dialog, ae),
178
+ onClick: le,
179
+ onKeyDown: ce,
184
180
  children: /* @__PURE__ */ d("div", {
185
181
  className: n.panel,
186
182
  children: [
@@ -231,44 +227,44 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
231
227
  })]
232
228
  }),
233
229
  /* @__PURE__ */ u("input", {
234
- ref: j,
230
+ ref: k,
235
231
  type: "text",
236
232
  role: "combobox",
237
233
  "aria-expanded": "true",
238
- "aria-controls": k,
234
+ "aria-controls": D,
239
235
  "aria-activedescendant": G >= 0 ? K(G) : void 0,
240
236
  "aria-autocomplete": "list",
241
- "aria-label": D,
237
+ "aria-label": w,
242
238
  autoComplete: "off",
243
239
  spellCheck: !1,
244
240
  className: n.input,
245
- placeholder: ie,
246
- value: L.value,
241
+ placeholder: B,
242
+ value: F.value,
247
243
  onChange: (e) => {
248
244
  let t = e.target.value;
249
- if (!B.value && T.length > 0) {
250
- let e = _(t, T);
251
- e && (B.value = e.scope.id, t = e.rest);
245
+ if (!R.value && C.length > 0) {
246
+ let e = _(t, C);
247
+ e && (R.value = e.scope.id, t = e.rest);
252
248
  }
253
- L.value = t, R.value = 0, P.current?.(t);
249
+ F.value = t, I.value = 0, M.current?.(t);
254
250
  },
255
- onKeyDown: oe
251
+ onKeyDown: se
256
252
  })
257
253
  ]
258
254
  }),
259
- T.length > 0 && /* @__PURE__ */ d("div", {
255
+ C.length > 0 && /* @__PURE__ */ d("div", {
260
256
  className: n.scopes,
261
257
  children: [/* @__PURE__ */ u("span", {
262
258
  className: n.scopesLabel,
263
259
  children: l(c.commandMenu.scopeLabel)
264
- }), T.map((e) => /* @__PURE__ */ d("button", {
260
+ }), C.map((e) => /* @__PURE__ */ d("button", {
265
261
  type: "button",
266
262
  className: n.scopePill,
267
- "data-active": e.id === B.value || void 0,
263
+ "data-active": e.id === R.value || void 0,
268
264
  onClick: () => {
269
265
  r(() => {
270
- B.value = B.value === e.id ? null : e.id, R.value = 0;
271
- }), j.current?.focus();
266
+ R.value = R.value === e.id ? null : e.id, I.value = 0;
267
+ }), k.current?.focus();
272
268
  },
273
269
  children: [e.prefix && /* @__PURE__ */ u("span", {
274
270
  className: n.scopePrefix,
@@ -280,8 +276,8 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
280
276
  className: n.list,
281
277
  children: [/* @__PURE__ */ u("div", {
282
278
  role: "listbox",
283
- id: k,
284
- "aria-label": S,
279
+ id: D,
280
+ "aria-label": b,
285
281
  tabIndex: 0,
286
282
  children: H.map((e, r) => /* @__PURE__ */ d("div", {
287
283
  role: "group",
@@ -290,7 +286,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
290
286
  children: [e.heading && /* @__PURE__ */ d("div", {
291
287
  className: n.heading,
292
288
  "aria-hidden": "true",
293
- children: [/* @__PURE__ */ u("span", { children: e.heading }), L.value !== "" && /* @__PURE__ */ u("span", {
289
+ children: [/* @__PURE__ */ u("span", { children: e.heading }), F.value !== "" && /* @__PURE__ */ u("span", {
294
290
  className: n.count,
295
291
  children: l(c.commandMenu.matches, { count: e.items.length })
296
292
  })]
@@ -300,7 +296,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
300
296
  let a = $;
301
297
  return /* @__PURE__ */ d("div", {
302
298
  ref: (e) => {
303
- M.current[a] = e;
299
+ A.current[a] = e;
304
300
  },
305
301
  id: K(a),
306
302
  role: "option",
@@ -310,7 +306,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
310
306
  "data-disabled": r.disabled || void 0,
311
307
  className: n.option,
312
308
  onMouseEnter: () => {
313
- r.disabled || (R.value = a);
309
+ r.disabled || (I.value = a);
314
310
  },
315
311
  onClick: () => X(r, "primary"),
316
312
  children: [
@@ -366,14 +362,14 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
366
362
  }, r.id);
367
363
  })]
368
364
  }, e.heading ?? `group-${r}`))
369
- }), U.length === 0 && (C ? /* @__PURE__ */ d("div", {
365
+ }), U.length === 0 && (x ? /* @__PURE__ */ d("div", {
370
366
  role: "status",
371
367
  className: n.empty,
372
368
  children: [/* @__PURE__ */ u(e, { size: "sm" }), l(c.commandMenu.loading)]
373
369
  }) : /* @__PURE__ */ u("div", {
374
370
  role: "status",
375
371
  className: n.empty,
376
- children: ne
372
+ children: T
377
373
  }))]
378
374
  }),
379
375
  /* @__PURE__ */ d("div", {
@@ -401,7 +397,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
401
397
  children: "↵"
402
398
  }), " open"]
403
399
  }),
404
- T.length > 0 && /* @__PURE__ */ d("span", {
400
+ C.length > 0 && /* @__PURE__ */ d("span", {
405
401
  className: n.hint,
406
402
  children: [/* @__PURE__ */ u(t, {
407
403
  size: "sm",
@@ -117,6 +117,7 @@ function f({ columns: f, rows: se, getRowId: ce, sort: p, defaultSort: le, sortM
117
117
  "data-zebra": pe || void 0,
118
118
  "data-sticky-header": me || void 0,
119
119
  "data-paginated": h ? !0 : void 0,
120
+ "data-fixed-layout": f.every((e) => e.width !== void 0) || void 0,
120
121
  children: [
121
122
  /* @__PURE__ */ l("span", {
122
123
  "aria-live": "polite",
@@ -176,7 +177,10 @@ function f({ columns: f, rows: se, getRowId: ce, sort: p, defaultSort: le, sortM
176
177
  /* @__PURE__ */ u("colgroup", { children: [
177
178
  v && /* @__PURE__ */ l("col", { className: n.controlCol }),
178
179
  g && /* @__PURE__ */ l("col", { className: n.controlCol }),
179
- f.map((e) => /* @__PURE__ */ l("col", { style: e.width === void 0 ? void 0 : { width: e.width } }, e.key))
180
+ f.map((e) => /* @__PURE__ */ l("col", { style: e.width !== void 0 || e.minWidth !== void 0 ? {
181
+ ...e.width === void 0 ? {} : { width: e.width },
182
+ ...e.minWidth === void 0 ? {} : { minWidth: e.minWidth }
183
+ } : void 0 }, e.key))
180
184
  ] }),
181
185
  /* @__PURE__ */ l("thead", { children: /* @__PURE__ */ u("tr", { children: [
182
186
  v && /* @__PURE__ */ l("th", {
@@ -205,6 +209,7 @@ function f({ columns: f, rows: se, getRowId: ce, sort: p, defaultSort: le, sortM
205
209
  return /* @__PURE__ */ l("th", {
206
210
  scope: "col",
207
211
  "data-align": e.align ?? "start",
212
+ "data-sized": e.width !== void 0 || void 0,
208
213
  "aria-sort": e.sortable ? r : void 0,
209
214
  children: e.sortable ? /* @__PURE__ */ l("button", {
210
215
  type: "button",
@@ -269,6 +274,7 @@ function f({ columns: f, rows: se, getRowId: ce, sort: p, defaultSort: le, sortM
269
274
  }),
270
275
  f.map((t) => /* @__PURE__ */ l("td", {
271
276
  "data-align": t.align ?? "start",
277
+ "data-sized": t.width !== void 0 || void 0,
272
278
  children: t.render ? t.render(e.row) : String(d(e.row, t.key) ?? "")
273
279
  }, t.key))
274
280
  ]
@@ -1,35 +1,35 @@
1
1
  "use client";
2
2
 
3
3
  var e = {
4
- root: "_root_jwjfs_2",
5
- toolbar: "_toolbar_jwjfs_26",
6
- heading: "_heading_jwjfs_35",
7
- title: "_title_jwjfs_41",
8
- description: "_description_jwjfs_47",
9
- search: "_search_jwjfs_52",
10
- batchBar: "_batchBar_jwjfs_79",
11
- batchCount: "_batchCount_jwjfs_89",
12
- batchActions: "_batchActions_jwjfs_95",
13
- scroller: "_scroller_jwjfs_101",
14
- scrollerVirtualized: "_scrollerVirtualized_jwjfs_106",
15
- table: "_table_jwjfs_112",
16
- row: "_row_jwjfs_172",
17
- controlCol: "_controlCol_jwjfs_178",
18
- controlCell: "_controlCell_jwjfs_182",
19
- sortButton: "_sortButton_jwjfs_188",
20
- emptyCell: "_emptyCell_jwjfs_236",
21
- expansionRow: "_expansionRow_jwjfs_243",
22
- expansionGrid: "_expansionGrid_jwjfs_249",
23
- expansionInner: "_expansionInner_jwjfs_253",
24
- expandButton: "_expandButton_jwjfs_258",
25
- chevron: "_chevron_jwjfs_281",
26
- shimmer: "_shimmer_jwjfs_296",
27
- footer: "_footer_jwjfs_323",
28
- pageSize: "_pageSize_jwjfs_333",
29
- range: "_range_jwjfs_359",
30
- pageButtons: "_pageButtons_jwjfs_364",
31
- pageButton: "_pageButton_jwjfs_364",
32
- srOnly: "_srOnly_jwjfs_405"
4
+ root: "_root_ulang_2",
5
+ toolbar: "_toolbar_ulang_26",
6
+ heading: "_heading_ulang_35",
7
+ title: "_title_ulang_41",
8
+ description: "_description_ulang_47",
9
+ search: "_search_ulang_52",
10
+ batchBar: "_batchBar_ulang_79",
11
+ batchCount: "_batchCount_ulang_89",
12
+ batchActions: "_batchActions_ulang_95",
13
+ scroller: "_scroller_ulang_101",
14
+ scrollerVirtualized: "_scrollerVirtualized_ulang_106",
15
+ table: "_table_ulang_112",
16
+ row: "_row_ulang_182",
17
+ controlCol: "_controlCol_ulang_188",
18
+ controlCell: "_controlCell_ulang_192",
19
+ sortButton: "_sortButton_ulang_198",
20
+ emptyCell: "_emptyCell_ulang_246",
21
+ expansionRow: "_expansionRow_ulang_253",
22
+ expansionGrid: "_expansionGrid_ulang_259",
23
+ expansionInner: "_expansionInner_ulang_263",
24
+ expandButton: "_expandButton_ulang_268",
25
+ chevron: "_chevron_ulang_291",
26
+ shimmer: "_shimmer_ulang_306",
27
+ footer: "_footer_ulang_333",
28
+ pageSize: "_pageSize_ulang_343",
29
+ range: "_range_ulang_369",
30
+ pageButtons: "_pageButtons_ulang_374",
31
+ pageButton: "_pageButton_ulang_374",
32
+ srOnly: "_srOnly_ulang_415"
33
33
  };
34
34
  //#endregion
35
35
  export { e as default };
@@ -1,25 +1,25 @@
1
1
  "use client";
2
2
 
3
3
  var e = {
4
- wrapper: "_wrapper_6chzy_2",
5
- label: "_label_6chzy_27",
6
- field: "_field_6chzy_34",
7
- trigger: "_trigger_6chzy_40",
8
- value: "_value_6chzy_78",
9
- placeholder: "_placeholder_6chzy_84",
10
- icon: "_icon_6chzy_87",
11
- clear: "_clear_6chzy_92",
12
- calendar: "_calendar_6chzy_117",
13
- header: "_header_6chzy_149",
14
- monthLabel: "_monthLabel_6chzy_156",
15
- navButton: "_navButton_6chzy_162",
16
- grid: "_grid_6chzy_184",
17
- weekday: "_weekday_6chzy_189",
18
- cell: "_cell_6chzy_198",
19
- empty: "_empty_6chzy_202",
20
- day: "_day_6chzy_206",
21
- error: "_error_6chzy_241",
22
- hint: "_hint_6chzy_245"
4
+ wrapper: "_wrapper_1hgll_2",
5
+ label: "_label_1hgll_31",
6
+ field: "_field_1hgll_38",
7
+ trigger: "_trigger_1hgll_44",
8
+ value: "_value_1hgll_82",
9
+ placeholder: "_placeholder_1hgll_88",
10
+ icon: "_icon_1hgll_91",
11
+ clear: "_clear_1hgll_96",
12
+ calendar: "_calendar_1hgll_121",
13
+ header: "_header_1hgll_153",
14
+ monthLabel: "_monthLabel_1hgll_160",
15
+ navButton: "_navButton_1hgll_166",
16
+ grid: "_grid_1hgll_188",
17
+ weekday: "_weekday_1hgll_193",
18
+ cell: "_cell_1hgll_202",
19
+ empty: "_empty_1hgll_206",
20
+ day: "_day_1hgll_210",
21
+ error: "_error_1hgll_245",
22
+ hint: "_hint_1hgll_249"
23
23
  };
24
24
  //#endregion
25
25
  export { e as default };
@@ -1,102 +1,100 @@
1
1
  "use client";
2
2
 
3
3
  import e from "./dropdown.module.js";
4
- import { composeRefs as t, createMachine as n, useMachine as r, useSignal as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
5
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
- import { cloneElement as l, useRef as u } from "react";
4
+ import { composeRefs as t, createMachine as n, useEffectPropSignal as r, useMachine as i, useSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ import { cloneElement as u, useRef as d } from "react";
7
7
  //#region ../components/src/dropdown/dropdown.tsx
8
- var d = n({
8
+ var f = n({
9
9
  initial: "closed",
10
10
  states: {
11
11
  closed: { on: { OPEN: "open" } },
12
12
  open: { on: { CLOSE: "closed" } }
13
13
  }
14
14
  });
15
- function f({ trigger: n, items: f, onSelect: p, placement: m = "bottom-start", open: h, onOpenChange: g }) {
16
- o();
17
- let [_, v] = r(d), y = u(null), b = u(null), x = u(null), S = u([]), C = i(-1), w = h !== void 0, T = w ? h : _.value === "open", E = i(T);
18
- E.value = T;
19
- let D = f.map((e, t) => ({
15
+ function p({ trigger: n, items: p, onSelect: m, placement: h = "bottom-start", open: g, onOpenChange: _ }) {
16
+ s();
17
+ let [v, y] = i(f), b = d(null), x = d(null), S = d(null), C = d([]), w = a(-1), T = g !== void 0, E = T ? g : v.value === "open", D = r(E), O = p.map((e, t) => ({
20
18
  item: e,
21
19
  index: t
22
- })).filter(({ item: e }) => !e.separator && !e.disabled).map(({ index: e }) => e), O = (e) => {
23
- w || v(e ? "OPEN" : "CLOSE"), g?.(e);
20
+ })).filter(({ item: e }) => !e.separator && !e.disabled).map(({ index: e }) => e), k = (e) => {
21
+ T || y(e ? "OPEN" : "CLOSE"), _?.(e);
24
22
  };
25
- a(() => {
26
- let e = C.value;
27
- E.value && e >= 0 && S.current[e]?.focus();
28
- }), a(() => {
29
- E.value ? C.value = D[0] ?? -1 : C.value = -1;
30
- }), a(() => {
31
- E.value ? x.current?.showPopover() : x.current?.hidePopover();
32
- }), a(() => {
33
- let e = x.current;
23
+ o(() => {
24
+ let e = w.value;
25
+ D.value && e >= 0 && C.current[e]?.focus();
26
+ }), o(() => {
27
+ D.value ? w.value = O[0] ?? -1 : w.value = -1;
28
+ }), o(() => {
29
+ D.value ? S.current?.showPopover() : S.current?.hidePopover();
30
+ }), o(() => {
31
+ let e = S.current;
34
32
  if (!e) return;
35
33
  let t = (e) => {
36
- e.newState === "closed" && O(!1);
34
+ e.newState === "closed" && k(!1);
37
35
  };
38
36
  return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
39
37
  });
40
- let k = (e) => {
41
- let t = f[e];
42
- !t || t.separator || t.disabled || (p?.(t.value), O(!1), b.current?.focus());
43
- }, A = (e) => {
44
- D.length !== 0 && (C.value = D[(D.indexOf(C.value) + e + D.length) % D.length] ?? -1);
38
+ let A = (e) => {
39
+ let t = p[e];
40
+ !t || t.separator || t.disabled || (m?.(t.value), k(!1), x.current?.focus());
45
41
  }, j = (e) => {
42
+ O.length !== 0 && (w.value = O[(O.indexOf(w.value) + e + O.length) % O.length] ?? -1);
43
+ }, M = (e) => {
46
44
  switch (e.key) {
47
45
  case "ArrowDown":
48
- e.preventDefault(), A(1);
46
+ e.preventDefault(), j(1);
49
47
  break;
50
48
  case "ArrowUp":
51
- e.preventDefault(), A(-1);
49
+ e.preventDefault(), j(-1);
52
50
  break;
53
51
  case "Home":
54
- e.preventDefault(), C.value = D[0] ?? -1;
52
+ e.preventDefault(), w.value = O[0] ?? -1;
55
53
  break;
56
54
  case "End":
57
- e.preventDefault(), C.value = D[D.length - 1] ?? -1;
55
+ e.preventDefault(), w.value = O[O.length - 1] ?? -1;
58
56
  break;
59
57
  case "Escape":
60
- e.preventDefault(), O(!1), b.current?.focus();
58
+ e.preventDefault(), k(!1), x.current?.focus();
61
59
  break;
62
60
  case "Enter":
63
61
  case " ":
64
- e.preventDefault(), k(C.value);
62
+ e.preventDefault(), A(w.value);
65
63
  break;
66
64
  }
67
- }, M = n, N = l(M, {
68
- ref: t(b, M.props.ref),
65
+ }, N = n, P = u(N, {
66
+ ref: t(x, N.props.ref),
69
67
  onClick: (e) => {
70
- M.props.onClick?.(e), O(!T);
68
+ N.props.onClick?.(e), k(!E);
71
69
  },
72
70
  "aria-haspopup": "menu",
73
- "aria-expanded": T
71
+ "aria-expanded": E
74
72
  });
75
- return /* @__PURE__ */ c("div", {
76
- ref: y,
73
+ return /* @__PURE__ */ l("div", {
74
+ ref: b,
77
75
  className: e.root,
78
- children: [N, /* @__PURE__ */ s("div", {
79
- ref: x,
76
+ children: [P, /* @__PURE__ */ c("div", {
77
+ ref: S,
80
78
  popover: "auto",
81
79
  role: "menu",
82
- "data-placement": m,
83
- "data-state": T ? "open" : "closed",
80
+ "data-placement": h,
81
+ "data-state": E ? "open" : "closed",
84
82
  className: e.menu,
85
- onKeyDown: j,
86
- children: f.map((t, n) => t.separator ? /* @__PURE__ */ s("div", {
83
+ onKeyDown: M,
84
+ children: p.map((t, n) => t.separator ? /* @__PURE__ */ c("div", {
87
85
  role: "separator",
88
86
  className: e.separator
89
- }, `sep-${n}`) : /* @__PURE__ */ c("button", {
87
+ }, `sep-${n}`) : /* @__PURE__ */ l("button", {
90
88
  type: "button",
91
89
  role: "menuitem",
92
90
  ref: (e) => {
93
- S.current[n] = e;
91
+ C.current[n] = e;
94
92
  },
95
- tabIndex: C.value === n ? 0 : -1,
93
+ tabIndex: w.value === n ? 0 : -1,
96
94
  disabled: t.disabled,
97
95
  className: e.item,
98
- onClick: () => k(n),
99
- children: [t.icon && /* @__PURE__ */ s("span", {
96
+ onClick: () => A(n),
97
+ children: [t.icon && /* @__PURE__ */ c("span", {
100
98
  className: e.icon,
101
99
  "aria-hidden": "true",
102
100
  children: t.icon
@@ -106,4 +104,4 @@ function f({ trigger: n, items: f, onSelect: p, placement: m = "bottom-start", o
106
104
  });
107
105
  }
108
106
  //#endregion
109
- export { f as Dropdown };
107
+ export { p as Dropdown };
@@ -1,20 +1,20 @@
1
1
  "use client";
2
2
 
3
3
  var e = {
4
- uploader: "_uploader_bw6tn_2",
5
- label: "_label_bw6tn_9",
6
- input: "_input_bw6tn_15",
7
- zone: "_zone_bw6tn_24",
8
- hint: "_hint_bw6tn_57",
9
- list: "_list_bw6tn_62",
10
- file: "_file_bw6tn_71",
11
- status: "_status_bw6tn_88",
12
- "glyph-complete": "_glyph-complete_bw6tn_94",
13
- "glyph-error": "_glyph-error_bw6tn_98",
14
- name: "_name_bw6tn_102",
15
- size: "_size_bw6tn_109",
16
- remove: "_remove_bw6tn_115",
17
- "error-message": "_error-message_bw6tn_135"
4
+ uploader: "_uploader_nfhc5_2",
5
+ label: "_label_nfhc5_13",
6
+ input: "_input_nfhc5_19",
7
+ zone: "_zone_nfhc5_28",
8
+ hint: "_hint_nfhc5_61",
9
+ list: "_list_nfhc5_66",
10
+ file: "_file_nfhc5_75",
11
+ status: "_status_nfhc5_92",
12
+ "glyph-complete": "_glyph-complete_nfhc5_98",
13
+ "glyph-error": "_glyph-error_nfhc5_102",
14
+ name: "_name_nfhc5_106",
15
+ size: "_size_nfhc5_113",
16
+ remove: "_remove_nfhc5_119",
17
+ "error-message": "_error-message_nfhc5_139"
18
18
  };
19
19
  //#endregion
20
20
  export { e as default };