@phcdevworks/spectre-ui 1.8.0 → 2.0.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/CHANGELOG.md CHANGED
@@ -6,6 +6,98 @@ reflects package releases published to npm.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.0.0] - 2026-06-17
10
+
11
+ Release Title: Token 3 Alignment
12
+
13
+ Contract change type: breaking
14
+
15
+ ### Changed
16
+
17
+ - **Token Alignment**: Updated `@phcdevworks/spectre-tokens` dependency to
18
+ `^3.0.0` and refreshed lockfile metadata against the latest published token
19
+ package. This is a major release because the upstream token package moved to
20
+ a breaking `3.0.0` contract.
21
+ - **Avatar Surface Role**: Updated Avatar background role mappings from the
22
+ removed upstream `--sp-surface-alternate` token to
23
+ `--sp-surface-subtle`, preserving the existing Avatar class and recipe
24
+ contract while matching the v3 token surface.
25
+ - **Release Readiness**: Updated package manager and development dependency
26
+ metadata, including the `esbuild` override and allowed script entry required
27
+ by the refreshed build stack.
28
+ - **Roadmap Accuracy**: Corrected the token-gap notes in `TODO.md` after
29
+ verifying the published `@phcdevworks/spectre-tokens@3.0.0` package: link,
30
+ interactive surface state, and divider tokens remain blocked.
31
+
32
+ ## [1.9.0] - 2026-06-10
33
+
34
+ Release Title: Component Recipe Expansion
35
+
36
+ Contract change type: additive
37
+
38
+ ### Added
39
+
40
+ - **Nav Recipe**: Added `getNavClasses`, `getNavLinksClasses`, and
41
+ `getNavLinkClasses` recipes plus `.sp-nav`, `.sp-nav__links`, and
42
+ `.sp-nav__link` CSS in `src/styles/components.css`. Consumes the new
43
+ `component.nav` tokens (`nav.bg`, `nav.text`, `nav.link`, `nav.linkHover`,
44
+ `nav.linkActive`, `nav.border`) published in
45
+ `@phcdevworks/spectre-tokens@2.9.0`. `getNavClasses` supports `bordered`,
46
+ `sticky`, and `fullWidth`; `getNavLinkClasses` supports `active`, `disabled`,
47
+ `hovered`, and `focused`. This is the first of the five Phase 4 component
48
+ recipes in `TODO.md`. Raised the `components.css` size budget in
49
+ `tests/css-entrypoints.test.ts` from 92000 to 96000 bytes.
50
+
51
+ - **Toast Recipe**: Added `getToastClasses` and `getToastIconClasses` recipes
52
+ plus `.sp-toast` and `.sp-toast__icon` CSS in `src/styles/components.css`.
53
+ Consumes the new `component.toast` tokens (`toast.{success,warning,danger,info}.{bg,text,border,icon}`)
54
+ published in `@phcdevworks/spectre-tokens@2.9.0`. `getToastClasses` supports
55
+ `info`, `success`, `warning`, and `danger` variants plus `dismissed` and
56
+ `fullWidth`; `getToastIconClasses` mirrors the same variants for icon color.
57
+ This is the second of the five Phase 4 component recipes in `TODO.md`.
58
+ Raised the `components.css` size budget in `tests/css-entrypoints.test.ts`
59
+ from 96000 to 100000 bytes.
60
+
61
+ - **Tooltip Recipe**: Added `getTooltipClasses` recipe plus `.sp-tooltip` CSS
62
+ in `src/styles/components.css`. Consumes the new `component.tooltip` tokens
63
+ (`tooltip.bg`, `tooltip.text`, `tooltip.border`) along with the existing
64
+ `--sp-opacity-tooltip` and `--sp-z-index-tooltip` primitives published in
65
+ `@phcdevworks/spectre-tokens@2.9.0`. `getTooltipClasses` supports `top`,
66
+ `bottom`, `left`, and `right` placements plus a `visible` flag. This is the
67
+ third of the five Phase 4 component recipes in `TODO.md`.
68
+
69
+ - **Dropdown Recipe**: Added `getDropdownClasses`, `getDropdownMenuClasses`,
70
+ and `getDropdownItemClasses` recipes plus `.sp-dropdown`,
71
+ `.sp-dropdown__menu`, and `.sp-dropdown__item` CSS in
72
+ `src/styles/components.css`. Consumes the new `component.dropdown` tokens
73
+ (`dropdown.bg`, `dropdown.border`, `dropdown.item.default`,
74
+ `dropdown.item.hover`, `dropdown.item.active`, `dropdown.item.text`)
75
+ published in `@phcdevworks/spectre-tokens@2.9.0`. `getDropdownClasses`
76
+ supports `fullWidth`; `getDropdownMenuClasses` supports `bottom-start`,
77
+ `bottom-end`, `top-start`, and `top-end` placements plus an `open` flag;
78
+ `getDropdownItemClasses` supports `active`, `disabled`, `hovered`, and
79
+ `focused`. This is the fourth of the five Phase 4 component recipes in
80
+ `TODO.md`. Raised the `components.css` size budget in
81
+ `tests/css-entrypoints.test.ts` from 100000 to 105000 bytes.
82
+
83
+ - **Modal Recipe**: Added `getModalClasses` and `getModalOverlayClasses`
84
+ recipes plus `.sp-modal` and `.sp-modal-overlay` CSS in
85
+ `src/styles/components.css`. Consumes the new `component.modal` tokens
86
+ (`modal.bg`, `modal.shadow`, `modal.border`, `modal.overlay`) along with the
87
+ existing `--sp-z-index-modal` primitive published in
88
+ `@phcdevworks/spectre-tokens@2.9.0`. `getModalClasses` supports `open` and
89
+ `fullWidth`; `getModalOverlayClasses` supports `open`. This is the fifth and
90
+ final of the five Phase 4 component recipes in `TODO.md`.
91
+
92
+ ### Changed
93
+
94
+ - **Token Alignment**: Updated `@phcdevworks/spectre-tokens` dependency to
95
+ `^2.9.0`. The published bundle now carries the five Phase 4 `component.*`
96
+ token groups (`nav`, `toast`, `tooltip`, `dropdown`, `modal`) for light and
97
+ dark modes, unblocking the matching recipe work in `TODO.md`. Raised the
98
+ `components.css` size budget in `tests/css-entrypoints.test.ts` from 88000 to
99
+ 92000 bytes to account for the additional bundled token variables.
100
+
9
101
  ## [1.8.0] - 2026-06-07
