@ropav/styles 0.3.0 → 0.5.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 +160 -19
- package/dist/components/accordion.css +12 -5
- package/dist/components/alert-dialog.css +1 -1
- package/dist/components/alert.css +9 -1
- package/dist/components/autocomplete/autocomplete.styles.d.ts +33 -0
- package/dist/components/autocomplete/autocomplete.styles.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete.styles.js +12 -0
- package/dist/components/autocomplete.css +39 -3
- package/dist/components/avatar.css +9 -0
- package/dist/components/badge.css +7 -0
- package/dist/components/button-group.css +6 -6
- package/dist/components/button.css +34 -11
- package/dist/components/calendar-year-picker.css +2 -1
- package/dist/components/calendar.css +8 -0
- package/dist/components/card.css +22 -1
- package/dist/components/chip.css +21 -0
- package/dist/components/close-button.css +8 -0
- package/dist/components/color-input-group/color-input-group.styles.d.ts +27 -0
- package/dist/components/color-input-group/color-input-group.styles.d.ts.map +1 -1
- package/dist/components/color-input-group/color-input-group.styles.js +6 -0
- package/dist/components/color-input-group.css +30 -1
- package/dist/components/color-swatch-picker.css +11 -0
- package/dist/components/combo-box/combo-box.styles.d.ts +27 -0
- package/dist/components/combo-box/combo-box.styles.d.ts.map +1 -1
- package/dist/components/combo-box/combo-box.styles.js +17 -7
- package/dist/components/combo-box.css +21 -1
- package/dist/components/date-input-group/date-input-group.styles.d.ts +27 -0
- package/dist/components/date-input-group/date-input-group.styles.d.ts.map +1 -1
- package/dist/components/date-input-group/date-input-group.styles.js +6 -0
- package/dist/components/date-input-group.css +30 -1
- package/dist/components/dropdown/dropdown.styles.d.ts.map +1 -1
- package/dist/components/dropdown/dropdown.styles.js +1 -1
- package/dist/components/dropdown.css +17 -12
- package/dist/components/index.css +4 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/input.styles.d.ts +15 -0
- package/dist/components/input/input.styles.d.ts.map +1 -1
- package/dist/components/input/input.styles.js +6 -0
- package/dist/components/input-group/input-group.styles.d.ts +27 -0
- package/dist/components/input-group/input-group.styles.d.ts.map +1 -1
- package/dist/components/input-group/input-group.styles.js +6 -0
- package/dist/components/input-group.css +32 -1
- package/dist/components/input.css +23 -1
- package/dist/components/list-box/list-box.styles.d.ts +15 -0
- package/dist/components/list-box/list-box.styles.d.ts.map +1 -1
- package/dist/components/list-box/list-box.styles.js +15 -5
- package/dist/components/list-box-item.css +4 -2
- package/dist/components/list-box.css +19 -0
- package/dist/components/menu/menu.styles.d.ts +19 -1
- package/dist/components/menu/menu.styles.d.ts.map +1 -1
- package/dist/components/menu/menu.styles.js +9 -1
- package/dist/components/menu.css +25 -0
- package/dist/components/meter.css +12 -0
- package/dist/components/modal.css +1 -1
- package/dist/components/number-field/number-field.styles.d.ts +27 -0
- package/dist/components/number-field/number-field.styles.d.ts.map +1 -1
- package/dist/components/number-field/number-field.styles.js +6 -0
- package/dist/components/number-field.css +68 -1
- package/dist/components/pagination.css +10 -6
- package/dist/components/popover.css +15 -1
- package/dist/components/progress-bar.css +12 -0
- package/dist/components/progress-circle.css +12 -0
- package/dist/components/radio.css +7 -0
- package/dist/components/range-calendar.css +28 -0
- package/dist/components/search-field/search-field.styles.d.ts +27 -0
- package/dist/components/search-field/search-field.styles.d.ts.map +1 -1
- package/dist/components/search-field/search-field.styles.js +6 -0
- package/dist/components/search-field.css +33 -1
- package/dist/components/segmented-control/index.d.ts +2 -0
- package/dist/components/segmented-control/index.d.ts.map +1 -0
- package/dist/components/segmented-control/index.js +2 -0
- package/dist/components/segmented-control/segmented-control.styles.d.ts +73 -0
- package/dist/components/segmented-control/segmented-control.styles.d.ts.map +1 -0
- package/dist/components/segmented-control/segmented-control.styles.js +27 -0
- package/dist/components/segmented-control.css +193 -0
- package/dist/components/select/select.styles.d.ts +33 -0
- package/dist/components/select/select.styles.d.ts.map +1 -1
- package/dist/components/select/select.styles.js +12 -0
- package/dist/components/select.css +40 -3
- package/dist/components/separator.css +18 -1
- package/dist/components/sidebar/index.d.ts +2 -0
- package/dist/components/sidebar/index.d.ts.map +1 -0
- package/dist/components/sidebar/index.js +2 -0
- package/dist/components/sidebar/sidebar.styles.d.ts +190 -0
- package/dist/components/sidebar/sidebar.styles.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar.styles.js +52 -0
- package/dist/components/sidebar.css +510 -0
- package/dist/components/skeleton.css +9 -0
- package/dist/components/slider.css +61 -0
- package/dist/components/splitter/index.d.ts +2 -0
- package/dist/components/splitter/index.d.ts.map +1 -0
- package/dist/components/splitter/index.js +2 -0
- package/dist/components/splitter/splitter.styles.d.ts +61 -0
- package/dist/components/splitter/splitter.styles.d.ts.map +1 -0
- package/dist/components/splitter/splitter.styles.js +26 -0
- package/dist/components/splitter.css +241 -0
- package/dist/components/surface.css +24 -0
- package/dist/components/switch.css +30 -0
- package/dist/components/table.css +11 -3
- package/dist/components/tabs.css +30 -2
- package/dist/components/tag.css +10 -0
- package/dist/components/textarea/textarea.styles.d.ts +15 -0
- package/dist/components/textarea/textarea.styles.d.ts.map +1 -1
- package/dist/components/textarea/textarea.styles.js +6 -0
- package/dist/components/textarea.css +23 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toggle-button-group.css +7 -7
- package/dist/components/toggle-button.css +17 -11
- package/dist/components/toolbar.css +8 -1
- package/dist/components/tooltip.css +15 -2
- package/dist/components/typography.css +21 -0
- package/dist/components/virtualizer/index.d.ts +2 -0
- package/dist/components/virtualizer/index.d.ts.map +1 -0
- package/dist/components/virtualizer/index.js +2 -0
- package/dist/components/virtualizer/virtualizer.styles.d.ts +44 -0
- package/dist/components/virtualizer/virtualizer.styles.d.ts.map +1 -0
- package/dist/components/virtualizer/virtualizer.styles.js +15 -0
- package/dist/components/virtualizer.css +64 -0
- package/dist/index.css +7 -2
- package/dist/index.js +5 -1
- package/dist/ropav.min.css +2 -2
- package/dist/themes/airbnb.css +231 -0
- package/dist/themes/all.css +17 -0
- package/dist/themes/coinbase.css +231 -0
- package/dist/themes/{default/variables.css → default.css} +28 -9
- package/dist/themes/discord.css +231 -0
- package/dist/themes/hero.css +262 -0
- package/dist/themes/lavender.css +231 -0
- package/dist/themes/mint.css +231 -0
- package/dist/themes/netflix.css +231 -0
- package/dist/themes/rabbit.css +231 -0
- package/dist/themes/shared/theme.css +19 -2
- package/dist/themes/sky.css +231 -0
- package/dist/themes/spotify.css +231 -0
- package/dist/themes/uber.css +231 -0
- package/dist/utilities/index.css +97 -0
- package/dist/variants/index.css +5 -15
- package/package.json +2 -3
- package/src/components/autocomplete/autocomplete.styles.ts +12 -0
- package/src/components/color-input-group/color-input-group.styles.ts +10 -0
- package/src/components/combo-box/combo-box.styles.ts +12 -0
- package/src/components/date-input-group/date-input-group.styles.ts +10 -0
- package/src/components/dropdown/dropdown.styles.ts +3 -1
- package/src/components/index.ts +4 -0
- package/src/components/input/input.styles.ts +6 -0
- package/src/components/input-group/input-group.styles.ts +10 -0
- package/src/components/list-box/list-box.styles.ts +6 -0
- package/src/components/menu/menu.styles.ts +10 -0
- package/src/components/number-field/number-field.styles.ts +10 -0
- package/src/components/search-field/search-field.styles.ts +10 -0
- package/src/components/segmented-control/index.ts +1 -0
- package/src/components/segmented-control/segmented-control.styles.ts +37 -0
- package/src/components/select/select.styles.ts +12 -0
- package/src/components/sidebar/index.ts +1 -0
- package/src/components/sidebar/sidebar.styles.ts +94 -0
- package/src/components/splitter/index.ts +1 -0
- package/src/components/splitter/splitter.styles.ts +44 -0
- package/src/components/textarea/textarea.styles.ts +6 -0
- package/src/components/virtualizer/index.ts +1 -0
- package/src/components/virtualizer/virtualizer.styles.ts +15 -0
- package/dist/themes/default/components/index.css +0 -6
- package/dist/themes/default/index.css +0 -8
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { VariantProps } from "tailwind-variants";
|
|
2
|
+
export declare const splitterVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
orientation: {
|
|
4
|
+
horizontal: {
|
|
5
|
+
base: string;
|
|
6
|
+
handle: string;
|
|
7
|
+
handleGrip: string;
|
|
8
|
+
};
|
|
9
|
+
vertical: {
|
|
10
|
+
base: string;
|
|
11
|
+
handle: string;
|
|
12
|
+
handleGrip: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}, {
|
|
16
|
+
base: string;
|
|
17
|
+
handle: string;
|
|
18
|
+
handleGrip: string;
|
|
19
|
+
handleTarget: string;
|
|
20
|
+
panel: string;
|
|
21
|
+
}, undefined, {
|
|
22
|
+
orientation: {
|
|
23
|
+
horizontal: {
|
|
24
|
+
base: string;
|
|
25
|
+
handle: string;
|
|
26
|
+
handleGrip: string;
|
|
27
|
+
};
|
|
28
|
+
vertical: {
|
|
29
|
+
base: string;
|
|
30
|
+
handle: string;
|
|
31
|
+
handleGrip: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}, {
|
|
35
|
+
base: string;
|
|
36
|
+
handle: string;
|
|
37
|
+
handleGrip: string;
|
|
38
|
+
handleTarget: string;
|
|
39
|
+
panel: string;
|
|
40
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
41
|
+
orientation: {
|
|
42
|
+
horizontal: {
|
|
43
|
+
base: string;
|
|
44
|
+
handle: string;
|
|
45
|
+
handleGrip: string;
|
|
46
|
+
};
|
|
47
|
+
vertical: {
|
|
48
|
+
base: string;
|
|
49
|
+
handle: string;
|
|
50
|
+
handleGrip: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}, {
|
|
54
|
+
base: string;
|
|
55
|
+
handle: string;
|
|
56
|
+
handleGrip: string;
|
|
57
|
+
handleTarget: string;
|
|
58
|
+
panel: string;
|
|
59
|
+
}>>;
|
|
60
|
+
export type SplitterVariants = VariantProps<typeof splitterVariants>;
|
|
61
|
+
//# sourceMappingURL=splitter.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splitter.styles.d.ts","sourceRoot":"","sources":["../../../src/components/splitter/splitter.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAgBtD,eAAO,MAAM,gBAAgB;;QAavB,UAAU;YACR,IAAI;YACJ,MAAM;YACN,UAAU;;QAEZ,QAAQ;YACN,IAAI;YACJ,MAAM;YACN,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIhB,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
//#region src/components/splitter/splitter.styles.ts
|
|
3
|
+
const splitterVariants = tv({
|
|
4
|
+
defaultVariants: { orientation: "horizontal" },
|
|
5
|
+
slots: {
|
|
6
|
+
base: "splitter",
|
|
7
|
+
handle: "splitter__handle",
|
|
8
|
+
handleGrip: "splitter__handle-grip",
|
|
9
|
+
handleTarget: "splitter__handle-target",
|
|
10
|
+
panel: "splitter__panel"
|
|
11
|
+
},
|
|
12
|
+
variants: { orientation: {
|
|
13
|
+
horizontal: {
|
|
14
|
+
base: "splitter--horizontal",
|
|
15
|
+
handle: "splitter__handle--horizontal",
|
|
16
|
+
handleGrip: "splitter__handle-grip--horizontal"
|
|
17
|
+
},
|
|
18
|
+
vertical: {
|
|
19
|
+
base: "splitter--vertical",
|
|
20
|
+
handle: "splitter__handle--vertical",
|
|
21
|
+
handleGrip: "splitter__handle-grip--vertical"
|
|
22
|
+
}
|
|
23
|
+
} }
|
|
24
|
+
});
|
|
25
|
+
//#endregion
|
|
26
|
+
export { splitterVariants };
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/* Splitter styles */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Orientation is a modifier class rather than a `[data-orientation]` descendant selector, and
|
|
5
|
+
* that is not a style preference. A splitter nests — a vertical group inside a panel of a
|
|
6
|
+
* horizontal one is the ordinary case — so `.splitter[data-orientation="horizontal"]
|
|
7
|
+
* .splitter__handle` would reach the inner group's handle as well as its own and lay it out on
|
|
8
|
+
* the wrong axis. Every rule below therefore sits on the part it styles.
|
|
9
|
+
*
|
|
10
|
+
* The modifier also buys the Storybook forced-colors sweep, which collects `[class*='--']` and a
|
|
11
|
+
* fixed state list that does not include `data-dragging`. Without one the two parts that paint
|
|
12
|
+
* anything — the handle and its grip — would never be audited.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
.splitter {
|
|
16
|
+
@apply isolate flex h-full w-full;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.splitter--horizontal {
|
|
20
|
+
@apply flex-row;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.splitter--vertical {
|
|
24
|
+
@apply flex-col;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* A flex item's automatic minimum is its content, so without `min-w-0`/`min-h-0` a panel holding
|
|
28
|
+
* a long word or a wide table cannot be dragged narrower than that content and the drag silently
|
|
29
|
+
* stops responding partway along the track.
|
|
30
|
+
*
|
|
31
|
+
* `flex-1` is the unmanaged fallback only. The component writes the whole `flex` shorthand inline;
|
|
32
|
+
* an inline `flex-basis` alone would leave this `flex-grow: 1` in place and the panel would grow
|
|
33
|
+
* straight back past the size it was given. */
|
|
34
|
+
.splitter__panel {
|
|
35
|
+
@apply relative min-h-0 min-w-0 flex-1 overflow-hidden;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* The flex item is the gutter and paints nothing itself. The line you see is `::after`, absolutely
|
|
39
|
+
* positioned, which is what lets it thicken on hover without the gutter changing width and
|
|
40
|
+
* reflowing both panels by a pixel. `.slider__thumb::after` carries its knob the same way. */
|
|
41
|
+
.splitter__handle {
|
|
42
|
+
/* The gutter is the line, with nothing either side of it. Dead space inside the gutter shows up
|
|
43
|
+
* as a gap wherever a nested group's divider meets this one — the panel between them clips its own
|
|
44
|
+
* contents, so the inner line cannot reach across to close it. `1px` rather than a spacing step,
|
|
45
|
+
* the same hairline `separator.css` writes as `h-px`/`w-px`, and both the flex item and `::after`
|
|
46
|
+
* are measured from it so a retuned token cannot let the gap back in. */
|
|
47
|
+
--splitter-gutter: 1px;
|
|
48
|
+
/* The whole grab area, gutter included — a hairline is not a target anyone can hit, so the target
|
|
49
|
+
* part overhangs it and every hit test lands there. Held as the total rather than as the overhang
|
|
50
|
+
* because the total is the number that means something, and it is off the spacing grid for the
|
|
51
|
+
* same reason: what is being sized is a target, not a step.
|
|
52
|
+
*
|
|
53
|
+
* Under the 24px WCAG 2.5.8 asks for, resting on that rule's spacing exception instead — what
|
|
54
|
+
* flanks a divider is a panel, not another target, so no two targets' circles can meet here. The
|
|
55
|
+
* overhang is also panel edge that stops taking clicks, and a scrollbar sits exactly there, which
|
|
56
|
+
* is why this is kept tight rather than widened to the letter of the rule. */
|
|
57
|
+
--splitter-target: 15px;
|
|
58
|
+
/* The pill's short axis and its long one. It is positioned rather than laid out, so it straddles a
|
|
59
|
+
* gutter narrower than itself without the panels giving up a pixel. */
|
|
60
|
+
--splitter-grip-thickness: calc(var(--spacing) * 1);
|
|
61
|
+
--splitter-grip-length: calc(var(--spacing) * 6);
|
|
62
|
+
/* How long the pointer has to stay before the divider lights up. A grab area many times the width
|
|
63
|
+
* of the line is one a pointer crosses on its way somewhere else, and a divider that flares at
|
|
64
|
+
* every crossing reads as a twitch rather than an invitation. Waiting means only an approach that
|
|
65
|
+
* settles counts. */
|
|
66
|
+
--splitter-highlight-delay: 500ms;
|
|
67
|
+
|
|
68
|
+
@apply relative z-10 flex shrink-0 grow-0 items-center justify-center self-stretch;
|
|
69
|
+
@apply bg-transparent outline-none select-none no-highlight;
|
|
70
|
+
|
|
71
|
+
/* The gesture is ours; the browser must not also pan or scroll from a drag on this. */
|
|
72
|
+
@apply touch-none;
|
|
73
|
+
|
|
74
|
+
&::after {
|
|
75
|
+
@apply pointer-events-none absolute rounded-sm bg-separator content-[''];
|
|
76
|
+
|
|
77
|
+
/* Flattened to `Canvas` the divider stops existing rather than weakening — the whole part
|
|
78
|
+
* *is* its background, which is why `separator.css` restates its colour the same way. */
|
|
79
|
+
@media (forced-colors: active) {
|
|
80
|
+
background-color: CanvasText;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Transitions
|
|
85
|
+
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
86
|
+
*/
|
|
87
|
+
transition:
|
|
88
|
+
background-color 150ms var(--ease-out),
|
|
89
|
+
inline-size 150ms var(--ease-out),
|
|
90
|
+
block-size 150ms var(--ease-out);
|
|
91
|
+
@apply motion-reduce:transition-none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:hover::after,
|
|
95
|
+
&[data-hovered="true"]::after,
|
|
96
|
+
&[data-dragging="true"]::after {
|
|
97
|
+
@apply bg-accent;
|
|
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
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* The grip answers to the same states as the line, and is reached as a direct child so a nested
|
|
107
|
+
* group's own grip is left alone. */
|
|
108
|
+
&: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
|
+
&[data-hovered="true"] > .splitter__handle-grip {
|
|
125
|
+
transition-delay: var(--splitter-highlight-delay);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Once a drag is under way the intent is not in question, so it skips the wait. Last, because a
|
|
129
|
+
* drag usually starts from a hover and has to win. */
|
|
130
|
+
&[data-dragging="true"]::after,
|
|
131
|
+
&[data-dragging="true"] > .splitter__handle-grip {
|
|
132
|
+
transition-delay: 0ms;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&:focus-visible,
|
|
136
|
+
&[data-focus-visible="true"] {
|
|
137
|
+
@apply status-focused;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&[data-disabled="true"] {
|
|
141
|
+
@apply status-disabled;
|
|
142
|
+
|
|
143
|
+
/* `status-disabled` reaches `color` and `border-color`, and neither the line nor the grip is
|
|
144
|
+
* either of those. */
|
|
145
|
+
&::after,
|
|
146
|
+
& > .splitter__handle-grip {
|
|
147
|
+
@media (forced-colors: active) {
|
|
148
|
+
background-color: GrayText;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* The invisible hit area — named for the target size it exists to reach, and kept apart from the
|
|
155
|
+
* grip because that one is the part you can see. A negative `inset` rather than a transparent
|
|
156
|
+
* border: forced colors turns a transparent *border-color* opaque — the trap `slider.css` documents
|
|
157
|
+
* at both ends of its track — and a bordered target would render as two solid blocks flanking every
|
|
158
|
+
* divider. `inset` has no such behaviour, so this needs no forced-colors rule of its own. */
|
|
159
|
+
.splitter__handle-target {
|
|
160
|
+
@apply absolute inset-0 bg-transparent;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* The visible grab affordance, and only that — the gesture belongs to the handle, the hit area to
|
|
164
|
+
* the target. No insets: an absolutely positioned child of a flex container takes its static
|
|
165
|
+
* position from the container's own alignment, which is the same `items-center justify-center` that
|
|
166
|
+
* centres the line above. `drawer.css` carries its handle bar as a child element the same way.
|
|
167
|
+
*
|
|
168
|
+
* Sized from custom properties rather than utilities so a theme can retune the pill without
|
|
169
|
+
* restating both axes in both orientations. */
|
|
170
|
+
.splitter__handle-grip {
|
|
171
|
+
@apply pointer-events-none absolute rounded-full bg-separator;
|
|
172
|
+
|
|
173
|
+
/* The whole part *is* its background, so the mode flattening it onto the page removes the grip
|
|
174
|
+
* rather than weakening it — the same reason the line restates its colour. */
|
|
175
|
+
@media (forced-colors: active) {
|
|
176
|
+
background-color: CanvasText;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Transitions
|
|
181
|
+
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
182
|
+
*/
|
|
183
|
+
transition: background-color 150ms var(--ease-out);
|
|
184
|
+
@apply motion-reduce:transition-none;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.splitter__handle-grip--horizontal {
|
|
188
|
+
inline-size: var(--splitter-grip-thickness);
|
|
189
|
+
block-size: var(--splitter-grip-length);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.splitter__handle-grip--vertical {
|
|
193
|
+
inline-size: var(--splitter-grip-length);
|
|
194
|
+
block-size: var(--splitter-grip-thickness);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* A horizontal group puts its panels side by side, so the divider is a vertical line. */
|
|
198
|
+
.splitter__handle--horizontal {
|
|
199
|
+
@apply cursor-col-resize;
|
|
200
|
+
|
|
201
|
+
inline-size: var(--splitter-gutter);
|
|
202
|
+
|
|
203
|
+
&::after {
|
|
204
|
+
@apply inset-y-0;
|
|
205
|
+
|
|
206
|
+
inline-size: var(--splitter-gutter);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
&:hover::after,
|
|
210
|
+
&[data-hovered="true"]::after,
|
|
211
|
+
&[data-dragging="true"]::after {
|
|
212
|
+
inline-size: calc(var(--splitter-gutter) * 2);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
& > .splitter__handle-target {
|
|
216
|
+
inset-inline: calc((var(--splitter-target) - var(--splitter-gutter)) / -2);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* A vertical group stacks its panels, so the divider is a horizontal line. */
|
|
221
|
+
.splitter__handle--vertical {
|
|
222
|
+
@apply cursor-row-resize;
|
|
223
|
+
|
|
224
|
+
block-size: var(--splitter-gutter);
|
|
225
|
+
|
|
226
|
+
&::after {
|
|
227
|
+
@apply inset-x-0;
|
|
228
|
+
|
|
229
|
+
block-size: var(--splitter-gutter);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&:hover::after,
|
|
233
|
+
&[data-hovered="true"]::after,
|
|
234
|
+
&[data-dragging="true"]::after {
|
|
235
|
+
block-size: calc(var(--splitter-gutter) * 2);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
& > .splitter__handle-target {
|
|
239
|
+
inset-block: calc((var(--splitter-target) - var(--splitter-gutter)) / -2);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
@@ -12,12 +12,36 @@
|
|
|
12
12
|
|
|
13
13
|
.surface--default {
|
|
14
14
|
@apply bg-surface text-surface-foreground;
|
|
15
|
+
|
|
16
|
+
/* Forced Colors Mode flattens the fill onto the page and strips the shadow, so the container
|
|
17
|
+
* stops having any shape - its contents just sit loose on the page. An outline rather than a
|
|
18
|
+
* border so nothing shifts, and it follows the radius the component sets. */
|
|
19
|
+
@media (forced-colors: active) {
|
|
20
|
+
outline: 1px solid CanvasText;
|
|
21
|
+
outline-offset: -1px;
|
|
22
|
+
}
|
|
15
23
|
}
|
|
16
24
|
|
|
17
25
|
.surface--secondary {
|
|
18
26
|
@apply bg-surface-secondary text-surface-secondary-foreground;
|
|
27
|
+
|
|
28
|
+
/* Forced Colors Mode flattens the fill onto the page and strips the shadow, so the container
|
|
29
|
+
* stops having any shape - its contents just sit loose on the page. An outline rather than a
|
|
30
|
+
* border so nothing shifts, and it follows the radius the component sets. */
|
|
31
|
+
@media (forced-colors: active) {
|
|
32
|
+
outline: 1px solid CanvasText;
|
|
33
|
+
outline-offset: -1px;
|
|
34
|
+
}
|
|
19
35
|
}
|
|
20
36
|
|
|
21
37
|
.surface--tertiary {
|
|
22
38
|
@apply bg-surface-tertiary text-surface-tertiary-foreground;
|
|
39
|
+
|
|
40
|
+
/* Forced Colors Mode flattens the fill onto the page and strips the shadow, so the container
|
|
41
|
+
* stops having any shape - its contents just sit loose on the page. An outline rather than a
|
|
42
|
+
* border so nothing shifts, and it follows the radius the component sets. */
|
|
43
|
+
@media (forced-colors: active) {
|
|
44
|
+
outline: 1px solid CanvasText;
|
|
45
|
+
outline-offset: -1px;
|
|
46
|
+
}
|
|
23
47
|
}
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
|
|
24
24
|
.switch__thumb {
|
|
25
25
|
@apply bg-default-foreground/20;
|
|
26
|
+
|
|
27
|
+
@media (forced-colors: active) {
|
|
28
|
+
background-color: GrayText;
|
|
29
|
+
}
|
|
26
30
|
}
|
|
27
31
|
}
|
|
28
32
|
|
|
@@ -95,6 +99,15 @@
|
|
|
95
99
|
box-shadow 150ms var(--ease-out);
|
|
96
100
|
@apply motion-reduce:transition-none;
|
|
97
101
|
|
|
102
|
+
/* Forced Colors Mode paints the track and the thumb the same `Canvas`, so the thumb vanishes
|
|
103
|
+
* inside the track and the switch stops showing its state - the position it moved to is not
|
|
104
|
+
* visible on a shape that has no visible edge. Give the track a border, then pair each track
|
|
105
|
+
* colour with the thumb colour the platform means to sit on it. */
|
|
106
|
+
@media (forced-colors: active) {
|
|
107
|
+
background-color: Canvas;
|
|
108
|
+
border: 1px solid ButtonBorder;
|
|
109
|
+
}
|
|
110
|
+
|
|
98
111
|
/* Focus states */
|
|
99
112
|
.switch:focus-visible &,
|
|
100
113
|
.switch:has([data-slot="switch-content"][data-focus-visible="true"]) &,
|
|
@@ -121,6 +134,11 @@
|
|
|
121
134
|
.switch[aria-checked="true"] &,
|
|
122
135
|
.switch[data-selected="true"] & {
|
|
123
136
|
background-color: var(--switch-control-bg-checked);
|
|
137
|
+
|
|
138
|
+
@media (forced-colors: active) {
|
|
139
|
+
background-color: Highlight;
|
|
140
|
+
border-color: Highlight;
|
|
141
|
+
}
|
|
124
142
|
}
|
|
125
143
|
|
|
126
144
|
/* Checked + Hover states */
|
|
@@ -170,6 +188,13 @@
|
|
|
170
188
|
height: 1rem; /* ~14px on desktop, ~16px on mobile */
|
|
171
189
|
width: 1.375rem; /* ~19px on desktop, ~22px on mobile */
|
|
172
190
|
|
|
191
|
+
/* Reads against the `Canvas` track the control falls back to; the `color` carries any icon
|
|
192
|
+
* slotted inside, which would otherwise be `CanvasText` on `CanvasText`. */
|
|
193
|
+
@media (forced-colors: active) {
|
|
194
|
+
background-color: CanvasText;
|
|
195
|
+
color: Canvas;
|
|
196
|
+
}
|
|
197
|
+
|
|
173
198
|
/**
|
|
174
199
|
* Transitions
|
|
175
200
|
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
@@ -187,6 +212,11 @@
|
|
|
187
212
|
0px 0px 5px 0px rgb(0 0 0 / 0.02),
|
|
188
213
|
0px 2px 10px 0px rgb(0 0 0 / 0.06),
|
|
189
214
|
0px 0px 1px 0px rgb(0 0 0 / 0.3);
|
|
215
|
+
|
|
216
|
+
@media (forced-colors: active) {
|
|
217
|
+
background-color: HighlightText;
|
|
218
|
+
color: Highlight;
|
|
219
|
+
}
|
|
190
220
|
}
|
|
191
221
|
|
|
192
222
|
.switch:active &,
|
|
@@ -25,6 +25,13 @@
|
|
|
25
25
|
.table-root--primary {
|
|
26
26
|
@apply bg-surface-secondary px-1 pb-1;
|
|
27
27
|
border-radius: min(32px, calc(var(--radius) * 2.5));
|
|
28
|
+
|
|
29
|
+
/* Forced Colors Mode flattens the fill onto the page and strips the shadow, so the container
|
|
30
|
+
* stops having any shape and its contents sit loose on the page. */
|
|
31
|
+
@media (forced-colors: active) {
|
|
32
|
+
outline: 1px solid CanvasText;
|
|
33
|
+
outline-offset: -1px;
|
|
34
|
+
}
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
.table-root--secondary {
|
|
@@ -198,9 +205,9 @@
|
|
|
198
205
|
border-end-end-radius: min(32px, var(--radius-2xl));
|
|
199
206
|
}
|
|
200
207
|
|
|
201
|
-
/* Virtualized: elements are divs, not tr/td
|
|
202
|
-
|
|
203
|
-
itself and clip overflow instead. */
|
|
208
|
+
/* Virtualized: elements are divs, not tr/td, and only a window of the rows
|
|
209
|
+
is in the DOM, so :first-child/:last-child name the window's edges rather
|
|
210
|
+
than the table's. Round the body itself and clip overflow instead. */
|
|
204
211
|
&:not(tbody) {
|
|
205
212
|
@apply relative h-full overflow-clip;
|
|
206
213
|
border-radius: min(32px, var(--radius-2xl));
|
|
@@ -232,6 +239,7 @@
|
|
|
232
239
|
/* Selected state */
|
|
233
240
|
&[data-selected="true"] .table__cell {
|
|
234
241
|
@apply bg-surface/10;
|
|
242
|
+
@apply forced-selected;
|
|
235
243
|
}
|
|
236
244
|
|
|
237
245
|
/* Disabled state */
|
package/dist/components/tabs.css
CHANGED
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
|
|
122
122
|
/* Individual tab */
|
|
123
123
|
.tabs__tab {
|
|
124
|
-
@apply relative flex h-8 w-full items-center justify-center rounded-
|
|
124
|
+
@apply relative flex h-8 w-full items-center justify-center rounded-component px-4 text-center text-sm font-medium text-muted outline-none no-highlight;
|
|
125
125
|
|
|
126
126
|
z-index: 1;
|
|
127
127
|
cursor: var(--cursor-interactive);
|
|
@@ -141,6 +141,14 @@
|
|
|
141
141
|
&[data-selected="true"] {
|
|
142
142
|
@apply text-segment-foreground;
|
|
143
143
|
|
|
144
|
+
/* Sits on top of the indicator, which forced colors paints `Highlight`. `forced-color-adjust`
|
|
145
|
+
* suppresses the `Canvas` backplate Chromium would otherwise paint behind this label - it
|
|
146
|
+
* covers the indicator, and black-on-black is exactly what it would leave. */
|
|
147
|
+
@media (forced-colors: active) {
|
|
148
|
+
forced-color-adjust: none;
|
|
149
|
+
color: HighlightText;
|
|
150
|
+
}
|
|
151
|
+
|
|
144
152
|
/* Hide separator on the selected tab and the one following it */
|
|
145
153
|
.tabs__separator,
|
|
146
154
|
& + .tabs__tab .tabs__separator {
|
|
@@ -213,10 +221,17 @@
|
|
|
213
221
|
|
|
214
222
|
/* Tab indicator - React Aria's SelectionIndicator */
|
|
215
223
|
.tabs__indicator {
|
|
216
|
-
@apply absolute start-0 top-0 size-full rounded-
|
|
224
|
+
@apply absolute start-0 top-0 size-full rounded-component bg-segment shadow-surface;
|
|
217
225
|
|
|
218
226
|
z-index: -1;
|
|
219
227
|
|
|
228
|
+
/* The indicator is a background and nothing else, so Forced Colors Mode flattens it away
|
|
229
|
+
* and nothing marks the selected tab. `Highlight` behind `HighlightText` is the platform's
|
|
230
|
+
* own pairing for a selected segment. */
|
|
231
|
+
@media (forced-colors: active) {
|
|
232
|
+
background-color: Highlight;
|
|
233
|
+
}
|
|
234
|
+
|
|
220
235
|
/**
|
|
221
236
|
* Transitions
|
|
222
237
|
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
@@ -254,12 +269,25 @@
|
|
|
254
269
|
/* Selected state - use text-foreground */
|
|
255
270
|
&[data-selected="true"] {
|
|
256
271
|
@apply text-foreground;
|
|
272
|
+
|
|
273
|
+
/* Here the indicator is a line under the tab rather than a pill behind it, so the
|
|
274
|
+
* label keeps the ordinary text colour instead of the base variant's
|
|
275
|
+
* `HighlightText`, which would be invisible against the page. */
|
|
276
|
+
@media (forced-colors: active) {
|
|
277
|
+
color: CanvasText;
|
|
278
|
+
}
|
|
257
279
|
}
|
|
258
280
|
}
|
|
259
281
|
|
|
260
282
|
/* Tab indicator - line style */
|
|
261
283
|
.tabs__indicator {
|
|
262
284
|
@apply rounded-none bg-accent shadow-none;
|
|
285
|
+
|
|
286
|
+
/* `bg-accent` outranks the base rule's forced-colors fallback and is itself flattened
|
|
287
|
+
* to `Canvas`, so the underline has to be restated here or it disappears. */
|
|
288
|
+
@media (forced-colors: active) {
|
|
289
|
+
background-color: Highlight;
|
|
290
|
+
}
|
|
263
291
|
}
|
|
264
292
|
}
|
|
265
293
|
|
package/dist/components/tag.css
CHANGED
|
@@ -19,6 +19,15 @@
|
|
|
19
19
|
/* Cursor */
|
|
20
20
|
cursor: var(--cursor-interactive);
|
|
21
21
|
|
|
22
|
+
/* Forced Colors Mode flattens the fill onto the page and strips the shadow, leaving a control
|
|
23
|
+
* that reads as bare text. `ButtonBorder` is the keyword the platform uses for a control's
|
|
24
|
+
* edge; an outline rather than a border so nothing shifts, and the focus ring replaces it
|
|
25
|
+
* while focused, which is the right order of importance. */
|
|
26
|
+
@media (forced-colors: active) {
|
|
27
|
+
outline: 1px solid ButtonBorder;
|
|
28
|
+
outline-offset: -1px;
|
|
29
|
+
}
|
|
30
|
+
|
|
22
31
|
/* SVG icon styling */
|
|
23
32
|
& svg {
|
|
24
33
|
@apply pointer-events-none size-3 shrink-0 self-center text-current;
|
|
@@ -42,6 +51,7 @@
|
|
|
42
51
|
/* Selected state */
|
|
43
52
|
.tag:is([data-selected="true"], [aria-selected="true"]) {
|
|
44
53
|
@apply bg-accent-soft text-accent-soft-foreground;
|
|
54
|
+
@apply forced-selected;
|
|
45
55
|
|
|
46
56
|
/* Selected + Hover state */
|
|
47
57
|
@media (hover: hover) {
|
|
@@ -4,6 +4,11 @@ export declare const textAreaVariants: import("tailwind-variants").TVReturnType<
|
|
|
4
4
|
false: "";
|
|
5
5
|
true: "textarea--full-width";
|
|
6
6
|
};
|
|
7
|
+
size: {
|
|
8
|
+
lg: "textarea--lg";
|
|
9
|
+
md: "";
|
|
10
|
+
sm: "textarea--sm";
|
|
11
|
+
};
|
|
7
12
|
variant: {
|
|
8
13
|
primary: "textarea--primary";
|
|
9
14
|
secondary: "textarea--secondary";
|
|
@@ -13,6 +18,11 @@ export declare const textAreaVariants: import("tailwind-variants").TVReturnType<
|
|
|
13
18
|
false: "";
|
|
14
19
|
true: "textarea--full-width";
|
|
15
20
|
};
|
|
21
|
+
size: {
|
|
22
|
+
lg: "textarea--lg";
|
|
23
|
+
md: "";
|
|
24
|
+
sm: "textarea--sm";
|
|
25
|
+
};
|
|
16
26
|
variant: {
|
|
17
27
|
primary: "textarea--primary";
|
|
18
28
|
secondary: "textarea--secondary";
|
|
@@ -22,6 +32,11 @@ export declare const textAreaVariants: import("tailwind-variants").TVReturnType<
|
|
|
22
32
|
false: "";
|
|
23
33
|
true: "textarea--full-width";
|
|
24
34
|
};
|
|
35
|
+
size: {
|
|
36
|
+
lg: "textarea--lg";
|
|
37
|
+
md: "";
|
|
38
|
+
sm: "textarea--sm";
|
|
39
|
+
};
|
|
25
40
|
variant: {
|
|
26
41
|
primary: "textarea--primary";
|
|
27
42
|
secondary: "textarea--secondary";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.styles.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/textarea.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"textarea.styles.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/textarea.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsB3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -4,6 +4,7 @@ const textAreaVariants = tv({
|
|
|
4
4
|
base: "textarea",
|
|
5
5
|
defaultVariants: {
|
|
6
6
|
fullWidth: false,
|
|
7
|
+
size: "md",
|
|
7
8
|
variant: "primary"
|
|
8
9
|
},
|
|
9
10
|
variants: {
|
|
@@ -11,6 +12,11 @@ const textAreaVariants = tv({
|
|
|
11
12
|
false: "",
|
|
12
13
|
true: "textarea--full-width"
|
|
13
14
|
},
|
|
15
|
+
size: {
|
|
16
|
+
lg: "textarea--lg",
|
|
17
|
+
md: "",
|
|
18
|
+
sm: "textarea--sm"
|
|
19
|
+
},
|
|
14
20
|
variant: {
|
|
15
21
|
primary: "textarea--primary",
|
|
16
22
|
secondary: "textarea--secondary"
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
/* use textarea instead of text-area to avoid conflict with Tailwind `text-` prefix */
|
|
2
2
|
.textarea {
|
|
3
|
-
@apply rounded-field border bg-field px-3
|
|
3
|
+
@apply rounded-field border bg-field px-3 field-line-md text-field-foreground shadow-field outline-none placeholder:text-field-placeholder;
|
|
4
4
|
|
|
5
5
|
min-height: 38px;
|
|
6
6
|
|
|
7
7
|
border-width: var(--border-width-field);
|
|
8
8
|
border-color: var(--field-border);
|
|
9
9
|
|
|
10
|
+
/* Forced Colors Mode flattens the fill onto the page and strips the shadow, leaving a field that
|
|
11
|
+
* reads as bare text - `--border-width-field` is 0, so the declared border brings nothing
|
|
12
|
+
* back on its own. `ButtonBorder` is the keyword the platform uses for a control's
|
|
13
|
+
* edge; an outline rather than a border so nothing shifts, and the focus ring replaces it
|
|
14
|
+
* while focused, which is the right order of importance. */
|
|
15
|
+
@media (forced-colors: active) {
|
|
16
|
+
outline: 1px solid ButtonBorder;
|
|
17
|
+
outline-offset: -1px;
|
|
18
|
+
}
|
|
19
|
+
|
|
10
20
|
/**
|
|
11
21
|
* Transitions
|
|
12
22
|
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
@@ -92,3 +102,15 @@
|
|
|
92
102
|
.textarea--full-width {
|
|
93
103
|
@apply w-full;
|
|
94
104
|
}
|
|
105
|
+
|
|
106
|
+
/* ==========================================================================
|
|
107
|
+
Size variants
|
|
108
|
+
========================================================================== */
|
|
109
|
+
|
|
110
|
+
.textarea--sm {
|
|
111
|
+
@apply field-line-sm;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.textarea--lg {
|
|
115
|
+
@apply field-line-lg;
|
|
116
|
+
}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
inset-inline-end: 0;
|
|
48
48
|
|
|
49
49
|
@apply pointer-events-auto flex flex-row items-start justify-start gap-1.5 bg-surface px-4 py-3 shadow-overlay;
|
|
50
|
-
border-radius: min(32px, var(--radius
|
|
50
|
+
border-radius: min(32px, var(--component-radius));
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.toast--bottom,
|