@cascivo/react 0.16.1 → 0.17.1

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 (62) hide show
  1. package/README.md +14 -13
  2. package/dist/accordion/accordion.js +5 -4
  3. package/dist/app-shell/app-shell.css +1 -1
  4. package/dist/app-shell/app-shell.js +28 -26
  5. package/dist/app-shell/app-shell.module.js +8 -8
  6. package/dist/breadcrumb/breadcrumb.js +1 -1
  7. package/dist/button/button.css +1 -1
  8. package/dist/button/button.js +4 -1
  9. package/dist/button/button.module.js +4 -1
  10. package/dist/calendar/calendar.js +67 -63
  11. package/dist/card/card.css +1 -1
  12. package/dist/card/card.module.js +8 -8
  13. package/dist/checkbox/checkbox.css +1 -1
  14. package/dist/checkbox/checkbox.module.js +4 -4
  15. package/dist/code-snippet/code-snippet.js +31 -26
  16. package/dist/combobox/combobox.js +55 -54
  17. package/dist/data-table/data-table.css +1 -1
  18. package/dist/data-table/data-table.js +155 -160
  19. package/dist/data-table/data-table.module.js +29 -29
  20. package/dist/date-picker/date-picker.js +90 -89
  21. package/dist/dock/dock.js +1 -1
  22. package/dist/field/field.css +1 -1
  23. package/dist/field/field.module.js +3 -3
  24. package/dist/index.d.ts +157 -10
  25. package/dist/large-title-header/large-title-header.js +1 -1
  26. package/dist/layouts/src/grid/grid.css +1 -1
  27. package/dist/layouts/src/grid/grid.module.js +3 -3
  28. package/dist/node/accordion/accordion.js +5 -4
  29. package/dist/node/app-shell/app-shell.js +28 -26
  30. package/dist/node/app-shell/app-shell.module.js +8 -8
  31. package/dist/node/breadcrumb/breadcrumb.js +1 -1
  32. package/dist/node/button/button.js +4 -1
  33. package/dist/node/button/button.module.js +4 -1
  34. package/dist/node/calendar/calendar.js +67 -63
  35. package/dist/node/card/card.module.js +8 -8
  36. package/dist/node/checkbox/checkbox.module.js +4 -4
  37. package/dist/node/code-snippet/code-snippet.js +31 -26
  38. package/dist/node/combobox/combobox.js +55 -54
  39. package/dist/node/data-table/data-table.js +155 -160
  40. package/dist/node/data-table/data-table.module.js +29 -29
  41. package/dist/node/date-picker/date-picker.js +90 -89
  42. package/dist/node/dock/dock.js +1 -1
  43. package/dist/node/field/field.module.js +3 -3
  44. package/dist/node/large-title-header/large-title-header.js +1 -1
  45. package/dist/node/layouts/src/grid/grid.module.js +3 -3
  46. package/dist/node/search/search.js +5 -4
  47. package/dist/node/side-nav/side-nav.js +90 -89
  48. package/dist/node/swap/swap.js +4 -3
  49. package/dist/node/switcher/switcher.js +1 -1
  50. package/dist/node/tabs/tabs.js +5 -4
  51. package/dist/node/toc/toc.js +5 -4
  52. package/dist/search/search.js +5 -4
  53. package/dist/side-nav/side-nav.js +90 -89
  54. package/dist/styles.css +7 -7
  55. package/dist/swap/swap.js +4 -3
  56. package/dist/switcher/switcher.js +1 -1
  57. package/dist/tabs/tabs.js +5 -4
  58. package/dist/toc/toc.js +5 -4
  59. package/dist/types.d.ts +21 -0
  60. package/dist/types.js +1 -0
  61. package/package.json +11 -4
  62. package/readme.body.md +14 -13
@@ -4,21 +4,21 @@ import { Tooltip as e } from "../tooltip/tooltip.js";
4
4
  import { usePopover as t } from "../popover/use-popover.js";
5
5
  import n from "./side-nav.module.js";
6
6
  import { Fragment as r, useId as i } from "react";
