@nyxwire/css 0.0.0-stage → 0.1.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 (134) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +133 -2
  3. package/dist/base.css +850 -0
  4. package/dist/components.css +10508 -0
  5. package/dist/docs/components/accordion.md +83 -0
  6. package/dist/docs/components/alert.md +52 -0
  7. package/dist/docs/components/avatar.md +55 -0
  8. package/dist/docs/components/badge.md +64 -0
  9. package/dist/docs/components/breadcrumbs.md +64 -0
  10. package/dist/docs/components/button.md +197 -0
  11. package/dist/docs/components/card.md +103 -0
  12. package/dist/docs/components/checkbox.md +45 -0
  13. package/dist/docs/components/chip.md +30 -0
  14. package/dist/docs/components/cluster.md +33 -0
  15. package/dist/docs/components/code.md +65 -0
  16. package/dist/docs/components/container.md +24 -0
  17. package/dist/docs/components/dialog.md +199 -0
  18. package/dist/docs/components/divider.md +31 -0
  19. package/dist/docs/components/dl.md +24 -0
  20. package/dist/docs/components/effect-utilities.md +82 -0
  21. package/dist/docs/components/empty.md +40 -0
  22. package/dist/docs/components/frame.md +27 -0
  23. package/dist/docs/components/grid.md +31 -0
  24. package/dist/docs/components/hud.md +75 -0
  25. package/dist/docs/components/input-group.md +28 -0
  26. package/dist/docs/components/input.md +52 -0
  27. package/dist/docs/components/kbd.md +42 -0
  28. package/dist/docs/components/label-and-field.md +31 -0
  29. package/dist/docs/components/link.md +41 -0
  30. package/dist/docs/components/list.md +67 -0
  31. package/dist/docs/components/menu.md +85 -0
  32. package/dist/docs/components/meter.md +77 -0
  33. package/dist/docs/components/navbar.md +66 -0
  34. package/dist/docs/components/pagination.md +64 -0
  35. package/dist/docs/components/popover.md +59 -0
  36. package/dist/docs/components/progress.md +32 -0
  37. package/dist/docs/components/prose.md +29 -0
  38. package/dist/docs/components/select.md +51 -0
  39. package/dist/docs/components/sidebar.md +35 -0
  40. package/dist/docs/components/sidenav.md +45 -0
  41. package/dist/docs/components/skeleton.md +36 -0
  42. package/dist/docs/components/slider.md +32 -0
  43. package/dist/docs/components/spinner.md +30 -0
  44. package/dist/docs/components/stack.md +26 -0
  45. package/dist/docs/components/steps.md +49 -0
  46. package/dist/docs/components/switch.md +19 -0
  47. package/dist/docs/components/table.md +83 -0
  48. package/dist/docs/components/tabs.md +207 -0
  49. package/dist/docs/components/textarea.md +13 -0
  50. package/dist/docs/components/toast.md +86 -0
  51. package/dist/docs/components/tooltip.md +39 -0
  52. package/dist/docs/components/typography-classes.md +38 -0
  53. package/dist/docs/families/data-display.md +15 -0
  54. package/dist/docs/families/feedback.md +13 -0
  55. package/dist/docs/families/forms.md +141 -0
  56. package/dist/docs/families/layout-typography.md +17 -0
  57. package/dist/docs/families/navigation.md +13 -0
  58. package/dist/docs/families/overlays.md +13 -0
  59. package/dist/docs/families/surfaces.md +11 -0
  60. package/dist/docs/foundations/accessibility.md +71 -0
  61. package/dist/docs/foundations/color-roles.md +114 -0
  62. package/dist/docs/foundations/effects-motion.md +150 -0
  63. package/dist/docs/foundations/flavors.md +156 -0
  64. package/dist/docs/foundations/icons.md +45 -0
  65. package/dist/docs/foundations/palette.md +180 -0
  66. package/dist/docs/foundations/spacing-elevation.md +168 -0
  67. package/dist/docs/foundations/typography.md +80 -0
  68. package/dist/docs/index.md +233 -0
  69. package/dist/docs/manifest.json +859 -0
  70. package/dist/fonts/inter-OFL.txt +93 -0
  71. package/dist/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
  72. package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
  73. package/dist/fonts/inter-latin-wght-italic.woff2 +0 -0
  74. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  75. package/dist/fonts/martian-mono-OFL.txt +93 -0
  76. package/dist/fonts/martian-mono-latin-ext-wdth-normal.woff2 +0 -0
  77. package/dist/fonts/martian-mono-latin-wdth-normal.woff2 +0 -0
  78. package/dist/fonts/space-grotesk-OFL.txt +93 -0
  79. package/dist/fonts/space-grotesk-latin-ext-wght-normal.woff2 +0 -0
  80. package/dist/fonts/space-grotesk-latin-wght-normal.woff2 +0 -0
  81. package/dist/fonts.css +73 -0
  82. package/dist/nyxwire.css +12183 -0
  83. package/dist/tokens.css +579 -0
  84. package/dist/utilities.css +176 -0
  85. package/nyxwire.d.ts +2 -0
  86. package/package.json +66 -3
  87. package/skills/nyxwire/SKILL.md +63 -0
  88. package/src/base.css +158 -0
  89. package/src/components/accordion.css +280 -0
  90. package/src/components/alert.css +176 -0
  91. package/src/components/avatar.css +262 -0
  92. package/src/components/badge.css +193 -0
  93. package/src/components/breadcrumbs.css +209 -0
  94. package/src/components/btn.css +517 -0
  95. package/src/components/card.css +327 -0
  96. package/src/components/checkbox.css +202 -0
  97. package/src/components/chip.css +345 -0
  98. package/src/components/code.css +340 -0
  99. package/src/components/dialog.css +411 -0
  100. package/src/components/divider.css +201 -0
  101. package/src/components/empty.css +216 -0
  102. package/src/components/field.css +161 -0
  103. package/src/components/hud.css +212 -0
  104. package/src/components/index.css +50 -0
  105. package/src/components/input.css +383 -0
  106. package/src/components/kbd.css +197 -0
  107. package/src/components/layout.css +344 -0
  108. package/src/components/link.css +178 -0
  109. package/src/components/list.css +353 -0
  110. package/src/components/menu.css +347 -0
  111. package/src/components/meter.css +238 -0
  112. package/src/components/navbar.css +309 -0
  113. package/src/components/pagination.css +302 -0
  114. package/src/components/popover.css +352 -0
  115. package/src/components/progress.css +241 -0
  116. package/src/components/select.css +121 -0
  117. package/src/components/sidenav.css +326 -0
  118. package/src/components/skeleton.css +193 -0
  119. package/src/components/slider.css +201 -0
  120. package/src/components/spinner.css +200 -0
  121. package/src/components/stat.css +263 -0
  122. package/src/components/steps.css +311 -0
  123. package/src/components/switch.css +183 -0
  124. package/src/components/table.css +290 -0
  125. package/src/components/tabs.css +271 -0
  126. package/src/components/toast.css +413 -0
  127. package/src/components/tooltip.css +288 -0
  128. package/src/fonts.css +92 -0
  129. package/src/index.css +6 -0
  130. package/src/motion.css +177 -0
  131. package/src/semantic.css +85 -0
  132. package/src/tokens.css +276 -0
  133. package/src/typography.css +430 -0
  134. package/src/utilities.css +198 -0
