@stacksjs/components 0.2.867 → 0.2.869

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 (109) hide show
  1. package/dist/AppearancePicker-61r20jpp.stx +351 -0
  2. package/dist/{Button-sebyqeva.stx → Button-pg8mzsq3.stx} +249 -0
  3. package/dist/Checkbox-52mhrzkz.stx +417 -0
  4. package/dist/ColorSwatches-ecfxphjy.stx +287 -0
  5. package/dist/{NumberInput-axcfj9y8.stx → NumberInput-e2afxyh3.stx} +303 -0
  6. package/dist/{PasswordInput-8m3109tp.stx → PasswordInput-n2ven456.stx} +315 -0
  7. package/dist/RadioGroup-ps9kn22f.stx +329 -0
  8. package/dist/RadioGroupOption-6hyy1bvb.stx +246 -0
  9. package/dist/{SegmentedControl-fr69q4gb.stx → SegmentedControl-7q0t8c9s.stx} +170 -1
  10. package/dist/{Select-1cnqbcmg.stx → Select-ygzchedx.stx} +266 -0
  11. package/dist/SettingsGroup-dkae46k5.stx +200 -0
  12. package/dist/SettingsPane-jbd1gbdt.stx +50 -0
  13. package/dist/SettingsPaneHeader-f0cvkqs7.stx +188 -0
  14. package/dist/SettingsRow-4cxbsf1q.stx +424 -0
  15. package/dist/SettingsSidebarGroup-p2ygv5yy.stx +108 -0
  16. package/dist/SettingsSidebarItem-x8fsn3w5.stx +228 -0
  17. package/dist/SettingsWindow-mm490ymt.stx +537 -0
  18. package/dist/Slider-j59dgw1c.stx +377 -0
  19. package/dist/Switch-ga9ap8n8.stx +374 -0
  20. package/dist/{TextInput-tsvfwxmg.stx → TextInput-tyqzz3jy.stx} +325 -0
  21. package/dist/index.d.ts +6 -0
  22. package/dist/index.js +35 -24
  23. package/dist/settings/settings.js +757 -0
  24. package/dist/ui/appearance-picker/AppearancePicker.d.ts +12 -0
  25. package/dist/ui/appearance-picker/index.d.ts +16 -0
  26. package/dist/ui/button/Button.d.ts +24 -1
  27. package/dist/ui/button/index.d.ts +1 -0
  28. package/dist/ui/checkbox/Checkbox.d.ts +9 -1
  29. package/dist/ui/checkbox/index.d.ts +1 -0
  30. package/dist/ui/color-swatches/ColorSwatches.d.ts +26 -0
  31. package/dist/ui/color-swatches/index.d.ts +18 -0
  32. package/dist/ui/input/NumberInput.d.ts +11 -1
  33. package/dist/ui/input/PasswordInput.d.ts +9 -1
  34. package/dist/ui/input/TextInput.d.ts +12 -1
  35. package/dist/ui/input/index.d.ts +7 -3
  36. package/dist/ui/radio-group/RadioGroup.d.ts +14 -2
  37. package/dist/ui/radio-group/RadioGroupOption.d.ts +6 -1
  38. package/dist/ui/radio-group/index.d.ts +2 -0
  39. package/dist/ui/segmented-control/SegmentedControl.d.ts +9 -1
  40. package/dist/ui/segmented-control/index.d.ts +1 -0
  41. package/dist/ui/select/Select.d.ts +10 -1
  42. package/dist/ui/select/index.d.ts +1 -0
  43. package/dist/ui/settings/SettingsGroup.d.ts +30 -0
  44. package/dist/ui/settings/SettingsPane.d.ts +19 -0
  45. package/dist/ui/settings/SettingsPaneHeader.d.ts +20 -0
  46. package/dist/ui/settings/SettingsRow.d.ts +53 -0
  47. package/dist/ui/settings/SettingsSidebarGroup.d.ts +11 -0
  48. package/dist/ui/settings/SettingsSidebarItem.d.ts +22 -0
  49. package/dist/ui/settings/SettingsWindow.d.ts +22 -0
  50. package/dist/ui/settings/core.d.ts +146 -0
  51. package/dist/ui/settings/index.d.ts +73 -0
  52. package/dist/ui/settings/settings.d.ts +8 -0
  53. package/dist/ui/settings/view.d.ts +36 -0
  54. package/dist/ui/slider/Slider.d.ts +24 -0
  55. package/dist/ui/slider/core.d.ts +33 -0
  56. package/dist/ui/slider/index.d.ts +20 -0
  57. package/dist/ui/switch/Switch.d.ts +10 -1
  58. package/dist/ui/switch/index.d.ts +2 -1
  59. package/dist/utils/mac-theme.d.ts +24 -0
  60. package/package.json +8 -3
  61. package/src/index.ts +6 -0
  62. package/src/ui/appearance-picker/AppearancePicker.stx +351 -0
  63. package/src/ui/appearance-picker/README.md +61 -0
  64. package/src/ui/appearance-picker/index.ts +22 -0
  65. package/src/ui/button/Button.stx +249 -0
  66. package/src/ui/button/README.md +21 -0
  67. package/src/ui/button/index.ts +8 -0
  68. package/src/ui/checkbox/Checkbox.stx +275 -0
  69. package/src/ui/checkbox/index.ts +2 -0
  70. package/src/ui/color-swatches/ColorSwatches.stx +287 -0
  71. package/src/ui/color-swatches/README.md +66 -0
  72. package/src/ui/color-swatches/index.ts +25 -0
  73. package/src/ui/input/NumberInput.stx +303 -0
  74. package/src/ui/input/PasswordInput.stx +315 -0
  75. package/src/ui/input/TextInput.stx +325 -0
  76. package/src/ui/input/index.ts +9 -3
  77. package/src/ui/radio-group/README.md +17 -0
  78. package/src/ui/radio-group/RadioGroup.stx +184 -6
  79. package/src/ui/radio-group/RadioGroupOption.stx +178 -2
  80. package/src/ui/radio-group/index.ts +4 -0
  81. package/src/ui/segmented-control/SegmentedControl.stx +170 -1
  82. package/src/ui/segmented-control/index.ts +2 -0
  83. package/src/ui/select/README.md +12 -0
  84. package/src/ui/select/Select.stx +266 -0
  85. package/src/ui/select/index.ts +2 -0
  86. package/src/ui/settings/README.md +221 -0
  87. package/src/ui/settings/SettingsGroup.stx +200 -0
  88. package/src/ui/settings/SettingsPane.stx +50 -0
  89. package/src/ui/settings/SettingsPaneHeader.stx +188 -0
  90. package/src/ui/settings/SettingsRow.stx +424 -0
  91. package/src/ui/settings/SettingsSidebarGroup.stx +108 -0
  92. package/src/ui/settings/SettingsSidebarItem.stx +228 -0
  93. package/src/ui/settings/SettingsWindow.stx +537 -0
  94. package/src/ui/settings/core.ts +359 -0
  95. package/src/ui/settings/index.ts +111 -0
  96. package/src/ui/settings/settings.ts +8 -0
  97. package/src/ui/settings/view.ts +740 -0
  98. package/src/ui/slider/README.md +91 -0
  99. package/src/ui/slider/Slider.stx +377 -0
  100. package/src/ui/slider/core.ts +120 -0
  101. package/src/ui/slider/index.ts +34 -0
  102. package/src/ui/switch/README.md +11 -0
  103. package/src/ui/switch/Switch.stx +217 -0
  104. package/src/ui/switch/index.ts +4 -1
  105. package/src/utils/mac-theme.ts +95 -0
  106. package/dist/Checkbox-80myyzzm.stx +0 -142
  107. package/dist/RadioGroup-smqcqgds.stx +0 -151
  108. package/dist/RadioGroupOption-twcw1b2a.stx +0 -70
  109. package/dist/Switch-s8yf2rvm.stx +0 -157
