@stacksjs/components 0.2.961 → 0.2.962

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 (60) hide show
  1. package/README.md +4 -0
  2. package/dist/{AppearancePicker-30fetv0a.stx → AppearancePicker-34758z53.stx} +2 -70
  3. package/dist/{Button-ghdfqwg0.stx → Button-rns3jhjh.stx} +33 -70
  4. package/dist/{Checkbox-355qsbwd.stx → Checkbox-4g3hemtw.stx} +1 -69
  5. package/dist/{ColorSwatches-ecfxphjy.stx → ColorSwatches-mz9kt78g.stx} +1 -69
  6. package/dist/{DateTimePicker-pz9p8jw4.stx → DateTimePicker-d5984mm1.stx} +5 -3
  7. package/dist/{NumberInput-e2afxyh3.stx → NumberInput-nqqen5a6.stx} +2 -70
  8. package/dist/{PasswordInput-d78bk8r0.stx → PasswordInput-j38f2n01.stx} +2 -70
  9. package/dist/{RadioGroup-ps9kn22f.stx → RadioGroup-mz3pv7he.stx} +1 -69
  10. package/dist/{RadioGroupOption-6hyy1bvb.stx → RadioGroupOption-mk98taz5.stx} +1 -69
  11. package/dist/{SegmentedControl-b93n9n2v.stx → SegmentedControl-jm6tb9f8.stx} +1 -69
  12. package/dist/{Select-p8mgxthn.stx → Select-36s22z6d.stx} +2 -70
  13. package/dist/{SettingsGroup-g1hnxp1p.stx → SettingsGroup-t3emsgk2.stx} +2 -70
  14. package/dist/{SettingsPane-9svk1w3e.stx → SettingsPane-tqe8q5cw.stx} +11 -3
  15. package/dist/{SettingsPaneHeader-am42srhp.stx → SettingsPaneHeader-wznh6dss.stx} +2 -70
  16. package/dist/{SettingsRow-kgda3nv1.stx → SettingsRow-5jgay5ae.stx} +2 -70
  17. package/dist/SettingsSidebarGroup-p5h359bn.stx +57 -0
  18. package/dist/{SettingsSidebarItem-ga2jxq53.stx → SettingsSidebarItem-69zs4b55.stx} +2 -70
  19. package/dist/{SettingsUpdateRow-ajpnqx8a.stx → SettingsUpdateRow-92mmxvpd.stx} +1 -69
  20. package/dist/{SettingsWindow-v7jepxem.stx → SettingsWindow-q0x86xqb.stx} +8 -70
  21. package/dist/{Slider-j59dgw1c.stx → Slider-cebse060.stx} +1 -69
  22. package/dist/{Switch-vd8k23sr.stx → Switch-7s3bhjg4.stx} +2 -70
  23. package/dist/{TextInput-fge1b7tk.stx → TextInput-4v09vw1r.stx} +2 -70
  24. package/dist/index.js +17 -17
  25. package/dist/settings/settings.js +80 -19
  26. package/dist/ui/button/Button.d.ts +4 -1
  27. package/dist/ui/button/index.d.ts +4 -0
  28. package/dist/ui/date-time-picker/DateTimePicker.d.ts +2 -0
  29. package/dist/ui/settings/SettingsPane.d.ts +6 -3
  30. package/dist/ui/settings/SettingsWindow.d.ts +4 -1
  31. package/dist/ui/settings/index.d.ts +4 -0
  32. package/dist/ui/settings/view.d.ts +3 -0
  33. package/package.json +3 -3
  34. package/{dist/SettingsSidebarGroup-4ag5qjpw.stx → src/theme/macos.css} +0 -57
  35. package/src/ui/appearance-picker/AppearancePicker.stx +2 -70
  36. package/src/ui/button/Button.stx +33 -70
  37. package/src/ui/button/index.ts +9 -0
  38. package/src/ui/checkbox/Checkbox.stx +1 -69
  39. package/src/ui/color-swatches/ColorSwatches.stx +1 -69
  40. package/src/ui/date-time-picker/DateTimePicker.stx +5 -3
  41. package/src/ui/input/NumberInput.stx +2 -70
  42. package/src/ui/input/PasswordInput.stx +2 -70
  43. package/src/ui/input/TextInput.stx +2 -70
  44. package/src/ui/radio-group/RadioGroup.stx +1 -69
  45. package/src/ui/radio-group/RadioGroupOption.stx +1 -69
  46. package/src/ui/segmented-control/SegmentedControl.stx +1 -69
  47. package/src/ui/select/Select.stx +2 -70
  48. package/src/ui/settings/README.md +21 -0
  49. package/src/ui/settings/SettingsGroup.stx +2 -70
  50. package/src/ui/settings/SettingsPane.stx +11 -3
  51. package/src/ui/settings/SettingsPaneHeader.stx +2 -70
  52. package/src/ui/settings/SettingsRow.stx +2 -70
  53. package/src/ui/settings/SettingsSidebarGroup.stx +2 -70
  54. package/src/ui/settings/SettingsSidebarItem.stx +2 -70
  55. package/src/ui/settings/SettingsUpdateRow.stx +1 -69
  56. package/src/ui/settings/SettingsWindow.stx +8 -70
  57. package/src/ui/settings/index.ts +6 -0
  58. package/src/ui/settings/view.ts +93 -21
  59. package/src/ui/slider/Slider.stx +1 -69
  60. package/src/ui/switch/Switch.stx +2 -70
