@floegence/floe-webapp-core 0.86.75 → 0.87.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 (50) hide show
  1. package/dist/components/index.d.ts +2 -0
  2. package/dist/components/ui/Accordion.d.ts +16 -0
  3. package/dist/components/ui/Accordion.js +59 -0
  4. package/dist/components/ui/Breadcrumb.d.ts +14 -0
  5. package/dist/components/ui/Breadcrumb.js +72 -0
  6. package/dist/components/ui/Calendar.d.ts +17 -0
  7. package/dist/components/ui/Calendar.js +151 -0
  8. package/dist/components/ui/Checkbox.js +137 -130
  9. package/dist/components/ui/DataTable.d.ts +33 -0
  10. package/dist/components/ui/DataTable.js +269 -0
  11. package/dist/components/ui/DatePicker.d.ts +35 -0
  12. package/dist/components/ui/DatePicker.js +198 -0
  13. package/dist/components/ui/Dropdown.d.ts +4 -20
  14. package/dist/components/ui/Dropdown.js +195 -231
  15. package/dist/components/ui/Form.d.ts +24 -5
  16. package/dist/components/ui/Form.js +179 -128
  17. package/dist/components/ui/Input.d.ts +6 -0
  18. package/dist/components/ui/Input.js +237 -189
  19. package/dist/components/ui/Pagination.js +211 -162
  20. package/dist/components/ui/Popover.d.ts +6 -1
  21. package/dist/components/ui/Popover.js +75 -56
  22. package/dist/components/ui/Select.d.ts +46 -0
  23. package/dist/components/ui/Select.js +414 -0
  24. package/dist/components/ui/Slider.d.ts +7 -0
  25. package/dist/components/ui/Slider.js +28 -0
  26. package/dist/components/ui/Switch.js +41 -32
  27. package/dist/components/ui/Table.d.ts +9 -0
  28. package/dist/components/ui/Table.js +97 -0
  29. package/dist/components/ui/calendarModel.d.ts +6 -0
  30. package/dist/components/ui/calendarModel.js +37 -0
  31. package/dist/components/ui/controllable.d.ts +7 -0
  32. package/dist/components/ui/controllable.js +10 -0
  33. package/dist/components/ui/dataTableModel.d.ts +18 -0
  34. package/dist/components/ui/dataTableModel.js +18 -0
  35. package/dist/components/ui/formFieldContext.d.ts +26 -0
  36. package/dist/components/ui/formFieldContext.js +40 -0
  37. package/dist/components/ui/index.d.ts +13 -1
  38. package/dist/components/ui/picker/PickerBase.js +106 -112
  39. package/dist/context/LocaleContext.d.ts +55 -0
  40. package/dist/context/LocaleContext.js +80 -0
  41. package/dist/context/index.d.ts +1 -0
  42. package/dist/diagrams/Diagram.js +129 -120
  43. package/dist/diagrams.css +5 -3
  44. package/dist/floe-webapp-core.css +1 -1
  45. package/dist/full.d.ts +2 -0
  46. package/dist/full.js +776 -737
  47. package/dist/index.js +111 -107
  48. package/dist/styles.css +1 -1
  49. package/dist/ui.js +223 -184
  50. package/package.json +1 -1
