@scalewing/react 1.26.0 → 1.28.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 (81) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +147 -3
  3. package/dist/components/ActionBar.d.ts +14 -0
  4. package/dist/components/ActionBar.js +5 -2
  5. package/dist/components/DenominationGrid.d.ts +5 -2
  6. package/dist/components/DenominationGrid.js +11 -3
  7. package/dist/components/Dialog.d.ts +28 -4
  8. package/dist/components/Dialog.js +20 -2
  9. package/dist/components/Notice.d.ts +69 -0
  10. package/dist/components/Notice.js +48 -0
  11. package/dist/components/Progress.d.ts +3 -1
  12. package/dist/components/Progress.js +4 -0
  13. package/dist/components/Stepper.d.ts +44 -0
  14. package/dist/components/Stepper.js +77 -0
  15. package/dist/components/Steps.d.ts +18 -0
  16. package/dist/components/Steps.js +34 -0
  17. package/dist/components/Toast.d.ts +20 -4
  18. package/dist/components/Toast.js +44 -21
  19. package/dist/components/action-bar/ActionBarSummary.d.ts +22 -0
  20. package/dist/components/action-bar/ActionBarSummary.js +23 -0
  21. package/dist/components/denomination-grid/ColumnHeadText.d.ts +7 -0
  22. package/dist/components/denomination-grid/ColumnHeadText.js +13 -0
  23. package/dist/components/denomination-grid/DenominationStrip.d.ts +5 -2
  24. package/dist/components/denomination-grid/DenominationStrip.js +4 -8
  25. package/dist/components/denomination-grid/DenominationTiles.d.ts +5 -2
  26. package/dist/components/denomination-grid/DenominationTiles.js +4 -3
  27. package/dist/components/denomination-grid/EntryCell.d.ts +15 -0
  28. package/dist/components/denomination-grid/EntryCell.js +16 -0
  29. package/dist/components/denomination-grid/RowLabelLine.d.ts +3 -2
  30. package/dist/components/denomination-grid/RowLabelLine.js +5 -3
  31. package/dist/components/denomination-grid/StripRow.d.ts +13 -0
  32. package/dist/components/denomination-grid/StripRow.js +19 -0
  33. package/dist/components/denomination-grid/types.d.ts +53 -1
  34. package/dist/components/denomination-grid/validate-entry.d.ts +15 -0
  35. package/dist/components/denomination-grid/validate-entry.js +78 -0
  36. package/dist/components/dialog/DialogFooter.d.ts +14 -0
  37. package/dist/components/dialog/DialogFooter.js +11 -0
  38. package/dist/components/dialog/DialogTitle.d.ts +11 -4
  39. package/dist/components/dialog/DialogTitle.js +8 -6
  40. package/dist/components/steps/Step.d.ts +24 -0
  41. package/dist/components/steps/Step.js +62 -0
  42. package/dist/components/steps/step-status.d.ts +26 -0
  43. package/dist/components/steps/step-status.js +37 -0
  44. package/dist/components/steps/steps-context.d.ts +16 -0
  45. package/dist/components/steps/steps-context.js +3 -0
  46. package/dist/components/toast/ToastContent.d.ts +22 -0
  47. package/dist/components/toast/ToastContent.js +21 -0
  48. package/dist/components/toast/use-toast-hold.d.ts +28 -0
  49. package/dist/components/toast/use-toast-hold.js +53 -0
  50. package/dist/components/toast/use-toast-timer.d.ts +15 -0
  51. package/dist/components/toast/use-toast-timer.js +34 -0
  52. package/dist/css/css-action-bar-summary.d.ts +2 -0
  53. package/dist/css/css-action-bar-summary.js +48 -0
  54. package/dist/css/css-action-bar.js +4 -0
  55. package/dist/css/css-components.js +16 -0
  56. package/dist/css/css-denomination-entry.d.ts +2 -0
  57. package/dist/css/css-denomination-entry.js +78 -0
  58. package/dist/css/css-denomination-grid.js +8 -0
  59. package/dist/css/css-denomination-label.d.ts +10 -0
  60. package/dist/css/css-denomination-label.js +36 -0
  61. package/dist/css/css-dialog-frame.d.ts +2 -0
  62. package/dist/css/css-dialog-frame.js +83 -0
  63. package/dist/css/css-dialog.js +20 -4
  64. package/dist/css/css-notice.d.ts +22 -0
  65. package/dist/css/css-notice.js +168 -0
  66. package/dist/css/css-progress.d.ts +3 -0
  67. package/dist/css/css-progress.js +13 -6
  68. package/dist/css/css-stepper.d.ts +10 -0
  69. package/dist/css/css-stepper.js +126 -0
  70. package/dist/css/css-steps.d.ts +9 -0
  71. package/dist/css/css-steps.js +203 -0
  72. package/dist/css/css-toast-card.d.ts +5 -0
  73. package/dist/css/css-toast-card.js +122 -0
  74. package/dist/css/css-variables.js +1 -0
  75. package/dist/css/stylesheet.js +10 -0
  76. package/dist/index.d.ts +9 -6
  77. package/dist/index.js +8 -5
  78. package/dist/stepper-count.d.ts +37 -0
  79. package/dist/stepper-count.js +50 -0
  80. package/dist/styles.css +623 -1
  81. package/package.json +1 -1
