@tensor_1/tokens 2.1.0 → 2.3.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.
@@ -23,6 +23,14 @@
23
23
  .uix-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--uix-space-2)); }
24
24
 
25
25
  .uix-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
26
+
27
+ /* elevation — apply the surface shadow tokens as a utility (cards/panels,
28
+ floating popovers/menus/dialogs, pressed/active pills). In dark mode
29
+ --uix-shadow-sm resolves to the inset top highlight, so elevated surfaces
30
+ keep their lift cue without a heavy drop shadow. */
31
+ .uix-elevated { box-shadow: var(--uix-shadow-sm); }
32
+ .uix-elevated-popover { box-shadow: var(--uix-shadow-popover); }
33
+ .uix-elevated-pill { box-shadow: var(--uix-shadow-sm); }
26
34
  }
27
35
  /* uix motion — shared keyframes, enter/exit helpers, and the reduced-motion guard.
28
36
  Components reference these tokens/keyframes; overlays pair the helpers with @starting-style. */
@@ -1023,9 +1031,10 @@
1023
1031
  }
1024
1032
  /* uix image lightbox — native <dialog>, click a thumbnail to enlarge. Depends only on --uix-* tokens. */
1025
1033
  @layer uix.components {
1026
- /* margin:auto centers the modal <dialog> in the viewport — required because base.css
1027
- resets `* { margin: 0 }`, which zeroes the UA dialog's own margin:auto (it would otherwise
1028
- pin to the top-left). Matches .uix-dialog. */
1034
+ /* margin:auto centers the modal <dialog> in the viewport. Set explicitly (not
1035
+ left to the UA default) so centering is robust regardless of any consumer
1036
+ reset — base.css scopes its margin reset to typographic/form elements and
1037
+ deliberately leaves <dialog> alone. Matches .uix-dialog. */
1029
1038
  .uix-lightbox { margin: auto; border: 0; background: transparent; padding: 0; max-width: 92vw; max-height: 92vh; box-shadow: var(--uix-shadow-overlay); overflow: visible; }
1030
1039
  /* A definite width is required: an SVG with a viewBox but no intrinsic width/height collapses to
1031
1040
  0×0 under width:auto, which then shrink-wraps the fit-content <dialog> to nothing (nothing shows
@@ -51,6 +51,8 @@
51
51
  --uix-danger-fg: #FFFFFF;
52
52
  --uix-danger-bg: #FFE4E6;
53
53
  --uix-danger-text: #C20012;
54
+ --uix-amber: #C98A1E;
55
+ --uix-amber-text: #795006;
54
56
  --uix-success-solid: #10B981;
55
57
  --uix-warning-solid: #F59E0B;
56
58
  --uix-info-solid: #2563EB;
@@ -175,6 +177,8 @@
175
177
  --uix-danger-fg: #FFFFFF;
176
178
  --uix-danger-bg: rgba(220,38,38,.20);
177
179
  --uix-danger-text: #F87171;
180
+ --uix-amber: #E6B25C;
181
+ --uix-amber-text: #E6B25C;
178
182
  --uix-success-solid: #34D399;
179
183
  --uix-warning-solid: #FBBF24;
180
184
  --uix-info-solid: #3B82F6;
@@ -201,7 +205,17 @@
201
205
  /* Fonts load via the Google Fonts <link> in index.html (Inter + IBM Plex Sans + IBM Plex Mono). */
202
206
  @layer uix.base {
203
207
  *, *::before, *::after { box-sizing: border-box; }
204
- * { margin: 0; }
208
+ /* Zero default UA margins on the elements that actually carry them — NOT a
209
+ bare `* { margin: 0 }`. The universal form lives in the `uix.base` layer,
210
+ which a Tailwind consumer orders ABOVE its own `utilities`, so a bare `*`
211
+ reset silently beat every margin utility (`mb-2`, `mt-4`, `space-y-*`) on
212
+ arbitrary layout elements (divs/sections) — the "no spacing between
213
+ components" bug. Scoping to typographic/default-margin elements (the same
214
+ set Tailwind's own preflight resets) keeps the standalone styleguide's
215
+ vertical rhythm while leaving layout elements free for consumer margins. */
216
+ body, h1, h2, h3, h4, h5, h6, p, blockquote, figure, figcaption,
217
+ dl, dd, ol, ul, menu, fieldset, hr, pre,
218
+ button, input, optgroup, select, textarea { margin: 0; }
205
219
 
206
220
  html { -webkit-text-size-adjust: 100%; }
207
221
  /* default theme follows the OS until JS sets data-theme */
@@ -272,6 +286,14 @@
272
286
  .uix-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--uix-space-2)); }
