@reliability-design/web 1.4.10 → 1.4.11

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.
@@ -0,0 +1,274 @@
1
+ /*
2
+ * Reliability Design System: AG Grid theme ("Data Table").
3
+ *
4
+ * import "@reliability-design/web/vars.css";
5
+ * import "@reliability-design/web/ag-grid.css";
6
+ *
7
+ * <div class="rel-data-table" data-density="dense | comfortable"> (no attribute = default)
8
+ * …toolbar… <ag-grid> …footer…
9
+ * </div>
10
+ *
11
+ * AG Grid 33 and newer (the Theming API, its default theme themeQuartz), or 32.2–32.3
12
+ * when the app passes `theme: themeQuartz`. AG Grid's legacy CSS themes are not covered.
13
+ *
14
+ * Every theme param is an `--ag-*` custom property. A value set on an ancestor of the
15
+ * grid wins over the theme's own value, and every value here is one of our tokens, so
16
+ * light and dark follow vars.css (`.dark` / `[data-theme="dark"]`) with no AG Grid
17
+ * colour-scheme switching.
18
+ *
19
+ * Only grids inside `.rel-data-table` are themed; other grids keep AG Grid's look.
20
+ *
21
+ * Values come from the Published DS "Data Table" page (node 9300:2) and the rules
22
+ * decided for 1.5.0. Heights have no tokens (rows 40 / 56 / 64, header 48, with the
23
+ * row divider inside the row height).
24
+ */
25
+
26
+ .rel-data-table {
27
+ /* ── Container: the Loads example's frame around toolbar + grid + footer ── */
28
+ display: flex;
29
+ flex-direction: column;
30
+ min-width: 0;
31
+ background-color: var(--rel-bg-surface);
32
+ border: 1px solid var(--rel-border-subtle);
33
+ border-radius: var(--rel-border-radius-md);
34
+ overflow: hidden;
35
+ color: var(--rel-text-default);
36
+ font-family: var(--rel-body-md-regular-font-family);
37
+
38
+ /* ── Type ── */
39
+ --ag-font-family: var(--rel-body-md-regular-font-family);
40
+ --ag-font-size: var(--rel-body-md-regular-font-size);
41
+ --ag-data-font-size: var(--rel-body-md-regular-font-size);
42
+ --ag-cell-font-size: var(--rel-body-md-regular-font-size);
43
+ --ag-cell-font-weight: var(--rel-body-md-regular-font-weight);
44
+ --ag-header-font-family: var(--rel-body-sm-semibold-font-family);
45
+ --ag-header-font-size: var(--rel-body-sm-semibold-font-size);
46
+ --ag-header-font-weight: var(--rel-body-sm-semibold-font-weight);
47
+
48
+ /* ── Colour ── */
49
+ --ag-text-color: var(--rel-text-default);
50
+ --ag-foreground-color: var(--rel-text-default);
51
+ --ag-cell-text-color: var(--rel-text-default);
52
+ --ag-subtle-text-color: var(--rel-text-caption);
53
+ --ag-background-color: var(--rel-bg-surface);
54
+ --ag-data-background-color: var(--rel-bg-surface);
55
+ --ag-odd-row-background-color: var(--rel-bg-surface);
56
+ --ag-chrome-background-color: var(--rel-bg-surface);
57
+ --ag-menu-background-color: var(--rel-bg-surface);
58
+ --ag-menu-text-color: var(--rel-text-default);
59
+ --ag-header-background-color: var(--rel-bg-neutral-elevated-1);
60
+ --ag-header-text-color: var(--rel-text-label);
61
+ --ag-header-cell-hover-background-color: transparent;
62
+ --ag-row-hover-color: var(--rel-bg-neutral-elevated-1);
63
+ --ag-selected-row-background-color: var(--rel-bg-info-light);
64
+ --ag-accent-color: var(--rel-border-focus);
65
+ --ag-range-selection-border-color: var(--rel-border-focus);
66
+ --ag-icon-button-hover-background-color: var(--rel-action-overlay-hover);
67
+ --ag-browser-color-scheme: light;
68
+
69
+ /* ── Size ── */
70
+ --ag-header-height: 48px;
71
+ --ag-row-height: 56px;
72
+ --ag-cell-horizontal-padding: var(--rel-spacing-md);
73
+ --ag-spacing: var(--rel-spacing-xs);
74
+ --ag-icon-size: 16px;
75
+ --ag-border-radius: var(--rel-border-radius-xs);
76
+
77
+ /* ── Lines: a divider under each row, none between columns ── */
78
+ --ag-border-color: var(--rel-border-subtle);
79
+ --ag-row-border: 1px solid var(--rel-border-subtle);
80
+ --ag-header-row-border: 1px solid var(--rel-border-subtle);
81
+ --ag-column-border: none;
82
+ --ag-header-column-border: none;
83
+ --ag-pinned-column-border: 1px solid var(--rel-border-subtle);
84
+ --ag-pinned-row-border: 1px solid var(--rel-border-subtle);
85
+ --ag-wrapper-border: none;
86
+ --ag-wrapper-border-radius: 0;
87
+
88
+ /* ── Focus: a 2px ring (AG Grid adds `inset` where the ring goes inside) ── */
89
+ --ag-focus-shadow: 0 0 0 2px var(--rel-border-focus);
90
+
91
+ /* ── Column resize: no handle at rest ── */
92
+ --ag-header-column-resize-handle-color: transparent;
93
+ --ag-header-column-resize-handle-width: 1px;
94
+ --ag-header-column-resize-handle-height: 100%;
95
+
96
+ /* ── Checkboxes, as rel-checkbox ── */
97
+ --ag-checkbox-checked-background-color: var(--rel-text-default);
98
+ --ag-checkbox-checked-border-color: var(--rel-text-default);
99
+ --ag-checkbox-checked-shape-color: var(--rel-text-inverse);
100
+ --ag-checkbox-indeterminate-background-color: var(--rel-text-default);
101
+ --ag-checkbox-indeterminate-border-color: var(--rel-text-default);
102
+ --ag-checkbox-indeterminate-shape-color: var(--rel-text-inverse);
103
+ --ag-checkbox-unchecked-background-color: transparent;
104
+ --ag-checkbox-unchecked-border-color: var(--rel-text-default);
105
+
106
+ /* ── Menus and tooltips, as rel-menu and rel-tooltip ── */
107
+ --ag-menu-border: 1px solid var(--rel-border-subtle);
108
+ --ag-menu-shadow: var(--rel-shadows-md);
109
+ --ag-popup-shadow: var(--rel-shadows-md);
110
+ --ag-tooltip-background-color: var(--rel-bg-neutral-inverse-2);
111
+ --ag-tooltip-text-color: var(--rel-text-inverse);
112
+ --ag-tooltip-border: none;
113
+ }
114
+
115
+ /* Scrollbars and native widgets follow dark mode. */
116
+ :root[data-theme="dark"] .rel-data-table,
117
+ .dark .rel-data-table,
118
+ .rel-data-table.dark {
119
+ --ag-browser-color-scheme: dark;
120
+ }
121
+
122
+ /* ── Density. AG Grid measures --ag-row-height and lays the rows out again. ── */
123
+ .rel-data-table[data-density="dense"] {
124
+ --ag-row-height: 40px;
125
+ }
126
+
127
+ .rel-data-table[data-density="comfortable"] {
128
+ --ag-row-height: 64px;
129
+ }
130
+
131
+ /* ── The grid fills the space between toolbar and footer ── */
132
+ .rel-data-table .ag-root-wrapper {
133
+ flex: 1 1 auto;
134
+ min-height: 0;
135
+ }
136
+
137
+ /* ── Line heights: header body-sm. Cells keep AG Grid's own line-height (the row height),
138
+ which is what centres one-line text vertically; the two-line stack sets body-md. ── */
139
+ .rel-data-table .ag-header-cell-text {
140
+ line-height: var(--rel-body-sm-semibold-line-height);
141
+ }
142
+
143
+ /* ── Focused cell: a 2px ring inside, without moving the content, for keyboard focus only.
144
+ AG Grid exposes no keyboard-mode class, so the ring follows :focus-visible: a mouse click
145
+ focuses the cell (or its checkbox) without it, and AG Grid's focus() after an arrow key or
146
+ Tab matches it. AG Grid's own 1px focus border is hidden either way. ── */
147
+ .rel-data-table .ag-cell-focus:not(.ag-cell-range-selected):focus-within {
148
+ border-color: transparent;
149
+ }
150
+
151
+ .rel-data-table .ag-cell-focus:not(.ag-cell-range-selected):is(:focus-visible, :has(:focus-visible)) {
152
+ box-shadow: inset 0 0 0 2px var(--rel-border-focus);
153
+ }
154
+
155
+ /* AG Grid rings a checkbox on :focus-within / :active; keyboard only here too. */
156
+ .rel-data-table .ag-checkbox-input-wrapper:is(:focus-within, :active):not(:has(:focus-visible)) {
157
+ box-shadow: none;
158
+ }
159
+
160
+ /* ── Column resize: a line on header hover, 2px in the focus colour while dragging ── */
161
+ .rel-data-table .ag-header:hover {
162
+ --ag-header-column-resize-handle-color: var(--rel-border-default);
163
+ }
164
+
165
+ .rel-data-table .ag-header-cell.ag-column-resizing {
166
+ --ag-header-column-resize-handle-color: var(--rel-border-focus);
167
+ --ag-header-column-resize-handle-width: 2px;
168
+ }
169
+
170
+ /* ── Sort: a sortable header shows the unsorted icon at rest, and the arrow once sorted.
171
+ AG Grid (32–36) always renders the unsorted icon on sortable headers and hides it with
172
+ .ag-hidden (display: none !important) unless `unSortIcon` is set; this shows it in an
173
+ unsorted column, which is what `defaultColDef: { unSortIcon: true }` does. Columns with
174
+ `sortable: false` have no icon. ── */
175
+ .rel-data-table .ag-header-cell-sorted-none .ag-sort-none-icon.ag-hidden {
176
+ display: inline !important;
177
+ }
178
+
179
+ /* ── Numbers and currency: right-aligned (columnType "rightAligned"), tabular figures ── */
180
+ .rel-data-table .rel-data-table__cell--numeric {
181
+ font-variant-numeric: tabular-nums;
182
+ font-weight: var(--rel-body-md-medium-font-weight);
183
+ }
184
+
185
+ /* ── Two-line cell: label over subtext (a date over its time window) ── */
186
+ .rel-data-table .rel-data-table__stack {
187
+ display: flex;
188
+ flex-direction: column;
189
+ justify-content: center;
190
+ min-width: 0;
191
+ height: 100%;
192
+ line-height: var(--rel-body-md-regular-line-height);
193
+ }
194
+
195
+ .rel-data-table .rel-data-table__stack > * {
196
+ overflow: hidden;
197
+ text-overflow: ellipsis;
198
+ white-space: nowrap;
199
+ }
200
+
201
+ .rel-data-table .rel-data-table__subtext {
202
+ color: var(--rel-text-caption);
203
+ font-size: var(--rel-body-sm-regular-font-size);
204
+ line-height: var(--rel-body-sm-regular-line-height);
205
+ }
206
+
207
+ /* ── Empty value: the dash in the caption colour ── */
208
+ .rel-data-table .rel-data-table__empty {
209
+ color: var(--rel-text-caption);
210
+ }
211
+
212
+ /* ── Text for screen readers only (e.g. "No value" behind the dash) ── */
213
+ .rel-data-table .rel-data-table__sr-only {
214
+ position: absolute;
215
+ width: 1px;
216
+ height: 1px;
217
+ margin: -1px;
218
+ padding: 0;
219
+ overflow: hidden;
220
+ clip: rect(0 0 0 0);
221
+ white-space: nowrap;
222
+ border: 0;
223
+ }
224
+
225
+ /* ── Error row (rowClassRules "rel-data-table__row--error"): danger fill, which also
226
+ wins over hover and selection, and a 4px rule on the first displayed cell ── */
227
+ .rel-data-table .ag-row.rel-data-table__row--error {
228
+ background-color: var(--rel-bg-danger-light);
229
+ --ag-row-hover-color: transparent;
230
+ --ag-selected-row-background-color: var(--rel-bg-danger-light);
231
+ }
232
+
233
+ .rel-data-table .ag-row.rel-data-table__row--error .ag-cell[aria-colindex="1"] {
234
+ box-shadow: inset 4px 0 0 var(--rel-bg-danger);
235
+ }
236
+
237
+ /* The keyboard focus ring still shows on the first cell of an error row. */
238
+ .rel-data-table .ag-row.rel-data-table__row--error .ag-cell[aria-colindex="1"].ag-cell-focus:not(.ag-cell-range-selected):is(:focus-visible, :has(:focus-visible)) {
239
+ box-shadow: inset 4px 0 0 var(--rel-bg-danger), inset 0 0 0 2px var(--rel-border-focus);
240
+ }
241
+
242
+ /* ── Disabled row (rowClassRules "rel-data-table__row--disabled") ── */
243
+ .rel-data-table .ag-row.rel-data-table__row--disabled {
244
+ opacity: 0.4;
245
+ }
246
+
247
+ /* ── AG Grid's tooltip, as rel-tooltip ── */
248
+ .rel-data-table .ag-tooltip {
249
+ padding: var(--rel-spacing-xs) var(--rel-spacing-sm);
250
+ border-radius: var(--rel-border-radius-sm);
251
+ font-family: var(--rel-body-md-regular-font-family);
252
+ font-size: var(--rel-body-md-regular-font-size);
253
+ font-weight: var(--rel-body-md-medium-font-weight);
254
+ line-height: var(--rel-body-md-regular-line-height);
255
+ }
256
+
257
+ /* ── Message block in place of the rows (empty, no results, failed load) ── */
258
+ .rel-data-table .rel-data-table__message {
259
+ display: flex;
260
+ flex-direction: column;
261
+ align-items: center;
262
+ gap: var(--rel-spacing-xs);
263
+ padding: var(--rel-spacing-md);
264
+ text-align: center;
265
+ color: var(--rel-text-body);
266
+ pointer-events: auto;
267
+ }
268
+
269
+ .rel-data-table .rel-data-table__message-title {
270
+ color: var(--rel-text-default);
271
+ font-size: var(--rel-body-md-medium-font-size);
272
+ font-weight: var(--rel-body-md-medium-font-weight);
273
+ line-height: var(--rel-body-md-medium-line-height);
274
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reliability-design/web",
3
- "version": "1.4.10",
3
+ "version": "1.4.11",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -34,6 +34,7 @@
34
34
  },
35
35
  "./vars.css": "./dist/styles/vars.css",
36
36
  "./motion.css": "./dist/styles/motion.css",
37
+ "./ag-grid.css": "./dist/styles/ag-grid.css",
37
38
  "./motion.tokens.json": "./dist/styles/motion.tokens.json",
38
39
  "./custom-elements.json": "./custom-elements.json"
39
40
  },