7
- import { cn as a, focusElement as o, getLinkComponent as s, useSignal as c, useSignals as l } from "@cascivo/core";
8
- import { builtin as u, t as d } from "@cascivo/i18n";
9
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
7
+ import { cn as a, focusElement as o, getLinkComponent as s, useControllableSignal as c, useSignal as l, useSignals as u } from "@cascivo/core";
8
+ import { builtin as d, t as f } from "@cascivo/i18n";
9
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
10
10
  //#region ../components/src/side-nav/side-nav.tsx
11
- function h(e) {
11
+ function g(e) {
12
12
  return !("type" in e);
13
13
  }
14
- function g() {
15
- return /* @__PURE__ */ p("svg", {
14
+ function _() {
15
+ return /* @__PURE__ */ m("svg", {
16
16
  viewBox: "0 0 16 16",
17
17
  width: "14",
18
18
  height: "14",
19
19
  "aria-hidden": "true",
20
20
  className: n.checkMark,
21
- children: /* @__PURE__ */ p("path", {
21
+ children: /* @__PURE__ */ m("path", {
22
22
  d: "M3.5 8.5l3 3 6-7",
23
23
  fill: "none",
24
24
  stroke: "currentColor",
@@ -28,20 +28,20 @@ function g() {
28
28
  })
29
29
  });
30
30
  }
31
- function _(e, { inMenu: t, onActivate: r, extraClass: i }) {
32
- let o = t ? "menuitem" : void 0, c = a(n.link, n.sublink, i), l = /* @__PURE__ */ m(f, { children: [
33
- e.icon ? /* @__PURE__ */ p("span", {
31
+ function v(e, { inMenu: t, onActivate: r, extraClass: i }) {
32
+ let o = t ? "menuitem" : void 0, c = a(n.link, n.sublink, i), l = /* @__PURE__ */ h(p, { children: [
33
+ e.icon ? /* @__PURE__ */ m("span", {
34
34
  className: n.icon,
35
35
  "aria-hidden": "true",
36
36
  children: e.icon
37
37
  }) : null,
38
- /* @__PURE__ */ p("span", {
38
+ /* @__PURE__ */ m("span", {
39
39
  className: n.label,
40
40
  children: e.label
41
41
  }),
42
- e.selected ? /* @__PURE__ */ p(g, {}) : null
42
+ e.selected ? /* @__PURE__ */ m(_, {}) : null
43
43
  ] });
44
- return e.onSelect && !e.href ? /* @__PURE__ */ p("button", {
44
+ return e.onSelect && !e.href ? /* @__PURE__ */ m("button", {
45
45
  type: "button",
46
46
  role: o,
47
47
  "aria-current": e.active ? "page" : void 0,
@@ -53,7 +53,7 @@ function _(e, { inMenu: t, onActivate: r, extraClass: i }) {
53
53
  e.onSelect?.(), r?.();
54
54
  },
55
55
  children: l
56
- }) : /* @__PURE__ */ p(s(), {
56
+ }) : /* @__PURE__ */ m(s(), {
57
57
  href: e.disabled ? void 0 : e.href,
58
58
  role: o,
59
59
  "aria-current": e.active ? "page" : void 0,
@@ -72,16 +72,16 @@ function _(e, { inMenu: t, onActivate: r, extraClass: i }) {
72
72
  children: l
73
73
  });
74
74
  }
75
- function v(e) {
75
+ function y(e) {
76
76
  if (typeof Intl < "u" && "Segmenter" in Intl) {
77
77
  let t = new Intl.Segmenter(void 0, { granularity: "grapheme" });
78
78
  for (let n of t.segment(e)) return n.segment;
79
79
  }
80
80
  return [...e][0] ?? "";
81
81
  }
82
- function y({ item: e }) {
83
- let { triggerRef: i, popoverRef: a, isOpen: s, anchorName: c, open: l, close: u, toggle: d } = t(), g = "[role=\"menuitem\"]:not([disabled]):not([aria-disabled=\"true\"])";
84
- return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("button", {
82
+ function b({ item: e }) {
83
+ let { triggerRef: i, popoverRef: a, isOpen: s, anchorName: c, open: l, close: u, toggle: d } = t(), f = "[role=\"menuitem\"]:not([disabled]):not([aria-disabled=\"true\"])";
84
+ return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("button", {
85
85
  ref: i,
86
86
  type: "button",
87
87
  "aria-haspopup": "menu",
@@ -96,21 +96,21 @@ function y({ item: e }) {
96
96
  e.preventDefault(), s.value || l();
97
97
  let t = a.current;
98
98
  t && setTimeout(() => {
99
- t.querySelector(g)?.focus();
99
+ t.querySelector(f)?.focus();
100
100
  }, 0);
101
101
  } else e.key === "Escape" && u();
102
102
  },
103
- children: e.icon ? /* @__PURE__ */ p("span", {
103
+ children: e.icon ? /* @__PURE__ */ m("span", {
104
104
  className: n.icon,
105
105
  "aria-hidden": "true",
106
106
  children: e.icon
107
- }) : /* @__PURE__ */ p("span", {
107
+ }) : /* @__PURE__ */ m("span", {
108
108
  className: n.fallbackIcon,
109
109
  "data-fallback-icon": !0,
110
110
  "aria-hidden": "true",
111
- children: v(e.label)
111
+ children: y(e.label)
112
112
  })
113
- }), /* @__PURE__ */ m("div", {
113
+ }), /* @__PURE__ */ h("div", {
114
114
  ref: a,
115
115
  popover: "auto",
116
116
  role: "menu",
@@ -120,93 +120,94 @@ function y({ item: e }) {
120
120
  onKeyDown: (e) => {
121
121
  let t = a.current;
122
122
  if (!t) return;
123
- let n = Array.from(t.querySelectorAll(g)), r = n.indexOf(e.target);
123
+ let n = Array.from(t.querySelectorAll(f)), r = n.indexOf(e.target);
124
124
  e.key === "ArrowDown" ? (e.preventDefault(), n[(r + 1) % n.length]?.focus()) : e.key === "ArrowUp" ? (e.preventDefault(), n[(r - 1 + n.length) % n.length]?.focus()) : e.key === "Escape" && (e.preventDefault(), u(), o(i.current));
125
125
  },
126
- children: [/* @__PURE__ */ p("div", {
126
+ children: [/* @__PURE__ */ m("div", {
127
127
  className: n.railFlyoutCaption,
128
128
  "aria-hidden": "true",
129
129
  children: e.label
130
- }), e.items.map((e, t) => h(e) ? /* @__PURE__ */ p(r, { children: _(e, {
130
+ }), e.items.map((e, t) => g(e) ? /* @__PURE__ */ m(r, { children: v(e, {
131
131
  inMenu: !0,
132
132
  onActivate: u,
133
133
  extraClass: n.flyoutItem
134
- }) }, t) : e.type === "separator" ? /* @__PURE__ */ p("div", {
134
+ }) }, t) : e.type === "separator" ? /* @__PURE__ */ m("div", {
135
135
  role: "separator",
136
136
  className: n.flyoutSeparator
137
- }, t) : /* @__PURE__ */ p("div", {
137
+ }, t) : /* @__PURE__ */ m("div", {
138
138
  className: n.railFlyoutCaption,
139
139
  "aria-hidden": "true",
140
140
  children: e.label
141
141
  }, t))]
142
142
  })] });
143
143
  }
144
- function b({ items: t, groups: r, collapsed: o, defaultCollapsed: g = !1, onCollapsedChange: b, ariaLabel: x, collapseLabel: S, expandLabel: C, expandOnHover: w = !1, showCollapseToggle: T = !0, header: E, footer: D, className: O }) {
145
- l();
146
- let k = x ?? d(u.sideNav.nav), A = S ?? d(u.sideNav.collapse), j = C ?? d(u.sideNav.expand), M = i(), N = c(o ?? g);
147
- o !== void 0 && (N.value = o);
148
- let P = r ?? (t ? [{ items: t }] : [{ items: [] }]), F = c(P.flatMap((e) => e.items).filter((e) => e.items?.some((e) => h(e) && e.active)).map((e) => e.label)), I = (e) => {
149
- let t = F.value;
150
- F.value = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
151
- }, L = () => {
152
- let e = !N.value;
153
- o === void 0 && (N.value = e), b?.(e);
154
- }, R = N.value;
155
- return /* @__PURE__ */ m("nav", {
156
- "aria-label": k,
157
- "data-state": R ? "collapsed" : "expanded",
158
- "data-expand-on-hover": R && w ? "" : void 0,
159
- className: a(n.sideNav, O),
144
+ function x({ items: t, groups: r, collapsed: o, defaultCollapsed: _ = !1, onCollapsedChange: x, ariaLabel: S, collapseLabel: C, expandLabel: w, expandOnHover: T = !1, showCollapseToggle: E = !0, header: D, footer: O, className: k }) {
145
+ u();
146
+ let A = S ?? f(d.sideNav.nav), j = C ?? f(d.sideNav.collapse), M = w ?? f(d.sideNav.expand), N = i(), [P] = c({
147
+ value: o,
148
+ defaultValue: _
149
+ }), F = r ?? (t ? [{ items: t }] : [{ items: [] }]), I = l(F.flatMap((e) => e.items).filter((e) => e.items?.some((e) => g(e) && e.active)).map((e) => e.label)), L = (e) => {
150
+ let t = I.value;
151
+ I.value = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
152
+ }, R = () => {
153
+ let e = !P.value;
154
+ o === void 0 && (P.value = e), x?.(e);
155
+ }, z = P.value;
156
+ return /* @__PURE__ */ h("nav", {
157
+ "aria-label": A,
158
+ "data-state": z ? "collapsed" : "expanded",
159
+ "data-expand-on-hover": z && T ? "" : void 0,
160
+ className: a(n.sideNav, k),
160
161
  children: [
161
- E && /* @__PURE__ */ p("div", {
162
+ D && /* @__PURE__ */ m("div", {
162
163
  className: n.header,
163
- children: E
164
+ children: D
164
165
  }),
165
- /* @__PURE__ */ p("ul", {
166
+ /* @__PURE__ */ m("ul", {
166
167
  className: n.list,
167
- children: P.map((t, r) => /* @__PURE__ */ m("li", {
168
+ children: F.map((t, r) => /* @__PURE__ */ h("li", {
168
169
  className: n.group,
169
- children: [t.label && /* @__PURE__ */ p("h3", {
170
+ children: [t.label && /* @__PURE__ */ m("h3", {
170
171
  className: n.groupLabel,
171
172
  children: t.label
172
- }), /* @__PURE__ */ p("ul", {
173
+ }), /* @__PURE__ */ m("ul", {
173
174
  className: n.groupItems,
174
175
  children: t.items.map((t, i) => {
175
176
  let a = `${r}-${i}`;
176
177
  if (t.items) {
177
- if (R && !w) return /* @__PURE__ */ p("li", { children: /* @__PURE__ */ p(y, { item: t }) }, t.id ?? a);
178
- let e = F.value.includes(t.label), r = `${M}-group-${a}`;
179
- return /* @__PURE__ */ m("li", { children: [/* @__PURE__ */ m("button", {
178
+ if (z && !T) return /* @__PURE__ */ m("li", { children: /* @__PURE__ */ m(b, { item: t }) }, t.id ?? a);
179
+ let e = I.value.includes(t.label), r = `${N}-group-${a}`;
180
+ return /* @__PURE__ */ h("li", { children: [/* @__PURE__ */ h("button", {
180
181
  type: "button",
181
182
  "aria-expanded": e,
182
183
  "aria-controls": r,
183
- "aria-label": R ? t.label : void 0,
184
+ "aria-label": z ? t.label : void 0,
184
185
  "data-state": e ? "open" : "closed",
185
186
  className: n.groupTrigger,
186
- onClick: () => I(t.label),
187
+ onClick: () => L(t.label),
187
188
  children: [
188
- t.icon ? /* @__PURE__ */ p("span", {
189
+ t.icon ? /* @__PURE__ */ m("span", {
189
190
  className: n.icon,
190
191
  "aria-hidden": "true",
191
192
  children: t.icon
192
- }) : R ? /* @__PURE__ */ p("span", {
193
+ }) : z ? /* @__PURE__ */ m("span", {
193
194
  className: n.fallbackIcon,
194
195
  "data-fallback-icon": !0,
195
196
  "aria-hidden": "true",
196
- children: v(t.label)
197
+ children: y(t.label)
197
198
  }) : null,
198
- /* @__PURE__ */ p("span", {
199
+ /* @__PURE__ */ m("span", {
199
200
  className: n.label,
200
- "data-rail-hidden": R || void 0,
201
+ "data-rail-hidden": z || void 0,
201
202
  children: t.label
202
203
  }),
203
- /* @__PURE__ */ p("svg", {
204
+ /* @__PURE__ */ m("svg", {
204
205
  viewBox: "0 0 16 16",
205
206
  width: "12",
206
207
  height: "12",
207
208
  "aria-hidden": "true",
208
209
  className: n.groupIndicator,
209
- children: /* @__PURE__ */ p("path", {
210
+ children: /* @__PURE__ */ m("path", {
210
211
  d: "M4 6l4 4 4-4",
211
212
  fill: "none",
212
213
  stroke: "currentColor",
@@ -216,47 +217,47 @@ function b({ items: t, groups: r, collapsed: o, defaultCollapsed: g = !1, onColl
216
217
  })
217
218
  })
218
219
  ]
219
- }), /* @__PURE__ */ p("div", {
220
+ }), /* @__PURE__ */ m("div", {
220
221
  id: r,
221
222
  "data-state": e ? "open" : "closed",
222
223
  className: n.sublist,
223
- children: /* @__PURE__ */ p("ul", {
224
+ children: /* @__PURE__ */ m("ul", {
224
225
  className: n.sublistInner,
225
- children: t.items.map((e, t) => h(e) ? /* @__PURE__ */ p("li", { children: _(e, { inMenu: !1 }) }, t) : e.type === "separator" ? /* @__PURE__ */ p("li", {
226
+ children: t.items.map((e, t) => g(e) ? /* @__PURE__ */ m("li", { children: v(e, { inMenu: !1 }) }, t) : e.type === "separator" ? /* @__PURE__ */ m("li", {
226
227
  role: "separator",
227
228
  className: n.subSeparator
228
- }, t) : /* @__PURE__ */ p("li", {
229
+ }, t) : /* @__PURE__ */ m("li", {
229
230
  className: n.subGroupLabel,
230
231
  children: e.label
231
232
  }, t))
232
233
  })
233
234
  })] }, t.id ?? a);
234
235
  }
235
- let o = /* @__PURE__ */ m(f, { children: [
236
- t.icon ? /* @__PURE__ */ p("span", {
236
+ let o = /* @__PURE__ */ h(p, { children: [
237
+ t.icon ? /* @__PURE__ */ m("span", {
237
238
  className: n.icon,
238
239
  "aria-hidden": "true",
239
240
  children: t.icon
240
- }) : R ? /* @__PURE__ */ p("span", {
241
+ }) : z ? /* @__PURE__ */ m("span", {
241
242
  className: n.fallbackIcon,
242
243
  "data-fallback-icon": !0,
243
244
  "aria-hidden": "true",
244
- children: v(t.label)
245
+ children: y(t.label)
245
246
  }) : null,
246
- /* @__PURE__ */ p("span", {
247
+ /* @__PURE__ */ m("span", {
247
248
  className: n.label,
248
- "data-rail-hidden": R || void 0,
249
+ "data-rail-hidden": z || void 0,
249
250
  children: t.label
250
251
  }),
251
- t.trailing == null ? null : /* @__PURE__ */ p("span", {
252
+ t.trailing == null ? null : /* @__PURE__ */ m("span", {
252
253
  className: n.trailing,
253
- "data-rail-hidden": R || void 0,
254
+ "data-rail-hidden": z || void 0,
254
255
  children: t.trailing
255
256
  })
256
257
  ] }), c = t.tone && t.tone !== "default" ? t.tone : void 0, l = {
257
258
  href: t.disabled ? void 0 : t.href,
258
259
  "aria-current": t.active ? "page" : void 0,
259
- "aria-label": R ? t.label : void 0,
260
+ "aria-label": z ? t.label : void 0,
260
261
  "aria-disabled": t.disabled || void 0,
261
262
  tabIndex: t.disabled ? -1 : void 0,
262
263
  "data-state": t.active ? "active" : void 0,
@@ -270,29 +271,29 @@ function b({ items: t, groups: r, collapsed: o, defaultCollapsed: g = !1, onColl
270
271
  t.onClick?.(e);
271
272
  }
272
273
  };
273
- if (t.render) return /* @__PURE__ */ p("li", {
274
+ if (t.render) return /* @__PURE__ */ m("li", {
274
275
  className: n.customItem,
275
276
  children: t.render({
276
- collapsed: R,
277
+ collapsed: z,
277
278
  children: o,
278
279
  linkProps: l
279
280
  })
280
281
  }, t.id ?? a);
281
- let u = s(), d = t.onClick && !t.href ? /* @__PURE__ */ p("button", {
282
+ let u = s(), d = t.onClick && !t.href ? /* @__PURE__ */ m("button", {
282
283
  type: "button",
283
284
  "aria-current": t.active ? "page" : void 0,
284
- "aria-label": R ? t.label : void 0,
285
+ "aria-label": z ? t.label : void 0,
285
286
  "data-state": t.active ? "active" : void 0,
286
287
  "data-tone": c,
287
288
  className: n.link,
288
289
  disabled: t.disabled,
289
290
  onClick: (e) => t.onClick?.(e),
290
291
  children: o
291
- }) : /* @__PURE__ */ p(u, {
292
+ }) : /* @__PURE__ */ m(u, {
292
293
  ...l,
293
294
  children: o
294
295
  });
295
- return /* @__PURE__ */ p("li", { children: R && !w ? /* @__PURE__ */ p(e, {
296
+ return /* @__PURE__ */ m("li", { children: z && !T ? /* @__PURE__ */ m(e, {
296
297
  content: t.label,
297
298
  placement: "right",
298
299
  children: d
@@ -301,22 +302,22 @@ function b({ items: t, groups: r, collapsed: o, defaultCollapsed: g = !1, onColl
301
302
  })]
302
303
  }, r))
303
304
  }),
304
- D && /* @__PURE__ */ p("div", {
305
+ O && /* @__PURE__ */ m("div", {
305
306
  className: n.footer,
306
- children: D
307
+ children: O
307
308
  }),
308
- T && /* @__PURE__ */ p("button", {
309
+ E && /* @__PURE__ */ m("button", {
309
310
  type: "button",
310
- "aria-label": R ? j : A,
311
+ "aria-label": z ? M : j,
311
312
  className: n.collapseToggle,
312
- onClick: L,
313
- children: /* @__PURE__ */ p("svg", {
313
+ onClick: R,
314
+ children: /* @__PURE__ */ m("svg", {
314
315
  viewBox: "0 0 16 16",
315
316
  width: "14",
316
317
  height: "14",
317
318
  "aria-hidden": "true",
318
319
  className: n.collapseIcon,
319
- children: /* @__PURE__ */ p("path", {
320
+ children: /* @__PURE__ */ m("path", {
320
321
  d: "M10 4l-4 4 4 4",
321
322
  fill: "none",
322
323
  stroke: "currentColor",
@@ -330,4 +331,4 @@ function b({ items: t, groups: r, collapsed: o, defaultCollapsed: g = !1, onColl
330
331
  });
331
332
  }
332
333
  //#endregion
333
- export { b as SideNav };
334
+ export { x as SideNav };
@@ -1,11 +1,12 @@
1
+ "use client";
2
+
1
3
  import e from "./swap.module.js";
2
- import { useSignal as t, useSignals as n } from "@cascivo/core";
4
+ import { useControllableSignal as t, useSignals as n } from "@cascivo/core";
3
5
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
6
  //#region ../components/src/swap/swap.tsx
5
7
  function a({ on: a, off: o, checked: s = !1, onValueChange: c, onChange: l, mode: u = "rotate", className: d, ariaLabel: f, ...p }) {
6
8
  n();
7
- let m = t(s);
8
- m.value = s;
9
+ let [m] = t({ value: s });
9
10
  function h() {
10
11
  let e = !m.value;
11
12
  (c ?? l)?.(e);
@@ -25,7 +25,7 @@ function c({ items: c, label: l, className: u }) {
25
25
  "aria-hidden": "true",
26
26
  children: t.icon
27
27
  }), t.label]
28
- }) }, t.href))
28
+ }) }, t.id ?? t.href))
29
29
  });
30
30
  }
31
31
  //#endregion
@@ -2,14 +2,15 @@
2
2
 
3
3
  import e from "./tabs.module.js";
4
4
  import { createContext as t, forwardRef as n, useId as r, useRef as i } from "react";
5
- import { Slot as a, cn as o, useSignal as s, useSignals as c } from "@cascivo/core";
5
+ import { Slot as a, cn as o, useControllableSignal as s, useSignals as c } from "@cascivo/core";
6
6
  import { jsx as l } from "react/jsx-runtime";
7
7
  //#region ../components/src/tabs/tabs.tsx
8
8
  var u = t(null);
9
9
  function d({ defaultValue: t, value: n, onValueChange: i, className: a, children: c }) {
10
- let d = r(), f = s(n ?? t ?? "");
11
- n !== void 0 && (f.value = n);
12
- let p = {
10
+ let d = r(), [f] = s({
11
+ value: n,
12
+ defaultValue: t ?? ""
13
+ }), p = {
13
14
  active: f,
14
15
  baseId: d,
15
16
  setValue: (e) => {
@@ -2,15 +2,16 @@
2
2
 
3
3
  import e from "./toc.module.js";
4
4
  import { useRef as t } from "react";
5
- import { cn as n, useSignal as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
5
+ import { cn as n, useControllableSignal as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
6
6
  import { builtin as o, t as s } from "@cascivo/i18n";
7
7
  import { jsx as c } from "react/jsx-runtime";
8
8
  //#region ../components/src/toc/toc.tsx
9
9
  function l({ items: l, activeId: u, onActiveChange: d, labels: f, className: p }) {
10
10
  a();
11
- let m = u !== void 0, h = r(u ?? l[0]?.id ?? "");
12
- m && (h.value = u);
13
- let g = t(d);
11
+ let m = u !== void 0, [h] = r({
12
+ value: u,
13
+ defaultValue: l[0]?.id ?? ""
14
+ }), g = t(d);
14
15
  return g.current = d, i(() => {
15
16
  if (m || typeof document > "u" || typeof IntersectionObserver > "u") return;
16
17
  let e = l.map((e) => document.getElementById(e.id)).filter((e) => e !== null);
@@ -2,7 +2,7 @@
2
2
 
3
3
  import e from "./search.module.js";
4
4
  import { useRef as t } from "react";
5
- import { cn as n, focusElement as r, useId as i, useSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
5
+ import { cn as n, focusElement as r, useControllableSignal as i, useId as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
6
6
  import { builtin as c, t as l } from "@cascivo/i18n";
7
7
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
8
8
  //#region ../components/src/search/search.tsx
@@ -30,9 +30,10 @@ function f() {
30
30
  }
31
31
  function p({ value: p, defaultValue: m = "", onValueChange: h, onChange: g, onSearch: _, debounceMs: v = 300, placeholder: y, size: b = "md", label: x, disabled: S = !1, clearLabel: C, id: w, className: T }) {
32
32
  s();
33
- let E = y ?? l(c.search.placeholder), D = x ?? l(c.search.label), O = C ?? l(c.search.clear), k = t(null), A = i("cascade-search"), j = w ?? A, M = p !== void 0, N = a(M ? p : m);
34
- M && (N.value = p);
35
- let P = t(_);
33
+ let E = y ?? l(c.search.placeholder), D = x ?? l(c.search.label), O = C ?? l(c.search.clear), k = t(null), A = a("cascade-search"), j = w ?? A, M = p !== void 0, [N] = i({
34
+ value: p,
35
+ defaultValue: m
36
+ }), P = t(_);
36
37
  P.current = _;
37
38
  let F = t(null), I = () => {
38
39
  F.current !== null && (clearTimeout(F.current), F.current = null);