@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,383 @@
|
|
|
1
|
+
/* Text controls. input.css owns the shared well: .nw-input, textarea.nw-input and .nw-select all
|
|
2
|
+
read the same paint variables, so an intent, a size or a state means the same thing on each.
|
|
3
|
+
select.css adds only what a select needs (the caret, the open trigger, multiple).
|
|
4
|
+
--_well is the control's own token: the deepest surface on a dark flavor, the lightest on lumen,
|
|
5
|
+
so a well reads as a well on both a canvas and a panel.
|
|
6
|
+
An intent class colors the resting border and the focus ring; aria-invalid / :user-invalid
|
|
7
|
+
always wins over it. A disabled well is quiet rather than translucent. */
|
|
8
|
+
@layer components {
|
|
9
|
+
.nw-input,
|
|
10
|
+
.nw-select {
|
|
11
|
+
--_intent: var(--nw-primary);
|
|
12
|
+
--_h: var(--nw-control-md);
|
|
13
|
+
--_px: var(--nw-space-3);
|
|
14
|
+
--_fs: var(--nw-text-sm);
|
|
15
|
+
--_radius: var(--nw-radius-md);
|
|
16
|
+
--_well: color-mix(
|
|
17
|
+
in oklab,
|
|
18
|
+
var(--nw-canvas-sunken) calc(100% * var(--nw-flavor-dark)),
|
|
19
|
+
var(--nw-canvas)
|
|
20
|
+
);
|
|
21
|
+
--_fill: var(--_well);
|
|
22
|
+
--_line: var(--nw-line-strong);
|
|
23
|
+
--_line-hover: var(--nw-line-bright);
|
|
24
|
+
--_ring: var(--nw-ring);
|
|
25
|
+
|
|
26
|
+
display: block;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
inline-size: 100%;
|
|
29
|
+
min-inline-size: 0;
|
|
30
|
+
block-size: var(--_h);
|
|
31
|
+
margin: 0;
|
|
32
|
+
padding: 0 var(--_px);
|
|
33
|
+
border: 1px solid var(--_line);
|
|
34
|
+
border-radius: var(--_radius);
|
|
35
|
+
font-family: var(--nw-font-sans);
|
|
36
|
+
font-size: var(--_fs);
|
|
37
|
+
font-weight: 400;
|
|
38
|
+
line-height: calc(var(--_h) - 2px);
|
|
39
|
+
color: var(--nw-fg);
|
|
40
|
+
background-color: var(--_fill);
|
|
41
|
+
box-shadow: none;
|
|
42
|
+
appearance: none;
|
|
43
|
+
transition:
|
|
44
|
+
border-color var(--nw-duration-fast) var(--nw-ease-standard),
|
|
45
|
+
background-color var(--nw-duration-fast) var(--nw-ease-standard),
|
|
46
|
+
box-shadow var(--nw-duration-fast) var(--nw-ease-standard);
|
|
47
|
+
}
|
|
48
|
+
.nw-input::placeholder {
|
|
49
|
+
/* --nw-fg-faint is below 4.5:1 on a well in lumen; the subtle ink is not. */
|
|
50
|
+
color: var(--nw-fg-subtle);
|
|
51
|
+
opacity: 1;
|
|
52
|
+
}
|
|
53
|
+
.nw-input:hover:not(:disabled, [aria-disabled='true']),
|
|
54
|
+
.nw-select:hover:not(:disabled, [aria-disabled='true']) {
|
|
55
|
+
--_line: var(--_line-hover);
|
|
56
|
+
}
|
|
57
|
+
.nw-input:focus,
|
|
58
|
+
.nw-select:focus {
|
|
59
|
+
--_line: var(--_intent);
|
|
60
|
+
outline: var(--nw-ring-width) solid var(--_ring);
|
|
61
|
+
outline-offset: var(--nw-ring-offset);
|
|
62
|
+
box-shadow: var(--nw-glow-sm);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Intents: the resting border and the focus ring ------------------------------------------- */
|
|
66
|
+
.nw-input-primary,
|
|
67
|
+
.nw-select-primary {
|
|
68
|
+
--_intent: var(--nw-primary);
|
|
69
|
+
--_ring: var(--nw-primary);
|
|
70
|
+
--_line: var(--nw-primary);
|
|
71
|
+
--_line-hover: var(--nw-primary);
|
|
72
|
+
}
|
|
73
|
+
.nw-input-secondary,
|
|
74
|
+
.nw-select-secondary {
|
|
75
|
+
--_intent: var(--nw-secondary);
|
|
76
|
+
--_ring: var(--nw-secondary);
|
|
77
|
+
--_line: var(--nw-secondary);
|
|
78
|
+
--_line-hover: var(--nw-secondary);
|
|
79
|
+
}
|
|
80
|
+
.nw-input-tertiary,
|
|
81
|
+
.nw-select-tertiary {
|
|
82
|
+
--_intent: var(--nw-tertiary);
|
|
83
|
+
--_ring: var(--nw-tertiary);
|
|
84
|
+
--_line: var(--nw-tertiary);
|
|
85
|
+
--_line-hover: var(--nw-tertiary);
|
|
86
|
+
}
|
|
87
|
+
.nw-input-neutral,
|
|
88
|
+
.nw-select-neutral {
|
|
89
|
+
--_intent: var(--nw-fg-muted);
|
|
90
|
+
--_ring: var(--nw-fg-muted);
|
|
91
|
+
--_line: var(--nw-line-strong);
|
|
92
|
+
--_line-hover: var(--nw-line-bright);
|
|
93
|
+
}
|
|
94
|
+
.nw-input-info,
|
|
95
|
+
.nw-select-info {
|
|
96
|
+
--_intent: var(--nw-info);
|
|
97
|
+
--_ring: var(--nw-info);
|
|
98
|
+
--_line: var(--nw-info);
|
|
99
|
+
--_line-hover: var(--nw-info);
|
|
100
|
+
}
|
|
101
|
+
.nw-input-success,
|
|
102
|
+
.nw-select-success {
|
|
103
|
+
--_intent: var(--nw-success);
|
|
104
|
+
--_ring: var(--nw-success);
|
|
105
|
+
--_line: var(--nw-success);
|
|
106
|
+
--_line-hover: var(--nw-success);
|
|
107
|
+
}
|
|
108
|
+
.nw-input-warning,
|
|
109
|
+
.nw-select-warning {
|
|
110
|
+
--_intent: var(--nw-warning);
|
|
111
|
+
--_ring: var(--nw-warning);
|
|
112
|
+
--_line: var(--nw-warning);
|
|
113
|
+
--_line-hover: var(--nw-warning);
|
|
114
|
+
}
|
|
115
|
+
.nw-input-danger,
|
|
116
|
+
.nw-select-danger {
|
|
117
|
+
--_intent: var(--nw-danger);
|
|
118
|
+
--_ring: var(--nw-danger);
|
|
119
|
+
--_line: var(--nw-danger);
|
|
120
|
+
--_line-hover: var(--nw-danger);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Invalid wins over every intent ---------------------------------------------------------- */
|
|
124
|
+
.nw-input:is([aria-invalid='true'], :user-invalid),
|
|
125
|
+
.nw-select:is([aria-invalid='true'], :user-invalid) {
|
|
126
|
+
--_intent: var(--nw-danger);
|
|
127
|
+
--_ring: var(--nw-danger);
|
|
128
|
+
--_line: var(--nw-danger);
|
|
129
|
+
--_line-hover: var(--nw-danger);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Read-only and disabled ------------------------------------------------------------------ */
|
|
133
|
+
.nw-input[readonly]:not(:disabled) {
|
|
134
|
+
--_fill: transparent;
|
|
135
|
+
border-style: dashed;
|
|
136
|
+
}
|
|
137
|
+
.nw-input:disabled,
|
|
138
|
+
.nw-input[aria-disabled='true'],
|
|
139
|
+
.nw-select:disabled,
|
|
140
|
+
.nw-select[aria-disabled='true'] {
|
|
141
|
+
--_fill: var(--nw-canvas-subtle);
|
|
142
|
+
--_line: var(--nw-line);
|
|
143
|
+
color: var(--nw-fg-disabled);
|
|
144
|
+
box-shadow: none;
|
|
145
|
+
cursor: not-allowed;
|
|
146
|
+
}
|
|
147
|
+
.nw-input:disabled::placeholder {
|
|
148
|
+
color: var(--nw-fg-disabled);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Variants --------------------------------------------------------------------------------- */
|
|
152
|
+
.nw-input-ghost {
|
|
153
|
+
--_fill: transparent;
|
|
154
|
+
--_line: transparent;
|
|
155
|
+
--_line-hover: var(--nw-line-strong);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* Sizes ---------------------------------------------------------------------------------- */
|
|
159
|
+
.nw-input-xs,
|
|
160
|
+
.nw-select-xs {
|
|
161
|
+
--_h: var(--nw-control-xs);
|
|
162
|
+
--_px: var(--nw-space-2-5);
|
|
163
|
+
--_fs: var(--nw-text-xs);
|
|
164
|
+
--_radius: var(--nw-radius-sm);
|
|
165
|
+
}
|
|
166
|
+
.nw-input-sm,
|
|
167
|
+
.nw-select-sm {
|
|
168
|
+
--_h: var(--nw-control-sm);
|
|
169
|
+
--_px: var(--nw-space-2-5);
|
|
170
|
+
--_fs: var(--nw-text-sm);
|
|
171
|
+
--_radius: var(--nw-radius-sm);
|
|
172
|
+
}
|
|
173
|
+
.nw-input-md,
|
|
174
|
+
.nw-select-md {
|
|
175
|
+
--_h: var(--nw-control-md);
|
|
176
|
+
--_px: var(--nw-space-3);
|
|
177
|
+
--_fs: var(--nw-text-sm);
|
|
178
|
+
--_radius: var(--nw-radius-md);
|
|
179
|
+
}
|
|
180
|
+
.nw-input-lg,
|
|
181
|
+
.nw-select-lg {
|
|
182
|
+
--_h: var(--nw-control-lg);
|
|
183
|
+
--_px: var(--nw-space-4);
|
|
184
|
+
--_fs: var(--nw-text-base);
|
|
185
|
+
--_radius: var(--nw-radius-md);
|
|
186
|
+
}
|
|
187
|
+
/* iOS zooms the page when it focuses a control whose text is under 16px. */
|
|
188
|
+
@media (pointer: coarse) {
|
|
189
|
+
.nw-input,
|
|
190
|
+
.nw-select {
|
|
191
|
+
font-size: max(var(--_fs), var(--nw-text-base));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* Textarea: the same well, no fixed height ------------------------------------------------- */
|
|
196
|
+
textarea.nw-input {
|
|
197
|
+
block-size: auto;
|
|
198
|
+
min-block-size: calc(var(--_h) * 2);
|
|
199
|
+
padding-block: calc((var(--_h) - var(--nw-leading-normal) * 1em) / 2 - 1px);
|
|
200
|
+
line-height: var(--nw-leading-normal);
|
|
201
|
+
resize: vertical;
|
|
202
|
+
scrollbar-color: var(--nw-line-strong) transparent;
|
|
203
|
+
scrollbar-width: thin;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* Type-specific ---------------------------------------------------------------------------- */
|
|
207
|
+
.nw-input::-webkit-search-cancel-button {
|
|
208
|
+
appearance: none;
|
|
209
|
+
}
|
|
210
|
+
.nw-input[type='number'] {
|
|
211
|
+
font-family: var(--nw-font-mono);
|
|
212
|
+
}
|
|
213
|
+
.nw-input:is(
|
|
214
|
+
[type='number'],
|
|
215
|
+
[type='date'],
|
|
216
|
+
[type='time'],
|
|
217
|
+
[type='datetime-local'],
|
|
218
|
+
[type='month'],
|
|
219
|
+
[type='week']
|
|
220
|
+
) {
|
|
221
|
+
font-variant-numeric: tabular-nums;
|
|
222
|
+
}
|
|
223
|
+
.nw-input[type='file'] {
|
|
224
|
+
padding-block: var(--nw-space-1);
|
|
225
|
+
line-height: var(--nw-leading-normal);
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
}
|
|
228
|
+
.nw-input[type='file']::file-selector-button {
|
|
229
|
+
block-size: 100%;
|
|
230
|
+
margin-inline-end: var(--nw-space-3);
|
|
231
|
+
padding-inline: var(--nw-space-3);
|
|
232
|
+
border: 0;
|
|
233
|
+
border-radius: var(--nw-radius-sm);
|
|
234
|
+
font: inherit;
|
|
235
|
+
font-size: var(--nw-text-xs);
|
|
236
|
+
font-weight: 600;
|
|
237
|
+
color: var(--nw-on-primary);
|
|
238
|
+
background-color: var(--nw-primary);
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
}
|
|
241
|
+
.nw-input[type='color'] {
|
|
242
|
+
padding: var(--nw-space-1);
|
|
243
|
+
cursor: pointer;
|
|
244
|
+
}
|
|
245
|
+
.nw-input[type='color']::-webkit-color-swatch-wrapper {
|
|
246
|
+
padding: 0;
|
|
247
|
+
}
|
|
248
|
+
.nw-input[type='color']::-webkit-color-swatch {
|
|
249
|
+
border: 1px solid var(--nw-line);
|
|
250
|
+
border-radius: var(--nw-radius-xs);
|
|
251
|
+
}
|
|
252
|
+
.nw-input[type='color']::-moz-color-swatch {
|
|
253
|
+
border: 1px solid var(--nw-line);
|
|
254
|
+
border-radius: var(--nw-radius-xs);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/* Input group: joined controls and addons --------------------------------------------------- */
|
|
258
|
+
.nw-input-group {
|
|
259
|
+
--_group-radius: var(--nw-radius-md);
|
|
260
|
+
display: flex;
|
|
261
|
+
align-items: stretch;
|
|
262
|
+
inline-size: 100%;
|
|
263
|
+
min-inline-size: 0;
|
|
264
|
+
isolation: isolate;
|
|
265
|
+
}
|
|
266
|
+
.nw-input-group > :is(.nw-input, .nw-select, .nw-btn) {
|
|
267
|
+
--_h: var(--nw-control-md);
|
|
268
|
+
}
|
|
269
|
+
.nw-input-group > .nw-input,
|
|
270
|
+
.nw-input-group > .nw-select {
|
|
271
|
+
flex: 1 1 auto;
|
|
272
|
+
inline-size: auto;
|
|
273
|
+
min-inline-size: 0;
|
|
274
|
+
}
|
|
275
|
+
.nw-input-group > .nw-btn,
|
|
276
|
+
.nw-input-group > .nw-input-addon {
|
|
277
|
+
flex: none;
|
|
278
|
+
}
|
|
279
|
+
/* A later component file sets these radii again; the group has to out-specify it. */
|
|
280
|
+
.nw-input-group > :is(.nw-input, .nw-select, .nw-btn, .nw-input-addon) {
|
|
281
|
+
border-radius: 0;
|
|
282
|
+
}
|
|
283
|
+
.nw-input-group > :is(.nw-input, .nw-select, .nw-btn, .nw-input-addon):first-child {
|
|
284
|
+
border-start-start-radius: var(--_group-radius);
|
|
285
|
+
border-end-start-radius: var(--_group-radius);
|
|
286
|
+
}
|
|
287
|
+
.nw-input-group > :is(.nw-input, .nw-select, .nw-btn, .nw-input-addon):last-child {
|
|
288
|
+
border-start-end-radius: var(--_group-radius);
|
|
289
|
+
border-end-end-radius: var(--_group-radius);
|
|
290
|
+
}
|
|
291
|
+
.nw-input-group > :not(:first-child) {
|
|
292
|
+
margin-inline-start: -1px;
|
|
293
|
+
}
|
|
294
|
+
.nw-input-group > :is(.nw-input, .nw-select):focus,
|
|
295
|
+
.nw-input-group > .nw-btn:focus-visible {
|
|
296
|
+
position: relative;
|
|
297
|
+
z-index: 1;
|
|
298
|
+
}
|
|
299
|
+
.nw-input-addon {
|
|
300
|
+
display: inline-flex;
|
|
301
|
+
align-items: center;
|
|
302
|
+
justify-content: center;
|
|
303
|
+
gap: var(--nw-space-1-5);
|
|
304
|
+
box-sizing: border-box;
|
|
305
|
+
min-block-size: var(--nw-control-md);
|
|
306
|
+
padding-inline: var(--nw-space-3);
|
|
307
|
+
border: 1px solid var(--nw-line-strong);
|
|
308
|
+
font-family: var(--nw-font-sans);
|
|
309
|
+
font-size: var(--nw-text-sm);
|
|
310
|
+
font-weight: 500;
|
|
311
|
+
line-height: var(--nw-leading-none);
|
|
312
|
+
color: var(--nw-fg-muted);
|
|
313
|
+
background-color: var(--nw-panel);
|
|
314
|
+
white-space: nowrap;
|
|
315
|
+
}
|
|
316
|
+
.nw-input-addon > svg {
|
|
317
|
+
flex: none;
|
|
318
|
+
inline-size: var(--nw-space-4);
|
|
319
|
+
block-size: var(--nw-space-4);
|
|
320
|
+
color: var(--nw-fg-subtle);
|
|
321
|
+
}
|
|
322
|
+
/* One knob for the whole group: the children read their own size variables. */
|
|
323
|
+
.nw-input-group-xs > :is(.nw-input, .nw-select, .nw-btn, .nw-input-addon),
|
|
324
|
+
.nw-input-group-sm > :is(.nw-input, .nw-select, .nw-btn, .nw-input-addon),
|
|
325
|
+
.nw-input-group-md > :is(.nw-input, .nw-select, .nw-btn, .nw-input-addon),
|
|
326
|
+
.nw-input-group-lg > :is(.nw-input, .nw-select, .nw-btn, .nw-input-addon) {
|
|
327
|
+
min-block-size: var(--_h);
|
|
328
|
+
}
|
|
329
|
+
.nw-input-group-xs > :is(.nw-input, .nw-select, .nw-btn, .nw-input-addon) {
|
|
330
|
+
--_h: var(--nw-control-xs);
|
|
331
|
+
--_px: var(--nw-space-2-5);
|
|
332
|
+
--_fs: var(--nw-text-xs);
|
|
333
|
+
min-block-size: var(--nw-control-xs);
|
|
334
|
+
font-size: var(--nw-text-xs);
|
|
335
|
+
}
|
|
336
|
+
.nw-input-group-sm > :is(.nw-input, .nw-select, .nw-btn, .nw-input-addon) {
|
|
337
|
+
--_h: var(--nw-control-sm);
|
|
338
|
+
--_px: var(--nw-space-2-5);
|
|
339
|
+
--_fs: var(--nw-text-sm);
|
|
340
|
+
min-block-size: var(--nw-control-sm);
|
|
341
|
+
font-size: var(--nw-text-sm);
|
|
342
|
+
}
|
|
343
|
+
.nw-input-group-md > :is(.nw-input, .nw-select, .nw-btn, .nw-input-addon) {
|
|
344
|
+
--_h: var(--nw-control-md);
|
|
345
|
+
--_px: var(--nw-space-3);
|
|
346
|
+
--_fs: var(--nw-text-sm);
|
|
347
|
+
min-block-size: var(--nw-control-md);
|
|
348
|
+
font-size: var(--nw-text-sm);
|
|
349
|
+
}
|
|
350
|
+
.nw-input-group-lg > :is(.nw-input, .nw-select, .nw-btn, .nw-input-addon) {
|
|
351
|
+
--_h: var(--nw-control-lg);
|
|
352
|
+
--_px: var(--nw-space-4);
|
|
353
|
+
--_fs: var(--nw-text-base);
|
|
354
|
+
min-block-size: var(--nw-control-lg);
|
|
355
|
+
font-size: var(--nw-text-base);
|
|
356
|
+
}
|
|
357
|
+
.nw-input-group-xs,
|
|
358
|
+
.nw-input-group-sm {
|
|
359
|
+
--_group-radius: var(--nw-radius-sm);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
@media (forced-colors: active) {
|
|
363
|
+
.nw-input,
|
|
364
|
+
.nw-select {
|
|
365
|
+
border-color: ButtonText;
|
|
366
|
+
box-shadow: none;
|
|
367
|
+
}
|
|
368
|
+
.nw-input:is([aria-invalid='true'], :user-invalid),
|
|
369
|
+
.nw-select:is([aria-invalid='true'], :user-invalid) {
|
|
370
|
+
border-style: dashed;
|
|
371
|
+
}
|
|
372
|
+
.nw-input:disabled,
|
|
373
|
+
.nw-input[aria-disabled='true'],
|
|
374
|
+
.nw-select:disabled,
|
|
375
|
+
.nw-select[aria-disabled='true'] {
|
|
376
|
+
color: GrayText;
|
|
377
|
+
border-color: GrayText;
|
|
378
|
+
}
|
|
379
|
+
.nw-input-addon {
|
|
380
|
+
border-color: ButtonText;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/* Kbd: a keycap. <kbd class="nw-kbd">K</kbd>; a chord is a .nw-kbd-combo of keycaps joined by a
|
|
2
|
+
plus; a hotkey hint (.nw-hotkey) pairs a chord with its label. The 2px lower edge gives the cap
|
|
3
|
+
its depth and flattens when pressed. */
|
|
4
|
+
@layer components {
|
|
5
|
+
.nw-kbd {
|
|
6
|
+
--_intent: var(--nw-fg);
|
|
7
|
+
--_soft: var(--nw-panel);
|
|
8
|
+
--_edge: var(--nw-line-strong);
|
|
9
|
+
--_fs: var(--nw-text-xs);
|
|
10
|
+
--_h: 1.75em;
|
|
11
|
+
display: inline-grid;
|
|
12
|
+
place-items: center;
|
|
13
|
+
min-inline-size: var(--_h);
|
|
14
|
+
block-size: var(--_h);
|
|
15
|
+
padding-inline: var(--nw-space-1-5);
|
|
16
|
+
border: 1px solid var(--_edge);
|
|
17
|
+
border-block-end-width: 2px;
|
|
18
|
+
border-radius: var(--nw-radius-sm);
|
|
19
|
+
font-family: var(--nw-font-mono);
|
|
20
|
+
font-size: var(--_fs);
|
|
21
|
+
font-weight: 500;
|
|
22
|
+
line-height: 1;
|
|
23
|
+
letter-spacing: var(--nw-tracking-wide);
|
|
24
|
+
color: var(--_intent);
|
|
25
|
+
background-color: var(--_soft);
|
|
26
|
+
vertical-align: middle;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
user-select: none;
|
|
29
|
+
transition:
|
|
30
|
+
translate var(--nw-duration-instant) var(--nw-ease-standard),
|
|
31
|
+
border-width var(--nw-duration-instant) var(--nw-ease-standard),
|
|
32
|
+
box-shadow var(--nw-duration-fast) var(--nw-ease-standard);
|
|
33
|
+
}
|
|
34
|
+
.nw-kbd > svg {
|
|
35
|
+
inline-size: 1em;
|
|
36
|
+
block-size: 1em;
|
|
37
|
+
}
|
|
38
|
+
/* Pressed: the cap travels one pixel and loses its lower edge. */
|
|
39
|
+
.nw-kbd:is([aria-pressed='true'], .nw-kbd-pressed, :active) {
|
|
40
|
+
translate: 0 1px;
|
|
41
|
+
border-block-end-width: 1px;
|
|
42
|
+
margin-block-end: 1px;
|
|
43
|
+
background-color: var(--nw-panel-active);
|
|
44
|
+
}
|
|
45
|
+
.nw-kbd:is([aria-disabled='true'], .nw-kbd-disabled) {
|
|
46
|
+
--_intent: var(--nw-fg-disabled);
|
|
47
|
+
--_edge: var(--nw-line);
|
|
48
|
+
background-color: var(--nw-canvas-subtle);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Intents: the cap takes the intent ink on its tint, with a tinted edge. */
|
|
52
|
+
.nw-kbd-primary {
|
|
53
|
+
--_intent: color-mix(in oklab, var(--nw-primary) var(--nw-soft-ink), var(--nw-fg));
|
|
54
|
+
--_soft: var(--nw-primary-soft);
|
|
55
|
+
--_edge: color-mix(in oklab, var(--nw-primary) 50%, transparent);
|
|
56
|
+
}
|
|
57
|
+
.nw-kbd-secondary {
|
|
58
|
+
--_intent: color-mix(in oklab, var(--nw-secondary) var(--nw-soft-ink), var(--nw-fg));
|
|
59
|
+
--_soft: var(--nw-secondary-soft);
|
|
60
|
+
--_edge: color-mix(in oklab, var(--nw-secondary) 50%, transparent);
|
|
61
|
+
}
|
|
62
|
+
.nw-kbd-tertiary {
|
|
63
|
+
--_intent: color-mix(in oklab, var(--nw-tertiary) var(--nw-soft-ink), var(--nw-fg));
|
|
64
|
+
--_soft: var(--nw-tertiary-soft);
|
|
65
|
+
--_edge: color-mix(in oklab, var(--nw-tertiary) 50%, transparent);
|
|
66
|
+
}
|
|
67
|
+
.nw-kbd-neutral {
|
|
68
|
+
--_intent: var(--nw-fg);
|
|
69
|
+
--_soft: var(--nw-panel);
|
|
70
|
+
--_edge: var(--nw-line-strong);
|
|
71
|
+
}
|
|
72
|
+
.nw-kbd-info {
|
|
73
|
+
--_intent: color-mix(in oklab, var(--nw-info) var(--nw-soft-ink), var(--nw-fg));
|
|
74
|
+
--_soft: var(--nw-info-soft);
|
|
75
|
+
--_edge: color-mix(in oklab, var(--nw-info) 50%, transparent);
|
|
76
|
+
}
|
|
77
|
+
.nw-kbd-success {
|
|
78
|
+
--_intent: color-mix(in oklab, var(--nw-success) var(--nw-soft-ink), var(--nw-fg));
|
|
79
|
+
--_soft: var(--nw-success-soft);
|
|
80
|
+
--_edge: color-mix(in oklab, var(--nw-success) 50%, transparent);
|
|
81
|
+
}
|
|
82
|
+
.nw-kbd-warning {
|
|
83
|
+
--_intent: color-mix(in oklab, var(--nw-warning) var(--nw-soft-ink), var(--nw-fg));
|
|
84
|
+
--_soft: var(--nw-warning-soft);
|
|
85
|
+
--_edge: color-mix(in oklab, var(--nw-warning) 50%, transparent);
|
|
86
|
+
}
|
|
87
|
+
.nw-kbd-danger {
|
|
88
|
+
--_intent: color-mix(in oklab, var(--nw-danger) var(--nw-soft-ink), var(--nw-fg));
|
|
89
|
+
--_soft: var(--nw-danger-soft);
|
|
90
|
+
--_edge: color-mix(in oklab, var(--nw-danger) 50%, transparent);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Variants. solid: filled cap. outline: no fill. glow: lit cap, brighter when pressed. */
|
|
94
|
+
.nw-kbd-solid {
|
|
95
|
+
--_intent: var(--nw-on-primary);
|
|
96
|
+
--_soft: var(--nw-primary);
|
|
97
|
+
--_edge: color-mix(in oklab, var(--nw-primary) 60%, var(--nw-crust));
|
|
98
|
+
}
|
|
99
|
+
.nw-kbd-outline {
|
|
100
|
+
--_soft: transparent;
|
|
101
|
+
}
|
|
102
|
+
.nw-kbd-glow {
|
|
103
|
+
--nw-glow-color: var(--nw-primary);
|
|
104
|
+
box-shadow: var(--nw-glow-sm);
|
|
105
|
+
}
|
|
106
|
+
.nw-kbd-glow:is([aria-pressed='true'], .nw-kbd-pressed, :active) {
|
|
107
|
+
box-shadow: var(--nw-glow-md);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Sizes */
|
|
111
|
+
.nw-kbd-xs {
|
|
112
|
+
--_fs: var(--nw-text-2xs);
|
|
113
|
+
}
|
|
114
|
+
.nw-kbd-sm {
|
|
115
|
+
--_fs: var(--nw-text-xs);
|
|
116
|
+
}
|
|
117
|
+
.nw-kbd-md {
|
|
118
|
+
--_fs: var(--nw-text-sm);
|
|
119
|
+
}
|
|
120
|
+
.nw-kbd-lg {
|
|
121
|
+
--_fs: var(--nw-text-base);
|
|
122
|
+
--_h: 2em;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* A chord: Ctrl + K. The plus is generated between caps. */
|
|
126
|
+
.nw-kbd-combo {
|
|
127
|
+
display: inline-flex;
|
|
128
|
+
gap: var(--nw-space-4);
|
|
129
|
+
align-items: center;
|
|
130
|
+
vertical-align: middle;
|
|
131
|
+
white-space: nowrap;
|
|
132
|
+
}
|
|
133
|
+
.nw-kbd-combo > .nw-kbd {
|
|
134
|
+
position: relative;
|
|
135
|
+
}
|
|
136
|
+
/* The plus fills the gap before this cap. */
|
|
137
|
+
.nw-kbd-combo > .nw-kbd + .nw-kbd::before {
|
|
138
|
+
content: '+';
|
|
139
|
+
position: absolute;
|
|
140
|
+
inset-block: 0;
|
|
141
|
+
inset-inline-start: calc(-1 * var(--nw-space-4) - 1px);
|
|
142
|
+
display: grid;
|
|
143
|
+
place-items: center;
|
|
144
|
+
inline-size: var(--nw-space-4);
|
|
145
|
+
font-size: 0.85em;
|
|
146
|
+
color: var(--nw-fg-faint);
|
|
147
|
+
}
|
|
148
|
+
.nw-kbd-combo-plain > .nw-kbd + .nw-kbd::before {
|
|
149
|
+
content: none;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* A hotkey hint: "Esc Close". */
|
|
153
|
+
.nw-hotkey {
|
|
154
|
+
display: inline-flex;
|
|
155
|
+
gap: var(--nw-space-2);
|
|
156
|
+
align-items: center;
|
|
157
|
+
font-size: var(--nw-text-sm);
|
|
158
|
+
color: var(--nw-fg-muted);
|
|
159
|
+
}
|
|
160
|
+
.nw-hotkey-label {
|
|
161
|
+
white-space: nowrap;
|
|
162
|
+
}
|
|
163
|
+
.nw-hotkeys {
|
|
164
|
+
display: flex;
|
|
165
|
+
flex-wrap: wrap;
|
|
166
|
+
gap: var(--nw-space-2) var(--nw-space-5);
|
|
167
|
+
}
|
|
168
|
+
.nw-hotkeys-vertical {
|
|
169
|
+
flex-direction: column;
|
|
170
|
+
align-items: flex-start;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@media (prefers-reduced-motion: reduce) {
|
|
174
|
+
.nw-kbd:is([aria-pressed='true'], .nw-kbd-pressed, :active) {
|
|
175
|
+
translate: none;
|
|
176
|
+
margin-block-end: 0;
|
|
177
|
+
border-block-end-width: 2px;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
@media (forced-colors: active) {
|
|
182
|
+
.nw-kbd {
|
|
183
|
+
border-color: CanvasText;
|
|
184
|
+
background: Canvas;
|
|
185
|
+
box-shadow: none;
|
|
186
|
+
}
|
|
187
|
+
.nw-kbd:is([aria-disabled='true'], .nw-kbd-disabled) {
|
|
188
|
+
color: GrayText;
|
|
189
|
+
border-color: GrayText;
|
|
190
|
+
}
|
|
191
|
+
.nw-kbd-solid {
|
|
192
|
+
forced-color-adjust: none;
|
|
193
|
+
color: HighlightText;
|
|
194
|
+
background: Highlight;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|