@nswds/tokens 3.6.0 → 3.8.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.
Files changed (35) hide show
  1. package/README.md +22 -1
  2. package/dist/css/motion/global.css +8 -0
  3. package/dist/css/z-index/global.css +10 -0
  4. package/dist/index.cjs +199 -57
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +147 -0
  7. package/dist/index.d.ts +147 -0
  8. package/dist/index.js +199 -57
  9. package/dist/index.js.map +1 -1
  10. package/dist/js/motion/global.d.ts +10 -0
  11. package/dist/js/motion/global.js +10 -0
  12. package/dist/js/z-index/global.d.ts +10 -0
  13. package/dist/js/z-index/global.js +10 -0
  14. package/dist/json/motion/global.json +12 -0
  15. package/dist/json/z-index/global.json +12 -0
  16. package/dist/less/motion/global.less +6 -0
  17. package/dist/less/z-index/global.less +8 -0
  18. package/dist/scss/motion/global.scss +6 -0
  19. package/dist/scss/z-index/global.scss +8 -0
  20. package/dist/tailwind/motion/global.css +8 -0
  21. package/dist/tailwind/preset.css +24 -0
  22. package/dist/tailwind/z-index/global.css +10 -0
  23. package/dist/tokens/border.base.json +12 -4
  24. package/dist/tokens/breakpoints.base.json +15 -5
  25. package/dist/tokens/global/motion/canonical.json +45 -0
  26. package/dist/tokens/global/z-index/canonical.json +44 -0
  27. package/dist/tokens/primitives-global.light.json +1032 -344
  28. package/dist/tokens/primitives-semantic.light.json +228 -76
  29. package/dist/tokens/radius.base.json +15 -5
  30. package/dist/tokens/space.base.json +36 -12
  31. package/dist/tokens/themes-masterbrand.light.json +171 -57
  32. package/dist/tokens/typography.base.json +93 -31
  33. package/dist/ts/motion/global.ts +10 -0
  34. package/dist/ts/z-index/global.ts +10 -0
  35. package/package.json +1 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![npm version](https://img.shields.io/npm/v/%40nswds%2Ftokens)](https://www.npmjs.com/package/@nswds/tokens)
5
5
 
6
6
  Design tokens for the NSW Design System — colour, spacing, typography, radius,
7
- breakpoints, borders, and shadows — plus related brand assets.
7
+ breakpoints, borders, shadows, motion, and z-index — plus related brand assets.
8
8
 
9
9
  The published package ships:
10
10
 
@@ -23,6 +23,8 @@ The published package ships:
23
23
  - **Spacing** (4px-grid rem scale), **radius**, **breakpoints**, **border widths**,
24
24
  **shadows** (elevation ramp + inset rings), and **typography** (font stacks, sizes,
25
25
  weights, line-heights, tracking) — with semantic typography styles (`heading-1`…`code`)
26
+ - **Motion** (durations + cubic-bezier easings) and **z-index** scale — DRAFT, pending
27
+ design review
26
28
  - DTCG 2025.10-compliant raw token JSON under `@nswds/tokens/tokens/*`
27
29
  - Tailwind CSS v4 `@theme` files for every category
28
30
  - Root JS API for consuming token collections directly
@@ -93,6 +95,23 @@ Each category publishes per-format files named by layer:
93
95
  The same values are available as SCSS/LESS variables and JS/JSON modules, e.g.
94
96
  `@nswds/tokens/js/radius/global.js` exports `radius = { none: '0px', sm: '4px', … }`.
95
97
 
98
+ > ⚠️ **Motion and z-index values are DRAFT** pending design review — the scales (and the
99
+ > mapping of names to numbers) may change before they are confirmed. They are published so
100
+ > the wiring is in place; treat the specific values as provisional.
101
+
102
+ ```css
103
+ @import '@nswds/tokens/css/motion/global.css'; /* --duration-* + --easing-* */
104
+ @import '@nswds/tokens/css/z-index/global.css'; /* --z-index-base … --z-index-tooltip */
105
+
106
+ .drawer {
107
+ transition: transform var(--duration-base) var(--easing-decelerate);
108
+ z-index: var(--z-index-modal);
109
+ }
110
+ ```
111
+
112
+ `duration.*` are CSS times (`150ms`), `easing.*` are `cubic-bezier(…)` timing functions,
113
+ and `z-index.*` are plain integers.
114
+
96
115
  ### 4. Typography
97
116
 
98
117
  ```css
@@ -182,6 +201,8 @@ categories carry direct values (one import each):
182
201
  | `tailwind/typography/global.css` | `--font-*`, `--text-*`, `--font-weight-*`, `--leading-*`, `--tracking-*` | `font-sans`, `text-16`, `leading-base`, … |
183
202
  | `tailwind/shadow/global.css` | `--shadow-*`, `--inset-shadow-*` | `shadow-md`, `inset-shadow-thin`, … |
184
203
  | `tailwind/border/global.css` | `--border-width-*` (plain vars; no native namespace) | arbitrary values: `border-[length:var(--border-width-thick)]` |
204
+ | `tailwind/motion/global.css` | `--ease-*` (native); `--duration-*` (plain vars) | `ease-standard`; `duration-[var(--duration-fast)]` |
205
+ | `tailwind/z-index/global.css` | `--z-index-*` (plain vars; no native namespace) | arbitrary values: `z-[var(--z-index-modal)]` |
185
206
 
186
207
  ```css
187
208
  @import 'tailwindcss';
@@ -0,0 +1,8 @@
1
+ :root {
2
+ --duration-fast: 150ms; /** Fast — quick feedback on small elements (hovers, toggles, focus rings). DRAFT pending design review. */
3
+ --duration-base: 250ms; /** Base — the default duration for most UI transitions. DRAFT pending design review. */
4
+ --duration-slow: 400ms; /** Slow — larger surfaces entering or leaving (modals, drawers, sheets). DRAFT pending design review. */
5
+ --easing-standard: cubic-bezier(0.4, 0, 0.2, 1); /** Standard ease-in-out — the default curve for elements moving within the viewport. DRAFT pending design review. */
6
+ --easing-decelerate: cubic-bezier(0, 0, 0.2, 1); /** Decelerate (ease-out) — elements entering the screen, fast then settling. DRAFT pending design review. */
7
+ --easing-accelerate: cubic-bezier(0.4, 0, 1, 1); /** Accelerate (ease-in) — elements leaving the screen, building speed as they exit. DRAFT pending design review. */
8
+ }
@@ -0,0 +1,10 @@
1
+ :root {
2
+ --z-index-base: 0; /** Base stacking level (0) — default in-flow content. DRAFT pending design review. */
3
+ --z-index-dropdown: 1000; /** Dropdown menus and select popups. DRAFT pending design review. */
4
+ --z-index-sticky: 1100; /** Sticky elements that pin on scroll (headers, toolbars). DRAFT pending design review. */
5
+ --z-index-overlay: 1200; /** Full-screen overlay scrims sitting behind modal content. DRAFT pending design review. */
6
+ --z-index-modal: 1300; /** Modal dialogs and side sheets. DRAFT pending design review. */
7
+ --z-index-popover: 1400; /** Popovers anchored to a trigger, above modals. DRAFT pending design review. */
8
+ --z-index-toast: 1500; /** Toast and snackbar notifications. DRAFT pending design review. */
9
+ --z-index-tooltip: 1600; /** Tooltips — the top-most interactive layer. DRAFT pending design review. */
10
+ }