@tensor_1/tokens 2.1.0 → 2.2.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
@@ -201,7 +201,17 @@
201
201
  /* Fonts load via the Google Fonts <link> in index.html (Inter + IBM Plex Sans + IBM Plex Mono). */
202
202
  @layer uix.base {
203
203
  *, *::before, *::after { box-sizing: border-box; }
204
- * { margin: 0; }
204
+ /* Zero default UA margins on the elements that actually carry them — NOT a
205
+ bare `* { margin: 0 }`. The universal form lives in the `uix.base` layer,
206
+ which a Tailwind consumer orders ABOVE its own `utilities`, so a bare `*`
207
+ reset silently beat every margin utility (`mb-2`, `mt-4`, `space-y-*`) on
208
+ arbitrary layout elements (divs/sections) — the "no spacing between
209
+ components" bug. Scoping to typographic/default-margin elements (the same
210
+ set Tailwind's own preflight resets) keeps the standalone styleguide's
211
+ vertical rhythm while leaving layout elements free for consumer margins. */
212
+ body, h1, h2, h3, h4, h5, h6, p, blockquote, figure, figcaption,
213
+ dl, dd, ol, ul, menu, fieldset, hr, pre,
214
+ button, input, optgroup, select, textarea { margin: 0; }
205
215
 
206
216
  html { -webkit-text-size-adjust: 100%; }
207
217
  /* default theme follows the OS until JS sets data-theme */
@@ -272,6 +282,14 @@
272
282
  .uix-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--uix-space-2)); }
273
283
 
274
284
  .uix-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
285
+
286
+ /* elevation — apply the surface shadow tokens as a utility (cards/panels,
287
+ floating popovers/menus/dialogs, pressed/active pills). In dark mode
288
+ --uix-shadow-sm resolves to the inset top highlight, so elevated surfaces
289
+ keep their lift cue without a heavy drop shadow. */
290
+ .uix-elevated { box-shadow: var(--uix-shadow-sm); }
291
+ .uix-elevated-popover { box-shadow: var(--uix-shadow-popover); }
292
+ .uix-elevated-pill { box-shadow: var(--uix-shadow-sm); }
275
293
  }
276
294
  /* uix motion — shared keyframes, enter/exit helpers, and the reduced-motion guard.
277
295
  Components reference these tokens/keyframes; overlays pair the helpers with @starting-style. */
@@ -924,6 +942,51 @@
924
942
  .uix-dl dt { color: var(--uix-text-muted); font-size: var(--uix-text-meta); }
925
943
  .uix-dl dd { color: var(--uix-text); font-size: var(--uix-text-body); margin: 0; }
926
944
  }
945
+ /* uix typography utilities — class-based application of the --uix-text-* scale.
946
+ A `<span class="uix-text-h3">` reads identically to an `<h3>`; consumers reach
947
+ for these instead of re-deriving the scale inline. (House products migrating
948
+ off bespoke `type-*` classes map 1:1 onto these — same sizes/leading/weights.)
949
+ Depends only on --uix-* tokens. */
950
+ @layer uix.components {
951
+ .uix-text-display {
952
+ font-size: var(--uix-text-display); line-height: var(--uix-leading-display);
953
+ font-weight: 400; letter-spacing: var(--uix-tracking-tight); color: var(--uix-text);
954
+ }
955
+ .uix-text-h1 {
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-h2 {
960
+ font-size: var(--uix-text-h2); line-height: var(--uix-leading-h2);
961
+ font-weight: 400; letter-spacing: -0.01em; color: var(--uix-text);
962
+ }
963
+ .uix-text-h3 {
964
+ font-size: var(--uix-text-h3); line-height: var(--uix-leading-h3);
965
+ font-weight: 700; color: var(--uix-text);
966
+ }
967
+ .uix-text-body {
968
+ font-size: var(--uix-text-body); line-height: var(--uix-leading-body);
969
+ font-weight: 400; color: var(--uix-text);
970
+ }
971
+ .uix-text-body-hushed {
972
+ font-size: var(--uix-text-body); line-height: var(--uix-leading-body);
973
+ font-weight: 400; color: var(--uix-text-hushed);
974
+ }
975
+ .uix-text-meta {
976
+ font-size: var(--uix-text-meta); line-height: var(--uix-leading-meta);
977
+ font-weight: 400; color: var(--uix-text-hushed);
978
+ }
979
+ .uix-text-eyebrow {
980
+ font-size: var(--uix-text-eyebrow); line-height: var(--uix-leading-eyebrow);
981
+ font-weight: 700; letter-spacing: var(--uix-tracking-eyebrow);
982
+ text-transform: uppercase; color: var(--uix-text-hushed);
983
+ }
984
+ .uix-text-data-hero {
985
+ font-size: var(--uix-text-data-hero); line-height: 1.1;
986
+ font-weight: 400; letter-spacing: -0.01em; color: var(--uix-text);
987
+ font-variant-numeric: tabular-nums;
988
+ }
989
+ }
927
990
  /* uix avatar / avatar-group / user-chip — depends only on --uix-* tokens. */
928
991
  @layer uix.components {
929
992
  .uix-avatar {
@@ -1272,9 +1335,10 @@
1272
1335
  }
1273
1336
  /* uix image lightbox — native <dialog>, click a thumbnail to enlarge. Depends only on --uix-* tokens. */
1274
1337
  @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. */
1338
+ /* margin:auto centers the modal <dialog> in the viewport. Set explicitly (not
1339
+ left to the UA default) so centering is robust regardless of any consumer
1340
+ reset — base.css scopes its margin reset to typographic/form elements and
1341
+ deliberately leaves <dialog> alone. Matches .uix-dialog. */
1278
1342
  .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
1343
  /* A definite width is required: an SVG with a viewBox but no intrinsic width/height collapses to
1280
1344
  0×0 under width:auto, which then shrink-wraps the fit-content <dialog> to nothing (nothing shows
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tensor_1/tokens",
3
- "version": "2.1.0",
3
+ "version": "2.2.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",