@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.
- package/LICENSE +21 -0
- package/README.md +133 -2
- package/dist/base.css +850 -0
- package/dist/components.css +10508 -0
- package/dist/docs/components/accordion.md +83 -0
- package/dist/docs/components/alert.md +52 -0
- package/dist/docs/components/avatar.md +55 -0
- package/dist/docs/components/badge.md +64 -0
- package/dist/docs/components/breadcrumbs.md +64 -0
- package/dist/docs/components/button.md +197 -0
- package/dist/docs/components/card.md +103 -0
- package/dist/docs/components/checkbox.md +45 -0
- package/dist/docs/components/chip.md +30 -0
- package/dist/docs/components/cluster.md +33 -0
- package/dist/docs/components/code.md +65 -0
- package/dist/docs/components/container.md +24 -0
- package/dist/docs/components/dialog.md +199 -0
- package/dist/docs/components/divider.md +31 -0
- package/dist/docs/components/dl.md +24 -0
- package/dist/docs/components/effect-utilities.md +82 -0
- package/dist/docs/components/empty.md +40 -0
- package/dist/docs/components/frame.md +27 -0
- package/dist/docs/components/grid.md +31 -0
- package/dist/docs/components/hud.md +75 -0
- package/dist/docs/components/input-group.md +28 -0
- package/dist/docs/components/input.md +52 -0
- package/dist/docs/components/kbd.md +42 -0
- package/dist/docs/components/label-and-field.md +31 -0
- package/dist/docs/components/link.md +41 -0
- package/dist/docs/components/list.md +67 -0
- package/dist/docs/components/menu.md +85 -0
- package/dist/docs/components/meter.md +77 -0
- package/dist/docs/components/navbar.md +66 -0
- package/dist/docs/components/pagination.md +64 -0
- package/dist/docs/components/popover.md +59 -0
- package/dist/docs/components/progress.md +32 -0
- package/dist/docs/components/prose.md +29 -0
- package/dist/docs/components/select.md +51 -0
- package/dist/docs/components/sidebar.md +35 -0
- package/dist/docs/components/sidenav.md +45 -0
- package/dist/docs/components/skeleton.md +36 -0
- package/dist/docs/components/slider.md +32 -0
- package/dist/docs/components/spinner.md +30 -0
- package/dist/docs/components/stack.md +26 -0
- package/dist/docs/components/steps.md +49 -0
- package/dist/docs/components/switch.md +19 -0
- package/dist/docs/components/table.md +83 -0
- package/dist/docs/components/tabs.md +207 -0
- package/dist/docs/components/textarea.md +13 -0
- package/dist/docs/components/toast.md +86 -0
- package/dist/docs/components/tooltip.md +39 -0
- package/dist/docs/components/typography-classes.md +38 -0
- package/dist/docs/families/data-display.md +15 -0
- package/dist/docs/families/feedback.md +13 -0
- package/dist/docs/families/forms.md +141 -0
- package/dist/docs/families/layout-typography.md +17 -0
- package/dist/docs/families/navigation.md +13 -0
- package/dist/docs/families/overlays.md +13 -0
- package/dist/docs/families/surfaces.md +11 -0
- package/dist/docs/foundations/accessibility.md +71 -0
- package/dist/docs/foundations/color-roles.md +114 -0
- package/dist/docs/foundations/effects-motion.md +150 -0
- package/dist/docs/foundations/flavors.md +156 -0
- package/dist/docs/foundations/icons.md +45 -0
- package/dist/docs/foundations/palette.md +180 -0
- package/dist/docs/foundations/spacing-elevation.md +168 -0
- package/dist/docs/foundations/typography.md +80 -0
- package/dist/docs/index.md +233 -0
- package/dist/docs/manifest.json +859 -0
- package/dist/fonts/inter-OFL.txt +93 -0
- package/dist/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/martian-mono-OFL.txt +93 -0
- package/dist/fonts/martian-mono-latin-ext-wdth-normal.woff2 +0 -0
- package/dist/fonts/martian-mono-latin-wdth-normal.woff2 +0 -0
- package/dist/fonts/space-grotesk-OFL.txt +93 -0
- package/dist/fonts/space-grotesk-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/space-grotesk-latin-wght-normal.woff2 +0 -0
- package/dist/fonts.css +73 -0
- package/dist/nyxwire.css +12183 -0
- package/dist/tokens.css +579 -0
- package/dist/utilities.css +176 -0
- package/nyxwire.d.ts +2 -0
- package/package.json +66 -3
- package/skills/nyxwire/SKILL.md +63 -0
- package/src/base.css +158 -0
- package/src/components/accordion.css +280 -0
- package/src/components/alert.css +176 -0
- package/src/components/avatar.css +262 -0
- package/src/components/badge.css +193 -0
- package/src/components/breadcrumbs.css +209 -0
- package/src/components/btn.css +517 -0
- package/src/components/card.css +327 -0
- package/src/components/checkbox.css +202 -0
- package/src/components/chip.css +345 -0
- package/src/components/code.css +340 -0
- package/src/components/dialog.css +411 -0
- package/src/components/divider.css +201 -0
- package/src/components/empty.css +216 -0
- package/src/components/field.css +161 -0
- package/src/components/hud.css +212 -0
- package/src/components/index.css +50 -0
- package/src/components/input.css +383 -0
- package/src/components/kbd.css +197 -0
- package/src/components/layout.css +344 -0
- package/src/components/link.css +178 -0
- package/src/components/list.css +353 -0
- package/src/components/menu.css +347 -0
- package/src/components/meter.css +238 -0
- package/src/components/navbar.css +309 -0
- package/src/components/pagination.css +302 -0
- package/src/components/popover.css +352 -0
- package/src/components/progress.css +241 -0
- package/src/components/select.css +121 -0
- package/src/components/sidenav.css +326 -0
- package/src/components/skeleton.css +193 -0
- package/src/components/slider.css +201 -0
- package/src/components/spinner.css +200 -0
- package/src/components/stat.css +263 -0
- package/src/components/steps.css +311 -0
- package/src/components/switch.css +183 -0
- package/src/components/table.css +290 -0
- package/src/components/tabs.css +271 -0
- package/src/components/toast.css +413 -0
- package/src/components/tooltip.css +288 -0
- package/src/fonts.css +92 -0
- package/src/index.css +6 -0
- package/src/motion.css +177 -0
- package/src/semantic.css +85 -0
- package/src/tokens.css +276 -0
- package/src/typography.css +430 -0
- package/src/utilities.css +198 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/* List: rows of content. <ul class="nw-list"> of .nw-list-item rows (or <li><a class="nw-list-item">
|
|
2
|
+
for navigable rows), with icon, media, content, meta and end slots. Variants: divided, bordered,
|
|
3
|
+
interactive, bullet, ordered, check, inline. .nw-dl is the description list. */
|
|
4
|
+
@layer components {
|
|
5
|
+
.nw-list {
|
|
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
|
+
--_py: var(--nw-space-3);
|
|
11
|
+
--_px: var(--nw-space-3);
|
|
12
|
+
--_fs: var(--nw-text-sm);
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
min-inline-size: 0;
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
font-size: var(--_fs);
|
|
19
|
+
line-height: var(--nw-leading-snug);
|
|
20
|
+
color: var(--nw-fg);
|
|
21
|
+
list-style: none;
|
|
22
|
+
}
|
|
23
|
+
/* A bare <li> is a wrapper; an <li> that is itself the item keeps the row layout. */
|
|
24
|
+
.nw-list > li:not(.nw-list-item) {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
min-inline-size: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.nw-list-item {
|
|
31
|
+
display: flex;
|
|
32
|
+
gap: var(--nw-space-3);
|
|
33
|
+
align-items: center;
|
|
34
|
+
min-inline-size: 0;
|
|
35
|
+
padding: var(--_py) var(--_px);
|
|
36
|
+
border: 0;
|
|
37
|
+
border-radius: var(--nw-radius-sm);
|
|
38
|
+
font: inherit;
|
|
39
|
+
text-align: start;
|
|
40
|
+
color: inherit;
|
|
41
|
+
text-decoration-line: none;
|
|
42
|
+
background: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Slots */
|
|
46
|
+
.nw-list-item-icon {
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
flex: none;
|
|
49
|
+
color: var(--nw-fg-subtle);
|
|
50
|
+
}
|
|
51
|
+
.nw-list-item-icon > svg {
|
|
52
|
+
inline-size: 1.25em;
|
|
53
|
+
block-size: 1.25em;
|
|
54
|
+
}
|
|
55
|
+
.nw-list-item-media {
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
flex: none;
|
|
58
|
+
}
|
|
59
|
+
.nw-list-item-content {
|
|
60
|
+
display: grid;
|
|
61
|
+
flex: 1;
|
|
62
|
+
gap: var(--nw-space-0-5);
|
|
63
|
+
min-inline-size: 0;
|
|
64
|
+
}
|
|
65
|
+
.nw-list-item-title {
|
|
66
|
+
font-weight: 500;
|
|
67
|
+
color: var(--nw-fg);
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
text-overflow: ellipsis;
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
}
|
|
72
|
+
.nw-list-item-description {
|
|
73
|
+
font-size: var(--nw-text-xs);
|
|
74
|
+
color: var(--nw-fg-subtle);
|
|
75
|
+
}
|
|
76
|
+
.nw-list-item-meta {
|
|
77
|
+
flex: none;
|
|
78
|
+
margin-inline-start: auto;
|
|
79
|
+
font-family: var(--nw-font-mono);
|
|
80
|
+
font-size: var(--nw-text-2xs);
|
|
81
|
+
font-variant-numeric: tabular-nums;
|
|
82
|
+
letter-spacing: var(--nw-tracking-wide);
|
|
83
|
+
color: var(--nw-fg-faint);
|
|
84
|
+
white-space: nowrap;
|
|
85
|
+
}
|
|
86
|
+
.nw-list-item-end {
|
|
87
|
+
display: flex;
|
|
88
|
+
flex: none;
|
|
89
|
+
gap: var(--nw-space-2);
|
|
90
|
+
align-items: center;
|
|
91
|
+
margin-inline-start: auto;
|
|
92
|
+
}
|
|
93
|
+
.nw-list-item-meta + .nw-list-item-end {
|
|
94
|
+
margin-inline-start: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* Divided: a hairline between rows. Bordered: a panel with hairlines inside. */
|
|
98
|
+
.nw-list-divided > * + * {
|
|
99
|
+
border-block-start: 1px solid var(--nw-line);
|
|
100
|
+
}
|
|
101
|
+
.nw-list-bordered {
|
|
102
|
+
border: 1px solid var(--nw-line);
|
|
103
|
+
border-radius: var(--nw-radius-md);
|
|
104
|
+
background-color: var(--nw-panel);
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
}
|
|
107
|
+
.nw-list-bordered > * + * {
|
|
108
|
+
border-block-start: 1px solid var(--nw-line);
|
|
109
|
+
}
|
|
110
|
+
.nw-list-bordered .nw-list-item {
|
|
111
|
+
border-radius: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Interactive rows: links, buttons and selectable options. */
|
|
115
|
+
:is(.nw-list-interactive .nw-list-item, .nw-list :is(a, button).nw-list-item) {
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
transition:
|
|
118
|
+
color var(--nw-duration-fast) var(--nw-ease-standard),
|
|
119
|
+
background-color var(--nw-duration-fast) var(--nw-ease-standard);
|
|
120
|
+
}
|
|
121
|
+
:is(.nw-list-interactive .nw-list-item, .nw-list :is(a, button).nw-list-item):hover:not(
|
|
122
|
+
[aria-disabled='true'],
|
|
123
|
+
:disabled
|
|
124
|
+
) {
|
|
125
|
+
background-color: var(--nw-panel);
|
|
126
|
+
}
|
|
127
|
+
.nw-list-bordered
|
|
128
|
+
:is(.nw-list-interactive .nw-list-item, :is(a, button).nw-list-item):hover:not(
|
|
129
|
+
[aria-disabled='true'],
|
|
130
|
+
:disabled
|
|
131
|
+
) {
|
|
132
|
+
background-color: var(--nw-panel-hover);
|
|
133
|
+
}
|
|
134
|
+
:is(.nw-list-interactive .nw-list-item, .nw-list :is(a, button).nw-list-item):active:not(
|
|
135
|
+
[aria-disabled='true'],
|
|
136
|
+
:disabled
|
|
137
|
+
) {
|
|
138
|
+
background-color: var(--nw-panel-active);
|
|
139
|
+
}
|
|
140
|
+
:is(.nw-list-interactive .nw-list-item, .nw-list :is(a, button).nw-list-item):focus-visible {
|
|
141
|
+
outline: var(--nw-ring-width) solid var(--nw-ring);
|
|
142
|
+
outline-offset: calc(-1 * var(--nw-ring-width));
|
|
143
|
+
}
|
|
144
|
+
.nw-list .nw-list-item:is([aria-current], [aria-selected='true'], .nw-list-item-active) {
|
|
145
|
+
color: var(--_ink);
|
|
146
|
+
background-color: var(--_soft);
|
|
147
|
+
}
|
|
148
|
+
.nw-list
|
|
149
|
+
.nw-list-item:is([aria-current], [aria-selected='true'], .nw-list-item-active)
|
|
150
|
+
:is(.nw-list-item-title, .nw-list-item-icon) {
|
|
151
|
+
color: inherit;
|
|
152
|
+
}
|
|
153
|
+
.nw-list .nw-list-item:is([aria-disabled='true'], :disabled) {
|
|
154
|
+
color: var(--nw-fg-disabled);
|
|
155
|
+
cursor: not-allowed;
|
|
156
|
+
}
|
|
157
|
+
.nw-list
|
|
158
|
+
.nw-list-item:is([aria-disabled='true'], :disabled)
|
|
159
|
+
:is(.nw-list-item-title, .nw-list-item-description, .nw-list-item-icon, .nw-list-item-meta) {
|
|
160
|
+
color: inherit;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Markers: bullets and numbers in the intent ink; checks as a glyph. */
|
|
164
|
+
.nw-list-bullet,
|
|
165
|
+
.nw-list-ordered {
|
|
166
|
+
gap: var(--nw-space-2);
|
|
167
|
+
padding-inline-start: var(--nw-space-5);
|
|
168
|
+
}
|
|
169
|
+
.nw-list-bullet {
|
|
170
|
+
list-style: disc;
|
|
171
|
+
}
|
|
172
|
+
.nw-list-ordered {
|
|
173
|
+
list-style: decimal;
|
|
174
|
+
}
|
|
175
|
+
:is(.nw-list-bullet, .nw-list-ordered) > li {
|
|
176
|
+
display: list-item;
|
|
177
|
+
padding-inline-start: var(--nw-space-1);
|
|
178
|
+
}
|
|
179
|
+
:is(.nw-list-bullet, .nw-list-ordered) > li::marker {
|
|
180
|
+
font-family: var(--nw-font-mono);
|
|
181
|
+
font-size: var(--nw-text-xs);
|
|
182
|
+
color: var(--_intent);
|
|
183
|
+
}
|
|
184
|
+
.nw-list-check {
|
|
185
|
+
gap: var(--nw-space-2);
|
|
186
|
+
}
|
|
187
|
+
.nw-list-check > li {
|
|
188
|
+
display: flex;
|
|
189
|
+
flex-direction: row;
|
|
190
|
+
gap: var(--nw-space-2-5);
|
|
191
|
+
align-items: flex-start;
|
|
192
|
+
}
|
|
193
|
+
.nw-list-check > li::before {
|
|
194
|
+
content: '';
|
|
195
|
+
flex: none;
|
|
196
|
+
inline-size: 1.2em;
|
|
197
|
+
block-size: 1.2em;
|
|
198
|
+
margin-block-start: calc((1lh - 1.2em) / 2);
|
|
199
|
+
background-color: var(--_intent);
|
|
200
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
|
|
201
|
+
center / contain no-repeat;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* Inline: items flow in a row. */
|
|
205
|
+
.nw-list-inline {
|
|
206
|
+
flex-direction: row;
|
|
207
|
+
flex-wrap: wrap;
|
|
208
|
+
gap: var(--nw-space-2) var(--nw-space-4);
|
|
209
|
+
}
|
|
210
|
+
.nw-list-inline > li {
|
|
211
|
+
flex-direction: row;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* Intents color markers and the selected row. */
|
|
215
|
+
.nw-list-primary {
|
|
216
|
+
--_intent: var(--nw-primary);
|
|
217
|
+
--_on: var(--nw-on-primary);
|
|
218
|
+
--_soft: var(--nw-primary-soft);
|
|
219
|
+
}
|
|
220
|
+
.nw-list-secondary {
|
|
221
|
+
--_intent: var(--nw-secondary);
|
|
222
|
+
--_on: var(--nw-on-secondary);
|
|
223
|
+
--_soft: var(--nw-secondary-soft);
|
|
224
|
+
}
|
|
225
|
+
.nw-list-tertiary {
|
|
226
|
+
--_intent: var(--nw-tertiary);
|
|
227
|
+
--_on: var(--nw-on-tertiary);
|
|
228
|
+
--_soft: var(--nw-tertiary-soft);
|
|
229
|
+
}
|
|
230
|
+
.nw-list-neutral {
|
|
231
|
+
--_intent: var(--nw-fg);
|
|
232
|
+
--_on: var(--nw-canvas);
|
|
233
|
+
--_soft: color-mix(in oklab, var(--nw-fg) 12%, transparent);
|
|
234
|
+
}
|
|
235
|
+
.nw-list-info {
|
|
236
|
+
--_intent: var(--nw-info);
|
|
237
|
+
--_on: var(--nw-on-info);
|
|
238
|
+
--_soft: var(--nw-info-soft);
|
|
239
|
+
}
|
|
240
|
+
.nw-list-success {
|
|
241
|
+
--_intent: var(--nw-success);
|
|
242
|
+
--_on: var(--nw-on-success);
|
|
243
|
+
--_soft: var(--nw-success-soft);
|
|
244
|
+
}
|
|
245
|
+
.nw-list-warning {
|
|
246
|
+
--_intent: var(--nw-warning);
|
|
247
|
+
--_on: var(--nw-on-warning);
|
|
248
|
+
--_soft: var(--nw-warning-soft);
|
|
249
|
+
}
|
|
250
|
+
.nw-list-danger {
|
|
251
|
+
--_intent: var(--nw-danger);
|
|
252
|
+
--_on: var(--nw-on-danger);
|
|
253
|
+
--_soft: var(--nw-danger-soft);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/* Sizes */
|
|
257
|
+
.nw-list-xs {
|
|
258
|
+
--_py: var(--nw-space-1);
|
|
259
|
+
--_px: var(--nw-space-2);
|
|
260
|
+
--_fs: var(--nw-text-xs);
|
|
261
|
+
}
|
|
262
|
+
.nw-list-sm {
|
|
263
|
+
--_py: var(--nw-space-2);
|
|
264
|
+
--_px: var(--nw-space-2-5);
|
|
265
|
+
--_fs: var(--nw-text-sm);
|
|
266
|
+
}
|
|
267
|
+
.nw-list-md {
|
|
268
|
+
--_py: var(--nw-space-3);
|
|
269
|
+
--_px: var(--nw-space-3);
|
|
270
|
+
--_fs: var(--nw-text-sm);
|
|
271
|
+
}
|
|
272
|
+
.nw-list-lg {
|
|
273
|
+
--_py: var(--nw-space-4);
|
|
274
|
+
--_px: var(--nw-space-4);
|
|
275
|
+
--_fs: var(--nw-text-base);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/* Description list: terms in the mono eyebrow face beside their details. */
|
|
279
|
+
.nw-dl {
|
|
280
|
+
display: grid;
|
|
281
|
+
grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr);
|
|
282
|
+
gap: var(--nw-space-2) var(--nw-space-6);
|
|
283
|
+
margin: 0;
|
|
284
|
+
font-size: var(--nw-text-sm);
|
|
285
|
+
line-height: var(--nw-leading-snug);
|
|
286
|
+
}
|
|
287
|
+
.nw-dl > dt {
|
|
288
|
+
padding-block-start: var(--nw-space-0-5);
|
|
289
|
+
font-family: var(--nw-font-mono);
|
|
290
|
+
font-size: var(--nw-text-2xs);
|
|
291
|
+
font-weight: 500;
|
|
292
|
+
letter-spacing: var(--nw-tracking-wider);
|
|
293
|
+
text-transform: uppercase;
|
|
294
|
+
color: var(--nw-fg-subtle);
|
|
295
|
+
}
|
|
296
|
+
.nw-dl > dd {
|
|
297
|
+
margin: 0;
|
|
298
|
+
min-inline-size: 0;
|
|
299
|
+
color: var(--nw-fg);
|
|
300
|
+
overflow-wrap: anywhere;
|
|
301
|
+
}
|
|
302
|
+
.nw-dl-stacked {
|
|
303
|
+
grid-template-columns: minmax(0, 1fr);
|
|
304
|
+
gap: var(--nw-space-1);
|
|
305
|
+
}
|
|
306
|
+
.nw-dl-stacked > dd + dt {
|
|
307
|
+
margin-block-start: var(--nw-space-3);
|
|
308
|
+
}
|
|
309
|
+
.nw-dl-divided {
|
|
310
|
+
row-gap: 0;
|
|
311
|
+
}
|
|
312
|
+
.nw-dl-divided > :is(dt, dd) {
|
|
313
|
+
padding-block: var(--nw-space-2-5);
|
|
314
|
+
border-block-start: 1px solid var(--nw-line);
|
|
315
|
+
}
|
|
316
|
+
.nw-dl-divided > :is(dt:first-child, dt:first-child + dd) {
|
|
317
|
+
border-block-start: 0;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
@media (max-width: 40rem) {
|
|
321
|
+
.nw-dl:not(.nw-dl-stacked) {
|
|
322
|
+
grid-template-columns: minmax(0, 1fr);
|
|
323
|
+
gap: var(--nw-space-1);
|
|
324
|
+
}
|
|
325
|
+
.nw-dl:not(.nw-dl-stacked) > dd + dt {
|
|
326
|
+
margin-block-start: var(--nw-space-3);
|
|
327
|
+
}
|
|
328
|
+
.nw-dl-divided > dd {
|
|
329
|
+
border-block-start: 0;
|
|
330
|
+
padding-block-start: 0;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
@media (forced-colors: active) {
|
|
335
|
+
.nw-list-divided > * + *,
|
|
336
|
+
.nw-list-bordered,
|
|
337
|
+
.nw-list-bordered > * + *,
|
|
338
|
+
.nw-dl-divided > :is(dt, dd) {
|
|
339
|
+
border-color: CanvasText;
|
|
340
|
+
}
|
|
341
|
+
.nw-list .nw-list-item:is([aria-current], [aria-selected='true'], .nw-list-item-active) {
|
|
342
|
+
forced-color-adjust: none;
|
|
343
|
+
color: HighlightText;
|
|
344
|
+
background-color: Highlight;
|
|
345
|
+
}
|
|
346
|
+
.nw-list .nw-list-item:is([aria-disabled='true'], :disabled) {
|
|
347
|
+
color: GrayText;
|
|
348
|
+
}
|
|
349
|
+
.nw-list-check > li::before {
|
|
350
|
+
background-color: CanvasText;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/* Menu: a floating list of commands. <div class="nw-menu" role="menu"> holding .nw-menu-item
|
|
2
|
+
buttons or links (role menuitem / menuitemcheckbox / menuitemradio), labels, separators and
|
|
3
|
+
groups. Opens as a [popover] or through data-state="open|closed". .nw-menubar is the horizontal
|
|
4
|
+
row of triggers. */
|
|
5
|
+
@layer components {
|
|
6
|
+
.nw-menu {
|
|
7
|
+
--_intent: var(--nw-primary);
|
|
8
|
+
--_on: var(--nw-on-primary);
|
|
9
|
+
--_soft: var(--nw-primary-soft);
|
|
10
|
+
--_ink: color-mix(in oklab, var(--_intent) var(--nw-soft-ink), var(--nw-fg));
|
|
11
|
+
--_h: var(--nw-control-sm);
|
|
12
|
+
--_fs: var(--nw-text-sm);
|
|
13
|
+
--_px: var(--nw-space-2-5);
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: var(--nw-space-px);
|
|
17
|
+
min-inline-size: 12rem;
|
|
18
|
+
max-inline-size: min(20rem, 100vw - 2 * var(--nw-space-4));
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: var(--nw-space-1);
|
|
21
|
+
border: 1px solid var(--nw-line-strong);
|
|
22
|
+
border-radius: var(--nw-radius-md);
|
|
23
|
+
font-size: var(--_fs);
|
|
24
|
+
line-height: var(--nw-leading-snug);
|
|
25
|
+
color: var(--nw-fg);
|
|
26
|
+
background-color: var(--nw-panel);
|
|
27
|
+
box-shadow: var(--nw-shadow-md);
|
|
28
|
+
overflow: auto;
|
|
29
|
+
overscroll-behavior: contain;
|
|
30
|
+
}
|
|
31
|
+
.nw-menu[popover] {
|
|
32
|
+
position: fixed;
|
|
33
|
+
inset: auto;
|
|
34
|
+
z-index: var(--nw-z-popover);
|
|
35
|
+
}
|
|
36
|
+
/* The UA hides a closed popover with display:none; the menu's own display:flex would beat it. */
|
|
37
|
+
.nw-menu[popover]:not(:popover-open) {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
40
|
+
.nw-menu::backdrop {
|
|
41
|
+
background: none;
|
|
42
|
+
}
|
|
43
|
+
.nw-menu:popover-open,
|
|
44
|
+
.nw-menu[data-state='open'] {
|
|
45
|
+
animation: nw-zoom-in var(--nw-duration-fast) var(--nw-ease-out);
|
|
46
|
+
transform-origin: var(--nw-menu-origin, top);
|
|
47
|
+
}
|
|
48
|
+
.nw-menu[data-state='closed'] {
|
|
49
|
+
animation: nw-zoom-out var(--nw-duration-fast) var(--nw-ease-in) forwards;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.nw-menu-item {
|
|
54
|
+
position: relative;
|
|
55
|
+
display: flex;
|
|
56
|
+
gap: var(--nw-space-2-5);
|
|
57
|
+
align-items: center;
|
|
58
|
+
min-block-size: var(--_h);
|
|
59
|
+
padding: var(--nw-space-1) var(--_px);
|
|
60
|
+
border: 0;
|
|
61
|
+
border-radius: var(--nw-radius-sm);
|
|
62
|
+
font: inherit;
|
|
63
|
+
text-align: start;
|
|
64
|
+
color: var(--nw-fg);
|
|
65
|
+
text-decoration-line: none;
|
|
66
|
+
background: none;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
user-select: none;
|
|
69
|
+
outline-offset: calc(-1 * var(--nw-ring-width));
|
|
70
|
+
transition:
|
|
71
|
+
color var(--nw-duration-instant) var(--nw-ease-standard),
|
|
72
|
+
background-color var(--nw-duration-instant) var(--nw-ease-standard);
|
|
73
|
+
}
|
|
74
|
+
.nw-menu-item:is(:hover, [data-highlighted], [aria-expanded='true']):not(
|
|
75
|
+
:disabled,
|
|
76
|
+
[aria-disabled='true'],
|
|
77
|
+
[data-disabled]
|
|
78
|
+
) {
|
|
79
|
+
color: var(--nw-fg);
|
|
80
|
+
background-color: var(--nw-panel-hover);
|
|
81
|
+
}
|
|
82
|
+
.nw-menu-item:focus-visible {
|
|
83
|
+
outline: var(--nw-ring-width) solid var(--nw-ring);
|
|
84
|
+
background-color: var(--nw-panel-hover);
|
|
85
|
+
}
|
|
86
|
+
.nw-menu-item:active:not(:disabled, [aria-disabled='true'], [data-disabled]) {
|
|
87
|
+
background-color: var(--nw-panel-active);
|
|
88
|
+
}
|
|
89
|
+
.nw-menu-item:is(:disabled, [aria-disabled='true'], [data-disabled]) {
|
|
90
|
+
color: var(--nw-fg-disabled);
|
|
91
|
+
cursor: not-allowed;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.nw-menu-icon {
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
flex: none;
|
|
97
|
+
color: var(--nw-fg-subtle);
|
|
98
|
+
transition: color var(--nw-duration-instant) var(--nw-ease-standard);
|
|
99
|
+
}
|
|
100
|
+
.nw-menu-icon > svg {
|
|
101
|
+
inline-size: 1.15em;
|
|
102
|
+
block-size: 1.15em;
|
|
103
|
+
}
|
|
104
|
+
.nw-menu-item:is(:hover, :focus-visible, [data-highlighted]) .nw-menu-icon {
|
|
105
|
+
color: inherit;
|
|
106
|
+
}
|
|
107
|
+
.nw-menu-item-text {
|
|
108
|
+
flex: 1;
|
|
109
|
+
min-inline-size: 0;
|
|
110
|
+
display: grid;
|
|
111
|
+
gap: var(--nw-space-0-5);
|
|
112
|
+
}
|
|
113
|
+
.nw-menu-item-description {
|
|
114
|
+
font-size: var(--nw-text-xs);
|
|
115
|
+
color: var(--nw-fg-subtle);
|
|
116
|
+
}
|
|
117
|
+
.nw-menu-shortcut {
|
|
118
|
+
margin-inline-start: auto;
|
|
119
|
+
font-family: var(--nw-font-mono);
|
|
120
|
+
font-size: var(--nw-text-2xs);
|
|
121
|
+
letter-spacing: var(--nw-tracking-wide);
|
|
122
|
+
color: var(--nw-fg-faint);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* Destructive item: danger ink, danger wash when highlighted. */
|
|
126
|
+
.nw-menu-item-danger {
|
|
127
|
+
color: var(--nw-danger);
|
|
128
|
+
}
|
|
129
|
+
.nw-menu-item-danger:is(:hover, [data-highlighted], :focus-visible):not(
|
|
130
|
+
:disabled,
|
|
131
|
+
[aria-disabled='true'],
|
|
132
|
+
[data-disabled]
|
|
133
|
+
) {
|
|
134
|
+
color: color-mix(in oklab, var(--nw-danger) var(--nw-soft-ink), var(--nw-fg));
|
|
135
|
+
background-color: var(--nw-danger-soft);
|
|
136
|
+
}
|
|
137
|
+
.nw-menu-item-danger .nw-menu-icon {
|
|
138
|
+
color: inherit;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Checkbox and radio items reserve a slot at the start; the mark appears when checked. */
|
|
142
|
+
.nw-menu-item:is([role='menuitemcheckbox'], [role='menuitemradio'])::before {
|
|
143
|
+
content: '';
|
|
144
|
+
flex: none;
|
|
145
|
+
inline-size: 1em;
|
|
146
|
+
block-size: 1em;
|
|
147
|
+
background-color: var(--_intent);
|
|
148
|
+
mask: var(--_mark) center / contain no-repeat;
|
|
149
|
+
opacity: 0;
|
|
150
|
+
transition: opacity var(--nw-duration-instant) var(--nw-ease-standard);
|
|
151
|
+
}
|
|
152
|
+
.nw-menu-item[role='menuitemcheckbox'] {
|
|
153
|
+
--_mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
|
|
154
|
+
}
|
|
155
|
+
.nw-menu-item[role='menuitemradio'] {
|
|
156
|
+
--_mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4.5' fill='black'/%3E%3C/svg%3E");
|
|
157
|
+
}
|
|
158
|
+
.nw-menu-item[aria-checked='mixed'] {
|
|
159
|
+
--_mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
|
|
160
|
+
}
|
|
161
|
+
.nw-menu-item:is([aria-checked='true'], [aria-checked='mixed'], [data-state='checked'])::before {
|
|
162
|
+
opacity: 1;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* A submenu trigger ends in a chevron. */
|
|
166
|
+
.nw-menu-item[aria-haspopup]::after {
|
|
167
|
+
content: '';
|
|
168
|
+
flex: none;
|
|
169
|
+
inline-size: 1em;
|
|
170
|
+
block-size: 1em;
|
|
171
|
+
margin-inline-start: auto;
|
|
172
|
+
background-color: var(--nw-fg-subtle);
|
|
173
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E")
|
|
174
|
+
center / contain no-repeat;
|
|
175
|
+
}
|
|
176
|
+
.nw-menu-item[aria-haspopup]:has(.nw-menu-shortcut)::after {
|
|
177
|
+
margin-inline-start: 0;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.nw-menu-label {
|
|
181
|
+
padding: var(--nw-space-2) var(--_px) var(--nw-space-1);
|
|
182
|
+
font-family: var(--nw-font-mono);
|
|
183
|
+
font-size: var(--nw-text-2xs);
|
|
184
|
+
font-weight: 500;
|
|
185
|
+
letter-spacing: var(--nw-tracking-wider);
|
|
186
|
+
text-transform: uppercase;
|
|
187
|
+
color: var(--nw-fg-subtle);
|
|
188
|
+
}
|
|
189
|
+
.nw-menu-separator {
|
|
190
|
+
block-size: 1px;
|
|
191
|
+
margin: var(--nw-space-1) calc(-1 * var(--nw-space-1));
|
|
192
|
+
border: 0;
|
|
193
|
+
background-color: var(--nw-line);
|
|
194
|
+
}
|
|
195
|
+
.nw-menu-group {
|
|
196
|
+
display: flex;
|
|
197
|
+
flex-direction: column;
|
|
198
|
+
gap: var(--nw-space-px);
|
|
199
|
+
}
|
|
200
|
+
.nw-menu-group + .nw-menu-group {
|
|
201
|
+
margin-block-start: var(--nw-space-1);
|
|
202
|
+
padding-block-start: var(--nw-space-1);
|
|
203
|
+
border-block-start: 1px solid var(--nw-line);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* Intents color the check marks and, in the soft variant, the highlight. */
|
|
207
|
+
.nw-menu-primary {
|
|
208
|
+
--_intent: var(--nw-primary);
|
|
209
|
+
--_on: var(--nw-on-primary);
|
|
210
|
+
--_soft: var(--nw-primary-soft);
|
|
211
|
+
}
|
|
212
|
+
.nw-menu-secondary {
|
|
213
|
+
--_intent: var(--nw-secondary);
|
|
214
|
+
--_on: var(--nw-on-secondary);
|
|
215
|
+
--_soft: var(--nw-secondary-soft);
|
|
216
|
+
}
|
|
217
|
+
.nw-menu-tertiary {
|
|
218
|
+
--_intent: var(--nw-tertiary);
|
|
219
|
+
--_on: var(--nw-on-tertiary);
|
|
220
|
+
--_soft: var(--nw-tertiary-soft);
|
|
221
|
+
}
|
|
222
|
+
.nw-menu-neutral {
|
|
223
|
+
--_intent: var(--nw-fg);
|
|
224
|
+
--_on: var(--nw-canvas);
|
|
225
|
+
--_soft: color-mix(in oklab, var(--nw-fg) 12%, transparent);
|
|
226
|
+
}
|
|
227
|
+
.nw-menu-info {
|
|
228
|
+
--_intent: var(--nw-info);
|
|
229
|
+
--_on: var(--nw-on-info);
|
|
230
|
+
--_soft: var(--nw-info-soft);
|
|
231
|
+
}
|
|
232
|
+
.nw-menu-success {
|
|
233
|
+
--_intent: var(--nw-success);
|
|
234
|
+
--_on: var(--nw-on-success);
|
|
235
|
+
--_soft: var(--nw-success-soft);
|
|
236
|
+
}
|
|
237
|
+
.nw-menu-warning {
|
|
238
|
+
--_intent: var(--nw-warning);
|
|
239
|
+
--_on: var(--nw-on-warning);
|
|
240
|
+
--_soft: var(--nw-warning-soft);
|
|
241
|
+
}
|
|
242
|
+
.nw-menu-danger {
|
|
243
|
+
--_intent: var(--nw-danger);
|
|
244
|
+
--_on: var(--nw-on-danger);
|
|
245
|
+
--_soft: var(--nw-danger-soft);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* Soft: the highlighted item takes the intent wash and ink instead of the neutral hover. */
|
|
249
|
+
.nw-menu-soft
|
|
250
|
+
.nw-menu-item:is(:hover, :focus-visible, [data-highlighted], [aria-expanded='true']):not(
|
|
251
|
+
:disabled,
|
|
252
|
+
[aria-disabled='true'],
|
|
253
|
+
[data-disabled],
|
|
254
|
+
.nw-menu-item-danger
|
|
255
|
+
) {
|
|
256
|
+
color: var(--_ink);
|
|
257
|
+
background-color: var(--_soft);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/* Wire: the gradient edge around the panel. */
|
|
261
|
+
.nw-menu-wire {
|
|
262
|
+
--nw-fill: var(--nw-panel);
|
|
263
|
+
border-color: transparent;
|
|
264
|
+
background:
|
|
265
|
+
linear-gradient(var(--nw-panel), var(--nw-panel)) padding-box,
|
|
266
|
+
var(--nw-gradient-wire) border-box;
|
|
267
|
+
box-shadow: var(--nw-shadow-md), var(--nw-glow-wire);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* Menubar: triggers in a row; an open trigger is highlighted. */
|
|
271
|
+
.nw-menubar {
|
|
272
|
+
display: flex;
|
|
273
|
+
gap: var(--nw-space-0-5);
|
|
274
|
+
align-items: center;
|
|
275
|
+
padding: var(--nw-space-0-5);
|
|
276
|
+
border: 1px solid var(--nw-line);
|
|
277
|
+
border-radius: var(--nw-radius-md);
|
|
278
|
+
background-color: var(--nw-canvas-subtle);
|
|
279
|
+
font-size: var(--nw-text-sm);
|
|
280
|
+
}
|
|
281
|
+
.nw-menubar > .nw-menu-item {
|
|
282
|
+
min-block-size: var(--nw-control-sm);
|
|
283
|
+
padding-inline: var(--nw-space-3);
|
|
284
|
+
}
|
|
285
|
+
.nw-menubar > .nw-menu-item[aria-haspopup]::after {
|
|
286
|
+
display: none;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/* Sizes */
|
|
290
|
+
.nw-menu-xs {
|
|
291
|
+
--_h: var(--nw-control-xs);
|
|
292
|
+
--_fs: var(--nw-text-xs);
|
|
293
|
+
--_px: var(--nw-space-2);
|
|
294
|
+
}
|
|
295
|
+
.nw-menu-sm {
|
|
296
|
+
--_h: var(--nw-control-sm);
|
|
297
|
+
--_fs: var(--nw-text-sm);
|
|
298
|
+
--_px: var(--nw-space-2-5);
|
|
299
|
+
}
|
|
300
|
+
.nw-menu-md {
|
|
301
|
+
--_h: var(--nw-control-md);
|
|
302
|
+
--_fs: var(--nw-text-sm);
|
|
303
|
+
--_px: var(--nw-space-3);
|
|
304
|
+
}
|
|
305
|
+
.nw-menu-lg {
|
|
306
|
+
--_h: var(--nw-control-lg);
|
|
307
|
+
--_fs: var(--nw-text-base);
|
|
308
|
+
--_px: var(--nw-space-4);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/* Movement becomes a cross-fade. */
|
|
312
|
+
@media (prefers-reduced-motion: reduce) {
|
|
313
|
+
.nw-menu:popover-open,
|
|
314
|
+
.nw-menu[data-state='open'] {
|
|
315
|
+
animation-name: nw-fade-in;
|
|
316
|
+
}
|
|
317
|
+
.nw-menu[data-state='closed'] {
|
|
318
|
+
animation-name: nw-fade-out;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
@media (forced-colors: active) {
|
|
323
|
+
.nw-menu,
|
|
324
|
+
.nw-menubar {
|
|
325
|
+
border-color: CanvasText;
|
|
326
|
+
background: Canvas;
|
|
327
|
+
box-shadow: none;
|
|
328
|
+
}
|
|
329
|
+
.nw-menu-item:is(:hover, :focus-visible, [data-highlighted], [aria-expanded='true']) {
|
|
330
|
+
forced-color-adjust: none;
|
|
331
|
+
color: HighlightText;
|
|
332
|
+
background-color: Highlight;
|
|
333
|
+
}
|
|
334
|
+
.nw-menu-item:is(:disabled, [aria-disabled='true'], [data-disabled]) {
|
|
335
|
+
color: GrayText;
|
|
336
|
+
}
|
|
337
|
+
.nw-menu-item::before,
|
|
338
|
+
.nw-menu-item::after {
|
|
339
|
+
background-color: CanvasText;
|
|
340
|
+
}
|
|
341
|
+
.nw-menu-separator,
|
|
342
|
+
.nw-menu-group + .nw-menu-group {
|
|
343
|
+
background-color: CanvasText;
|
|
344
|
+
border-color: CanvasText;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|