@ropav/styles 0.4.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.
Files changed (181) hide show
  1. package/README.md +89 -5
  2. package/dist/components/accordion.css +6 -14
  3. package/dist/components/alert-dialog.css +1 -13
  4. package/dist/components/alert.css +1 -1
  5. package/dist/components/autocomplete/autocomplete.styles.d.ts +33 -0
  6. package/dist/components/autocomplete/autocomplete.styles.d.ts.map +1 -1
  7. package/dist/components/autocomplete/autocomplete.styles.js +12 -0
  8. package/dist/components/autocomplete.css +54 -36
  9. package/dist/components/breadcrumbs.css +9 -2
  10. package/dist/components/button-group.css +6 -10
  11. package/dist/components/button.css +10 -18
  12. package/dist/components/calendar-year-picker.css +20 -8
  13. package/dist/components/calendar.css +46 -21
  14. package/dist/components/card.css +1 -1
  15. package/dist/components/checkbox.css +54 -56
  16. package/dist/components/chip.css +3 -1
  17. package/dist/components/close-button.css +7 -6
  18. package/dist/components/color-area.css +6 -6
  19. package/dist/components/color-input-group/color-input-group.styles.d.ts +27 -0
  20. package/dist/components/color-input-group/color-input-group.styles.d.ts.map +1 -1
  21. package/dist/components/color-input-group/color-input-group.styles.js +6 -0
  22. package/dist/components/color-input-group.css +31 -28
  23. package/dist/components/color-picker.css +1 -5
  24. package/dist/components/color-slider.css +14 -12
  25. package/dist/components/color-swatch-picker.css +2 -85
  26. package/dist/components/color-swatch.css +1 -1
  27. package/dist/components/combo-box/combo-box.styles.d.ts +27 -0
  28. package/dist/components/combo-box/combo-box.styles.d.ts.map +1 -1
  29. package/dist/components/combo-box/combo-box.styles.js +17 -7
  30. package/dist/components/combo-box.css +34 -4
  31. package/dist/components/date-input-group/date-input-group.styles.d.ts +27 -0
  32. package/dist/components/date-input-group/date-input-group.styles.d.ts.map +1 -1
  33. package/dist/components/date-input-group/date-input-group.styles.js +6 -0
  34. package/dist/components/date-input-group.css +55 -33
  35. package/dist/components/date-picker.css +1 -5
  36. package/dist/components/date-range-picker.css +1 -5
  37. package/dist/components/disclosure.css +0 -4
  38. package/dist/components/drawer.css +4 -8
  39. package/dist/components/drop-zone/drop-zone.styles.d.ts +34 -0
  40. package/dist/components/drop-zone/drop-zone.styles.d.ts.map +1 -0
  41. package/dist/components/drop-zone/drop-zone.styles.js +8 -0
  42. package/dist/components/drop-zone/index.d.ts +2 -0
  43. package/dist/components/drop-zone/index.d.ts.map +1 -0
  44. package/dist/components/drop-zone/index.js +2 -0
  45. package/dist/components/drop-zone.css +78 -0
  46. package/dist/components/dropdown.css +1 -5
  47. package/dist/components/error-message.css +0 -4
  48. package/dist/components/field-error.css +0 -4
  49. package/dist/components/index.css +5 -0
  50. package/dist/components/index.d.ts +5 -0
  51. package/dist/components/index.d.ts.map +1 -1
  52. package/dist/components/input/input.styles.d.ts +15 -0
  53. package/dist/components/input/input.styles.d.ts.map +1 -1
  54. package/dist/components/input/input.styles.js +6 -0
  55. package/dist/components/input-group/input-group.styles.d.ts +27 -0
  56. package/dist/components/input-group/input-group.styles.d.ts.map +1 -1
  57. package/dist/components/input-group/input-group.styles.js +6 -0
  58. package/dist/components/input-group.css +35 -38
  59. package/dist/components/input-otp.css +14 -26
  60. package/dist/components/input.css +23 -32
  61. package/dist/components/kbd.css +3 -1
  62. package/dist/components/label.css +7 -2
  63. package/dist/components/link.css +13 -11
  64. package/dist/components/list-box/list-box.styles.d.ts +15 -0
  65. package/dist/components/list-box/list-box.styles.d.ts.map +1 -1
  66. package/dist/components/list-box/list-box.styles.js +15 -5
  67. package/dist/components/list-box-item.css +8 -12
  68. package/dist/components/list-box.css +19 -0
  69. package/dist/components/menu/menu.styles.d.ts +19 -1
  70. package/dist/components/menu/menu.styles.d.ts.map +1 -1
  71. package/dist/components/menu/menu.styles.js +9 -1
  72. package/dist/components/menu-item.css +4 -10
  73. package/dist/components/menu.css +19 -0
  74. package/dist/components/meter.css +8 -16
  75. package/dist/components/modal.css +1 -13
  76. package/dist/components/number-field/number-field.styles.d.ts +27 -0
  77. package/dist/components/number-field/number-field.styles.d.ts.map +1 -1
  78. package/dist/components/number-field/number-field.styles.js +6 -0
  79. package/dist/components/number-field.css +83 -36
  80. package/dist/components/pagination.css +6 -10
  81. package/dist/components/popover.css +15 -5
  82. package/dist/components/progress-bar/progress-bar.styles.d.ts +36 -0
  83. package/dist/components/progress-bar/progress-bar.styles.d.ts.map +1 -1
  84. package/dist/components/progress-bar/progress-bar.styles.js +10 -0
  85. package/dist/components/progress-bar.css +82 -16
  86. package/dist/components/progress-circle.css +0 -4
  87. package/dist/components/radio.css +7 -9
  88. package/dist/components/range-calendar.css +73 -31
  89. package/dist/components/search-field/search-field.styles.d.ts +27 -0
  90. package/dist/components/search-field/search-field.styles.d.ts.map +1 -1
  91. package/dist/components/search-field/search-field.styles.js +6 -0
  92. package/dist/components/search-field.css +36 -29
  93. package/dist/components/segmented-control/index.d.ts +2 -0
  94. package/dist/components/segmented-control/index.d.ts.map +1 -0
  95. package/dist/components/segmented-control/index.js +2 -0
  96. package/dist/components/segmented-control/segmented-control.styles.d.ts +73 -0
  97. package/dist/components/segmented-control/segmented-control.styles.d.ts.map +1 -0
  98. package/dist/components/segmented-control/segmented-control.styles.js +27 -0
  99. package/dist/components/segmented-control.css +188 -0
  100. package/dist/components/select/select.styles.d.ts +33 -0
  101. package/dist/components/select/select.styles.d.ts.map +1 -1
  102. package/dist/components/select/select.styles.js +12 -0
  103. package/dist/components/select.css +47 -33
  104. package/dist/components/sidebar/index.d.ts +2 -0
  105. package/dist/components/sidebar/index.d.ts.map +1 -0
  106. package/dist/components/sidebar/index.js +2 -0
  107. package/dist/components/sidebar/sidebar.styles.d.ts +226 -0
  108. package/dist/components/sidebar/sidebar.styles.d.ts.map +1 -0
  109. package/dist/components/sidebar/sidebar.styles.js +65 -0
  110. package/dist/components/sidebar.css +604 -0
  111. package/dist/components/slider.css +10 -11
  112. package/dist/components/splitter/index.d.ts +2 -0
  113. package/dist/components/splitter/index.d.ts.map +1 -0
  114. package/dist/components/splitter/index.js +2 -0
  115. package/dist/components/splitter/splitter.styles.d.ts +61 -0
  116. package/dist/components/splitter/splitter.styles.d.ts.map +1 -0
  117. package/dist/components/splitter/splitter.styles.js +26 -0
  118. package/dist/components/splitter.css +249 -0
  119. package/dist/components/switch.css +16 -15
  120. package/dist/components/table.css +72 -30
  121. package/dist/components/tabs.css +9 -20
  122. package/dist/components/tag.css +32 -24
  123. package/dist/components/textarea/textarea.styles.d.ts +15 -0
  124. package/dist/components/textarea/textarea.styles.d.ts.map +1 -1
  125. package/dist/components/textarea/textarea.styles.js +6 -0
  126. package/dist/components/textarea.css +23 -32
  127. package/dist/components/toast.css +4 -2
  128. package/dist/components/toggle-button-group.css +7 -11
  129. package/dist/components/toggle-button.css +9 -17
  130. package/dist/components/toolbar.css +1 -1
  131. package/dist/components/tooltip.css +15 -6
  132. package/dist/components/typography.css +12 -4
  133. package/dist/components/virtualizer/index.d.ts +2 -0
  134. package/dist/components/virtualizer/index.d.ts.map +1 -0
  135. package/dist/components/virtualizer/index.js +2 -0
  136. package/dist/components/virtualizer/virtualizer.styles.d.ts +44 -0
  137. package/dist/components/virtualizer/virtualizer.styles.d.ts.map +1 -0
  138. package/dist/components/virtualizer/virtualizer.styles.js +15 -0
  139. package/dist/components/virtualizer.css +72 -0
  140. package/dist/index.js +6 -1
  141. package/dist/ropav.min.css +2 -2
  142. package/dist/themes/airbnb.css +11 -4
  143. package/dist/themes/all.css +1 -0
  144. package/dist/themes/coinbase.css +11 -4
  145. package/dist/themes/default.css +40 -8
  146. package/dist/themes/discord.css +11 -4
  147. package/dist/themes/hero.css +282 -0
  148. package/dist/themes/lavender.css +11 -4
  149. package/dist/themes/mint.css +11 -4
  150. package/dist/themes/netflix.css +11 -4
  151. package/dist/themes/rabbit.css +11 -4
  152. package/dist/themes/shared/theme.css +20 -2
  153. package/dist/themes/sky.css +11 -4
  154. package/dist/themes/spotify.css +11 -4
  155. package/dist/themes/uber.css +11 -4
  156. package/dist/utilities/index.css +27 -0
  157. package/package.json +1 -1
  158. package/src/components/autocomplete/autocomplete.styles.ts +12 -0
  159. package/src/components/color-input-group/color-input-group.styles.ts +10 -0
  160. package/src/components/combo-box/combo-box.styles.ts +12 -0
  161. package/src/components/date-input-group/date-input-group.styles.ts +10 -0
  162. package/src/components/drop-zone/drop-zone.styles.ts +12 -0
  163. package/src/components/drop-zone/index.ts +1 -0
  164. package/src/components/index.ts +5 -0
  165. package/src/components/input/input.styles.ts +6 -0
  166. package/src/components/input-group/input-group.styles.ts +10 -0
  167. package/src/components/list-box/list-box.styles.ts +6 -0
  168. package/src/components/menu/menu.styles.ts +10 -0
  169. package/src/components/number-field/number-field.styles.ts +10 -0
  170. package/src/components/progress-bar/progress-bar.styles.ts +14 -0
  171. package/src/components/search-field/search-field.styles.ts +10 -0
  172. package/src/components/segmented-control/index.ts +1 -0
  173. package/src/components/segmented-control/segmented-control.styles.ts +37 -0
  174. package/src/components/select/select.styles.ts +12 -0
  175. package/src/components/sidebar/index.ts +1 -0
  176. package/src/components/sidebar/sidebar.styles.ts +117 -0
  177. package/src/components/splitter/index.ts +1 -0
  178. package/src/components/splitter/splitter.styles.ts +44 -0
  179. package/src/components/textarea/textarea.styles.ts +6 -0
  180. package/src/components/virtualizer/index.ts +1 -0
  181. package/src/components/virtualizer/virtualizer.styles.ts +15 -0
