@ropav/styles 0.5.0 → 0.6.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/README.md +79 -0
- package/dist/components/accordion.css +1 -9
- package/dist/components/alert-dialog.css +0 -12
- package/dist/components/autocomplete.css +25 -35
- package/dist/components/breadcrumbs.css +9 -2
- package/dist/components/button-group.css +0 -4
- package/dist/components/button.css +3 -7
- package/dist/components/calendar-year-picker.css +19 -7
- package/dist/components/calendar.css +46 -21
- package/dist/components/checkbox.css +54 -56
- package/dist/components/chip.css +3 -1
- package/dist/components/close-button.css +7 -6
- package/dist/components/color-area.css +6 -6
- package/dist/components/color-input-group.css +10 -27
- package/dist/components/color-picker.css +1 -5
- package/dist/components/color-slider.css +14 -12
- package/dist/components/color-swatch-picker.css +2 -85
- package/dist/components/color-swatch.css +1 -1
- package/dist/components/combo-box.css +13 -3
- package/dist/components/date-input-group.css +34 -32
- package/dist/components/date-picker.css +1 -5
- package/dist/components/date-range-picker.css +1 -5
- package/dist/components/disclosure.css +0 -4
- package/dist/components/drawer.css +4 -8
- package/dist/components/drop-zone/drop-zone.styles.d.ts +34 -0
- package/dist/components/drop-zone/drop-zone.styles.d.ts.map +1 -0
- package/dist/components/drop-zone/drop-zone.styles.js +8 -0
- package/dist/components/drop-zone/index.d.ts +2 -0
- package/dist/components/drop-zone/index.d.ts.map +1 -0
- package/dist/components/drop-zone/index.js +2 -0
- package/dist/components/drop-zone.css +78 -0
- package/dist/components/dropdown.css +0 -4
- package/dist/components/error-message.css +0 -4
- package/dist/components/field-error.css +0 -4
- package/dist/components/index.css +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input-group.css +12 -37
- package/dist/components/input-otp.css +14 -26
- package/dist/components/input.css +11 -32
- package/dist/components/kbd.css +3 -1
- package/dist/components/label.css +7 -2
- package/dist/components/link.css +13 -11
- package/dist/components/list-box-item.css +4 -10
- package/dist/components/menu-item.css +4 -10
- package/dist/components/meter.css +8 -16
- package/dist/components/modal.css +0 -12
- package/dist/components/number-field.css +23 -35
- package/dist/components/pagination.css +0 -4
- package/dist/components/popover.css +0 -4
- package/dist/components/progress-bar/progress-bar.styles.d.ts +36 -0
- package/dist/components/progress-bar/progress-bar.styles.d.ts.map +1 -1
- package/dist/components/progress-bar/progress-bar.styles.js +10 -0
- package/dist/components/progress-bar.css +82 -16
- package/dist/components/progress-circle.css +0 -4
- package/dist/components/radio.css +7 -9
- package/dist/components/range-calendar.css +73 -31
- package/dist/components/search-field.css +11 -28
- package/dist/components/segmented-control.css +9 -14
- package/dist/components/select.css +18 -32
- package/dist/components/sidebar/sidebar.styles.d.ts +36 -0
- package/dist/components/sidebar/sidebar.styles.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar.styles.js +14 -1
- package/dist/components/sidebar.css +132 -38
- package/dist/components/slider.css +10 -11
- package/dist/components/splitter.css +44 -36
- package/dist/components/switch.css +16 -15
- package/dist/components/table.css +69 -27
- package/dist/components/tabs.css +8 -19
- package/dist/components/tag.css +32 -24
- package/dist/components/textarea.css +11 -32
- package/dist/components/toast.css +3 -1
- package/dist/components/toggle-button-group.css +0 -4
- package/dist/components/toggle-button.css +2 -6
- package/dist/components/tooltip.css +0 -4
- package/dist/components/typography.css +12 -4
- package/dist/components/virtualizer.css +11 -3
- package/dist/index.js +2 -1
- package/dist/ropav.min.css +1 -1
- package/dist/themes/airbnb.css +6 -4
- package/dist/themes/coinbase.css +6 -4
- package/dist/themes/default.css +24 -4
- package/dist/themes/discord.css +6 -4
- package/dist/themes/hero.css +24 -4
- package/dist/themes/lavender.css +6 -4
- package/dist/themes/mint.css +6 -4
- package/dist/themes/netflix.css +6 -4
- package/dist/themes/rabbit.css +6 -4
- package/dist/themes/shared/theme.css +1 -0
- package/dist/themes/sky.css +6 -4
- package/dist/themes/spotify.css +6 -4
- package/dist/themes/uber.css +6 -4
- package/package.json +1 -1
- package/src/components/drop-zone/drop-zone.styles.ts +12 -0
- package/src/components/drop-zone/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/components/progress-bar/progress-bar.styles.ts +14 -0
- package/src/components/sidebar/sidebar.styles.ts +23 -0
|
@@ -41,6 +41,18 @@ export declare const sidebarVariants: import("tailwind-variants").TVReturnType<{
|
|
|
41
41
|
panel: string;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
+
variant: {
|
|
45
|
+
floating: {
|
|
46
|
+
panel: string;
|
|
47
|
+
rail: string;
|
|
48
|
+
};
|
|
49
|
+
inset: {
|
|
50
|
+
inset: string;
|
|
51
|
+
panel: string;
|
|
52
|
+
rail: string;
|
|
53
|
+
};
|
|
54
|
+
sidebar: {};
|
|
55
|
+
};
|
|
44
56
|
}, {
|
|
45
57
|
base: string;
|
|
46
58
|
content: string;
|
|
@@ -103,6 +115,18 @@ export declare const sidebarVariants: import("tailwind-variants").TVReturnType<{
|
|
|
103
115
|
panel: string;
|
|
104
116
|
};
|
|
105
117
|
};
|
|
118
|
+
variant: {
|
|
119
|
+
floating: {
|
|
120
|
+
panel: string;
|
|
121
|
+
rail: string;
|
|
122
|
+
};
|
|
123
|
+
inset: {
|
|
124
|
+
inset: string;
|
|
125
|
+
panel: string;
|
|
126
|
+
rail: string;
|
|
127
|
+
};
|
|
128
|
+
sidebar: {};
|
|
129
|
+
};
|
|
106
130
|
}, {
|
|
107
131
|
base: string;
|
|
108
132
|
content: string;
|
|
@@ -165,6 +189,18 @@ export declare const sidebarVariants: import("tailwind-variants").TVReturnType<{
|
|
|
165
189
|
panel: string;
|
|
166
190
|
};
|
|
167
191
|
};
|
|
192
|
+
variant: {
|
|
193
|
+
floating: {
|
|
194
|
+
panel: string;
|
|
195
|
+
rail: string;
|
|
196
|
+
};
|
|
197
|
+
inset: {
|
|
198
|
+
inset: string;
|
|
199
|
+
panel: string;
|
|
200
|
+
rail: string;
|
|
201
|
+
};
|
|
202
|
+
sidebar: {};
|
|
203
|
+
};
|
|
168
204
|
}, {
|
|
169
205
|
base: string;
|
|
170
206
|
content: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.styles.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/sidebar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AActD,eAAO,MAAM,eAAe;;
|
|
1
|
+
{"version":3,"file":"sidebar.styles.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/sidebar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AActD,eAAO,MAAM,eAAe;;QA6BtB,IAAI;YACF,KAAK;;QAEP,IAAI;YACF,KAAK;;QAEP,SAAS;YACP,KAAK;;;;QAMP,IAAI;YACF,KAAK;;;;QAMP,IAAI;YACF,OAAO;;;;QAMT,IAAI;YACF,IAAI;;;;QAMN,IAAI;YACF,IAAI;;;;QAIN,IAAI;YACF,IAAI;YACJ,KAAK;;QAEP,KAAK;YACH,IAAI;YACJ,KAAK;;;;QAcP,QAAQ;YACN,KAAK;YACL,IAAI;;QAEN,KAAK;YACH,KAAK;YACL,KAAK;YACL,IAAI;;QAEN,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGX,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -3,7 +3,8 @@ import { tv } from "tailwind-variants";
|
|
|
3
3
|
const sidebarVariants = tv({
|
|
4
4
|
defaultVariants: {
|
|
5
5
|
collapsible: "icon",
|
|
6
|
-
side: "left"
|
|
6
|
+
side: "left",
|
|
7
|
+
variant: "sidebar"
|
|
7
8
|
},
|
|
8
9
|
slots: {
|
|
9
10
|
base: "sidebar",
|
|
@@ -45,6 +46,18 @@ const sidebarVariants = tv({
|
|
|
45
46
|
base: "sidebar--right",
|
|
46
47
|
panel: "sidebar__panel--right"
|
|
47
48
|
}
|
|
49
|
+
},
|
|
50
|
+
variant: {
|
|
51
|
+
floating: {
|
|
52
|
+
panel: "sidebar__panel--floating",
|
|
53
|
+
rail: "sidebar__rail--quiet"
|
|
54
|
+
},
|
|
55
|
+
inset: {
|
|
56
|
+
inset: "sidebar__inset--card",
|
|
57
|
+
panel: "sidebar__panel--bare",
|
|
58
|
+
rail: "sidebar__rail--quiet"
|
|
59
|
+
},
|
|
60
|
+
sidebar: {}
|
|
48
61
|
}
|
|
49
62
|
}
|
|
50
63
|
});
|
|
@@ -19,11 +19,25 @@
|
|
|
19
19
|
* stylesheet reads. */
|
|
20
20
|
--sidebar-width: calc(var(--spacing) * 64);
|
|
21
21
|
--sidebar-width-icon: calc(var(--spacing) * 14);
|
|
22
|
+
/* The gap a card stands off by and the corner it wears, for the variants where something is
|
|
23
|
+
* a card: the panel under `--floating`, the inset under `--card`. One pair rather than two,
|
|
24
|
+
* because a variant makes exactly one of them a card and a second set would be the same two
|
|
25
|
+
* numbers under a name that is wrong half the time.
|
|
26
|
+
*
|
|
27
|
+
* The corner is the one every container in the library wears, so a sidebar's card and a Card
|
|
28
|
+
* dropped beside it round the same. */
|
|
29
|
+
--sidebar-card-gap: calc(var(--spacing) * 2);
|
|
30
|
+
--sidebar-card-radius: min(32px, var(--component-radius));
|
|
22
31
|
/* The rail's line and the grab area around it, matching `splitter.css` — same hairline, same
|
|
23
32
|
* reasoning about a target no one can hit, same wait before it flares. */
|
|
24
33
|
--sidebar-rail-gutter: 1px;
|
|
25
34
|
--sidebar-rail-target: 15px;
|
|
26
35
|
--sidebar-highlight-delay: 500ms;
|
|
36
|
+
/* What the line is painted with, at rest and lit. Separate properties so a caller can retune one
|
|
37
|
+
* state without flattening the rest onto a single colour. */
|
|
38
|
+
--sidebar-rail-line: var(--separator);
|
|
39
|
+
--sidebar-rail-line-hover: var(--accent);
|
|
40
|
+
--sidebar-rail-line-dragging: var(--sidebar-rail-line-hover);
|
|
27
41
|
|
|
28
42
|
@apply isolate flex h-full w-full;
|
|
29
43
|
}
|
|
@@ -51,10 +65,6 @@
|
|
|
51
65
|
|
|
52
66
|
inline-size: var(--sidebar-width);
|
|
53
67
|
|
|
54
|
-
/**
|
|
55
|
-
* Transitions
|
|
56
|
-
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
57
|
-
*/
|
|
58
68
|
transition: inline-size 200ms var(--ease-out);
|
|
59
69
|
@apply motion-reduce:transition-none;
|
|
60
70
|
}
|
|
@@ -76,6 +86,27 @@
|
|
|
76
86
|
@apply border-s border-separator/50;
|
|
77
87
|
}
|
|
78
88
|
|
|
89
|
+
/* Neither fill nor line: the panel has stopped being a surface, and the inset beside it is the one
|
|
90
|
+
* that paints. After the side modifiers, whose border this has to beat at equal specificity, and
|
|
91
|
+
* before `--drawer`, which stays last for the reason given there. */
|
|
92
|
+
.sidebar__panel--bare {
|
|
93
|
+
@apply border-0 bg-transparent;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* The panel as a card of its own, standing off the page on every side. A whole border rather than
|
|
97
|
+
* the side modifiers' single edge, which at equal specificity is enough to overwrite it — no
|
|
98
|
+
* `border-0` first.
|
|
99
|
+
*
|
|
100
|
+
* The margin is what the rail then sits in, and that gap is already dividing the two, which is why
|
|
101
|
+
* this variant quiets the line: a hairline inside it would be a second answer to the same question.
|
|
102
|
+
*/
|
|
103
|
+
.sidebar__panel--floating {
|
|
104
|
+
@apply border border-separator/50 shadow-surface;
|
|
105
|
+
|
|
106
|
+
margin: var(--sidebar-card-gap);
|
|
107
|
+
border-radius: var(--sidebar-card-radius);
|
|
108
|
+
}
|
|
109
|
+
|
|
79
110
|
/* Collapsing to icons is the default, so the width it collapses to lives on the mode that has one
|
|
80
111
|
* and `--none` is the empty rule. */
|
|
81
112
|
.sidebar__panel--icon[data-collapsed="true"] {
|
|
@@ -93,18 +124,26 @@
|
|
|
93
124
|
@apply border-0 bg-transparent;
|
|
94
125
|
|
|
95
126
|
inline-size: 0;
|
|
127
|
+
/* And the standing-off a card variant asks for, which on a box no longer there is a gap held
|
|
128
|
+
* open around nothing — the same fault as the hairline, a little wider. */
|
|
129
|
+
margin: 0;
|
|
96
130
|
}
|
|
97
131
|
|
|
98
132
|
.sidebar__panel--none {
|
|
99
133
|
}
|
|
100
134
|
|
|
101
135
|
/* Inside a drawer the panel is no longer the surface — the dialog is, and it paints, sizes and
|
|
102
|
-
* slides itself. The panel gives all
|
|
103
|
-
*
|
|
136
|
+
* slides itself. The panel gives all of that up and becomes the column that fills what it was
|
|
137
|
+
* handed, the standing-off and the corner of a card variant included: the dialog is already the
|
|
138
|
+
* shape, and a card inset within it would be a second one drawn inside the first.
|
|
139
|
+
* Last of the panel's modifiers, so it beats the widths and the card geometry above at equal
|
|
140
|
+
* specificity. */
|
|
104
141
|
.sidebar__panel--drawer {
|
|
105
142
|
@apply size-full border-0 bg-transparent;
|
|
106
143
|
|
|
107
144
|
inline-size: auto;
|
|
145
|
+
margin: 0;
|
|
146
|
+
border-radius: 0;
|
|
108
147
|
transition: none;
|
|
109
148
|
}
|
|
110
149
|
|
|
@@ -183,15 +222,23 @@
|
|
|
183
222
|
========================================================================== */
|
|
184
223
|
|
|
185
224
|
.sidebar__item {
|
|
186
|
-
@apply relative flex min-h-9 w-full min-w-0 items-center justify-start gap-2 rounded-component px-2 text-sm font-medium
|
|
225
|
+
@apply relative flex min-h-9 w-full min-w-0 items-center justify-start gap-2 rounded-component px-2 text-sm font-medium no-underline outline-none no-highlight;
|
|
226
|
+
|
|
227
|
+
/* The row's fill and label, per state. A caller retuning the resting pair used to flatten the
|
|
228
|
+
* current page's along with it, since one declaration cannot tell the states apart. */
|
|
229
|
+
--sidebar-item-bg: transparent;
|
|
230
|
+
--sidebar-item-bg-hover: var(--state-layer);
|
|
231
|
+
--sidebar-item-bg-pressed: var(--sidebar-item-bg-hover);
|
|
232
|
+
--sidebar-item-bg-current: var(--accent-soft);
|
|
233
|
+
--sidebar-item-fg: var(--foreground);
|
|
234
|
+
--sidebar-item-fg-current: var(--accent-soft-foreground);
|
|
235
|
+
|
|
236
|
+
background-color: var(--sidebar-item-bg);
|
|
237
|
+
color: var(--sidebar-item-fg);
|
|
187
238
|
|
|
188
239
|
/* Cursor */
|
|
189
240
|
cursor: var(--cursor-interactive);
|
|
190
241
|
|
|
191
|
-
/**
|
|
192
|
-
* Transitions
|
|
193
|
-
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
194
|
-
*/
|
|
195
242
|
transition:
|
|
196
243
|
background-color 150ms var(--ease-out),
|
|
197
244
|
color 150ms var(--ease-out);
|
|
@@ -201,7 +248,7 @@
|
|
|
201
248
|
@media (hover: hover) {
|
|
202
249
|
&:hover,
|
|
203
250
|
&[data-hovered="true"] {
|
|
204
|
-
|
|
251
|
+
background-color: var(--sidebar-item-bg-hover);
|
|
205
252
|
}
|
|
206
253
|
}
|
|
207
254
|
|
|
@@ -214,14 +261,15 @@
|
|
|
214
261
|
/* Pressed state */
|
|
215
262
|
&:active,
|
|
216
263
|
&[data-pressed="true"] {
|
|
217
|
-
|
|
264
|
+
background-color: var(--sidebar-item-bg-pressed);
|
|
218
265
|
}
|
|
219
266
|
|
|
220
267
|
/* The current page. Its whole job is to be the one item that stands out, so the mode flattening
|
|
221
268
|
* the fill onto the page would take exactly the distinction away — hence `forced-selected`,
|
|
222
269
|
* which is what the rest of the library reaches for to say "this one". */
|
|
223
270
|
&[data-current="true"] {
|
|
224
|
-
|
|
271
|
+
background-color: var(--sidebar-item-bg-current);
|
|
272
|
+
color: var(--sidebar-item-fg-current);
|
|
225
273
|
|
|
226
274
|
@apply forced-selected;
|
|
227
275
|
}
|
|
@@ -337,10 +385,6 @@
|
|
|
337
385
|
height: var(--disclosure-panel-height);
|
|
338
386
|
overflow: clip;
|
|
339
387
|
|
|
340
|
-
/**
|
|
341
|
-
* Transitions
|
|
342
|
-
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
343
|
-
*/
|
|
344
388
|
transition:
|
|
345
389
|
height 200ms var(--ease-out-quad),
|
|
346
390
|
opacity 200ms var(--ease-out);
|
|
@@ -368,6 +412,27 @@
|
|
|
368
412
|
@apply relative flex min-w-0 flex-1 flex-col overflow-hidden bg-background;
|
|
369
413
|
}
|
|
370
414
|
|
|
415
|
+
/* The page beside a bare panel, and now the thing that paints. `--surface` rather than the base
|
|
416
|
+
* rule's `--background`: this stopped being the page's background the moment it became a plate
|
|
417
|
+
* lying on one, which is what `--surface` names.
|
|
418
|
+
*
|
|
419
|
+
* The first of this component's modifiers to *add* paint rather than drop it, which is what puts it
|
|
420
|
+
* in front of the forced-colors sweep as a box with something to lose. Under the mode the fill
|
|
421
|
+
* flattens onto the page behind it and the shadow goes, leaving the contents sitting loose — so it
|
|
422
|
+
* takes the same inset outline every container that paints takes, offset inwards so nothing moves
|
|
423
|
+
* and the radius above still holds it. */
|
|
424
|
+
.sidebar__inset--card {
|
|
425
|
+
@apply bg-surface text-surface-foreground shadow-surface;
|
|
426
|
+
|
|
427
|
+
margin: var(--sidebar-card-gap);
|
|
428
|
+
border-radius: var(--sidebar-card-radius);
|
|
429
|
+
|
|
430
|
+
@media (forced-colors: active) {
|
|
431
|
+
outline: 1px solid CanvasText;
|
|
432
|
+
outline-offset: -1px;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
371
436
|
/* ==========================================================================
|
|
372
437
|
Rail — the edge strip
|
|
373
438
|
========================================================================== */
|
|
@@ -385,9 +450,14 @@
|
|
|
385
450
|
inline-size: var(--sidebar-rail-gutter);
|
|
386
451
|
cursor: var(--cursor-interactive);
|
|
387
452
|
|
|
453
|
+
/* On the host, not in `::after` where the transition lives: the variant reaches a pseudo-element
|
|
454
|
+
* from its originating element, and appending its condition after `::after` matches nothing. */
|
|
455
|
+
@apply motion-reduce:transition-none;
|
|
456
|
+
|
|
388
457
|
&::after {
|
|
389
|
-
@apply pointer-events-none absolute inset-y-0 rounded-sm
|
|
458
|
+
@apply pointer-events-none absolute inset-y-0 rounded-sm content-[''];
|
|
390
459
|
|
|
460
|
+
background-color: var(--sidebar-rail-line);
|
|
391
461
|
inline-size: var(--sidebar-rail-gutter);
|
|
392
462
|
|
|
393
463
|
/* Flattened to `Canvas` the line stops existing rather than weakening — the whole part *is*
|
|
@@ -396,28 +466,15 @@
|
|
|
396
466
|
background-color: CanvasText;
|
|
397
467
|
}
|
|
398
468
|
|
|
399
|
-
/**
|
|
400
|
-
* Transitions
|
|
401
|
-
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
402
|
-
*/
|
|
403
469
|
transition:
|
|
404
470
|
background-color 150ms var(--ease-out),
|
|
405
471
|
inline-size 150ms var(--ease-out);
|
|
406
|
-
@apply motion-reduce:transition-none;
|
|
407
472
|
}
|
|
408
473
|
|
|
409
474
|
&:hover::after,
|
|
410
475
|
&[data-hovered="true"]::after,
|
|
411
476
|
&[data-dragging="true"]::after {
|
|
412
|
-
@apply bg-accent;
|
|
413
|
-
|
|
414
477
|
inline-size: calc(var(--sidebar-rail-gutter) * 2);
|
|
415
|
-
|
|
416
|
-
/* `bg-separator` and `bg-accent` both flatten to `Canvas`, so without this the resting and
|
|
417
|
-
* active states are byte-identical under the mode. */
|
|
418
|
-
@media (forced-colors: active) {
|
|
419
|
-
background-color: Highlight;
|
|
420
|
-
}
|
|
421
478
|
}
|
|
422
479
|
|
|
423
480
|
/* Delayed on the way in and immediate on the way out. A grab area many times the width of the
|
|
@@ -425,15 +482,27 @@
|
|
|
425
482
|
* reads as a twitch rather than an invitation. */
|
|
426
483
|
&:hover::after,
|
|
427
484
|
&[data-hovered="true"]::after {
|
|
485
|
+
background-color: var(--sidebar-rail-line-hover);
|
|
428
486
|
transition-delay: var(--sidebar-highlight-delay);
|
|
429
487
|
}
|
|
430
488
|
|
|
431
489
|
/* A drag under way is not in question, so it skips the wait. Last, because a drag usually starts
|
|
432
490
|
* from a hover and has to win. */
|
|
433
491
|
&[data-dragging="true"]::after {
|
|
492
|
+
background-color: var(--sidebar-rail-line-dragging);
|
|
434
493
|
transition-delay: 0ms;
|
|
435
494
|
}
|
|
436
495
|
|
|
496
|
+
/* Every lit colour flattens to the same `Canvas` as the resting one, so without this the two are
|
|
497
|
+
* byte-identical under the mode. One block for all of them, after the colours it overrides. */
|
|
498
|
+
@media (forced-colors: active) {
|
|
499
|
+
&:hover::after,
|
|
500
|
+
&[data-hovered="true"]::after,
|
|
501
|
+
&[data-dragging="true"]::after {
|
|
502
|
+
background-color: Highlight;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
437
506
|
&:focus-visible,
|
|
438
507
|
&[data-focus-visible="true"] {
|
|
439
508
|
@apply status-focused;
|
|
@@ -457,6 +526,26 @@
|
|
|
457
526
|
@apply cursor-col-resize;
|
|
458
527
|
}
|
|
459
528
|
|
|
529
|
+
/* Nothing left for the line to divide once something else is drawing that division — a card's own
|
|
530
|
+
* edge, or the gap it stands in — so it goes quiet in every state.
|
|
531
|
+
*
|
|
532
|
+
* Re-pointing the properties rather than restating the state rules, the shape `.input--secondary`
|
|
533
|
+
* takes: a `background-color` here would lose to `.sidebar__rail:hover::after` on specificity, and
|
|
534
|
+
* restating that set drifts the day a state is added to it.
|
|
535
|
+
*
|
|
536
|
+
* All three, and the third is not redundant. `--sidebar-rail-line-dragging` is declared on the
|
|
537
|
+
* shell as a `var()` of the hover one, so it is substituted there, against the shell's value; only
|
|
538
|
+
* the resolved colour reaches this far. Re-pointing hover here arrives too late for it, and a drag
|
|
539
|
+
* would still flare.
|
|
540
|
+
*
|
|
541
|
+
* The line comes back under Forced Colors Mode, on purpose: those blocks paint system keywords,
|
|
542
|
+
* which are not a component's to quiet. */
|
|
543
|
+
.sidebar__rail--quiet {
|
|
544
|
+
--sidebar-rail-line: transparent;
|
|
545
|
+
--sidebar-rail-line-hover: transparent;
|
|
546
|
+
--sidebar-rail-line-dragging: transparent;
|
|
547
|
+
}
|
|
548
|
+
|
|
460
549
|
/* The invisible hit area, overhanging the hairline on both sides. A negative `inset` rather than a
|
|
461
550
|
* transparent border, because Forced Colors Mode turns a transparent border-color opaque and every
|
|
462
551
|
* rail would render as a solid block. */
|
|
@@ -471,15 +560,19 @@
|
|
|
471
560
|
========================================================================== */
|
|
472
561
|
|
|
473
562
|
.sidebar__trigger {
|
|
474
|
-
@apply inline-flex size-8 shrink-0 items-center justify-center rounded-component
|
|
563
|
+
@apply inline-flex size-8 shrink-0 items-center justify-center rounded-component outline-none select-none no-highlight;
|
|
564
|
+
|
|
565
|
+
--sidebar-trigger-bg: transparent;
|
|
566
|
+
--sidebar-trigger-bg-hover: var(--state-layer);
|
|
567
|
+
--sidebar-trigger-fg: var(--muted);
|
|
568
|
+
--sidebar-trigger-fg-hover: var(--foreground);
|
|
569
|
+
|
|
570
|
+
background-color: var(--sidebar-trigger-bg);
|
|
571
|
+
color: var(--sidebar-trigger-fg);
|
|
475
572
|
|
|
476
573
|
/* Cursor */
|
|
477
574
|
cursor: var(--cursor-interactive);
|
|
478
575
|
|
|
479
|
-
/**
|
|
480
|
-
* Transitions
|
|
481
|
-
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
482
|
-
*/
|
|
483
576
|
transition:
|
|
484
577
|
background-color 150ms var(--ease-out),
|
|
485
578
|
color 150ms var(--ease-out);
|
|
@@ -493,7 +586,8 @@
|
|
|
493
586
|
@media (hover: hover) {
|
|
494
587
|
&:hover,
|
|
495
588
|
&[data-hovered="true"] {
|
|
496
|
-
|
|
589
|
+
background-color: var(--sidebar-trigger-bg-hover);
|
|
590
|
+
color: var(--sidebar-trigger-fg-hover);
|
|
497
591
|
}
|
|
498
592
|
}
|
|
499
593
|
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.slider__track {
|
|
24
|
-
@apply relative
|
|
24
|
+
@apply relative bg-default;
|
|
25
|
+
|
|
26
|
+
border-radius: min(32px, var(--component-radius));
|
|
25
27
|
|
|
26
28
|
grid-area: track;
|
|
27
29
|
|
|
@@ -46,7 +48,9 @@
|
|
|
46
48
|
|
|
47
49
|
.slider__thumb {
|
|
48
50
|
/* Flex container for centering pseudo-elements */
|
|
49
|
-
@apply absolute flex cursor-grab items-center justify-center
|
|
51
|
+
@apply absolute flex cursor-grab items-center justify-center bg-accent no-highlight;
|
|
52
|
+
|
|
53
|
+
border-radius: min(32px, var(--component-radius));
|
|
50
54
|
|
|
51
55
|
/* The wrapper is the fill colour in ordinary use, which hides it against the fill. Flattened
|
|
52
56
|
* to `Canvas` it would punch a hole through the fill instead, so it steps back and lets
|
|
@@ -55,10 +59,6 @@
|
|
|
55
59
|
background-color: transparent;
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
/**
|
|
59
|
-
* Transitions
|
|
60
|
-
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
61
|
-
*/
|
|
62
62
|
transition:
|
|
63
63
|
background-color 250ms var(--ease-smooth),
|
|
64
64
|
transform 250ms var(--ease-out),
|
|
@@ -67,9 +67,11 @@
|
|
|
67
67
|
|
|
68
68
|
/* after: Visible thumb element */
|
|
69
69
|
&::after {
|
|
70
|
-
@apply relative z-10
|
|
70
|
+
@apply relative z-10 bg-accent-foreground text-black shadow-field;
|
|
71
71
|
content: "";
|
|
72
72
|
|
|
73
|
+
border-radius: min(32px, var(--component-radius));
|
|
74
|
+
|
|
73
75
|
/* Both the knob's fill and the shadow that separates it from the track are gone under
|
|
74
76
|
* forced colors. `Canvas` inside a `CanvasText` ring reads against the bare track on one
|
|
75
77
|
* side and the `Highlight` fill on the other, which no single flat colour manages. */
|
|
@@ -79,10 +81,7 @@
|
|
|
79
81
|
outline-offset: -2px;
|
|
80
82
|
}
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
* Transitions
|
|
84
|
-
*/
|
|
85
|
-
@apply origin-center transition-all motion-reduce:transition-none;
|
|
84
|
+
@apply origin-center transition-all;
|
|
86
85
|
}
|
|
87
86
|
|
|
88
87
|
/* Dragging state - cursor changes and thumb scales down */
|
|
@@ -64,6 +64,14 @@
|
|
|
64
64
|
* every crossing reads as a twitch rather than an invitation. Waiting means only an approach that
|
|
65
65
|
* settles counts. */
|
|
66
66
|
--splitter-highlight-delay: 500ms;
|
|
67
|
+
/* What the line and the grip are painted with, at rest and lit. Separate properties so a caller
|
|
68
|
+
* can retune one state without flattening the rest onto a single colour. */
|
|
69
|
+
--splitter-line: var(--separator);
|
|
70
|
+
--splitter-line-hover: var(--accent);
|
|
71
|
+
--splitter-line-dragging: var(--splitter-line-hover);
|
|
72
|
+
--splitter-grip-bg: var(--separator);
|
|
73
|
+
--splitter-grip-bg-hover: var(--accent);
|
|
74
|
+
--splitter-grip-bg-dragging: var(--splitter-grip-bg-hover);
|
|
67
75
|
|
|
68
76
|
@apply relative z-10 flex shrink-0 grow-0 items-center justify-center self-stretch;
|
|
69
77
|
@apply bg-transparent outline-none select-none no-highlight;
|
|
@@ -71,8 +79,14 @@
|
|
|
71
79
|
/* The gesture is ours; the browser must not also pan or scroll from a drag on this. */
|
|
72
80
|
@apply touch-none;
|
|
73
81
|
|
|
82
|
+
/* On the host, not in `::after` where the transition lives: the variant reaches a pseudo-element
|
|
83
|
+
* from its originating element, and appending its condition after `::after` matches nothing. */
|
|
84
|
+
@apply motion-reduce:transition-none;
|
|
85
|
+
|
|
74
86
|
&::after {
|
|
75
|
-
@apply pointer-events-none absolute rounded-sm
|
|
87
|
+
@apply pointer-events-none absolute rounded-sm content-[''];
|
|
88
|
+
|
|
89
|
+
background-color: var(--splitter-line);
|
|
76
90
|
|
|
77
91
|
/* Flattened to `Canvas` the divider stops existing rather than weakening — the whole part
|
|
78
92
|
* *is* its background, which is why `separator.css` restates its colour the same way. */
|
|
@@ -80,58 +94,54 @@
|
|
|
80
94
|
background-color: CanvasText;
|
|
81
95
|
}
|
|
82
96
|
|
|
83
|
-
/**
|
|
84
|
-
* Transitions
|
|
85
|
-
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
86
|
-
*/
|
|
87
97
|
transition:
|
|
88
98
|
background-color 150ms var(--ease-out),
|
|
89
99
|
inline-size 150ms var(--ease-out),
|
|
90
100
|
block-size 150ms var(--ease-out);
|
|
91
|
-
@apply motion-reduce:transition-none;
|
|
92
101
|
}
|
|
93
102
|
|
|
103
|
+
/* Delayed on the way in and immediate on the way out: the delay lives here rather than in the
|
|
104
|
+
* base rule, so leaving drops the highlight at once and a pointer that only passes through never
|
|
105
|
+
* starts the transition at all. It covers the thickening too — both are the same flare. */
|
|
94
106
|
&:hover::after,
|
|
95
|
-
&[data-hovered="true"]::after
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
/* `bg-separator` and `bg-accent` both flatten to `Canvas`, so without this the resting and
|
|
100
|
-
* active states are byte-identical under the mode and grabbing the handle shows nothing. */
|
|
101
|
-
@media (forced-colors: active) {
|
|
102
|
-
background-color: Highlight;
|
|
103
|
-
}
|
|
107
|
+
&[data-hovered="true"]::after {
|
|
108
|
+
background-color: var(--splitter-line-hover);
|
|
109
|
+
transition-delay: var(--splitter-highlight-delay);
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
/* The grip answers to the same states as the line, and is reached as a direct child so a nested
|
|
107
113
|
* group's own grip is left alone. */
|
|
108
114
|
&:hover > .splitter__handle-grip,
|
|
109
|
-
&[data-hovered="true"] > .splitter__handle-grip,
|
|
110
|
-
&[data-dragging="true"] > .splitter__handle-grip {
|
|
111
|
-
@apply bg-accent;
|
|
112
|
-
|
|
113
|
-
@media (forced-colors: active) {
|
|
114
|
-
background-color: Highlight;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/* Delayed on the way in and immediate on the way out: the delay lives here rather than in the
|
|
119
|
-
* base rule, so leaving drops the highlight at once and a pointer that only passes through never
|
|
120
|
-
* starts the transition at all. It covers the thickening too — both are the same flare. */
|
|
121
|
-
&:hover::after,
|
|
122
|
-
&[data-hovered="true"]::after,
|
|
123
|
-
&:hover > .splitter__handle-grip,
|
|
124
115
|
&[data-hovered="true"] > .splitter__handle-grip {
|
|
116
|
+
background-color: var(--splitter-grip-bg-hover);
|
|
125
117
|
transition-delay: var(--splitter-highlight-delay);
|
|
126
118
|
}
|
|
127
119
|
|
|
128
120
|
/* Once a drag is under way the intent is not in question, so it skips the wait. Last, because a
|
|
129
121
|
* drag usually starts from a hover and has to win. */
|
|
130
|
-
&[data-dragging="true"]::after
|
|
122
|
+
&[data-dragging="true"]::after {
|
|
123
|
+
background-color: var(--splitter-line-dragging);
|
|
124
|
+
transition-delay: 0ms;
|
|
125
|
+
}
|
|
126
|
+
|
|
131
127
|
&[data-dragging="true"] > .splitter__handle-grip {
|
|
128
|
+
background-color: var(--splitter-grip-bg-dragging);
|
|
132
129
|
transition-delay: 0ms;
|
|
133
130
|
}
|
|
134
131
|
|
|
132
|
+
/* Every lit colour flattens to the same `Canvas` as the resting one, so without this grabbing
|
|
133
|
+
* the handle shows nothing. One block for both parts, after the colours it overrides. */
|
|
134
|
+
@media (forced-colors: active) {
|
|
135
|
+
&:hover::after,
|
|
136
|
+
&[data-hovered="true"]::after,
|
|
137
|
+
&[data-dragging="true"]::after,
|
|
138
|
+
&:hover > .splitter__handle-grip,
|
|
139
|
+
&[data-hovered="true"] > .splitter__handle-grip,
|
|
140
|
+
&[data-dragging="true"] > .splitter__handle-grip {
|
|
141
|
+
background-color: Highlight;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
135
145
|
&:focus-visible,
|
|
136
146
|
&[data-focus-visible="true"] {
|
|
137
147
|
@apply status-focused;
|
|
@@ -168,7 +178,9 @@
|
|
|
168
178
|
* Sized from custom properties rather than utilities so a theme can retune the pill without
|
|
169
179
|
* restating both axes in both orientations. */
|
|
170
180
|
.splitter__handle-grip {
|
|
171
|
-
@apply pointer-events-none absolute rounded-full
|
|
181
|
+
@apply pointer-events-none absolute rounded-full;
|
|
182
|
+
|
|
183
|
+
background-color: var(--splitter-grip-bg);
|
|
172
184
|
|
|
173
185
|
/* The whole part *is* its background, so the mode flattening it onto the page removes the grip
|
|
174
186
|
* rather than weakening it — the same reason the line restates its colour. */
|
|
@@ -176,10 +188,6 @@
|
|
|
176
188
|
background-color: CanvasText;
|
|
177
189
|
}
|
|
178
190
|
|
|
179
|
-
/**
|
|
180
|
-
* Transitions
|
|
181
|
-
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
182
|
-
*/
|
|
183
191
|
transition: background-color 150ms var(--ease-out);
|
|
184
192
|
@apply motion-reduce:transition-none;
|
|
185
193
|
}
|