@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
@@ -24,7 +24,8 @@
24
24
 
25
25
  .table-root--primary {
26
26
  @apply bg-surface-secondary px-1 pb-1;
27
- border-radius: min(32px, calc(var(--radius) * 2.5));
27
+
28
+ border-radius: min(32px, var(--component-radius));
28
29
 
29
30
  /* Forced Colors Mode flattens the fill onto the page and strips the shadow, so the container
30
31
  * stops having any shape and its contents sit loose on the page. */
@@ -58,8 +59,8 @@
58
59
  th.table__column:first-child,
59
60
  [role="row"] > [role="presentation"]:first-of-type > .table__column
60
61
  ) {
61
- border-start-start-radius: min(32px, var(--radius-2xl));
62
- border-end-start-radius: min(32px, var(--radius-2xl));
62
+ border-start-start-radius: min(32px, var(--component-radius));
63
+ border-end-start-radius: min(32px, var(--component-radius));
63
64
  }
64
65
 
65
66
  .table-root--secondary
@@ -67,8 +68,8 @@
67
68
  th.table__column:last-child,
68
69
  [role="row"] > [role="presentation"]:last-of-type > .table__column
69
70
  ) {
70
- border-start-end-radius: min(32px, var(--radius-2xl));
71
- border-end-end-radius: min(32px, var(--radius-2xl));
71
+ border-start-end-radius: min(32px, var(--component-radius));
72
+ border-end-end-radius: min(32px, var(--component-radius));
72
73
  }
73
74
 
74
75
  /* Secondary: body has no shadow or rounded corners */
@@ -92,14 +93,10 @@
92
93
  /* Secondary: rows are transparent and keep bottom border on every row */
93
94
  .table-root--secondary .table__row {
94
95
  .table__cell {
95
- @apply border-b border-separator-tertiary/50 bg-transparent;
96
- }
96
+ @apply border-b border-separator-tertiary/50;
97
97
 
98
- @media (hover: hover) {
99
- &:hover .table__cell,
100
- &[data-hovered="true"] .table__cell {
101
- @apply bg-default/50;
102
- }
98
+ --table-cell-bg: transparent;
99
+ --table-cell-bg-hover: color-mix(in oklab, var(--state-layer) 50%, transparent);
103
100
  }
104
101
  }
105
102
 
@@ -126,7 +123,12 @@
126
123
  Table Column (<th>)
127
124
  -------------------------------------------------------------------------- */