@@ -1,10 +1,11 @@
1
- import { createComponent as o, insert as l, effect as f, className as b, setAttribute as m, spread as D, mergeProps as M, template as v, use as N, memo as E } from "solid-js/web";
2
- import { splitProps as B, createUniqueId as U, Switch as V, Match as S, Show as p, For as J, useContext as K, createEffect as O, createContext as Q } from "solid-js";
3
- import { cn as u } from "../../utils/cn.js";
4
- var R = /* @__PURE__ */ v('<svg viewBox="0 0 12 12"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M2 6l3 3 5-6">'), T = /* @__PURE__ */ v('<svg viewBox="0 0 12 12"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round><path d="M2 6h8">'), W = /* @__PURE__ */ v("<div role=group>"), X = /* @__PURE__ */ v("<div data-floe-surface=inset data-floe-surface-part=indicator>"), Y = /* @__PURE__ */ v("<input data-floe-choice-input type=checkbox>"), _ = /* @__PURE__ */ v("<span>"), Z = /* @__PURE__ */ v('<div class="flex flex-col">'), ee = /* @__PURE__ */ v('<label><div class="relative flex items-center justify-center pt-0.5">'), re = /* @__PURE__ */ v("<label data-floe-surface-part=choice><span class=font-medium>"), te = /* @__PURE__ */ v('<div class="absolute top-2 right-2"><svg class="w-4 h-4 text-[var(--floe-accent-ink)]"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"clip-rule=evenodd>'), ne = /* @__PURE__ */ v('<label data-floe-surface-part=choice><div class="flex items-start gap-3"><div class="flex items-center justify-center pt-0.5"></div><div class="flex flex-col flex-1 min-w-0">'), oe = /* @__PURE__ */ v('<div class="absolute top-1.5 right-1.5"><div class="w-4 h-4 rounded-full bg-primary flex items-center justify-center">'), le = /* @__PURE__ */ v("<label data-floe-surface-part=choice>"), ae = /* @__PURE__ */ v("<div>");
5
- const F = Q();
6
- function ie() {
7
- return K(F);
1
+ import { createComponent as n, insert as a, effect as f, className as g, setAttribute as m, spread as A, mergeProps as B, template as v, use as N, memo as G } from "solid-js/web";
2
+ import { splitProps as P, createUniqueId as U, Switch as V, Match as j, Show as b, For as J, useContext as K, createEffect as Q, createContext as R } from "solid-js";
3
+ import { useFormControl as T } from "./formFieldContext.js";
4
+ import { cn as d } from "../../utils/cn.js";
5
+ var W = /* @__PURE__ */ v('<svg viewBox="0 0 12 12"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M2 6l3 3 5-6">'), X = /* @__PURE__ */ v('<svg viewBox="0 0 12 12"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round><path d="M2 6h8">'), Y = /* @__PURE__ */ v("<div role=group>"), Z = /* @__PURE__ */ v("<div data-floe-surface=inset data-floe-surface-part=indicator>"), ee = /* @__PURE__ */ v("<input>"), $ = /* @__PURE__ */ v("<span>"), re = /* @__PURE__ */ v('<div class="flex flex-col">'), te = /* @__PURE__ */ v('<label><div class="relative flex items-center justify-center pt-0.5">'), ne = /* @__PURE__ */ v("<label data-floe-surface-part=choice><span class=font-medium>"), oe = /* @__PURE__ */ v('<div class="absolute top-2 right-2"><svg class="w-4 h-4 text-[var(--floe-accent-ink)]"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"clip-rule=evenodd>'), le = /* @__PURE__ */ v('<label data-floe-surface-part=choice><div class="flex items-start gap-3"><div class="flex items-center justify-center pt-0.5"></div><div class="flex flex-col flex-1 min-w-0">'), ae = /* @__PURE__ */ v('<div class="absolute top-1.5 right-1.5"><div class="w-4 h-4 rounded-full bg-primary flex items-center justify-center">'), ie = /* @__PURE__ */ v("<label data-floe-surface-part=choice>"), se = /* @__PURE__ */ v("<div>");
6
+ const E = R();
7
+ function ce() {
8
+ return K(E);
8
9
  }
9
10
  const C = {
10
11
  sm: {
@@ -25,15 +26,15 @@ const C = {
25
26
  label: "text-sm",
26
27
  description: "text-xs"
27
28
  }
28
- }, se = {
29
+ }, de = {
29
30
  sm: "px-2.5 py-1 text-xs",
30
31
  md: "px-3 py-1.5 text-xs",
31
32
  lg: "px-4 py-2 text-sm"
32
- }, ce = {
33
+ }, ue = {
33
34
  sm: "p-2.5",
34
35
  md: "p-3",
35
36
  lg: "p-4"
36
- }, G = {
37
+ }, L = {
37
38
  sm: {
38
39
  container: "p-3 min-w-[80px]",
39
40
  icon: "w-5 h-5"
@@ -47,95 +48,97 @@ const C = {
47
48
  icon: "w-8 h-8"
48
49
  }
49
50
  };
50
- function A(w) {
51
+ function O(x) {
51
52
  return (() => {
52
- var i = R();
53
- return f(() => m(i, "class", w.class)), i;
53
+ var s = W();
54
+ return f(() => m(s, "class", x.class)), s;
54
55
  })();
55
56
  }
56
- function de(w) {
57
+ function fe(x) {
57
58
  return (() => {
58
- var i = T();
59
- return f(() => m(i, "class", w.class)), i;
59
+ var s = X();
60
+ return f(() => m(s, "class", x.class)), s;
60
61
  })();
61
62
  }
62
- function ue(w) {
63
- const [i, e] = B(w, ["value", "onChange", "size", "orientation", "variant", "disabled", "class", "children"]), g = () => i.variant ?? "default", I = {
64
- value: () => i.value ?? [],
65
- onChange: (h, d) => {
66
- const x = i.value ?? [], k = d ? [...x, h] : x.filter((c) => c !== h);
67
- i.onChange?.(k);
63
+ function ve(x) {
64
+ const [s, p] = P(x, ["value", "onChange", "size", "orientation", "variant", "disabled", "class", "children"]), e = () => s.variant ?? "default", M = {
65
+ value: () => s.value ?? [],
66
+ onChange: (h, y) => {
67
+ const u = s.value ?? [], w = y ? [...u, h] : u.filter((k) => k !== h);
68
+ s.onChange?.(w);
68
69
  },
69
- size: () => i.size ?? "md",
70
- variant: g,
71
- disabled: () => i.disabled ?? !1
72
- }, j = () => {
73
- const h = g(), d = i.orientation === "horizontal";
74
- return h === "button" ? u("inline-flex rounded-group border border-[var(--floe-line)] overflow-hidden", d ? "flex-row" : "flex-col") : h === "card" || h === "tile" ? u("grid gap-2", d ? "grid-flow-col auto-cols-fr" : "grid-cols-1") : u("flex", d ? "flex-row flex-wrap gap-4" : "flex-col gap-2");
70
+ size: () => s.size ?? "md",
71
+ variant: e,
72
+ disabled: () => s.disabled ?? !1
73
+ }, S = () => {
74
+ const h = e(), y = s.orientation === "horizontal";
75
+ return h === "button" ? d("inline-flex rounded-group border border-[var(--floe-line)] overflow-hidden", y ? "flex-row" : "flex-col") : h === "card" || h === "tile" ? d("grid gap-2", y ? "grid-flow-col auto-cols-fr" : "grid-cols-1") : d("flex", y ? "flex-row flex-wrap gap-4" : "flex-col gap-2");
75
76
  };
76
- return o(F.Provider, {
77
- value: I,
77
+ return n(E.Provider, {
78
+ value: M,
78
79
  get children() {
79
- var h = W();
80
- return D(h, M({
80
+ var h = Y();
81
+ return A(h, B({
81
82
  get "data-floe-surface"() {
82
- return g() === "button" ? "inset" : void 0;
83
+ return e() === "button" ? "inset" : void 0;
83
84
  },
84
85
  get "data-floe-surface-part"() {
85
- return g() === "button" ? "rail" : void 0;
86
+ return e() === "button" ? "rail" : void 0;
86
87
  },
87
88
  get class() {
88
- return u(j(), i.class);
89
+ return d(S(), s.class);
89
90
  }
90
- }, e), !1, !0), l(h, () => i.children), h;
91
+ }, p), !1, !0), a(h, () => s.children), h;
91
92
  }
92
93
  });
93
94
  }
94
- function fe(w) {
95
- const i = ie(), [e, g] = B(w, ["value", "checked", "onChange", "label", "description", "icon", "size", "variant", "indeterminate", "ref", "class", "disabled", "id"]), I = U(), j = () => e.id ?? I, h = () => i !== void 0, d = () => e.size ?? i?.size() ?? "md", x = () => e.variant ?? i?.variant() ?? "default", k = () => e.disabled ?? i?.disabled() ?? !1, c = () => h() && e.value ? i.value().includes(e.value) : e.checked ?? !1, H = () => {
96
- k() || (h() && e.value ? i.onChange(e.value, !c()) : e.onChange?.(!c()));
97
- }, L = () => (() => {
98
- var t = X();
99
- return l(t, o(p, {
95
+ function he(x) {
96
+ const s = T(), p = ce(), [e, M] = P(x, ["value", "checked", "onChange", "label", "description", "icon", "size", "variant", "indeterminate", "ref", "class", "disabled", "id"]), S = U(), h = () => e.id ?? (p ? S : s.id) ?? S, y = () => p !== void 0, u = () => e.size ?? p?.size() ?? "md", w = () => e.variant ?? p?.variant() ?? "default", k = () => e.disabled ?? (p?.disabled() || s.disabled || !1), c = () => y() && e.value ? p.value().includes(e.value) : e.checked ?? !1, H = () => {
97
+ k() || (y() && e.value ? p.onChange(e.value, !c()) : e.onChange?.(!c()));
98
+ }, q = () => (() => {
99
+ var t = Z();
100
+ return a(t, n(b, {
100
101
  get when() {
101
102
  return e.indeterminate;
102
103
  },
103
104
  get children() {
104
- return o(de, {
105
+ return n(fe, {
105
106
  get class() {
106
- return u(C[d()].icon, "transition-transform duration-[var(--floe-duration-fast)]");
107
+ return d(C[u()].icon, "transition-transform duration-[var(--floe-duration-fast)]");
107
108
  }
108
109
  });
109
110
  }
110
- }), null), l(t, o(p, {
111
+ }), null), a(t, n(b, {
111
112
  get when() {
112
- return E(() => !e.indeterminate)() && c();
113
+ return G(() => !e.indeterminate)() && c();
113
114
  },
114
115
  get children() {
115
- return o(A, {
116
+ return n(O, {
116
117
  get class() {
117
- return u(C[d()].icon, "transition-transform duration-[var(--floe-duration-fast)]");
118
+ return d(C[u()].icon, "transition-transform duration-[var(--floe-duration-fast)]");
118
119
  }
119
120
  });
120
121
  }
121
122
  }), null), f((r) => {
122
- var n = c() || e.indeterminate ? "true" : void 0, a = u("rounded-xs border-2 transition-[background-color,border-color,color,transform] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", "flex items-center justify-center", C[d()].box, c() || e.indeterminate ? "border-primary bg-primary text-primary-foreground" : "border-[var(--floe-control-edge)] bg-transparent hover:border-[var(--floe-control-edge-hover)]", k() && "cursor-not-allowed");
123
- return n !== r.e && m(t, "data-floe-selected", r.e = n), a !== r.t && b(t, r.t = a), r;
123
+ var o = c() || e.indeterminate ? "true" : void 0, l = d("rounded-xs border-2 transition-[background-color,border-color,color,transform] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", "flex items-center justify-center", C[u()].box, c() || e.indeterminate ? "border-primary bg-primary text-primary-foreground" : "border-[var(--floe-control-edge)] bg-transparent hover:border-[var(--floe-control-edge-hover)]", k() && "cursor-not-allowed");
124
+ return o !== r.e && m(t, "data-floe-selected", r.e = o), l !== r.t && g(t, r.t = l), r;
124
125
  }, {
125
126
  e: void 0,
126
127
  t: void 0
127
128
  }), t;
128
- })(), z = (t) => {
129
+ })(), I = (t) => {
129
130
  let r;
130
- return O(() => {
131
+ return Q(() => {
131
132
  r && (r.indeterminate = e.indeterminate ?? !1);
132
133
  }), (() => {
133
- var n = Y();
134
- return N((a) => {
135
- r = a, typeof e.ref == "function" && e.ref(a);
136
- }, n), n.addEventListener("change", H), D(n, M({
134
+ var o = ee();
135
+ return N((l) => {
136
+ r = l, typeof e.ref == "function" && e.ref(l);
137
+ }, o), A(o, B(s, {
138
+ "data-floe-choice-input": "",
139
+ type: "checkbox",
137
140
  get id() {
138
- return j();
141
+ return h();
139
142
  },
140
143
  get value() {
141
144
  return e.value;
@@ -144,62 +147,66 @@ function fe(w) {
144
147
  return c();
145
148
  },
146
149
  get "aria-checked"() {
147
- return E(() => !!e.indeterminate)() ? "mixed" : c();
150
+ return G(() => !!e.indeterminate)() ? "mixed" : c();
148
151
  },
149
152
  get disabled() {
150
153
  return k();
151
154
  },
155
+ onClick: (l) => {
156
+ (x.readOnly ?? s.readOnly) && l.preventDefault();
157
+ },
158
+ onChange: H,
152
159
  get class() {
153
160
  return t.class ?? "sr-only peer";
154
161
  }
155
- }, g), !1, !1), n;
162
+ }, M), !1, !1), o;
156
163
  })();
157
164
  };
158
- return o(V, {
165
+ return n(V, {
159
166
  get children() {
160
- return [o(S, {
167
+ return [n(j, {
161
168
  get when() {
162
- return x() === "default";
169
+ return w() === "default";
163
170
  },
164
171
  get children() {
165
- var t = ee(), r = t.firstChild;
166
- return l(r, o(z, {}), null), l(r, o(L, {}), null), l(t, o(p, {
172
+ var t = te(), r = t.firstChild;
173
+ return a(r, n(I, {}), null), a(r, n(q, {}), null), a(t, n(b, {
167
174
  get when() {
168
175
  return e.label || e.description;
169
176
  },
170
177
  get children() {
171
- var n = Z();
172
- return l(n, o(p, {
178
+ var o = re();
179
+ return a(o, n(b, {
173
180
  get when() {
174
181
  return e.label;
175
182
  },
176
183
  get children() {
177
- var a = _();
178
- return l(a, () => e.label), f(() => b(a, u("text-foreground", C[d()].label))), a;
184
+ var l = $();
185
+ return a(l, () => e.label), f(() => g(l, d("text-foreground", C[u()].label))), l;
179
186
  }
180
- }), null), l(n, o(p, {
187
+ }), null), a(o, n(b, {
181
188
  get when() {
182
189
  return e.description;
183
190
  },
184
191
  get children() {
185
- var a = _();
186
- return l(a, () => e.description), f(() => b(a, u("text-[var(--floe-ink-soft)]", C[d()].description))), a;
192
+ var l = $();
193
+ return a(l, () => e.description), f(() => g(l, d("text-[var(--floe-ink-soft)]", C[u()].description))), l;
187
194
  }
188
- }), null), n;
195
+ }), null), o;
189
196
  }
190
- }), null), f(() => b(t, u("inline-flex items-start gap-2 cursor-pointer select-none", k() && "opacity-50 cursor-not-allowed", e.class))), t;
197
+ }), null), f(() => g(t, d("inline-flex items-start gap-2 cursor-pointer select-none", k() && "opacity-50 cursor-not-allowed", e.class))), t;
191
198
  }
192
- }), o(S, {
199
+ }), n(j, {
193
200
  get when() {
194
- return x() === "button";
201
+ return w() === "button";
195
202
  },
196
203
  get children() {
197
- var t = re(), r = t.firstChild;
198
- return l(t, o(z, {
204
+ var t = ne(), r = t.firstChild;
205
+ return a(t, n(I, {
199
206
  class: "sr-only"
200
- }), r), l(r, () => e.label), f((n) => {
201
- var a = c() ? "inset" : "raised", s = c() ? "true" : void 0, y = x(), $ = u("cursor-pointer select-none transition-colors duration-[var(--floe-duration-fast)]", "border-r border-[var(--floe-line)] last:border-r-0", se[d()], c() ? "bg-[var(--primary)] text-[var(--primary-foreground)] border-[var(--primary)]" : "bg-transparent text-[var(--floe-ink-soft)] hover:bg-[var(--floe-state-hover)] hover:text-[var(--floe-ink)]", k() && "opacity-50 cursor-not-allowed", e.class);
202
- return a !== n.e && m(t, "data-floe-surface", n.e = a), s !== n.t && m(t, "data-floe-selected", n.t = s), y !== n.a && m(t, "data-floe-choice-variant", n.a = y), $ !== n.o && b(t, n.o = $), n;
207
+ }), r), a(r, () => e.label), f((o) => {
208
+ var l = c() ? "inset" : "raised", i = c() ? "true" : void 0, _ = w(), z = d("cursor-pointer select-none transition-colors duration-[var(--floe-duration-fast)]", "border-r border-[var(--floe-line)] last:border-r-0", de[u()], c() ? "bg-[var(--primary)] text-[var(--primary-foreground)] border-[var(--primary)]" : "bg-transparent text-[var(--floe-ink-soft)] hover:bg-[var(--floe-state-hover)] hover:text-[var(--floe-ink)]", k() && "opacity-50 cursor-not-allowed", e.class);
209
+ return l !== o.e && m(t, "data-floe-surface", o.e = l), i !== o.t && m(t, "data-floe-selected", o.t = i), _ !== o.a && m(t, "data-floe-choice-variant", o.a = _), z !== o.o && g(t, o.o = z), o;
203
210
  }, {
204
211
  e: void 0,
205
212
  t: void 0,
@@ -207,40 +214,40 @@ function fe(w) {
207
214
  o: void 0
208
215
  }), t;
209
216
  }
210
- }), o(S, {
217
+ }), n(j, {
211
218
  get when() {
212
- return x() === "card";
219
+ return w() === "card";
213
220
  },
214
221
  get children() {
215
- var t = ne(), r = t.firstChild, n = r.firstChild, a = n.nextSibling;
216
- return l(t, o(z, {
222
+ var t = le(), r = t.firstChild, o = r.firstChild, l = o.nextSibling;
223
+ return a(t, n(I, {
217
224
  class: "sr-only"
218
- }), r), l(n, o(L, {})), l(a, o(p, {
225
+ }), r), a(o, n(q, {})), a(l, n(b, {
219
226
  get when() {
220
227
  return e.label;
221
228
  },
222
229
  get children() {
223
- var s = _();
224
- return l(s, () => e.label), f(() => b(s, u("font-medium text-foreground", C[d()].label))), s;
230
+ var i = $();
231
+ return a(i, () => e.label), f(() => g(i, d("font-medium text-foreground", C[u()].label))), i;
225
232
  }
226
- }), null), l(a, o(p, {
233
+ }), null), a(l, n(b, {
227
234
  get when() {
228
235
  return e.description;
229
236
  },
230
237
  get children() {
231
- var s = _();
232
- return l(s, () => e.description), f(() => b(s, u("text-[var(--floe-ink-soft)] mt-0.5", C[d()].description))), s;
238
+ var i = $();
239
+ return a(i, () => e.description), f(() => g(i, d("text-[var(--floe-ink-soft)] mt-0.5", C[u()].description))), i;
233
240
  }
234
- }), null), l(t, o(p, {
241
+ }), null), a(t, n(b, {
235
242
  get when() {
236
243
  return c();
237
244
  },
238
245
  get children() {
239
- return te();
246
+ return oe();
240
247
  }
241
- }), null), f((s) => {
242
- var y = c() ? "inset" : "raised", $ = c() ? "true" : void 0, P = x(), q = u("relative cursor-pointer select-none rounded-group border transition-[background-color,border-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", ce[d()], c() ? "border-[var(--floe-accent-line)] bg-[var(--floe-state-selected)]" : "border-[var(--floe-line)] bg-transparent hover:border-[var(--floe-line-strong)] hover:bg-[var(--floe-state-hover)]", k() && "opacity-50 cursor-not-allowed", e.class);
243
- return y !== s.e && m(t, "data-floe-surface", s.e = y), $ !== s.t && m(t, "data-floe-selected", s.t = $), P !== s.a && m(t, "data-floe-choice-variant", s.a = P), q !== s.o && b(t, s.o = q), s;
248
+ }), null), f((i) => {
249
+ var _ = c() ? "inset" : "raised", z = c() ? "true" : void 0, D = w(), F = d("relative cursor-pointer select-none rounded-group border transition-[background-color,border-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", ue[u()], c() ? "border-[var(--floe-accent-line)] bg-[var(--floe-state-selected)]" : "border-[var(--floe-line)] bg-transparent hover:border-[var(--floe-line-strong)] hover:bg-[var(--floe-state-hover)]", k() && "opacity-50 cursor-not-allowed", e.class);
250
+ return _ !== i.e && m(t, "data-floe-surface", i.e = _), z !== i.t && m(t, "data-floe-selected", i.t = z), D !== i.a && m(t, "data-floe-choice-variant", i.a = D), F !== i.o && g(t, i.o = F), i;
244
251
  }, {
245
252
  e: void 0,
246
253
  t: void 0,
@@ -248,58 +255,58 @@ function fe(w) {
248
255
  o: void 0
249
256
  }), t;
250
257
  }
251
- }), o(S, {
258
+ }), n(j, {
252
259
  get when() {
253
- return x() === "tile";
260
+ return w() === "tile";
254
261
  },
255
262
  get children() {
256
- var t = le();
257
- return l(t, o(z, {
263
+ var t = ie();
264
+ return a(t, n(I, {
258
265
  class: "sr-only"
259
- }), null), l(t, o(p, {
266
+ }), null), a(t, n(b, {
260
267
  get when() {
261
268
  return e.icon;
262
269
  },
263
270
  children: (r) => {
264
- const n = r();
271
+ const o = r();
265
272
  return (() => {
266
- var a = ae();
267
- return l(a, o(n, {
273
+ var l = se();
274
+ return a(l, n(o, {
268
275
  get class() {
269
- return G[d()].icon;
276
+ return L[u()].icon;
270
277
  }
271
- })), f(() => b(a, u("mb-2 transition-colors duration-[var(--floe-duration-fast)]", c() ? "text-[var(--floe-accent-ink)]" : "text-[var(--floe-ink-quiet)]"))), a;
278
+ })), f(() => g(l, d("mb-2 transition-colors duration-[var(--floe-duration-fast)]", c() ? "text-[var(--floe-accent-ink)]" : "text-[var(--floe-ink-quiet)]"))), l;
272
279
  })();
273
280
  }
274
- }), null), l(t, o(p, {
281
+ }), null), a(t, n(b, {
275
282
  get when() {
276
283
  return e.label;
277
284
  },
278
285
  get children() {
279
- var r = _();
280
- return l(r, () => e.label), f(() => b(r, u("font-medium transition-colors duration-[var(--floe-duration-fast)]", C[d()].label, c() ? "text-[var(--floe-ink)]" : "text-[var(--floe-ink-soft)]"))), r;
286
+ var r = $();
287
+ return a(r, () => e.label), f(() => g(r, d("font-medium transition-colors duration-[var(--floe-duration-fast)]", C[u()].label, c() ? "text-[var(--floe-ink)]" : "text-[var(--floe-ink-soft)]"))), r;
281
288
  }
282
- }), null), l(t, o(p, {
289
+ }), null), a(t, n(b, {
283
290
  get when() {
284
291
  return e.description;
285
292
  },
286
293
  get children() {
287
- var r = _();
288
- return l(r, () => e.description), f(() => b(r, u("text-[var(--floe-ink-soft)] mt-0.5", C[d()].description))), r;
294
+ var r = $();
295
+ return a(r, () => e.description), f(() => g(r, d("text-[var(--floe-ink-soft)] mt-0.5", C[u()].description))), r;
289
296
  }
290
- }), null), l(t, o(p, {
297
+ }), null), a(t, n(b, {
291
298
  get when() {
292
299
  return c();
293
300
  },
294
301
  get children() {
295
- var r = oe(), n = r.firstChild;
296
- return l(n, o(A, {
302
+ var r = ae(), o = r.firstChild;
303
+ return a(o, n(O, {
297
304
  class: "w-2.5 h-2.5 text-primary-foreground"
298
305
  })), r;
299
306
  }
300
307
  }), null), f((r) => {
301
- var n = c() ? "inset" : "raised", a = c() ? "true" : void 0, s = x(), y = u("relative flex flex-col items-center justify-center cursor-pointer select-none", "rounded-control border transition-[background-color,border-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)] text-center", G[d()].container, c() ? "border-[var(--floe-accent-line)] bg-[var(--floe-state-selected)]" : "border-[var(--floe-line)] bg-transparent hover:border-[var(--floe-line-strong)] hover:bg-[var(--floe-state-hover)]", k() && "opacity-50 cursor-not-allowed", e.class);
302
- return n !== r.e && m(t, "data-floe-surface", r.e = n), a !== r.t && m(t, "data-floe-selected", r.t = a), s !== r.a && m(t, "data-floe-choice-variant", r.a = s), y !== r.o && b(t, r.o = y), r;
308
+ var o = c() ? "inset" : "raised", l = c() ? "true" : void 0, i = w(), _ = d("relative flex flex-col items-center justify-center cursor-pointer select-none", "rounded-control border transition-[background-color,border-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)] text-center", L[u()].container, c() ? "border-[var(--floe-accent-line)] bg-[var(--floe-state-selected)]" : "border-[var(--floe-line)] bg-transparent hover:border-[var(--floe-line-strong)] hover:bg-[var(--floe-state-hover)]", k() && "opacity-50 cursor-not-allowed", e.class);
309
+ return o !== r.e && m(t, "data-floe-surface", r.e = o), l !== r.t && m(t, "data-floe-selected", r.t = l), i !== r.a && m(t, "data-floe-choice-variant", r.a = i), _ !== r.o && g(t, r.o = _), r;
303
310
  }, {
304
311
  e: void 0,
305
312
  t: void 0,
@@ -311,29 +318,29 @@ function fe(w) {
311
318
  }
312
319
  });
313
320
  }
314
- function be(w) {
315
- const [i, e] = B(w, ["options"]);
316
- return o(ue, M(e, {
321
+ function xe(x) {
322
+ const [s, p] = P(x, ["options"]);
323
+ return n(ve, B(p, {
317
324
  get children() {
318
- return o(J, {
325
+ return n(J, {
319
326
  get each() {
320
- return i.options;
327
+ return s.options;
321
328
  },
322
- children: (g) => o(fe, {
329
+ children: (e) => n(he, {
323
330
  get value() {
324
- return g.value;
331
+ return e.value;
325
332
  },
326
333
  get label() {
327
- return g.label;
334
+ return e.label;
328
335
  },
329
336
  get description() {
330
- return g.description;
337
+ return e.description;
331
338
  },
332
339
  get icon() {
333
- return g.icon;
340
+ return e.icon;
334
341
  },
335
342
  get disabled() {
336
- return g.disabled;
343
+ return e.disabled;
337
344
  }
338
345
  })
339
346
  });
@@ -341,7 +348,7 @@ function be(w) {
341
348
  }));
342
349
  }
343
350
  export {
344
- fe as Checkbox,
345
- ue as CheckboxGroup,
346
- be as CheckboxList
351
+ he as Checkbox,
352
+ ve as CheckboxGroup,
353
+ xe as CheckboxList
347
354
  };
@@ -0,0 +1,33 @@
1
+ import { type JSX } from 'solid-js';
2
+ import type { TableSort } from './dataTableModel';
3
+ export interface DataTableColumn<T> {
4
+ id: string;
5
+ header: string;
6
+ cell: (row: T) => JSX.Element;
7
+ sortable?: boolean;
8
+ class?: string;
9
+ }
10
+ export interface DataTableProps<T> {
11
+ /** Rows are already filtered, sorted and paginated by the host or createTableModel. */
12
+ rows: readonly T[];
13
+ columns: readonly DataTableColumn<T>[];
14
+ rowKey: (row: T) => string;
15
+ ariaLabel: string;
16
+ caption?: string;
17
+ sort?: TableSort;
18
+ onSortChange?: (sort: TableSort) => void;
19
+ selectedKeys?: readonly string[];
20
+ onSelectionChange?: (keys: string[]) => void;
21
+ isRowSelectable?: (row: T) => boolean;
22
+ rowLabel?: (row: T) => string;
23
+ hiddenColumns?: readonly string[];
24
+ loading?: boolean;
25
+ error?: string;
26
+ onRetry?: () => void;
27
+ empty?: JSX.Element;
28
+ /** Product-owned search, column visibility and bulk actions. */
29
+ toolbar?: JSX.Element;
30
+ pagination?: JSX.Element;
31
+ class?: string;
32
+ }
33
+ export declare function DataTable<T>(props: DataTableProps<T>): JSX.Element;