@stacksjs/components 0.2.960 → 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 (63) hide show
  1. package/README.md +5 -1
  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/{SwipeRow-zyjxszhg.stx → SwipeRow-az09d4tb.stx} +3 -1
  23. package/dist/{Switch-vd8k23sr.stx → Switch-7s3bhjg4.stx} +2 -70
  24. package/dist/{TextInput-fge1b7tk.stx → TextInput-4v09vw1r.stx} +2 -70
  25. package/dist/index.js +17 -17
  26. package/dist/settings/settings.js +80 -19
  27. package/dist/ui/button/Button.d.ts +4 -1
  28. package/dist/ui/button/index.d.ts +4 -0
  29. package/dist/ui/date-time-picker/DateTimePicker.d.ts +2 -0
  30. package/dist/ui/list/SwipeRow.d.ts +3 -1
  31. package/dist/ui/settings/SettingsPane.d.ts +6 -3
  32. package/dist/ui/settings/SettingsWindow.d.ts +4 -1
  33. package/dist/ui/settings/index.d.ts +4 -0
  34. package/dist/ui/settings/view.d.ts +3 -0
  35. package/package.json +3 -3
  36. package/{dist/SettingsSidebarGroup-4ag5qjpw.stx → src/theme/macos.css} +0 -57
  37. package/src/ui/appearance-picker/AppearancePicker.stx +2 -70
  38. package/src/ui/button/Button.stx +33 -70
  39. package/src/ui/button/index.ts +9 -0
  40. package/src/ui/checkbox/Checkbox.stx +1 -69
  41. package/src/ui/color-swatches/ColorSwatches.stx +1 -69
  42. package/src/ui/date-time-picker/DateTimePicker.stx +5 -3
  43. package/src/ui/input/NumberInput.stx +2 -70
  44. package/src/ui/input/PasswordInput.stx +2 -70
  45. package/src/ui/input/TextInput.stx +2 -70
  46. package/src/ui/list/SwipeRow.stx +3 -1
  47. package/src/ui/radio-group/RadioGroup.stx +1 -69
  48. package/src/ui/radio-group/RadioGroupOption.stx +1 -69
  49. package/src/ui/segmented-control/SegmentedControl.stx +1 -69
  50. package/src/ui/select/Select.stx +2 -70
  51. package/src/ui/settings/README.md +21 -0
  52. package/src/ui/settings/SettingsGroup.stx +2 -70
  53. package/src/ui/settings/SettingsPane.stx +11 -3
  54. package/src/ui/settings/SettingsPaneHeader.stx +2 -70
  55. package/src/ui/settings/SettingsRow.stx +2 -70
  56. package/src/ui/settings/SettingsSidebarGroup.stx +2 -70
  57. package/src/ui/settings/SettingsSidebarItem.stx +2 -70
  58. package/src/ui/settings/SettingsUpdateRow.stx +1 -69
  59. package/src/ui/settings/SettingsWindow.stx +8 -70
  60. package/src/ui/settings/index.ts +6 -0
  61. package/src/ui/settings/view.ts +93 -21
  62. package/src/ui/slider/Slider.stx +1 -69
  63. package/src/ui/switch/Switch.stx +2 -70
@@ -6,6 +6,9 @@ export const pane = $props.pane || ''
6
6
  export const searchable = $bool($props.searchable, true)
7
7
  export const searchPlaceholder = $props.searchPlaceholder || 'Search'
8
8
  export const storageKey = $props.storageKey || ''
