@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,288 @@
|
|
|
1
|
+
/* Tooltip, two ways.
|
|
2
|
+
|
|
3
|
+
1. Pure CSS, no markup: put data-tooltip="..." on any focusable element (or .nw-tooltip-trigger
|
|
4
|
+
on an element with an accessible name). The label renders in ::after on hover and
|
|
5
|
+
focus-visible, above the trigger by default; data-side="top|right|bottom|left" moves it.
|
|
6
|
+
data-tooltip="" renders nothing. The CSS path cannot reposition at a viewport edge, so use
|
|
7
|
+
the positioned box below for long labels or edge-of-screen triggers.
|
|
8
|
+
|
|
9
|
+
2. Positioned box (Reka, Radix, or your own floating logic):
|
|
10
|
+
<div class="nw-tooltip nw-tooltip-sm" role="tooltip" data-state="open" data-side="bottom">
|
|
11
|
+
Label <kbd class="nw-tooltip-kbd">K</kbd>
|
|
12
|
+
<span class="nw-tooltip-arrow" data-side="bottom" aria-hidden="true"></span>
|
|
13
|
+
</div>
|
|
14
|
+
An element arrow (not an svg) is a rotated square in the tooltip's own fill.
|
|
15
|
+
|
|
16
|
+
The chip is a sunken dark label in every flavor: in lumen it inverts against the light page.
|
|
17
|
+
Sizes xs..lg; intents color the border and the kbd; -glow is opt-in. */
|
|
18
|
+
@layer components {
|
|
19
|
+
.nw-tooltip {
|
|
20
|
+
--_intent: var(--nw-primary);
|
|
21
|
+
--_on: var(--nw-on-primary);
|
|
22
|
+
--_soft: var(--nw-primary-soft);
|
|
23
|
+
--_fill: var(--nw-canvas-sunken);
|
|
24
|
+
--_ink: var(--nw-fg);
|
|
25
|
+
--_edge: color-mix(
|
|
26
|
+
in oklab,
|
|
27
|
+
var(--nw-line-strong) calc(100% * var(--nw-flavor-dark)),
|
|
28
|
+
transparent
|
|
29
|
+
);
|
|
30
|
+
--_fs: var(--nw-text-xs);
|
|
31
|
+
--_px: var(--nw-space-2-5);
|
|
32
|
+
--_py: var(--nw-space-1-5);
|
|
33
|
+
--_arrow: var(--nw-space-2);
|
|
34
|
+
--_offset: var(--nw-space-2);
|
|
35
|
+
--_from: translateY(calc(-1 * var(--nw-slide-distance, 0.25rem)));
|
|
36
|
+
--_in: nw-slide-in-from-top;
|
|
37
|
+
--_out: nw-slide-out-to-top;
|
|
38
|
+
|
|
39
|
+
position: fixed;
|
|
40
|
+
inset: auto;
|
|
41
|
+
z-index: var(--nw-z-tooltip);
|
|
42
|
+
inline-size: max-content;
|
|
43
|
+
max-inline-size: min(22rem, calc(100dvw - 2 * var(--nw-space-4)));
|
|
44
|
+
padding: var(--_py) var(--_px);
|
|
45
|
+
border: 1px solid var(--_edge);
|
|
46
|
+
border-radius: var(--nw-radius-sm);
|
|
47
|
+
font-size: var(--_fs);
|
|
48
|
+
font-weight: 500;
|
|
49
|
+
line-height: var(--nw-leading-snug);
|
|
50
|
+
text-align: start;
|
|
51
|
+
text-wrap: pretty;
|
|
52
|
+
color: var(--_ink);
|
|
53
|
+
background-color: var(--_fill);
|
|
54
|
+
box-shadow: var(--nw-shadow-md);
|
|
55
|
+
pointer-events: none;
|
|
56
|
+
}
|
|
57
|
+
.nw-tooltip[data-state='open'] {
|
|
58
|
+
animation: var(--_in) var(--nw-duration-fast) var(--nw-ease-out) both;
|
|
59
|
+
}
|
|
60
|
+
.nw-tooltip[data-state='closed'] {
|
|
61
|
+
animation: var(--_out) var(--nw-duration-fast) var(--nw-ease-in) both;
|
|
62
|
+
}
|
|
63
|
+
.nw-tooltip[data-side='bottom'] {
|
|
64
|
+
--_from: translateY(var(--nw-slide-distance, 0.25rem));
|
|
65
|
+
--_in: nw-slide-in-from-bottom;
|
|
66
|
+
--_out: nw-slide-out-to-bottom;
|
|
67
|
+
}
|
|
68
|
+
.nw-tooltip[data-side='left'] {
|
|
69
|
+
--_from: translateX(var(--nw-slide-distance, 0.25rem));
|
|
70
|
+
--_in: nw-slide-in-from-right;
|
|
71
|
+
--_out: nw-slide-out-to-right;
|
|
72
|
+
}
|
|
73
|
+
.nw-tooltip[data-side='right'] {
|
|
74
|
+
--_from: translateX(calc(-1 * var(--nw-slide-distance, 0.25rem)));
|
|
75
|
+
--_in: nw-slide-in-from-left;
|
|
76
|
+
--_out: nw-slide-out-to-left;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.nw-tooltip-kbd {
|
|
80
|
+
margin-inline-start: var(--nw-space-2);
|
|
81
|
+
padding-inline: var(--nw-space-1);
|
|
82
|
+
border: 1px solid var(--nw-line);
|
|
83
|
+
border-radius: var(--nw-radius-xs);
|
|
84
|
+
font-family: var(--nw-font-mono);
|
|
85
|
+
font-size: var(--nw-text-2xs);
|
|
86
|
+
color: color-mix(in oklab, var(--_intent) var(--nw-soft-ink), var(--_ink));
|
|
87
|
+
white-space: nowrap;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.nw-tooltip-arrow:not(svg) {
|
|
91
|
+
position: absolute;
|
|
92
|
+
inline-size: var(--_arrow);
|
|
93
|
+
block-size: var(--_arrow);
|
|
94
|
+
border: 1px solid var(--_edge);
|
|
95
|
+
border-width: 1px 0 0 1px;
|
|
96
|
+
background-color: var(--_fill);
|
|
97
|
+
transform: rotate(45deg);
|
|
98
|
+
}
|
|
99
|
+
.nw-tooltip-arrow:not(svg)[data-side='bottom'] {
|
|
100
|
+
inset-block-start: calc(var(--_arrow) / -2);
|
|
101
|
+
inset-inline-start: var(--_arrow-left, calc(50% - var(--_arrow) / 2));
|
|
102
|
+
}
|
|
103
|
+
.nw-tooltip-arrow:not(svg)[data-side='top'] {
|
|
104
|
+
inset-block-end: calc(var(--_arrow) / -2);
|
|
105
|
+
inset-inline-start: var(--_arrow-left, calc(50% - var(--_arrow) / 2));
|
|
106
|
+
border-width: 0 1px 1px 0;
|
|
107
|
+
}
|
|
108
|
+
.nw-tooltip-arrow:not(svg)[data-side='left'] {
|
|
109
|
+
inset-inline-end: calc(var(--_arrow) / -2);
|
|
110
|
+
inset-block-start: var(--_arrow-top, calc(50% - var(--_arrow) / 2));
|
|
111
|
+
border-width: 1px 1px 0 0;
|
|
112
|
+
}
|
|
113
|
+
.nw-tooltip-arrow:not(svg)[data-side='right'] {
|
|
114
|
+
inset-inline-start: calc(var(--_arrow) / -2);
|
|
115
|
+
inset-block-start: var(--_arrow-top, calc(50% - var(--_arrow) / 2));
|
|
116
|
+
border-width: 0 0 1px 1px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Pure-CSS path ---------------------------------------------------------------------------- */
|
|
120
|
+
|
|
121
|
+
[data-tooltip]:not([data-tooltip='']) {
|
|
122
|
+
position: relative;
|
|
123
|
+
}
|
|
124
|
+
[data-tooltip]:not([data-tooltip=''])::after {
|
|
125
|
+
content: attr(data-tooltip);
|
|
126
|
+
display: none;
|
|
127
|
+
position: absolute;
|
|
128
|
+
z-index: var(--nw-z-tooltip);
|
|
129
|
+
inset-block-end: calc(100% + var(--_offset, var(--nw-space-2)));
|
|
130
|
+
inset-inline-start: 50%;
|
|
131
|
+
inline-size: max-content;
|
|
132
|
+
max-inline-size: min(20rem, 80dvw);
|
|
133
|
+
padding: var(--nw-space-1-5) var(--nw-space-2-5);
|
|
134
|
+
border: 1px solid var(--_edge, var(--nw-line-strong));
|
|
135
|
+
border-radius: var(--nw-radius-sm);
|
|
136
|
+
font-size: var(--nw-text-xs);
|
|
137
|
+
font-weight: 500;
|
|
138
|
+
line-height: var(--nw-leading-snug);
|
|
139
|
+
text-align: center;
|
|
140
|
+
text-wrap: pretty;
|
|
141
|
+
color: var(--_ink, var(--nw-fg));
|
|
142
|
+
background-color: var(--_fill, var(--nw-canvas-sunken));
|
|
143
|
+
box-shadow: var(--nw-shadow-md);
|
|
144
|
+
opacity: 0;
|
|
145
|
+
transform: translate(-50%, var(--nw-space-1));
|
|
146
|
+
transition:
|
|
147
|
+
opacity var(--nw-duration-fast) var(--nw-ease-out),
|
|
148
|
+
transform var(--nw-duration-fast) var(--nw-ease-out),
|
|
149
|
+
display var(--nw-duration-fast) allow-discrete;
|
|
150
|
+
pointer-events: none;
|
|
151
|
+
}
|
|
152
|
+
[data-tooltip]:not([data-tooltip='']):is(:hover, :focus-visible)::after {
|
|
153
|
+
display: block;
|
|
154
|
+
opacity: 1;
|
|
155
|
+
transform: translate(-50%, 0);
|
|
156
|
+
transition-delay: var(--nw-tooltip-delay, 0ms);
|
|
157
|
+
}
|
|
158
|
+
@starting-style {
|
|
159
|
+
[data-tooltip]:not([data-tooltip='']):is(:hover, :focus-visible)::after {
|
|
160
|
+
opacity: 0;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
[data-tooltip][data-side='bottom']::after {
|
|
164
|
+
inset-block: calc(100% + var(--_offset, var(--nw-space-2))) auto;
|
|
165
|
+
transform: translate(-50%, calc(-1 * var(--nw-space-1)));
|
|
166
|
+
}
|
|
167
|
+
[data-tooltip][data-side='bottom']:is(:hover, :focus-visible)::after {
|
|
168
|
+
transform: translate(-50%, 0);
|
|
169
|
+
}
|
|
170
|
+
[data-tooltip][data-side='right']::after {
|
|
171
|
+
inset-block: auto auto;
|
|
172
|
+
inset-block-start: 50%;
|
|
173
|
+
inset-inline: calc(100% + var(--_offset, var(--nw-space-2))) auto;
|
|
174
|
+
transform: translate(calc(-1 * var(--nw-space-1)), -50%);
|
|
175
|
+
}
|
|
176
|
+
[data-tooltip][data-side='right']:is(:hover, :focus-visible)::after {
|
|
177
|
+
transform: translate(0, -50%);
|
|
178
|
+
}
|
|
179
|
+
[data-tooltip][data-side='left']::after {
|
|
180
|
+
inset-block: auto auto;
|
|
181
|
+
inset-block-start: 50%;
|
|
182
|
+
inset-inline: auto calc(100% + var(--_offset, var(--nw-space-2)));
|
|
183
|
+
transform: translate(var(--nw-space-1), -50%);
|
|
184
|
+
}
|
|
185
|
+
[data-tooltip][data-side='left']:is(:hover, :focus-visible)::after {
|
|
186
|
+
transform: translate(0, -50%);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* Sizes ------------------------------------------------------------------------------------ */
|
|
190
|
+
|
|
191
|
+
.nw-tooltip-xs {
|
|
192
|
+
--_fs: var(--nw-text-2xs);
|
|
193
|
+
--_px: var(--nw-space-2);
|
|
194
|
+
--_py: var(--nw-space-1);
|
|
195
|
+
}
|
|
196
|
+
.nw-tooltip-sm {
|
|
197
|
+
--_fs: var(--nw-text-xs);
|
|
198
|
+
--_px: var(--nw-space-2-5);
|
|
199
|
+
--_py: var(--nw-space-1-5);
|
|
200
|
+
}
|
|
201
|
+
.nw-tooltip-md {
|
|
202
|
+
--_fs: var(--nw-text-sm);
|
|
203
|
+
--_px: var(--nw-space-3);
|
|
204
|
+
--_py: var(--nw-space-2);
|
|
205
|
+
}
|
|
206
|
+
.nw-tooltip-lg {
|
|
207
|
+
--_fs: var(--nw-text-base);
|
|
208
|
+
--_px: var(--nw-space-4);
|
|
209
|
+
--_py: var(--nw-space-2);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* Intents ---------------------------------------------------------------------------------- */
|
|
213
|
+
|
|
214
|
+
.nw-tooltip-primary {
|
|
215
|
+
--_intent: var(--nw-primary);
|
|
216
|
+
--_on: var(--nw-on-primary);
|
|
217
|
+
--_soft: var(--nw-primary-soft);
|
|
218
|
+
--_edge: var(--_intent);
|
|
219
|
+
}
|
|
220
|
+
.nw-tooltip-secondary {
|
|
221
|
+
--_intent: var(--nw-secondary);
|
|
222
|
+
--_on: var(--nw-on-secondary);
|
|
223
|
+
--_soft: var(--nw-secondary-soft);
|
|
224
|
+
--_edge: var(--_intent);
|
|
225
|
+
}
|
|
226
|
+
.nw-tooltip-tertiary {
|
|
227
|
+
--_intent: var(--nw-tertiary);
|
|
228
|
+
--_on: var(--nw-on-tertiary);
|
|
229
|
+
--_soft: var(--nw-tertiary-soft);
|
|
230
|
+
--_edge: var(--_intent);
|
|
231
|
+
}
|
|
232
|
+
.nw-tooltip-neutral {
|
|
233
|
+
--_intent: var(--nw-fg-muted);
|
|
234
|
+
--_on: var(--nw-canvas);
|
|
235
|
+
--_soft: color-mix(in oklab, var(--nw-fg) 10%, transparent);
|
|
236
|
+
--_edge: var(--nw-line-strong);
|
|
237
|
+
}
|
|
238
|
+
.nw-tooltip-info {
|
|
239
|
+
--_intent: var(--nw-info);
|
|
240
|
+
--_on: var(--nw-on-info);
|
|
241
|
+
--_soft: var(--nw-info-soft);
|
|
242
|
+
--_edge: var(--_intent);
|
|
243
|
+
}
|
|
244
|
+
.nw-tooltip-success {
|
|
245
|
+
--_intent: var(--nw-success);
|
|
246
|
+
--_on: var(--nw-on-success);
|
|
247
|
+
--_soft: var(--nw-success-soft);
|
|
248
|
+
--_edge: var(--_intent);
|
|
249
|
+
}
|
|
250
|
+
.nw-tooltip-warning {
|
|
251
|
+
--_intent: var(--nw-warning);
|
|
252
|
+
--_on: var(--nw-on-warning);
|
|
253
|
+
--_soft: var(--nw-warning-soft);
|
|
254
|
+
--_edge: var(--_intent);
|
|
255
|
+
}
|
|
256
|
+
.nw-tooltip-danger {
|
|
257
|
+
--_intent: var(--nw-danger);
|
|
258
|
+
--_on: var(--nw-on-danger);
|
|
259
|
+
--_soft: var(--nw-danger-soft);
|
|
260
|
+
--_edge: var(--_intent);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.nw-tooltip-glow {
|
|
264
|
+
--nw-glow-color: var(--_intent);
|
|
265
|
+
box-shadow: var(--nw-shadow-md), var(--nw-glow-sm);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@media (prefers-reduced-motion: reduce) {
|
|
269
|
+
[data-tooltip]:not([data-tooltip=''])::after {
|
|
270
|
+
transform: translate(-50%, 0);
|
|
271
|
+
}
|
|
272
|
+
[data-tooltip][data-side='right']::after,
|
|
273
|
+
[data-tooltip][data-side='left']::after {
|
|
274
|
+
transform: translate(0, -50%);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
@media (forced-colors: active) {
|
|
279
|
+
.nw-tooltip,
|
|
280
|
+
[data-tooltip]:not([data-tooltip=''])::after,
|
|
281
|
+
.nw-tooltip-arrow:not(svg) {
|
|
282
|
+
border: 1px solid CanvasText;
|
|
283
|
+
color: CanvasText;
|
|
284
|
+
background: Canvas;
|
|
285
|
+
box-shadow: none;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
package/src/fonts.css
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/* Latin and Latin Extended subsets of the three variable families, served from ./fonts (the build
|
|
2
|
+
copies the files out of the @fontsource-variable packages). */
|
|
3
|
+
@font-face {
|
|
4
|
+
font-family: 'Space Grotesk Variable';
|
|
5
|
+
font-style: normal;
|
|
6
|
+
font-display: swap;
|
|
7
|
+
font-weight: 300 700;
|
|
8
|
+
src: url('./fonts/space-grotesk-latin-ext-wght-normal.woff2') format('woff2-variations');
|
|
9
|
+
unicode-range:
|
|
10
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
|
|
11
|
+
U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
|
|
12
|
+
U+A720-A7FF;
|
|
13
|
+
}
|
|
14
|
+
@font-face {
|
|
15
|
+
font-family: 'Space Grotesk Variable';
|
|
16
|
+
font-style: normal;
|
|
17
|
+
font-display: swap;
|
|
18
|
+
font-weight: 300 700;
|
|
19
|
+
src: url('./fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
|
|
20
|
+
unicode-range:
|
|
21
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
|
22
|
+
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
23
|
+
}
|
|
24
|
+
@font-face {
|
|
25
|
+
font-family: 'Inter Variable';
|
|
26
|
+
font-style: normal;
|
|
27
|
+
font-display: swap;
|
|
28
|
+
font-weight: 100 900;
|
|
29
|
+
src: url('./fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
|
|
30
|
+
unicode-range:
|
|
31
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
|
|
32
|
+
U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
|
|
33
|
+
U+A720-A7FF;
|
|
34
|
+
}
|
|
35
|
+
@font-face {
|
|
36
|
+
font-family: 'Inter Variable';
|
|
37
|
+
font-style: normal;
|
|
38
|
+
font-display: swap;
|
|
39
|
+
font-weight: 100 900;
|
|
40
|
+
src: url('./fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
|
|
41
|
+
unicode-range:
|
|
42
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
|
43
|
+
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
44
|
+
}
|
|
45
|
+
@font-face {
|
|
46
|
+
font-family: 'Inter Variable';
|
|
47
|
+
font-style: italic;
|
|
48
|
+
font-display: swap;
|
|
49
|
+
font-weight: 100 900;
|
|
50
|
+
src: url('./fonts/inter-latin-ext-wght-italic.woff2') format('woff2-variations');
|
|
51
|
+
unicode-range:
|
|
52
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
|
|
53
|
+
U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
|
|
54
|
+
U+A720-A7FF;
|
|
55
|
+
}
|
|
56
|
+
@font-face {
|
|
57
|
+
font-family: 'Inter Variable';
|
|
58
|
+
font-style: italic;
|
|
59
|
+
font-display: swap;
|
|
60
|
+
font-weight: 100 900;
|
|
61
|
+
src: url('./fonts/inter-latin-wght-italic.woff2') format('woff2-variations');
|
|
62
|
+
unicode-range:
|
|
63
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
|
64
|
+
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Martian Mono draws 0.7em per glyph at its natural width. The file carries the width axis
|
|
68
|
+
(75% to 112.5%); declaring only 75% to 87.5% clamps the default to 87.5% (0.65em) wherever the
|
|
69
|
+
family is used, and font-stretch: 75% narrows it to the usual 0.6em. */
|
|
70
|
+
@font-face {
|
|
71
|
+
font-family: 'Martian Mono Variable';
|
|
72
|
+
font-style: normal;
|
|
73
|
+
font-display: swap;
|
|
74
|
+
font-weight: 100 800;
|
|
75
|
+
font-stretch: 75% 87.5%;
|
|
76
|
+
src: url('./fonts/martian-mono-latin-ext-wdth-normal.woff2') format('woff2-variations');
|
|
77
|
+
unicode-range:
|
|
78
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
|
|
79
|
+
U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
|
|
80
|
+
U+A720-A7FF;
|
|
81
|
+
}
|
|
82
|
+
@font-face {
|
|
83
|
+
font-family: 'Martian Mono Variable';
|
|
84
|
+
font-style: normal;
|
|
85
|
+
font-display: swap;
|
|
86
|
+
font-weight: 100 800;
|
|
87
|
+
font-stretch: 75% 87.5%;
|
|
88
|
+
src: url('./fonts/martian-mono-latin-wdth-normal.woff2') format('woff2-variations');
|
|
89
|
+
unicode-range:
|
|
90
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
|
91
|
+
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
92
|
+
}
|
package/src/index.css
ADDED
package/src/motion.css
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/* Shared keyframes and the reduced-motion switch. A keyframe used by one component only belongs
|
|
2
|
+
in that component's file. */
|
|
3
|
+
@layer base {
|
|
4
|
+
@keyframes nw-spin {
|
|
5
|
+
to {
|
|
6
|
+
transform: rotate(360deg);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@keyframes nw-pulse {
|
|
11
|
+
50% {
|
|
12
|
+
opacity: 0.4;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@keyframes nw-glow-pulse {
|
|
17
|
+
0%,
|
|
18
|
+
100% {
|
|
19
|
+
box-shadow: var(--nw-glow-sm);
|
|
20
|
+
}
|
|
21
|
+
50% {
|
|
22
|
+
box-shadow: var(--nw-glow-lg);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* For a background sized 200% wide. */
|
|
27
|
+
@keyframes nw-shimmer {
|
|
28
|
+
from {
|
|
29
|
+
background-position: 200% 0;
|
|
30
|
+
}
|
|
31
|
+
to {
|
|
32
|
+
background-position: -200% 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@keyframes nw-fade-in {
|
|
37
|
+
from {
|
|
38
|
+
opacity: 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
@keyframes nw-fade-out {
|
|
42
|
+
to {
|
|
43
|
+
opacity: 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
@keyframes nw-zoom-in {
|
|
47
|
+
from {
|
|
48
|
+
opacity: 0;
|
|
49
|
+
transform: scale(0.96);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
@keyframes nw-zoom-out {
|
|
53
|
+
to {
|
|
54
|
+
opacity: 0;
|
|
55
|
+
transform: scale(0.96);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Slides travel --nw-slide-distance: 0.5rem for a popover, 100% for a drawer. */
|
|
60
|
+
@keyframes nw-slide-in-from-top {
|
|
61
|
+
from {
|
|
62
|
+
opacity: 0;
|
|
63
|
+
transform: translateY(calc(-1 * var(--nw-slide-distance, 0.5rem)));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
@keyframes nw-slide-in-from-bottom {
|
|
67
|
+
from {
|
|
68
|
+
opacity: 0;
|
|
69
|
+
transform: translateY(var(--nw-slide-distance, 0.5rem));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
@keyframes nw-slide-in-from-left {
|
|
73
|
+
from {
|
|
74
|
+
opacity: 0;
|
|
75
|
+
transform: translateX(calc(-1 * var(--nw-slide-distance, 0.5rem)));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
@keyframes nw-slide-in-from-right {
|
|
79
|
+
from {
|
|
80
|
+
opacity: 0;
|
|
81
|
+
transform: translateX(var(--nw-slide-distance, 0.5rem));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
@keyframes nw-slide-out-to-top {
|
|
85
|
+
to {
|
|
86
|
+
opacity: 0;
|
|
87
|
+
transform: translateY(calc(-1 * var(--nw-slide-distance, 0.5rem)));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
@keyframes nw-slide-out-to-bottom {
|
|
91
|
+
to {
|
|
92
|
+
opacity: 0;
|
|
93
|
+
transform: translateY(var(--nw-slide-distance, 0.5rem));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
@keyframes nw-slide-out-to-left {
|
|
97
|
+
to {
|
|
98
|
+
opacity: 0;
|
|
99
|
+
transform: translateX(calc(-1 * var(--nw-slide-distance, 0.5rem)));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
@keyframes nw-slide-out-to-right {
|
|
103
|
+
to {
|
|
104
|
+
opacity: 0;
|
|
105
|
+
transform: translateX(var(--nw-slide-distance, 0.5rem));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Chromatic split in the secondary and tertiary colors, with two frames that keep only a slice
|
|
110
|
+
of the text. Played with a step timing function, so each frame holds until the next. */
|
|
111
|
+
@keyframes nw-glitch {
|
|
112
|
+
0% {
|
|
113
|
+
transform: translate(0.03em, -0.02em);
|
|
114
|
+
text-shadow:
|
|
115
|
+
-0.06em 0 var(--nw-secondary),
|
|
116
|
+
0.06em 0 var(--nw-tertiary);
|
|
117
|
+
}
|
|
118
|
+
15% {
|
|
119
|
+
transform: translate(-0.05em, 0.02em) skewX(-8deg);
|
|
120
|
+
text-shadow:
|
|
121
|
+
0.09em 0 var(--nw-secondary),
|
|
122
|
+
-0.09em 0 var(--nw-tertiary);
|
|
123
|
+
clip-path: inset(8% 0 54% 0);
|
|
124
|
+
}
|
|
125
|
+
30% {
|
|
126
|
+
transform: translate(0.04em, 0);
|
|
127
|
+
text-shadow:
|
|
128
|
+
-0.05em 0 var(--nw-secondary),
|
|
129
|
+
0.05em 0 var(--nw-tertiary);
|
|
130
|
+
clip-path: inset(0);
|
|
131
|
+
}
|
|
132
|
+
45% {
|
|
133
|
+
transform: translate(-0.02em, -0.02em) skewX(6deg);
|
|
134
|
+
text-shadow:
|
|
135
|
+
0.07em 0 var(--nw-secondary),
|
|
136
|
+
-0.07em 0 var(--nw-tertiary);
|
|
137
|
+
clip-path: inset(58% 0 6% 0);
|
|
138
|
+
}
|
|
139
|
+
60% {
|
|
140
|
+
transform: translate(0.02em, 0.01em);
|
|
141
|
+
text-shadow:
|
|
142
|
+
-0.04em 0 var(--nw-secondary),
|
|
143
|
+
0.04em 0 var(--nw-tertiary);
|
|
144
|
+
clip-path: inset(0);
|
|
145
|
+
}
|
|
146
|
+
80% {
|
|
147
|
+
transform: translate(-0.01em, 0);
|
|
148
|
+
text-shadow:
|
|
149
|
+
0.02em 0 var(--nw-secondary),
|
|
150
|
+
-0.02em 0 var(--nw-tertiary);
|
|
151
|
+
}
|
|
152
|
+
100% {
|
|
153
|
+
transform: none;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Decorative motion collapses to an instant state change. Durations go to almost zero, not zero,
|
|
158
|
+
so animationend and transitionend still fire. Motion that carries meaning, such as a spinner
|
|
159
|
+
for pending work, opts out with .nw-motion-essential. */
|
|
160
|
+
@media (prefers-reduced-motion: reduce) {
|
|
161
|
+
:root {
|
|
162
|
+
--nw-duration-instant: 0.01ms;
|
|
163
|
+
--nw-duration-fast: 0.01ms;
|
|
164
|
+
--nw-duration-base: 0.01ms;
|
|
165
|
+
--nw-duration-slow: 0.01ms;
|
|
166
|
+
--nw-duration-slower: 0.01ms;
|
|
167
|
+
}
|
|
168
|
+
:where(*:not(.nw-motion-essential)),
|
|
169
|
+
:where(*:not(.nw-motion-essential))::before,
|
|
170
|
+
:where(*:not(.nw-motion-essential))::after {
|
|
171
|
+
animation-duration: 0.01ms !important;
|
|
172
|
+
animation-iteration-count: 1 !important;
|
|
173
|
+
transition-duration: 0.01ms !important;
|
|
174
|
+
scroll-behavior: auto !important;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
package/src/semantic.css
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* Semantic roles. Declared again on every flavor and accent scope so a nested scope resolves the
|
|
2
|
+
var() references against its own palette. */
|
|
3
|
+
@layer theme {
|
|
4
|
+
:root,
|
|
5
|
+
[data-flavor],
|
|
6
|
+
[data-accent] {
|
|
7
|
+
/* Surfaces */
|
|
8
|
+
--nw-canvas: var(--nw-base);
|
|
9
|
+
--nw-canvas-subtle: var(--nw-mantle);
|
|
10
|
+
--nw-canvas-sunken: var(--nw-crust);
|
|
11
|
+
--nw-panel: var(--nw-surface0);
|
|
12
|
+
--nw-panel-hover: var(--nw-surface1);
|
|
13
|
+
--nw-panel-active: var(--nw-surface2);
|
|
14
|
+
|
|
15
|
+
/* Text */
|
|
16
|
+
--nw-fg: var(--nw-text);
|
|
17
|
+
--nw-fg-muted: var(--nw-subtext1);
|
|
18
|
+
--nw-fg-subtle: var(--nw-subtext0);
|
|
19
|
+
--nw-fg-faint: var(--nw-overlay2);
|
|
20
|
+
--nw-fg-disabled: var(--nw-overlay1);
|
|
21
|
+
|
|
22
|
+
/* Lines. --nw-line is decorative; a control boundary needs --nw-line-strong (3:1 on canvas). */
|
|
23
|
+
--nw-line: var(--nw-overlay0);
|
|
24
|
+
--nw-line-strong: var(--nw-overlay1);
|
|
25
|
+
--nw-line-bright: var(--nw-overlay2);
|
|
26
|
+
|
|
27
|
+
/* Intents */
|
|
28
|
+
--nw-primary: var(--nw-accent);
|
|
29
|
+
--nw-on-primary: var(--nw-on-accent);
|
|
30
|
+
--nw-primary-soft: color-mix(in oklab, var(--nw-primary) 16%, transparent);
|
|
31
|
+
--nw-secondary: var(--nw-synth);
|
|
32
|
+
--nw-on-secondary: var(--nw-on-accent);
|
|
33
|
+
--nw-secondary-soft: color-mix(in oklab, var(--nw-secondary) 16%, transparent);
|
|
34
|
+
--nw-tertiary: var(--nw-ice);
|
|
35
|
+
--nw-on-tertiary: var(--nw-on-accent);
|
|
36
|
+
--nw-tertiary-soft: color-mix(in oklab, var(--nw-tertiary) 16%, transparent);
|
|
37
|
+
--nw-info: var(--nw-arc);
|
|
38
|
+
--nw-on-info: var(--nw-on-accent);
|
|
39
|
+
--nw-info-soft: color-mix(in oklab, var(--nw-info) 16%, transparent);
|
|
40
|
+
--nw-success: var(--nw-matrix);
|
|
41
|
+
--nw-on-success: var(--nw-on-accent);
|
|
42
|
+
--nw-success-soft: color-mix(in oklab, var(--nw-success) 16%, transparent);
|
|
43
|
+
--nw-warning: var(--nw-volt);
|
|
44
|
+
--nw-on-warning: var(--nw-on-accent);
|
|
45
|
+
--nw-warning-soft: color-mix(in oklab, var(--nw-warning) 16%, transparent);
|
|
46
|
+
--nw-danger: var(--nw-alarm);
|
|
47
|
+
--nw-on-danger: var(--nw-on-accent);
|
|
48
|
+
--nw-danger-soft: color-mix(in oklab, var(--nw-danger) 16%, transparent);
|
|
49
|
+
|
|
50
|
+
/* Interaction and overlays */
|
|
51
|
+
--nw-ring: var(--nw-primary);
|
|
52
|
+
--nw-link: var(--nw-iris);
|
|
53
|
+
--nw-selection: color-mix(in oklab, var(--nw-primary) 32%, transparent);
|
|
54
|
+
/* Ink of elevation shadows and scrims: crust on the dark flavors, the text ink on lumen. */
|
|
55
|
+
--nw-shadow-ink: color-mix(
|
|
56
|
+
in oklab,
|
|
57
|
+
var(--nw-crust) calc(100% * var(--nw-flavor-dark)),
|
|
58
|
+
var(--nw-text)
|
|
59
|
+
);
|
|
60
|
+
--nw-backdrop: color-mix(
|
|
61
|
+
in oklab,
|
|
62
|
+
var(--nw-shadow-ink) calc(35% + 37% * var(--nw-flavor-dark)),
|
|
63
|
+
transparent
|
|
64
|
+
);
|
|
65
|
+
--nw-glass: color-mix(in oklab, var(--nw-canvas) 78%, transparent);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Soft ink: the share of an intent color in text that sits on its own -soft tint; the rest is
|
|
69
|
+
--nw-fg. The tint costs contrast, so each flavor gets the most saturated mix that keeps 4.5:1
|
|
70
|
+
for all twelve accents on canvas-sunken, canvas-subtle, canvas and panel. Set on the flavor
|
|
71
|
+
scopes only, so an accent scope inherits its flavor's value. */
|
|
72
|
+
:root,
|
|
73
|
+
[data-flavor='nocturne'] {
|
|
74
|
+
--nw-soft-ink: 90%;
|
|
75
|
+
}
|
|
76
|
+
[data-flavor='abyss'] {
|
|
77
|
+
--nw-soft-ink: 100%;
|
|
78
|
+
}
|
|
79
|
+
[data-flavor='twilight'] {
|
|
80
|
+
--nw-soft-ink: 75%;
|
|
81
|
+
}
|
|
82
|
+
[data-flavor='lumen'] {
|
|
83
|
+
--nw-soft-ink: 70%;
|
|
84
|
+
}
|
|
85
|
+
}
|