@tensor_1/tokens 2.6.0 → 2.7.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 +11 -0
- package/build/css/components.css +38 -7
- package/build/css/styles.css +38 -7
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -77,3 +77,14 @@ The following CSS primitives (and their `@tensor_1/react` wrappers) are the inte
|
|
|
77
77
|
If you reach for `var(--uix-danger)` or `var(--uix-warning)` to render SLA urgency or severity, use `<StatusPill tone="sla-breached">` or `<StatusPill tone="p1">` instead — the component handles WCAG contrast, dark mode, and brand overrides; a raw literal does not.
|
|
78
78
|
|
|
79
79
|
Likewise, don't fork the data grid: a product-local `data-table.tsx` (bespoke sort/filter/selection/resize + hand-coded column widths) should be replaced by `<Table>` + the subcomponents above, composed over the framework-agnostic `table-engine` (or the `useTable` hook). Sorting, filtering, search highlighting, saved views, and virtualization then match the vanilla styleguide exactly, and every visual affordance re-themes with the tokens listed here.
|
|
80
|
+
|
|
81
|
+
## Documentation site
|
|
82
|
+
|
|
83
|
+
A **build-free** component explorer lives in [`docs/`](./docs/) — a no-bundler HTML shell (`docs/explorer.html`) with a left component nav and a per-component page whose regions (`overview`, `live-example`, `props-table`, `do-dont`, `a11y-notes`) are keyed by `data-region` and filled in incrementally. It reuses the styleguide's theming verbatim (the no-flash `data-theme` script + `[data-uix-theme-toggle]`) and links the same `--uix-*` contract via `../styles/main.css`, so light/dark behaves identically to `index.html`. `docs/docs.js` exposes pure, unit-tested helpers (`slugify`, `componentNav`, `renderPropsTable`) behind a `typeof document` DOM guard; run `node --test docs/docs.test.js`.
|
|
84
|
+
|
|
85
|
+
Serve it from the repo root (the styleguide's static root) so relative asset paths resolve:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
npm run docs:serve
|
|
89
|
+
# → http://localhost:4178/packages/tokens/docs/explorer.html
|
|
90
|
+
```
|
package/build/css/components.css
CHANGED
|
@@ -119,6 +119,9 @@
|
|
|
119
119
|
.uix-field { display: flex; flex-direction: column; gap: var(--uix-space-2); }
|
|
120
120
|
.uix-field__label { font-size: var(--uix-text-meta); font-weight: 500; color: var(--uix-text); }
|
|
121
121
|
.uix-field__label[data-required]::after { content: " *"; color: var(--uix-danger-text); }
|
|
122
|
+
/* message slot for hint / error / success — reserves one line so an appearing error never
|
|
123
|
+
shifts the layout (UIX-FIX-04); the React <Field> always renders it. */
|
|
124
|
+
.uix-field__msg { font-size: var(--uix-text-meta); line-height: 1.45; min-height: 1.45em; }
|
|
122
125
|
.uix-field__hint { font-size: var(--uix-text-meta); color: var(--uix-text-muted); }
|
|
123
126
|
.uix-field__error { font-size: var(--uix-text-meta); color: var(--uix-danger-text); display: inline-flex; align-items: center; gap: var(--uix-space-2); }
|
|
124
127
|
.uix-field__error svg, .uix-field__success svg { width: 14px; height: 14px; flex: none; }
|
|
@@ -858,8 +861,28 @@
|
|
|
858
861
|
.uix-avatar--editable:hover .uix-avatar__edit, .uix-avatar--editable:focus-visible .uix-avatar__edit { opacity: 1; }
|
|
859
862
|
.uix-avatar--empty { background: var(--uix-bg-subtle); border: 1.5px dashed var(--uix-border-strong); color: var(--uix-text-muted); }
|
|
860
863
|
}
|
|
861
|
-
/* uix tooltip
|
|
864
|
+
/* uix tooltip. Two flavours, both depend only on --uix-* tokens:
|
|
865
|
+
• .uix-tooltip__bubble — the React <Tooltip>: renders in the top layer via the
|
|
866
|
+
Popover API, so it escapes any overflow:hidden/scroll ancestor (UIX-FIX-02).
|
|
867
|
+
JS sets position/left/top; CSS owns appearance + the fade.
|
|
868
|
+
• [data-uix-tip] — the legacy CSS-only tooltip, kept for back-compat. It is
|
|
869
|
+
position:absolute and so is clipped by an overflow ancestor; prefer <Tooltip>. */
|
|
862
870
|
@layer uix.components {
|
|
871
|
+
.uix-tooltip { display: inline-flex; }
|
|
872
|
+
|
|
873
|
+
.uix-tooltip__bubble {
|
|
874
|
+
position: fixed; margin: 0; inset: auto; border: 0;
|
|
875
|
+
width: max-content; max-width: 16rem;
|
|
876
|
+
background: var(--uix-text); color: var(--uix-bg-app);
|
|
877
|
+
font-size: var(--uix-text-meta); font-weight: 500; line-height: 1.4;
|
|
878
|
+
padding: var(--uix-space-2) var(--uix-space-3); border-radius: var(--uix-radius-sm);
|
|
879
|
+
box-shadow: var(--uix-shadow-popover); white-space: normal; pointer-events: none;
|
|
880
|
+
opacity: 0; transition: opacity var(--uix-dur-fast) var(--uix-ease-out);
|
|
881
|
+
}
|
|
882
|
+
.uix-tooltip__bubble:popover-open { opacity: 1; }
|
|
883
|
+
@starting-style { .uix-tooltip__bubble:popover-open { opacity: 0; } }
|
|
884
|
+
|
|
885
|
+
/* legacy CSS-only tooltip — clipped by overflow ancestors; superseded by .uix-tooltip__bubble */
|
|
863
886
|
[data-uix-tip] { position: relative; }
|
|
864
887
|
[data-uix-tip]::after {
|
|
865
888
|
content: attr(data-uix-tip); position: absolute; bottom: calc(100% + 6px); left: 50%;
|
|
@@ -870,6 +893,8 @@
|
|
|
870
893
|
transition: opacity var(--uix-dur-fast) var(--uix-ease-out), transform var(--uix-dur-fast) var(--uix-ease-out);
|
|
871
894
|
}
|
|
872
895
|
[data-uix-tip]:hover::after, [data-uix-tip]:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
|
|
896
|
+
/* when JS upgrades [data-uix-tip] to a top-layer bubble, drop the clipped CSS-only one */
|
|
897
|
+
.uix-has-js-tip [data-uix-tip]::after { content: none; }
|
|
873
898
|
}
|
|
874
899
|
/* uix progress bar + ring — depends only on --uix-* tokens. */
|
|
875
900
|
@layer uix.components {
|
|
@@ -903,16 +928,22 @@
|
|
|
903
928
|
.uix-timeline__body { padding-bottom: var(--uix-space-5); }
|
|
904
929
|
.uix-timeline__meta { font-size: var(--uix-text-meta); color: var(--uix-text-muted); }
|
|
905
930
|
}
|
|
906
|
-
/* uix tree view —
|
|
931
|
+
/* uix tree view — WAI-ARIA tree (role=tree/treeitem/group). Depends only on --uix-* tokens.
|
|
932
|
+
ARIA (aria-expanded / aria-selected / aria-level) lives on the treeitem <li>, so the chevron,
|
|
933
|
+
selection, and collapse styling all key off the item, not the row (UIX-FIX-04). */
|
|
907
934
|
@layer uix.components {
|
|
908
935
|
.uix-tree, .uix-tree ul { list-style: none; margin: 0; padding: 0; }
|
|
909
|
-
.uix-
|
|
910
|
-
.uix-
|
|
911
|
-
.uix-tree__row
|
|
936
|
+
.uix-tree__group { padding-left: var(--uix-space-5); }
|
|
937
|
+
.uix-tree__item { outline: none; } /* the focus ring is drawn on the row, below */
|
|
938
|
+
.uix-tree__row { display: flex; align-items: center; gap: var(--uix-space-2); padding: var(--uix-space-2) var(--uix-space-2); border-radius: var(--uix-radius-sm); cursor: pointer; color: var(--uix-text); font-size: var(--uix-text-body); }
|
|
939
|
+
.uix-tree__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
940
|
+
.uix-tree__item > .uix-tree__row:hover { background: var(--uix-bg-hover); }
|
|
941
|
+
.uix-tree__item[aria-selected="true"] > .uix-tree__row { background: var(--uix-bg-active); }
|
|
942
|
+
.uix-tree__item:focus-visible > .uix-tree__row { outline: 2px solid var(--uix-ring); outline-offset: -2px; }
|
|
912
943
|
.uix-tree__toggle { width: 16px; height: 16px; flex: none; display: grid; place-items: center; color: var(--uix-text-muted); transition: transform var(--uix-dur) var(--uix-ease-out); }
|
|
913
944
|
.uix-tree__toggle svg { width: 14px; height: 14px; }
|
|
914
|
-
.uix-
|
|
915
|
-
.uix-
|
|
945
|
+
.uix-tree__item[aria-expanded="false"] > .uix-tree__row .uix-tree__toggle { transform: rotate(-90deg); }
|
|
946
|
+
.uix-tree__item[aria-expanded="false"] > .uix-tree__group { display: none; }
|
|
916
947
|
}
|
|
917
948
|
/* uix calendar (shared by date pickers) — depends only on --uix-* tokens. */
|
|
918
949
|
@layer uix.components {
|
package/build/css/styles.css
CHANGED
|
@@ -415,6 +415,9 @@
|
|
|
415
415
|
.uix-field { display: flex; flex-direction: column; gap: var(--uix-space-2); }
|
|
416
416
|
.uix-field__label { font-size: var(--uix-text-meta); font-weight: 500; color: var(--uix-text); }
|
|
417
417
|
.uix-field__label[data-required]::after { content: " *"; color: var(--uix-danger-text); }
|
|
418
|
+
/* message slot for hint / error / success — reserves one line so an appearing error never
|
|
419
|
+
shifts the layout (UIX-FIX-04); the React <Field> always renders it. */
|
|
420
|
+
.uix-field__msg { font-size: var(--uix-text-meta); line-height: 1.45; min-height: 1.45em; }
|
|
418
421
|
.uix-field__hint { font-size: var(--uix-text-meta); color: var(--uix-text-muted); }
|
|
419
422
|
.uix-field__error { font-size: var(--uix-text-meta); color: var(--uix-danger-text); display: inline-flex; align-items: center; gap: var(--uix-space-2); }
|
|
420
423
|
.uix-field__error svg, .uix-field__success svg { width: 14px; height: 14px; flex: none; }
|
|
@@ -1199,8 +1202,28 @@
|
|
|
1199
1202
|
.uix-avatar--editable:hover .uix-avatar__edit, .uix-avatar--editable:focus-visible .uix-avatar__edit { opacity: 1; }
|
|
1200
1203
|
.uix-avatar--empty { background: var(--uix-bg-subtle); border: 1.5px dashed var(--uix-border-strong); color: var(--uix-text-muted); }
|
|
1201
1204
|
}
|
|
1202
|
-
/* uix tooltip
|
|
1205
|
+
/* uix tooltip. Two flavours, both depend only on --uix-* tokens:
|
|
1206
|
+
• .uix-tooltip__bubble — the React <Tooltip>: renders in the top layer via the
|
|
1207
|
+
Popover API, so it escapes any overflow:hidden/scroll ancestor (UIX-FIX-02).
|
|
1208
|
+
JS sets position/left/top; CSS owns appearance + the fade.
|
|
1209
|
+
• [data-uix-tip] — the legacy CSS-only tooltip, kept for back-compat. It is
|
|
1210
|
+
position:absolute and so is clipped by an overflow ancestor; prefer <Tooltip>. */
|
|
1203
1211
|
@layer uix.components {
|
|
1212
|
+
.uix-tooltip { display: inline-flex; }
|
|
1213
|
+
|
|
1214
|
+
.uix-tooltip__bubble {
|
|
1215
|
+
position: fixed; margin: 0; inset: auto; border: 0;
|
|
1216
|
+
width: max-content; max-width: 16rem;
|
|
1217
|
+
background: var(--uix-text); color: var(--uix-bg-app);
|
|
1218
|
+
font-size: var(--uix-text-meta); font-weight: 500; line-height: 1.4;
|
|
1219
|
+
padding: var(--uix-space-2) var(--uix-space-3); border-radius: var(--uix-radius-sm);
|
|
1220
|
+
box-shadow: var(--uix-shadow-popover); white-space: normal; pointer-events: none;
|
|
1221
|
+
opacity: 0; transition: opacity var(--uix-dur-fast) var(--uix-ease-out);
|
|
1222
|
+
}
|
|
1223
|
+
.uix-tooltip__bubble:popover-open { opacity: 1; }
|
|
1224
|
+
@starting-style { .uix-tooltip__bubble:popover-open { opacity: 0; } }
|
|
1225
|
+
|
|
1226
|
+
/* legacy CSS-only tooltip — clipped by overflow ancestors; superseded by .uix-tooltip__bubble */
|
|
1204
1227
|
[data-uix-tip] { position: relative; }
|
|
1205
1228
|
[data-uix-tip]::after {
|
|
1206
1229
|
content: attr(data-uix-tip); position: absolute; bottom: calc(100% + 6px); left: 50%;
|
|
@@ -1211,6 +1234,8 @@
|
|
|
1211
1234
|
transition: opacity var(--uix-dur-fast) var(--uix-ease-out), transform var(--uix-dur-fast) var(--uix-ease-out);
|
|
1212
1235
|
}
|
|
1213
1236
|
[data-uix-tip]:hover::after, [data-uix-tip]:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
|
|
1237
|
+
/* when JS upgrades [data-uix-tip] to a top-layer bubble, drop the clipped CSS-only one */
|
|
1238
|
+
.uix-has-js-tip [data-uix-tip]::after { content: none; }
|
|
1214
1239
|
}
|
|
1215
1240
|
/* uix progress bar + ring — depends only on --uix-* tokens. */
|
|
1216
1241
|
@layer uix.components {
|
|
@@ -1244,16 +1269,22 @@
|
|
|
1244
1269
|
.uix-timeline__body { padding-bottom: var(--uix-space-5); }
|
|
1245
1270
|
.uix-timeline__meta { font-size: var(--uix-text-meta); color: var(--uix-text-muted); }
|
|
1246
1271
|
}
|
|
1247
|
-
/* uix tree view —
|
|
1272
|
+
/* uix tree view — WAI-ARIA tree (role=tree/treeitem/group). Depends only on --uix-* tokens.
|
|
1273
|
+
ARIA (aria-expanded / aria-selected / aria-level) lives on the treeitem <li>, so the chevron,
|
|
1274
|
+
selection, and collapse styling all key off the item, not the row (UIX-FIX-04). */
|
|
1248
1275
|
@layer uix.components {
|
|
1249
1276
|
.uix-tree, .uix-tree ul { list-style: none; margin: 0; padding: 0; }
|
|
1250
|
-
.uix-
|
|
1251
|
-
.uix-
|
|
1252
|
-
.uix-tree__row
|
|
1277
|
+
.uix-tree__group { padding-left: var(--uix-space-5); }
|
|
1278
|
+
.uix-tree__item { outline: none; } /* the focus ring is drawn on the row, below */
|
|
1279
|
+
.uix-tree__row { display: flex; align-items: center; gap: var(--uix-space-2); padding: var(--uix-space-2) var(--uix-space-2); border-radius: var(--uix-radius-sm); cursor: pointer; color: var(--uix-text); font-size: var(--uix-text-body); }
|
|
1280
|
+
.uix-tree__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1281
|
+
.uix-tree__item > .uix-tree__row:hover { background: var(--uix-bg-hover); }
|
|
1282
|
+
.uix-tree__item[aria-selected="true"] > .uix-tree__row { background: var(--uix-bg-active); }
|
|
1283
|
+
.uix-tree__item:focus-visible > .uix-tree__row { outline: 2px solid var(--uix-ring); outline-offset: -2px; }
|
|
1253
1284
|
.uix-tree__toggle { width: 16px; height: 16px; flex: none; display: grid; place-items: center; color: var(--uix-text-muted); transition: transform var(--uix-dur) var(--uix-ease-out); }
|
|
1254
1285
|
.uix-tree__toggle svg { width: 14px; height: 14px; }
|
|
1255
|
-
.uix-
|
|
1256
|
-
.uix-
|
|
1286
|
+
.uix-tree__item[aria-expanded="false"] > .uix-tree__row .uix-tree__toggle { transform: rotate(-90deg); }
|
|
1287
|
+
.uix-tree__item[aria-expanded="false"] > .uix-tree__group { display: none; }
|
|
1257
1288
|
}
|
|
1258
1289
|
/* uix calendar (shared by date pickers) — depends only on --uix-* tokens. */
|
|
1259
1290
|
@layer uix.components {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tensor_1/tokens",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "UIx v2 design tokens — the --uix-* contract for house products (Tensor, POSx, SHOPx). One DTCG source -> CSS variables, Tailwind theme, and typed TS constants.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
"build": "npm run build:tokens && npm run build:themes && npm run build:styles",
|
|
40
40
|
"test:parity": "node scripts/check-parity.mjs",
|
|
41
41
|
"test:contract": "node scripts/check-contract.mjs",
|
|
42
|
+
"docs:serve": "serve -l 4178 ../..",
|
|
43
|
+
"size:css": "node scripts/size-report.mjs --check",
|
|
44
|
+
"size:css:update": "node scripts/size-report.mjs --update",
|
|
42
45
|
"prepublishOnly": "npm run build && npm run test:parity && npm run test:contract"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|