9
+ export const loadingPane = $props.loadingPane || 'Loading settings…'
10
+ export const failedPane = $props.failedPane || 'Could not load this pane.'
11
+ export const retryPane = $props.retryPane || 'Try again'
9
12
  /*
10
13
  * `window` is a window that is all Settings: it fills the viewport and leaves
11
14
  * room for the traffic lights. `sheet` is the same two columns inside a page.
@@ -169,6 +172,9 @@ onMount(() => {
169
172
  storageKey,
170
173
  storage: paneStorage,
171
174
  globalKeys: {{ globalKeys }},
175
+ loadingPane: {{ loadingPane }},
176
+ failedPane: {{ failedPane }},
177
+ retryPane: {{ retryPane }},
172
178
  }, callbacks)
173
179
  }
174
180
 
@@ -328,76 +334,8 @@ defineExpose(api)
328
334
  </div>
329
335
  @endif
330
336
 
331
- <style data-native-exclude>
332
- :where(:root) {
333
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
334
- --stx-mac-font-size: 13px;
335
- --stx-mac-font-size-small: 11px;
336
- --stx-mac-hairline: 0.5px;
337
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
338
- --stx-mac-card-radius: 12px;
339
- --stx-mac-control-radius: 6px;
340
- --stx-mac-row-height: 38px;
341
- --stx-mac-row-inset: 10px;
342
- --stx-mac-sidebar-width: 226px;
343
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
344
- --stx-mac-accent-ink: #ffffff;
345
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
346
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
347
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
348
- --stx-mac-window: #ffffff;
349
- --stx-mac-sidebar: #f2f1f0;
350
- --stx-mac-card: rgba(0, 0, 0, 0.04);
351
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
352
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
353
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
354
- --stx-mac-well: rgba(0, 0, 0, 0.07);
355
- --stx-mac-control: #ffffff;
356
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
357
- --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);
358
- --stx-mac-switch-on: #34c759;
359
- --stx-mac-knob: #ffffff;
360
- --stx-mac-danger: #ff3b30;
361
- }
362
- :where(.dark) {
363
- --stx-mac-accent: var(--stx-accent, #0a84ff);
364
- --stx-mac-accent-ink: #ffffff;
365
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
366
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
367
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
368
- --stx-mac-window: #1e1e1e;
369
- --stx-mac-sidebar: #2a2a2a;
370
- --stx-mac-card: rgba(255, 255, 255, 0.05);
371
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
372
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
373
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
374
- --stx-mac-well: rgba(255, 255, 255, 0.1);
375
- --stx-mac-control: rgba(255, 255, 255, 0.14);
376
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
377
- --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);
378
- --stx-mac-switch-on: #30d158;
379
- --stx-mac-knob: #ffffff;
380
- --stx-mac-danger: #ff453a;
381
- }
382
- @media (max-resolution: 1.5dppx) {
383
- :where(:root) {
384
- --stx-mac-hairline: 1px;
385
- }
386
- }
387
- @media (prefers-contrast: more) {
388
- :where(:root) {
389
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
390
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
391
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
392
- --stx-mac-hairline: 1px;
393
- }
394
- :where(.dark) {
395
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
396
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
397
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
398
- }
399
- }
400
-
337
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
338
+ <style data-native-exclude data-stx-public-style>
401
339
  /*
402
340
  * The measurements are System Settings' own on macOS 26, in points. Each is a
403
341
  * variable so an app can move one without restating the rest.
@@ -28,6 +28,10 @@ export interface SettingsWindowProps {
28
28
  searchPlaceholder?: string
29
29
  /** Remembers the last pane under `stx:settings:<key>`: in local storage, which on a native host is the app's storage. */
30
30
  storageKey?: string
31
+ /** Status and action labels for deferred panes. */
32
+ loadingPane?: string
33
+ failedPane?: string
34
+ retryPane?: string
31
35
  /** `window` fills a titlebar-less window and clears its buttons; `sheet` is a rounded panel inside another window. Default `window`. */
32
36
  presentation?: 'window' | 'sheet'
33
37
  /** Pixels. Default 226. */
@@ -72,6 +76,8 @@ export interface SettingsPaneProps {
72
76
  parent?: string
73
77
  /** Render this pane visible before any script runs. Give it to the pane the window opens on. */
74
78
  active?: boolean
79
+ /** Fetch this inactive pane on first open in a static web build. */
80
+ defer?: boolean
75
81
  className?: string
76
82
  }