@@ -0,0 +1,66 @@
1
+ # ColorSwatches
2
+
3
+ A row of colour dots to pick one from, as System Settings offers its accent colours. The chosen dot has a ring around it and its name written underneath.
4
+
5
+ ```html
6
+ <script client>
7
+ const accent = state('multi')
8
+ const accents = [
9
+ { value: 'multi', label: 'Multicolour', color: 'conic-gradient(from 210deg, #ff5e5b, #ffb400, #62c554, #2fb0e8, #4b6ef5, #b05bd6, #ff5e5b)' },
10
+ { value: 'blue', label: 'Blue', color: '#3478f6' },
11
+ { value: 'purple', label: 'Purple', color: '#8c3d9a' },
12
+ { value: 'graphite', label: 'Graphite', color: '#989898' },
13
+ ]
14
+ </script>
15
+
16
+ <ColorSwatches v-model:value="accent" :options="accents" label="Accent colour" />
17
+ ```
18
+
19
+ ## Props
20
+
21
+ | Prop | Default | What it does |
22
+ |---|---|---|
23
+ | `value` | `''` | The chosen option's value. `v-model:value`. |
24
+ | `options` | `[]` | `{ value, color, label?, disabled? }`, or a bare string, which is a colour named after itself. `color` is any CSS colour or gradient. The list is reactive. |
25
+ | `label` | none | The accessible name of the group. Inside a `<SettingsRow>` it can be left out: the row's label names the group. |
26
+ | `caption` | `true` | Write the chosen colour's name under it, and keep room for it so choosing one moves nothing. |
27
+ | `disabled` | `false` | Nothing can be chosen. One option can be disabled on its own. |
28
+ | `id`, `className` | | On the root element. |
29
+
30
+ ## Events
31
+
32
+ | Event | Payload | When |
33
+ |---|---|---|
34
+ | `change` | the value | A different colour was chosen. |
35
+ | `update:value` | the value | The same moment. This is what `v-model:value` listens to. |
36
+
37
+ ## Keys
38
+
39
+ The dots are a radio group with one tab stop, on the chosen dot (or the first, when nothing is chosen).
40
+
41
+ | Key | Does |
42
+ |---|---|
43
+ | Arrow Right, Arrow Down | chooses the next dot, round to the first |
44
+ | Arrow Left, Arrow Up | chooses the one before, round to the last |
45
+ | Home, End | chooses the first, the last |
46
+ | Space, Enter | chooses the focused dot |
47
+
48
+ A disabled dot is stepped over.
49
+
50
+ ## Accessibility
51
+
52
+ The root is `role="radiogroup"` and each dot a `<button role="radio">` with `aria-checked` and its label as `aria-label`. The caption under the chosen dot is hidden from a screen reader, which has already read the name. Give every option a `label`: without one the name read out is the raw value.
53
+
54
+ ## Styling
55
+
56
+ The ring is the accent colour (`--stx-mac-accent`) and the caption the secondary ink. The ring stays the accent colour in a window that is not the key window, as it does in System Settings.
57
+
58
+ | Variable | Default |
59
+ |---|---|
60
+ | `--stx-swatch-size` | `24px` |
61
+ | `--stx-swatch-gap` | `12px` |
62
+ | `--stx-swatch-ring`, `--stx-swatch-ring-gap` | `2px`, `2px` |
63
+ | `--stx-swatch-ring-color` | the accent |
64
+ | `--stx-swatch-caption-gap`, `--stx-swatch-caption-height` | `4px`, `13px` |
65
+
66
+ The dots wrap on to another line when the row is too narrow for them. A caption can be wider than its dot and is centred under it, so the first and last may reach past the ends of the row.
@@ -0,0 +1,25 @@
1
+ export { default as ColorSwatches } from './ColorSwatches.stx'
2
+
3
+ /** One colour to choose. A bare string is a colour named after itself. */
4
+ export interface ColorSwatchOption {
5
+ value: string
6
+ /** Any CSS colour or gradient. */
7
+ color: string
8
+ /** Its name: read out, and written under it when chosen. Default the value. */
9
+ label?: string
10
+ disabled?: boolean
11
+ }
12
+
13
+ export interface ColorSwatchesProps {
14
+ /** The chosen option's value. `v-model:value`. */
15
+ value?: string
16
+ options: Array<ColorSwatchOption | string>
17
+ /** The accessible name of the group. Left out inside a `<SettingsRow>`, the row's label names it. */
18
+ label?: string
19
+ disabled?: boolean
20
+ /** Write the chosen colour's name under it, and keep room for it. Default true. */
21
+ caption?: boolean
22
+ id?: string
23
+ className?: string
24
+ onChange?: (value: string) => void
25
+ }
@@ -35,6 +35,16 @@ export const step = $num($props.step, 1)
35
35
  export const showControls = $bool($props.showControls, true)
