@wealth-os/design-system 0.0.0-stage → 0.2.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 (63) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/LICENSE +201 -0
  3. package/README.md +89 -2
  4. package/dist/button-yvMc7CT-.js +47 -0
  5. package/dist/charts.d.ts +138 -0
  6. package/dist/charts.js +712 -0
  7. package/dist/command-menu.d.ts +3 -0
  8. package/dist/command-menu.js +53 -0
  9. package/dist/components/advanced-controls.d.ts +145 -0
  10. package/dist/components/badge.d.ts +9 -0
  11. package/dist/components/button-group.d.ts +15 -0
  12. package/dist/components/button.d.ts +14 -0
  13. package/dist/components/command-menu.d.ts +42 -0
  14. package/dist/components/data-display.d.ts +100 -0
  15. package/dist/components/data-table.d.ts +113 -0
  16. package/dist/components/date-input.d.ts +36 -0
  17. package/dist/components/date-range-picker.d.ts +23 -0
  18. package/dist/components/field.d.ts +18 -0
  19. package/dist/components/financial.d.ts +83 -0
  20. package/dist/components/form.d.ts +8 -0
  21. package/dist/components/icon-button.d.ts +11 -0
  22. package/dist/components/icons.d.ts +9 -0
  23. package/dist/components/navigation.d.ts +53 -0
  24. package/dist/components/notice.d.ts +11 -0
  25. package/dist/components/number-input.d.ts +44 -0
  26. package/dist/components/overlays.d.ts +91 -0
  27. package/dist/components/select-menu.d.ts +27 -0
  28. package/dist/components/select.d.ts +23 -0
  29. package/dist/components/status-badge.d.ts +9 -0
  30. package/dist/components/surface.d.ts +16 -0
  31. package/dist/components/text-input.d.ts +8 -0
  32. package/dist/components/textarea.d.ts +7 -0
  33. package/dist/components/validation-message.d.ts +8 -0
  34. package/dist/data-display-BA7t1E4G.js +278 -0
  35. package/dist/data-table.d.ts +2 -0
  36. package/dist/data-table.js +346 -0
  37. package/dist/financial.d.ts +1 -0
  38. package/dist/financial.js +178 -0
  39. package/dist/form-Csxly6Es.js +74 -0
  40. package/dist/forms.d.ts +39 -0
  41. package/dist/forms.js +32 -0
  42. package/dist/index.d.ts +23 -0
  43. package/dist/index.js +1411 -0
  44. package/dist/lib/control-density.d.ts +3 -0
  45. package/dist/lib/utils.d.ts +3 -0
  46. package/dist/navigation.d.ts +3 -0
  47. package/dist/navigation.js +224 -0
  48. package/dist/notice-jbY9FQu_.js +49 -0
  49. package/dist/overlays-BleXRtz6.js +219 -0
  50. package/dist/overlays.d.ts +7 -0
  51. package/dist/overlays.js +2 -0
  52. package/dist/reset.css +16 -0
  53. package/dist/styles.css +3 -0
  54. package/dist/tokens.css +157 -0
  55. package/dist/utils-CX-Pz5p6.js +8 -0
  56. package/docs/accessibility.md +154 -0
  57. package/docs/charts.md +47 -0
  58. package/docs/components.md +296 -0
  59. package/docs/data-table.md +87 -0
  60. package/docs/layout-composition.md +224 -0
  61. package/docs/migration.md +91 -0
  62. package/docs/tokens.md +170 -0
  63. package/package.json +118 -4