77
83
 
@@ -9,6 +9,7 @@
9
9
  */
10
10
  import type { SettingsHistory, SettingsItemInfo, SettingsPaneInfo, SettingsRowInfo, SettingsSearchHit, SettingsTypeAhead } from './core'
11
11
  import type { SettingsTreeStorage } from './native'
12
+ import { loadStaticFragment } from '@stacksjs/stx/static-fragment-client'
12
13
  import { emptySettingsHistory, findSettingsPane, resolveSettingsPane, searchSettings, SETTINGS_HIGHLIGHT_MS, settingsCanGoBack, settingsCanGoForward, settingsHistoryBack, settingsHistoryCurrent, settingsHistoryForward, settingsHistoryVisit, settingsParentPane, settingsResultsAnnouncement, settingsRovingIndex, settingsSidebarPane, settingsStorageName, settingsTypeAheadAdd, settingsTypeAheadMatch } from './core'
13
14
 
14
15
  export interface SettingsWindowOptions {
@@ -27,6 +28,10 @@ export interface SettingsWindowOptions {
27
28
  * document, as in a window that is all Settings, or only inside the shell.
28
29
  */
29
30
  globalKeys?: boolean
31
+ /** Text shown while a deferred pane loads or after a request fails. */
32
+ loadingPane?: string
33
+ failedPane?: string
34
+ retryPane?: string
30
35
  }
31
36
 
32
37
  export interface SettingsPaneDetail {
@@ -59,6 +64,10 @@ export interface SettingsWindowCallbacks {
59
64
  onNavigate?: (detail: SettingsNavigateDetail) => void
60
65
  }
61
66
 
67
+ interface SearchableRow extends SettingsRowInfo {
68
+ position: number
69
+ }
70
+
62
71
  interface InertElement extends HTMLElement {
63
72
  __stx_inert_content?: boolean
64
73
  }
@@ -82,7 +91,9 @@ export class SettingsWindowView {
82
91
  private storageKey: string
83
92
  private readonly storage: SettingsTreeStorage | null
84
93
  private typed: SettingsTypeAhead | null = null
85
- private hits: Array<{ hit: SettingsSearchHit, row: HTMLElement }> = []
94
+ private hits: Array<{ hit: SettingsSearchHit, row: SearchableRow }> = []
95
+ private queuedReveal: SearchableRow | null = null
96
+ private readonly fragmentDownloads = new AbortController()
86
97
  private highlighted: HTMLElement | null = null
87
98
  private highlightTimer: ReturnType<typeof setTimeout> | null = null
88
99
  private readonly disposers: Array<() => void> = []
@@ -99,7 +110,7 @@ export class SettingsWindowView {
99
110
  private readonly title: InertElement | null
100
111
  private readonly body: HTMLElement | null
101
112
 
102
- constructor(private readonly root: HTMLElement, options: SettingsWindowOptions = {}, private readonly callbacks: SettingsWindowCallbacks = {}) {
113
+ constructor(private readonly root: HTMLElement, private readonly options: SettingsWindowOptions = {}, private readonly callbacks: SettingsWindowCallbacks = {}) {
103
114
  this.storageKey = options.storageKey || ''
104
115
  this.storage = options.storage ?? null
105
116
  if (!root.id)
@@ -159,12 +170,11 @@ export class SettingsWindowView {
159
170
  revealSetting(id: string): boolean {
160
171
  if (!id)
161
172
  return false
162
- const row = this.rowElements().find(element => element.getAttribute('data-setting') === id)
163
- const pane = row ? this.paneOf(row) : ''
164
- if (!row || !pane)
173
+ const row = this.searchableRows().find(entry => entry.id === id)
174
+ if (!row)
165
175
  return false
166
- this.open(pane)
167
- this.reveal(row)
176
+ this.open(row.pane)
177
+ this.revealRow(row)
168
178
  return true
169
179
  }
170
180
 
@@ -192,6 +202,7 @@ export class SettingsWindowView {
192
202
  }
193
203
 
194
204
  destroy(): void {
205
+ this.fragmentDownloads.abort()
195
206
  for (const dispose of this.disposers) dispose()
196
207
  this.disposers.length = 0
197
208
  this.clearHighlight()
@@ -253,12 +264,27 @@ export class SettingsWindowView {
253
264
  }))
254
265
  }
255
266
 
256
- private rowElements(): HTMLElement[] {
257
- return this.all(ROW).filter(row => this.paneOf(row) !== '')
267
+ private rowElements(pane: HTMLElement): HTMLElement[] {
268
+ return this.all(ROW, pane).filter(element => element.closest(PANE) === pane)
258
269
  }
259
270
 
260
- private paneOf(element: Element): string {
261
- return element.closest(PANE)?.getAttribute('data-settings-pane') || ''
271
+ private searchableRows(): SearchableRow[] {
272
+ return this.paneElements().flatMap((pane) => {
273
+ const id = pane.getAttribute('data-settings-pane') || ''
274
+ if (!id)
275
+ return []
276
+ if (pane.hasAttribute('data-stx-fragment')) {
277
+ const entries: [string, string, string][] = JSON.parse(pane.getAttribute('data-stx-fragment-metadata') || '[]')
278
+ return entries.map(([setting, label, keywords], position) => ({ id: setting, label: label.trim(), keywords, pane: id, position }))
279
+ }
280
+ return this.rowElements(pane).map((row, position) => ({
281
+ id: row.getAttribute('data-setting') || '',
282
+ label: (row.getAttribute('data-label') || '').trim(),
283
+ keywords: row.getAttribute('data-keywords') || '',
284
+ pane: id,
285
+ position,
286
+ }))
287
+ })
262
288
  }
263
289
 
264
290
  private stored(): string {
@@ -381,6 +407,7 @@ export class SettingsWindowView {
381
407
  const changed = id !== this.current
382
408
  this.current = id
383
409
  if (changed) {
410
+ this.queuedReveal = null
384
411
  this.clearHighlight()
385
412
  // A different screen, not more of the one that was there.
386
413
  if (this.body)
@@ -395,6 +422,43 @@ export class SettingsWindowView {
395
422
  this.store()
396
423
  this.callbacks.onPane?.({ id, title: info.title, parent: settingsParentPane(panes, id) })
397
424
  }
425
+ if (target.hasAttribute('data-stx-fragment') && !target.hasChildNodes())
426
+ void this.loadPane(target)
427
+ }
428
+
429
+ private async loadPane(pane: HTMLElement): Promise<void> {
430
+ const status = document.createElement('p')
431
+ status.setAttribute('role', 'status')
432
+ status.textContent = this.options.loadingPane ?? 'Loading settings…'
433
+ // Replacing a focused Retry button must leave focus in its own pane.
434
+ if (pane.contains(document.activeElement)) {
435
+ pane.setAttribute('tabindex', '-1')
436
+ pane.focus({ preventScroll: true })
437
+ }
438
+ pane.replaceChildren(status)
439
+ pane.setAttribute('aria-busy', 'true')
440
+ const signal = this.fragmentDownloads.signal
441
+ try {
442
+ await loadStaticFragment(pane, signal)
443
+ const reveal = this.queuedReveal
444
+ if (reveal && this.current === reveal.pane && this.paneElement(reveal.pane) === pane) {
445
+ this.queuedReveal = null
446
+ this.revealRow(reveal)
447
+ }
448
+ }
449
+ catch {
450
+ if (signal.aborted || !pane.isConnected)
451
+ return
452
+ status.textContent = this.options.failedPane ?? 'Could not load this pane.'
453
+ const retry = document.createElement('button')
454
+ retry.type = 'button'
455
+ retry.textContent = this.options.retryPane ?? 'Try again'
456
+ retry.addEventListener('click', () => void this.loadPane(pane), { once: true })
457
+ pane.replaceChildren(status, retry)
458
+ }
459
+ finally {
460
+ pane.removeAttribute('aria-busy')
461
+ }
398
462
  }
399
463
 
400
464
  /** One stop in the tab order: the selected item, or the first showing when it is filtered out. */
@@ -437,14 +501,8 @@ export class SettingsWindowView {
437
501
  // -------------------------------------------------------------------------
438
502
 
439
503
  private applySearch(report: boolean): void {
440
- const rows = this.rowElements()
441
- const index: SettingsRowInfo[] = rows.map(row => ({
442
- id: row.getAttribute('data-setting') || '',
443
- label: (row.getAttribute('data-label') || '').trim(),
444
- keywords: row.getAttribute('data-keywords') || '',
445
- pane: this.paneOf(row),
446
- }))
447
- const found = searchSettings(this.query, { panes: this.panes(), items: this.items(), rows: index })
504
+ const rows = this.searchableRows()
505
+ const found = searchSettings(this.query, { panes: this.panes(), items: this.items(), rows })
448
506
  const searching = found.query !== ''
449
507
 
450
508
  this.root.toggleAttribute('data-searching', searching)
@@ -507,10 +565,10 @@ export class SettingsWindowView {
507
565
 
508
566
  private chooseResult(position: number): void {
509
567
  const found = this.hits[position]
510
- if (!found || !found.row.isConnected)
568
+ if (!found)
511
569
  return
512
570
  this.open(found.hit.pane)
513
- this.reveal(found.row)
571
+ this.revealRow(found.row)
514
572
  }
515
573
 
516
574
  private clearSearch(): void {
@@ -523,6 +581,20 @@ export class SettingsWindowView {
523
581
  // Finding a row
524
582
  // -------------------------------------------------------------------------
525
583
 
584
+ private revealRow(hit: SearchableRow): void {
585
+ const pane = this.paneElement(hit.pane)
586
+ if (!pane)
587
+ return
588
+ if (pane.hasAttribute('data-stx-fragment')) {
589
+ this.queuedReveal = hit
590
+ return
591
+ }
592
+ const rows = this.rowElements(pane)
593
+ const row = hit.id ? rows.find(element => element.getAttribute('data-setting') === hit.id) : rows[hit.position]
594
+ if (row)
595
+ this.reveal(row)
596
+ }
597
+
526
598
  private reveal(row: HTMLElement): void {
527
599
  if (this.body) {
528
600
  const frame = this.body.getBoundingClientRect()
@@ -151,76 +151,8 @@ defineExpose({
151
151
  @endif
152
152
  </div>
153
153
 
154
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
154
155
  <style data-native-exclude>
155
- :where(:root) {
156
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
157
- --stx-mac-font-size: 13px;
158
- --stx-mac-font-size-small: 11px;
159
- --stx-mac-hairline: 0.5px;
160
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
161
- --stx-mac-card-radius: 12px;
162
- --stx-mac-control-radius: 6px;
163
- --stx-mac-row-height: 38px;
164
- --stx-mac-row-inset: 10px;
165
- --stx-mac-sidebar-width: 226px;
166
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
167
- --stx-mac-accent-ink: #ffffff;
168
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
169
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
170
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
171
- --stx-mac-window: #ffffff;
172
- --stx-mac-sidebar: #f2f1f0;
173
- --stx-mac-card: rgba(0, 0, 0, 0.04);
174
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
175
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
176
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
177
- --stx-mac-well: rgba(0, 0, 0, 0.07);
178
- --stx-mac-control: #ffffff;
179
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
180
- --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);
181
- --stx-mac-switch-on: #34c759;
182
- --stx-mac-knob: #ffffff;
183
- --stx-mac-danger: #ff3b30;
184
- }
185
- :where(.dark) {
186
- --stx-mac-accent: var(--stx-accent, #0a84ff);
187
- --stx-mac-accent-ink: #ffffff;
188
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
189
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
190
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
191
- --stx-mac-window: #1e1e1e;
192
- --stx-mac-sidebar: #2a2a2a;
193
- --stx-mac-card: rgba(255, 255, 255, 0.05);
194
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
195
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
196
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
197
- --stx-mac-well: rgba(255, 255, 255, 0.1);
198
- --stx-mac-control: rgba(255, 255, 255, 0.14);
199
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
200
- --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);
201
- --stx-mac-switch-on: #30d158;
202
- --stx-mac-knob: #ffffff;
203
- --stx-mac-danger: #ff453a;
204
- }
205
- @media (max-resolution: 1.5dppx) {
206
- :where(:root) {
207
- --stx-mac-hairline: 1px;
208
- }
209
- }
210
- @media (prefers-contrast: more) {
211
- :where(:root) {
212
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
213
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
214
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
215
- --stx-mac-hairline: 1px;
216
- }
217
- :where(.dark) {
218
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
219
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
220
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
221
- }
222
- }
223
-
224
156
  :where([data-stx-slider]) {
225
157
  --stx-slider-track-height: 4px;
226
158
  --stx-slider-knob-width: 20px;
@@ -205,76 +205,8 @@ defineExpose({ isChecked, toggle })
205
205
  </label>
206
206
  @endif
207
207
 
208
- <style data-native-exclude>
209
- :where(:root) {
210
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
211
- --stx-mac-font-size: 13px;
212
- --stx-mac-font-size-small: 11px;
213
- --stx-mac-hairline: 0.5px;
214
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
215
- --stx-mac-card-radius: 12px;
216
- --stx-mac-control-radius: 6px;
217
- --stx-mac-row-height: 38px;
218
- --stx-mac-row-inset: 10px;
219
- --stx-mac-sidebar-width: 226px;
220
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
221
- --stx-mac-accent-ink: #ffffff;
222
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
223
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
224
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
225
- --stx-mac-window: #ffffff;
226
- --stx-mac-sidebar: #f2f1f0;
227
- --stx-mac-card: rgba(0, 0, 0, 0.04);
228
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
229
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
230
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
231
- --stx-mac-well: rgba(0, 0, 0, 0.07);
232
- --stx-mac-control: #ffffff;
233
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
234
- --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);
235
- --stx-mac-switch-on: #34c759;
236
- --stx-mac-knob: #ffffff;
237
- --stx-mac-danger: #ff3b30;
238
- }
239
- :where(.dark) {
240
- --stx-mac-accent: var(--stx-accent, #0a84ff);
241
- --stx-mac-accent-ink: #ffffff;
242
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
243
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
244
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
245
- --stx-mac-window: #1e1e1e;
246
- --stx-mac-sidebar: #2a2a2a;
247
- --stx-mac-card: rgba(255, 255, 255, 0.05);
248
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
249
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
250
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
251
- --stx-mac-well: rgba(255, 255, 255, 0.1);
252
- --stx-mac-control: rgba(255, 255, 255, 0.14);
253
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
254
- --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);
255
- --stx-mac-switch-on: #30d158;
256
- --stx-mac-knob: #ffffff;
257
- --stx-mac-danger: #ff453a;
258
- }
259
- @media (max-resolution: 1.5dppx) {
260
- :where(:root) {
261
- --stx-mac-hairline: 1px;
262
- }
263
- }
264
- @media (prefers-contrast: more) {
265
- :where(:root) {
266
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
267
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
268
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
269
- --stx-mac-hairline: 1px;
270
- }
271
- :where(.dark) {
272
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
273
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
274
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
275
- }
276
- }
277
-
208
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
209
+ <style data-native-exclude data-stx-public-style>
278
210
  .stx-mac-switch-row {
279
211
  display: inline-flex;
280
212
  align-items: center;