10
102
 
11
103
  Release Title: Spinner Contract and Token Focus Alignment
package/README.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @phcdevworks/spectre-ui
2
2
 
3
+ ## Repository Snapshot
4
+
5
+ | Field | Value |
6
+ |-------|-------|
7
+ | Project team | `project-design` |
8
+ | Repository role | Spectre L2 CSS, Tailwind, and recipe contract |
9
+ | Package/artifact | `@phcdevworks/spectre-ui` |
10
+ | Current version/status | 2.0.0 |
11
+
12
+ ## Standard Workflow
13
+
14
+ 1. Read [AGENTS.md](AGENTS.md), then the agent-specific guide for the task.
15
+ 2. Check [TODO.md](TODO.md) and [ROADMAP.md](ROADMAP.md) for current scope.
16
+ 3. Make the smallest repo-local change that satisfies the task.
17
+ 4. Run `npm run check` when validation is required or practical.
18
+ 5. Update docs and [CHANGELOG.md](CHANGELOG.md) only when behavior, public
19
+ contracts, or release-relevant metadata changed.
20
+
21
+ ## Documentation Map
22
+
23
+ | Guide | Path |
24
+ |-------|------|
25
+ | Agent rules | [AGENTS.md](AGENTS.md) |
26
+ | Claude Code | [CLAUDE.md](CLAUDE.md) |
27
+ | Codex | [CODEX.md](CODEX.md) |
28
+ | Copilot | [COPILOT.md](COPILOT.md) |
29
+ | Jules | [JULES.md](JULES.md) |
30
+ | Roadmap | [ROADMAP.md](ROADMAP.md) |
31
+ | Todo | [TODO.md](TODO.md) |
32
+ | Changelog | [CHANGELOG.md](CHANGELOG.md) |
33
+ | Security | [SECURITY.md](SECURITY.md) |
34
+
3
35
  [![npm version](https://img.shields.io/npm/v/@phcdevworks/spectre-ui)](https://www.npmjs.com/package/@phcdevworks/spectre-ui)
4
36
  [![CI](https://github.com/phcdevworks/spectre-ui/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/phcdevworks/spectre-ui/actions/workflows/ci.yml)
5
37
  [![License](https://img.shields.io/npm/l/@phcdevworks/spectre-ui)](LICENSE)
@@ -237,6 +269,11 @@ All options are optional and fall back to sensible defaults.
237
269
  | Avatar | `getAvatarClasses` | — | `sm` `md` `lg` `xl` | shape: `circle` `square` |
238
270
  | Tag | `getTagClasses` | `default` `primary` `secondary` `success` `warning` `danger` `info` `neutral` `accent` `cta` `outline` `ghost` | `sm` `md` `lg` | `dismissible` `selected` `disabled` `loading` `interactive` `fullWidth` |
239
271
  | Spinner | `getSpinnerClasses` | — | `sm` `md` `lg` | — |
272
+ | Nav | `getNavClasses` | — | — | `bordered` `sticky` `fullWidth` |
273
+ | Toast | `getToastClasses` | `info` `success` `warning` `danger` | — | `dismissed` `fullWidth` |
274
+ | Tooltip | `getTooltipClasses` | placement: `top` `bottom` `left` `right` | — | `visible` |
275
+ | Dropdown | `getDropdownClasses` | menu placement: `bottom-start` `bottom-end` `top-start` `top-end` | — | `fullWidth`, item: `active` `disabled` |
276
+ | Modal | `getModalClasses` | — | — | `open` `fullWidth` |
240
277
 
241
278
  Each recipe family also exports sub-element helpers for its structural parts
242
279
  (labels, wrappers, sub-containers, text elements). See the full list below.
@@ -261,20 +298,30 @@ Root recipe functions:
261
298
  - `getBadgeClasses`
262
299
  - `getButtonClasses`
263
300
  - `getCardClasses`
301
+ - `getDropdownClasses`
264
302
  - `getIconBoxClasses`
265
303
  - `getInputClasses`
304
+ - `getModalClasses`
305
+ - `getNavClasses`
266
306
  - `getPricingCardClasses`
267
307
  - `getRatingClasses`
268
308
  - `getSpinnerClasses`
269
309
  - `getTagClasses`
270
310
  - `getTestimonialClasses`
311
+ - `getToastClasses`
312
+ - `getTooltipClasses`
271
313
 
272
314
  Root recipe helper functions:
273
315
 
316
+ - `getDropdownItemClasses`
317
+ - `getDropdownMenuClasses`
274
318
  - `getInputErrorMessageClasses`
275
319
  - `getInputHelperTextClasses`
276
320
  - `getInputLabelClasses`
277
321
  - `getInputWrapperClasses`
322
+ - `getModalOverlayClasses`
323
+ - `getNavLinkClasses`
324
+ - `getNavLinksClasses`
278
325
  - `getPricingCardBadgeClasses`
279
326
  - `getPricingCardDescriptionClasses`
280
327
  - `getPricingCardPriceClasses`
@@ -287,6 +334,7 @@ Root recipe helper functions:
287
334
  - `getTestimonialAuthorNameClasses`
288
335
  - `getTestimonialAuthorTitleClasses`
289
336
  - `getTestimonialQuoteClasses`
337
+ - `getToastIconClasses`
290
338
 
291
339
  The root package also re-exports the related recipe option, variant, size, and
292
340
  state TypeScript types defined by those recipes.
package/dist/base.css CHANGED
@@ -3,7 +3,7 @@
3
3
  --sp-surface-card: #ffffff;
4
4
  --sp-surface-input: #ffffff;
5
5
  --sp-surface-overlay: rgba(0, 0, 0, 0.6);
6
- --sp-surface-alternate: #eef1f6;
6
+ --sp-surface-subtle: #eef1f6;
7
7
  --sp-surface-hero: linear-gradient(135deg, #5b6ee1 0%, #6f3fd7 100%);
8
8
  --sp-text-on-page-default: #141b24;
9
9
  --sp-text-on-page-muted: #4b576a;
@@ -37,6 +37,41 @@
37
37
  --sp-icon-box-icon-success: #16a34a;
38
38
  --sp-icon-box-icon-warning: #d48806;
39
39
  --sp-icon-box-icon-danger: #dc2626;
40
+ --sp-nav-bg: #ffffff;
41
+ --sp-nav-text: #141b24;
42
+ --sp-nav-link: #374253;
43
+ --sp-nav-link-hover: #1f57db;
44
+ --sp-nav-link-active: #1946b4;
45
+ --sp-nav-border: #d9dfeb;
46
+ --sp-modal-bg: #ffffff;
47
+ --sp-modal-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.20);
48
+ --sp-modal-border: #d9dfeb;
49
+ --sp-modal-overlay: rgba(0, 0, 0, 0.6);
50
+ --sp-toast-success-bg: #f0fdf4;
51
+ --sp-toast-success-text: #166534;
52
+ --sp-toast-success-border: #bbf7d0;
53
+ --sp-toast-success-icon: #16a34a;
54
+ --sp-toast-warning-bg: #fffbea;
55
+ --sp-toast-warning-text: #8f5200;
56
+ --sp-toast-warning-border: #ffe08a;
57
+ --sp-toast-warning-icon: #d48806;
58
+ --sp-toast-danger-bg: #fef2f2;
59
+ --sp-toast-danger-text: #991b1b;
60
+ --sp-toast-danger-border: #fecaca;
61
+ --sp-toast-danger-icon: #dc2626;
62
+ --sp-toast-info-bg: #f0f9ff;
63
+ --sp-toast-info-text: #0c4a6e;
64
+ --sp-toast-info-border: #bae6fd;
65
+ --sp-toast-info-icon: #0369a1;
66
+ --sp-tooltip-bg: #141b24;
67
+ --sp-tooltip-text: #ffffff;
68
+ --sp-tooltip-border: #374253;
69
+ --sp-dropdown-bg: #ffffff;
70
+ --sp-dropdown-border: #d9dfeb;
71
+ --sp-dropdown-item-default: transparent;
72
+ --sp-dropdown-item-hover: #eef1f6;
73
+ --sp-dropdown-item-active: #f0f9ff;
74
+ --sp-dropdown-item-text: #141b24;
40
75
  --sp-color-brand-50: #eef4ff;
41
76
  --sp-color-brand-100: #d9e7ff;
42
77
  --sp-color-brand-200: #b9d2ff;
@@ -228,6 +263,7 @@
228
263
  --sp-z-index-popover: 1500;
229
264
  --sp-z-index-tooltip: 1600;
230
265
  --sp-z-index-toast: 1700;
266
+ --sp-duration-reduced: 0.01ms;
231
267
  --sp-duration-instant: 75ms;
232
268
  --sp-duration-fast: 150ms;
233
269
  --sp-duration-base: 200ms;
@@ -255,6 +291,7 @@
255
291
  --sp-focus-ring-style: solid;
256
292
  --sp-min-touch-target: 44px;
257
293
  --sp-min-text-size: 16px;
294
+ --sp-reduced-motion: 0.01ms;
258
295
  --sp-button-primary-bg: #0369a1;
259
296
  --sp-button-primary-bghover: #075985;
260
297
  --sp-button-primary-bgactive: #0c4a6e;
@@ -355,13 +392,37 @@
355
392
  --sp-animation-pulse-duration: 1200ms;
356
393
  --sp-animation-pulse-easing: cubic-bezier(0.4, 0, 0.2, 1);
357
394
  --sp-animation-pulse-keyframes: pulse;
395
+ --sp-animation-reduced-motion-fadein-duration: 0.01ms;
396
+ --sp-animation-reduced-motion-fadein-easing: linear;
397
+ --sp-animation-reduced-motion-fadein-keyframes: fade-in;
398
+ --sp-animation-reduced-motion-fadeout-duration: 0.01ms;
399
+ --sp-animation-reduced-motion-fadeout-easing: linear;
400
+ --sp-animation-reduced-motion-fadeout-keyframes: fade-out;
401
+ --sp-animation-reduced-motion-slideup-duration: 0.01ms;
402
+ --sp-animation-reduced-motion-slideup-easing: linear;
403
+ --sp-animation-reduced-motion-slideup-keyframes: slide-up;
404
+ --sp-animation-reduced-motion-slidedown-duration: 0.01ms;
405
+ --sp-animation-reduced-motion-slidedown-easing: linear;
406
+ --sp-animation-reduced-motion-slidedown-keyframes: slide-down;
407
+ --sp-animation-reduced-motion-scalein-duration: 0.01ms;
408
+ --sp-animation-reduced-motion-scalein-easing: linear;
409
+ --sp-animation-reduced-motion-scalein-keyframes: scale-in;
410
+ --sp-animation-reduced-motion-bounce-duration: 0.01ms;
411
+ --sp-animation-reduced-motion-bounce-easing: linear;
412
+ --sp-animation-reduced-motion-bounce-keyframes: bounce;
413
+ --sp-animation-reduced-motion-shake-duration: 0.01ms;
414
+ --sp-animation-reduced-motion-shake-easing: linear;
415
+ --sp-animation-reduced-motion-shake-keyframes: shake;
416
+ --sp-animation-reduced-motion-pulse-duration: 0.01ms;
417
+ --sp-animation-reduced-motion-pulse-easing: linear;
418
+ --sp-animation-reduced-motion-pulse-keyframes: pulse;
358
419
  }
359
420
  :root[data-spectre-theme="dark"] {
360
421
  --sp-surface-page: #141b24;
361
422
  --sp-surface-card: #222b38;
362
423
  --sp-surface-input: #374253;
363
424
  --sp-surface-overlay: rgba(0, 0, 0, 0.6);
364
- --sp-surface-alternate: #222b38;
425
+ --sp-surface-subtle: #222b38;
365
426
  --sp-surface-hero: linear-gradient(135deg, #5d28b8 0%, #401f75 100%);
366
427
  --sp-text-on-page-default: #f7f8fb;
367
428
  --sp-text-on-page-muted: #b7c1d4;
@@ -395,6 +456,41 @@
395
456
  --sp-icon-box-icon-success: #4ade80;
396
457
  --sp-icon-box-icon-warning: #ffc21a;
397
458
  --sp-icon-box-icon-danger: #f87171;
459
+ --sp-nav-bg: #141b24;
460
+ --sp-nav-text: #f7f8fb;
461
+ --sp-nav-link: #b7c1d4;
462
+ --sp-nav-link-hover: #5a92ff;
463
+ --sp-nav-link-active: #8ab6ff;
464
+ --sp-nav-border: #374253;
465
+ --sp-modal-bg: #222b38;
466
+ --sp-modal-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.20);
467
+ --sp-modal-border: #374253;
468
+ --sp-modal-overlay: rgba(0, 0, 0, 0.6);
469
+ --sp-toast-success-bg: #14532d;
470
+ --sp-toast-success-text: #dcfce7;
471
+ --sp-toast-success-border: #15803d;
472
+ --sp-toast-success-icon: #4ade80;
473
+ --sp-toast-warning-bg: #734000;
474
+ --sp-toast-warning-text: #fff1c2;
475
+ --sp-toast-warning-border: #ad6800;
476
+ --sp-toast-warning-icon: #ffc21a;
477
+ --sp-toast-danger-bg: #7f1d1d;
478
+ --sp-toast-danger-text: #fee2e2;
479
+ --sp-toast-danger-border: #b91c1c;
480
+ --sp-toast-danger-icon: #f87171;
481
+ --sp-toast-info-bg: #082f49;
482
+ --sp-toast-info-text: #e0f2fe;
483
+ --sp-toast-info-border: #075985;
484
+ --sp-toast-info-icon: #38bdf8;
485
+ --sp-tooltip-bg: #f7f8fb;
486
+ --sp-tooltip-text: #141b24;
487
+ --sp-tooltip-border: #b7c1d4;
488
+ --sp-dropdown-bg: #222b38;
489
+ --sp-dropdown-border: #374253;
490
+ --sp-dropdown-item-default: transparent;
491
+ --sp-dropdown-item-hover: #374253;
492
+ --sp-dropdown-item-active: #082f49;
493
+ --sp-dropdown-item-text: #eef1f6;
398
494
  }
399
495
  @layer base {
400
496