@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
@@ -66,76 +66,8 @@ function onKey(event) {
66
66
  <slot :disabled="disabled" />
67
67
  </component>
68
68
 
69
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
69
70
  <style data-native-exclude>
70
- :where(:root) {
71
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
72
- --stx-mac-font-size: 13px;
73
- --stx-mac-font-size-small: 11px;
74
- --stx-mac-hairline: 0.5px;
75
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
76
- --stx-mac-card-radius: 12px;
77
- --stx-mac-control-radius: 6px;
78
- --stx-mac-row-height: 38px;
79
- --stx-mac-row-inset: 10px;
80
- --stx-mac-sidebar-width: 226px;
81
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
82
- --stx-mac-accent-ink: #ffffff;
83
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
84
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
85
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
86
- --stx-mac-window: #ffffff;
87
- --stx-mac-sidebar: #f2f1f0;
88
- --stx-mac-card: rgba(0, 0, 0, 0.04);
89
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
90
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
91
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
92
- --stx-mac-well: rgba(0, 0, 0, 0.07);
93
- --stx-mac-control: #ffffff;
94
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
95
- --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);
96
- --stx-mac-switch-on: #34c759;
97
- --stx-mac-knob: #ffffff;
98
- --stx-mac-danger: #ff3b30;
99
- }
100
- :where(.dark) {
101
- --stx-mac-accent: var(--stx-accent, #0a84ff);
102
- --stx-mac-accent-ink: #ffffff;
103
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
104
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
105
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
106
- --stx-mac-window: #1e1e1e;
107
- --stx-mac-sidebar: #2a2a2a;
108
- --stx-mac-card: rgba(255, 255, 255, 0.05);
109
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
110
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
111
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
112
- --stx-mac-well: rgba(255, 255, 255, 0.1);
113
- --stx-mac-control: rgba(255, 255, 255, 0.14);
114
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
115
- --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);
116
- --stx-mac-switch-on: #30d158;
117
- --stx-mac-knob: #ffffff;
118
- --stx-mac-danger: #ff453a;
119
- }
120
- @media (max-resolution: 1.5dppx) {
121
- :where(:root) {
122
- --stx-mac-hairline: 1px;
123
- }
124
- }
125
- @media (prefers-contrast: more) {
126
- :where(:root) {
127
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
128
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
129
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
130
- --stx-mac-hairline: 1px;
131
- }
132
- :where(.dark) {
133
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
134
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
135
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
136
- }
137
- }
138
-
139
71
  [data-stx-radio-option][data-checked="true"] {
140
72
  background-color: rgb(30 58 138 / 0.75);
141
73
  color: white;
@@ -200,76 +200,8 @@ defineExpose({ selected })
200
200
  ><span class="truncate" :class="labelClasses(segment)" :text="segment.label"></span></button>
201
201
  </div>
202
202
 
203
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
203
204
  <style data-native-exclude>
204
- :where(:root) {
205
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
206
- --stx-mac-font-size: 13px;
207
- --stx-mac-font-size-small: 11px;
208
- --stx-mac-hairline: 0.5px;
209
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
210
- --stx-mac-card-radius: 12px;
211
- --stx-mac-control-radius: 6px;
212
- --stx-mac-row-height: 38px;
213
- --stx-mac-row-inset: 10px;
214
- --stx-mac-sidebar-width: 226px;
215
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
216
- --stx-mac-accent-ink: #ffffff;
217
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
218
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
219
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
220
- --stx-mac-window: #ffffff;
221
- --stx-mac-sidebar: #f2f1f0;
222
- --stx-mac-card: rgba(0, 0, 0, 0.04);
223
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
224
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
225
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
226
- --stx-mac-well: rgba(0, 0, 0, 0.07);
227
- --stx-mac-control: #ffffff;
228
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
229
- --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);
230
- --stx-mac-switch-on: #34c759;
231
- --stx-mac-knob: #ffffff;
232
- --stx-mac-danger: #ff3b30;
233
- }
234
- :where(.dark) {
235
- --stx-mac-accent: var(--stx-accent, #0a84ff);
236
- --stx-mac-accent-ink: #ffffff;
237
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
238
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
239
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
240
- --stx-mac-window: #1e1e1e;
241
- --stx-mac-sidebar: #2a2a2a;
242
- --stx-mac-card: rgba(255, 255, 255, 0.05);
243
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
244
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
245
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
246
- --stx-mac-well: rgba(255, 255, 255, 0.1);
247
- --stx-mac-control: rgba(255, 255, 255, 0.14);
248
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
249
- --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);
250
- --stx-mac-switch-on: #30d158;
251
- --stx-mac-knob: #ffffff;
252
- --stx-mac-danger: #ff453a;
253
- }
254
- @media (max-resolution: 1.5dppx) {
255
- :where(:root) {
256
- --stx-mac-hairline: 1px;
257
- }
258
- }
259
- @media (prefers-contrast: more) {
260
- :where(:root) {
261
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
262
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
263
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
264
- --stx-mac-hairline: 1px;
265
- }
266
- :where(.dark) {
267
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
268
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
269
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
270
- }
271
- }
272
-
273
205
  .stx-mac-segmented {
274
206
  display: inline-flex;
275
207
  box-sizing: border-box;
@@ -342,76 +342,8 @@ defineExpose({ value: selectedValue, options: optionList })
342
342
  </div>
343
343
  @endif
344
344
 
345
- <style data-native-exclude>
346
- :where(:root) {
347
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
348
- --stx-mac-font-size: 13px;
349
- --stx-mac-font-size-small: 11px;
350
- --stx-mac-hairline: 0.5px;
351
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
352
- --stx-mac-card-radius: 12px;
353
- --stx-mac-control-radius: 6px;
354
- --stx-mac-row-height: 38px;
355
- --stx-mac-row-inset: 10px;
356
- --stx-mac-sidebar-width: 226px;
357
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
358
- --stx-mac-accent-ink: #ffffff;
359
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
360
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
361
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
362
- --stx-mac-window: #ffffff;
363
- --stx-mac-sidebar: #f2f1f0;
364
- --stx-mac-card: rgba(0, 0, 0, 0.04);
365
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
366
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
367
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
368
- --stx-mac-well: rgba(0, 0, 0, 0.07);
369
- --stx-mac-control: #ffffff;
370
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
371
- --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);
372
- --stx-mac-switch-on: #34c759;
373
- --stx-mac-knob: #ffffff;
374
- --stx-mac-danger: #ff3b30;
375
- }
376
- :where(.dark) {
377
- --stx-mac-accent: var(--stx-accent, #0a84ff);
378
- --stx-mac-accent-ink: #ffffff;
379
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
380
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
381
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
382
- --stx-mac-window: #1e1e1e;
383
- --stx-mac-sidebar: #2a2a2a;
384
- --stx-mac-card: rgba(255, 255, 255, 0.05);
385
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
386
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
387
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
388
- --stx-mac-well: rgba(255, 255, 255, 0.1);
389
- --stx-mac-control: rgba(255, 255, 255, 0.14);
390
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
391
- --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);
392
- --stx-mac-switch-on: #30d158;
393
- --stx-mac-knob: #ffffff;
394
- --stx-mac-danger: #ff453a;
395
- }
396
- @media (max-resolution: 1.5dppx) {
397
- :where(:root) {
398
- --stx-mac-hairline: 1px;
399
- }
400
- }
401
- @media (prefers-contrast: more) {
402
- :where(:root) {
403
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
404
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
405
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
406
- --stx-mac-hairline: 1px;
407
- }
408
- :where(.dark) {
409
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
410
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
411
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
412
- }
413
- }
414
-
345
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
346
+ <style data-native-exclude data-stx-public-style>
415
347
  .stx-mac-popup-field {
416
348
  display: inline-flex;
417
349
  flex-direction: column;
@@ -97,76 +97,8 @@ if (native) {
97
97
  </section>
98
98
  @endif
99
99
 
100
- <style data-native-exclude>
101
- :where(:root) {
102
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
103
- --stx-mac-font-size: 13px;
104
- --stx-mac-font-size-small: 11px;
105
- --stx-mac-hairline: 0.5px;
106
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
107
- --stx-mac-card-radius: 12px;
108
- --stx-mac-control-radius: 6px;
109
- --stx-mac-row-height: 38px;
110
- --stx-mac-row-inset: 10px;
111
- --stx-mac-sidebar-width: 226px;
112
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
113
- --stx-mac-accent-ink: #ffffff;
114
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
115
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
116
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
117
- --stx-mac-window: #ffffff;
118
- --stx-mac-sidebar: #f2f1f0;
119
- --stx-mac-card: rgba(0, 0, 0, 0.04);
120
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
121
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
122
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
123
- --stx-mac-well: rgba(0, 0, 0, 0.07);
124
- --stx-mac-control: #ffffff;
125
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
126
- --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);
127
- --stx-mac-switch-on: #34c759;
128
- --stx-mac-knob: #ffffff;
129
- --stx-mac-danger: #ff3b30;
130
- }
131
- :where(.dark) {
132
- --stx-mac-accent: var(--stx-accent, #0a84ff);
133
- --stx-mac-accent-ink: #ffffff;
134
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
135
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
136
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
137
- --stx-mac-window: #1e1e1e;
138
- --stx-mac-sidebar: #2a2a2a;
139
- --stx-mac-card: rgba(255, 255, 255, 0.05);
140
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
141
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
142
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
143
- --stx-mac-well: rgba(255, 255, 255, 0.1);
144
- --stx-mac-control: rgba(255, 255, 255, 0.14);
145
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
146
- --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);
147
- --stx-mac-switch-on: #30d158;
148
- --stx-mac-knob: #ffffff;
149
- --stx-mac-danger: #ff453a;
150
- }
151
- @media (max-resolution: 1.5dppx) {
152
- :where(:root) {
153
- --stx-mac-hairline: 1px;
154
- }
155
- }
156
- @media (prefers-contrast: more) {
157
- :where(:root) {
158
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
159
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
160
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
161
- --stx-mac-hairline: 1px;
162
- }
163
- :where(.dark) {
164
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
165
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
166
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
167
- }
168
- }
169
-
100
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
101
+ <style data-native-exclude data-stx-public-style>
170
102
  /*
171
103
  * The card. No border and no clipping: a pop-up menu or a focus ring inside a
172
104
  * row has to be able to leave it.
@@ -6,8 +6,10 @@ import { SETTINGS_NATIVE } from './native-theme'
6
6
  * sidebar item carries; a pane with a `parent` is a sub-pane, reached by a
7
7
  * navigation row and not from the sidebar.
8
8
  *
9
- * Every pane is in the page from the start and all but one are hidden. The
10
- * shell shows the open one; `active` leaves this one showing before it has.
9
+ * The shell shows the open pane. `active` leaves it showing before the
10
+ * shell runs. In static web builds, `defer` moves an inactive pane's
11
+ * contents into an asset fetched when the pane opens. Request-rendered web
12
+ * builds can serve it through the owning page if deferred regions are enabled.
11
13
  *
12
14
  * On a native host ($native) a pane is a scroll view of its own, so each pane
13
15
  * keeps its place when the window moves between them.
@@ -17,6 +19,7 @@ export const title = $props.title || paneId
17
19
  export const keywords = $props.keywords || ''
18
20
  export const parent = $props.parent || ''
19
21
  export const active = $bool($props.active)
22
+ export const deferred = $bool($props.defer)
20
23
  export const role = parent ? 'region' : 'tabpanel'
21
24
  export const className = $props.className || ''
22
25
  export const T = SETTINGS_NATIVE
@@ -58,12 +61,17 @@ export const T = SETTINGS_NATIVE
58
61
  aria-label="{{ title }}"
59
62
  class="stx-settings-pane {{ className }}"
60
63
  hidden
64
+ @if(deferred)
65
+ data-stx-defer-fragment="settings-{{ paneId }}"
66
+ data-stx-fragment-index="data-settings-row data-setting data-label data-keywords"
67
+ data-stx-fragment-index-boundary="data-stx-settings"
68
+ @endif
61
69
  >
62
70
  <slot />
63
71
  </section>
64
72
  @endif
65
73
 
66
- <style data-native-exclude>
74
+ <style data-native-exclude data-stx-public-style>
67
75
  .stx-settings-pane { display: block; min-width: 0; outline: 0; }
68
76
  .stx-settings-pane[hidden] { display: none; }
69
77
  </style>
@@ -54,76 +54,8 @@ const detail = useReactiveProp('description', {{ description }})
54
54
  </header>
55
55
  @endif
56
56
 
57
- <style data-native-exclude>
58
- :where(:root) {
59
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
60
- --stx-mac-font-size: 13px;
61
- --stx-mac-font-size-small: 11px;
62
- --stx-mac-hairline: 0.5px;
63
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
64
- --stx-mac-card-radius: 12px;
65
- --stx-mac-control-radius: 6px;
66
- --stx-mac-row-height: 38px;
67
- --stx-mac-row-inset: 10px;
68
- --stx-mac-sidebar-width: 226px;
69
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
70
- --stx-mac-accent-ink: #ffffff;
71
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
72
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
73
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
74
- --stx-mac-window: #ffffff;
75
- --stx-mac-sidebar: #f2f1f0;
76
- --stx-mac-card: rgba(0, 0, 0, 0.04);
77
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
78
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
79
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
80
- --stx-mac-well: rgba(0, 0, 0, 0.07);
81
- --stx-mac-control: #ffffff;
82
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
83
- --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);
84
- --stx-mac-switch-on: #34c759;
85
- --stx-mac-knob: #ffffff;
86
- --stx-mac-danger: #ff3b30;
87
- }
88
- :where(.dark) {
89
- --stx-mac-accent: var(--stx-accent, #0a84ff);
90
- --stx-mac-accent-ink: #ffffff;
91
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
92
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
93
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
94
- --stx-mac-window: #1e1e1e;
95
- --stx-mac-sidebar: #2a2a2a;
96
- --stx-mac-card: rgba(255, 255, 255, 0.05);
97
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
98
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
99
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
100
- --stx-mac-well: rgba(255, 255, 255, 0.1);
101
- --stx-mac-control: rgba(255, 255, 255, 0.14);
102
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
103
- --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);
104
- --stx-mac-switch-on: #30d158;
105
- --stx-mac-knob: #ffffff;
106
- --stx-mac-danger: #ff453a;
107
- }
108
- @media (max-resolution: 1.5dppx) {
109
- :where(:root) {
110
- --stx-mac-hairline: 1px;
111
- }
112
- }
113
- @media (prefers-contrast: more) {
114
- :where(:root) {
115
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
116
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
117
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
118
- --stx-mac-hairline: 1px;
119
- }
120
- :where(.dark) {
121
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
122
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
123
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
124
- }
125
- }
126
-
57
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
58
+ <style data-native-exclude data-stx-public-style>
127
59
  :where([data-settings-pane-header]) {
128
60
  --stx-settings-tone-grey: #8e8e93;
129
61
  --stx-settings-tone-blue: #007aff;
@@ -189,76 +189,8 @@ defineExpose({ labelId, descriptionId, nameControl })
189
189
  </div>
190
190
  @endif
191
191
 
192
- <style data-native-exclude>
193
- :where(:root) {
194
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
195
- --stx-mac-font-size: 13px;
196
- --stx-mac-font-size-small: 11px;
197
- --stx-mac-hairline: 0.5px;
198
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
199
- --stx-mac-card-radius: 12px;
200
- --stx-mac-control-radius: 6px;
201
- --stx-mac-row-height: 38px;
202
- --stx-mac-row-inset: 10px;
203
- --stx-mac-sidebar-width: 226px;
204
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
205
- --stx-mac-accent-ink: #ffffff;
206
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
207
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
208
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
209
- --stx-mac-window: #ffffff;
210
- --stx-mac-sidebar: #f2f1f0;
211
- --stx-mac-card: rgba(0, 0, 0, 0.04);
212
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
213
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
214
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
215
- --stx-mac-well: rgba(0, 0, 0, 0.07);
216
- --stx-mac-control: #ffffff;
217
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
218
- --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);
219
- --stx-mac-switch-on: #34c759;
220
- --stx-mac-knob: #ffffff;
221
- --stx-mac-danger: #ff3b30;
222
- }
223
- :where(.dark) {
224
- --stx-mac-accent: var(--stx-accent, #0a84ff);
225
- --stx-mac-accent-ink: #ffffff;
226
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
227
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
228
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
229
- --stx-mac-window: #1e1e1e;
230
- --stx-mac-sidebar: #2a2a2a;
231
- --stx-mac-card: rgba(255, 255, 255, 0.05);
232
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
233
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
234
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
235
- --stx-mac-well: rgba(255, 255, 255, 0.1);
236
- --stx-mac-control: rgba(255, 255, 255, 0.14);
237
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
238
- --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);
239
- --stx-mac-switch-on: #30d158;
240
- --stx-mac-knob: #ffffff;
241
- --stx-mac-danger: #ff453a;
242
- }
243
- @media (max-resolution: 1.5dppx) {
244
- :where(:root) {
245
- --stx-mac-hairline: 1px;
246
- }
247
- }
248
- @media (prefers-contrast: more) {
249
- :where(:root) {
250
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
251
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
252
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
253
- --stx-mac-hairline: 1px;
254
- }
255
- :where(.dark) {
256
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
257
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
258
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
259
- }
260
- }
261
-
192
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
193
+ <style data-native-exclude data-stx-public-style>
262
194
  :where([data-settings-row]) {
263
195
  /* The tile colours a Settings icon is drawn on. */
264
196
  --stx-settings-tone-grey: #8e8e93;
@@ -0,0 +1,57 @@
1
+ <script server>
2
+ import { SETTINGS_NATIVE } from './native-theme'
3
+
4
+ /*
5
+ * <SettingsSidebarGroup>: a run of sidebar items, set a little apart from the
6
+ * next. System Settings gives its groups no headings; `label` is there for
7
+ * the window that needs one.
8
+ *
9
+ * On a native host ($native) the gap above the group is a view of its own
10
+ * (`data-settings-group-gap`), which the window shows above every group but
11
+ * the first one showing: there is no sibling selector to do it.
12
+ */
13
+ export const label = $props.label || ''
14
+ export const className = $props.className || ''
15
+ export const T = SETTINGS_NATIVE
16
+ </script>
17
+
18
+ @if($native)
19
+ <div data-settings-group class="{{ T.group }} {{ className }}">
20
+ <div data-settings-group-gap class="{{ T.groupGap }} hidden"></div>
21
+ @if(label)
22
+ <span class="{{ T.groupLabel }}">{{ label }}</span>
23
+ @endif
24
+ <slot />
25
+ </div>
26
+ @else
27
+ <div data-settings-group role="presentation" class="stx-settings-group {{ className }}">
28
+ @if(label)
29
+ <div class="stx-settings-group-label" role="presentation">{{ label }}</div>
30
+ @endif
31
+ <slot />
32
+ </div>
33
+ @endif
34
+
35
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
36
+ <style data-native-exclude data-stx-public-style>
37
+ :where([data-settings-group]) {
38
+ --stx-settings-group-gap: 13px;
39
+ --stx-settings-item-gap: 2px;
40
+ }
41
+ .stx-settings-group {
42
+ display: flex;
43
+ flex-direction: column;
44
+ gap: var(--stx-settings-item-gap);
45
+ }
46
+ .stx-settings-group[hidden] { display: none; }
47
+ /* The gap sits above every group but the first one showing, so a search that hides a group hides its gap. */
48
+ .stx-settings-group:not([hidden]) ~ .stx-settings-group,
49
+ :where([data-stx-scope]):has(> .stx-settings-group:not([hidden])) ~ :where([data-stx-scope]) > .stx-settings-group { margin-top: var(--stx-settings-group-gap); }
50
+ .stx-settings-group-label {
51
+ padding: 0 8px 3px;
52
+ color: var(--stx-mac-ink-secondary);
53
+ font-size: var(--stx-mac-font-size-small);
54
+ font-weight: 600;
55
+ letter-spacing: 0;
56
+ }
57
+ </style>
@@ -69,76 +69,8 @@ export const glyphInk = settingsNativeGlyph(tone)
69
69
  </button>
70
70
  @endif
71
71
 
72
- <style data-native-exclude>
73
- :where(:root) {
74
- --stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
75
- --stx-mac-font-size: 13px;
76
- --stx-mac-font-size-small: 11px;
77
- --stx-mac-hairline: 0.5px;
78
- --stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
79
- --stx-mac-card-radius: 12px;
80
- --stx-mac-control-radius: 6px;
81
- --stx-mac-row-height: 38px;
82
- --stx-mac-row-inset: 10px;
83
- --stx-mac-sidebar-width: 226px;
84
- --stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
85
- --stx-mac-accent-ink: #ffffff;
86
- --stx-mac-ink: rgba(0, 0, 0, 0.85);
87
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
88
- --stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
89
- --stx-mac-window: #ffffff;
90
- --stx-mac-sidebar: #f2f1f0;
91
- --stx-mac-card: rgba(0, 0, 0, 0.04);
92
- --stx-mac-separator: rgba(0, 0, 0, 0.1);
93
- --stx-mac-hover: rgba(0, 0, 0, 0.05);
94
- --stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
95
- --stx-mac-well: rgba(0, 0, 0, 0.07);
96
- --stx-mac-control: #ffffff;
97
- --stx-mac-control-line: rgba(0, 0, 0, 0.12);
98
- --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);
99
- --stx-mac-switch-on: #34c759;
100
- --stx-mac-knob: #ffffff;
101
- --stx-mac-danger: #ff3b30;
102
- }
103
- :where(.dark) {
104
- --stx-mac-accent: var(--stx-accent, #0a84ff);
105
- --stx-mac-accent-ink: #ffffff;
106
- --stx-mac-ink: rgba(255, 255, 255, 0.85);
107
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
108
- --stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
109
- --stx-mac-window: #1e1e1e;
110
- --stx-mac-sidebar: #2a2a2a;
111
- --stx-mac-card: rgba(255, 255, 255, 0.05);
112
- --stx-mac-separator: rgba(255, 255, 255, 0.1);
113
- --stx-mac-hover: rgba(255, 255, 255, 0.06);
114
- --stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
115
- --stx-mac-well: rgba(255, 255, 255, 0.1);
116
- --stx-mac-control: rgba(255, 255, 255, 0.14);
117
- --stx-mac-control-line: rgba(255, 255, 255, 0.06);
118
- --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);
119
- --stx-mac-switch-on: #30d158;
120
- --stx-mac-knob: #ffffff;
121
- --stx-mac-danger: #ff453a;
122
- }
123
- @media (max-resolution: 1.5dppx) {
124
- :where(:root) {
125
- --stx-mac-hairline: 1px;
126
- }
127
- }
128
- @media (prefers-contrast: more) {
129
- :where(:root) {
130
- --stx-mac-separator: rgba(0, 0, 0, 0.4);
131
- --stx-mac-control-line: rgba(0, 0, 0, 0.5);
132
- --stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
133
- --stx-mac-hairline: 1px;
134
- }
135
- :where(.dark) {
136
- --stx-mac-separator: rgba(255, 255, 255, 0.45);
137
- --stx-mac-control-line: rgba(255, 255, 255, 0.5);
138
- --stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
139
- }
140
- }
141
-
72
+ <style data-native-exclude data-stx-public-style src="../../theme/macos.css"></style>
73
+ <style data-native-exclude data-stx-public-style>
142
74
  :where([data-settings-item]) {
143
75
  --stx-settings-item-height: 30px;
144
76
  --stx-settings-item-radius: 8px;