273
287
 
274
288
  .uix-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
289
+
290
+ /* elevation — apply the surface shadow tokens as a utility (cards/panels,
291
+ floating popovers/menus/dialogs, pressed/active pills). In dark mode
292
+ --uix-shadow-sm resolves to the inset top highlight, so elevated surfaces
293
+ keep their lift cue without a heavy drop shadow. */
294
+ .uix-elevated { box-shadow: var(--uix-shadow-sm); }
295
+ .uix-elevated-popover { box-shadow: var(--uix-shadow-popover); }
296
+ .uix-elevated-pill { box-shadow: var(--uix-shadow-sm); }
275
297
  }
276
298
  /* uix motion — shared keyframes, enter/exit helpers, and the reduced-motion guard.
277
299
  Components reference these tokens/keyframes; overlays pair the helpers with @starting-style. */
@@ -924,6 +946,51 @@
924
946
  .uix-dl dt { color: var(--uix-text-muted); font-size: var(--uix-text-meta); }
925
947
  .uix-dl dd { color: var(--uix-text); font-size: var(--uix-text-body); margin: 0; }
926
948
  }
949
+ /* uix typography utilities — class-based application of the --uix-text-* scale.
950
+ A `<span class="uix-text-h3">` reads identically to an `<h3>`; consumers reach
951
+ for these instead of re-deriving the scale inline. (House products migrating
952
+ off bespoke `type-*` classes map 1:1 onto these — same sizes/leading/weights.)
953
+ Depends only on --uix-* tokens. */
954
+ @layer uix.components {
955
+ .uix-text-display {
956
+ font-size: var(--uix-text-display); line-height: var(--uix-leading-display);
957
+ font-weight: 400; letter-spacing: var(--uix-tracking-tight); color: var(--uix-text);
958
+ }
959
+ .uix-text-h1 {
960
+ font-size: var(--uix-text-display); line-height: var(--uix-leading-display);
961
+ font-weight: 400; letter-spacing: var(--uix-tracking-tight); color: var(--uix-text);
962
+ }
963
+ .uix-text-h2 {
964
+ font-size: var(--uix-text-h2); line-height: var(--uix-leading-h2);
965
+ font-weight: 400; letter-spacing: -0.01em; color: var(--uix-text);
966
+ }
967
+ .uix-text-h3 {
968
+ font-size: var(--uix-text-h3); line-height: var(--uix-leading-h3);
969
+ font-weight: 700; color: var(--uix-text);
970
+ }
971
+ .uix-text-body {
972
+ font-size: var(--uix-text-body); line-height: var(--uix-leading-body);
973
+ font-weight: 400; color: var(--uix-text);
974
+ }
975
+ .uix-text-body-hushed {
976
+ font-size: var(--uix-text-body); line-height: var(--uix-leading-body);
977
+ font-weight: 400; color: var(--uix-text-hushed);
978
+ }
979
+ .uix-text-meta {
980
+ font-size: var(--uix-text-meta); line-height: var(--uix-leading-meta);
981
+ font-weight: 400; color: var(--uix-text-hushed);
982
+ }
983
+ .uix-text-eyebrow {
984
+ font-size: var(--uix-text-eyebrow); line-height: var(--uix-leading-eyebrow);
985
+ font-weight: 700; letter-spacing: var(--uix-tracking-eyebrow);
986
+ text-transform: uppercase; color: var(--uix-text-hushed);
987
+ }
988
+ .uix-text-data-hero {
989
+ font-size: var(--uix-text-data-hero); line-height: 1.1;
990
+ font-weight: 400; letter-spacing: -0.01em; color: var(--uix-text);
991
+ font-variant-numeric: tabular-nums;
992
+ }
993
+ }
927
994
  /* uix avatar / avatar-group / user-chip — depends only on --uix-* tokens. */
