@phcdevworks/spectre-ui 1.8.0 → 1.9.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 +69 -0
- package/README.md +16 -0
- package/dist/base.css +96 -0
- package/dist/components.css +548 -7
- package/dist/index.cjs +155 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +548 -7
- package/dist/index.d.cts +82 -1
- package/dist/index.d.ts +82 -1
- package/dist/index.js +145 -4
- package/dist/index.js.map +1 -1
- package/dist/utilities.css +96 -0
- package/package.json +10 -7
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,75 @@ reflects package releases published to npm.
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [1.9.0] - 2026-06-10
|
|
10
|
+
|
|
11
|
+
Release Title: Component Recipe Expansion
|
|
12
|
+
|
|
13
|
+
Contract change type: additive
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **Nav Recipe**: Added `getNavClasses`, `getNavLinksClasses`, and
|
|
18
|
+
`getNavLinkClasses` recipes plus `.sp-nav`, `.sp-nav__links`, and
|
|
19
|
+
`.sp-nav__link` CSS in `src/styles/components.css`. Consumes the new
|
|
20
|
+
`component.nav` tokens (`nav.bg`, `nav.text`, `nav.link`, `nav.linkHover`,
|
|
21
|
+
`nav.linkActive`, `nav.border`) published in
|
|
22
|
+
`@phcdevworks/spectre-tokens@2.9.0`. `getNavClasses` supports `bordered`,
|
|
23
|
+
`sticky`, and `fullWidth`; `getNavLinkClasses` supports `active`, `disabled`,
|
|
24
|
+
`hovered`, and `focused`. This is the first of the five Phase 4 component
|
|
25
|
+
recipes in `TODO.md`. Raised the `components.css` size budget in
|
|
26
|
+
`tests/css-entrypoints.test.ts` from 92000 to 96000 bytes.
|
|
27
|
+
|
|
28
|
+
- **Toast Recipe**: Added `getToastClasses` and `getToastIconClasses` recipes
|
|
29
|
+
plus `.sp-toast` and `.sp-toast__icon` CSS in `src/styles/components.css`.
|
|
30
|
+
Consumes the new `component.toast` tokens (`toast.{success,warning,danger,info}.{bg,text,border,icon}`)
|
|
31
|
+
published in `@phcdevworks/spectre-tokens@2.9.0`. `getToastClasses` supports
|
|
32
|
+
`info`, `success`, `warning`, and `danger` variants plus `dismissed` and
|
|
33
|
+
`fullWidth`; `getToastIconClasses` mirrors the same variants for icon color.
|
|
34
|
+
This is the second of the five Phase 4 component recipes in `TODO.md`.
|
|
35
|
+
Raised the `components.css` size budget in `tests/css-entrypoints.test.ts`
|
|
36
|
+
from 96000 to 100000 bytes.
|
|
37
|
+
|
|
38
|
+
- **Tooltip Recipe**: Added `getTooltipClasses` recipe plus `.sp-tooltip` CSS
|
|
39
|
+
in `src/styles/components.css`. Consumes the new `component.tooltip` tokens
|
|
40
|
+
(`tooltip.bg`, `tooltip.text`, `tooltip.border`) along with the existing
|
|
41
|
+
`--sp-opacity-tooltip` and `--sp-z-index-tooltip` primitives published in
|
|
42
|
+
`@phcdevworks/spectre-tokens@2.9.0`. `getTooltipClasses` supports `top`,
|
|
43
|
+
`bottom`, `left`, and `right` placements plus a `visible` flag. This is the
|
|
44
|
+
third of the five Phase 4 component recipes in `TODO.md`.
|
|
45
|
+
|
|
46
|
+
- **Dropdown Recipe**: Added `getDropdownClasses`, `getDropdownMenuClasses`,
|
|
47
|
+
and `getDropdownItemClasses` recipes plus `.sp-dropdown`,
|
|
48
|
+
`.sp-dropdown__menu`, and `.sp-dropdown__item` CSS in
|
|
49
|
+
`src/styles/components.css`. Consumes the new `component.dropdown` tokens
|
|
50
|
+
(`dropdown.bg`, `dropdown.border`, `dropdown.item.default`,
|
|
51
|
+
`dropdown.item.hover`, `dropdown.item.active`, `dropdown.item.text`)
|
|
52
|
+
published in `@phcdevworks/spectre-tokens@2.9.0`. `getDropdownClasses`
|
|
53
|
+
supports `fullWidth`; `getDropdownMenuClasses` supports `bottom-start`,
|
|
54
|
+
`bottom-end`, `top-start`, and `top-end` placements plus an `open` flag;
|
|
55
|
+
`getDropdownItemClasses` supports `active`, `disabled`, `hovered`, and
|
|
56
|
+
`focused`. This is the fourth of the five Phase 4 component recipes in
|
|
57
|
+
`TODO.md`. Raised the `components.css` size budget in
|
|
58
|
+
`tests/css-entrypoints.test.ts` from 100000 to 105000 bytes.
|
|
59
|
+
|
|
60
|
+
- **Modal Recipe**: Added `getModalClasses` and `getModalOverlayClasses`
|
|
61
|
+
recipes plus `.sp-modal` and `.sp-modal-overlay` CSS in
|
|
62
|
+
`src/styles/components.css`. Consumes the new `component.modal` tokens
|
|
63
|
+
(`modal.bg`, `modal.shadow`, `modal.border`, `modal.overlay`) along with the
|
|
64
|
+
existing `--sp-z-index-modal` primitive published in
|
|
65
|
+
`@phcdevworks/spectre-tokens@2.9.0`. `getModalClasses` supports `open` and
|
|
66
|
+
`fullWidth`; `getModalOverlayClasses` supports `open`. This is the fifth and
|
|
67
|
+
final of the five Phase 4 component recipes in `TODO.md`.
|
|
68
|
+
|
|
69
|
+
### Changed
|
|
70
|
+
|
|
71
|
+
- **Token Alignment**: Updated `@phcdevworks/spectre-tokens` dependency to
|
|
72
|
+
`^2.9.0`. The published bundle now carries the five Phase 4 `component.*`
|
|
73
|
+
token groups (`nav`, `toast`, `tooltip`, `dropdown`, `modal`) for light and
|
|
74
|
+
dark modes, unblocking the matching recipe work in `TODO.md`. Raised the
|
|
75
|
+
`components.css` size budget in `tests/css-entrypoints.test.ts` from 88000 to
|
|
76
|
+
92000 bytes to account for the additional bundled token variables.
|
|
77
|
+
|
|
9
78
|
## [1.8.0] - 2026-06-07
|
|
10
79
|
|
|
11
80
|
Release Title: Spinner Contract and Token Focus Alignment
|
package/README.md
CHANGED
|
@@ -237,6 +237,11 @@ All options are optional and fall back to sensible defaults.
|
|
|
237
237
|
| Avatar | `getAvatarClasses` | — | `sm` `md` `lg` `xl` | shape: `circle` `square` |
|
|
238
238
|
| Tag | `getTagClasses` | `default` `primary` `secondary` `success` `warning` `danger` `info` `neutral` `accent` `cta` `outline` `ghost` | `sm` `md` `lg` | `dismissible` `selected` `disabled` `loading` `interactive` `fullWidth` |
|
|
239
239
|
| Spinner | `getSpinnerClasses` | — | `sm` `md` `lg` | — |
|
|
240
|
+
| Nav | `getNavClasses` | — | — | `bordered` `sticky` `fullWidth` |
|
|
241
|
+
| Toast | `getToastClasses` | `info` `success` `warning` `danger` | — | `dismissed` `fullWidth` |
|
|
242
|
+
| Tooltip | `getTooltipClasses` | placement: `top` `bottom` `left` `right` | — | `visible` |
|
|
243
|
+
| Dropdown | `getDropdownClasses` | menu placement: `bottom-start` `bottom-end` `top-start` `top-end` | — | `fullWidth`, item: `active` `disabled` |
|
|
244
|
+
| Modal | `getModalClasses` | — | — | `open` `fullWidth` |
|
|
240
245
|
|
|
241
246
|
Each recipe family also exports sub-element helpers for its structural parts
|
|
242
247
|
(labels, wrappers, sub-containers, text elements). See the full list below.
|
|
@@ -261,20 +266,30 @@ Root recipe functions:
|
|
|
261
266
|
- `getBadgeClasses`
|
|
262
267
|
- `getButtonClasses`
|
|
263
268
|
- `getCardClasses`
|
|
269
|
+
- `getDropdownClasses`
|
|
264
270
|
- `getIconBoxClasses`
|
|
265
271
|
- `getInputClasses`
|
|
272
|
+
- `getModalClasses`
|
|
273
|
+
- `getNavClasses`
|
|
266
274
|
- `getPricingCardClasses`
|
|
267
275
|
- `getRatingClasses`
|
|
268
276
|
- `getSpinnerClasses`
|
|
269
277
|
- `getTagClasses`
|
|
270
278
|
- `getTestimonialClasses`
|
|
279
|
+
- `getToastClasses`
|
|
280
|
+
- `getTooltipClasses`
|
|
271
281
|
|
|
272
282
|
Root recipe helper functions:
|
|
273
283
|
|
|
284
|
+
- `getDropdownItemClasses`
|
|
285
|
+
- `getDropdownMenuClasses`
|
|
274
286
|
- `getInputErrorMessageClasses`
|
|
275
287
|
- `getInputHelperTextClasses`
|
|
276
288
|
- `getInputLabelClasses`
|
|
277
289
|
- `getInputWrapperClasses`
|
|
290
|
+
- `getModalOverlayClasses`
|
|
291
|
+
- `getNavLinkClasses`
|
|
292
|
+
- `getNavLinksClasses`
|
|
278
293
|
- `getPricingCardBadgeClasses`
|
|
279
294
|
- `getPricingCardDescriptionClasses`
|
|
280
295
|
- `getPricingCardPriceClasses`
|
|
@@ -287,6 +302,7 @@ Root recipe helper functions:
|
|
|
287
302
|
- `getTestimonialAuthorNameClasses`
|
|
288
303
|
- `getTestimonialAuthorTitleClasses`
|
|
289
304
|
- `getTestimonialQuoteClasses`
|
|
305
|
+
- `getToastIconClasses`
|
|
290
306
|
|
|
291
307
|
The root package also re-exports the related recipe option, variant, size, and
|
|
292
308
|
state TypeScript types defined by those recipes.
|
package/dist/base.css
CHANGED
|
@@ -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,6 +392,30 @@
|
|
|
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;
|
|
@@ -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
|
|