@rozie-ui/data-table-solid 0.4.0 → 0.5.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.
- package/README.md +48 -42
- package/dist/index.cjs +424 -121
- package/dist/index.d.cts +7 -7
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +424 -121
- package/package.json +2 -2
- package/src/Column.tsx +2 -2
- package/src/DataTable.tsx +232 -29
- package/src/themes/base.css +38 -25
- package/src/themes/bootstrap.css +11 -0
- package/src/themes/material.css +11 -0
- package/src/themes/shadcn.css +11 -0
package/src/themes/base.css
CHANGED
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @rozie-ui/data-table — base token reference.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* place and wires each public `--rozie-data-table-*` token onto the internal
|
|
10
|
-
* `--rdt-*` the component consumes, so a design-system bridge (shadcn / material /
|
|
11
|
-
* bootstrap) can re-skin the whole table by remapping ONLY the public tokens.
|
|
4
|
+
* This file is the PUBLIC token reference. It declares 18 `--rozie-data-table-*`
|
|
5
|
+
* tokens and wires each onto the short internal `--rdt-*` token the component's
|
|
6
|
+
* scoped `<style>` actually reads. The component reads 82 internal `--rdt-*`
|
|
7
|
+
* tokens in total, each with an inline `var(--rdt-x, <fallback>)` default, so the
|
|
8
|
+
* table renders ZERO-CONFIG without importing this file.
|
|
12
9
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
10
|
+
* Scope, stated plainly: remapping the public tokens re-skins the table's primary
|
|
11
|
+
* surfaces — type, borders, background, header, row, cell padding, accent, and the
|
|
12
|
+
* max-height. It does NOT reach every cosmetic value. 58 of the 82 internal tokens
|
|
13
|
+
* have no public counterpart today, including the grid active-cell ring, the range
|
|
14
|
+
* highlight, the fill handle, the invalid-cell outline, the group tokens, the filter
|
|
15
|
+
* row, the per-header column ⋯ menu, most of the pagination bar (only
|
|
16
|
+
* --rozie-data-table-control-border-color, --rozie-data-table-radius, and
|
|
17
|
+
* --rozie-data-table-disabled-opacity are public — its background, padding, and
|
|
18
|
+
* status-text size are not), and the chrome column widths. Those remain internal
|
|
19
|
+
* and may be renamed; a design system that needs them should set the `--rdt-*`
|
|
20
|
+
* name directly and accept that it is not yet a stable API. One Lit-specific rule: set
|
|
21
|
+
* the public tokens at or ABOVE the `<rozie-data-table>` element (`:root`, a wrapper, or
|
|
22
|
+
* the element itself), never on the `.rozie-data-table` / `.rozie-data-table-wrap`
|
|
23
|
+
* classes — on that target both of those render inside the component's shadow root,
|
|
24
|
+
* where a document stylesheet cannot reach them. The tokens themselves inherit across
|
|
25
|
+
* the boundary, and the component carries the mapping internally, so every one of the 18
|
|
26
|
+
* works there.
|
|
27
|
+
*
|
|
28
|
+
* NOTE the split: the STRUCTURAL rules — `border-collapse`, the keyed-r-for
|
|
29
|
+
* layout, `position: sticky` for the header + pinned columns, the
|
|
30
|
+
* resize-handle positioning, the `<details>` disclosure box — are
|
|
31
|
+
* behavior-critical and live in the component's scoped `<style>` (per-leaf,
|
|
32
|
+
* NOT consumer-overridable). Only the values below flow through tokens.
|
|
19
33
|
*
|
|
20
34
|
* Override any token at any ancestor scope (`:root`, `.dark`, a wrapper, or the
|
|
21
35
|
* `.rozie-data-table` / `.rozie-data-table-wrap` element). See
|
|
@@ -24,12 +38,11 @@
|
|
|
24
38
|
*/
|
|
25
39
|
.rozie-data-table-wrap,
|
|
26
40
|
.rozie-data-table {
|
|
27
|
-
/*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
must not delete these as dead — they are the intended public API. */
|
|
41
|
+
/* These public tokens aren't read directly by a CSS var() inside this
|
|
42
|
+
component's own scoped <style> — that is by design. This is the public
|
|
43
|
+
surface; the "Wire the PUBLIC tokens..." block further down assigns each
|
|
44
|
+
one onto the short internal --rdt-* custom property the component
|
|
45
|
+
actually reads. */
|
|
33
46
|
|
|
34
47
|
/* ── palette (the few values most consumers will set) ───────────────────── */
|
|
35
48
|
--rozie-data-table-fg: inherit;
|
|
@@ -52,24 +65,24 @@
|
|
|
52
65
|
/* ── sort indicator ─────────────────────────────────────────────────────── */
|
|
53
66
|
--rozie-data-table-sort-indicator-opacity: 0.7;
|
|
54
67
|
|
|
55
|
-
/* ── resize handle
|
|
68
|
+
/* ── resize handle ──────────────────────────────────────────────────────── */
|
|
56
69
|
--rozie-data-table-resize-grip-color: rgba(0, 0, 0, 0.12);
|
|
57
70
|
--rozie-data-table-resize-grip-active: var(--rozie-data-table-accent);
|
|
58
71
|
|
|
59
|
-
/* ── pin controls
|
|
72
|
+
/* ── pin controls ───────────────────────────────────────────────────────── */
|
|
60
73
|
--rozie-data-table-pin-active-bg: rgba(0, 0, 0, 0.1);
|
|
61
74
|
|
|
62
|
-
/* ── column-visibility menu
|
|
75
|
+
/* ── column-visibility menu ─────────────────────────────────────────────── */
|
|
63
76
|
--rozie-data-table-menu-bg: #fff;
|
|
64
77
|
--rozie-data-table-menu-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
|
|
65
78
|
|
|
66
|
-
/* ── selection checkboxes
|
|
79
|
+
/* ── selection checkboxes ───────────────────────────────────────────────── */
|
|
67
80
|
--rozie-data-table-select-accent: var(--rozie-data-table-accent);
|
|
68
81
|
|
|
69
82
|
/* ── disabled pagination controls ──────────────────────────────────────── */
|
|
70
83
|
--rozie-data-table-disabled-opacity: 0.4;
|
|
71
84
|
|
|
72
|
-
/* ── virtual scroll (row windowing
|
|
85
|
+
/* ── virtual scroll (row windowing) ─────────────────────────────────────── */
|
|
73
86
|
/* Read with NO fallback at its one use site (`max-height: var(--rozie-data-table-max-height);`
|
|
74
87
|
on `.rdt-scroll`) — when unset the property is invalid at computed-value
|
|
75
88
|
time and the rule behaves as if `max-height` were never declared there,
|
package/src/themes/bootstrap.css
CHANGED
|
@@ -11,7 +11,18 @@
|
|
|
11
11
|
*
|
|
12
12
|
* import '@rozie-ui/data-table-react/themes/base.css';
|
|
13
13
|
* import '@rozie-ui/data-table-react/themes/bootstrap.css';
|
|
14
|
+
*
|
|
15
|
+
* SCOPE (changed 2026-09-12, F-01). This bridge assigns its tokens at `:root` as well as on
|
|
16
|
+
* the table's own classes. A design-system bridge is an app-wide skin by nature, and `:root`
|
|
17
|
+
* is the only scope that reaches the Lit leaf: there, `.rozie-data-table-wrap` and
|
|
18
|
+
* `.rozie-data-table` both render INSIDE the component's shadow root, where a document-level
|
|
19
|
+
* class selector can never match — so before this change all four bridges were inert on Lit.
|
|
20
|
+
* Trade-off, stated rather than buried: two tables on one page can no longer take DIFFERENT
|
|
21
|
+
* bridges by ancestor class alone. Per-instance overrides still work on the five light-DOM
|
|
22
|
+
* targets via the class selectors below, and on all six by setting the public tokens on any
|
|
23
|
+
* ancestor of the table.
|
|
14
24
|
*/
|
|
25
|
+
:root,
|
|
15
26
|
.rozie-data-table-wrap,
|
|
16
27
|
.rozie-data-table {
|
|
17
28
|
--rozie-data-table-fg: var(--bs-body-color, #212529);
|
package/src/themes/material.css
CHANGED
|
@@ -11,7 +11,18 @@
|
|
|
11
11
|
*
|
|
12
12
|
* import '@rozie-ui/data-table-react/themes/base.css';
|
|
13
13
|
* import '@rozie-ui/data-table-react/themes/material.css';
|
|
14
|
+
*
|
|
15
|
+
* SCOPE (changed 2026-09-12, F-01). This bridge assigns its tokens at `:root` as well as on
|
|
16
|
+
* the table's own classes. A design-system bridge is an app-wide skin by nature, and `:root`
|
|
17
|
+
* is the only scope that reaches the Lit leaf: there, `.rozie-data-table-wrap` and
|
|
18
|
+
* `.rozie-data-table` both render INSIDE the component's shadow root, where a document-level
|
|
19
|
+
* class selector can never match — so before this change all four bridges were inert on Lit.
|
|
20
|
+
* Trade-off, stated rather than buried: two tables on one page can no longer take DIFFERENT
|
|
21
|
+
* bridges by ancestor class alone. Per-instance overrides still work on the five light-DOM
|
|
22
|
+
* targets via the class selectors below, and on all six by setting the public tokens on any
|
|
23
|
+
* ancestor of the table.
|
|
14
24
|
*/
|
|
25
|
+
:root,
|
|
15
26
|
.rozie-data-table-wrap,
|
|
16
27
|
.rozie-data-table {
|
|
17
28
|
--rozie-data-table-fg: var(--md-sys-color-on-surface, #1d1b20);
|
package/src/themes/shadcn.css
CHANGED
|
@@ -17,7 +17,18 @@
|
|
|
17
17
|
*
|
|
18
18
|
* If your shadcn setup predates the `hsl()`-wrapping convention (Tailwind v4 /
|
|
19
19
|
* oklch tokens emit pre-formed colors), drop the `hsl(...)` wrappers below.
|
|
20
|
+
*
|
|
21
|
+
* SCOPE (changed 2026-09-12, F-01). This bridge assigns its tokens at `:root` as well as on
|
|
22
|
+
* the table's own classes. A design-system bridge is an app-wide skin by nature, and `:root`
|
|
23
|
+
* is the only scope that reaches the Lit leaf: there, `.rozie-data-table-wrap` and
|
|
24
|
+
* `.rozie-data-table` both render INSIDE the component's shadow root, where a document-level
|
|
25
|
+
* class selector can never match — so before this change all four bridges were inert on Lit.
|
|
26
|
+
* Trade-off, stated rather than buried: two tables on one page can no longer take DIFFERENT
|
|
27
|
+
* bridges by ancestor class alone. Per-instance overrides still work on the five light-DOM
|
|
28
|
+
* targets via the class selectors below, and on all six by setting the public tokens on any
|
|
29
|
+
* ancestor of the table.
|
|
20
30
|
*/
|
|
31
|
+
:root,
|
|
21
32
|
.rozie-data-table-wrap,
|
|
22
33
|
.rozie-data-table {
|
|
23
34
|
--rozie-data-table-fg: hsl(var(--foreground, 222.2 47.4% 11.2%));
|