@@ -0,0 +1,271 @@
1
+ /* Tabs: a tablist of tabs over tabpanels. Works with ARIA roles alone inside .nw-tabs, or with the
2
+ .nw-tabs-list / .nw-tab / .nw-tabs-panel classes. The selected tab is set in the intent ink on
3
+ its tonal wash; variants: pill (segmented), cut (chamfered folder tabs), vertical, stretch. */
4
+ @layer components {
5
+ .nw-tabs {
6
+ --_intent: var(--nw-primary);
7
+ --_on: var(--nw-on-primary);
8
+ --_soft: var(--nw-primary-soft);
9
+ --_ink: color-mix(in oklab, var(--_intent) var(--nw-soft-ink), var(--nw-fg));
10
+ --_h: var(--nw-control-md);
11
+ --_fs: var(--nw-text-sm);
12
+ --_px: var(--nw-space-3);
13
+ display: grid;
14
+ gap: var(--nw-space-4);
15
+ min-inline-size: 0;
16
+ }
17
+
18
+ :is(.nw-tabs [role='tablist'], .nw-tabs-list) {
19
+ display: flex;
20
+ gap: var(--nw-space-1);
21
+ align-items: flex-end;
22
+ margin: 0;
23
+ padding: 0;
24
+ border-block-end: 1px solid var(--nw-line);
25
+ list-style: none;
26
+ overflow-x: auto;
27
+ scrollbar-width: none;
28
+ }
29
+
30
+ :is(.nw-tabs [role='tab'], .nw-tab) {
31
+ position: relative;
32
+ display: inline-flex;
33
+ gap: var(--nw-space-2);
34
+ align-items: center;
35
+ justify-content: center;
36
+ min-block-size: var(--_h);
37
+ padding-inline: var(--_px);
38
+ border: 0;
39
+ border-radius: var(--nw-radius-sm) var(--nw-radius-sm) 0 0;
40
+ font: inherit;
41
+ font-size: var(--_fs);
42
+ font-weight: 500;
43
+ line-height: var(--nw-leading-snug);
44
+ color: var(--nw-fg-muted);
45
+ text-decoration-line: none;
46
+ white-space: nowrap;
47
+ background: none;
48
+ cursor: pointer;
49
+ transition:
50
+ color var(--nw-duration-fast) var(--nw-ease-standard),
51
+ background-color var(--nw-duration-fast) var(--nw-ease-standard),
52
+ box-shadow var(--nw-duration-fast) var(--nw-ease-standard);
53
+ }
54
+ :is(.nw-tabs [role='tab'], .nw-tab):hover:not(:disabled, [aria-disabled='true']) {
55
+ color: var(--nw-fg);
56
+ background-color: var(--nw-panel);
57
+ }
58
+ :is(.nw-tabs [role='tab'], .nw-tab):focus-visible {
59
+ outline: var(--nw-ring-width) solid var(--nw-ring);
60
+ outline-offset: calc(-1 * var(--nw-ring-width));
61
+ }
62
+ :is(.nw-tabs [role='tab'], .nw-tab):is(
63
+ [aria-selected='true'],
64
+ [data-state='active'],
65
+ .nw-tab-active
66
+ ) {
67
+ color: var(--_ink);
68
+ background-color: var(--_soft);
69
+ }
70
+ :is(.nw-tabs [role='tab'], .nw-tab):is(:disabled, [aria-disabled='true']) {
71
+ color: var(--nw-fg-disabled);
72
+ cursor: not-allowed;
73
+ }
74
+
75
+ .nw-tab-icon {
76
+ display: inline-flex;
77
+ flex: none;
78
+ }
79
+ .nw-tab-icon > svg {
80
+ inline-size: 1.15em;
81
+ block-size: 1.15em;
82
+ }
83
+ /* A count is a value that changes, so it may sit on the tab. */
84
+ .nw-tab-count {
85
+ display: inline-grid;
86
+ place-items: center;
87
+ min-inline-size: 1.6em;
88
+ padding: 0 var(--nw-space-1-5);
89
+ border-radius: var(--nw-radius-full);
90
+ font-family: var(--nw-font-mono);
91
+ font-size: var(--nw-text-2xs);
92
+ font-variant-numeric: tabular-nums;
93
+ line-height: 1.6;
94
+ color: var(--nw-fg-subtle);
95
+ background-color: var(--nw-panel-active);
96
+ }
97
+ :is([aria-selected='true'], [data-state='active'], .nw-tab-active) > .nw-tab-count {
98
+ color: var(--_on);
99
+ background-color: var(--_intent);
100
+ }
101
+
102
+ :is(.nw-tabs [role='tabpanel'], .nw-tabs-panel) {
103
+ min-inline-size: 0;
104
+ border-radius: var(--nw-radius-sm);
105
+ }
106
+ :is(.nw-tabs [role='tabpanel'], .nw-tabs-panel):focus-visible {
107
+ outline: var(--nw-ring-width) solid var(--nw-ring);
108
+ outline-offset: var(--nw-ring-offset);
109
+ }
110
+ :is(.nw-tabs [role='tabpanel'], .nw-tabs-panel):is([hidden], [data-state='inactive']) {
111
+ display: none;
112
+ }
113
+
114
+ /* Intents */
115
+ .nw-tabs-primary {
116
+ --_intent: var(--nw-primary);
117
+ --_on: var(--nw-on-primary);
118
+ --_soft: var(--nw-primary-soft);
119
+ }
120
+ .nw-tabs-secondary {
121
+ --_intent: var(--nw-secondary);
122
+ --_on: var(--nw-on-secondary);
123
+ --_soft: var(--nw-secondary-soft);
124
+ }
125
+ .nw-tabs-tertiary {
126
+ --_intent: var(--nw-tertiary);
127
+ --_on: var(--nw-on-tertiary);
128
+ --_soft: var(--nw-tertiary-soft);
129
+ }
130
+ .nw-tabs-neutral {
131
+ --_intent: var(--nw-fg);
132
+ --_on: var(--nw-canvas);
133
+ --_soft: color-mix(in oklab, var(--nw-fg) 12%, transparent);
134
+ }
135
+ .nw-tabs-info {
136
+ --_intent: var(--nw-info);
137
+ --_on: var(--nw-on-info);
138
+ --_soft: var(--nw-info-soft);
139
+ }
140
+ .nw-tabs-success {
141
+ --_intent: var(--nw-success);
142
+ --_on: var(--nw-on-success);
143
+ --_soft: var(--nw-success-soft);
144
+ }
145
+ .nw-tabs-warning {
146
+ --_intent: var(--nw-warning);
147
+ --_on: var(--nw-on-warning);
148
+ --_soft: var(--nw-warning-soft);
149
+ }
150
+ .nw-tabs-danger {
151
+ --_intent: var(--nw-danger);
152
+ --_on: var(--nw-on-danger);
153
+ --_soft: var(--nw-danger-soft);
154
+ }
155
+
156
+ /* Pill: a segmented control on a sunken track; the selected segment is solid and glows. */
157
+ .nw-tabs-pill :is([role='tablist'], .nw-tabs-list) {
158
+ gap: var(--nw-space-0-5);
159
+ align-items: stretch;
160
+ inline-size: fit-content;
161
+ max-inline-size: 100%;
162
+ padding: var(--nw-space-0-5);
163
+ border: 1px solid var(--nw-line-strong);
164
+ border-radius: var(--nw-radius-md);
165
+ background-color: var(--nw-canvas-sunken);
166
+ }
167
+ .nw-tabs-pill :is([role='tab'], .nw-tab) {
168
+ min-block-size: calc(var(--_h) - 2 * var(--nw-space-0-5) - 2px);
169
+ border-radius: var(--nw-radius-sm);
170
+ }
171
+ .nw-tabs-pill
172
+ :is([role='tab'], .nw-tab):is([aria-selected='true'], [data-state='active'], .nw-tab-active) {
173
+ --nw-glow-color: var(--_intent);
174
+ color: var(--_on);
175
+ background-color: var(--_intent);
176
+ box-shadow: var(--nw-glow-sm);
177
+ }
178
+ .nw-tabs-pill :is([aria-selected='true'], [data-state='active'], .nw-tab-active) > .nw-tab-count {
179
+ color: var(--_intent);
180
+ background-color: var(--_on);
181
+ }
182
+
183
+ /* Cut: folder tabs with the top-right corner chamfered by --nw-cut. The selected tab is a solid
184
+ panel in the intent ink; the clip takes the place of a radius, so there is no edge line. */
185
+ .nw-tabs-cut :is([role='tab'], .nw-tab) {
186
+ border-radius: 0;
187
+ clip-path: polygon(0 0, calc(100% - var(--nw-cut)) 0, 100% var(--nw-cut), 100% 100%, 0 100%);
188
+ }
189
+ .nw-tabs-cut
190
+ :is([role='tab'], .nw-tab):is([aria-selected='true'], [data-state='active'], .nw-tab-active) {
191
+ color: var(--_ink);
192
+ background-color: var(--nw-panel);
193
+ }
194
+
195
+ /* Vertical: the list runs down the inline-start side. */
196
+ .nw-tabs-vertical {
197
+ grid-template-columns: auto minmax(0, 1fr);
198
+ align-items: start;
199
+ }
200
+ .nw-tabs-vertical :is([role='tablist'], .nw-tabs-list) {
201
+ flex-direction: column;
202
+ align-items: stretch;
203
+ border-block-end: 0;
204
+ border-inline-end: 1px solid var(--nw-line);
205
+ overflow: visible;
206
+ }
207
+ .nw-tabs-vertical :is([role='tab'], .nw-tab) {
208
+ justify-content: flex-start;
209
+ border-radius: var(--nw-radius-sm) 0 0 var(--nw-radius-sm);
210
+ }
211
+ .nw-tabs-vertical.nw-tabs-pill :is([role='tablist'], .nw-tabs-list) {
212
+ border: 1px solid var(--nw-line-strong);
213
+ }
214
+ .nw-tabs-vertical.nw-tabs-pill :is([role='tab'], .nw-tab) {
215
+ border-radius: var(--nw-radius-sm);
216
+ }
217
+ .nw-tabs-vertical.nw-tabs-cut :is([role='tab'], .nw-tab) {
218
+ border-radius: 0;
219
+ }
220
+
221
+ /* Stretch: tabs share the list width. */
222
+ .nw-tabs-stretch :is([role='tab'], .nw-tab) {
223
+ flex: 1;
224
+ }
225
+
226
+ /* Sizes */
227
+ .nw-tabs-xs {
228
+ --_h: var(--nw-control-xs);
229
+ --_fs: var(--nw-text-xs);
230
+ --_px: var(--nw-space-2);
231
+ }
232
+ .nw-tabs-sm {
233
+ --_h: var(--nw-control-sm);
234
+ --_fs: var(--nw-text-sm);
235
+ --_px: var(--nw-space-2-5);
236
+ }
237
+ .nw-tabs-md {
238
+ --_h: var(--nw-control-md);
239
+ --_fs: var(--nw-text-sm);
240
+ --_px: var(--nw-space-3);
241
+ }
242
+ .nw-tabs-lg {
243
+ --_h: var(--nw-control-lg);
244
+ --_fs: var(--nw-text-base);
245
+ --_px: var(--nw-space-4);
246
+ }
247
+
248
+ @media (forced-colors: active) {
249
+ :is(.nw-tabs [role='tab'], .nw-tab):is(
250
+ [aria-selected='true'],
251
+ [data-state='active'],
252
+ .nw-tab-active
253
+ ) {
254
+ color: Highlight;
255
+ text-decoration: underline 2px;
256
+ }
257
+ .nw-tabs-pill
258
+ :is([role='tab'], .nw-tab):is([aria-selected='true'], [data-state='active'], .nw-tab-active) {
259
+ forced-color-adjust: none;
260
+ color: HighlightText;
261
+ background-color: Highlight;
262
+ box-shadow: none;
263
+ }
264
+ .nw-tabs-cut :is([role='tab'], .nw-tab) {
265
+ clip-path: none;
266
+ }
267
+ :is(.nw-tabs [role='tab'], .nw-tab):is(:disabled, [aria-disabled='true']) {
268
+ color: GrayText;
269
+ }
270
+ }
271
+ }
@@ -0,0 +1,413 @@
1
+ /* Toast stack and toast. The region is a fixed stack in one of six corners; toasts are grid rows
2
+ with an icon, a body and a close button, and carry the region's swipe direction.
3
+
4
+ <div class="nw-toast-region nw-toast-region-bottom-right" role="region" aria-label="Notifications">
5
+ <div class="nw-toast nw-toast-success" role="status" data-state="open">
6
+ <span class="nw-toast-icon" aria-hidden="true">svg</span>
7
+ <div class="nw-toast-body">
8
+ <p class="nw-toast-title">Deployed</p>
9
+ <p class="nw-toast-description">Build 412 is live.</p>
10
+ <div class="nw-toast-actions"><button class="nw-btn nw-btn-sm nw-btn-ghost">Undo</button></div>
11
+ </div>
12
+ <button class="nw-toast-close" aria-label="Dismiss">svg</button>
13
+ <span class="nw-toast-timer" aria-hidden="true"></span>
14
+ </div>
15
+ </div>
16
+
17
+ The timer drains over --nw-toast-duration (default 5s) and pauses while the toast is hovered or
18
+ holds focus; it is an indicator of remaining time, not a decoration. Add data-state="closed" to
19
+ play the exit before removing the node. data-swipe="move|cancel|end" follows the pointer on the
20
+ region's swipe axis; the end position comes from --nw-toast-swipe-end-x. Intents color the icon
21
+ and the timer; -solid inverts the whole toast; -glow and -cut are opt-in. */
22
+ @layer components {
23
+ .nw-toast-region {
24
+ --_swipe: -1;
25
+
26
+ position: fixed;
27
+ inset-block-end: var(--nw-space-4);
28
+ inset-inline-end: var(--nw-space-4);
29
+ z-index: var(--nw-z-toast);
30
+ display: flex;
31
+ flex-direction: column;
32
+ gap: var(--nw-space-3);
33
+ inline-size: min(24rem, calc(100dvw - 2 * var(--nw-space-4)));
34
+ max-block-size: calc(100dvh - 2 * var(--nw-space-4));
35
+ pointer-events: none;
36
+ }
37
+ .nw-toast-region > * {
38
+ pointer-events: auto;
39
+ }
40
+ .nw-toast-region-top-right {
41
+ inset-block: var(--nw-space-4) auto;
42
+ inset-inline: auto var(--nw-space-4);
43
+ }
44
+ .nw-toast-region-top-left {
45
+ --_swipe: 1;
46
+ inset-block: var(--nw-space-4) auto;
47
+ inset-inline: var(--nw-space-4) auto;
48
+ }
49
+ .nw-toast-region-bottom-left {
50
+ --_swipe: 1;
51
+ inset-inline: var(--nw-space-4) auto;
52
+ inset-inline-end: auto;
53
+ }
54
+ .nw-toast-region-top-center,
55
+ .nw-toast-region-bottom-center {
56
+ --_swipe: 0;
57
+ inset-inline-start: 50%;
58
+ translate: -50% 0;
59
+ }
60
+ .nw-toast-region-top-center {
61
+ inset-block: var(--nw-space-4) auto;
62
+ }
63
+ /* Newest toast sits nearest its edge. */
64
+ .nw-toast-region-top-right,
65
+ .nw-toast-region-top-left,
66
+ .nw-toast-region-top-center {
67
+ flex-direction: column-reverse;
68
+ }
69
+
70
+ .nw-toast {
71
+ --_intent: var(--nw-primary);
72
+ --_on: var(--nw-on-primary);
73
+ --_soft: var(--nw-primary-soft);
74
+ --_fill: var(--nw-panel);
75
+ --_edge: var(--nw-line-strong);
76
+ --_ink: var(--nw-fg);
77
+ --_muted: var(--nw-fg-muted);
78
+ --_from: translateX(calc(var(--_swipe, -1) * (100% + var(--nw-space-4))));
79
+ --_p: var(--nw-space-4);
80
+ --_fs: var(--nw-text-sm);
81
+ --nw-toast-duration: 5s;
82
+ --nw-glow-color: var(--_intent);
83
+
84
+ position: relative;
85
+ display: grid;
86
+ grid-template-columns: auto minmax(0, 1fr) auto;
87
+ gap: var(--nw-space-2) var(--nw-space-3);
88
+ align-items: start;
89
+ padding: var(--_p);
90
+ overflow: hidden;
91
+ border: 1px solid var(--_edge);
92
+ border-radius: var(--nw-radius-md);
93
+ font-size: var(--_fs);
94
+ line-height: var(--nw-leading-normal);
95
+ color: var(--_ink);
96
+ background-color: var(--_fill);
97
+ box-shadow: var(--nw-shadow-lg);
98
+ animation: nw-toast-in var(--nw-duration-slow) var(--nw-ease-out) both;
99
+ }
100
+ .nw-toast[data-state='closed'] {
101
+ animation: nw-toast-out var(--nw-duration-base) var(--nw-ease-in) both;
102
+ }
103
+ .nw-toast[data-swipe='move'] {
104
+ transform: translateX(var(--nw-toast-swipe-move-x, 0px));
105
+ transition: none;
106
+ }
107
+ .nw-toast[data-swipe='cancel'] {
108
+ transform: none;
109
+ transition: transform var(--nw-duration-base) var(--nw-ease-out);
110
+ }
111
+ .nw-toast[data-swipe='end'] {
112
+ animation: nw-toast-swipe-out var(--nw-duration-fast) var(--nw-ease-in) both;
113
+ }
114
+
115
+ /* Parts ------------------------------------------------------------------------------------ */
116
+
117
+ .nw-toast-icon {
118
+ display: inline-grid;
119
+ place-items: center;
120
+ inline-size: var(--nw-space-6);
121
+ block-size: var(--nw-space-6);
122
+ margin-block-start: var(--nw-space-0-5);
123
+ color: var(--_intent);
124
+ }
125
+ .nw-toast-icon > svg {
126
+ inline-size: var(--nw-space-5);
127
+ block-size: var(--nw-space-5);
128
+ filter: drop-shadow(0 0 var(--nw-space-1) color-mix(in oklab, var(--_intent) 45%, transparent));
129
+ }
130
+ .nw-toast:not(:has(.nw-toast-icon)) {
131
+ grid-template-columns: minmax(0, 1fr) auto;
132
+ }
133
+ .nw-toast-body {
134
+ display: grid;
135
+ gap: var(--nw-space-1);
136
+ min-inline-size: 0;
137
+ }
138
+ .nw-toast-title {
139
+ font-weight: 600;
140
+ color: var(--_ink);
141
+ text-wrap: pretty;
142
+ }
143
+ .nw-toast-description {
144
+ font-size: var(--nw-text-xs);
145
+ color: var(--_muted);
146
+ text-wrap: pretty;
147
+ }
148
+ .nw-toast-actions {
149
+ display: flex;
150
+ flex-wrap: wrap;
151
+ gap: var(--nw-space-2);
152
+ margin-block-start: var(--nw-space-2);
153
+ }
154
+ .nw-toast-close {
155
+ display: inline-grid;
156
+ place-items: center;
157
+ inline-size: var(--nw-control-sm);
158
+ block-size: var(--nw-control-sm);
159
+ margin: calc(-1 * var(--nw-space-1)) calc(-1 * var(--nw-space-1)) 0 0;
160
+ padding: 0;
161
+ border: 0;
162
+ border-radius: var(--nw-radius-sm);
163
+ color: var(--_muted);
164
+ background: none;
165
+ transition:
166
+ color var(--nw-duration-fast) var(--nw-ease-standard),
167
+ background-color var(--nw-duration-fast) var(--nw-ease-standard);
168
+ }
169
+ .nw-toast-close > svg {
170
+ inline-size: var(--nw-space-4);
171
+ block-size: var(--nw-space-4);
172
+ }
173
+ .nw-toast-close:hover {
174
+ color: var(--_ink);
175
+ background-color: color-mix(in oklab, var(--_ink) 8%, transparent);
176
+ }
177
+ .nw-toast-close:active {
178
+ background-color: color-mix(in oklab, var(--_ink) 16%, transparent);
179
+ }
180
+ .nw-toast-close:focus-visible {
181
+ outline: var(--nw-ring-width) solid var(--nw-ring);
182
+ outline-offset: 0;
183
+ }
184
+ .nw-toast:focus-visible {
185
+ outline: var(--nw-ring-width) solid var(--nw-ring);
186
+ outline-offset: var(--nw-ring-offset);
187
+ }
188
+
189
+ /* Remaining time, read from the same duration the dismiss timer uses. */
190
+ .nw-toast-timer {
191
+ position: absolute;
192
+ inset-block-end: 0;
193
+ inset-inline: 0;
194
+ block-size: 2px;
195
+ overflow: hidden;
196
+ background: color-mix(in oklab, var(--_intent) 18%, transparent);
197
+ }
198
+ .nw-toast-timer::after {
199
+ content: '';
200
+ position: absolute;
201
+ inset: 0;
202
+ background: var(--_intent);
203
+ transform-origin: left center;
204
+ animation: nw-toast-timer var(--nw-toast-duration) linear both;
205
+ }
206
+ .nw-toast:is(:hover, :focus-within) .nw-toast-timer::after {
207
+ animation-play-state: paused;
208
+ }
209
+
210
+ /* Intents ---------------------------------------------------------------------------------- */
211
+
212
+ .nw-toast-primary {
213
+ --_intent: var(--nw-primary);
214
+ --_on: var(--nw-on-primary);
215
+ --_soft: var(--nw-primary-soft);
216
+ }
217
+ .nw-toast-secondary {
218
+ --_intent: var(--nw-secondary);
219
+ --_on: var(--nw-on-secondary);
220
+ --_soft: var(--nw-secondary-soft);
221
+ }
222
+ .nw-toast-tertiary {
223
+ --_intent: var(--nw-tertiary);
224
+ --_on: var(--nw-on-tertiary);
225
+ --_soft: var(--nw-tertiary-soft);
226
+ }
227
+ .nw-toast-neutral {
228
+ --_intent: var(--nw-fg-muted);
229
+ --_on: var(--nw-canvas);
230
+ --_soft: color-mix(in oklab, var(--nw-fg) 10%, transparent);
231
+ }
232
+ .nw-toast-info {
233
+ --_intent: var(--nw-info);
234
+ --_on: var(--nw-on-info);
235
+ --_soft: var(--nw-info-soft);
236
+ }
237
+ .nw-toast-success {
238
+ --_intent: var(--nw-success);
239
+ --_on: var(--nw-on-success);
240
+ --_soft: var(--nw-success-soft);
241
+ }
242
+ .nw-toast-warning {
243
+ --_intent: var(--nw-warning);
244
+ --_on: var(--nw-on-warning);
245
+ --_soft: var(--nw-warning-soft);
246
+ }
247
+ .nw-toast-danger {
248
+ --_intent: var(--nw-danger);
249
+ --_on: var(--nw-on-danger);
250
+ --_soft: var(--nw-danger-soft);
251
+ }
252
+
253
+ /* Sizes ------------------------------------------------------------------------------------ */
254
+
255
+ .nw-toast-xs {
256
+ --_p: var(--nw-space-2-5);
257
+ --_fs: var(--nw-text-xs);
258
+ }
259
+ .nw-toast-sm {
260
+ --_p: var(--nw-space-3);
261
+ --_fs: var(--nw-text-xs);
262
+ }
263
+ .nw-toast-md {
264
+ --_p: var(--nw-space-4);
265
+ --_fs: var(--nw-text-sm);
266
+ }
267
+ .nw-toast-lg {
268
+ --_p: var(--nw-space-5);
269
+ --_fs: var(--nw-text-base);
270
+ }
271
+
272
+ /* Variants --------------------------------------------------------------------------------- */
273
+
274
+ /* Soft tint over the panel: the toast reads as its intent without an accent stripe. */
275
+ .nw-toast-soft {
276
+ --_fill: color-mix(in oklab, var(--_intent) 8%, var(--nw-panel));
277
+ --_edge: color-mix(in oklab, var(--_intent) 45%, var(--nw-line-strong));
278
+ }
279
+ .nw-toast-solid {
280
+ --_fill: var(--_intent);
281
+ --_edge: var(--_intent);
282
+ --_ink: var(--_on);
283
+ --_muted: color-mix(in oklab, var(--_on) 85%, transparent);
284
+ }
285
+ .nw-toast-solid .nw-toast-icon {
286
+ color: var(--_on);
287
+ }
288
+ .nw-toast-solid .nw-toast-timer {
289
+ background: color-mix(in oklab, var(--_on) 25%, transparent);
290
+ }
291
+ .nw-toast-solid .nw-toast-timer::after {
292
+ background: var(--_on);
293
+ }
294
+ .nw-toast-wire {
295
+ --_edge: var(--nw-gradient-wire);
296
+ border-color: transparent;
297
+ background:
298
+ linear-gradient(var(--_fill), var(--_fill)) padding-box,
299
+ var(--_edge) border-box;
300
+ }
301
+ .nw-toast-glow {
302
+ box-shadow: var(--nw-shadow-lg), var(--nw-glow-md);
303
+ }
304
+ .nw-toast-cut {
305
+ --nw-fill: var(--_fill);
306
+ --nw-cut: var(--nw-space-3);
307
+ isolation: isolate;
308
+ border: 0;
309
+ border-radius: 0;
310
+ background: var(--nw-cut-surface);
311
+ overflow: visible;
312
+ }
313
+ .nw-toast-cut::before {
314
+ content: '';
315
+ position: absolute;
316
+ inset: 0;
317
+ z-index: 1;
318
+ pointer-events: none;
319
+ background: var(--_edge);
320
+ clip-path: var(--nw-cut-ring);
321
+ }
322
+ .nw-toast-cut .nw-toast-timer {
323
+ inset-inline-start: var(--nw-cut);
324
+ clip-path: var(--nw-cut-path);
325
+ }
326
+ .nw-toast-cut.nw-toast-glow {
327
+ box-shadow: none;
328
+ filter: var(--nw-glow-drop-md);
329
+ }
330
+
331
+ @keyframes nw-toast-in {
332
+ from {
333
+ opacity: 0;
334
+ transform: var(--_from);
335
+ }
336
+ to {
337
+ opacity: 1;
338
+ transform: none;
339
+ }
340
+ }
341
+ @keyframes nw-toast-out {
342
+ to {
343
+ opacity: 0;
344
+ transform: scale(0.96);
345
+ }
346
+ }
347
+ @keyframes nw-toast-swipe-out {
348
+ from {
349
+ transform: translateX(var(--nw-toast-swipe-end-x, 0px));
350
+ }
351
+ to {
352
+ opacity: 0;
353
+ transform: translateX(
354
+ calc(var(--_swipe, -1) * (100% + var(--nw-space-8)) + var(--nw-toast-swipe-end-x, 0px))
355
+ );
356
+ }
357
+ }
358
+ @keyframes nw-toast-timer {
359
+ from {
360
+ transform: scaleX(1);
361
+ }
362
+ to {
363
+ transform: scaleX(0);
364
+ }
365
+ }
366
+
367
+ @media (max-width: 40rem) {
368
+ .nw-toast-region {
369
+ inset-inline: var(--nw-space-3);
370
+ inset-block-end: var(--nw-space-3);
371
+ inline-size: auto;
372
+ translate: none;
373
+ }
374
+ .nw-toast-region-top-right,
375
+ .nw-toast-region-top-left,
376
+ .nw-toast-region-top-center {
377
+ inset-block: var(--nw-space-3) auto;
378
+ }
379
+ }
380
+
381
+ @media (prefers-reduced-motion: reduce) {
382
+ .nw-toast {
383
+ --_from: none;
384
+ }
385
+ .nw-toast[data-swipe='move'] {
386
+ transform: none;
387
+ }
388
+ /* The base layer collapses decorative animation to an instant. A toast that really
389
+ auto-dismisses should mark its timer .nw-motion-essential so the countdown keeps its real
390
+ duration; otherwise the track is hidden rather than frozen at a misleading width. */
391
+ .nw-toast-timer:not(.nw-motion-essential) {
392
+ display: none;
393
+ }
394
+ }
395
+
396
+ @media (forced-colors: active) {
397
+ .nw-toast {
398
+ border: 1px solid CanvasText;
399
+ background: Canvas;
400
+ box-shadow: none;
401
+ }
402
+ .nw-toast-cut::before {
403
+ display: none;
404
+ }
405
+ .nw-toast-icon,
406
+ .nw-toast-close {
407
+ color: CanvasText;
408
+ }
409
+ .nw-toast-timer {
410
+ background: CanvasText;
411
+ }
412
+ }
413
+ }