@@ -1,2 +1,5 @@
1
+ export declare const progressTones: readonly ["accent", "success", "warning", "danger"];
2
+ /** The bar's color: the accent, or success, warning (time running out) or danger. */
3
+ export type ProgressTone = (typeof progressTones)[number];
1
4
  export declare function cssProgressClasses(): string;
2
5
  export declare function progressClassCatalog(): string[];
@@ -1,4 +1,15 @@
1
1
  import { typographyVariants } from '@scalewing/tokens';
2
+ export const progressTones = [
3
+ 'accent',
4
+ 'success',
5
+ 'warning',
6
+ 'danger',
7
+ ];
8
+ function toneRules() {
9
+ return progressTones
10
+ .map((tone) => `.sw-progress-${tone} { --sw-progress-color: var(--sw-color-${tone}); }`)
11
+ .join('\n');
12
+ }
2
13
  const label = typographyVariants.label;
3
14
  const caption = typographyVariants.caption;
4
15
  export function cssProgressClasses() {
@@ -11,9 +22,7 @@ export function cssProgressClasses() {
11
22
  width: 100%;
12
23
  }
13
24
 
14
- .sw-progress-accent { --sw-progress-color: var(--sw-color-accent); }
15
- .sw-progress-success { --sw-progress-color: var(--sw-color-success); }
16
- .sw-progress-danger { --sw-progress-color: var(--sw-color-danger); }
25
+ ${toneRules()}
17
26
 
18
27
  .sw-progress-heading {
19
28
  align-items: baseline;
@@ -66,9 +75,7 @@ export function cssProgressClasses() {
66
75
  export function progressClassCatalog() {
67
76
  return [
68
77
  'sw-progress',
69
- 'sw-progress-accent',
70
- 'sw-progress-success',
71
- 'sw-progress-danger',
78
+ ...progressTones.map((tone) => `sw-progress-${tone}`),
72
79
  'sw-progress-heading',
73
80
  'sw-progress-label',
74
81
  'sw-progress-count',
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The web Stepper: a label over a track of − count +. The count is a few
3
+ * digits wide by default, the track at its own width even under a wider label
4
+ * or message (`5ch` plus its padding, so its width never follows
5
+ * its value), or fills its container with `sw-stepper-full`. The buttons are
6
+ * spacing step 6 wide on the subtle fill and every part is the `md` control
7
+ * height.
8
+ */
9
+ export declare function cssStepperClasses(): string;
10
+ export declare function stepperClassCatalog(): string[];
@@ -0,0 +1,126 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ import { changedTintLayer } from './css-field-changed.js';
3
+ const body = typographyVariants.body;
4
+ const label = typographyVariants.label;
5
+ const title = typographyVariants.title;
6
+ /*
7
+ * The count is a text input, so the canvas already draws it as a control
8
+ * (`[data-theme] :is(input[type='text'], …)`). `input.sw-stepper-input`
9
+ * matches that rule's specificity and comes later in the sheet, so the
10
+ * stepper's own centering and type win while the canvas keeps the surface,
11
+ * the focus ring and the disabled look.
12
+ */
13
+ const input = '[data-theme] input.sw-stepper-input';
14
+ function stateRules() {
15
+ return `[data-theme] .sw-stepper-invalid input.sw-stepper-input {
16
+ border-color: var(--sw-color-danger);
17
+ }
18
+
19
+ [data-theme] .sw-stepper-changed input.sw-stepper-input {
20
+ border-color: var(--sw-color-accent);
21
+ box-shadow: inset 0 0 0 1px var(--sw-color-accent);
22
+ }
23
+
24
+ [data-theme] .sw-stepper-changed input.sw-stepper-input:not(:placeholder-shown) {
25
+ background-image: ${changedTintLayer};
26
+ }
27
+
28
+ /* Read-only: the buttons keep their room, so the count lines up with an editable one. */
29
+ .sw-stepper-readonly .sw-stepper-button { visibility: hidden; }
30
+
31
+ @media (forced-colors: active) {
32
+ .sw-stepper-button { border-color: ButtonText; }
33
+ .sw-stepper-button:disabled { border-color: GrayText; color: GrayText; opacity: 1; }
34
+ [data-theme] .sw-stepper-invalid input.sw-stepper-input { border-color: Mark; }
35
+ [data-theme] .sw-stepper-changed input.sw-stepper-input { border-color: Highlight; box-shadow: inset 0 0 0 1px Highlight; background-image: none; }
36
+ }`;
37
+ }
38
+ /**
39
+ * The web Stepper: a label over a track of − count +. The count is a few
40
+ * digits wide by default, the track at its own width even under a wider label
41
+ * or message (`5ch` plus its padding, so its width never follows
42
+ * its value), or fills its container with `sw-stepper-full`. The buttons are
43
+ * spacing step 6 wide on the subtle fill and every part is the `md` control
44
+ * height.
45
+ */
46
+ export function cssStepperClasses() {
47
+ return `.sw-stepper {
48
+ align-items: flex-start;
49
+ display: inline-flex;
50
+ flex-direction: column;
51
+ gap: var(--sw-space-1);
52
+ min-width: 0;
53
+ /* Holds its hidden label and empty error region, which leave the flow,
54
+ so inside a scroll region they never widen the page. */
55
+ position: relative;
56
+ }
57
+
58
+ .sw-stepper-full { align-items: stretch; display: flex; }
59
+
60
+ .sw-stepper-track {
61
+ display: inline-grid;
62
+ gap: var(--sw-space-1);
63
+ grid-template-columns: var(--sw-space-6) auto var(--sw-space-6);
64
+ }
65
+
66
+ .sw-stepper-full .sw-stepper-track {
67
+ display: grid;
68
+ grid-template-columns: var(--sw-space-6) minmax(0, 1fr) var(--sw-space-6);
69
+ }
70
+
71
+ .sw-stepper-button {
72
+ align-items: center;
73
+ appearance: none;
74
+ background: var(--sw-color-subtle);
75
+ border: 1px solid transparent;
76
+ border-radius: var(--sw-radius-sm);
77
+ color: var(--sw-color-text);
78
+ cursor: pointer;
79
+ display: inline-flex;
80
+ font-family: var(--sw-font-sans);
81
+ font-size: ${title.fontSize}px;
82
+ font-weight: ${title.fontWeight};
83
+ justify-content: center;
84
+ line-height: ${title.lineHeight}px;
85
+ margin: 0;
86
+ min-height: var(--sw-control-md-min-height);
87
+ padding: 0;
88
+ touch-action: manipulation;
89
+ }
90
+
91
+ .sw-stepper-button:hover:not(:disabled) {
92
+ background: var(--sw-color-border);
93
+ }
94
+
95
+ .sw-stepper-button:disabled {
96
+ cursor: not-allowed;
97
+ opacity: var(--sw-disabled-opacity);
98
+ }
99
+
100
+ ${input} {
101
+ font-size: ${body.fontSize}px;
102
+ font-variant-numeric: tabular-nums;
103
+ font-weight: ${label.fontWeight};
104
+ inline-size: calc(5ch + 2 * var(--sw-space-1));
105
+ line-height: ${body.lineHeight}px;
106
+ min-width: 0;
107
+ padding-inline: var(--sw-space-1);
108
+ text-align: center;
109
+ }
110
+
111
+ .sw-stepper-full input.sw-stepper-input { inline-size: 100%; }
112
+
113
+ ${stateRules()}`;
114
+ }
115
+ export function stepperClassCatalog() {
116
+ return [
117
+ 'sw-stepper',
118
+ 'sw-stepper-full',
119
+ 'sw-stepper-track',
120
+ 'sw-stepper-button',
121
+ 'sw-stepper-input',
122
+ 'sw-stepper-invalid',
123
+ 'sw-stepper-changed',
124
+ 'sw-stepper-readonly',
125
+ ];
126
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The one-page vertical stepper: an ordered list of glass panels a small
3
+ * gap apart. Each has a header line (marker, title, and on a done step its
4
+ * summary and Edit) and, while open (current or error), a body indented to
5
+ * the title. An open step's title is the title variant; a folded one's is
6
+ * body size at label weight, muted ahead of the form or skipped.
7
+ */
8
+ export declare function cssStepsClasses(): string;
9
+ export declare function stepsClassCatalog(): string[];
@@ -0,0 +1,203 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ const body = typographyVariants.body;
3
+ const caption = typographyVariants.caption;
4
+ const label = typographyVariants.label;
5
+ const title = typographyVariants.title;
6
+ /** The marker's size: the xs control height. */
7
+ const marker = 'var(--sw-control-xs-min-height)';
8
+ /** The marker's look per status: its fill, ring and number color. */
9
+ function markerRules() {
10
+ return `.sw-steps-item-upcoming .sw-steps-marker,
11
+ .sw-steps-item-skipped .sw-steps-marker {
12
+ box-shadow: inset 0 0 0 2px var(--sw-color-border);
13
+ color: var(--sw-color-muted);
14
+ }
15
+
16
+ .sw-steps-item-current .sw-steps-marker {
17
+ background: var(--sw-color-accent);
18
+ color: var(--sw-color-onAccent);
19
+ }
20
+
21
+ .sw-steps-item-error .sw-steps-marker {
22
+ background: var(--sw-color-danger);
23
+ color: var(--sw-color-onDanger);
24
+ }
25
+
26
+ .sw-steps-item-done .sw-steps-marker {
27
+ background: var(--sw-color-success);
28
+ }
29
+
30
+ /* Private chrome: a check drawn with two borders, as Checkbox's. */
31
+ .sw-steps-item-done .sw-steps-marker::after {
32
+ border-bottom: 2px solid var(--sw-color-surface);
33
+ border-right: 2px solid var(--sw-color-surface);
34
+ content: '';
35
+ height: var(--sw-space-3);
36
+ margin-top: calc(-1 * var(--sw-space-1) / 2);
37
+ transform: rotate(45deg);
38
+ width: calc(var(--sw-space-3) / 2);
39
+ }`;
40
+ }
41
+ /*
42
+ * A line from each marker down to the next step's, through the gap between
43
+ * the panels: the success color below a done step, the hairline otherwise.
44
+ */
45
+ function connectorRules() {
46
+ return `.sw-steps-item:not(:last-child)::after {
47
+ background: var(--sw-color-border);
48
+ bottom: calc(-1 * var(--sw-space-2) - 1px);
49
+ content: '';
50
+ inset-inline-start: calc(var(--sw-space-4) + ${marker} / 2 - 1px);
51
+ position: absolute;
52
+ top: calc(var(--sw-steps-padding) + ${marker} + var(--sw-space-1));
53
+ width: 2px;
54
+ }
55
+
56
+ .sw-steps-item-done:not(:last-child)::after {
57
+ background: var(--sw-color-success);
58
+ }`;
59
+ }
60
+ function forcedColorRules() {
61
+ return `@media (forced-colors: active) {
62
+ .sw-steps-marker { border: 2px solid CanvasText; box-shadow: none; }
63
+ .sw-steps-item-current .sw-steps-marker { border-color: Highlight; }
64
+ .sw-steps-item-done .sw-steps-marker::after { border-color: CanvasText; }
65
+ .sw-steps-item:not(:last-child)::after { background: CanvasText; }
66
+ .sw-steps-item-upcoming .sw-steps-title,
67
+ .sw-steps-item-skipped .sw-steps-title { color: GrayText; }
68
+ }`;
69
+ }
70
+ /**
71
+ * The one-page vertical stepper: an ordered list of glass panels a small
72
+ * gap apart. Each has a header line (marker, title, and on a done step its
73
+ * summary and Edit) and, while open (current or error), a body indented to
74
+ * the title. An open step's title is the title variant; a folded one's is
75
+ * body size at label weight, muted ahead of the form or skipped.
76
+ */
77
+ export function cssStepsClasses() {
78
+ return `.sw-steps {
79
+ display: flex;
80
+ flex-direction: column;
81
+ gap: var(--sw-space-2);
82
+ list-style: none;
83
+ margin: 0;
84
+ padding: 0;
85
+ }
86
+
87
+ .sw-steps-item {
88
+ --sw-steps-padding: var(--sw-space-3);
89
+ background: var(--sw-glass-fill);
90
+ border: 1px solid var(--sw-glass-border);
91
+ border-radius: var(--sw-radius-md);
92
+ box-shadow: inset 0 1px 0 var(--sw-glass-specular);
93
+ color: var(--sw-color-text);
94
+ display: flex;
95
+ flex-direction: column;
96
+ gap: var(--sw-space-4);
97
+ padding: var(--sw-steps-padding) var(--sw-space-4);
98
+ position: relative;
99
+ }
100
+
101
+ .sw-steps-item-current,
102
+ .sw-steps-item-error {
103
+ --sw-steps-padding: var(--sw-space-4);
104
+ }
105
+
106
+ /* The marker sits at the top of the header, so the connector always starts
107
+ under it; each line of the header is centred on the marker's height. */
108
+ .sw-steps-header {
109
+ align-items: flex-start;
110
+ display: flex;
111
+ gap: var(--sw-space-3);
112
+ min-height: ${marker};
113
+ min-width: 0;
114
+ }
115
+
116
+ .sw-steps-marker {
117
+ align-items: center;
118
+ border-radius: var(--sw-radius-pill);
119
+ box-sizing: border-box;
120
+ display: inline-flex;
121
+ flex: none;
122
+ font-family: var(--sw-font-sans);
123
+ font-size: ${caption.fontSize}px;
124
+ font-variant-numeric: tabular-nums;
125
+ font-weight: 700;
126
+ height: ${marker};
127
+ justify-content: center;
128
+ line-height: ${caption.lineHeight}px;
129
+ width: ${marker};
130
+ }
131
+
132
+ .sw-steps-title {
133
+ font-family: var(--sw-font-sans);
134
+ font-size: ${body.fontSize}px;
135
+ font-weight: ${label.fontWeight};
136
+ letter-spacing: ${body.letterSpacing}px;
137
+ line-height: ${body.lineHeight}px;
138
+ margin: 0;
139
+ min-width: 0;
140
+ padding-block: calc((${marker} - ${body.lineHeight}px) / 2);
141
+ }
142
+
143
+ .sw-steps-item-current .sw-steps-title,
144
+ .sw-steps-item-error .sw-steps-title {
145
+ font-size: ${title.fontSize}px;
146
+ letter-spacing: ${title.letterSpacing}px;
147
+ line-height: ${title.lineHeight}px;
148
+ padding-block: calc((${marker} - ${title.lineHeight}px) / 2);
149
+ }
150
+
151
+ .sw-steps-item-upcoming .sw-steps-title,
152
+ .sw-steps-item-skipped .sw-steps-title,
153
+ .sw-steps-reason {
154
+ color: var(--sw-color-muted);
155
+ }
156
+
157
+ .sw-steps-summary {
158
+ flex: 1 1 0;
159
+ font-size: ${label.fontSize}px;
160
+ letter-spacing: ${label.letterSpacing}px;
161
+ line-height: ${label.lineHeight}px;
162
+ min-width: 25%;
163
+ overflow: hidden;
164
+ padding-block: calc((${marker} - ${label.lineHeight}px) / 2);
165
+ text-overflow: ellipsis;
166
+ white-space: nowrap;
167
+ }
168
+
169
+ .sw-button.sw-steps-edit {
170
+ flex: none;
171
+ margin-block: calc((${marker} - var(--sw-control-sm-min-height)) / 2);
172
+ margin-inline-start: auto;
173
+ }
174
+
175
+ .sw-steps-body {
176
+ margin-inline-start: calc(${marker} + var(--sw-space-3));
177
+ min-width: 0;
178
+ }
179
+
180
+ ${markerRules()}
181
+
182
+ ${connectorRules()}
183
+
184
+ ${forcedColorRules()}`;
185
+ }
186
+ export function stepsClassCatalog() {
187
+ return [
188
+ 'sw-steps',
189
+ 'sw-steps-item',
190
+ 'sw-steps-item-upcoming',
191
+ 'sw-steps-item-current',
192
+ 'sw-steps-item-done',
193
+ 'sw-steps-item-error',
194
+ 'sw-steps-item-skipped',
195
+ 'sw-steps-header',
196
+ 'sw-steps-marker',
197
+ 'sw-steps-title',
198
+ 'sw-steps-reason',
199
+ 'sw-steps-summary',
200
+ 'sw-steps-edit',
201
+ 'sw-steps-body',
202
+ ];
203
+ }
@@ -0,0 +1,5 @@
1
+ export declare const toastPlacements: readonly ["bottom", "top-end"];
2
+ /** Where a toast that does not travel shows: centered at the bottom, or the top end corner. */
3
+ export type ToastPlacement = (typeof toastPlacements)[number];
4
+ export declare function cssToastCardClasses(): string;
5
+ export declare function toastCardClassCatalog(): string[];
@@ -0,0 +1,122 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ import { toastMaxWidth } from './css-toast.js';
3
+ export const toastPlacements = ['bottom', 'top-end'];
4
+ const label = typographyVariants.label;
5
+ const body = typographyVariants.body;
6
+ /*
7
+ * The toast as a card: a bold title over a muted detail, an action at the
8
+ * end of the row, and a thin line that runs down with the time left.
9
+ *
10
+ * `top-end` puts it in the top corner at the end of the line, clear of the
11
+ * safe area, at most a dialog's reading width; it drops in from above. A
12
+ * toast with an action or the remaining line takes the pointer, so hover
13
+ * can hold it (and the action can be pressed); the bottom toast stays
14
+ * click-through. The line is a scale from full to empty over the toast's
15
+ * duration (`--sw-toast-duration`), held while the toast is paused; it is
16
+ * a measure of time, not decoration, so it runs under reduced motion too.
17
+ */
18
+ export function cssToastCardClasses() {
19
+ return `.sw-toast-title {
20
+ display: block;
21
+ font-size: ${label.fontSize}px;
22
+ font-weight: ${label.fontWeight};
23
+ letter-spacing: ${label.letterSpacing}px;
24
+ line-height: ${label.lineHeight}px;
25
+ }
26
+
27
+ .sw-toast-detail {
28
+ color: var(--sw-color-muted);
29
+ font-size: ${label.fontSize}px;
30
+ font-weight: ${body.fontWeight};
31
+ letter-spacing: ${label.letterSpacing}px;
32
+ line-height: ${label.lineHeight}px;
33
+ }
34
+
35
+ .sw-toast-row:has(.sw-toast-title) { align-items: flex-start; }
36
+
37
+ .sw-toast-row .sw-toast-body { flex: 1 1 auto; }
38
+
39
+ .sw-button.sw-toast-action {
40
+ flex: none;
41
+ margin-block: calc((${label.lineHeight}px - var(--sw-control-sm-min-height)) / 2);
42
+ }
43
+
44
+ .sw-toast-interactive { pointer-events: auto; }
45
+
46
+ .sw-toast-top-end {
47
+ bottom: auto;
48
+ left: auto;
49
+ max-width: min(var(--sw-dialog-max), ${toastMaxWidth});
50
+ right: max(var(--sw-space-4), env(safe-area-inset-right, 0px));
51
+ top: max(var(--sw-space-4), env(safe-area-inset-top, 0px));
52
+ translate: none;
53
+ }
54
+
55
+ .sw-toast-top-end:dir(rtl) {
56
+ left: max(var(--sw-space-4), env(safe-area-inset-left, 0px));
57
+ right: auto;
58
+ }
59
+
60
+ .sw-toast-top-end:popover-open {
61
+ animation: sw-toast-drop var(--sw-motion-default) var(--sw-motion-easing);
62
+ }
63
+
64
+ @keyframes sw-toast-drop {
65
+ from {
66
+ opacity: 0;
67
+ translate: 0 calc(-1 * var(--sw-space-3));
68
+ }
69
+ to {
70
+ opacity: 1;
71
+ translate: none;
72
+ }
73
+ }
74
+
75
+ .sw-toast-remaining {
76
+ background: var(--sw-color-border);
77
+ border-radius: var(--sw-radius-pill);
78
+ display: block;
79
+ height: var(--sw-space-1);
80
+ margin-top: var(--sw-space-2);
81
+ overflow: hidden;
82
+ position: relative;
83
+ }
84
+
85
+ .sw-toast-remaining::after {
86
+ animation: sw-toast-remaining var(--sw-toast-duration, 0ms) linear forwards;
87
+ background: var(--sw-toast-tone, var(--sw-color-accent));
88
+ content: '';
89
+ inset: 0;
90
+ position: absolute;
91
+ transform-origin: left center;
92
+ }
93
+
94
+ .sw-toast-remaining:dir(rtl)::after { transform-origin: right center; }
95
+
96
+ .sw-toast-paused .sw-toast-remaining::after { animation-play-state: paused; }
97
+
98
+ @keyframes sw-toast-remaining {
99
+ from { transform: scaleX(1); }
100
+ to { transform: scaleX(0); }
101
+ }
102
+
103
+ @media (prefers-reduced-motion: reduce) {
104
+ .sw-toast-top-end:popover-open { animation: none; }
105
+ }
106
+
107
+ @media (forced-colors: active) {
108
+ .sw-toast-remaining { background: Canvas; border: 1px solid CanvasText; }
109
+ .sw-toast-remaining::after { background: CanvasText; }
110
+ }`;
111
+ }
112
+ export function toastCardClassCatalog() {
113
+ return [
114
+ 'sw-toast-title',
115
+ 'sw-toast-detail',
116
+ 'sw-toast-action',
117
+ 'sw-toast-interactive',
118
+ 'sw-toast-top-end',
119
+ 'sw-toast-remaining',
120
+ 'sw-toast-paused',
121
+ ];
122
+ }
@@ -38,6 +38,7 @@ ${control}
38
38
  --sw-container-max: 72rem;
39
39
  --sw-dialog-max: 32rem;
40
40
  --sw-dialog-max-lg: 56rem;
41
+ --sw-dialog-max-xl: 65rem;
41
42
  --sw-select-max: 16rem;
42
43
  --sw-split-min: ${splitScale.min}rem;
43
44
  --sw-split-size: ${splitScale.size}rem;
@@ -9,6 +9,7 @@ import { checkboxClassCatalog } from './css-checkbox.js';
9
9
  import { radioGroupClassCatalog } from './css-radio-group.js';
10
10
  import { spinnerClassCatalog } from './css-spinner.js';
11
11
  import { progressClassCatalog } from './css-progress.js';
12
+ import { noticeClassCatalog } from './css-notice.js';
12
13
  import { tooltipClassCatalog } from './css-tooltip.js';
13
14
  import { infoTipClassCatalog } from './css-info-tip.js';
14
15
  import { separatorClassCatalog } from './css-separator.js';
@@ -22,6 +23,8 @@ import { gridSpanClassCatalog } from './css-grid-span.js';
22
23
  import { denominationGridClassCatalog } from './css-denomination-grid.js';
23
24
  import { scrollRegionClassCatalog } from './css-scroll-region.js';
24
25
  import { fieldClassCatalog } from './css-field.js';
26
+ import { stepperClassCatalog } from './css-stepper.js';
27
+ import { stepsClassCatalog } from './css-steps.js';
25
28
  import { boxBorderClassCatalog } from './css-box-border.js';
26
29
  import { cssComponentClasses } from './css-components.js';
27
30
  import { buttonClassCatalog } from './css-button.js';
@@ -32,9 +35,11 @@ import { tableClassCatalog } from './css-table.js';
32
35
  import { chromeClassCatalog } from './css-chrome.js';
33
36
  import { sectionNavClassCatalog } from './css-section-nav.js';
34
37
  import { dialogClassCatalog } from './css-dialog.js';
38
+ import { dialogFrameClassCatalog } from './css-dialog-frame.js';
35
39
  import { selectClassCatalog } from './css-select.js';
36
40
  import { splitClassCatalog } from './css-split.js';
37
41
  import { toastClassCatalog } from './css-toast.js';
42
+ import { toastCardClassCatalog } from './css-toast-card.js';
38
43
  import { cssDocumentCanvas } from './css-document.js';
39
44
  import { cssPaletteAttributes } from './css-palettes.js';
40
45
  import { cssUtilities } from './css-utilities.js';
@@ -62,6 +67,7 @@ export function utilityClassCatalog() {
62
67
  ...chromeClassCatalog(),
63
68
  ...sectionNavClassCatalog(),
64
69
  ...dialogClassCatalog(),
70
+ ...dialogFrameClassCatalog(),
65
71
  ...accordionClassCatalog(),
66
72
  ...selectClassCatalog(),
67
73
  ...actionMenuClassCatalog(),
@@ -73,6 +79,7 @@ export function utilityClassCatalog() {
73
79
  ...radioGroupClassCatalog(),
74
80
  ...spinnerClassCatalog(),
75
81
  ...progressClassCatalog(),
82
+ ...noticeClassCatalog(),
76
83
  ...tooltipClassCatalog(),
77
84
  ...infoTipClassCatalog(),
78
85
  ...separatorClassCatalog(),
@@ -84,8 +91,11 @@ export function utilityClassCatalog() {
84
91
  ...gridSpanClassCatalog(),
85
92
  ...denominationGridClassCatalog(),
86
93
  ...fieldClassCatalog(),
94
+ ...stepperClassCatalog(),
95
+ ...stepsClassCatalog(),
87
96
  ...splitClassCatalog(),
88
97
  ...toastClassCatalog(),
98
+ ...toastCardClassCatalog(),
89
99
  ...responsiveClassCatalog(),
90
100
  ...boxBorderClassCatalog(),
91
101
  ];
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { ActionMenu, type ActionMenuAlign, type ActionMenuItem, type ActionMenuProps, } from './components/ActionMenu.js';
2
- export { ActionBar, type ActionBarProps } from './components/ActionBar.js';
2
+ export { ActionBar, type ActionBarProps, type ActionBarSummary, type ActionBarSummaryTone, } from './components/ActionBar.js';
3
3
  export { Accordion } from './components/Accordion.js';
4
4
  export type { AccordionProps, AccordionSize } from './components/Accordion.js';
5
5
  export { Switch, type SwitchProps } from './components/Switch.js';
@@ -7,7 +7,8 @@ export { DateField, type DateFieldLabels, type DateFieldProps, type WeekStart, }
7
7
  export { CalendarButton, type CalendarButtonLabels, type CalendarButtonProps, type CalendarButtonRange, } from './components/CalendarButton.js';
8
8
  export { Checkbox, type CheckboxProps } from './components/Checkbox.js';
9
9
  export { Spinner, type SpinnerProps, type SpinnerSize, } from './components/Spinner.js';
10
- export { Progress, type ProgressProps, type ProgressTone, } from './components/Progress.js';
10
+ export { Notice, noticeTones, noticeVariants, type NoticeProps, type NoticeRole, type NoticeTone, type NoticeVariant, } from './components/Notice.js';
11
+ export { Progress, progressTones, type ProgressProps, type ProgressTone, } from './components/Progress.js';
11
12
  export { Tooltip, type TooltipProps, type TooltipRelationship, } from './components/Tooltip.js';
12
13
  export { InfoTip, type InfoTipProps } from './components/InfoTip.js';
13
14
  export { RadioGroup, type RadioGroupOption, type RadioGroupProps, } from './components/RadioGroup.js';
@@ -18,12 +19,14 @@ export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, } from '
18
19
  export { Box, type BoxBorder, type BoxElement, type BoxProps, } from './components/Box.js';
19
20
  export { ButtonGroup, type ButtonGroupJustify, type ButtonGroupProps, } from './components/ButtonGroup.js';
20
21
  export { Card, type CardProps, type CardVariant } from './components/Card.js';
21
- export { Dialog, type DialogProps, type DialogSize, type DialogTitleLevel, } from './components/Dialog.js';
22
+ export { Dialog, dialogSizes, type DialogProps, type DialogRole, type DialogSize, type DialogTitleLevel, } from './components/Dialog.js';
22
23
  export { StatTile, type StatTileEmphasis, type StatTileProps, type StatTileTone, statTileTones, } from './components/StatTile.js';
23
24
  export { TabPanel, type TabItem, type TabPanelProps, Tabs, type TabsProps, tabId, tabPanelId, } from './components/Tabs.js';
24
- export { Toast, toastTones } from './components/Toast.js';
25
+ export { Toast, toastPlacements, toastTones, type ToastAction, type ToastPlacement, } from './components/Toast.js';
25
26
  export type { ToastProps, ToastTone } from './components/Toast.js';
26
27
  export { Field, type FieldProps, type FieldSize } from './components/Field.js';
28
+ export { Step, type StepHeadingLevel, type StepProps, Steps, type StepsLabels, type StepsProps, type StepStatus, } from './components/Steps.js';
29
+ export { Stepper, type StepperProps, type StepperWidth, } from './components/Stepper.js';
27
30
  export { Inline, type InlineProps } from './components/Inline.js';
28
31
  export { Split } from './components/Split.js';
29
32
  export type { SplitProps } from './components/Split.js';
@@ -48,7 +51,7 @@ export { Grid } from './components/Grid.js';
48
51
  export type { GridColumns, GridProps } from './components/Grid.js';
49
52
  export type { GridColumnSpan } from './css/css-grid-span.js';
50
53
  export type { ColumnSpanProps } from './column-span-classes.js';
51
- export { DenominationGrid } from './components/DenominationGrid.js';
52
- export type { DenominationGridColumn, DenominationGridLayout, DenominationGridProps, DenominationGridRow, DenominationGridRowRole, DenominationGridTone, DenominationLabelWidth, } from './components/DenominationGrid.js';
54
+ export { DenominationGrid, denominationLabelAppearances, } from './components/DenominationGrid.js';
55
+ export type { DenominationGridColumn, DenominationGridEntry, DenominationGridLayout, DenominationGridProps, DenominationGridRow, DenominationGridRowEmphasis, DenominationGridRowRole, DenominationGridTone, DenominationLabelAppearance, DenominationLabelWidth, } from './components/DenominationGrid.js';
53
56
  export { FilterChips } from './components/FilterChips.js';
54
57
  export type { FilterChipOption, FilterChipsProps, } from './components/FilterChips.js';
package/dist/index.js CHANGED
@@ -1,12 +1,13 @@
1
1
  export { ActionMenu, } from './components/ActionMenu.js';
2
- export { ActionBar } from './components/ActionBar.js';
2
+ export { ActionBar, } from './components/ActionBar.js';
3
3
  export { Accordion } from './components/Accordion.js';
4
4
  export { Switch } from './components/Switch.js';
5
5
  export { DateField, } from './components/DateField.js';
6
6
  export { CalendarButton, } from './components/CalendarButton.js';
7
7
  export { Checkbox } from './components/Checkbox.js';
8
8
  export { Spinner, } from './components/Spinner.js';
9
- export { Progress, } from './components/Progress.js';
9
+ export { Notice, noticeTones, noticeVariants, } from './components/Notice.js';
10
+ export { Progress, progressTones, } from './components/Progress.js';
10
11
  export { Tooltip, } from './components/Tooltip.js';
11
12
  export { InfoTip } from './components/InfoTip.js';
12
13
  export { RadioGroup, } from './components/RadioGroup.js';
@@ -17,11 +18,13 @@ export { Button, } from './components/Button.js';
17
18
  export { Box, } from './components/Box.js';
18
19
  export { ButtonGroup, } from './components/ButtonGroup.js';
19
20
  export { Card } from './components/Card.js';
20
- export { Dialog, } from './components/Dialog.js';
21
+ export { Dialog, dialogSizes, } from './components/Dialog.js';
21
22
  export { StatTile, statTileTones, } from './components/StatTile.js';
22
23
  export { TabPanel, Tabs, tabId, tabPanelId, } from './components/Tabs.js';
23
- export { Toast, toastTones } from './components/Toast.js';
24
+ export { Toast, toastPlacements, toastTones, } from './components/Toast.js';
24
25
  export { Field } from './components/Field.js';
26
+ export { Step, Steps, } from './components/Steps.js';
27
+ export { Stepper, } from './components/Stepper.js';
25
28
  export { Inline } from './components/Inline.js';
26
29
  export { Split } from './components/Split.js';
27
30
  export { Nav } from './components/Nav.js';
@@ -37,5 +40,5 @@ export { breakpointQuery } from './css/breakpoints.js';
37
40
  export { Separator } from './components/Separator.js';
38
41
  export { DescriptionItem, DescriptionList, } from './components/DescriptionList.js';
39
42
  export { Grid } from './components/Grid.js';
40
- export { DenominationGrid } from './components/DenominationGrid.js';
43
+ export { DenominationGrid, denominationLabelAppearances, } from './components/DenominationGrid.js';
41
44
  export { FilterChips } from './components/FilterChips.js';