@@ -21,7 +21,9 @@
21
21
  }
22
22
 
23
23
  .slider__track {
24
- @apply relative rounded-xl bg-default;
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 rounded-xl bg-accent no-highlight;
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 rounded-lg bg-accent-foreground text-black shadow-field;
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 */
@@ -0,0 +1,2 @@
1
+ export * from "./splitter.styles";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/splitter/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { splitterVariants } from "./splitter.styles.js";
2
+ export { splitterVariants };
@@ -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,249 @@
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
+ /* 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);
75
+
76
+ @apply relative z-10 flex shrink-0 grow-0 items-center justify-center self-stretch;
77
+ @apply bg-transparent outline-none select-none no-highlight;
78
+
79
+ /* The gesture is ours; the browser must not also pan or scroll from a drag on this. */
80
+ @apply touch-none;
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
+
86
+ &::after {
87
+ @apply pointer-events-none absolute rounded-sm content-[''];
88
+
89
+ background-color: var(--splitter-line);
90
+
91
+ /* Flattened to `Canvas` the divider stops existing rather than weakening — the whole part
92
+ * *is* its background, which is why `separator.css` restates its colour the same way. */
93
+ @media (forced-colors: active) {
94
+ background-color: CanvasText;
95
+ }
96
+
97
+ transition:
98
+ background-color 150ms var(--ease-out),
99
+ inline-size 150ms var(--ease-out),
100
+ block-size 150ms var(--ease-out);
101
+ }
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. */
106
+ &:hover::after,
107
+ &[data-hovered="true"]::after {
108
+ background-color: var(--splitter-line-hover);
109
+ transition-delay: var(--splitter-highlight-delay);
110
+ }
111
+
112
+ /* The grip answers to the same states as the line, and is reached as a direct child so a nested
113
+ * group's own grip is left alone. */
114
+ &:hover > .splitter__handle-grip,
115
+ &[data-hovered="true"] > .splitter__handle-grip {
116
+ background-color: var(--splitter-grip-bg-hover);
117
+ transition-delay: var(--splitter-highlight-delay);
118
+ }
119
+
120
+ /* Once a drag is under way the intent is not in question, so it skips the wait. Last, because a
121
+ * drag usually starts from a hover and has to win. */
122
+ &[data-dragging="true"]::after {
123
+ background-color: var(--splitter-line-dragging);
124
+ transition-delay: 0ms;
125
+ }
126
+
127
+ &[data-dragging="true"] > .splitter__handle-grip {
128
+ background-color: var(--splitter-grip-bg-dragging);
129
+ transition-delay: 0ms;
130
+ }
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
+
145
+ &:focus-visible,
146
+ &[data-focus-visible="true"] {
147
+ @apply status-focused;
148
+ }
149
+
150
+ &[data-disabled="true"] {
151
+ @apply status-disabled;
152
+
153
+ /* `status-disabled` reaches `color` and `border-color`, and neither the line nor the grip is
154
+ * either of those. */
155
+ &::after,
156
+ & > .splitter__handle-grip {
157
+ @media (forced-colors: active) {
158
+ background-color: GrayText;
159
+ }
160
+ }
161
+ }
162
+ }
163
+
164
+ /* The invisible hit area — named for the target size it exists to reach, and kept apart from the
165
+ * grip because that one is the part you can see. A negative `inset` rather than a transparent
166
+ * border: forced colors turns a transparent *border-color* opaque — the trap `slider.css` documents
167
+ * at both ends of its track — and a bordered target would render as two solid blocks flanking every
168
+ * divider. `inset` has no such behaviour, so this needs no forced-colors rule of its own. */
169
+ .splitter__handle-target {
170
+ @apply absolute inset-0 bg-transparent;
171
+ }
172
+
173
+ /* The visible grab affordance, and only that — the gesture belongs to the handle, the hit area to
174
+ * the target. No insets: an absolutely positioned child of a flex container takes its static
175
+ * position from the container's own alignment, which is the same `items-center justify-center` that
176
+ * centres the line above. `drawer.css` carries its handle bar as a child element the same way.
177
+ *
178
+ * Sized from custom properties rather than utilities so a theme can retune the pill without
179
+ * restating both axes in both orientations. */
180
+ .splitter__handle-grip {
181
+ @apply pointer-events-none absolute rounded-full;
182
+
183
+ background-color: var(--splitter-grip-bg);
184
+
185
+ /* The whole part *is* its background, so the mode flattening it onto the page removes the grip
186
+ * rather than weakening it — the same reason the line restates its colour. */
187
+ @media (forced-colors: active) {
188
+ background-color: CanvasText;
189
+ }
190
+
191
+ transition: background-color 150ms var(--ease-out);
192
+ @apply motion-reduce:transition-none;
193
+ }
194
+
195
+ .splitter__handle-grip--horizontal {
196
+ inline-size: var(--splitter-grip-thickness);
197
+ block-size: var(--splitter-grip-length);
198
+ }
199
+
200
+ .splitter__handle-grip--vertical {
201
+ inline-size: var(--splitter-grip-length);
202
+ block-size: var(--splitter-grip-thickness);
203
+ }
204
+
205
+ /* A horizontal group puts its panels side by side, so the divider is a vertical line. */
206
+ .splitter__handle--horizontal {
207
+ @apply cursor-col-resize;
208
+
209
+ inline-size: var(--splitter-gutter);
210
+
211
+ &::after {
212
+ @apply inset-y-0;
213
+
214
+ inline-size: var(--splitter-gutter);
215
+ }
216
+
217
+ &:hover::after,
218
+ &[data-hovered="true"]::after,
219
+ &[data-dragging="true"]::after {
220
+ inline-size: calc(var(--splitter-gutter) * 2);
221
+ }
222
+
223
+ & > .splitter__handle-target {
224
+ inset-inline: calc((var(--splitter-target) - var(--splitter-gutter)) / -2);
225
+ }
226
+ }
227
+
228
+ /* A vertical group stacks its panels, so the divider is a horizontal line. */
229
+ .splitter__handle--vertical {
230
+ @apply cursor-row-resize;
231
+
232
+ block-size: var(--splitter-gutter);
233
+
234
+ &::after {
235
+ @apply inset-x-0;
236
+
237
+ block-size: var(--splitter-gutter);
238
+ }
239
+
240
+ &:hover::after,
241
+ &[data-hovered="true"]::after,
242
+ &[data-dragging="true"]::after {
243
+ block-size: calc(var(--splitter-gutter) * 2);
244
+ }
245
+
246
+ & > .splitter__handle-target {
247
+ inset-block: calc((var(--splitter-target) - var(--splitter-gutter)) / -2);
248
+ }
249
+ }
@@ -22,7 +22,7 @@
22
22
  }
