@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,183 @@
|
|
|
1
|
+
/* Switch: a boolean setting that applies at once. <input type='checkbox' role='switch'> with the
|
|
2
|
+
class, so checked, disabled and focus-visible come from the element itself.
|
|
3
|
+
Off is a well with a neutral thumb; on is the intent with the on-accent thumb. The thumb moves
|
|
4
|
+
on the compositor (translate) and squashes under the pointer without changing the track's box.
|
|
5
|
+
Wrap it in a .nw-label for a clickable text; the lh margin aligns it to the first line.
|
|
6
|
+
For a setting that needs a submit, use a checkbox instead. */
|
|
7
|
+
@layer components {
|
|
8
|
+
.nw-switch {
|
|
9
|
+
--_intent: var(--nw-primary);
|
|
10
|
+
--_on: var(--nw-on-primary);
|
|
11
|
+
--_h: var(--nw-space-5);
|
|
12
|
+
--_w: calc(var(--_h) * 2 - var(--nw-space-1));
|
|
13
|
+
--_pad: var(--nw-space-0-5);
|
|
14
|
+
--_fill: var(--nw-line-strong);
|
|
15
|
+
--_knob: var(--nw-fg-subtle);
|
|
16
|
+
--_track: color-mix(
|
|
17
|
+
in oklab,
|
|
18
|
+
var(--nw-canvas-sunken) calc(100% * var(--nw-flavor-dark)),
|
|
19
|
+
var(--nw-canvas)
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
position: relative;
|
|
23
|
+
display: inline-block;
|
|
24
|
+
flex: none;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
inline-size: var(--_w);
|
|
27
|
+
block-size: var(--_h);
|
|
28
|
+
margin: 0;
|
|
29
|
+
border: 1px solid var(--_fill);
|
|
30
|
+
border-radius: var(--nw-radius-full);
|
|
31
|
+
background-color: var(--_track);
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
appearance: none;
|
|
34
|
+
-webkit-tap-highlight-color: transparent;
|
|
35
|
+
transition:
|
|
36
|
+
background-color var(--nw-duration-base) var(--nw-ease-standard),
|
|
37
|
+
border-color var(--nw-duration-base) var(--nw-ease-standard),
|
|
38
|
+
box-shadow var(--nw-duration-base) var(--nw-ease-standard);
|
|
39
|
+
}
|
|
40
|
+
.nw-switch::before {
|
|
41
|
+
content: '';
|
|
42
|
+
position: absolute;
|
|
43
|
+
inset-block-start: var(--_pad);
|
|
44
|
+
inset-inline-start: var(--_pad);
|
|
45
|
+
inline-size: calc(var(--_h) - 2px - var(--_pad) * 2);
|
|
46
|
+
block-size: calc(var(--_h) - 2px - var(--_pad) * 2);
|
|
47
|
+
border-radius: var(--nw-radius-full);
|
|
48
|
+
background-color: var(--_knob);
|
|
49
|
+
box-shadow: var(--nw-shadow-sm);
|
|
50
|
+
transition:
|
|
51
|
+
translate var(--nw-duration-base) var(--nw-ease-back),
|
|
52
|
+
scale var(--nw-duration-fast) var(--nw-ease-standard),
|
|
53
|
+
background-color var(--nw-duration-base) var(--nw-ease-standard);
|
|
54
|
+
}
|
|
55
|
+
.nw-switch:checked {
|
|
56
|
+
--_fill: var(--_intent);
|
|
57
|
+
--_knob: var(--_on);
|
|
58
|
+
background-color: var(--_intent);
|
|
59
|
+
box-shadow: var(--nw-glow-sm);
|
|
60
|
+
}
|
|
61
|
+
.nw-switch:checked::before {
|
|
62
|
+
translate: calc(var(--_w) - var(--_h)) 0;
|
|
63
|
+
}
|
|
64
|
+
.nw-switch:hover:not(:disabled) {
|
|
65
|
+
--_fill: var(--_intent);
|
|
66
|
+
--_knob: var(--nw-fg);
|
|
67
|
+
}
|
|
68
|
+
.nw-switch:checked:hover:not(:disabled) {
|
|
69
|
+
--_knob: var(--_on);
|
|
70
|
+
background-color: color-mix(in oklab, var(--_intent) 86%, var(--nw-fg));
|
|
71
|
+
}
|
|
72
|
+
/* Press feedback is a squash of the thumb, anchored to the side it rests on. */
|
|
73
|
+
.nw-switch:active:not(:disabled)::before {
|
|
74
|
+
scale: 1.2 1;
|
|
75
|
+
transform-origin: left center;
|
|
76
|
+
}
|
|
77
|
+
.nw-switch:checked:active:not(:disabled)::before {
|
|
78
|
+
transform-origin: right center;
|
|
79
|
+
}
|
|
80
|
+
.nw-switch[dir='rtl']:checked::before,
|
|
81
|
+
[dir='rtl'] > .nw-switch:checked::before {
|
|
82
|
+
transform-origin: left center;
|
|
83
|
+
}
|
|
84
|
+
.nw-switch:focus-visible {
|
|
85
|
+
outline: var(--nw-ring-width) solid var(--nw-ring);
|
|
86
|
+
outline-offset: var(--nw-ring-offset);
|
|
87
|
+
}
|
|
88
|
+
.nw-switch:disabled {
|
|
89
|
+
--_fill: var(--nw-line);
|
|
90
|
+
--_knob: var(--nw-fg-disabled);
|
|
91
|
+
background-color: var(--nw-canvas-subtle);
|
|
92
|
+
box-shadow: none;
|
|
93
|
+
cursor: not-allowed;
|
|
94
|
+
}
|
|
95
|
+
.nw-switch:disabled::before {
|
|
96
|
+
box-shadow: none;
|
|
97
|
+
}
|
|
98
|
+
.nw-switch::after {
|
|
99
|
+
content: '';
|
|
100
|
+
position: absolute;
|
|
101
|
+
inset-block: calc(50% - var(--nw-space-3));
|
|
102
|
+
inset-inline: calc(-1 * var(--nw-space-1));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Intents -------------------------------------------------------------------------------- */
|
|
106
|
+
.nw-switch-primary {
|
|
107
|
+
--_intent: var(--nw-primary);
|
|
108
|
+
--_on: var(--nw-on-primary);
|
|
109
|
+
}
|
|
110
|
+
.nw-switch-secondary {
|
|
111
|
+
--_intent: var(--nw-secondary);
|
|
112
|
+
--_on: var(--nw-on-secondary);
|
|
113
|
+
}
|
|
114
|
+
.nw-switch-tertiary {
|
|
115
|
+
--_intent: var(--nw-tertiary);
|
|
116
|
+
--_on: var(--nw-on-tertiary);
|
|
117
|
+
}
|
|
118
|
+
.nw-switch-neutral {
|
|
119
|
+
--_intent: var(--nw-fg-muted);
|
|
120
|
+
--_on: var(--nw-canvas);
|
|
121
|
+
}
|
|
122
|
+
.nw-switch-info {
|
|
123
|
+
--_intent: var(--nw-info);
|
|
124
|
+
--_on: var(--nw-on-info);
|
|
125
|
+
}
|
|
126
|
+
.nw-switch-success {
|
|
127
|
+
--_intent: var(--nw-success);
|
|
128
|
+
--_on: var(--nw-on-success);
|
|
129
|
+
}
|
|
130
|
+
.nw-switch-warning {
|
|
131
|
+
--_intent: var(--nw-warning);
|
|
132
|
+
--_on: var(--nw-on-warning);
|
|
133
|
+
}
|
|
134
|
+
.nw-switch-danger {
|
|
135
|
+
--_intent: var(--nw-danger);
|
|
136
|
+
--_on: var(--nw-on-danger);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* Sizes ---------------------------------------------------------------------------------- */
|
|
140
|
+
.nw-switch-sm {
|
|
141
|
+
--_h: var(--nw-space-4);
|
|
142
|
+
}
|
|
143
|
+
.nw-switch-md {
|
|
144
|
+
--_h: var(--nw-space-5);
|
|
145
|
+
}
|
|
146
|
+
.nw-switch-lg {
|
|
147
|
+
--_h: var(--nw-space-6);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.nw-label > .nw-switch {
|
|
151
|
+
margin-block: calc((1lh - var(--_h)) / 2);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@media (prefers-reduced-motion: reduce) {
|
|
155
|
+
.nw-switch::before {
|
|
156
|
+
transition: background-color var(--nw-duration-fast) var(--nw-ease-standard);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@media (forced-colors: active) {
|
|
161
|
+
.nw-switch {
|
|
162
|
+
border-color: ButtonText;
|
|
163
|
+
box-shadow: none;
|
|
164
|
+
}
|
|
165
|
+
.nw-switch::before {
|
|
166
|
+
background: ButtonText;
|
|
167
|
+
box-shadow: none;
|
|
168
|
+
}
|
|
169
|
+
.nw-switch:checked {
|
|
170
|
+
background: Highlight;
|
|
171
|
+
border-color: Highlight;
|
|
172
|
+
}
|
|
173
|
+
.nw-switch:checked::before {
|
|
174
|
+
background: HighlightText;
|
|
175
|
+
}
|
|
176
|
+
.nw-switch:disabled {
|
|
177
|
+
border-color: GrayText;
|
|
178
|
+
}
|
|
179
|
+
.nw-switch:disabled::before {
|
|
180
|
+
background: GrayText;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/* Table: dense data rows with hairline rules, mono column labels and tabular numerals.
|
|
2
|
+
|
|
3
|
+
<div class="nw-table-wrap">
|
|
4
|
+
<table class="nw-table nw-table-hover nw-table-sticky">
|
|
5
|
+
<caption>Six nodes on the night grid</caption>
|
|
6
|
+
<thead><tr><th aria-sort="ascending"><button class="nw-table-sort">Node</button></th>
|
|
7
|
+
<th>Region</th><th class="nw-table-num">Latency</th><th>Status</th></tr></thead>
|
|
8
|
+
<tbody>
|
|
9
|
+
<tr aria-selected="true"><th scope="row">hel-01</th><td>Helsinki</td>
|
|
10
|
+
<td class="nw-table-num">12 ms</td><td class="nw-table-success">Online</td></tr>
|
|
11
|
+
...
|
|
12
|
+
</tbody>
|
|
13
|
+
</table>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
The wrapper supplies the border, radius and scroll area; the table itself is unboxed so it also
|
|
17
|
+
works bare. Sizes sm..lg change cell padding and font size; -striped, -hover, -bordered and
|
|
18
|
+
-sticky are opt-in. Row state: aria-selected / data-selected, data-disabled, tr:focus-visible.
|
|
19
|
+
Intent classes on a tr, th or td tint that row or cell with the intent's soft wash; pair them
|
|
20
|
+
with .nw-text-<intent> when the text itself should carry the color. */
|
|
21
|
+
@layer components {
|
|
22
|
+
.nw-table {
|
|
23
|
+
--_intent: var(--nw-primary);
|
|
24
|
+
--_on: var(--nw-on-primary);
|
|
25
|
+
--_soft: var(--nw-primary-soft);
|
|
26
|
+
--_px: var(--nw-space-4);
|
|
27
|
+
--_py: var(--nw-space-3);
|
|
28
|
+
--_fs: var(--nw-text-sm);
|
|
29
|
+
--_surface: var(--nw-canvas);
|
|
30
|
+
|
|
31
|
+
inline-size: 100%;
|
|
32
|
+
border-collapse: collapse;
|
|
33
|
+
font-size: var(--_fs);
|
|
34
|
+
line-height: var(--nw-leading-normal);
|
|
35
|
+
color: var(--nw-fg);
|
|
36
|
+
}
|
|
37
|
+
.nw-table caption {
|
|
38
|
+
caption-side: bottom;
|
|
39
|
+
padding-block: var(--nw-space-3);
|
|
40
|
+
font-family: var(--nw-font-mono);
|
|
41
|
+
font-size: var(--nw-text-2xs);
|
|
42
|
+
letter-spacing: var(--nw-tracking-wide);
|
|
43
|
+
text-align: start;
|
|
44
|
+
color: var(--nw-fg-subtle);
|
|
45
|
+
}
|
|
46
|
+
.nw-table-caption-top caption {
|
|
47
|
+
caption-side: top;
|
|
48
|
+
}
|
|
49
|
+
.nw-table :where(th, td) {
|
|
50
|
+
padding: var(--_py) var(--_px);
|
|
51
|
+
border-block-end: 1px solid var(--nw-line);
|
|
52
|
+
text-align: start;
|
|
53
|
+
vertical-align: middle;
|
|
54
|
+
}
|
|
55
|
+
.nw-table thead th {
|
|
56
|
+
border-block-end-color: var(--nw-line-strong);
|
|
57
|
+
font-family: var(--nw-font-mono);
|
|
58
|
+
font-size: var(--nw-text-2xs);
|
|
59
|
+
font-weight: 500;
|
|
60
|
+
letter-spacing: var(--nw-tracking-wider);
|
|
61
|
+
text-transform: uppercase;
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
color: var(--nw-fg-subtle);
|
|
64
|
+
}
|
|
65
|
+
.nw-table tbody th {
|
|
66
|
+
font-weight: 500;
|
|
67
|
+
color: var(--nw-fg);
|
|
68
|
+
}
|
|
69
|
+
.nw-table tfoot :where(th, td) {
|
|
70
|
+
border-block-end: 0;
|
|
71
|
+
border-block-start: 1px solid var(--nw-line-strong);
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Sorting ---------------------------------------------------------------------------------- */
|
|
76
|
+
|
|
77
|
+
.nw-table th[aria-sort] {
|
|
78
|
+
color: var(--nw-fg);
|
|
79
|
+
}
|
|
80
|
+
.nw-table th[aria-sort]::after {
|
|
81
|
+
content: '';
|
|
82
|
+
display: inline-block;
|
|
83
|
+
inline-size: var(--nw-space-3);
|
|
84
|
+
block-size: var(--nw-space-3);
|
|
85
|
+
margin-inline-start: var(--nw-space-2);
|
|
86
|
+
vertical-align: -0.125em;
|
|
87
|
+
background-color: currentColor;
|
|
88
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
89
|
+
mask-size: contain;
|
|
90
|
+
mask-repeat: no-repeat;
|
|
91
|
+
opacity: 0.4;
|
|
92
|
+
}
|
|
93
|
+
.nw-table th[aria-sort='ascending']::after,
|
|
94
|
+
.nw-table th[aria-sort='descending']::after {
|
|
95
|
+
color: var(--_intent);
|
|
96
|
+
opacity: 1;
|
|
97
|
+
}
|
|
98
|
+
.nw-table th[aria-sort='ascending']::after {
|
|
99
|
+
transform: rotate(180deg);
|
|
100
|
+
}
|
|
101
|
+
.nw-table-sort {
|
|
102
|
+
display: inline-flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
gap: var(--nw-space-1);
|
|
105
|
+
padding: 0;
|
|
106
|
+
border: 0;
|
|
107
|
+
font: inherit;
|
|
108
|
+
letter-spacing: inherit;
|
|
109
|
+
text-transform: inherit;
|
|
110
|
+
color: inherit;
|
|
111
|
+
background: none;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
}
|
|
114
|
+
.nw-table-sort:hover {
|
|
115
|
+
color: var(--nw-fg);
|
|
116
|
+
}
|
|
117
|
+
.nw-table-sort:focus-visible {
|
|
118
|
+
outline: var(--nw-ring-width) solid var(--nw-ring);
|
|
119
|
+
outline-offset: var(--nw-ring-offset);
|
|
120
|
+
border-radius: var(--nw-radius-xs);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Cell roles ------------------------------------------------------------------------------- */
|
|
124
|
+
|
|
125
|
+
.nw-table .nw-table-num {
|
|
126
|
+
text-align: end;
|
|
127
|
+
font-variant-numeric: tabular-nums;
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
}
|
|
130
|
+
.nw-table .nw-table-center {
|
|
131
|
+
text-align: center;
|
|
132
|
+
}
|
|
133
|
+
.nw-table .nw-table-empty {
|
|
134
|
+
padding-block: var(--nw-space-10);
|
|
135
|
+
text-align: center;
|
|
136
|
+
color: var(--nw-fg-subtle);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* Row state -------------------------------------------------------------------------------- */
|
|
140
|
+
|
|
141
|
+
.nw-table tbody tr:focus-visible {
|
|
142
|
+
outline: var(--nw-ring-width) solid var(--nw-ring);
|
|
143
|
+
outline-offset: calc(-1 * var(--nw-ring-width));
|
|
144
|
+
}
|
|
145
|
+
.nw-table tbody tr[data-disabled] > * {
|
|
146
|
+
color: var(--nw-fg-disabled);
|
|
147
|
+
}
|
|
148
|
+
.nw-table tbody tr:is([aria-selected='true'], [data-selected]) > * {
|
|
149
|
+
background-color: var(--_soft);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* Variants --------------------------------------------------------------------------------- */
|
|
153
|
+
|
|
154
|
+
.nw-table-striped tbody tr:nth-child(even) > * {
|
|
155
|
+
background-color: color-mix(in oklab, var(--nw-fg) 3%, transparent);
|
|
156
|
+
}
|
|
157
|
+
.nw-table-hover tbody tr > * {
|
|
158
|
+
transition: background-color var(--nw-duration-fast) var(--nw-ease-standard);
|
|
159
|
+
}
|
|
160
|
+
.nw-table-hover tbody tr:hover > * {
|
|
161
|
+
background-color: color-mix(in oklab, var(--_intent) 7%, transparent);
|
|
162
|
+
}
|
|
163
|
+
.nw-table-hover tbody tr:is([aria-selected='true'], [data-selected]):hover > * {
|
|
164
|
+
background-color: color-mix(in oklab, var(--_intent) 22%, transparent);
|
|
165
|
+
}
|
|
166
|
+
.nw-table-bordered :where(th, td) {
|
|
167
|
+
border-inline-end: 1px solid var(--nw-line);
|
|
168
|
+
}
|
|
169
|
+
.nw-table-bordered tr > :last-child {
|
|
170
|
+
border-inline-end: 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Sizes ------------------------------------------------------------------------------------ */
|
|
174
|
+
|
|
175
|
+
.nw-table-sm {
|
|
176
|
+
--_px: var(--nw-space-3);
|
|
177
|
+
--_py: var(--nw-space-2);
|
|
178
|
+
--_fs: var(--nw-text-xs);
|
|
179
|
+
}
|
|
180
|
+
.nw-table-md {
|
|
181
|
+
--_px: var(--nw-space-4);
|
|
182
|
+
--_py: var(--nw-space-3);
|
|
183
|
+
--_fs: var(--nw-text-sm);
|
|
184
|
+
}
|
|
185
|
+
.nw-table-lg {
|
|
186
|
+
--_px: var(--nw-space-5);
|
|
187
|
+
--_py: var(--nw-space-4);
|
|
188
|
+
--_fs: var(--nw-text-base);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Intent washes on a row or a single cell --------------------------------------------------- */
|
|
192
|
+
|
|
193
|
+
.nw-table :is(tr, th, td).nw-table-primary {
|
|
194
|
+
--_intent: var(--nw-primary);
|
|
195
|
+
--_on: var(--nw-on-primary);
|
|
196
|
+
--_soft: var(--nw-primary-soft);
|
|
197
|
+
background-color: var(--nw-primary-soft);
|
|
198
|
+
}
|
|
199
|
+
.nw-table :is(tr, th, td).nw-table-secondary {
|
|
200
|
+
--_intent: var(--nw-secondary);
|
|
201
|
+
--_on: var(--nw-on-secondary);
|
|
202
|
+
--_soft: var(--nw-secondary-soft);
|
|
203
|
+
background-color: var(--nw-secondary-soft);
|
|
204
|
+
}
|
|
205
|
+
.nw-table :is(tr, th, td).nw-table-tertiary {
|
|
206
|
+
--_intent: var(--nw-tertiary);
|
|
207
|
+
--_on: var(--nw-on-tertiary);
|
|
208
|
+
--_soft: var(--nw-tertiary-soft);
|
|
209
|
+
background-color: var(--nw-tertiary-soft);
|
|
210
|
+
}
|
|
211
|
+
.nw-table :is(tr, th, td).nw-table-neutral {
|
|
212
|
+
--_intent: var(--nw-fg-muted);
|
|
213
|
+
--_on: var(--nw-canvas);
|
|
214
|
+
--_soft: color-mix(in oklab, var(--nw-fg) 10%, transparent);
|
|
215
|
+
background-color: color-mix(in oklab, var(--nw-fg) 6%, transparent);
|
|
216
|
+
}
|
|
217
|
+
.nw-table :is(tr, th, td).nw-table-info {
|
|
218
|
+
--_intent: var(--nw-info);
|
|
219
|
+
--_on: var(--nw-on-info);
|
|
220
|
+
--_soft: var(--nw-info-soft);
|
|
221
|
+
background-color: var(--nw-info-soft);
|
|
222
|
+
}
|
|
223
|
+
.nw-table :is(tr, th, td).nw-table-success {
|
|
224
|
+
--_intent: var(--nw-success);
|
|
225
|
+
--_on: var(--nw-on-success);
|
|
226
|
+
--_soft: var(--nw-success-soft);
|
|
227
|
+
background-color: var(--nw-success-soft);
|
|
228
|
+
}
|
|
229
|
+
.nw-table :is(tr, th, td).nw-table-warning {
|
|
230
|
+
--_intent: var(--nw-warning);
|
|
231
|
+
--_on: var(--nw-on-warning);
|
|
232
|
+
--_soft: var(--nw-warning-soft);
|
|
233
|
+
background-color: var(--nw-warning-soft);
|
|
234
|
+
}
|
|
235
|
+
.nw-table :is(tr, th, td).nw-table-danger {
|
|
236
|
+
--_intent: var(--nw-danger);
|
|
237
|
+
--_on: var(--nw-on-danger);
|
|
238
|
+
--_soft: var(--nw-danger-soft);
|
|
239
|
+
background-color: var(--nw-danger-soft);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* Opt-in: the cell's text carries its intent color too (uses --_intent from the intent class). */
|
|
243
|
+
.nw-table :is(tr, th, td).nw-table-ink {
|
|
244
|
+
color: color-mix(in oklab, var(--_intent) var(--nw-soft-ink), var(--nw-fg));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/* Scroll wrapper and sticky header ---------------------------------------------------------- */
|
|
248
|
+
|
|
249
|
+
.nw-table-wrap {
|
|
250
|
+
position: relative;
|
|
251
|
+
inline-size: 100%;
|
|
252
|
+
overflow: auto;
|
|
253
|
+
overscroll-behavior: contain;
|
|
254
|
+
border: 1px solid var(--nw-line-strong);
|
|
255
|
+
border-radius: var(--nw-radius-md);
|
|
256
|
+
background-color: var(--nw-panel);
|
|
257
|
+
scrollbar-width: thin;
|
|
258
|
+
}
|
|
259
|
+
.nw-table-wrap > .nw-table {
|
|
260
|
+
--_surface: var(--nw-panel);
|
|
261
|
+
}
|
|
262
|
+
.nw-table-wrap > .nw-table > tbody > tr:last-child > * {
|
|
263
|
+
border-block-end: 0;
|
|
264
|
+
}
|
|
265
|
+
.nw-table-sticky thead th {
|
|
266
|
+
position: sticky;
|
|
267
|
+
inset-block-start: 0;
|
|
268
|
+
z-index: 1;
|
|
269
|
+
background-color: var(--_surface);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
@media (forced-colors: active) {
|
|
273
|
+
.nw-table :where(th, td),
|
|
274
|
+
.nw-table-wrap {
|
|
275
|
+
border-color: CanvasText;
|
|
276
|
+
}
|
|
277
|
+
.nw-table tbody tr:is([aria-selected='true'], [data-selected]) > * {
|
|
278
|
+
background: Highlight;
|
|
279
|
+
color: HighlightText;
|
|
280
|
+
}
|
|
281
|
+
.nw-table-striped tbody tr:nth-child(even) > *,
|
|
282
|
+
.nw-table-hover tbody tr:hover > *,
|
|
283
|
+
.nw-table :is(tr, th, td)[class*='nw-table-'] {
|
|
284
|
+
background: transparent;
|
|
285
|
+
}
|
|
286
|
+
.nw-table-sticky thead th {
|
|
287
|
+
background: Canvas;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|