@stacksjs/components 0.2.865 → 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/preview-frame/preview-frame.js +58 -2
- 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/preview-frame/core.d.ts +22 -0
- package/dist/ui/preview-frame/view.d.ts +9 -0
- 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/preview-frame/README.md +16 -14
- package/src/ui/preview-frame/core.ts +50 -0
- package/src/ui/preview-frame/index.ts +4 -4
- package/src/ui/preview-frame/view.ts +61 -4
- 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,50 @@
|
|
|
1
|
+
<script server>
|
|
2
|
+
/*
|
|
3
|
+
* <SettingsPane>: one screen of a Settings window. Its `id` is the id its
|
|
4
|
+
* sidebar item carries; a pane with a `parent` is a sub-pane, reached by a
|
|
5
|
+
* navigation row and not from the sidebar.
|
|
6
|
+
*
|
|
7
|
+
* Every pane is in the page from the start and all but one are hidden. The
|
|
8
|
+
* shell shows the open one; `active` leaves this one showing before it has.
|
|
9
|
+
*/
|
|
10
|
+
export const paneId = $props.id || ''
|
|
11
|
+
export const title = $props.title || paneId
|
|
12
|
+
export const keywords = $props.keywords || ''
|
|
13
|
+
export const parent = $props.parent || ''
|
|
14
|
+
export const active = $bool($props.active)
|
|
15
|
+
export const role = parent ? 'region' : 'tabpanel'
|
|
16
|
+
export const className = $props.className || ''
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
@if(active)
|
|
20
|
+
<section
|
|
21
|
+
data-settings-pane="{{ paneId }}"
|
|
22
|
+
data-title="{{ title }}"
|
|
23
|
+
data-keywords="{{ keywords }}"
|
|
24
|
+
data-parent="{{ parent }}"
|
|
25
|
+
data-active
|
|
26
|
+
role="{{ role }}"
|
|
27
|
+
aria-label="{{ title }}"
|
|
28
|
+
class="stx-settings-pane {{ className }}"
|
|
29
|
+
>
|
|
30
|
+
<slot />
|
|
31
|
+
</section>
|
|
32
|
+
@else
|
|
33
|
+
<section
|
|
34
|
+
data-settings-pane="{{ paneId }}"
|
|
35
|
+
data-title="{{ title }}"
|
|
36
|
+
data-keywords="{{ keywords }}"
|
|
37
|
+
data-parent="{{ parent }}"
|
|
38
|
+
role="{{ role }}"
|
|
39
|
+
aria-label="{{ title }}"
|
|
40
|
+
class="stx-settings-pane {{ className }}"
|
|
41
|
+
hidden
|
|
42
|
+
>
|
|
43
|
+
<slot />
|
|
44
|
+
</section>
|
|
45
|
+
@endif
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
.stx-settings-pane { display: block; min-width: 0; outline: 0; }
|
|
49
|
+
.stx-settings-pane[hidden] { display: none; }
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
<script server>
|
|
2
|
+
/*
|
|
3
|
+
* <SettingsPaneHeader>: the card at the top of a pane that says what the pane
|
|
4
|
+
* is. A large icon tile, the pane's name, and a sentence about it.
|
|
5
|
+
*
|
|
6
|
+
* <SettingsPaneHeader icon="i-f7-gear-alt-fill" tone="grey" title="General"
|
|
7
|
+
* description="Manage your overall setup and preferences." />
|
|
8
|
+
*
|
|
9
|
+
* Anything in the slot goes under the description: a link, a button.
|
|
10
|
+
*/
|
|
11
|
+
const TONES = ['grey', 'blue', 'red', 'orange', 'yellow', 'green', 'indigo', 'purple', 'pink', 'ink']
|
|
12
|
+
export const icon = $props.icon || ''
|
|
13
|
+
export const tone = TONES.includes($props.tone) ? $props.tone : 'grey'
|
|
14
|
+
export const title = $props.title || ''
|
|
15
|
+
export const description = $props.description || ''
|
|
16
|
+
export const className = $props.className || ''
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script client>
|
|
20
|
+
const heading = useReactiveProp('title', {{ title }})
|
|
21
|
+
const detail = useReactiveProp('description', {{ description }})
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<header data-settings-pane-header class="stx-settings-hero {{ className }}">
|
|
25
|
+
@if(icon)
|
|
26
|
+
<span class="stx-settings-hero-tile" data-tone="{{ tone }}" aria-hidden="true"><i class="{{ icon }}"></i></span>
|
|
27
|
+
@endif
|
|
28
|
+
<h2 :text="heading()" class="stx-settings-hero-title">{{ title }}</h2>
|
|
29
|
+
<p :show="detail()" :text="detail()" class="stx-settings-hero-description">{{ description }}</p>
|
|
30
|
+
<div class="stx-settings-hero-extra"><slot /></div>
|
|
31
|
+
</header>
|
|
32
|
+
|
|
33
|
+
<style data-native-exclude>
|
|
34
|
+
:where(:root) {
|
|
35
|
+
--stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
|
|
36
|
+
--stx-mac-font-size: 13px;
|
|
37
|
+
--stx-mac-font-size-small: 11px;
|
|
38
|
+
--stx-mac-hairline: 0.5px;
|
|
39
|
+
--stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
|
|
40
|
+
--stx-mac-card-radius: 12px;
|
|
41
|
+
--stx-mac-control-radius: 6px;
|
|
42
|
+
--stx-mac-row-height: 38px;
|
|
43
|
+
--stx-mac-row-inset: 10px;
|
|
44
|
+
--stx-mac-sidebar-width: 226px;
|
|
45
|
+
--stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
|
|
46
|
+
--stx-mac-accent-ink: #ffffff;
|
|
47
|
+
--stx-mac-ink: rgba(0, 0, 0, 0.85);
|
|
48
|
+
--stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
|
|
49
|
+
--stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
|
|
50
|
+
--stx-mac-window: #ffffff;
|
|
51
|
+
--stx-mac-sidebar: #f2f1f0;
|
|
52
|
+
--stx-mac-card: rgba(0, 0, 0, 0.04);
|
|
53
|
+
--stx-mac-separator: rgba(0, 0, 0, 0.1);
|
|
54
|
+
--stx-mac-hover: rgba(0, 0, 0, 0.05);
|
|
55
|
+
--stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
|
|
56
|
+
--stx-mac-well: rgba(0, 0, 0, 0.07);
|
|
57
|
+
--stx-mac-control: #ffffff;
|
|
58
|
+
--stx-mac-control-line: rgba(0, 0, 0, 0.12);
|
|
59
|
+
--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);
|
|
60
|
+
--stx-mac-switch-on: #34c759;
|
|
61
|
+
--stx-mac-knob: #ffffff;
|
|
62
|
+
--stx-mac-danger: #ff3b30;
|
|
63
|
+
}
|
|
64
|
+
:where(.dark) {
|
|
65
|
+
--stx-mac-accent: var(--stx-accent, #0a84ff);
|
|
66
|
+
--stx-mac-accent-ink: #ffffff;
|
|
67
|
+
--stx-mac-ink: rgba(255, 255, 255, 0.85);
|
|
68
|
+
--stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
|
|
69
|
+
--stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
|
|
70
|
+
--stx-mac-window: #1e1e1e;
|
|
71
|
+
--stx-mac-sidebar: #2a2a2a;
|
|
72
|
+
--stx-mac-card: rgba(255, 255, 255, 0.05);
|
|
73
|
+
--stx-mac-separator: rgba(255, 255, 255, 0.1);
|
|
74
|
+
--stx-mac-hover: rgba(255, 255, 255, 0.06);
|
|
75
|
+
--stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
|
|
76
|
+
--stx-mac-well: rgba(255, 255, 255, 0.1);
|
|
77
|
+
--stx-mac-control: rgba(255, 255, 255, 0.14);
|
|
78
|
+
--stx-mac-control-line: rgba(255, 255, 255, 0.06);
|
|
79
|
+
--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);
|
|
80
|
+
--stx-mac-switch-on: #30d158;
|
|
81
|
+
--stx-mac-knob: #ffffff;
|
|
82
|
+
--stx-mac-danger: #ff453a;
|
|
83
|
+
}
|
|
84
|
+
@media (max-resolution: 1.5dppx) {
|
|
85
|
+
:where(:root) {
|
|
86
|
+
--stx-mac-hairline: 1px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
@media (prefers-contrast: more) {
|
|
90
|
+
:where(:root) {
|
|
91
|
+
--stx-mac-separator: rgba(0, 0, 0, 0.4);
|
|
92
|
+
--stx-mac-control-line: rgba(0, 0, 0, 0.5);
|
|
93
|
+
--stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
|
|
94
|
+
--stx-mac-hairline: 1px;
|
|
95
|
+
}
|
|
96
|
+
:where(.dark) {
|
|
97
|
+
--stx-mac-separator: rgba(255, 255, 255, 0.45);
|
|
98
|
+
--stx-mac-control-line: rgba(255, 255, 255, 0.5);
|
|
99
|
+
--stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:where([data-settings-pane-header]) {
|
|
104
|
+
--stx-settings-tone-grey: #8e8e93;
|
|
105
|
+
--stx-settings-tone-blue: #007aff;
|
|
106
|
+
--stx-settings-tone-red: #ff3b30;
|
|
107
|
+
--stx-settings-tone-orange: #ff9500;
|
|
108
|
+
--stx-settings-tone-yellow: #ffcc00;
|
|
109
|
+
--stx-settings-tone-green: #34c759;
|
|
110
|
+
--stx-settings-tone-indigo: #5856d6;
|
|
111
|
+
--stx-settings-tone-purple: #af52de;
|
|
112
|
+
--stx-settings-tone-pink: #ff2d55;
|
|
113
|
+
--stx-settings-tone-ink: #1c1c1e;
|
|
114
|
+
--stx-settings-hero-tile-size: 48px;
|
|
115
|
+
--stx-settings-hero-padding: 22px;
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
align-items: center;
|
|
119
|
+
box-sizing: border-box;
|
|
120
|
+
margin: 0 0 10px;
|
|
121
|
+
padding: var(--stx-settings-hero-padding);
|
|
122
|
+
border-radius: var(--stx-mac-card-radius);
|
|
123
|
+
background: var(--stx-mac-card);
|
|
124
|
+
font-family: var(--stx-mac-font);
|
|
125
|
+
text-align: center;
|
|
126
|
+
color: var(--stx-mac-ink);
|
|
127
|
+
-webkit-font-smoothing: antialiased;
|
|
128
|
+
cursor: default;
|
|
129
|
+
-webkit-user-select: none;
|
|
130
|
+
user-select: none;
|
|
131
|
+
}
|
|
132
|
+
:where(.dark) :where([data-settings-pane-header]) {
|
|
133
|
+
--stx-settings-tone-blue: #0a84ff;
|
|
134
|
+
--stx-settings-tone-red: #ff453a;
|
|
135
|
+
--stx-settings-tone-orange: #ff9f0a;
|
|
136
|
+
--stx-settings-tone-yellow: #ffd60a;
|
|
137
|
+
--stx-settings-tone-green: #30d158;
|
|
138
|
+
--stx-settings-tone-indigo: #5e5ce6;
|
|
139
|
+
--stx-settings-tone-purple: #bf5af2;
|
|
140
|
+
--stx-settings-tone-pink: #ff375f;
|
|
141
|
+
--stx-settings-tone-ink: #48484a;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-tile {
|
|
145
|
+
display: inline-flex;
|
|
146
|
+
flex: 0 0 auto;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: center;
|
|
149
|
+
width: var(--stx-settings-hero-tile-size);
|
|
150
|
+
height: var(--stx-settings-hero-tile-size);
|
|
151
|
+
margin-bottom: 12px;
|
|
152
|
+
border-radius: 11px;
|
|
153
|
+
background: var(--stx-settings-tone-grey);
|
|
154
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
|
|
155
|
+
color: #ffffff;
|
|
156
|
+
font-size: 30px;
|
|
157
|
+
line-height: 1;
|
|
158
|
+
}
|
|
159
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-tile > i { display: block; width: 1em; height: 1em; }
|
|
160
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-tile[data-tone="blue"] { background: var(--stx-settings-tone-blue); }
|
|
161
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-tile[data-tone="red"] { background: var(--stx-settings-tone-red); }
|
|
162
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-tile[data-tone="orange"] { background: var(--stx-settings-tone-orange); }
|
|
163
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-tile[data-tone="yellow"] { background: var(--stx-settings-tone-yellow); }
|
|
164
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-tile[data-tone="green"] { background: var(--stx-settings-tone-green); }
|
|
165
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-tile[data-tone="indigo"] { background: var(--stx-settings-tone-indigo); }
|
|
166
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-tile[data-tone="purple"] { background: var(--stx-settings-tone-purple); }
|
|
167
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-tile[data-tone="pink"] { background: var(--stx-settings-tone-pink); }
|
|
168
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-tile[data-tone="ink"] { background: var(--stx-settings-tone-ink); }
|
|
169
|
+
|
|
170
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-title {
|
|
171
|
+
margin: 0;
|
|
172
|
+
font-size: 20px;
|
|
173
|
+
font-weight: 700;
|
|
174
|
+
line-height: 24px;
|
|
175
|
+
letter-spacing: -0.2px;
|
|
176
|
+
color: var(--stx-mac-ink);
|
|
177
|
+
}
|
|
178
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-description {
|
|
179
|
+
max-width: 440px;
|
|
180
|
+
margin: 2px 0 0;
|
|
181
|
+
font-size: 12px;
|
|
182
|
+
line-height: 16px;
|
|
183
|
+
color: var(--stx-mac-ink-secondary);
|
|
184
|
+
}
|
|
185
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-description:empty { display: none; }
|
|
186
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-extra { margin-top: 10px; font-size: var(--stx-mac-font-size); }
|
|
187
|
+
:where([data-settings-pane-header]) > .stx-settings-hero-extra:empty { display: none; }
|
|
188
|
+
</style>
|
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
<script server>
|
|
2
|
+
/*
|
|
3
|
+
* <SettingsRow>: one setting in a <SettingsGroup>. Its name at the leading
|
|
4
|
+
* edge, a description under it, and the control (whatever is in the slot) at
|
|
5
|
+
* the trailing edge.
|
|
6
|
+
*
|
|
7
|
+
* <SettingsRow label="Tint window background" setting="tint" keywords="wallpaper colour">
|
|
8
|
+
* <Switch variant="mac" v-model:checked="tint" />
|
|
9
|
+
* </SettingsRow>
|
|
10
|
+
*
|
|
11
|
+
* The row is how the window's search finds a setting, so it carries
|
|
12
|
+
* `data-settings-row`, `data-setting`, `data-label` and `data-keywords`, and
|
|
13
|
+
* it draws the wash the window asks for by setting `data-highlight` on it.
|
|
14
|
+
*
|
|
15
|
+
* The label names the control. Its id is `<row id>-label` (also on the row as
|
|
16
|
+
* `data-label-id`), for a control that wants `aria-labelledby` itself, and
|
|
17
|
+
* when the first control in the slot has no accessible name the row gives it
|
|
18
|
+
* that one, with the description as `aria-describedby`.
|
|
19
|
+
*
|
|
20
|
+
* `to="<pane id>"` makes it a navigation row: a chevron, an optional `value`
|
|
21
|
+
* beside it, and `data-navigate` for the window, which is what opens the pane.
|
|
22
|
+
* The row only draws it.
|
|
23
|
+
*
|
|
24
|
+
* `multiline` lets the words wrap and puts the control at the top;
|
|
25
|
+
* `layout="stacked"` puts the control under the label at full width;
|
|
26
|
+
* `destructive` paints the label as a destructive action. `icon` is an
|
|
27
|
+
* Iconify class on a tile of `tone`.
|
|
28
|
+
*/
|
|
29
|
+
const TONES = ['grey', 'blue', 'red', 'orange', 'yellow', 'green', 'indigo', 'purple', 'pink', 'ink']
|
|
30
|
+
export const label = $props.label || ''
|
|
31
|
+
export const description = $props.description || ''
|
|
32
|
+
export const icon = $props.icon || ''
|
|
33
|
+
export const tone = TONES.includes($props.tone) ? $props.tone : 'grey'
|
|
34
|
+
export const setting = $props.setting || ''
|
|
35
|
+
export const keywords = Array.isArray($props.keywords) ? $props.keywords.join(' ') : ($props.keywords || '')
|
|
36
|
+
export const to = $props.to || ''
|
|
37
|
+
export const navigates = to !== ''
|
|
38
|
+
export const value = $props.value || ''
|
|
39
|
+
export const multiline = $bool($props.multiline)
|
|
40
|
+
export const destructive = $bool($props.destructive)
|
|
41
|
+
export const disabled = $bool($props.disabled)
|
|
42
|
+
export const layout = $props.layout === 'stacked' ? 'stacked' : 'inline'
|
|
43
|
+
const settingSlug = String(setting).replace(/[^\w-]+/g, '-')
|
|
44
|
+
export const rowId = $props.id || (settingSlug ? `settings-row-${settingSlug}` : `settings-row-${$uid}`)
|
|
45
|
+
export const labelId = `${rowId}-label`
|
|
46
|
+
export const descriptionId = `${rowId}-description`
|
|
47
|
+
export const className = $props.className || ''
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<script client>
|
|
51
|
+
const heading = useReactiveProp('label', {{ label }})
|
|
52
|
+
const detail = useReactiveProp('description', {{ description }})
|
|
53
|
+
const trailing = useReactiveProp('value', {{ value }})
|
|
54
|
+
const isDisabled = useReactiveProp('disabled', {{ disabled }})
|
|
55
|
+
const labelId = {{ labelId }}
|
|
56
|
+
const descriptionId = {{ descriptionId }}
|
|
57
|
+
const rowRef = useRef('row')
|
|
58
|
+
|
|
59
|
+
// What counts as the control: a group of choices before any one choice in it.
|
|
60
|
+
const CONTROLS = '[role="radiogroup"], [role="group"], input:not([type="hidden"]), select, textarea, button, [role="switch"], [role="slider"], [role="combobox"], [role="checkbox"], [role="listbox"], [role="textbox"], [role="spinbutton"], [tabindex]:not([tabindex="-1"])'
|
|
61
|
+
|
|
62
|
+
/*
|
|
63
|
+
* A name a control falls back to when it was given none says what kind of
|
|
64
|
+
* thing it is, not which setting. <Switch> calls itself "Toggle switch", and a
|
|
65
|
+
* window of twenty of those tells a screen reader nothing, so the row's label
|
|
66
|
+
* is put in charge of it: `aria-labelledby` outranks `aria-label`.
|
|
67
|
+
*/
|
|
68
|
+
const PLACEHOLDER_NAMES = ['Toggle switch']
|
|
69
|
+
|
|
70
|
+
function isNamed(control) {
|
|
71
|
+
if (PLACEHOLDER_NAMES.includes(control.getAttribute('aria-label') || '') && !control.hasAttribute('aria-labelledby')) return false
|
|
72
|
+
if ((control.getAttribute('aria-label') || '').trim() !== '') return true
|
|
73
|
+
if (control.hasAttribute('aria-labelledby')) return true
|
|
74
|
+
if (control.labels && control.labels.length > 0) return true
|
|
75
|
+
// A push button says what it does in its own words.
|
|
76
|
+
return control.tagName === 'BUTTON' && !control.hasAttribute('role') && control.textContent.trim() !== ''
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Name the slot's first control after the row, unless it has a name. */
|
|
80
|
+
function nameControl() {
|
|
81
|
+
const row = rowRef()
|
|
82
|
+
const slot = row ? row.querySelector('.stx-settings-row-control') : null
|
|
83
|
+
const control = slot ? slot.querySelector(CONTROLS) : null
|
|
84
|
+
if (!control) return null
|
|
85
|
+
if (!isNamed(control)) control.setAttribute('aria-labelledby', labelId)
|
|
86
|
+
if (detail() && !control.hasAttribute('aria-describedby')) control.setAttribute('aria-describedby', descriptionId)
|
|
87
|
+
return control
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
onMount(() => {
|
|
91
|
+
nameControl()
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
defineExpose({ labelId, descriptionId, nameControl })
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<div
|
|
98
|
+
ref="row"
|
|
99
|
+
id="{{ rowId }}"
|
|
100
|
+
data-settings-row
|
|
101
|
+
@if(setting)data-setting="{{ setting }}"@endif
|
|
102
|
+
data-label="{{ label }}"
|
|
103
|
+
:data-label="heading()"
|
|
104
|
+
data-keywords="{{ keywords }}"
|
|
105
|
+
data-label-id="{{ labelId }}"
|
|
106
|
+
data-layout="{{ layout }}"
|
|
107
|
+
@if(multiline)data-multiline@endif
|
|
108
|
+
@if(destructive)data-destructive@endif
|
|
109
|
+
@if(icon)data-tile@endif
|
|
110
|
+
@if(navigates)data-navigate="{{ to }}" role="button" tabindex="0"@endif
|
|
111
|
+
@if(disabled)aria-disabled="true"@endif
|
|
112
|
+
:aria-disabled="isDisabled() ? 'true' : null"
|
|
113
|
+
class="stx-settings-row {{ className }}"
|
|
114
|
+
>
|
|
115
|
+
@if(icon)
|
|
116
|
+
<span class="stx-settings-row-tile" data-tone="{{ tone }}" aria-hidden="true"><i class="{{ icon }}"></i></span>
|
|
117
|
+
@endif
|
|
118
|
+
<span class="stx-settings-row-text">
|
|
119
|
+
<span id="{{ labelId }}" :text="heading()" class="stx-settings-row-label">{{ label }}</span>
|
|
120
|
+
<span id="{{ descriptionId }}" :show="detail()" :text="detail()" class="stx-settings-row-description">{{ description }}</span>
|
|
121
|
+
</span>
|
|
122
|
+
<span class="stx-settings-row-control"><slot /></span>
|
|
123
|
+
@if(navigates)
|
|
124
|
+
<span :show="trailing()" :text="trailing()" class="stx-settings-row-value">{{ value }}</span>
|
|
125
|
+
<span class="stx-settings-row-chevron" aria-hidden="true"></span>
|
|
126
|
+
@endif
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<style data-native-exclude>
|
|
130
|
+
:where(:root) {
|
|
131
|
+
--stx-mac-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', sans-serif;
|
|
132
|
+
--stx-mac-font-size: 13px;
|
|
133
|
+
--stx-mac-font-size-small: 11px;
|
|
134
|
+
--stx-mac-hairline: 0.5px;
|
|
135
|
+
--stx-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--stx-mac-accent) 35%, transparent);
|
|
136
|
+
--stx-mac-card-radius: 12px;
|
|
137
|
+
--stx-mac-control-radius: 6px;
|
|
138
|
+
--stx-mac-row-height: 38px;
|
|
139
|
+
--stx-mac-row-inset: 10px;
|
|
140
|
+
--stx-mac-sidebar-width: 226px;
|
|
141
|
+
--stx-mac-accent: var(--stx-accent, rgb(0, 122, 255));
|
|
142
|
+
--stx-mac-accent-ink: #ffffff;
|
|
143
|
+
--stx-mac-ink: rgba(0, 0, 0, 0.85);
|
|
144
|
+
--stx-mac-ink-secondary: rgba(0, 0, 0, 0.5);
|
|
145
|
+
--stx-mac-ink-tertiary: rgba(0, 0, 0, 0.26);
|
|
146
|
+
--stx-mac-window: #ffffff;
|
|
147
|
+
--stx-mac-sidebar: #f2f1f0;
|
|
148
|
+
--stx-mac-card: rgba(0, 0, 0, 0.04);
|
|
149
|
+
--stx-mac-separator: rgba(0, 0, 0, 0.1);
|
|
150
|
+
--stx-mac-hover: rgba(0, 0, 0, 0.05);
|
|
151
|
+
--stx-mac-selection-inactive: rgba(0, 0, 0, 0.08);
|
|
152
|
+
--stx-mac-well: rgba(0, 0, 0, 0.07);
|
|
153
|
+
--stx-mac-control: #ffffff;
|
|
154
|
+
--stx-mac-control-line: rgba(0, 0, 0, 0.12);
|
|
155
|
+
--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);
|
|
156
|
+
--stx-mac-switch-on: #34c759;
|
|
157
|
+
--stx-mac-knob: #ffffff;
|
|
158
|
+
--stx-mac-danger: #ff3b30;
|
|
159
|
+
}
|
|
160
|
+
:where(.dark) {
|
|
161
|
+
--stx-mac-accent: var(--stx-accent, #0a84ff);
|
|
162
|
+
--stx-mac-accent-ink: #ffffff;
|
|
163
|
+
--stx-mac-ink: rgba(255, 255, 255, 0.85);
|
|
164
|
+
--stx-mac-ink-secondary: rgba(255, 255, 255, 0.55);
|
|
165
|
+
--stx-mac-ink-tertiary: rgba(255, 255, 255, 0.25);
|
|
166
|
+
--stx-mac-window: #1e1e1e;
|
|
167
|
+
--stx-mac-sidebar: #2a2a2a;
|
|
168
|
+
--stx-mac-card: rgba(255, 255, 255, 0.05);
|
|
169
|
+
--stx-mac-separator: rgba(255, 255, 255, 0.1);
|
|
170
|
+
--stx-mac-hover: rgba(255, 255, 255, 0.06);
|
|
171
|
+
--stx-mac-selection-inactive: rgba(255, 255, 255, 0.1);
|
|
172
|
+
--stx-mac-well: rgba(255, 255, 255, 0.1);
|
|
173
|
+
--stx-mac-control: rgba(255, 255, 255, 0.14);
|
|
174
|
+
--stx-mac-control-line: rgba(255, 255, 255, 0.06);
|
|
175
|
+
--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);
|
|
176
|
+
--stx-mac-switch-on: #30d158;
|
|
177
|
+
--stx-mac-knob: #ffffff;
|
|
178
|
+
--stx-mac-danger: #ff453a;
|
|
179
|
+
}
|
|
180
|
+
@media (max-resolution: 1.5dppx) {
|
|
181
|
+
:where(:root) {
|
|
182
|
+
--stx-mac-hairline: 1px;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
@media (prefers-contrast: more) {
|
|
186
|
+
:where(:root) {
|
|
187
|
+
--stx-mac-separator: rgba(0, 0, 0, 0.4);
|
|
188
|
+
--stx-mac-control-line: rgba(0, 0, 0, 0.5);
|
|
189
|
+
--stx-mac-ink-secondary: rgba(0, 0, 0, 0.75);
|
|
190
|
+
--stx-mac-hairline: 1px;
|
|
191
|
+
}
|
|
192
|
+
:where(.dark) {
|
|
193
|
+
--stx-mac-separator: rgba(255, 255, 255, 0.45);
|
|
194
|
+
--stx-mac-control-line: rgba(255, 255, 255, 0.5);
|
|
195
|
+
--stx-mac-ink-secondary: rgba(255, 255, 255, 0.8);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:where([data-settings-row]) {
|
|
200
|
+
/* The tile colours a Settings icon is drawn on. */
|
|
201
|
+
--stx-settings-tone-grey: #8e8e93;
|
|
202
|
+
--stx-settings-tone-blue: #007aff;
|
|
203
|
+
--stx-settings-tone-red: #ff3b30;
|
|
204
|
+
--stx-settings-tone-orange: #ff9500;
|
|
205
|
+
--stx-settings-tone-yellow: #ffcc00;
|
|
206
|
+
--stx-settings-tone-green: #34c759;
|
|
207
|
+
--stx-settings-tone-indigo: #5856d6;
|
|
208
|
+
--stx-settings-tone-purple: #af52de;
|
|
209
|
+
--stx-settings-tone-pink: #ff2d55;
|
|
210
|
+
--stx-settings-tone-ink: #1c1c1e;
|
|
211
|
+
--stx-settings-tile-size: 24px;
|
|
212
|
+
--stx-settings-tile-radius: 6px;
|
|
213
|
+
--stx-settings-tile-glyph: 15px;
|
|
214
|
+
--stx-settings-row-gap: 10px;
|
|
215
|
+
--stx-settings-row-wash: color-mix(in srgb, var(--stx-mac-accent) 20%, transparent);
|
|
216
|
+
/* A slider in a row is a control at the trailing edge, not the row's width. */
|
|
217
|
+
--stx-slider-width: 220px;
|
|
218
|
+
position: relative;
|
|
219
|
+
display: flex;
|
|
220
|
+
flex-direction: row;
|
|
221
|
+
align-items: center;
|
|
222
|
+
gap: var(--stx-settings-row-gap);
|
|
223
|
+
box-sizing: border-box;
|
|
224
|
+
min-height: var(--stx-mac-row-height);
|
|
225
|
+
min-width: 0;
|
|
226
|
+
padding: 0 var(--stx-mac-row-inset);
|
|
227
|
+
font-family: var(--stx-mac-font);
|
|
228
|
+
font-size: var(--stx-mac-font-size);
|
|
229
|
+
letter-spacing: -0.08px;
|
|
230
|
+
color: var(--stx-mac-ink);
|
|
231
|
+
-webkit-font-smoothing: antialiased;
|
|
232
|
+
cursor: default;
|
|
233
|
+
outline: none;
|
|
234
|
+
}
|
|
235
|
+
:where(.dark) :where([data-settings-row]) {
|
|
236
|
+
--stx-settings-tone-grey: #8e8e93;
|
|
237
|
+
--stx-settings-tone-blue: #0a84ff;
|
|
238
|
+
--stx-settings-tone-red: #ff453a;
|
|
239
|
+
--stx-settings-tone-orange: #ff9f0a;
|
|
240
|
+
--stx-settings-tone-yellow: #ffd60a;
|
|
241
|
+
--stx-settings-tone-green: #30d158;
|
|
242
|
+
--stx-settings-tone-indigo: #5e5ce6;
|
|
243
|
+
--stx-settings-tone-purple: #bf5af2;
|
|
244
|
+
--stx-settings-tone-pink: #ff375f;
|
|
245
|
+
--stx-settings-tone-ink: #48484a;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* The words. The label is one line unless the row is `multiline`; the
|
|
249
|
+
description always wraps. */
|
|
250
|
+
:where([data-settings-row]) > .stx-settings-row-text {
|
|
251
|
+
display: flex;
|
|
252
|
+
flex: 1 1 auto;
|
|
253
|
+
flex-direction: column;
|
|
254
|
+
justify-content: center;
|
|
255
|
+
min-width: 0;
|
|
256
|
+
padding: 7px 0;
|
|
257
|
+
-webkit-user-select: none;
|
|
258
|
+
user-select: none;
|
|
259
|
+
}
|
|
260
|
+
:where([data-settings-row]) .stx-settings-row-label {
|
|
261
|
+
overflow: hidden;
|
|
262
|
+
line-height: 16px;
|
|
263
|
+
text-overflow: ellipsis;
|
|
264
|
+
white-space: nowrap;
|
|
265
|
+
color: var(--stx-mac-ink);
|
|
266
|
+
}
|
|
267
|
+
:where([data-settings-row]) .stx-settings-row-description {
|
|
268
|
+
overflow: hidden;
|
|
269
|
+
margin-top: 1px;
|
|
270
|
+
font-size: var(--stx-mac-font-size-small);
|
|
271
|
+
line-height: 14px;
|
|
272
|
+
letter-spacing: 0;
|
|
273
|
+
/* A description wraps, as System Settings' do: it is a sentence, and a
|
|
274
|
+
sentence cut off at the control says less than no sentence. */
|
|
275
|
+
overflow-wrap: anywhere;
|
|
276
|
+
white-space: normal;
|
|
277
|
+
color: var(--stx-mac-ink-secondary);
|
|
278
|
+
}
|
|
279
|
+
:where([data-settings-row]) .stx-settings-row-description:empty { display: none; }
|
|
280
|
+
:where([data-settings-row][data-destructive]) .stx-settings-row-label { color: var(--stx-mac-danger); }
|
|
281
|
+
|
|
282
|
+
/* The control, at the trailing edge and never squeezed by the words. */
|
|
283
|
+
:where([data-settings-row]) > .stx-settings-row-control {
|
|
284
|
+
display: flex;
|
|
285
|
+
flex: 0 0 auto;
|
|
286
|
+
flex-direction: row;
|
|
287
|
+
align-items: center;
|
|
288
|
+
justify-content: flex-end;
|
|
289
|
+
gap: 8px;
|
|
290
|
+
max-width: 100%;
|
|
291
|
+
min-width: 0;
|
|
292
|
+
}
|
|
293
|
+
:where([data-settings-row]) > .stx-settings-row-control:empty { display: none; }
|
|
294
|
+
|
|
295
|
+
/* Words that wrap, with the control level with the first line. */
|
|
296
|
+
:where([data-settings-row][data-multiline]) { align-items: flex-start; }
|
|
297
|
+
:where([data-settings-row][data-multiline]) > .stx-settings-row-text { justify-content: flex-start; padding: 10px 0; }
|
|
298
|
+
:where([data-settings-row][data-multiline]) :is(.stx-settings-row-label, .stx-settings-row-description) {
|
|
299
|
+
overflow: visible;
|
|
300
|
+
text-overflow: clip;
|
|
301
|
+
white-space: normal;
|
|
302
|
+
}
|
|
303
|
+
:where([data-settings-row][data-multiline]) > .stx-settings-row-control { padding: 10px 0; }
|
|
304
|
+
:where([data-settings-row][data-multiline]) > :is(.stx-settings-row-tile, .stx-settings-row-chevron, .stx-settings-row-value) { margin-top: 10px; }
|
|
305
|
+
|
|
306
|
+
/* The control under the label, as wide as the row: a text area, a radio group. */
|
|
307
|
+
:where([data-settings-row][data-layout="stacked"]) {
|
|
308
|
+
flex-direction: column;
|
|
309
|
+
align-items: stretch;
|
|
310
|
+
gap: 4px;
|
|
311
|
+
--stx-slider-width: 100%;
|
|
312
|
+
}
|
|
313
|
+
:where([data-settings-row][data-layout="stacked"]) > .stx-settings-row-text { flex: 0 0 auto; padding: 10px 0 0; }
|
|
314
|
+
:where([data-settings-row][data-layout="stacked"]) > .stx-settings-row-control {
|
|
315
|
+
flex-direction: column;
|
|
316
|
+
align-items: stretch;
|
|
317
|
+
justify-content: flex-start;
|
|
318
|
+
gap: 0;
|
|
319
|
+
padding: 0 0 7px;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* The icon tile. */
|
|
323
|
+
:where([data-settings-row]) > .stx-settings-row-tile {
|
|
324
|
+
display: inline-flex;
|
|
325
|
+
flex: 0 0 auto;
|
|
326
|
+
align-items: center;
|
|
327
|
+
justify-content: center;
|
|
328
|
+
width: var(--stx-settings-tile-size);
|
|
329
|
+
height: var(--stx-settings-tile-size);
|
|
330
|
+
border-radius: var(--stx-settings-tile-radius);
|
|
331
|
+
background: var(--stx-settings-tone-grey);
|
|
332
|
+
color: #ffffff;
|
|
333
|
+
font-size: var(--stx-settings-tile-glyph);
|
|
334
|
+
line-height: 1;
|
|
335
|
+
}
|
|
336
|
+
:where([data-settings-row]) > .stx-settings-row-tile > i { display: block; width: 1em; height: 1em; }
|
|
337
|
+
:where([data-settings-row]) > .stx-settings-row-tile[data-tone="blue"] { background: var(--stx-settings-tone-blue); }
|
|
338
|
+
:where([data-settings-row]) > .stx-settings-row-tile[data-tone="red"] { background: var(--stx-settings-tone-red); }
|
|
339
|
+
:where([data-settings-row]) > .stx-settings-row-tile[data-tone="orange"] { background: var(--stx-settings-tone-orange); }
|
|
340
|
+
:where([data-settings-row]) > .stx-settings-row-tile[data-tone="yellow"] { background: var(--stx-settings-tone-yellow); }
|
|
341
|
+
:where([data-settings-row]) > .stx-settings-row-tile[data-tone="green"] { background: var(--stx-settings-tone-green); }
|
|
342
|
+
:where([data-settings-row]) > .stx-settings-row-tile[data-tone="indigo"] { background: var(--stx-settings-tone-indigo); }
|
|
343
|
+
:where([data-settings-row]) > .stx-settings-row-tile[data-tone="purple"] { background: var(--stx-settings-tone-purple); }
|
|
344
|
+
:where([data-settings-row]) > .stx-settings-row-tile[data-tone="pink"] { background: var(--stx-settings-tone-pink); }
|
|
345
|
+
:where([data-settings-row]) > .stx-settings-row-tile[data-tone="ink"] { background: var(--stx-settings-tone-ink); }
|
|
346
|
+
|
|
347
|
+
/* A navigation row: a value, a chevron, and something to press. */
|
|
348
|
+
:where([data-settings-row][data-navigate][data-tile]) { min-height: 44px; }
|
|
349
|
+
:where([data-settings-row]) > .stx-settings-row-value {
|
|
350
|
+
flex: 0 1 auto;
|
|
351
|
+
overflow: hidden;
|
|
352
|
+
min-width: 0;
|
|
353
|
+
text-overflow: ellipsis;
|
|
354
|
+
white-space: nowrap;
|
|
355
|
+
color: var(--stx-mac-ink-secondary);
|
|
356
|
+
-webkit-user-select: none;
|
|
357
|
+
user-select: none;
|
|
358
|
+
}
|
|
359
|
+
:where([data-settings-row]) > .stx-settings-row-value:empty { display: none; }
|
|
360
|
+
:where([data-settings-row]) > .stx-settings-row-chevron {
|
|
361
|
+
position: relative;
|
|
362
|
+
flex: 0 0 auto;
|
|
363
|
+
width: 7px;
|
|
364
|
+
height: 11px;
|
|
365
|
+
margin-left: -2px;
|
|
366
|
+
}
|
|
367
|
+
:where([data-settings-row]) > .stx-settings-row-chevron::before {
|
|
368
|
+
content: '';
|
|
369
|
+
position: absolute;
|
|
370
|
+
top: 50%;
|
|
371
|
+
left: 0;
|
|
372
|
+
box-sizing: border-box;
|
|
373
|
+
width: 7px;
|
|
374
|
+
height: 7px;
|
|
375
|
+
border-top: 1.5px solid var(--stx-mac-ink-tertiary);
|
|
376
|
+
border-right: 1.5px solid var(--stx-mac-ink-tertiary);
|
|
377
|
+
border-radius: 0.5px;
|
|
378
|
+
transform: translate(-2px, -50%) rotate(45deg);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/*
|
|
382
|
+
* What a row is washed with: hover and press on a navigation row, the focus
|
|
383
|
+
* ring, and the highlight the window's search puts on a found row. A rounded
|
|
384
|
+
* shape inside the row, concentric with the card, so the card need not clip.
|
|
385
|
+
*/
|
|
386
|
+
:where([data-settings-row])::after {
|
|
387
|
+
content: '';
|
|
388
|
+
position: absolute;
|
|
389
|
+
inset: 3px;
|
|
390
|
+
border-radius: calc(var(--stx-mac-card-radius) - 3px);
|
|
391
|
+
background: transparent;
|
|
392
|
+
pointer-events: none;
|
|
393
|
+
transition: background-color 150ms ease;
|
|
394
|
+
}
|
|
395
|
+
:where([data-settings-row][data-navigate]:hover)::after { background: var(--stx-mac-hover); }
|
|
396
|
+
:where([data-settings-row][data-navigate]:active)::after { background: var(--stx-mac-selection-inactive); }
|
|
397
|
+
:where([data-settings-row][data-navigate]:focus-visible)::after { box-shadow: var(--stx-mac-focus-ring); }
|
|
398
|
+
|
|
399
|
+
:where([data-settings-row][aria-disabled="true"]) > :not(.stx-settings-row-tile) { opacity: 0.4; }
|
|
400
|
+
:where([data-settings-row][aria-disabled="true"]) { pointer-events: none; }
|
|
401
|
+
|
|
402
|
+
[data-settings-row][data-highlight]::after { animation: stx-settings-row-highlight 1.6s ease-out both; }
|
|
403
|
+
@keyframes stx-settings-row-highlight {
|
|
404
|
+
0%, 30% { background: var(--stx-settings-row-wash); }
|
|
405
|
+
100% { background: transparent; }
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/* A window that is not the key window has no accent to wash with. */
|
|
409
|
+
:where([data-stx-window-active="false"]) :where([data-settings-row]),
|
|
410
|
+
:root[data-craft-window-active='false'] :where([data-settings-row]) {
|
|
411
|
+
--stx-settings-row-wash: var(--stx-mac-selection-inactive);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
@media (prefers-reduced-motion: reduce) {
|
|
415
|
+
:where([data-settings-row])::after { transition: none; }
|
|
416
|
+
/* The found row is still marked, for as long as the window marks it. It does not move. */
|
|
417
|
+
[data-settings-row][data-highlight]::after { animation: none; background: var(--stx-settings-row-wash); }
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
@media (prefers-contrast: more) {
|
|
421
|
+
:where([data-settings-row]) > .stx-settings-row-chevron::before { border-color: var(--stx-mac-ink-secondary); }
|
|
422
|
+
:where([data-settings-row][data-navigate]:focus-visible)::after { box-shadow: 0 0 0 2px var(--stx-mac-accent); }
|
|
423
|
+
}
|
|
424
|
+
</style>
|