@tensor_1/tokens 2.52.0 → 2.54.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tensor_1/tokens",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.54.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
|
"sideEffects": [
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/* uix matrix — two-axis grids (HAR-2752, HAR-2753): `.uix-matrix--input` holds a choice per cell,
|
|
2
|
+
* `.uix-matrix--heatmap` a count and a named band with a way to the items behind it. Both are a
|
|
3
|
+
* `role="grid"` table with sticky row and column headers, in a scroller of their own so a wide
|
|
4
|
+
* grid never widens the page. Colour is never the only cue: a level and a band always show their
|
|
5
|
+
* words. Nothing here moves: a choice lands in its cell, and a cell opens somewhere else.
|
|
6
|
+
* Depends only on --uix-* tokens. */
|
|
7
|
+
@layer uix.components {
|
|
8
|
+
/* inline-size: a size container takes no width from its content, so in a shrink-to-fit parent
|
|
9
|
+
(a flex row) it would collapse to nothing */
|
|
10
|
+
.uix-matrix { container-type: inline-size; inline-size: 100%; min-width: 0; max-width: 100%; }
|
|
11
|
+
|
|
12
|
+
.uix-matrix__scroll {
|
|
13
|
+
--_head: clamp(7.5rem, 32cqi, 14rem);
|
|
14
|
+
--_cell: 7rem;
|
|
15
|
+
/* The column headers stick only in a scroller that scrolls: set --uix-matrix-max-height to
|
|
16
|
+
keep them in view down a long grid. The page scrolls it otherwise. */
|
|
17
|
+
max-height: var(--uix-matrix-max-height, none);
|
|
18
|
+
overflow: auto;
|
|
19
|
+
/* the sticky layers stay inside the grid, under a page's own sticky bar */
|
|
20
|
+
isolation: isolate;
|
|
21
|
+
/* keeps a cell the arrow keys reach clear of the row headers; useMatrixGrid does the same
|
|
22
|
+
for the column headers, whose height depends on their words */
|
|
23
|
+
scroll-padding-inline-start: var(--_head);
|
|
24
|
+
border: 1px solid var(--uix-border);
|
|
25
|
+
border-radius: var(--uix-radius-md);
|
|
26
|
+
}
|
|
27
|
+
.uix-matrix--heatmap .uix-matrix__scroll { --_cell: 5.5rem; }
|
|
28
|
+
|
|
29
|
+
/* Fixed: a cell keeps its width when its words change */
|
|
30
|
+
.uix-matrix__grid {
|
|
31
|
+
table-layout: fixed;
|
|
32
|
+
width: max(100%, calc(var(--_head) + var(--uix-matrix-columns, 1) * var(--_cell)));
|
|
33
|
+
border-collapse: separate;
|
|
34
|
+
border-spacing: 0;
|
|
35
|
+
font-size: var(--uix-text-meta);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.uix-matrix__corner, .uix-matrix__column, .uix-matrix__row {
|
|
39
|
+
position: sticky;
|
|
40
|
+
padding: var(--uix-space-2);
|
|
41
|
+
background: var(--uix-bg-subtle);
|
|
42
|
+
color: var(--uix-text-muted);
|
|
43
|
+
font-weight: 500;
|
|
44
|
+
text-align: start;
|
|
45
|
+
vertical-align: middle;
|
|
46
|
+
overflow-wrap: anywhere;
|
|
47
|
+
hyphens: auto;
|
|
48
|
+
}
|
|
49
|
+
.uix-matrix__corner, .uix-matrix__column { inset-block-start: 0; border-block-end: 1px solid var(--uix-border); z-index: var(--uix-z-raised); }
|
|
50
|
+
.uix-matrix__corner, .uix-matrix__row { inset-inline-start: 0; border-inline-end: 1px solid var(--uix-border); }
|
|
51
|
+
.uix-matrix__corner { width: var(--_head); z-index: var(--uix-z-sticky); }
|
|
52
|
+
.uix-matrix__row { z-index: var(--uix-z-raised); color: var(--uix-text); }
|
|
53
|
+
.uix-matrix__axis { display: block; }
|
|
54
|
+
.uix-matrix__axis--column { text-align: end; }
|
|
55
|
+
.uix-matrix__note { display: block; color: var(--uix-text-muted); font-weight: 400; }
|
|
56
|
+
|
|
57
|
+
/* relative: the containing block of the Select's hidden input and the visually hidden help,
|
|
58
|
+
which would otherwise escape the scroller and widen the page */
|
|
59
|
+
.uix-matrix__cell { position: relative; padding: var(--uix-space-1); vertical-align: top; }
|
|
60
|
+
|
|
61
|
+
/* A level's and a band's colour */
|
|
62
|
+
.uix-matrix [data-tone="neutral"] { --_tone-bg: var(--uix-neutral-bg); --_tone-fg: var(--uix-text); }
|
|
63
|
+
.uix-matrix [data-tone="info"] { --_tone-bg: var(--uix-info-bg); --_tone-fg: var(--uix-info-text); }
|
|
64
|
+
.uix-matrix [data-tone="success"] { --_tone-bg: var(--uix-success-bg); --_tone-fg: var(--uix-success-text); }
|
|
65
|
+
.uix-matrix [data-tone="warning"] { --_tone-bg: var(--uix-warning-bg); --_tone-fg: var(--uix-warning-text); }
|
|
66
|
+
.uix-matrix [data-tone="attention"] { --_tone-bg: var(--uix-attention-bg); --_tone-fg: var(--uix-attention-text); }
|
|
67
|
+
.uix-matrix [data-tone="danger"] { --_tone-bg: var(--uix-danger-bg); --_tone-fg: var(--uix-danger-text); }
|
|
68
|
+
|
|
69
|
+
/* MatrixInput: the cell is a Select, its value in the words of the level */
|
|
70
|
+
.uix-matrix__cell .uix-select {
|
|
71
|
+
width: 100%;
|
|
72
|
+
height: auto;
|
|
73
|
+
min-height: var(--uix-space-8);
|
|
74
|
+
padding-block: var(--uix-space-1);
|
|
75
|
+
padding-inline: var(--uix-space-2) var(--uix-space-6);
|
|
76
|
+
border-color: transparent;
|
|
77
|
+
background-color: var(--_tone-bg, transparent);
|
|
78
|
+
color: var(--_tone-fg, var(--uix-text));
|
|
79
|
+
}
|
|
80
|
+
/* a keyboard grid: where focus is must be plain, so the same solid ring as a heatmap tile */
|
|
81
|
+
.uix-matrix__cell .uix-select:focus-visible { outline: 2px solid var(--uix-ring); outline-offset: -2px; box-shadow: none; }
|
|
82
|
+
.uix-matrix__cell .uix-select::after { inset-inline-end: var(--uix-space-1); }
|
|
83
|
+
.uix-matrix__cell .uix-select[aria-readonly="true"] { padding-inline-end: var(--uix-space-2); }
|
|
84
|
+
/* a level's words are never cut off: they wrap in the cell */
|
|
85
|
+
.uix-matrix__cell :is(.uix-select__value, .uix-select__text) { overflow: visible; white-space: normal; overflow-wrap: anywhere; }
|
|
86
|
+
.uix-matrix__cell .uix-select[data-placeholder] { border-color: var(--uix-border); color: var(--uix-text-muted); }
|
|
87
|
+
/* "Not rated" is a value, so it is drawn apart from a level and from a cell with none */
|
|
88
|
+
.uix-matrix__cell .uix-select[data-unrated] { border: 1px dashed var(--uix-border-strong); color: var(--uix-text-muted); font-style: italic; }
|
|
89
|
+
.uix-matrix__cell .uix-select[data-locked] { opacity: .7; }
|
|
90
|
+
.uix-matrix__cell .uix-select[data-invalid] { border-color: var(--uix-danger-border); }
|
|
91
|
+
/* The corner mark says a cell has help to show, without colour */
|
|
92
|
+
.uix-matrix__cell:has([data-help])::after {
|
|
93
|
+
content: "";
|
|
94
|
+
position: absolute;
|
|
95
|
+
inset-block-start: var(--uix-space-1);
|
|
96
|
+
inset-inline-end: var(--uix-space-1);
|
|
97
|
+
border-block-start: var(--uix-space-2) solid var(--uix-border-strong);
|
|
98
|
+
border-inline-start: var(--uix-space-2) solid transparent;
|
|
99
|
+
border-start-end-radius: var(--uix-radius-sm);
|
|
100
|
+
pointer-events: none;
|
|
101
|
+
}
|
|
102
|
+
.uix-matrix__error { display: block; margin-block-start: var(--uix-space-1); color: var(--uix-danger-text); overflow-wrap: anywhere; }
|
|
103
|
+
.uix-matrix__help { min-height: 1lh; margin: var(--uix-space-2) 0 0; color: var(--uix-text-muted); font-size: var(--uix-text-meta); }
|
|
104
|
+
|
|
105
|
+
/* MatrixHeatmap: the cell is one control */
|
|
106
|
+
.uix-matrix__tile {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
width: 100%;
|
|
112
|
+
min-height: calc(var(--uix-space-8) * 2);
|
|
113
|
+
padding: var(--uix-space-1);
|
|
114
|
+
border: 1px solid color-mix(in srgb, var(--_tone-fg, var(--uix-border-strong)) 30%, transparent);
|
|
115
|
+
border-radius: var(--uix-radius-sm);
|
|
116
|
+
background: var(--_tone-bg, transparent);
|
|
117
|
+
color: var(--_tone-fg, var(--uix-text));
|
|
118
|
+
font: inherit;
|
|
119
|
+
text-align: center;
|
|
120
|
+
text-decoration: none;
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
}
|
|
123
|
+
.uix-matrix__tile[data-tone="neutral"] { border-color: var(--uix-border-strong); }
|
|
124
|
+
.uix-matrix__tile[aria-disabled="true"] { cursor: default; }
|
|
125
|
+
.uix-matrix__tile:focus-visible { outline: 2px solid var(--uix-ring); outline-offset: -2px; }
|
|
126
|
+
/* A cell the caller left out: no band and no figure, unlike a zero they chose to hide */
|
|
127
|
+
.uix-matrix__tile[data-empty] { border: 1px dashed var(--uix-border-strong); color: var(--uix-text-muted); }
|
|
128
|
+
.uix-matrix__count { font-size: var(--uix-text-body); font-weight: 600; font-variant-numeric: tabular-nums; }
|
|
129
|
+
.uix-matrix__band { overflow-wrap: anywhere; }
|
|
130
|
+
|
|
131
|
+
@media (hover: hover) and (pointer: fine) {
|
|
132
|
+
.uix-matrix__tile:hover { border-color: currentColor; }
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
.uix-save-status[data-state="saving"] .uix-save-status__icon { border: 1px solid var(--uix-border-strong); border-top-color: transparent; animation: uix-spin var(--uix-loop-spin) linear infinite; }
|
|
11
11
|
.uix-save-status[data-state="saved"] .uix-save-status__icon { background: var(--uix-success); }
|
|
12
12
|
.uix-save-status[data-state="failed"] { color: var(--uix-danger-text); }
|
|
13
|
+
/* A refusal is a sentence (HAR-2749): it wraps inside its container, however narrow. The text
|
|
14
|
+
starts from its longest word, so it stays beside the icon and a short one keeps its line, and
|
|
15
|
+
the retry drops under it when both no longer fit. Saving and Saved stay one short line. */
|
|
16
|
+
.uix-save-status[data-state="failed"] { flex-wrap: wrap; align-items: baseline; min-width: 0; max-width: 100%; white-space: normal; }
|
|
17
|
+
.uix-save-status[data-state="failed"] .uix-save-status__text { flex: 1 1 min-content; min-width: 0; overflow-wrap: break-word; }
|
|
18
|
+
.uix-save-status[data-state="failed"] .uix-save-status__retry { flex: none; }
|
|
13
19
|
.uix-save-status[data-state="failed"] .uix-save-status__icon { background: var(--uix-danger); }
|
|
14
20
|
|
|
15
21
|
@media (prefers-reduced-motion: reduce) {
|