928
995
  @layer uix.components {
929
996
  .uix-avatar {
@@ -1272,9 +1339,10 @@
1272
1339
  }
1273
1340
  /* uix image lightbox — native <dialog>, click a thumbnail to enlarge. Depends only on --uix-* tokens. */
1274
1341
  @layer uix.components {
1275
- /* margin:auto centers the modal <dialog> in the viewport — required because base.css
1276
- resets `* { margin: 0 }`, which zeroes the UA dialog's own margin:auto (it would otherwise
1277
- pin to the top-left). Matches .uix-dialog. */
1342
+ /* margin:auto centers the modal <dialog> in the viewport. Set explicitly (not
1343
+ left to the UA default) so centering is robust regardless of any consumer
1344
+ reset — base.css scopes its margin reset to typographic/form elements and
1345
+ deliberately leaves <dialog> alone. Matches .uix-dialog. */
1278
1346
  .uix-lightbox { margin: auto; border: 0; background: transparent; padding: 0; max-width: 92vw; max-height: 92vh; box-shadow: var(--uix-shadow-overlay); overflow: visible; }
1279
1347
  /* A definite width is required: an SVG with a viewBox but no intrinsic width/height collapses to
1280
1348
  0×0 under width:auto, which then shrink-wraps the fit-content <dialog> to nothing (nothing shows
@@ -40,6 +40,8 @@
40
40
  --uix-danger-fg: #FFFFFF;
41
41
  --uix-danger-bg: #FFE4E6;
42
42
  --uix-danger-text: #C20012;
43
+ --uix-amber: #C98A1E;
44
+ --uix-amber-text: #795006;
43
45
  --uix-success-solid: #10B981;
44
46
  --uix-warning-solid: #F59E0B;
45
47
  --uix-info-solid: #2563EB;
@@ -164,6 +166,8 @@
164
166
  --uix-danger-fg: #FFFFFF;
165
167
  --uix-danger-bg: rgba(220,38,38,.20);
166
168
  --uix-danger-text: #F87171;
169
+ --uix-amber: #E6B25C;
170
+ --uix-amber-text: #E6B25C;
167
171
  --uix-success-solid: #34D399;
168
172
  --uix-warning-solid: #FBBF24;
169
173
  --uix-info-solid: #3B82F6;
@@ -41,6 +41,8 @@ module.exports = {
41
41
  "uix-danger-fg": "var(--uix-danger-fg)",
42
42
  "uix-danger-bg": "var(--uix-danger-bg)",
43
43
  "uix-danger-text": "var(--uix-danger-text)",
44
+ "uix-amber": "var(--uix-amber)",
45
+ "uix-amber-text": "var(--uix-amber-text)",
44
46
  "uix-success-solid": "var(--uix-success-solid)",
45
47
  "uix-warning-solid": "var(--uix-warning-solid)",
46
48
  "uix-info-solid": "var(--uix-info-solid)",
@@ -38,6 +38,8 @@
38
38
  --color-uix-danger-fg: var(--uix-danger-fg);
39
39
  --color-uix-danger-bg: var(--uix-danger-bg);
40
40
  --color-uix-danger-text: var(--uix-danger-text);
41
+ --color-uix-amber: var(--uix-amber);
42
+ --color-uix-amber-text: var(--uix-amber-text);
41
43
  --color-uix-success-solid: var(--uix-success-solid);
42
44
  --color-uix-warning-solid: var(--uix-warning-solid);
43
45
  --color-uix-info-solid: var(--uix-info-solid);
@@ -1,5 +1,5 @@
1
1
  /* GENERATED — do not edit. */
2
- export type UixTokenName = "bg-app" | "bg-subtle" | "bg-hover" | "bg-active" | "surface" | "surface-2" | "surface-3" | "border" | "border-strong" | "text" | "text-hushed" | "text-muted" | "text-reverse" | "text-hushed-reverse" | "accent" | "accent-dark" | "accent-light" | "accent-hover" | "accent-fg" | "link" | "ring" | "brand-muted" | "success" | "success-fg" | "success-bg" | "warning" | "warning-fg" | "warning-bg" | "warning-text" | "info" | "info-fg" | "info-bg" | "info-text" | "danger" | "danger-fg" | "danger-bg" | "danger-text" | "success-solid" | "warning-solid" | "info-solid" | "danger-solid" | "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "chart-6" | "chart-7" | "chart-8" | "chart-neutral" | "row" | "row-alt" | "row-pinned-bg" | "scrollbar-thumb" | "scrollbar-thumb-hover" | "scrollbar-track" | "scrim" | "scrim-strong" | "shadow-sm" | "shadow-popover" | "shadow-overlay" | "highlight-top" | "ease-out" | "ease-out-strong" | "ease-in" | "ease-in-out" | "ease-spring" | "dur-fast" | "dur" | "dur-slow" | "dur-slower" | "lift" | "z-raised" | "z-sticky" | "z-dropdown" | "z-overlay" | "z-tooltip" | "z-toast" | "radius-xs" | "radius-sm" | "radius-md" | "radius-lg" | "radius-pill" | "row-h" | "row-h-compact" | "row-h-comfortable" | "control-h" | "sidebar-w" | "topbar-h" | "scrollbar-size" | "icon-sm" | "icon-md" | "icon-lg" | "peek-w" | "space-0" | "space-1" | "space-2" | "space-3" | "space-4" | "space-5" | "space-6" | "space-7" | "space-8" | "space-9" | "space-10" | "space-11" | "space-12" | "font-sans" | "font-heading" | "font-mono" | "text-display" | "leading-display" | "text-data-hero" | "leading-data-hero" | "text-h2" | "leading-h2" | "text-h3" | "leading-h3" | "text-body" | "leading-body" | "text-meta" | "leading-meta" | "text-eyebrow" | "leading-eyebrow" | "tracking-tight" | "tracking-eyebrow";
2
+ export type UixTokenName = "bg-app" | "bg-subtle" | "bg-hover" | "bg-active" | "surface" | "surface-2" | "surface-3" | "border" | "border-strong" | "text" | "text-hushed" | "text-muted" | "text-reverse" | "text-hushed-reverse" | "accent" | "accent-dark" | "accent-light" | "accent-hover" | "accent-fg" | "link" | "ring" | "brand-muted" | "success" | "success-fg" | "success-bg" | "warning" | "warning-fg" | "warning-bg" | "warning-text" | "info" | "info-fg" | "info-bg" | "info-text" | "danger" | "danger-fg" | "danger-bg" | "danger-text" | "amber" | "amber-text" | "success-solid" | "warning-solid" | "info-solid" | "danger-solid" | "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "chart-6" | "chart-7" | "chart-8" | "chart-neutral" | "row" | "row-alt" | "row-pinned-bg" | "scrollbar-thumb" | "scrollbar-thumb-hover" | "scrollbar-track" | "scrim" | "scrim-strong" | "shadow-sm" | "shadow-popover" | "shadow-overlay" | "highlight-top" | "ease-out" | "ease-out-strong" | "ease-in" | "ease-in-out" | "ease-spring" | "dur-fast" | "dur" | "dur-slow" | "dur-slower" | "lift" | "z-raised" | "z-sticky" | "z-dropdown" | "z-overlay" | "z-tooltip" | "z-toast" | "radius-xs" | "radius-sm" | "radius-md" | "radius-lg" | "radius-pill" | "row-h" | "row-h-compact" | "row-h-comfortable" | "control-h" | "sidebar-w" | "topbar-h" | "scrollbar-size" | "icon-sm" | "icon-md" | "icon-lg" | "peek-w" | "space-0" | "space-1" | "space-2" | "space-3" | "space-4" | "space-5" | "space-6" | "space-7" | "space-8" | "space-9" | "space-10" | "space-11" | "space-12" | "font-sans" | "font-heading" | "font-mono" | "text-display" | "leading-display" | "text-data-hero" | "leading-data-hero" | "text-h2" | "leading-h2" | "text-h3" | "leading-h3" | "text-body" | "leading-body" | "text-meta" | "leading-meta" | "text-eyebrow" | "leading-eyebrow" | "tracking-tight" | "tracking-eyebrow";
3
3
  export declare const cssVar: Record<UixTokenName, string>;
4
4
  export declare const light: Record<UixTokenName, string>;
5
5
  export declare const dark: Partial<Record<UixTokenName, string>>;
@@ -41,6 +41,8 @@ export const cssVar = {
41
41
  "danger-fg": "var(--uix-danger-fg)",
42
42
  "danger-bg": "var(--uix-danger-bg)",
43
43
  "danger-text": "var(--uix-danger-text)",
44
+ "amber": "var(--uix-amber)",
45
+ "amber-text": "var(--uix-amber-text)",
44
46
  "success-solid": "var(--uix-success-solid)",
45
47
  "warning-solid": "var(--uix-warning-solid)",
46
48
  "info-solid": "var(--uix-info-solid)",
@@ -170,6 +172,8 @@ export const light = {
170
172
  "danger-fg": "#FFFFFF",
171
173
  "danger-bg": "#FFE4E6",
172
174
  "danger-text": "#C20012",
175
+ "amber": "#C98A1E",
176
+ "amber-text": "#795006",
173
177
  "success-solid": "#10B981",
174
178
  "warning-solid": "#F59E0B",
175
179
  "info-solid": "#2563EB",
@@ -294,6 +298,8 @@ export const dark = {
294
298
  "danger-fg": "#FFFFFF",
295
299
  "danger-bg": "rgba(220,38,38,.20)",
296
300
  "danger-text": "#F87171",
301
+ "amber": "#E6B25C",
302
+ "amber-text": "#E6B25C",
297
303
  "success-solid": "#34D399",
298
304
  "warning-solid": "#FBBF24",
299
305
  "info-solid": "#3B82F6",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tensor_1/tokens",
3
- "version": "2.1.0",
3
+ "version": "2.3.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,8 @@
39
39
  "danger-fg": { "$type": "color", "$value": "#FFFFFF" },
40
40
  "danger-bg": { "$type": "color", "$value": "#FFE4E6" },
41
41
  "danger-text": { "$type": "color", "$value": "#C20012", "$description": "Danger-toned TEXT, legible on --uix-danger-bg (the bright --uix-danger #E40014 is only 4.05:1 on #FFE4E6). A hand-darkened red for text; --uix-danger stays the SOLID role (danger button bg, critical pill, dots). Dark mode brightens it. Used by pill/alert/stat-trend/field-error/menu/sla/node/audit --danger." },
42
+ "amber": { "$type": "color", "$value": "#C98A1E", "$description": "SEV-3 / medium-severity tone — the third tier of the severity ramp (danger = SEV-1, warning = SEV-2, amber = SEV-3). A muted ochre, deliberately distinct from the brighter --uix-warning so the three tiers read apart." },
43
+ "amber-text": { "$type": "color", "$value": "#795006", "$description": "Amber-toned TEXT, legible on a faint amber tint and on dark surfaces (the SEV-3 ochre is too light as text on pale fills). Dark mode brightens it to track --uix-amber. Used by severity-3 badges." },
42
44
 
43
45
  "success-solid": { "$type": "color", "$value": "#10B981", "$description": "SOLID status role — the vivid fill/dot/pulse color, distinct from the legible TEXT role (--uix-success). Products override per brand." },
44
46
  "warning-solid": { "$type": "color", "$value": "#F59E0B", "$description": "SOLID status role (see success-solid)." },
@@ -34,6 +34,8 @@
34
34
  "danger-fg": { "$type": "color", "$value": "#FFFFFF" },
35
35
  "danger-bg": { "$type": "color", "$value": "rgba(220,38,38,.20)" },
36
36
  "danger-text": { "$type": "color", "$value": "#F87171", "$description": "On dark, the deep --uix-danger #DC2626 fails as text on the faint danger tint and on plain surfaces — brightened so pill/field-error/stat-trend/menu/node/audit text reads AA. --uix-danger stays the solid critical-pill / button bg (with white --uix-danger-fg)." },
37
+ "amber": { "$type": "color", "$value": "#E6B25C", "$description": "SEV-3 tone lightened for dark surfaces (the light-mode ochre #C98A1E is too dark on dark)." },
38
+ "amber-text": { "$type": "color", "$value": "#E6B25C", "$description": "On dark the lightened amber reads as text directly — tracks --uix-amber." },
37
39
 
38
40
  "success-solid": { "$type": "color", "$value": "#34D399" },
39
41
  "warning-solid": { "$type": "color", "$value": "#FBBF24" },