package/README.md CHANGED
@@ -158,6 +158,10 @@ The `@component` directive also works if you prefer the Blade style:
158
158
  @endcomponent
159
159
  ```
160
160
 
161
+ ### Shared stylesheets
162
+
163
+ Use `<style src="./theme.css"></style>` to share a local CSS file across components. STX resolves the path relative to the component and hoists one copy of an unscoped stylesheet into the document, including styles used inside STX branches, loops, and deferred panes. For an inline stylesheet that belongs to the whole document, mark it with `data-stx-shared-style`. Styles local to a plain template or shadow root stay with that template. Use root-relative URLs for assets referenced by the CSS. Add `data-native-exclude` when the stylesheet only applies to browser rendering.
164
+
161
165
  ## Usage
162
166
 
163
167
  ### Basic Example
@@ -162,76 +162,8 @@ defineExpose({ value: chosen })
162
162
  </div>
163
163
  @endif
164
164
 
165
- <style data-native-exclude>
166
- :where(:root) {
167
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
168
- --stx-mac-font-size: 13px;
169
- --stx-mac-font-size-small: 11px;
170
- --stx-mac-hairline: 0.5px;
171
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
172
- --stx-mac-card-radius: 12px;
173
- --stx-mac-control-radius: 6px;
174
- --stx-mac-row-height: 38px;
175
- --stx-mac-row-inset: 10px;
176
- --stx-mac-sidebar-width: 226px;
177
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
178
- --stx-mac-accent-ink: #ffffff;
179
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
180
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
181
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
182
- --stx-mac-window: #ffffff;
183
- --stx-mac-sidebar: #f2f1f0;
184
- --stx-mac-card: rgba(0, 0, 0, 0.04);
185
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
186
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
187
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
188
- --stx-mac-well: rgba(0, 0, 0, 0.07);
189
- --stx-mac-control: #ffffff;
190
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
191
- --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);
192
- --stx-mac-switch-on: #34c759;
193
- --stx-mac-knob: #ffffff;
194
- --stx-mac-danger: #ff3b30;
195
- }
196
- :where(.dark) {
197
- --stx-mac-accent: var(--stx-accent, #0a84ff);
198
- --stx-mac-accent-ink: #ffffff;
199
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
200
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
201
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
202
- --stx-mac-window: #1e1e1e;
203
- --stx-mac-sidebar: #2a2a2a;
204
- --stx-mac-card: rgba(255, 255, 255, 0.05);
205
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
206
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
207
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
208
- --stx-mac-well: rgba(255, 255, 255, 0.1);
209
- --stx-mac-control: rgba(255, 255, 255, 0.14);
210
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
211
- --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);
212
- --stx-mac-switch-on: #30d158;
213
- --stx-mac-knob: #ffffff;
214
- --stx-mac-danger: #ff453a;
215
- }
216
- @media (max-resolution: 1.5dppx) {
217
- :where(:root) {
218
- --stx-mac-hairline: 1px;
219
- }
220
- }
221
- @media (prefers-contrast: more) {
222
- :where(:root) {
223
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
224
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
225
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
226
- --stx-mac-hairline: 1px;
227
- }
228
- :where(.dark) {
229
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
230
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
231
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
232
- }
233
- }
234
-
165
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
166
+ <style data-native-exclude data-stx-public-style>
235
167
  :where([data-stx-appearance-picker]) {
236
168
  --stx-appearance-width: 67px;
237
169
  --stx-appearance-height: 44px;
@@ -71,6 +71,9 @@ export const hasLabel = label !== ''
71
71
  * is for a button that has neither.
72
72
  */
73
73
  export const ariaLabel = $props.ariaLabel || $props['aria-label'] || ''
74
+ export const ariaExpanded = String($props.ariaExpanded ?? '')
75
+ export const ariaControls = String($props.ariaControls ?? '')
76
+ export const ariaPressed = String($props.ariaPressed ?? '')
74
77
  export const leftIcon = $props.leftIcon || ''
75
78
  export const rightIcon = $props.rightIcon || ''
76
79
  export const className = $props.className || ''
@@ -245,6 +248,10 @@ const isLoading = useReactiveProp('loading', {{ loading }})
245
248
  // (:ariaLabel="action.label" in a row of icon buttons) stayed on the boxless
246
249
  // scope wrapper and never reached the button, which then had no name at all.
247
250
  const ariaLabelProp = useReactiveProp('ariaLabel', {{ ariaLabel }}, { parse: value => value == null ? '' : String(value) })
251
+ // Parent signals retain their types. Stringify at the button so false is present.
252
+ const ariaExpandedProp = useReactiveProp('ariaExpanded', {{ ariaExpanded }})
253
+ const ariaControlsProp = useReactiveProp('ariaControls', {{ ariaControls }})
254
+ const ariaPressedProp = useReactiveProp('ariaPressed', {{ ariaPressed }})
248
255
  const disabledProp = useReactiveProp('disabled', {{ disabled }})
249
256
 
250
257
  // Loading implies disabled, the same combination the server computes for the
@@ -285,6 +292,12 @@ function onClick(event) {
285
292
  :aria-busy="isLoading() ? 'true' : 'false'"
286
293
  @if(ariaLabel)aria-label="{{ ariaLabel }}"@endif
287
294
  :aria-label="String(ariaLabelProp() ?? '') || null"
295
+ @if(ariaExpanded)aria-expanded="{{ ariaExpanded }}"@endif
296
+ :aria-expanded="String(ariaExpandedProp() ?? '') || null"
297
+ @if(ariaControls)aria-controls="{{ ariaControls }}"@endif
298
+ :aria-controls="String(ariaControlsProp() ?? '') || null"
299
+ @if(ariaPressed)aria-pressed="{{ ariaPressed }}"@endif
300
+ :aria-pressed="String(ariaPressedProp() ?? '') || null"
288
301
  @click="onClick($event)"
289
302
  ><slot /></button>
290
303
  <button
@@ -302,6 +315,12 @@ function onClick(event) {
302
315
  :aria-busy="isLoading() ? 'true' : 'false'"
303
316
  @if(ariaLabel)aria-label="{{ ariaLabel }}"@endif
304
317
  :aria-label="String(ariaLabelProp() ?? '') || null"
318
+ @if(ariaExpanded)aria-expanded="{{ ariaExpanded }}"@endif
319
+ :aria-expanded="String(ariaExpandedProp() ?? '') || null"
320
+ @if(ariaControls)aria-controls="{{ ariaControls }}"@endif
321
+ :aria-controls="String(ariaControlsProp() ?? '') || null"
322
+ @if(ariaPressed)aria-pressed="{{ ariaPressed }}"@endif
323
+ :aria-pressed="String(ariaPressedProp() ?? '') || null"
305
324
  @click="onClick($event)"
306
325
  >
307
326
  <div data-native="ActivityIndicator" :show="isLoading()" class="{{ nativeTintClass }}" :color="platformControls ? null : legacyNativeTint" role="status"></div>
@@ -325,6 +344,12 @@ function onClick(event) {
325
344
  :aria-busy="isLoading() ? 'true' : 'false'"
326
345
  @if(ariaLabel)aria-label="{{ ariaLabel }}"@endif
327
346
  :aria-label="String(ariaLabelProp() ?? '') || null"
347
+ @if(ariaExpanded)aria-expanded="{{ ariaExpanded }}"@endif
348
+ :aria-expanded="String(ariaExpandedProp() ?? '') || null"
349
+ @if(ariaControls)aria-controls="{{ ariaControls }}"@endif
350
+ :aria-controls="String(ariaControlsProp() ?? '') || null"
351
+ @if(ariaPressed)aria-pressed="{{ ariaPressed }}"@endif
352
+ :aria-pressed="String(ariaPressedProp() ?? '') || null"
328
353
  @if(tooltip)title="{{ tooltip }}"@endif
329
354
  @click="onClick($event)"
330
355
  >
@@ -358,6 +383,12 @@ function onClick(event) {
358
383
  :aria-busy="isLoading() ? 'true' : 'false'"
359
384
  @if(ariaLabel)aria-label="{{ ariaLabel }}"@endif
360
385
  :aria-label="String(ariaLabelProp() ?? '') || null"
386
+ @if(ariaExpanded)aria-expanded="{{ ariaExpanded }}"@endif
387
+ :aria-expanded="String(ariaExpandedProp() ?? '') || null"
388
+ @if(ariaControls)aria-controls="{{ ariaControls }}"@endif
389
+ :aria-controls="String(ariaControlsProp() ?? '') || null"
390
+ @if(ariaPressed)aria-pressed="{{ ariaPressed }}"@endif
391
+ :aria-pressed="String(ariaPressedProp() ?? '') || null"
361
392
  @if(tooltip)title="{{ tooltip }}"@endif
362
393
  @click="onClick($event)"
363
394
  >
@@ -423,76 +454,8 @@ function onClick(event) {
423
454
  </button>
424
455
  @endif
425
456
 
426
- <style data-native-exclude>
427
- :where(:root) {
428
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
429
- --stx-mac-font-size: 13px;
430
- --stx-mac-font-size-small: 11px;
431
- --stx-mac-hairline: 0.5px;
432
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
433
- --stx-mac-card-radius: 12px;
434
- --stx-mac-control-radius: 6px;
435
- --stx-mac-row-height: 38px;
436
- --stx-mac-row-inset: 10px;
437
- --stx-mac-sidebar-width: 226px;
438
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
439
- --stx-mac-accent-ink: #ffffff;
440
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
441
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
442
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
443
- --stx-mac-window: #ffffff;
444
- --stx-mac-sidebar: #f2f1f0;
445
- --stx-mac-card: rgba(0, 0, 0, 0.04);
446
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
447
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
448
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
449
- --stx-mac-well: rgba(0, 0, 0, 0.07);
450
- --stx-mac-control: #ffffff;
451
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
452
- --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);
453
- --stx-mac-switch-on: #34c759;
454
- --stx-mac-knob: #ffffff;
455
- --stx-mac-danger: #ff3b30;
456
- }
457
- :where(.dark) {
458
- --stx-mac-accent: var(--stx-accent, #0a84ff);
459
- --stx-mac-accent-ink: #ffffff;
460
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
461
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
462
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
463
- --stx-mac-window: #1e1e1e;
464
- --stx-mac-sidebar: #2a2a2a;
465
- --stx-mac-card: rgba(255, 255, 255, 0.05);
466
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
467
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
468
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
469
- --stx-mac-well: rgba(255, 255, 255, 0.1);
470
- --stx-mac-control: rgba(255, 255, 255, 0.14);
471
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
472
- --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);
473
- --stx-mac-switch-on: #30d158;
474
- --stx-mac-knob: #ffffff;
475
- --stx-mac-danger: #ff453a;
476
- }
477
- @media (max-resolution: 1.5dppx) {
478
- :where(:root) {
479
- --stx-mac-hairline: 1px;
480
- }
481
- }
482
- @media (prefers-contrast: more) {
483
- :where(:root) {
484
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
485
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
486
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
487
- --stx-mac-hairline: 1px;
488
- }
489
- :where(.dark) {
490
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
491
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
492
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
493
- }
494
- }
495
-
457
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
458
+ <style data-native-exclude data-stx-public-style data-stx-shared-style>
496
459
  .stx-mac-button {
497
460
  --stx-mac-button-pressed: color-mix(in srgb, var(--stx-mac-ink) 8%, transparent);
498
461
  display: inline-flex;
@@ -206,76 +206,8 @@ defineExpose({ isChecked })
206
206
  </div>
207
207
  @endif
208
208
 
209
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
209
210
  <style data-native-exclude>
210
- :where(:root) {
211
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
212
- --stx-mac-font-size: 13px;
213
- --stx-mac-font-size-small: 11px;
214
- --stx-mac-hairline: 0.5px;
215
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
216
- --stx-mac-card-radius: 12px;
217
- --stx-mac-control-radius: 6px;
218
- --stx-mac-row-height: 38px;
219
- --stx-mac-row-inset: 10px;
220
- --stx-mac-sidebar-width: 226px;
221
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
222
- --stx-mac-accent-ink: #ffffff;
223
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
224
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
225
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
226
- --stx-mac-window: #ffffff;
227
- --stx-mac-sidebar: #f2f1f0;
228
- --stx-mac-card: rgba(0, 0, 0, 0.04);
229
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
230
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
231
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
232
- --stx-mac-well: rgba(0, 0, 0, 0.07);
233
- --stx-mac-control: #ffffff;
234
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
235
- --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);
236
- --stx-mac-switch-on: #34c759;
237
- --stx-mac-knob: #ffffff;
238
- --stx-mac-danger: #ff3b30;
239
- }
240
- :where(.dark) {
241
- --stx-mac-accent: var(--stx-accent, #0a84ff);
242
- --stx-mac-accent-ink: #ffffff;
243
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
244
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
245
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
246
- --stx-mac-window: #1e1e1e;
247
- --stx-mac-sidebar: #2a2a2a;
248
- --stx-mac-card: rgba(255, 255, 255, 0.05);
249
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
250
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
251
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
252
- --stx-mac-well: rgba(255, 255, 255, 0.1);
253
- --stx-mac-control: rgba(255, 255, 255, 0.14);
254
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
255
- --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);
256
- --stx-mac-switch-on: #30d158;
257
- --stx-mac-knob: #ffffff;
258
- --stx-mac-danger: #ff453a;
259
- }
260
- @media (max-resolution: 1.5dppx) {
261
- :where(:root) {
262
- --stx-mac-hairline: 1px;
263
- }
264
- }
265
- @media (prefers-contrast: more) {
266
- :where(:root) {
267
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
268
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
269
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
270
- --stx-mac-hairline: 1px;
271
- }
272
- :where(.dark) {
273
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
274
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
275
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
276
- }
277
- }
278
-
279
211
  .stx-mac-checkbox-row {
280
212
  display: inline-flex;
281
213
  align-items: flex-start;
@@ -124,76 +124,8 @@ defineExpose({ value: chosen })
124
124
  ><span class="stx-color-swatch-dot"></span><span class="stx-color-swatch-caption" aria-hidden="true" :text="swatch.label"></span></button>
125
125
  </div>
126
126
 
127
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
127
128
  <style data-native-exclude>
128
- :where(:root) {
129
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
130
- --stx-mac-font-size: 13px;
131
- --stx-mac-font-size-small: 11px;
132
- --stx-mac-hairline: 0.5px;
133
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
134
- --stx-mac-card-radius: 12px;
135
- --stx-mac-control-radius: 6px;
136
- --stx-mac-row-height: 38px;
137
- --stx-mac-row-inset: 10px;
138
- --stx-mac-sidebar-width: 226px;
139
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
140
- --stx-mac-accent-ink: #ffffff;
141
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
142
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
143
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
144
- --stx-mac-window: #ffffff;
145
- --stx-mac-sidebar: #f2f1f0;
146
- --stx-mac-card: rgba(0, 0, 0, 0.04);
147
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
148
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
149
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
150
- --stx-mac-well: rgba(0, 0, 0, 0.07);
151
- --stx-mac-control: #ffffff;
152
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
153
- --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);
154
- --stx-mac-switch-on: #34c759;
155
- --stx-mac-knob: #ffffff;
156
- --stx-mac-danger: #ff3b30;
157
- }
158
- :where(.dark) {
159
- --stx-mac-accent: var(--stx-accent, #0a84ff);
160
- --stx-mac-accent-ink: #ffffff;
161
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
162
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
163
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
164
- --stx-mac-window: #1e1e1e;
165
- --stx-mac-sidebar: #2a2a2a;
166
- --stx-mac-card: rgba(255, 255, 255, 0.05);
167
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
168
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
169
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
170
- --stx-mac-well: rgba(255, 255, 255, 0.1);
171
- --stx-mac-control: rgba(255, 255, 255, 0.14);
172
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
173
- --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);
174
- --stx-mac-switch-on: #30d158;
175
- --stx-mac-knob: #ffffff;
176
- --stx-mac-danger: #ff453a;
177
- }
178
- @media (max-resolution: 1.5dppx) {
179
- :where(:root) {
180
- --stx-mac-hairline: 1px;
181
- }
182
- }
183
- @media (prefers-contrast: more) {
184
- :where(:root) {
185
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
186
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
187
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
188
- --stx-mac-hairline: 1px;
189
- }
190
- :where(.dark) {
191
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
192
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
193
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
194
- }
195
- }
196
-
197
129
  :where([data-stx-color-swatches]) {
198
130
  --stx-swatch-size: 24px;
199
131
  --stx-swatch-gap: 12px;
@@ -11,6 +11,8 @@ const step = $num($props.minuteStep, 1)
11
11
  export const minuteStep = Number.isInteger(step) && step > 0 && 60 % step === 0 ? step : 1
12
12
  export const placeholder = $props.placeholder || 'Choose date and time'
13
13
  export const label = $props.label || 'Schedule'
14
+ export const triggerLabel = label
15
+ export const triggerPlaceholder = placeholder
14
16
  export const instanceId = $uid
15
17
  export const rootClasses = `relative inline-block ${$props.className || ''}`.trim()
16
18
  export const triggerClasses = 'inline-flex items-center gap-2 rounded-control bg-field px-3 py-2 text-sm text-fg ring-1 ring-inset ring-line-strong hover:bg-field-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:opacity-50'
@@ -209,10 +211,10 @@ defineExpose({ open, close })
209
211
  </script>
210
212
 
211
213
  <div class="{{ rootClasses }}" x-ref="dateTimeRoot" data-date-time-picker>
212
- <button type="button" class="{{ triggerClasses }}" x-ref="dateTimeTrigger" data-date-time-trigger :disabled="disabled" aria-haspopup="dialog" :aria-expanded="isOpen() ? 'true' : 'false'" :aria-controls="panelId" :aria-label="label" @click="toggle()">
213
- <span x-text="displayValue"></span>
214
+ <button type="button" class="{{ triggerClasses }}" x-ref="dateTimeTrigger" data-date-time-trigger :disabled="disabled" aria-haspopup="dialog" aria-expanded="false" :aria-expanded="isOpen() ? 'true' : 'false'" :aria-controls="panelId" aria-label="{{ triggerLabel }}" :aria-label="label" @click="toggle()">
215
+ <span :text="displayValue">{{ triggerPlaceholder }}</span>
214
216
  </button>
215
- <div :if="isOpen" class="{{ panelClasses }}" role="dialog" data-native="Modal" visible="false" :id="panelId" :aria-labelledby="titleId" :aria-describedby="zoneId" data-date-time-panel>
217
+ <div :if="isOpen" class="{{ panelClasses }}" role="dialog" data-native="Modal" visible="false" hidden :hidden="!isOpen()" :id="panelId" :aria-labelledby="titleId" :aria-describedby="zoneId" data-date-time-panel>
216
218
  <h3 class="mb-2 text-sm font-semibold text-fg" :id="titleId" x-text="label">{{ label }}</h3>
217
219
  <p class="mb-3 text-xs text-fg-muted" :id="zoneId">Timezone: <span x-text="timeZone"></span></p>
218
220
  <div class="mb-3 flex flex-wrap gap-2">
@@ -278,76 +278,8 @@ defineExpose({ value: inputValue, increment, decrement })
278
278
  </div>
279
279
  @endif
280
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
-
281
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
282
+ <style data-native-exclude data-stx-public-style>
351
283
  .stx-mac-stepper-wrap {
352
284
  display: inline-block;
353
285
  max-width: 100%;
@@ -380,76 +380,8 @@ defineExpose({ value: inputValue })
380
380
  </div>
381
381
  @endif
382
382
 
383
- <style data-native-exclude>
384
- :where(:root) {
385
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
386
- --stx-mac-font-size: 13px;
387
- --stx-mac-font-size-small: 11px;
388
- --stx-mac-hairline: 0.5px;
389
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
390
- --stx-mac-card-radius: 12px;
391
- --stx-mac-control-radius: 6px;
392
- --stx-mac-row-height: 38px;
393
- --stx-mac-row-inset: 10px;
394
- --stx-mac-sidebar-width: 226px;
395
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
396
- --stx-mac-accent-ink: #ffffff;
397
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
398
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
399
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
400
- --stx-mac-window: #ffffff;
401
- --stx-mac-sidebar: #f2f1f0;
402
- --stx-mac-card: rgba(0, 0, 0, 0.04);
403
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
404
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
405
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
406
- --stx-mac-well: rgba(0, 0, 0, 0.07);
407
- --stx-mac-control: #ffffff;
408
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
409
- --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);
410
- --stx-mac-switch-on: #34c759;
411
- --stx-mac-knob: #ffffff;
412
- --stx-mac-danger: #ff3b30;
413
- }
414
- :where(.dark) {
415
- --stx-mac-accent: var(--stx-accent, #0a84ff);
416
- --stx-mac-accent-ink: #ffffff;
417
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
418
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
419
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
420
- --stx-mac-window: #1e1e1e;
421
- --stx-mac-sidebar: #2a2a2a;
422
- --stx-mac-card: rgba(255, 255, 255, 0.05);
423
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
424
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
425
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
426
- --stx-mac-well: rgba(255, 255, 255, 0.1);
427
- --stx-mac-control: rgba(255, 255, 255, 0.14);
428
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
429
- --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);
430
- --stx-mac-switch-on: #30d158;
431
- --stx-mac-knob: #ffffff;
432
- --stx-mac-danger: #ff453a;
433
- }
434
- @media (max-resolution: 1.5dppx) {
435
- :where(:root) {
436
- --stx-mac-hairline: 1px;
437
- }
438
- }
439
- @media (prefers-contrast: more) {
440
- :where(:root) {
441
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
442
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
443
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
444
- --stx-mac-hairline: 1px;
445
- }
446
- :where(.dark) {
447
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
448
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
449
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
450
- }
451
- }
452
-
383
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
384
+ <style data-native-exclude data-stx-public-style>
453
385
  .stx-mac-field-wrap {
454
386
  display: block;
455
387
  width: var(--stx-mac-field-width, 100%);
@@ -163,76 +163,8 @@ defineExpose({ selected, selectValue })
163
163
  @endif
164
164
  </component>
165
165
 
166
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
166
167
  <style data-native-exclude>
167
- :where(:root) {
168
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
169
- --stx-mac-font-size: 13px;
170
- --stx-mac-font-size-small: 11px;
171
- --stx-mac-hairline: 0.5px;
172
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
173
- --stx-mac-card-radius: 12px;
174
- --stx-mac-control-radius: 6px;
175
- --stx-mac-row-height: 38px;
176
- --stx-mac-row-inset: 10px;
177
- --stx-mac-sidebar-width: 226px;
178
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
179
- --stx-mac-accent-ink: #ffffff;
180
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
181
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
182
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
183
- --stx-mac-window: #ffffff;
184
- --stx-mac-sidebar: #f2f1f0;
185
- --stx-mac-card: rgba(0, 0, 0, 0.04);
186
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
187
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
188
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
189
- --stx-mac-well: rgba(0, 0, 0, 0.07);
190
- --stx-mac-control: #ffffff;
191
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
192
- --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);
193
- --stx-mac-switch-on: #34c759;
194
- --stx-mac-knob: #ffffff;
195
- --stx-mac-danger: #ff3b30;
196
- }
197
- :where(.dark) {
198
- --stx-mac-accent: var(--stx-accent, #0a84ff);
199
- --stx-mac-accent-ink: #ffffff;
200
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
201
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
202
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
203
- --stx-mac-window: #1e1e1e;
204
- --stx-mac-sidebar: #2a2a2a;
205
- --stx-mac-card: rgba(255, 255, 255, 0.05);
206
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
207
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
208
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
209
- --stx-mac-well: rgba(255, 255, 255, 0.1);
210
- --stx-mac-control: rgba(255, 255, 255, 0.14);
211
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
212
- --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);
213
- --stx-mac-switch-on: #30d158;
214
- --stx-mac-knob: #ffffff;
215
- --stx-mac-danger: #ff453a;
216
- }
217
- @media (max-resolution: 1.5dppx) {
218
- :where(:root) {
219
- --stx-mac-hairline: 1px;
220
- }
221
- }
222
- @media (prefers-contrast: more) {
223
- :where(:root) {
224
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
225
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
226
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
227
- --stx-mac-hairline: 1px;
228
- }
229
- :where(.dark) {
230
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
231
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
232
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
233
- }
234
- }
235
-
236
168
  .stx-mac-radio-group {
237
169
  display: flex;
238
170
  flex-direction: column;