@@ -0,0 +1,278 @@
1
+ import { t as e } from "./utils-CX-Pz5p6.js";
2
+ import * as t from "react";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ //#region src/components/data-display.tsx
5
+ var i = t.forwardRef(({ className: t, density: r = "comfortable", ...i }, a) => /* @__PURE__ */ n("div", {
6
+ className: "wos-table-scroll",
7
+ role: "region",
8
+ "aria-label": i["aria-label"],
9
+ tabIndex: 0,
10
+ children: /* @__PURE__ */ n("table", {
11
+ ref: a,
12
+ "data-density": r,
13
+ className: e("wos-table", t),
14
+ ...i
15
+ })
16
+ }));
17
+ i.displayName = "Table";
18
+ var a = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("thead", {
19
+ ref: i,
20
+ className: e("wos-table-header", t),
21
+ ...r
22
+ }));
23
+ a.displayName = "TableHeader";
24
+ var o = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("tbody", {
25
+ ref: i,
26
+ className: e("wos-table-body", t),
27
+ ...r
28
+ }));
29
+ o.displayName = "TableBody";
30
+ var s = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("tfoot", {
31
+ ref: i,
32
+ className: e("wos-table-footer", t),
33
+ ...r
34
+ }));
35
+ s.displayName = "TableFooter";
36
+ var c = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("tr", {
37
+ ref: i,
38
+ className: e("wos-table-row", t),
39
+ ...r
40
+ }));
41
+ c.displayName = "TableRow";
42
+ var l = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("th", {
43
+ ref: i,
44
+ scope: "col",
45
+ className: e("wos-table-head", t),
46
+ ...r
47
+ }));
48
+ l.displayName = "TableHead";
49
+ var u = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("td", {
50
+ ref: i,
51
+ className: e("wos-table-cell", t),
52
+ ...r
53
+ }));
54
+ u.displayName = "TableCell";
55
+ var d = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("caption", {
56
+ ref: i,
57
+ className: e("wos-table-caption", t),
58
+ ...r
59
+ }));
60
+ d.displayName = "TableCaption";
61
+ function f({ src: r, alt: i = "", fallback: a, size: o = "md", className: s, ...c }) {
62
+ let [l, u] = t.useState(!1);
63
+ t.useEffect(() => u(!1), [r]);
64
+ let d = !r || l;
65
+ return /* @__PURE__ */ n("span", {
66
+ role: d && i ? "img" : void 0,
67
+ "aria-label": d && i ? i : void 0,
68
+ className: e("wos-avatar", `wos-avatar-${o}`, s),
69
+ ...c,
70
+ children: d ? /* @__PURE__ */ n("span", {
71
+ "aria-hidden": "true",
72
+ children: a ?? i.slice(0, 2).toUpperCase()
73
+ }) : /* @__PURE__ */ n("img", {
74
+ src: r,
75
+ alt: i,
76
+ onError: () => u(!0)
77
+ })
78
+ });
79
+ }
80
+ function p({ max: n = 4, label: i = "People", className: a, children: o, ...s }) {
81
+ let c = t.Children.toArray(o), l = c.slice(0, Math.max(0, n));
82
+ return /* @__PURE__ */ r("div", {
83
+ role: "group",
84
+ "aria-label": i,
85
+ className: e("wos-avatar-group", a),
86
+ ...s,
87
+ children: [l, c.length > l.length && /* @__PURE__ */ r("span", {
88
+ className: "wos-avatar wos-avatar-md wos-avatar-overflow",
89
+ "aria-label": `${c.length - l.length} more`,
90
+ children: ["+", c.length - l.length]
91
+ })]
92
+ });
93
+ }
94
+ function m({ columns: t = 1, className: r, ...i }) {
95
+ return /* @__PURE__ */ n("dl", {
96
+ className: e("wos-description-list", `wos-description-list-${t}`, r),
97
+ ...i
98
+ });
99
+ }
100
+ function h({ label: t, value: i, className: a, ...o }) {
101
+ return /* @__PURE__ */ r("div", {
102
+ className: e("wos-key-value", a),
103
+ ...o,
104
+ children: [/* @__PURE__ */ n("dt", { children: t }), /* @__PURE__ */ n("dd", { children: i })]
105
+ });
106
+ }
107
+ function g({ density: t = "comfortable", className: r, ...i }) {
108
+ return /* @__PURE__ */ n("ul", {
109
+ className: e("wos-data-list", `wos-data-list-${t}`, r),
110
+ ...i
111
+ });
112
+ }
113
+ function _({ title: t, description: i, action: a, icon: o, className: s, ...c }) {
114
+ return /* @__PURE__ */ r("div", {
115
+ className: e("wos-empty-state", s),
116
+ ...c,
117
+ children: [
118
+ /* @__PURE__ */ n("div", {
119
+ className: "wos-empty-icon",
120
+ "aria-hidden": "true",
121
+ children: o ?? "—"
122
+ }),
123
+ /* @__PURE__ */ n("h3", { children: t }),
124
+ i && /* @__PURE__ */ n("p", { children: i }),
125
+ a
126
+ ]
127
+ });
128
+ }
129
+ function v({ width: t, height: r, circle: i, className: a, style: o, ...s }) {
130
+ return /* @__PURE__ */ n("div", {
131
+ "aria-hidden": "true",
132
+ className: e("wos-skeleton", i && "wos-skeleton-circle", a),
133
+ style: {
134
+ width: t,
135
+ height: r,
136
+ ...o
137
+ },
138
+ ...s
139
+ });
140
+ }
141
+ function y({ value: t, max: i = 100, label: a, showValue: o = !1, className: s, ...c }) {
142
+ let l = i > 0 ? i : 100, u = t == null ? void 0 : Math.min(l, Math.max(0, t));
143
+ return /* @__PURE__ */ r("div", {
144
+ className: e("wos-progress-wrap", s),
145
+ ...c,
146
+ children: [/* @__PURE__ */ n("div", {
147
+ className: "wos-progress",
148
+ role: "progressbar",
149
+ "aria-label": a,
150
+ "aria-valuemin": 0,
151
+ "aria-valuemax": l,
152
+ "aria-valuenow": u,
153
+ "aria-valuetext": u == null ? "Loading" : `${Math.round(u / l * 100)}%`,
154
+ children: /* @__PURE__ */ n("span", {
155
+ className: u == null ? "wos-progress-indeterminate" : "",
156
+ style: u == null ? void 0 : { width: `${u / l * 100}%` }
157
+ })
158
+ }), o && u != null && /* @__PURE__ */ r("span", {
159
+ className: "type-metadata tabular",
160
+ children: [Math.round(u / l * 100), "%"]
161
+ })]
162
+ });
163
+ }
164
+ function b({ value: t, max: i = 100, label: a, size: o = 40, strokeWidth: s = 4, className: c, ...l }) {
165
+ let u = i > 0 ? i : 100, d = t == null ? void 0 : Math.min(u, Math.max(0, t)) / u, f = (o - s) / 2, p = 2 * Math.PI * f;
166
+ return /* @__PURE__ */ n("div", {
167
+ className: e("wos-circular-progress", c),
168
+ role: "progressbar",
169
+ "aria-label": a,
170
+ "aria-valuemin": 0,
171
+ "aria-valuemax": u,
172
+ "aria-valuenow": t == null ? void 0 : Math.min(u, Math.max(0, t)),
173
+ "aria-valuetext": d == null ? "Loading" : `${Math.round(d * 100)}%`,
174
+ style: {
175
+ width: o,
176
+ height: o
177
+ },
178
+ ...l,
179
+ children: /* @__PURE__ */ r("svg", {
180
+ viewBox: `0 0 ${o} ${o}`,
181
+ "aria-hidden": "true",
182
+ children: [/* @__PURE__ */ n("circle", {
183
+ className: "wos-circular-track",
184
+ cx: o / 2,
185
+ cy: o / 2,
186
+ r: f,
187
+ strokeWidth: s
188
+ }), /* @__PURE__ */ n("circle", {
189
+ className: "wos-circular-value",
190
+ cx: o / 2,
191
+ cy: o / 2,
192
+ r: f,
193
+ strokeWidth: s,
194
+ strokeDasharray: p,
195
+ strokeDashoffset: d == null ? p * .72 : p * (1 - d)
196
+ })]
197
+ })
198
+ });
199
+ }
200
+ function x({ orientation: t = "horizontal", className: r, ...i }) {
201
+ return t === "vertical" ? /* @__PURE__ */ n("span", {
202
+ role: "separator",
203
+ "aria-orientation": "vertical",
204
+ className: e("wos-separator-vertical", r),
205
+ ...i
206
+ }) : /* @__PURE__ */ n("hr", {
207
+ className: e("wos-separator", r),
208
+ ...i
209
+ });
210
+ }
211
+ function S({ orientation: t = "both", className: r, ...i }) {
212
+ return /* @__PURE__ */ n("div", {
213
+ "data-orientation": t,
214
+ className: e("wos-scroll-area", r),
215
+ ...i
216
+ });
217
+ }
218
+ function C({ ratio: t = 1, className: r, style: i, ...a }) {
219
+ return /* @__PURE__ */ n("div", {
220
+ className: e("wos-aspect-ratio", r),
221
+ style: {
222
+ aspectRatio: t,
223
+ ...i
224
+ },
225
+ ...a
226
+ });
227
+ }
228
+ function w({ label: t, value: i, detail: a, trend: o, className: s, ...c }) {
229
+ return /* @__PURE__ */ r("div", {
230
+ className: e("wos-stat", s),
231
+ ...c,
232
+ children: [
233
+ /* @__PURE__ */ n("div", {
234
+ className: "type-caption text-muted-foreground",
235
+ children: t
236
+ }),
237
+ /* @__PURE__ */ n("div", {
238
+ className: "wos-stat-value tabular",
239
+ children: i
240
+ }),
241
+ (a || o) && /* @__PURE__ */ r("div", {
242
+ className: "wos-stat-meta",
243
+ children: [a, o && /* @__PURE__ */ n("span", { children: o })]
244
+ })
245
+ ]
246
+ });
247
+ }
248
+ function T({ icon: t, className: i, ...a }) {
249
+ return /* @__PURE__ */ r("section", {
250
+ className: e("wos-metric-card", i),
251
+ children: [/* @__PURE__ */ n(w, { ...a }), /* @__PURE__ */ n("span", {
252
+ className: "wos-metric-icon",
253
+ "aria-hidden": "true",
254
+ children: t
255
+ })]
256
+ });
257
+ }
258
+ function E({ items: t, className: i, ...a }) {
259
+ return /* @__PURE__ */ n("ol", {
260
+ className: e("wos-timeline", i),
261
+ ...a,
262
+ children: t.map((e, t) => /* @__PURE__ */ r("li", {
263
+ "data-status": e.status ?? "upcoming",
264
+ children: [/* @__PURE__ */ n("span", {
265
+ className: "wos-timeline-marker",
266
+ "aria-hidden": "true"
267
+ }), /* @__PURE__ */ r("div", { children: [/* @__PURE__ */ r("div", {
268
+ className: "wos-timeline-heading",
269
+ children: [e.title, e.date && /* @__PURE__ */ n("time", {
270
+ className: "type-metadata text-muted-foreground",
271
+ children: e.date
272
+ })]
273
+ }), e.description && /* @__PURE__ */ n("p", { children: e.description })] })]
274
+ }, e.id ?? t))
275
+ });
276
+ }
277
+ //#endregion
278
+ export { E as C, c as S, d as _, g as a, l as b, h as c, S as d, x as f, o as g, i as h, b as i, T as l, w as m, f as n, m as o, v as p, p as r, _ as s, C as t, y as u, u as v, a as x, s as y };
@@ -0,0 +1,2 @@
1
+ import "./styles.css";
2
+ export { DataTable, createDataTableColumnHelper, type DataTableProps, type DataTableColumn, type DataTableState } from "./components/data-table";
@@ -0,0 +1,346 @@
1
+ /* empty css */
2
+ import { t as e } from "./button-yvMc7CT-.js";
3
+ import { t } from "./utils-CX-Pz5p6.js";
4
+ import { S as n, b as r, g as ee, h as te, p as ne, s as re, v as i, x as ie } from "./data-display-BA7t1E4G.js";
5
+ import { K as a, X as o, Y as s } from "./overlays-BleXRtz6.js";
6
+ import * as c from "react";
7
+ import { Fragment as ae, jsx as l, jsxs as u } from "react/jsx-runtime";
8
+ import { columnFilteringFeature as d, columnPinningFeature as f, columnResizingFeature as p, columnSizingFeature as m, columnVisibilityFeature as h, createColumnHelper as g, createCoreRowModel as _, createExpandedRowModel as v, createFilteredRowModel as y, createPaginatedRowModel as b, createSortedRowModel as x, filterFn_includesString as S, globalFilteringFeature as C, rowExpandingFeature as w, rowPaginationFeature as T, rowSelectionFeature as E, rowSortingFeature as D, sortFn_alphanumeric as O, sortFn_text as k, tableFeatures as A, useTable as oe } from "@tanstack/react-table";
9
+ //#region src/components/data-table.tsx
10
+ var se = A({
11
+ rowSortingFeature: D,
12
+ columnFilteringFeature: d,
13
+ globalFilteringFeature: C,
14
+ rowPaginationFeature: T,
15
+ rowSelectionFeature: E,
16
+ columnVisibilityFeature: h,
17
+ columnSizingFeature: m,
18
+ columnResizingFeature: p,
19
+ columnPinningFeature: f,
20
+ rowExpandingFeature: w,
21
+ coreRowModel: _(),
22
+ filteredRowModel: y(),
23
+ sortedRowModel: x(),
24
+ paginatedRowModel: b(),
25
+ expandedRowModel: v(),
26
+ sortFns: {
27
+ alphanumeric: O,
28
+ text: k
29
+ },
30
+ filterFns: { includesString: S }
31
+ });
32
+ function j() {
33
+ return g();
34
+ }
35
+ function M(e) {
36
+ return "columns" in e && Array.isArray(e.columns) ? {
37
+ ...e,
38
+ columns: e.columns.map((e) => M(e))
39
+ } : "accessorKey" in e || "accessorFn" in e ? {
40
+ ...e,
41
+ filterFn: e.filterFn ?? "includesString"
42
+ } : e;
43
+ }
44
+ function N({ columns: d, data: f, getRowId: p, density: m = "comfortable", caption: h, ariaLabel: g = "Data table", enableSorting: _ = !0, enableFiltering: v = !0, enableGlobalFilter: y = !0, enablePagination: b = !0, enableRowSelection: x = !1, enableColumnVisibility: S = !1, enableColumnResizing: C = !1, enableColumnPinning: w = !1, enableExpanding: T = !1, renderSubComponent: E, loading: D = !1, loadingLabel: O = "Loading data", error: k, emptyState: A, pageSizeOptions: j = [
45
+ 10,
46
+ 20,
47
+ 50
48
+ ], manualSorting: N = !1, manualFiltering: ce = !1, manualPagination: le = !1, pageCount: P, rowCount: F, state: ue, initialState: I, onSortingChange: L, onColumnFiltersChange: R, onGlobalFilterChange: z, onPaginationChange: B, onRowSelectionChange: V, onColumnVisibilityChange: H, onColumnSizingChange: U, onColumnPinningChange: W, onExpandedChange: G, className: de, toolbar: K }) {
49
+ let fe = c.useMemo(() => d.map(M), [d]), q = oe({
50
+ features: se,
51
+ columns: fe,
52
+ data: f ?? [],
53
+ ...p ? { getRowId: p } : {},
54
+ ...I ? { initialState: I } : {},
55
+ ...ue ? { state: ue } : {},
56
+ ...L ? { onSortingChange: L } : {},
57
+ ...R ? { onColumnFiltersChange: R } : {},
58
+ ...z ? { onGlobalFilterChange: z } : {},
59
+ ...B ? { onPaginationChange: B } : {},
60
+ ...V ? { onRowSelectionChange: V } : {},
61
+ ...H ? { onColumnVisibilityChange: H } : {},
62
+ ...U ? { onColumnSizingChange: U } : {},
63
+ ...W ? { onColumnPinningChange: W } : {},
64
+ ...G ? { onExpandedChange: G } : {},
65
+ manualSorting: N,
66
+ manualFiltering: ce,
67
+ ...P == null ? {} : { pageCount: P },
68
+ ...F == null ? {} : { rowCount: F },
69
+ enableRowSelection: x,
70
+ enableSorting: _,
71
+ enableColumnFilters: v,
72
+ enableGlobalFilter: y,
73
+ enableColumnPinning: w,
74
+ enableColumnResizing: C,
75
+ enableExpanding: T,
76
+ getSubRows: (e) => e.subRows,
77
+ getRowCanExpand: () => !!E,
78
+ manualPagination: le || !b
79
+ }), J = q.getRowModel().rows, Y = q.getVisibleLeafColumns(), X = v ? q.getAllLeafColumns().filter((e) => e.getCanFilter()) : [], Z = S ? q.getAllLeafColumns().filter((e) => e.getCanHide()) : [], Q = q.state.columnFilters?.length ?? 0, $ = Object.values(q.state.rowSelection ?? {}).filter(Boolean).length, pe = (e) => e.getIsSorted() === "asc" ? "Sorted ascending" : e.getIsSorted() === "desc" ? "Sorted descending" : "Not sorted";
80
+ return /* @__PURE__ */ u("div", {
81
+ className: t("wos-data-table", de),
82
+ children: [
83
+ (y || X.length > 0 || Z.length > 0 || K) && /* @__PURE__ */ u("div", {
84
+ className: "wos-data-table-toolbar",
85
+ children: [y && /* @__PURE__ */ u("label", {
86
+ className: "wos-data-table-search",
87
+ children: [
88
+ " ",
89
+ /* @__PURE__ */ l("span", {
90
+ className: "sr-only",
91
+ children: "Search all columns"
92
+ }),
93
+ /* @__PURE__ */ l("input", {
94
+ className: "wos-field",
95
+ type: "search",
96
+ value: q.state.globalFilter ?? "",
97
+ onChange: (e) => q.setGlobalFilter(e.target.value),
98
+ placeholder: "Search…"
99
+ })
100
+ ]
101
+ }), /* @__PURE__ */ u("div", {
102
+ className: "wos-data-table-tools",
103
+ children: [
104
+ K,
105
+ X.length > 0 && /* @__PURE__ */ u(a, { children: [/* @__PURE__ */ l(o, {
106
+ asChild: !0,
107
+ children: /* @__PURE__ */ u(e, {
108
+ variant: "outline",
109
+ size: "sm",
110
+ "aria-label": Q > 0 ? `Filters, ${Q} active` : "Filters",
111
+ children: ["Filters", Q > 0 && /* @__PURE__ */ l("span", {
112
+ className: "wos-data-table-filter-count",
113
+ "aria-hidden": "true",
114
+ children: Q
115
+ })]
116
+ })
117
+ }), /* @__PURE__ */ u(s, {
118
+ align: "end",
119
+ "aria-label": "Column filters",
120
+ className: "wos-data-table-filter-menu",
121
+ children: [X.map((e) => /* @__PURE__ */ u("label", { children: [/* @__PURE__ */ u("span", {
122
+ className: "type-metadata",
123
+ children: ["Filter ", e.id]
124
+ }), /* @__PURE__ */ l("input", {
125
+ className: "wos-field",
126
+ "aria-label": `Filter ${e.id}`,
127
+ value: e.getFilterValue() ?? "",
128
+ onChange: (t) => e.setFilterValue(t.target.value)
129
+ })] }, e.id)), Q > 0 && /* @__PURE__ */ l(e, {
130
+ variant: "ghost",
131
+ size: "sm",
132
+ className: "wos-data-table-clear-filters",
133
+ onClick: () => q.resetColumnFilters(),
134
+ children: "Clear filters"
135
+ })]
136
+ })] }),
137
+ Z.length > 0 && /* @__PURE__ */ u(a, { children: [/* @__PURE__ */ l(o, {
138
+ asChild: !0,
139
+ children: /* @__PURE__ */ l(e, {
140
+ variant: "outline",
141
+ size: "sm",
142
+ children: "Columns"
143
+ })
144
+ }), /* @__PURE__ */ l(s, {
145
+ align: "end",
146
+ "aria-label": "Visible columns",
147
+ className: "wos-column-menu",
148
+ children: Z.map((e) => /* @__PURE__ */ u("label", { children: [/* @__PURE__ */ l("input", {
149
+ type: "checkbox",
150
+ checked: e.getIsVisible(),
151
+ onChange: e.getToggleVisibilityHandler()
152
+ }), e.id] }, e.id))
153
+ })] })
154
+ ]
155
+ })]
156
+ }),
157
+ x && $ > 0 && /* @__PURE__ */ u("div", {
158
+ className: "wos-data-table-selection",
159
+ role: "status",
160
+ children: [
161
+ $,
162
+ " row",
163
+ $ === 1 ? "" : "s",
164
+ " selected"
165
+ ]
166
+ }),
167
+ k ? /* @__PURE__ */ l("div", {
168
+ className: "wos-data-table-message",
169
+ role: "alert",
170
+ children: k
171
+ }) : /* @__PURE__ */ u(ae, { children: [/* @__PURE__ */ l("div", {
172
+ className: "wos-data-table-scroller",
173
+ "aria-busy": D || void 0,
174
+ children: D ? /* @__PURE__ */ u("div", {
175
+ role: "status",
176
+ className: "wos-data-table-loading",
177
+ children: [/* @__PURE__ */ l("span", {
178
+ className: "sr-only",
179
+ children: O
180
+ }), Array.from({ length: 4 }, (e, t) => /* @__PURE__ */ l(ne, { height: m === "compact" ? 30 : 42 }, t))]
181
+ }) : /* @__PURE__ */ u(te, {
182
+ density: m,
183
+ "aria-label": g,
184
+ style: {
185
+ width: q.getTotalSize(),
186
+ minWidth: "100%",
187
+ tableLayout: "fixed"
188
+ },
189
+ children: [
190
+ h && /* @__PURE__ */ l("caption", {
191
+ className: "wos-table-caption wos-data-table-caption",
192
+ children: h
193
+ }),
194
+ /* @__PURE__ */ l(ie, { children: q.getHeaderGroups().map((e, t) => /* @__PURE__ */ u(n, { children: [(x || T) && /* @__PURE__ */ l(r, {
195
+ className: "wos-data-table-select-head",
196
+ rowSpan: t === 0 ? q.getHeaderGroups().length : void 0,
197
+ children: x && t === 0 && /* @__PURE__ */ l("input", {
198
+ type: "checkbox",
199
+ "aria-label": "Select rows on this page",
200
+ checked: q.getIsAllPageRowsSelected(),
201
+ ref: (e) => {
202
+ e && (e.indeterminate = q.getIsSomePageRowsSelected());
203
+ },
204
+ onChange: q.getToggleAllPageRowsSelectedHandler()
205
+ })
206
+ }), e.headers.map((e) => /* @__PURE__ */ l(r, {
207
+ scope: "col",
208
+ "aria-sort": e.column.getCanSort() ? e.column.getIsSorted() === "asc" ? "ascending" : e.column.getIsSorted() === "desc" ? "descending" : "none" : void 0,
209
+ style: {
210
+ width: e.getSize(),
211
+ position: e.column.getIsPinned() ? "sticky" : void 0,
212
+ insetInlineStart: e.column.getIsPinned() === "start" ? e.column.getStart("start") : void 0,
213
+ insetInlineEnd: e.column.getIsPinned() === "end" ? e.column.getAfter("end") : void 0
214
+ },
215
+ children: e.isPlaceholder ? null : /* @__PURE__ */ u("div", {
216
+ className: "wos-data-table-heading",
217
+ children: [
218
+ e.column.getCanSort() ? /* @__PURE__ */ u("button", {
219
+ type: "button",
220
+ className: "wos-data-table-sort",
221
+ onClick: () => e.column.toggleSorting(),
222
+ "aria-label": `${String(e.column.columnDef.header ?? e.column.id)}. ${pe(e.column)}. Activate to change sort.`,
223
+ children: [/* @__PURE__ */ l(q.FlexRender, { header: e }), /* @__PURE__ */ l("span", {
224
+ "aria-hidden": "true",
225
+ children: e.column.getIsSorted() === "asc" ? " ↑" : e.column.getIsSorted() === "desc" ? " ↓" : " ↕"
226
+ })]
227
+ }) : /* @__PURE__ */ l(q.FlexRender, { header: e }),
228
+ w && e.column.getCanPin() && /* @__PURE__ */ l("button", {
229
+ className: "wos-data-table-pin",
230
+ type: "button",
231
+ "aria-label": `${e.column.getIsPinned() ? "Unpin" : "Pin"} ${e.column.id} ${e.column.getIsPinned() ? "column" : "column to start"}`,
232
+ onClick: () => e.column.pin(e.column.getIsPinned() !== "start" && "start"),
233
+ children: e.column.getIsPinned() === "start" ? "Unpin" : "Pin"
234
+ }),
235
+ C && e.column.getCanResize() && /* @__PURE__ */ l("button", {
236
+ className: "wos-column-resizer",
237
+ type: "button",
238
+ "aria-label": `Resize ${e.column.id} column`,
239
+ onMouseDown: e.getResizeHandler(),
240
+ onTouchStart: e.getResizeHandler(),
241
+ onKeyDown: (t) => {
242
+ let n = t.key === "ArrowRight" ? 16 : t.key === "ArrowLeft" ? -16 : 0;
243
+ n && (t.preventDefault(), q.setColumnSizing((t) => ({
244
+ ...t,
245
+ [e.column.id]: Math.min(e.column.columnDef.maxSize ?? 800, Math.max(e.column.columnDef.minSize ?? 40, e.column.getSize() + n))
246
+ })));
247
+ }
248
+ })
249
+ ]
250
+ })
251
+ }, e.id))] }, e.id)) }),
252
+ /* @__PURE__ */ l(ee, { children: J.length === 0 ? /* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(i, {
253
+ colSpan: Y.length + (x || T ? 1 : 0),
254
+ children: A ?? /* @__PURE__ */ l(re, {
255
+ title: "No results",
256
+ description: "Try adjusting your search or filters."
257
+ })
258
+ }) }) : J.map((e) => /* @__PURE__ */ u(c.Fragment, { children: [/* @__PURE__ */ u(n, {
259
+ "data-selected": e.getIsSelected() || void 0,
260
+ "aria-selected": x ? e.getIsSelected() : void 0,
261
+ children: [(x || T) && /* @__PURE__ */ u(i, {
262
+ className: "wos-data-table-select-cell",
263
+ children: [x && /* @__PURE__ */ l("input", {
264
+ type: "checkbox",
265
+ "aria-label": `Select row ${e.id}`,
266
+ checked: e.getIsSelected(),
267
+ disabled: !e.getCanSelect(),
268
+ onChange: e.getToggleSelectedHandler()
269
+ }), T && e.getCanExpand() && /* @__PURE__ */ l("button", {
270
+ type: "button",
271
+ className: "wos-data-table-expand",
272
+ "aria-expanded": e.getIsExpanded(),
273
+ "aria-label": `${e.getIsExpanded() ? "Collapse" : "Expand"} row ${e.id}`,
274
+ onClick: e.getToggleExpandedHandler(),
275
+ children: e.getIsExpanded() ? "−" : "+"
276
+ })]
277
+ }), e.getVisibleCells().map((e) => /* @__PURE__ */ l(i, {
278
+ className: e.column.columnDef.meta?.align === "right" ? "text-right tabular" : void 0,
279
+ style: {
280
+ width: e.column.getSize(),
281
+ position: e.column.getIsPinned() ? "sticky" : void 0,
282
+ insetInlineStart: e.column.getIsPinned() === "start" ? e.column.getStart("start") : void 0,
283
+ insetInlineEnd: e.column.getIsPinned() === "end" ? e.column.getAfter("end") : void 0
284
+ },
285
+ children: /* @__PURE__ */ l(q.FlexRender, { cell: e })
286
+ }, e.id))]
287
+ }), T && e.getIsExpanded() && E && /* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(i, {
288
+ colSpan: Y.length + (x || T ? 1 : 0),
289
+ children: E({ row: e.original })
290
+ }) })] }, e.id)) })
291
+ ]
292
+ })
293
+ }), b && !D && /* @__PURE__ */ u("div", {
294
+ className: "wos-data-table-pagination",
295
+ children: [/* @__PURE__ */ u("span", {
296
+ className: "wos-data-table-row-count type-metadata text-muted-foreground",
297
+ children: [q.getRowCount(), " rows"]
298
+ }), /* @__PURE__ */ u("div", {
299
+ className: "wos-data-table-pagination-controls",
300
+ children: [/* @__PURE__ */ u("label", {
301
+ className: "type-metadata",
302
+ children: ["Rows per page ", /* @__PURE__ */ l("select", {
303
+ value: q.state.pagination?.pageSize ?? 10,
304
+ onChange: (e) => q.setPageSize(Number(e.target.value)),
305
+ children: j.map((e) => /* @__PURE__ */ l("option", {
306
+ value: e,
307
+ children: e
308
+ }, e))
309
+ })]
310
+ }), /* @__PURE__ */ u("div", {
311
+ className: "wos-data-table-page-actions",
312
+ children: [
313
+ /* @__PURE__ */ l(e, {
314
+ size: "sm",
315
+ variant: "outline",
316
+ onClick: () => q.previousPage(),
317
+ disabled: !q.getCanPreviousPage(),
318
+ "aria-label": "Previous page",
319
+ children: "Previous"
320
+ }),
321
+ /* @__PURE__ */ u("span", {
322
+ "aria-live": "polite",
323
+ className: "type-metadata",
324
+ children: [
325
+ "Page ",
326
+ (q.state.pagination?.pageIndex ?? 0) + 1,
327
+ q.getPageCount() > 0 ? ` of ${q.getPageCount()}` : ""
328
+ ]
329
+ }),
330
+ /* @__PURE__ */ l(e, {
331
+ size: "sm",
332
+ variant: "outline",
333
+ onClick: () => q.nextPage(),
334
+ disabled: !q.getCanNextPage(),
335
+ "aria-label": "Next page",
336
+ children: "Next"
337
+ })
338
+ ]
339
+ })]
340
+ })]
341
+ })] })
342
+ ]
343
+ });
344
+ }
345
+ //#endregion
346
+ export { N as DataTable, j as createDataTableColumnHelper };
@@ -0,0 +1 @@
1
+ export { CurrencyValue, PercentageValue, ShareQuantity, FinancialMetric, EstimateIndicator, AllocationBar, FinancialDataTable, AssumptionNotice, type CurrencyValueProps, type PercentageValueProps, type ShareQuantityProps, type FinancialValueState, type FinancialMetricProps, type EstimateIndicatorProps, type AllocationSegment, type AllocationBarProps, type FinancialDataColumn, type FinancialDataTableProps, type AssumptionNoticeProps, } from "./components/financial";