36
36
  export const className = $props.className || ''
37
37
  export const inputClassName = $props.inputClassName || ''
38
+ /*
39
+ * `variant="mac"` draws the stepper a Mac draws: a narrow field with its
40
+ * digits against the right edge, and beside it a 15x22 capsule holding an up
41
+ * and a down chevron. The field is the same <input type="number">, so the
42
+ * arrow keys step it as the browser does, and the two buttons are the ones
43
+ * the default look has. Only the classes change, to `stx-mac-stepper`, which
44
+ * this file's <style> block draws from the `--stx-mac-*` tokens. `size` is
45
+ * not read; the field is as wide as `--stx-mac-stepper-width` (56px unset).
46
+ */
47
+ export const mac = $props.variant === 'mac'
38
48
 
39
49
  /*
40
50
  * Padding decides the height here too, with no `h-*` to override it: an app
@@ -135,6 +145,58 @@ function decrement() {
135
145
  defineExpose({ value: inputValue, increment, decrement })
136
146
  </script>
137
147
 
148
+ @if(mac)
149
+ <div class="stx-mac-stepper-wrap {{ className }}">
150
+ @if(label)
151
+ <label for="{{ inputId }}" class="stx-mac-field-label" @if(error)data-error="true"@endif>
152
+ {{ label }}
153
+ @if(required)
154
+ <span class="stx-mac-field-required">*</span>
155
+ @endif
156
+ </label>
157
+ @endif
158
+
159
+ <div class="stx-mac-stepper">
160
+ <input
161
+ @if(name)name="{{ name }}"@endif
162
+ @if(autocomplete)autocomplete="{{ autocomplete }}"@endif
163
+ @if(form)form="{{ form }}"@endif
164
+ @if(inputMode)inputmode="{{ inputMode }}"@endif
165
+ @if(enterKeyHint)enterkeyhint="{{ enterKeyHint }}"@endif
166
+ type="number"
167
+ id="{{ inputId }}"
168
+ class="stx-mac-field stx-mac-stepper-field {{ inputClassName }}"
169
+ value="{{ value }}"
170
+ :value="inputValue()"
171
+ placeholder="{{ placeholder }}"
172
+ :placeholder="String(placeholderText() ?? '')"
173
+ @if(disabled)disabled@endif
174
+ @if(readonly)readonly@endif
175
+ @if(required)required@endif
176
+ @if(min !== undefined)min="{{ min }}"@endif
177
+ @if(max !== undefined)max="{{ max }}"@endif
178
+ step="{{ step }}"
179
+ @input="onInput($event)"
180
+ @change="onChange($event)"
181
+ :aria-invalid="{{ error ? 'true' : 'false' }}"
182
+ @if(helperText)aria-describedby="{{ helperId }}"@endif
183
+ />
184
+
185
+ @if(showControls && !disabled && !readonly)
186
+ <div class="stx-mac-stepper-buttons">
187
+ <button type="button" @click="increment()" class="stx-mac-stepper-button stx-mac-stepper-up" aria-label="Increment"></button>
188
+ <button type="button" @click="decrement()" class="stx-mac-stepper-button stx-mac-stepper-down" aria-label="Decrement"></button>
189
+ </div>
190
+ @endif
191
+ </div>
192
+
193
+ @if(helperText)
194
+ <p id="{{ helperId }}" class="stx-mac-field-helper" @if(error)data-error="true"@endif>
195
+ {{ helperText }}
196
+ </p>
197
+ @endif
198
+ </div>
199
+ @else
138
200
  <div class="w-full {{ className }}">
139
201
  @if(label)
140
202
  <label for="{{ inputId }}" class="{{ labelClasses }}">
@@ -214,3 +276,244 @@ defineExpose({ value: inputValue, increment, decrement })
214
276
  </p>
215
277
  @endif
216
278
  </div>
279
+ @endif
280
+
281
+ <style data-native-exclude>
282
+ :where(:root) {
283
+ --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
284
+ --stx-mac-font-size: 13px;
285
+ --stx-mac-font-size-small: 11px;
286
+ --stx-mac-hairline: 0.5px;
287
+ --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
288
+ --stx-mac-card-radius: 12px;
289
+ --stx-mac-control-radius: 6px;
290
+ --stx-mac-row-height: 38px;
291
+ --stx-mac-row-inset: 10px;
292
+ --stx-mac-sidebar-width: 226px;
293
+ --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
294
+ --stx-mac-accent-ink: #ffffff;
295
+ --stx-mac-ink: rgba(0, 0, 0, 0.85);
296
+ --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
297
+ --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
298
+ --stx-mac-window: #ffffff;
299
+ --stx-mac-sidebar: #f2f1f0;
300
+ --stx-mac-card: rgba(0, 0, 0, 0.04);
301
+ --stx-mac-separator: rgba(0, 0, 0, 0.1);
302
+ --stx-mac-hover: rgba(0, 0, 0, 0.05);
303
+ --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
304
+ --stx-mac-well: rgba(0, 0, 0, 0.07);
305
+ --stx-mac-control: #ffffff;
306
+ --stx-mac-control-line: rgba(0, 0, 0, 0.12);
307
+ --stx-mac-control-shadow: 0 0.5px 1.5px rgba(0, 0, 0, 0.14), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
308
+ --stx-mac-switch-on: #34c759;
309
+ --stx-mac-knob: #ffffff;
310
+ --stx-mac-danger: #ff3b30;
311
+ }
312
+ :where(.dark) {
313
+ --stx-mac-accent: var(--stx-accent, #0a84ff);
314
+ --stx-mac-accent-ink: #ffffff;
315
+ --stx-mac-ink: rgba(255, 255, 255, 0.85);
316
+ --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
317
+ --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
318
+ --stx-mac-window: #1e1e1e;
319
+ --stx-mac-sidebar: #2a2a2a;
320
+ --stx-mac-card: rgba(255, 255, 255, 0.05);
321
+ --stx-mac-separator: rgba(255, 255, 255, 0.1);
322
+ --stx-mac-hover: rgba(255, 255, 255, 0.06);
323
+ --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
324
+ --stx-mac-well: rgba(255, 255, 255, 0.1);
325
+ --stx-mac-control: rgba(255, 255, 255, 0.14);
326
+ --stx-mac-control-line: rgba(255, 255, 255, 0.06);
327
+ --stx-mac-control-shadow: 0 0.5px 1.5px rgba(0, 0, 0, 0.4), inset 0 0.5px 0 rgba(255, 255, 255, 0.12);
328
+ --stx-mac-switch-on: #30d158;
329
+ --stx-mac-knob: #ffffff;
330
+ --stx-mac-danger: #ff453a;
331
+ }
332
+ @media (max-resolution: 1.5dppx) {
333
+ :where(:root) {
334
+ --stx-mac-hairline: 1px;
335
+ }
336
+ }
337
+ @media (prefers-contrast: more) {
338
+ :where(:root) {
339
+ --stx-mac-separator: rgba(0, 0, 0, 0.4);
340
+ --stx-mac-control-line: rgba(0, 0, 0, 0.5);
341
+ --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
342
+ --stx-mac-hairline: 1px;
343
+ }
344
+ :where(.dark) {
345
+ --stx-mac-separator: rgba(255, 255, 255, 0.45);
346
+ --stx-mac-control-line: rgba(255, 255, 255, 0.5);
347
+ --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
348
+ }
349
+ }
350
+
351
+ .stx-mac-stepper-wrap {
352
+ display: inline-block;
353
+ max-width: 100%;
354
+ font-family: var(--stx-mac-font);
355
+ font-size: var(--stx-mac-font-size);
356
+ letter-spacing: -0.08px;
357
+ -webkit-font-smoothing: antialiased;
358
+ color: var(--stx-mac-ink);
359
+ cursor: default;
360
+ }
361
+
362
+ .stx-mac-field-label {
363
+ display: block;
364
+ margin-bottom: 4px;
365
+ line-height: 16px;
366
+ -webkit-user-select: none;
367
+ user-select: none;
368
+ }
369
+
370
+ .stx-mac-field-label[data-error='true'],
371
+ .stx-mac-field-required,
372
+ .stx-mac-field-helper[data-error='true'] {
373
+ color: var(--stx-mac-danger);
374
+ }
375
+
376
+ .stx-mac-field-box {
377
+ position: relative;
378
+ display: flex;
379
+ align-items: center;
380
+ }
381
+
382
+ .stx-mac-field {
383
+ --stx-mac-field-line: inset 0 0 0 var(--stx-mac-hairline) var(--stx-mac-control-line);
384
+ display: block;
385
+ flex: 1 1 auto;
386
+ box-sizing: border-box;
387
+ width: 100%;
388
+ min-width: 0;
389
+ height: 24px;
390
+ margin: 0;
391
+ padding: 0 7px;
392
+ border: 0;
393
+ border-radius: var(--stx-mac-control-radius);
394
+ background: var(--stx-mac-control);
395
+ box-shadow: var(--stx-mac-field-line);
396
+ color: var(--stx-mac-ink);
397
+ font: inherit;
398
+ letter-spacing: inherit;
399
+ -webkit-appearance: none;
400
+ appearance: none;
401
+ outline: none;
402
+ transition: box-shadow 150ms ease;
403
+ }
404
+
405
+ .stx-mac-field::placeholder {
406
+ color: var(--stx-mac-ink-tertiary);
407
+ }
408
+
409
+ .stx-mac-field:focus-visible {
410
+ box-shadow: var(--stx-mac-field-line), var(--stx-mac-focus-ring);
411
+ }
412
+
413
+ .stx-mac-field[aria-invalid='true'] {
414
+ --stx-mac-field-line: inset 0 0 0 1px var(--stx-mac-danger);
415
+ }
416
+
417
+ .stx-mac-field:disabled {
418
+ opacity: 0.5;
419
+ }
420
+
421
+ .stx-mac-field-helper {
422
+ margin: 4px 0 0;
423
+ font-size: var(--stx-mac-font-size-small);
424
+ line-height: 14px;
425
+ letter-spacing: 0;
426
+ color: var(--stx-mac-ink-secondary);
427
+ }
428
+
429
+ @media (prefers-reduced-motion: reduce) {
430
+ .stx-mac-field {
431
+ transition: none;
432
+ }
433
+ }
434
+
435
+ .stx-mac-stepper {
436
+ display: inline-flex;
437
+ align-items: center;
438
+ gap: 4px;
439
+ }
440
+
441
+ /* Two classes, so these win over the plain field's rules whichever component's stylesheet the page loads last. */
442
+ .stx-mac-field.stx-mac-stepper-field {
443
+ flex: none;
444
+ width: var(--stx-mac-stepper-width, 56px);
445
+ text-align: right;
446
+ font-variant-numeric: tabular-nums;
447
+ -moz-appearance: textfield;
448
+ }
449
+
450
+ .stx-mac-field.stx-mac-stepper-field::-webkit-inner-spin-button,
451
+ .stx-mac-field.stx-mac-stepper-field::-webkit-outer-spin-button {
452
+ margin: 0;
453
+ -webkit-appearance: none;
454
+ }
455
+
456
+ .stx-mac-stepper-buttons {
457
+ --stx-mac-stepper-pressed: color-mix(in srgb, var(--stx-mac-ink) 10%, transparent);
458
+ display: flex;
459
+ flex: none;
460
+ flex-direction: column;
461
+ width: 15px;
462
+ height: 22px;
463
+ overflow: hidden;
464
+ border-radius: 7.5px;
465
+ background: var(--stx-mac-control);
466
+ box-shadow: var(--stx-mac-control-shadow);
467
+ }
468
+
469
+ .stx-mac-stepper-buttons:has(:focus-visible) {
470
+ box-shadow: var(--stx-mac-control-shadow), var(--stx-mac-focus-ring);
471
+ }
472
+
473
+ .stx-mac-stepper-button {
474
+ position: relative;
475
+ flex: 1 1 0;
476
+ width: 15px;
477
+ margin: 0;
478
+ padding: 0;
479
+ border: 0;
480
+ background: transparent;
481
+ color: var(--stx-mac-ink);
482
+ -webkit-appearance: none;
483
+ appearance: none;
484
+ cursor: default;
485
+ outline: none;
486
+ }
487
+
488
+ .stx-mac-stepper-button:active {
489
+ background: var(--stx-mac-stepper-pressed);
490
+ }
491
+
492
+ /* Each chevron is the corner of a small square turned on its point. */
493
+ .stx-mac-stepper-button::before {
494
+ content: '';
495
+ position: absolute;
496
+ left: 5.25px;
497
+ box-sizing: border-box;
498
+ width: 4.5px;
499
+ height: 4.5px;
500
+ border: solid currentColor;
501
+ border-width: 1.5px 0 0 1.5px;
502
+ }
503
+
504
+ .stx-mac-stepper-up::before {
505
+ top: 5px;
506
+ transform: rotate(45deg);
507
+ }
508
+
509
+ .stx-mac-stepper-down::before {
510
+ top: 1.5px;
511
+ transform: rotate(225deg);
512
+ }
513
+
514
+ @media (prefers-contrast: more) {
515
+ .stx-mac-stepper-buttons {
516
+ box-shadow: inset 0 0 0 1px var(--stx-mac-control-line);
517
+ }
518
+ }
519
+ </style>