@stacksjs/components 0.2.867 → 0.2.868
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.
- package/dist/AppearancePicker-61r20jpp.stx +351 -0
- package/dist/{Button-sebyqeva.stx → Button-pg8mzsq3.stx} +249 -0
- package/dist/Checkbox-52mhrzkz.stx +417 -0
- package/dist/ColorSwatches-ecfxphjy.stx +287 -0
- package/dist/{NumberInput-axcfj9y8.stx → NumberInput-e2afxyh3.stx} +303 -0
- package/dist/{PasswordInput-8m3109tp.stx → PasswordInput-n2ven456.stx} +315 -0
- package/dist/RadioGroup-ps9kn22f.stx +329 -0
- package/dist/RadioGroupOption-6hyy1bvb.stx +246 -0
- package/dist/{SegmentedControl-fr69q4gb.stx → SegmentedControl-7q0t8c9s.stx} +170 -1
- package/dist/{Select-1cnqbcmg.stx → Select-ygzchedx.stx} +266 -0
- package/dist/SettingsGroup-dkae46k5.stx +200 -0
- package/dist/SettingsPane-jbd1gbdt.stx +50 -0
- package/dist/SettingsPaneHeader-f0cvkqs7.stx +188 -0
- package/dist/SettingsRow-4cxbsf1q.stx +424 -0
- package/dist/SettingsSidebarGroup-p2ygv5yy.stx +108 -0
- package/dist/SettingsSidebarItem-x8fsn3w5.stx +228 -0
- package/dist/SettingsWindow-mm490ymt.stx +537 -0
- package/dist/Slider-j59dgw1c.stx +377 -0
- package/dist/Switch-ga9ap8n8.stx +374 -0
- package/dist/{TextInput-tsvfwxmg.stx → TextInput-tyqzz3jy.stx} +325 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +35 -24
- package/dist/settings/settings.js +757 -0
- package/dist/ui/appearance-picker/AppearancePicker.d.ts +12 -0
- package/dist/ui/appearance-picker/index.d.ts +16 -0
- package/dist/ui/button/Button.d.ts +24 -1
- package/dist/ui/button/index.d.ts +1 -0
- package/dist/ui/checkbox/Checkbox.d.ts +9 -1
- package/dist/ui/checkbox/index.d.ts +1 -0
- package/dist/ui/color-swatches/ColorSwatches.d.ts +26 -0
- package/dist/ui/color-swatches/index.d.ts +18 -0
- package/dist/ui/input/NumberInput.d.ts +11 -1
- package/dist/ui/input/PasswordInput.d.ts +9 -1
- package/dist/ui/input/TextInput.d.ts +12 -1
- package/dist/ui/input/index.d.ts +7 -3
- package/dist/ui/radio-group/RadioGroup.d.ts +14 -2
- package/dist/ui/radio-group/RadioGroupOption.d.ts +6 -1
- package/dist/ui/radio-group/index.d.ts +2 -0
- package/dist/ui/segmented-control/SegmentedControl.d.ts +9 -1
- package/dist/ui/segmented-control/index.d.ts +1 -0
- package/dist/ui/select/Select.d.ts +10 -1
- package/dist/ui/select/index.d.ts +1 -0
- package/dist/ui/settings/SettingsGroup.d.ts +30 -0
- package/dist/ui/settings/SettingsPane.d.ts +19 -0
- package/dist/ui/settings/SettingsPaneHeader.d.ts +20 -0
- package/dist/ui/settings/SettingsRow.d.ts +53 -0
- package/dist/ui/settings/SettingsSidebarGroup.d.ts +11 -0
- package/dist/ui/settings/SettingsSidebarItem.d.ts +22 -0
- package/dist/ui/settings/SettingsWindow.d.ts +22 -0
- package/dist/ui/settings/core.d.ts +146 -0
- package/dist/ui/settings/index.d.ts +73 -0
- package/dist/ui/settings/settings.d.ts +8 -0
- package/dist/ui/settings/view.d.ts +36 -0
- package/dist/ui/slider/Slider.d.ts +24 -0
- package/dist/ui/slider/core.d.ts +33 -0
- package/dist/ui/slider/index.d.ts +20 -0
- package/dist/ui/switch/Switch.d.ts +10 -1
- package/dist/ui/switch/index.d.ts +2 -1
- package/dist/utils/mac-theme.d.ts +24 -0
- package/package.json +8 -3
- package/src/index.ts +6 -0
- package/src/ui/appearance-picker/AppearancePicker.stx +351 -0
- package/src/ui/appearance-picker/README.md +61 -0
- package/src/ui/appearance-picker/index.ts +22 -0
- package/src/ui/button/Button.stx +249 -0
- package/src/ui/button/README.md +21 -0
- package/src/ui/button/index.ts +8 -0
- package/src/ui/checkbox/Checkbox.stx +275 -0
- package/src/ui/checkbox/index.ts +2 -0
- package/src/ui/color-swatches/ColorSwatches.stx +287 -0
- package/src/ui/color-swatches/README.md +66 -0
- package/src/ui/color-swatches/index.ts +25 -0
- package/src/ui/input/NumberInput.stx +303 -0
- package/src/ui/input/PasswordInput.stx +315 -0
- package/src/ui/input/TextInput.stx +325 -0
- package/src/ui/input/index.ts +9 -3
- package/src/ui/radio-group/README.md +17 -0
- package/src/ui/radio-group/RadioGroup.stx +184 -6
- package/src/ui/radio-group/RadioGroupOption.stx +178 -2
- package/src/ui/radio-group/index.ts +4 -0
- package/src/ui/segmented-control/SegmentedControl.stx +170 -1
- package/src/ui/segmented-control/index.ts +2 -0
- package/src/ui/select/README.md +12 -0
- package/src/ui/select/Select.stx +266 -0
- package/src/ui/select/index.ts +2 -0
- package/src/ui/settings/README.md +221 -0
- package/src/ui/settings/SettingsGroup.stx +200 -0
- package/src/ui/settings/SettingsPane.stx +50 -0
- package/src/ui/settings/SettingsPaneHeader.stx +188 -0
- package/src/ui/settings/SettingsRow.stx +424 -0
- package/src/ui/settings/SettingsSidebarGroup.stx +108 -0
- package/src/ui/settings/SettingsSidebarItem.stx +228 -0
- package/src/ui/settings/SettingsWindow.stx +537 -0
- package/src/ui/settings/core.ts +359 -0
- package/src/ui/settings/index.ts +111 -0
- package/src/ui/settings/settings.ts +8 -0
- package/src/ui/settings/view.ts +740 -0
- package/src/ui/slider/README.md +91 -0
- package/src/ui/slider/Slider.stx +377 -0
- package/src/ui/slider/core.ts +120 -0
- package/src/ui/slider/index.ts +34 -0
- package/src/ui/switch/README.md +11 -0
- package/src/ui/switch/Switch.stx +217 -0
- package/src/ui/switch/index.ts +4 -1
- package/src/utils/mac-theme.ts +95 -0
- package/dist/Checkbox-80myyzzm.stx +0 -142
- package/dist/RadioGroup-smqcqgds.stx +0 -151
- package/dist/RadioGroupOption-twcw1b2a.stx +0 -70
- package/dist/Switch-s8yf2rvm.stx +0 -157
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
<script server>
|
|
2
|
+
export const title = $props.title || 'Settings'
|
|
3
|
+
export const pane = $props.pane || ''
|
|
4
|
+
export const searchable = $bool($props.searchable, true)
|
|
5
|
+
export const searchPlaceholder = $props.searchPlaceholder || 'Search'
|
|
6
|
+
export const storageKey = $props.storageKey || ''
|
|
7
|
+
/*
|
|
8
|
+
* `window` is a window that is all Settings: it fills the viewport and leaves
|
|
9
|
+
* room for the traffic lights. `sheet` is the same two columns inside a page.
|
|
10
|
+
*/
|
|
11
|
+
export const presentation = $props.presentation === 'sheet' ? 'sheet' : 'window'
|
|
12
|
+
/* A window that is all Settings hears its shortcuts anywhere in the document; a sheet only inside itself. */
|
|
13
|
+
export const globalKeys = presentation === 'window'
|
|
14
|
+
export const className = $props.className || ''
|
|
15
|
+
export const settingsId = $props.id || `settings-${$uid}`
|
|
16
|
+
|
|
17
|
+
/* Left out, both come from the stylesheet: the token width, and a height by presentation. */
|
|
18
|
+
const sidebarWidth = $num($props.sidebarWidth, 0)
|
|
19
|
+
const height = $props.height || ''
|
|
20
|
+
export const rootStyle = [
|
|
21
|
+
sidebarWidth > 0 ? `--stx-settings-sidebar-width: ${sidebarWidth}px` : '',
|
|
22
|
+
height ? `--stx-settings-height: ${height}` : '',
|
|
23
|
+
].filter(Boolean).join('; ')
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<script client>
|
|
27
|
+
/*
|
|
28
|
+
* <SettingsWindow>: the two columns of a Mac Settings window. A sidebar of
|
|
29
|
+
* items under a search field, and beside it the open pane under a toolbar
|
|
30
|
+
* with back, forward and the pane's name.
|
|
31
|
+
*
|
|
32
|
+
* What it decides is in ./core and what it does to the page in ./view; this
|
|
33
|
+
* is the wiring. The items, panes and rows are other components, found by the
|
|
34
|
+
* attributes they carry.
|
|
35
|
+
*/
|
|
36
|
+
import { SettingsWindowView } from './view'
|
|
37
|
+
|
|
38
|
+
const emit = defineEmits(['pane', 'search', 'navigate'])
|
|
39
|
+
|
|
40
|
+
const asText = value => (value == null ? '' : String(value))
|
|
41
|
+
const openPane = useModel('pane', { default: {{ pane }}, parse: asText })
|
|
42
|
+
|
|
43
|
+
const rootRef = useRef('settings')
|
|
44
|
+
let settings = null
|
|
45
|
+
|
|
46
|
+
onMount(() => {
|
|
47
|
+
const root = rootRef()
|
|
48
|
+
if (!root) return
|
|
49
|
+
|
|
50
|
+
settings = new SettingsWindowView(root, {
|
|
51
|
+
pane: asText(openPane()),
|
|
52
|
+
storageKey: {{ storageKey }},
|
|
53
|
+
globalKeys: {{ globalKeys }},
|
|
54
|
+
}, {
|
|
55
|
+
onPane(detail) {
|
|
56
|
+
openPane.set(detail.id)
|
|
57
|
+
emit('pane', detail)
|
|
58
|
+
},
|
|
59
|
+
onSearch(detail) { emit('search', detail) },
|
|
60
|
+
onNavigate(detail) { emit('navigate', detail) },
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
// The first run finds the pane the view just opened, which may be a stored
|
|
64
|
+
// one; only a later change of the prop is an instruction.
|
|
65
|
+
effect(() => {
|
|
66
|
+
const next = asText(openPane())
|
|
67
|
+
if (next && next !== settings.getPane()) settings.showPane(next)
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
onDestroy(() => {
|
|
72
|
+
if (settings) settings.destroy()
|
|
73
|
+
settings = null
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
defineExpose({
|
|
77
|
+
showPane: id => (settings ? settings.showPane(asText(id)) : false),
|
|
78
|
+
revealSetting: id => (settings ? settings.revealSetting(asText(id)) : false),
|
|
79
|
+
back: () => { if (settings) settings.back() },
|
|
80
|
+
forward: () => { if (settings) settings.forward() },
|
|
81
|
+
focusSearch: () => { if (settings) settings.focusSearch() },
|
|
82
|
+
getPane: () => (settings ? settings.getPane() : ''),
|
|
83
|
+
})
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<div
|
|
87
|
+
ref="settings"
|
|
88
|
+
id="{{ settingsId }}"
|
|
89
|
+
data-stx-settings
|
|
90
|
+
data-presentation="{{ presentation }}"
|
|
91
|
+
data-stx-window-active="true"
|
|
92
|
+
role="group"
|
|
93
|
+
aria-label="{{ title }}"
|
|
94
|
+
class="stx-settings {{ className }}"
|
|
95
|
+
style="{{ rootStyle }}"
|
|
96
|
+
>
|
|
97
|
+
<div class="stx-settings-sidebar">
|
|
98
|
+
{{-- The strip the traffic lights sit over. Nothing of ours goes under
|
|
99
|
+
them, and the window is moved by it. --}}
|
|
100
|
+
<div class="stx-settings-sidebar-top" data-window-drag>
|
|
101
|
+
@if(searchable)
|
|
102
|
+
<div class="stx-settings-search" data-settings-search>
|
|
103
|
+
<span class="i-f7-search stx-settings-search-glyph" aria-hidden="true"></span>
|
|
104
|
+
<input
|
|
105
|
+
type="search"
|
|
106
|
+
class="stx-settings-search-input"
|
|
107
|
+
placeholder="{{ searchPlaceholder }}"
|
|
108
|
+
aria-label="{{ searchPlaceholder }}"
|
|
109
|
+
aria-controls="{{ settingsId }}-nav"
|
|
110
|
+
autocomplete="off"
|
|
111
|
+
autocorrect="off"
|
|
112
|
+
autocapitalize="off"
|
|
113
|
+
spellcheck="false"
|
|
114
|
+
data-settings-search-input
|
|
115
|
+
>
|
|
116
|
+
<button type="button" class="stx-settings-search-clear" aria-label="Clear search" tabindex="-1" data-settings-search-clear>
|
|
117
|
+
<span class="i-f7-xmark-circle-fill" aria-hidden="true"></span>
|
|
118
|
+
</button>
|
|
119
|
+
</div>
|
|
120
|
+
@endif
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<div class="stx-settings-nav" id="{{ settingsId }}-nav" data-settings-nav>
|
|
124
|
+
<div class="stx-settings-account" data-settings-account><slot name="account" /></div>
|
|
125
|
+
<div class="stx-settings-list" role="tablist" aria-orientation="vertical" aria-label="{{ title }}" data-settings-list><slot name="sidebar" /></div>
|
|
126
|
+
<div class="stx-settings-results" role="group" aria-label="Matching settings" data-settings-results hidden></div>
|
|
127
|
+
<p class="stx-settings-empty" data-settings-empty hidden>No Results</p>
|
|
128
|
+
</div>
|
|
129
|
+
<div class="stx-settings-live" role="status" aria-live="polite" data-settings-live></div>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<div class="stx-settings-detail">
|
|
133
|
+
<div class="stx-settings-toolbar" data-window-drag>
|
|
134
|
+
<div class="stx-settings-history" role="group" aria-label="History">
|
|
135
|
+
<button type="button" class="stx-settings-history-button" aria-label="Back" data-settings-back disabled>
|
|
136
|
+
<span class="i-f7-chevron-left" aria-hidden="true"></span>
|
|
137
|
+
</button>
|
|
138
|
+
<span class="stx-settings-history-rule" aria-hidden="true"></span>
|
|
139
|
+
<button type="button" class="stx-settings-history-button" aria-label="Forward" data-settings-forward disabled>
|
|
140
|
+
<span class="i-f7-chevron-right" aria-hidden="true"></span>
|
|
141
|
+
</button>
|
|
142
|
+
</div>
|
|
143
|
+
<div class="stx-settings-title" id="{{ settingsId }}-title" role="heading" aria-level="{{ presentation === 'sheet' ? '2' : '1' }}" data-settings-title></div>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<div class="stx-settings-body" data-settings-body>
|
|
147
|
+
<div class="stx-settings-content"><slot /></div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<style data-native-exclude>
|
|
153
|
+
:where(:root) {
|
|
154
|
+
--stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
|
|
155
|
+
--stx-mac-font-size: 13px;
|
|
156
|
+
--stx-mac-font-size-small: 11px;
|
|
157
|
+
--stx-mac-hairline: 0.5px;
|
|
158
|
+
--stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
|
|
159
|
+
--stx-mac-card-radius: 12px;
|
|
160
|
+
--stx-mac-control-radius: 6px;
|
|
161
|
+
--stx-mac-row-height: 38px;
|
|
162
|
+
--stx-mac-row-inset: 10px;
|
|
163
|
+
--stx-mac-sidebar-width: 226px;
|
|
164
|
+
--stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
|
|
165
|
+
--stx-mac-accent-ink: #ffffff;
|
|
166
|
+
--stx-mac-ink: rgba(0, 0, 0, 0.85);
|
|
167
|
+
--stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
|
|
168
|
+
--stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
|
|
169
|
+
--stx-mac-window: #ffffff;
|
|
170
|
+
--stx-mac-sidebar: #f2f1f0;
|
|
171
|
+
--stx-mac-card: rgba(0, 0, 0, 0.04);
|
|
172
|
+
--stx-mac-separator: rgba(0, 0, 0, 0.1);
|
|
173
|
+
--stx-mac-hover: rgba(0, 0, 0, 0.05);
|
|
174
|
+
--stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
|
|
175
|
+
--stx-mac-well: rgba(0, 0, 0, 0.07);
|
|
176
|
+
--stx-mac-control: #ffffff;
|
|
177
|
+
--stx-mac-control-line: rgba(0, 0, 0, 0.12);
|
|
178
|
+
--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);
|
|
179
|
+
--stx-mac-switch-on: #34c759;
|
|
180
|
+
--stx-mac-knob: #ffffff;
|
|
181
|
+
--stx-mac-danger: #ff3b30;
|
|
182
|
+
}
|
|
183
|
+
:where(.dark) {
|
|
184
|
+
--stx-mac-accent: var(--stx-accent, #0a84ff);
|
|
185
|
+
--stx-mac-accent-ink: #ffffff;
|
|
186
|
+
--stx-mac-ink: rgba(255, 255, 255, 0.85);
|
|
187
|
+
--stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
|
|
188
|
+
--stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
|
|
189
|
+
--stx-mac-window: #1e1e1e;
|
|
190
|
+
--stx-mac-sidebar: #2a2a2a;
|
|
191
|
+
--stx-mac-card: rgba(255, 255, 255, 0.05);
|
|
192
|
+
--stx-mac-separator: rgba(255, 255, 255, 0.1);
|
|
193
|
+
--stx-mac-hover: rgba(255, 255, 255, 0.06);
|
|
194
|
+
--stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
|
|
195
|
+
--stx-mac-well: rgba(255, 255, 255, 0.1);
|
|
196
|
+
--stx-mac-control: rgba(255, 255, 255, 0.14);
|
|
197
|
+
--stx-mac-control-line: rgba(255, 255, 255, 0.06);
|
|
198
|
+
--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);
|
|
199
|
+
--stx-mac-switch-on: #30d158;
|
|
200
|
+
--stx-mac-knob: #ffffff;
|
|
201
|
+
--stx-mac-danger: #ff453a;
|
|
202
|
+
}
|
|
203
|
+
@media (max-resolution: 1.5dppx) {
|
|
204
|
+
:where(:root) {
|
|
205
|
+
--stx-mac-hairline: 1px;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
@media (prefers-contrast: more) {
|
|
209
|
+
:where(:root) {
|
|
210
|
+
--stx-mac-separator: rgba(0, 0, 0, 0.4);
|
|
211
|
+
--stx-mac-control-line: rgba(0, 0, 0, 0.5);
|
|
212
|
+
--stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
|
|
213
|
+
--stx-mac-hairline: 1px;
|
|
214
|
+
}
|
|
215
|
+
:where(.dark) {
|
|
216
|
+
--stx-mac-separator: rgba(255, 255, 255, 0.45);
|
|
217
|
+
--stx-mac-control-line: rgba(255, 255, 255, 0.5);
|
|
218
|
+
--stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/*
|
|
223
|
+
* The measurements are System Settings' own on macOS 26, in points. Each is a
|
|
224
|
+
* variable so an app can move one without restating the rest.
|
|
225
|
+
*/
|
|
226
|
+
:where([data-stx-settings]) {
|
|
227
|
+
--stx-settings-sidebar-width: var(--stx-mac-sidebar-width);
|
|
228
|
+
--stx-settings-height: 100vh;
|
|
229
|
+
--stx-settings-sidebar-inset: 9px;
|
|
230
|
+
--stx-settings-search-height: 28px;
|
|
231
|
+
--stx-settings-toolbar-height: 52px;
|
|
232
|
+
--stx-settings-content-width: 500px;
|
|
233
|
+
--stx-settings-content-margin: 20px;
|
|
234
|
+
--stx-settings-sheet-radius: 14px;
|
|
235
|
+
--stx-settings-sheet-width: 715px;
|
|
236
|
+
--stx-settings-scrollbar: var(--stx-mac-ink-tertiary);
|
|
237
|
+
/* How much of the sidebar's own fill covers a native material behind it. */
|
|
238
|
+
--stx-settings-material-opacity: 62%;
|
|
239
|
+
/*
|
|
240
|
+
* The band the window buttons occupy. Craft publishes where they are; the
|
|
241
|
+
* older pair of names is the room to leave, which is the same thing here.
|
|
242
|
+
* In a browser nothing is published and the band is the toolbar's height.
|
|
243
|
+
*/
|
|
244
|
+
--stx-settings-chrome-band: max(
|
|
245
|
+
var(--stx-settings-toolbar-height),
|
|
246
|
+
calc(
|
|
247
|
+
var(--craft-window-buttons-y, var(--craft-window-controls-inset-y, 0px))
|
|
248
|
+
+ var(--craft-window-buttons-height, var(--craft-window-controls-height, 0px))
|
|
249
|
+
+ 12px
|
|
250
|
+
)
|
|
251
|
+
);
|
|
252
|
+
/* What the search field leaves above itself, under the band. */
|
|
253
|
+
--stx-settings-search-gap: 7px;
|
|
254
|
+
}
|
|
255
|
+
:where([data-stx-settings][data-presentation="sheet"]) {
|
|
256
|
+
--stx-settings-height: min(640px, 90vh);
|
|
257
|
+
--stx-settings-chrome-band: 0px;
|
|
258
|
+
--stx-settings-search-gap: 12px;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
[data-stx-settings] {
|
|
262
|
+
display: flex;
|
|
263
|
+
box-sizing: border-box;
|
|
264
|
+
width: 100%;
|
|
265
|
+
height: var(--stx-settings-height);
|
|
266
|
+
min-width: 0;
|
|
267
|
+
overflow: hidden;
|
|
268
|
+
color: var(--stx-mac-ink);
|
|
269
|
+
font-family: var(--stx-mac-font);
|
|
270
|
+
font-size: var(--stx-mac-font-size);
|
|
271
|
+
line-height: 1.25;
|
|
272
|
+
letter-spacing: -0.08px;
|
|
273
|
+
text-align: left;
|
|
274
|
+
-webkit-font-smoothing: antialiased;
|
|
275
|
+
cursor: default;
|
|
276
|
+
user-select: none;
|
|
277
|
+
-webkit-user-select: none;
|
|
278
|
+
}
|
|
279
|
+
[data-stx-settings] *, [data-stx-settings] *::before, [data-stx-settings] *::after { box-sizing: border-box; }
|
|
280
|
+
/* Parts here set their own `display`, which would outrank the browser's rule for `hidden`. */
|
|
281
|
+
[data-stx-settings] [hidden] { display: none; }
|
|
282
|
+
|
|
283
|
+
[data-stx-settings][data-presentation="sheet"] {
|
|
284
|
+
max-width: var(--stx-settings-sheet-width);
|
|
285
|
+
border-radius: var(--stx-settings-sheet-radius);
|
|
286
|
+
box-shadow: 0 0 0 var(--stx-mac-hairline) var(--stx-mac-separator), 0 18px 50px rgba(0, 0, 0, 0.22);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/* ---------- The sidebar ---------- */
|
|
290
|
+
.stx-settings-sidebar {
|
|
291
|
+
position: relative;
|
|
292
|
+
display: flex;
|
|
293
|
+
flex-direction: column;
|
|
294
|
+
flex: none;
|
|
295
|
+
width: var(--stx-settings-sidebar-width);
|
|
296
|
+
min-width: 0;
|
|
297
|
+
background: var(--stx-mac-sidebar);
|
|
298
|
+
box-shadow: inset calc(-1 * var(--stx-mac-hairline)) 0 0 color-mix(in srgb, var(--stx-mac-separator) 60%, transparent);
|
|
299
|
+
}
|
|
300
|
+
/*
|
|
301
|
+
* Craft stamps this on the root element when it has drawn a material behind
|
|
302
|
+
* the web view. Only then does the sidebar let it through; in a browser there
|
|
303
|
+
* is nothing behind and an opaque sidebar is the right answer.
|
|
304
|
+
*/
|
|
305
|
+
:root[data-craft-native-sidebar] [data-stx-settings][data-presentation="window"] .stx-settings-sidebar {
|
|
306
|
+
background: color-mix(in srgb, var(--stx-mac-sidebar) var(--stx-settings-material-opacity), transparent);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.stx-settings-sidebar-top {
|
|
310
|
+
flex: none;
|
|
311
|
+
min-height: var(--stx-settings-chrome-band);
|
|
312
|
+
padding: calc(var(--stx-settings-chrome-band) + var(--stx-settings-search-gap)) var(--stx-settings-sidebar-inset) 6px;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* A drag region moves the window; what can be pressed inside one does not. */
|
|
316
|
+
[data-stx-settings] [data-window-drag] { -webkit-app-region: drag; }
|
|
317
|
+
[data-stx-settings] [data-window-drag] :is(button, input, a, select, textarea, [role="button"], .stx-settings-search) { -webkit-app-region: no-drag; }
|
|
318
|
+
|
|
319
|
+
.stx-settings-search {
|
|
320
|
+
display: flex;
|
|
321
|
+
align-items: center;
|
|
322
|
+
gap: 5px;
|
|
323
|
+
height: var(--stx-settings-search-height);
|
|
324
|
+
padding: 0 8px;
|
|
325
|
+
border-radius: calc(var(--stx-settings-search-height) / 2);
|
|
326
|
+
background: var(--stx-mac-well);
|
|
327
|
+
box-shadow: inset 0 0 0 var(--stx-mac-hairline) var(--stx-mac-control-line);
|
|
328
|
+
color: var(--stx-mac-ink-secondary);
|
|
329
|
+
transition: box-shadow 150ms ease, background-color 150ms ease;
|
|
330
|
+
}
|
|
331
|
+
.stx-settings-search:has(.stx-settings-search-input:focus-visible) { box-shadow: var(--stx-mac-focus-ring); }
|
|
332
|
+
.stx-settings-search-glyph { flex: none; width: 13px; height: 13px; }
|
|
333
|
+
.stx-settings-search-input {
|
|
334
|
+
flex: 1;
|
|
335
|
+
min-width: 0;
|
|
336
|
+
height: 100%;
|
|
337
|
+
margin: 0;
|
|
338
|
+
padding: 0;
|
|
339
|
+
border: 0;
|
|
340
|
+
outline: 0;
|
|
341
|
+
background: transparent;
|
|
342
|
+
color: var(--stx-mac-ink);
|
|
343
|
+
font: inherit;
|
|
344
|
+
letter-spacing: inherit;
|
|
345
|
+
cursor: text;
|
|
346
|
+
user-select: text;
|
|
347
|
+
-webkit-user-select: text;
|
|
348
|
+
appearance: none;
|
|
349
|
+
-webkit-appearance: none;
|
|
350
|
+
}
|
|
351
|
+
.stx-settings-search-input::placeholder { color: var(--stx-mac-ink-secondary); opacity: 1; }
|
|
352
|
+
.stx-settings-search-input::-webkit-search-decoration,
|
|
353
|
+
.stx-settings-search-input::-webkit-search-cancel-button,
|
|
354
|
+
.stx-settings-search-input::-webkit-search-results-button { display: none; -webkit-appearance: none; }
|
|
355
|
+
.stx-settings-search-clear {
|
|
356
|
+
display: none;
|
|
357
|
+
flex: none;
|
|
358
|
+
width: 14px;
|
|
359
|
+
height: 14px;
|
|
360
|
+
margin: 0;
|
|
361
|
+
padding: 0;
|
|
362
|
+
border: 0;
|
|
363
|
+
border-radius: 50%;
|
|
364
|
+
background: none;
|
|
365
|
+
color: var(--stx-mac-ink-secondary);
|
|
366
|
+
cursor: default;
|
|
367
|
+
}
|
|
368
|
+
.stx-settings-search-clear > span { display: block; width: 14px; height: 14px; }
|
|
369
|
+
.stx-settings-search[data-filled] .stx-settings-search-clear { display: block; }
|
|
370
|
+
|
|
371
|
+
.stx-settings-nav {
|
|
372
|
+
flex: 1;
|
|
373
|
+
min-height: 0;
|
|
374
|
+
overflow-x: hidden;
|
|
375
|
+
overflow-y: auto;
|
|
376
|
+
padding: 0 var(--stx-settings-sidebar-inset) 12px;
|
|
377
|
+
}
|
|
378
|
+
.stx-settings-account { margin-top: 7px; }
|
|
379
|
+
/* A slot nobody filled leaves no gap behind. */
|
|
380
|
+
.stx-settings-account:not(:has(*)) { display: none; }
|
|
381
|
+
.stx-settings-list { display: block; padding-top: 7px; }
|
|
382
|
+
|
|
383
|
+
/* ---------- What a search found ---------- */
|
|
384
|
+
.stx-settings-results { display: flex; flex-direction: column; gap: 2px; padding-top: 7px; }
|
|
385
|
+
.stx-settings-list:not([hidden]) + .stx-settings-results {
|
|
386
|
+
margin-top: 8px;
|
|
387
|
+
border-top: var(--stx-mac-hairline) solid var(--stx-mac-separator);
|
|
388
|
+
}
|
|
389
|
+
.stx-settings-result {
|
|
390
|
+
display: flex;
|
|
391
|
+
flex-direction: column;
|
|
392
|
+
justify-content: center;
|
|
393
|
+
gap: 1px;
|
|
394
|
+
width: 100%;
|
|
395
|
+
min-height: 38px;
|
|
396
|
+
margin: 0;
|
|
397
|
+
padding: 4px 8px;
|
|
398
|
+
border: 0;
|
|
399
|
+
border-radius: 8px;
|
|
400
|
+
outline: 0;
|
|
401
|
+
background: none;
|
|
402
|
+
color: inherit;
|
|
403
|
+
font: inherit;
|
|
404
|
+
letter-spacing: inherit;
|
|
405
|
+
text-align: left;
|
|
406
|
+
cursor: default;
|
|
407
|
+
}
|
|
408
|
+
.stx-settings-result:hover { background: var(--stx-mac-hover); }
|
|
409
|
+
.stx-settings-result:focus-visible { box-shadow: var(--stx-mac-focus-ring); }
|
|
410
|
+
.stx-settings-result-label,
|
|
411
|
+
.stx-settings-result-pane { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
412
|
+
.stx-settings-result-pane { color: var(--stx-mac-ink-secondary); font-size: var(--stx-mac-font-size-small); letter-spacing: 0; }
|
|
413
|
+
.stx-settings-empty {
|
|
414
|
+
margin: 0;
|
|
415
|
+
padding: 24px 8px;
|
|
416
|
+
color: var(--stx-mac-ink-secondary);
|
|
417
|
+
text-align: center;
|
|
418
|
+
}
|
|
419
|
+
/* Read out, never seen. */
|
|
420
|
+
.stx-settings-live {
|
|
421
|
+
position: absolute;
|
|
422
|
+
width: 1px;
|
|
423
|
+
height: 1px;
|
|
424
|
+
overflow: hidden;
|
|
425
|
+
clip-path: inset(50%);
|
|
426
|
+
white-space: nowrap;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/* ---------- The detail column ---------- */
|
|
430
|
+
.stx-settings-detail {
|
|
431
|
+
display: flex;
|
|
432
|
+
flex-direction: column;
|
|
433
|
+
flex: 1;
|
|
434
|
+
min-width: 0;
|
|
435
|
+
background: var(--stx-mac-window);
|
|
436
|
+
}
|
|
437
|
+
.stx-settings-toolbar {
|
|
438
|
+
display: flex;
|
|
439
|
+
align-items: center;
|
|
440
|
+
flex: none;
|
|
441
|
+
gap: 12px;
|
|
442
|
+
height: var(--stx-settings-toolbar-height);
|
|
443
|
+
padding: 0 16px 0 8px;
|
|
444
|
+
/* The line is there all along and only shown once the content has moved under it. */
|
|
445
|
+
box-shadow: 0 var(--stx-mac-hairline) 0 transparent;
|
|
446
|
+
transition: box-shadow 150ms ease;
|
|
447
|
+
z-index: 1;
|
|
448
|
+
}
|
|
449
|
+
[data-stx-settings][data-scrolled] .stx-settings-toolbar { box-shadow: 0 var(--stx-mac-hairline) 0 var(--stx-mac-separator); }
|
|
450
|
+
|
|
451
|
+
.stx-settings-history {
|
|
452
|
+
display: flex;
|
|
453
|
+
align-items: center;
|
|
454
|
+
flex: none;
|
|
455
|
+
width: 74px;
|
|
456
|
+
height: 36px;
|
|
457
|
+
border-radius: 18px;
|
|
458
|
+
background: var(--stx-mac-well);
|
|
459
|
+
box-shadow: inset 0 0 0 var(--stx-mac-hairline) var(--stx-mac-control-line);
|
|
460
|
+
}
|
|
461
|
+
.stx-settings-history-button {
|
|
462
|
+
display: grid;
|
|
463
|
+
place-items: center;
|
|
464
|
+
flex: 1;
|
|
465
|
+
height: 100%;
|
|
466
|
+
margin: 0;
|
|
467
|
+
padding: 0;
|
|
468
|
+
border: 0;
|
|
469
|
+
outline: 0;
|
|
470
|
+
background: none;
|
|
471
|
+
color: var(--stx-mac-ink-secondary);
|
|
472
|
+
cursor: default;
|
|
473
|
+
transition: color 150ms ease, background-color 150ms ease;
|
|
474
|
+
}
|
|
475
|
+
.stx-settings-history-button:first-child { border-radius: 18px 6px 6px 18px; padding-left: 3px; }
|
|
476
|
+
.stx-settings-history-button:last-child { border-radius: 6px 18px 18px 6px; padding-right: 3px; }
|
|
477
|
+
.stx-settings-history-button > span { display: block; width: 17px; height: 17px; }
|
|
478
|
+
.stx-settings-history-button:hover:not(:disabled) { color: var(--stx-mac-ink); }
|
|
479
|
+
.stx-settings-history-button:active:not(:disabled) { background: var(--stx-mac-hover); }
|
|
480
|
+
.stx-settings-history-button:disabled { color: var(--stx-mac-ink-tertiary); }
|
|
481
|
+
.stx-settings-history-button:focus-visible { box-shadow: var(--stx-mac-focus-ring); }
|
|
482
|
+
.stx-settings-history-rule { flex: none; width: 1px; height: 16px; background: var(--stx-mac-separator); }
|
|
483
|
+
|
|
484
|
+
.stx-settings-title {
|
|
485
|
+
min-width: 0;
|
|
486
|
+
overflow: hidden;
|
|
487
|
+
font-size: 15px;
|
|
488
|
+
font-weight: 600;
|
|
489
|
+
letter-spacing: -0.2px;
|
|
490
|
+
text-overflow: ellipsis;
|
|
491
|
+
white-space: nowrap;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.stx-settings-body {
|
|
495
|
+
flex: 1;
|
|
496
|
+
min-height: 0;
|
|
497
|
+
overflow-x: hidden;
|
|
498
|
+
overflow-y: auto;
|
|
499
|
+
padding: 11px var(--stx-settings-content-margin) 20px;
|
|
500
|
+
}
|
|
501
|
+
.stx-settings-content {
|
|
502
|
+
width: 100%;
|
|
503
|
+
max-width: var(--stx-settings-content-width);
|
|
504
|
+
margin: 0 auto;
|
|
505
|
+
}
|
|
506
|
+
/*
|
|
507
|
+
* Until the view has run, the pane the server left showing is the one shown,
|
|
508
|
+
* and the first pane when it left none: a window is never blank while it loads.
|
|
509
|
+
*/
|
|
510
|
+
[data-stx-settings]:not([data-settings-ready]):not(:has([data-settings-pane]:not([hidden]))) .stx-settings-content > :first-child:is([data-settings-pane], :has(> [data-settings-pane])),
|
|
511
|
+
[data-stx-settings]:not([data-settings-ready]):not(:has([data-settings-pane]:not([hidden]))) .stx-settings-content > :first-child > [data-settings-pane] { display: block; }
|
|
512
|
+
|
|
513
|
+
/* ---------- Scrollbars: thin, and only while the pointer is over the list ---------- */
|
|
514
|
+
.stx-settings-nav,
|
|
515
|
+
.stx-settings-body { scrollbar-width: thin; scrollbar-color: transparent transparent; }
|
|
516
|
+
/* Where a scrollbar takes room, it takes it in every pane, so the column does not shift between a long pane and a short one. */
|
|
517
|
+
.stx-settings-body { scrollbar-gutter: stable; }
|
|
518
|
+
.stx-settings-nav:hover,
|
|
519
|
+
.stx-settings-body:hover { scrollbar-color: var(--stx-settings-scrollbar) transparent; }
|
|
520
|
+
|
|
521
|
+
/* ---------- An inactive window ---------- */
|
|
522
|
+
:where([data-stx-window-active="false"]) .stx-settings-history-button,
|
|
523
|
+
:root[data-craft-window-active='false'] .stx-settings-history-button { color: var(--stx-mac-ink-tertiary); }
|
|
524
|
+
|
|
525
|
+
@media (prefers-contrast: more) {
|
|
526
|
+
.stx-settings-sidebar { box-shadow: inset -1px 0 0 var(--stx-mac-separator); }
|
|
527
|
+
.stx-settings-search,
|
|
528
|
+
.stx-settings-history { box-shadow: inset 0 0 0 1px var(--stx-mac-control-line); }
|
|
529
|
+
.stx-settings-toolbar { box-shadow: 0 1px 0 var(--stx-mac-separator); }
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
@media (prefers-reduced-motion: reduce) {
|
|
533
|
+
.stx-settings-search,
|
|
534
|
+
.stx-settings-toolbar,
|
|
535
|
+
.stx-settings-history-button { transition: none; }
|
|
536
|
+
}
|
|
537
|
+
</style>
|