128
125
  .table__column {
129
- @apply relative px-4 py-2.5 text-start text-xs font-medium text-muted;
126
+ @apply relative px-4 py-2.5 text-start text-xs font-medium;
127
+
128
+ --table-column-fg: var(--muted);
129
+ --table-column-fg-hover: var(--foreground);
130
+
131
+ color: var(--table-column-fg);
130
132
 
131
133
  /* Separator between columns — a short vertical line on the right edge */
132
134
  &::after {
@@ -138,6 +140,13 @@
138
140
  content: none;
139
141
  }
140
142
 
143
+ /* A column holding nothing but the select-all box has no heading for the line to divide from
144
+ * the next one, and where the end padding is collapsed it lands on the box's own edge and
145
+ * reads as a border the box grew. */
146
+ &:has(> .checkbox:only-child)::after {
147
+ content: none;
148
+ }
149
+
141
150
  /* Sortable columns */
142
151
  &[data-allows-sorting="true"] {
143
152
  cursor: var(--cursor-interactive);
@@ -146,7 +155,7 @@
146
155
  @media (hover: hover) {
147
156
  &[data-allows-sorting="true"]:hover,
148
157
  &[data-allows-sorting="true"][data-hovered="true"] {
149
- @apply text-foreground;
158
+ color: var(--table-column-fg-hover);
150
159
  }
151
160
  }
152
161
 
@@ -193,24 +202,24 @@
193
202
  (border-radius on <tbody> itself has no effect).
194
203
  Logical properties so corners follow `dir` in RTL. */
195
204
  & tr:first-child td:first-child {
196
- border-start-start-radius: min(32px, var(--radius-2xl));
205
+ border-start-start-radius: min(32px, var(--component-radius));
197
206
  }
198
207
  & tr:first-child td:last-child {
199
- border-start-end-radius: min(32px, var(--radius-2xl));
208
+ border-start-end-radius: min(32px, var(--component-radius));
200
209
  }
201
210
  & tr:last-child td:first-child {
202
- border-end-start-radius: min(32px, var(--radius-2xl));
211
+ border-end-start-radius: min(32px, var(--component-radius));
203
212
  }
204
213
  & tr:last-child td:last-child {
205
- border-end-end-radius: min(32px, var(--radius-2xl));
214
+ border-end-end-radius: min(32px, var(--component-radius));
206
215
  }
207
216
 
208
- /* Virtualized: elements are divs, not tr/td. VirtualizerItem wrappers
209
- break :first-child/:last-child on rows and cells, so round the body
210
- itself and clip overflow instead. */
217
+ /* Virtualized: elements are divs, not tr/td, and only a window of the rows
218
+ is in the DOM, so :first-child/:last-child name the window's edges rather
219
+ than the table's. Round the body itself and clip overflow instead. */
211
220
  &:not(tbody) {
212
221
  @apply relative h-full overflow-clip;
213
- border-radius: min(32px, var(--radius-2xl));
222
+ border-radius: min(32px, var(--component-radius));
214
223
  }
215
224
  }
216
225
 
@@ -232,16 +241,26 @@
232
241
  @media (hover: hover) {
233
242
  &:hover .table__cell,
234
243
  &[data-hovered="true"] .table__cell {
235
- @apply bg-surface/40;
244
+ background-color: var(--table-cell-bg-hover);
236
245
  }
237
246
  }
238
247
 
239
248
  /* Selected state */
240
249
  &[data-selected="true"] .table__cell {
241
- @apply bg-surface/10;
250
+ background-color: var(--table-cell-bg-selected);
251
+
242
252
  @apply forced-selected;
243
253
  }
244
254
 
255
+ /* A selected row still answers the pointer. Without this the rule above swallows the hover -
256
+ * it is later and equally specific, so the row that is both reads as merely selected. */
257
+ @media (hover: hover) {
258
+ &[data-selected="true"]:hover .table__cell,
259
+ &[data-selected="true"][data-hovered="true"] .table__cell {
260
+ background-color: var(--table-cell-bg-selected-hover);
261
+ }
262
+ }
263
+
245
264
  /* Disabled state */
246
265
  &[aria-disabled="true"],
247
266
  &[data-disabled="true"] {
@@ -261,7 +280,7 @@
261
280
 
262
281
  /* Drop target state */
263
282
  &[data-drop-target="true"] .table__cell {
264
- @apply bg-accent-soft;
283
+ background-color: var(--table-cell-bg-drop-target);
265
284
  }
266
285
  }
267
286
 
@@ -269,7 +288,17 @@
269
288
  Table Cell (<td>)
270
289
  -------------------------------------------------------------------------- */
271
290
  .table__cell {
272
- @apply h-full bg-surface px-4 py-3 align-middle text-sm text-foreground;
291
+ @apply h-full px-4 py-3 align-middle text-sm text-foreground;
292
+
293
+ /* The row's fill, per state, declared on the cell because that is what paints — Firefox clips a
294
+ * row's own background outside the border radius. `.table-root--secondary` re-points two. */
295
+ --table-cell-bg: var(--surface);
296
+ --table-cell-bg-hover: var(--surface-hover);
297
+ --table-cell-bg-selected: var(--accent-soft);
298
+ --table-cell-bg-selected-hover: var(--accent-soft-hover);
299
+ --table-cell-bg-drop-target: var(--accent-soft);
300
+
301
+ background-color: var(--table-cell-bg);
273
302
 
274
303
  @apply border-b border-separator-tertiary/50;
275
304
 
@@ -354,24 +383,37 @@
354
383
  -------------------------------------------------------------------------- */
355
384
  .table__column-resizer {
356
385
  /* Match the ::after separator: absolute, right edge, short vertical line */
357
- @apply absolute end-0 top-1/2 h-4 w-px -translate-y-1/2 rounded-sm bg-separator;
386
+ @apply absolute end-0 top-1/2 h-4 w-px -translate-y-1/2 rounded-sm;
358
387
  /* Make it interactive — wider hit area with transparent padding */
359
388
  @apply box-content translate-x-1/2 cursor-col-resize touch-none px-2;
360
389
  /* Reset appearance */
361
390
  @apply border-none bg-clip-content outline-none;
362
391
 
392
+ --table-resizer-bg: var(--separator);
393
+ --table-resizer-bg-hover: var(--accent);
394
+ --table-resizer-bg-resizing: var(--table-resizer-bg-hover);
395
+ --table-resizer-bg-focus-visible: var(--focus);
396
+
397
+ background-color: var(--table-resizer-bg);
398
+
363
399
  &[data-hovered="true"],
364
400
  &:hover {
365
- @apply h-full w-0.5 bg-accent;
401
+ @apply h-full w-0.5;
402
+
403
+ background-color: var(--table-resizer-bg-hover);
366
404
  }
367
405
 
368
406
  &[data-resizing="true"] {
369
- @apply h-full w-0.5 bg-accent;
407
+ @apply h-full w-0.5;
408
+
409
+ background-color: var(--table-resizer-bg-resizing);
370
410
  }
371
411
 
372
412
  &[data-focus-visible="true"],
373
413
  &:focus-visible {
374
- @apply h-full w-0.5 bg-focus;
414
+ @apply h-full w-0.5;
415
+
416
+ background-color: var(--table-resizer-bg-focus-visible);
375
417
  }
376
418
  }
377
419
 
@@ -16,7 +16,7 @@
16
16
  .tabs__list-container {
17
17
  @apply relative bg-default;
18
18
 
19
- border-radius: calc(var(--radius) * 2.5);
19
+ border-radius: min(32px, var(--component-radius));
20
20
 
21
21
  /* Vertical scroller fills the container height so overflow detection
22
22
  engages when the wrapper height is constrained (e.g. h-[240px]) */
@@ -29,10 +29,6 @@
29
29
  > .tabs__list-container__scroll-next {
30
30
  @apply absolute z-2 hidden size-4 cursor-(--cursor-interactive) items-center justify-center rounded-full border-0 bg-transparent p-0 text-foreground outline-none;
31
31
 
32
- /**
33
- * Transitions
34
- * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
35
- */
36
32
  transition: opacity 150ms var(--ease-smooth);
37
33
  @apply motion-reduce:transition-none;
38
34
 
@@ -121,15 +117,16 @@
121
117
 
122
118
  /* Individual tab */
123
119
  .tabs__tab {
124
- @apply relative flex h-8 w-full items-center justify-center rounded-3xl px-4 text-center text-sm font-medium text-muted outline-none no-highlight;
120
+ @apply relative flex h-8 w-full items-center justify-center rounded-component px-4 text-center text-sm font-medium outline-none no-highlight;
121
+
122
+ --tabs-tab-fg: var(--muted);
123
+ --tabs-tab-fg-selected: var(--segment-foreground);
124
+
125
+ color: var(--tabs-tab-fg);
125
126
 
126
127
  z-index: 1;
127
128
  cursor: var(--cursor-interactive);
128
129
 
129
- /**
130
- * Transitions
131
- * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
132
- */
133
130
  transition:
134
131
  color 150ms var(--ease-smooth),
135
132
  background-color 150ms var(--ease-smooth),
@@ -139,7 +136,7 @@
139
136
 
140
137
  /* Selected state */
141
138
  &[data-selected="true"] {
142
- @apply text-segment-foreground;
139
+ color: var(--tabs-tab-fg-selected);
143
140
 
144
141
  /* Sits on top of the indicator, which forced colors paints `Highlight`. `forced-color-adjust`
145
142
  * suppresses the `Canvas` backplate Chromium would otherwise paint behind this label - it
@@ -182,10 +179,6 @@
182
179
  .tabs__separator {
183
180
  @apply pointer-events-none absolute rounded-sm bg-muted/25;
184
181
 
185
- /**
186
- * Transitions
187
- * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
188
- */
189
182
  transition: opacity 150ms var(--ease-smooth);
190
183
  @apply motion-reduce:transition-none;
191
184
 
@@ -221,7 +214,7 @@
221
214
 
222
215
  /* Tab indicator - React Aria's SelectionIndicator */
223
216
  .tabs__indicator {
224
- @apply absolute start-0 top-0 size-full rounded-3xl bg-segment shadow-surface;
217
+ @apply absolute start-0 top-0 size-full rounded-component bg-segment shadow-surface;
225
218
 
226
219
  z-index: -1;
227
220
 
@@ -232,10 +225,6 @@
232
225
  background-color: Highlight;
233
226
  }
234
227
 
235
- /**
236
- * Transitions
237
- * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
238
- */
239
228
  transition-duration: 250ms;
240
229
  transition-property: translate, width, height;
241
230
  transition-timing-function: var(--ease-out-fluid);
@@ -2,12 +2,21 @@
2
2
  .tag {
3
3
  --optical-offset: 0.031em;
4
4
 
5
- @apply relative inline-flex items-center gap-1 rounded-xl font-medium select-none no-highlight;
5
+ @apply relative inline-flex items-center gap-1 font-medium select-none no-highlight;
6
+
7
+ border-radius: min(32px, var(--component-radius));
8
+
9
+ /* The fill and label, per state. The variants re-point these and declare nothing else. */
10
+ --tag-bg: transparent;
11
+ --tag-bg-hover: var(--tag-bg);
12
+ --tag-bg-selected: var(--accent-soft);
13
+ --tag-bg-selected-hover: var(--accent-soft-hover);
14
+ --tag-fg: currentcolor;
15
+ --tag-fg-selected: var(--accent-soft-foreground);
16
+
17
+ background-color: var(--tag-bg);
18
+ color: var(--tag-fg);
6
19
 
7
- /**
8
- * Transitions
9
- * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
10
- */
11
20
  transition:
12
21
  color 100ms var(--ease-smooth),
13
22
  scale 100ms var(--ease-smooth),
@@ -28,6 +37,13 @@
28
37
  outline-offset: -1px;
29
38
  }
30
39
 
40
+ /* Hover state (when not selected or disabled) */
41
+ @media (hover: hover) {
42
+ &:is(:hover, [data-hovered="true"]):not([data-selected="true"]):not([data-disabled="true"]) {
43
+ background-color: var(--tag-bg-hover);
44
+ }
45
+ }
46
+
31
47
  /* SVG icon styling */
32
48
  & svg {
33
49
  @apply pointer-events-none size-3 shrink-0 self-center text-current;
@@ -50,13 +66,15 @@
50
66
 
51
67
  /* Selected state */
52
68
  .tag:is([data-selected="true"], [aria-selected="true"]) {
53
- @apply bg-accent-soft text-accent-soft-foreground;
69
+ background-color: var(--tag-bg-selected);
70
+ color: var(--tag-fg-selected);
71
+
54
72
  @apply forced-selected;
55
73
 
56
74
  /* Selected + Hover state */
57
75
  @media (hover: hover) {
58
76
  &:is(:hover, [data-hovered="true"]) {
59
- @apply bg-accent-soft-hover;
77
+ background-color: var(--tag-bg-selected-hover);
60
78
  }
61
79
  }
62
80
  }
@@ -71,30 +89,20 @@
71
89
  }
72
90
 
73
91
  .tag--lg {
74
- @apply rounded-2xl px-2.5 py-1.5 text-sm;
92
+ @apply px-2.5 py-1.5 text-sm;
75
93
  }
76
94
 
77
95
  /* Variant */
78
96
  .tag--default {
79
- @apply bg-default text-default-foreground;
80
-
81
- /* Hover state (when not selected or disabled) */
82
- @media (hover: hover) {
83
- &:is(:hover, [data-hovered="true"]):not([data-selected="true"]):not([data-disabled="true"]) {
84
- @apply bg-default-hover;
85
- }
86
- }
97
+ --tag-bg: var(--default);
98
+ --tag-bg-hover: var(--default-hover);
99
+ --tag-fg: var(--default-foreground);
87
100
  }
88
101
 
89
102
  .tag--surface {
90
- @apply bg-surface text-surface-foreground;
91
-
92
- /* Hover state (when not selected or disabled) */
93
- @media (hover: hover) {
94
- &:is(:hover, [data-hovered="true"]):not([data-selected="true"]):not([data-disabled="true"]) {
95
- @apply bg-surface-hover;
96
- }
97
- }
103
+ --tag-bg: var(--surface);
104
+ --tag-bg-hover: var(--surface-hover);
105
+ --tag-fg: var(--surface-foreground);
98
106
  }
99
107
 
100
108
  /* Remove Button */
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgB3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
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,6 +1,13 @@
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 py-2 text-base text-field-foreground shadow-field outline-none placeholder:text-field-placeholder sm:text-sm;
3
+ @apply rounded-field border px-3 field-line-md text-field-foreground shadow-field outline-none placeholder:text-field-placeholder;
4
+
5
+ /* The fill, per state. The `--secondary` variant re-points these and declares nothing else. */
6
+ --textarea-bg: var(--field-background, var(--default));
7
+ --textarea-bg-hover: var(--field-hover);
8
+ --textarea-bg-focus: var(--field-focus);
9
+
10
+ background-color: var(--textarea-bg);
4
11
 
5
12
  min-height: 38px;
6
13
 
@@ -17,10 +24,6 @@
17
24
  outline-offset: -1px;
18
25
  }
19
26
 
20
- /**
21
- * Transitions
22
- * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
23
- */
24
27
  transition:
25
28
  background-color 150ms var(--ease-smooth),
26
29
  border-color 150ms var(--ease-smooth),
@@ -30,7 +33,7 @@
30
33
  @media (hover: hover) {
31
34
  &:hover:not(:focus):not(:focus-visible),
32
35
  &[data-hovered="true"]:not([data-focused="true"]):not([data-focus-visible="true"]) {
33
- @apply bg-field-hover;
36
+ background-color: var(--textarea-bg-hover);
34
37
  border-color: var(--field-border-hover);
35
38
  }
36
39
  }
@@ -40,7 +43,7 @@
40
43
  &[data-focused="true"] {
41
44
  @apply status-focused-field;
42
45
  border-color: var(--field-border-focus);
43
- background-color: var(--field-focus);
46
+ background-color: var(--textarea-bg-focus);
44
47
  }
45
48
 
46
49
  /* Focus visible state */
@@ -50,7 +53,7 @@
50
53
 
51
54
  &[data-invalid="true"] {
52
55
  @apply status-invalid-field;
53
- background-color: var(--field-focus);
56
+ background-color: var(--textarea-bg-focus);
54
57
  }
55
58
 
56
59
  /* Disabled state */
@@ -68,37 +71,25 @@
68
71
 
69
72
  .textarea--secondary {
70
73
  @apply shadow-none;
71
- background-color: var(--textarea-bg);
72
74
 
73
75
  --textarea-bg: var(--default);
74
76
  --textarea-bg-hover: var(--default-hover);
75
77
  --textarea-bg-focus: var(--default);
76
-
77
- @media (hover: hover) {
78
- &:hover:not(:focus):not(:focus-visible),
79
- &[data-hovered="true"]:not([data-focused="true"]):not([data-focus-visible="true"]) {
80
- background-color: var(--textarea-bg-hover);
81
- }
82
- }
83
-
84
- &:focus,
85
- &[data-focused="true"] {
86
- background-color: var(--textarea-bg-focus);
87
- }
88
-
89
- /* Focus visible state */
90
- &:focus-visible:not(:focus),
91
- &[data-focus-visible="true"] {
92
- }
93
-
94
- /* Invalid state */
95
- &[data-invalid="true"] {
96
- @apply status-invalid-field;
97
- background-color: var(--textarea-bg-focus);
98
- }
99
78
  }
100
79
 
101
80
  /* Full width modifier */
102
81
  .textarea--full-width {
103
82
  @apply w-full;
104
83
  }
84
+
85
+ /* ==========================================================================
86
+ Size variants
87
+ ========================================================================== */
88
+
89
+ .textarea--sm {
90
+ @apply field-line-sm;
91
+ }
92
+
93
+ .textarea--lg {
94
+ @apply field-line-lg;
95
+ }
@@ -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-3xl));
50
+ border-radius: min(32px, var(--component-radius));
51
51
  }
52
52
 
53
53
  .toast--bottom,
@@ -131,6 +131,8 @@
131
131
  /* Toast close button */
132
132
  .toast__close-button {
133
133
  @apply pointer-events-none absolute -end-1 -top-1 size-5 border-border bg-default opacity-0 sm:border sm:bg-overlay;
134
+
135
+ --toast-close-button-bg-hover: var(--default);
134
136
  transition: opacity 150ms var(--ease-smooth);
135
137
  @apply motion-reduce:transition-none;
136
138
  /* Overrides close button default icon size from 16px to 12px */
@@ -142,7 +144,7 @@
142
144
  @media (hover: hover) {
143
145
  &:hover,
144
146
  &[data-hovered="true"] {
145
- @apply bg-default;
147
+ background-color: var(--toast-close-button-bg-hover);
146
148
  }
147
149
  }
148
150
  }
@@ -38,32 +38,32 @@
38
38
 
39
39
  /* Apply border radius to first button (start edge) */
40
40
  .toggle-button-group--horizontal .toggle-button:first-child {
41
- @apply rounded-s-3xl;
41
+ @apply rounded-s-component;
42
42
  }
43
43
 
44
44
  /* Apply border radius to last button (end edge) */
45
45
  .toggle-button-group--horizontal .toggle-button:last-child {
46
- @apply rounded-e-3xl;
46
+ @apply rounded-e-component;
47
47
  }
48
48
 
49
49
  /* If only one button, apply both rounded edges */
50
50
  .toggle-button-group--horizontal .toggle-button:first-child:last-child {
51
- @apply rounded-3xl;
51
+ @apply rounded-component;
52
52
  }
53
53
 
54
54
  /* Apply border radius to first button (top edge) in vertical */
55
55
  .toggle-button-group--vertical .toggle-button:first-child {
56
- @apply rounded-t-3xl;
56
+ @apply rounded-t-component;
57
57
  }
58
58
 
59
59
  /* Apply border radius to last button (bottom edge) in vertical */
60
60
  .toggle-button-group--vertical .toggle-button:last-child {
61
- @apply rounded-b-3xl;
61
+ @apply rounded-b-component;
62
62
  }
63
63
 
64
64
  /* If only one button in vertical, apply all rounded edges */
65
65
  .toggle-button-group--vertical .toggle-button:first-child:last-child {
66
- @apply rounded-3xl;
66
+ @apply rounded-component;
67
67
  }
68
68
 
69
69
  /* Remove scale transform on active/pressed state for buttons in group */
@@ -93,10 +93,6 @@
93
93
  position: absolute;
94
94
  pointer-events: none;
95
95
 
96
- /**
97
- * Transitions
98
- * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
99
- */
100
96
  transition: opacity 150ms var(--ease-smooth);
101
97
  @apply motion-reduce:transition-none;
102
98
 
@@ -127,7 +123,7 @@
127
123
 
128
124
  /* Restore border radius in detached mode */
129
125
  .toggle-button-group--detached .toggle-button {
130
- @apply rounded-3xl;
126
+ @apply rounded-component;
131
127
  }
132
128
 
133
129
  /* Hide separators in detached mode */