23
23
 
24
24
  .switch__thumb {
25
- @apply bg-default-foreground/20;
25
+ background-color: var(--switch-thumb-bg-disabled);
26
26
 
27
27
  @media (forced-colors: active) {
28
28
  background-color: GrayText;
@@ -84,16 +84,14 @@
84
84
  /* Switch control (track) */
85
85
  .switch__control {
86
86
  /* Default size (medium) */
87
- @apply relative flex shrink-0 items-center overflow-hidden rounded-xl;
87
+ @apply relative flex shrink-0 items-center overflow-hidden;
88
+
89
+ border-radius: min(32px, var(--component-radius));
88
90
  height: 1.25rem; /* 20px on desktop (14px base), 20px on mobile (16px base) - scales with font-size */
89
91
  width: 2.5rem; /* 35px on desktop, 40px on mobile - scales with font-size */
90
92
 
91
93
  background-color: var(--switch-control-bg);
92
94
 
93
- /**
94
- * Transitions
95
- * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
96
- */
97
95
  transition:
98
96
  background-color 250ms var(--ease-smooth),
99
97
  box-shadow 150ms var(--ease-out);
@@ -167,7 +165,6 @@
167
165
 
168
166
  /* Size-specific control dimensions */
169
167
  .switch--sm .switch__control {
170
- @apply rounded-lg;
171
168
  height: 1rem; /* ~14px on desktop, ~16px on mobile */
172
169
  width: 2rem; /* ~32px on desktop, ~36px on mobile */
173
170
  }
@@ -184,7 +181,15 @@
184
181
  /* Switch thumb */
185
182
  .switch__thumb {
186
183
  /* Default size (medium) with margin-based positioning */
187
- @apply ms-0.5 flex origin-center rounded-lg bg-white text-black shadow-field;
184
+ @apply ms-0.5 flex origin-center text-black shadow-field;
185
+
186
+ border-radius: min(32px, var(--component-radius));
187
+
188
+ --switch-thumb-bg: var(--white);
189
+ --switch-thumb-bg-selected: var(--accent-foreground);
190
+ --switch-thumb-bg-disabled: color-mix(in oklab, var(--default-foreground) 20%, transparent);
191
+
192
+ background-color: var(--switch-thumb-bg);
188
193
  height: 1rem; /* ~14px on desktop, ~16px on mobile */
189
194
  width: 1.375rem; /* ~19px on desktop, ~22px on mobile */
190
195
 
@@ -195,10 +200,6 @@
195
200
  color: Canvas;
196
201
  }
197
202
 
198
- /**
199
- * Transitions
200
- * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
201
- */
202
203
  transition:
203
204
  margin 300ms var(--ease-out-fluid),
204
205
  background-color 200ms var(--ease-out);
@@ -207,7 +208,9 @@
207
208
  /* Selected/checked state - use margin instead of translate */
208
209
  .switch[aria-checked="true"] &,
209
210
  .switch[data-selected="true"] & {
210
- @apply ms-[calc(100%-1.5rem)] bg-accent-foreground text-accent;
211
+ @apply ms-[calc(100%-1.5rem)] text-accent;
212
+
213
+ background-color: var(--switch-thumb-bg-selected);
211
214
  box-shadow:
212
215
  0px 0px 5px 0px rgb(0 0 0 / 0.02),
213
216
  0px 2px 10px 0px rgb(0 0 0 / 0.06),
@@ -226,7 +229,6 @@
226
229
 
227
230
  /* Size-specific thumb dimensions */
228
231
  .switch--sm .switch__thumb {
229
- @apply rounded-md;
230
232
  height: 0.75rem; /* ~10.5px on desktop, ~12px on mobile */
231
233
  width: 1.03125rem; /* ~14.4px on desktop, ~16.5px on mobile - maintains 1.375:1 ratio */
232
234
 
@@ -238,7 +240,6 @@
238
240
  }
239
241
 
240
242
  .switch--lg .switch__thumb {
241
- @apply rounded-xl;
242
243
  height: 1.25rem; /* ~17.5px on desktop, ~20px on mobile */
243
244
  width: 1.71875rem; /* ~24px on desktop, ~27.5px on mobile - maintains 1.375:1 ratio */
244
245