@scattered-light/loomiere-base-ui 0.0.0-stage → 0.1.1
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/README.md +26 -2
- package/dist/index.d.ts +107 -0
- package/dist/index.js +315 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/components/Accordion.css +120 -0
- package/dist/styles/components/AlertDialog.css +8 -0
- package/dist/styles/components/Autocomplete.css +201 -0
- package/dist/styles/components/Avatar.css +134 -0
- package/dist/styles/components/Button.css +129 -0
- package/dist/styles/components/Checkbox.css +156 -0
- package/dist/styles/components/CheckboxGroup.css +15 -0
- package/dist/styles/components/Collapsible.css +115 -0
- package/dist/styles/components/Combobox.css +484 -0
- package/dist/styles/components/ContextMenu.css +168 -0
- package/dist/styles/components/Dialog.css +145 -0
- package/dist/styles/components/Drawer.css +126 -0
- package/dist/styles/components/Field.css +60 -0
- package/dist/styles/components/Fieldset.css +41 -0
- package/dist/styles/components/Form.css +19 -0
- package/dist/styles/components/Input.css +136 -0
- package/dist/styles/components/Menu.css +148 -0
- package/dist/styles/components/Menubar.css +192 -0
- package/dist/styles/components/Meter.css +59 -0
- package/dist/styles/components/NavigationMenu.css +419 -0
- package/dist/styles/components/NumberField.css +90 -0
- package/dist/styles/components/OTPField.css +62 -0
- package/dist/styles/components/Popover.css +161 -0
- package/dist/styles/components/PreviewCard.css +116 -0
- package/dist/styles/components/Progress.css +76 -0
- package/dist/styles/components/Radio.css +151 -0
- package/dist/styles/components/ScrollArea.css +81 -0
- package/dist/styles/components/Select.css +273 -0
- package/dist/styles/components/Separator.css +27 -0
- package/dist/styles/components/Slider.css +165 -0
- package/dist/styles/components/Switch.css +165 -0
- package/dist/styles/components/Tabs.css +135 -0
- package/dist/styles/components/Toast.css +235 -0
- package/dist/styles/components/Toggle.css +109 -0
- package/dist/styles/components/ToggleGroup.css +20 -0
- package/dist/styles/components/Toolbar.css +61 -0
- package/dist/styles/components/Tooltip.css +59 -0
- package/dist/styles/index.css +52 -0
- package/dist/styles/reset/accessibility.css +65 -0
- package/dist/styles/reset/reset-accessibility.css +110 -0
- package/dist/styles/reset/reset.css +442 -0
- package/package.json +50 -4
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/* @scattered-light/loomiere-base-ui 0.1.1 · styles for @base-ui/react 1.9.0 */
|
|
2
|
+
/* Select - Mojave Theme
|
|
3
|
+
*
|
|
4
|
+
* The trigger is a field (the field pattern, control sizes, the base text style); the
|
|
5
|
+
* list is a popup of item rows. Select keeps no tokens of its own.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/* ============================================
|
|
9
|
+
TRIGGER
|
|
10
|
+
============================================ */
|
|
11
|
+
|
|
12
|
+
.SelectTrigger {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
color: var(--sl-field-color);
|
|
15
|
+
background: var(--sl-field-background);
|
|
16
|
+
border: var(--sl-field-border-width) solid var(--sl-field-border-color);
|
|
17
|
+
border-radius: var(--sl-field-radius);
|
|
18
|
+
transition: var(--sl-field-transition);
|
|
19
|
+
outline: none;
|
|
20
|
+
font-family: var(--sl-font-base-font-family);
|
|
21
|
+
font-size: var(--sl-font-base-font-size);
|
|
22
|
+
font-weight: var(--sl-font-base-font-weight);
|
|
23
|
+
line-height: var(--sl-font-base-line-height);
|
|
24
|
+
letter-spacing: var(--sl-font-base-letter-spacing);
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
gap: var(--sl-gap-control);
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: var(--sl-control-height-md);
|
|
31
|
+
padding-block: var(--sl-control-padding-block);
|
|
32
|
+
padding-inline: var(--sl-control-padding-inline);
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.SelectTrigger:hover:not(:disabled) {
|
|
37
|
+
border-color: var(--sl-field-border-color-hover);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.SelectTrigger:focus-visible {
|
|
41
|
+
border-color: var(--sl-field-border-color-focus);
|
|
42
|
+
box-shadow: var(--sl-field-shadow-focus);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.SelectTrigger:disabled {
|
|
46
|
+
background: var(--sl-field-background-disabled);
|
|
47
|
+
color: var(--sl-field-color-disabled);
|
|
48
|
+
cursor: not-allowed;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* ============================================
|
|
52
|
+
VALUE AND ICON
|
|
53
|
+
============================================ */
|
|
54
|
+
|
|
55
|
+
.SelectValue {
|
|
56
|
+
flex: 1;
|
|
57
|
+
text-align: left;
|
|
58
|
+
color: var(--sl-field-color);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.SelectValue:empty::before {
|
|
62
|
+
content: attr(data-placeholder);
|
|
63
|
+
color: var(--sl-field-placeholder-color);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.SelectIcon {
|
|
67
|
+
display: inline-flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
flex-shrink: 0;
|
|
71
|
+
line-height: 1;
|
|
72
|
+
width: var(--sl-icon-size-base);
|
|
73
|
+
height: var(--sl-icon-size-base);
|
|
74
|
+
color: var(--sl-text-tertiary);
|
|
75
|
+
transition: transform var(--sl-duration-normal) var(--sl-easing-default);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.SelectTrigger[aria-expanded='true'] .SelectIcon {
|
|
79
|
+
transform: rotate(180deg);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* ============================================
|
|
83
|
+
BACKDROP, POSITIONER, POPUP
|
|
84
|
+
============================================ */
|
|
85
|
+
|
|
86
|
+
.SelectBackdrop {
|
|
87
|
+
position: fixed;
|
|
88
|
+
inset: 0;
|
|
89
|
+
background: color-mix(in srgb, var(--sl-overlay-base) 30%, transparent);
|
|
90
|
+
z-index: calc(var(--sl-popup-z-index) - 1);
|
|
91
|
+
animation: fadeIn var(--sl-popup-animation-duration) var(--sl-popup-animation-easing);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@keyframes fadeIn {
|
|
95
|
+
from {
|
|
96
|
+
opacity: 0;
|
|
97
|
+
}
|
|
98
|
+
to {
|
|
99
|
+
opacity: 1;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.SelectPositioner {
|
|
104
|
+
z-index: var(--sl-popup-z-index);
|
|
105
|
+
outline: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.SelectPopup {
|
|
109
|
+
box-sizing: border-box;
|
|
110
|
+
background: var(--sl-popup-background);
|
|
111
|
+
border: var(--sl-popup-border-width) solid var(--sl-popup-border-color);
|
|
112
|
+
border-radius: var(--sl-popup-radius);
|
|
113
|
+
box-shadow: var(--sl-popup-shadow);
|
|
114
|
+
outline: none;
|
|
115
|
+
border-radius: var(--sl-popup-radius-field);
|
|
116
|
+
padding: var(--sl-popup-padding);
|
|
117
|
+
width: var(--anchor-width);
|
|
118
|
+
max-width: var(--available-width);
|
|
119
|
+
animation: slideDown var(--sl-popup-animation-duration) var(--sl-popup-animation-easing);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@keyframes slideDown {
|
|
123
|
+
from {
|
|
124
|
+
opacity: 0;
|
|
125
|
+
transform: translateY(calc(-1 * var(--sl-space-2)));
|
|
126
|
+
}
|
|
127
|
+
to {
|
|
128
|
+
opacity: 1;
|
|
129
|
+
transform: translateY(0);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.SelectList {
|
|
134
|
+
max-height: var(--sl-popup-list-max-height);
|
|
135
|
+
overflow: auto;
|
|
136
|
+
outline: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* ============================================
|
|
140
|
+
ITEM
|
|
141
|
+
============================================ */
|
|
142
|
+
|
|
143
|
+
.SelectItem {
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
gap: var(--sl-item-gap);
|
|
147
|
+
padding-block: var(--sl-item-padding-block);
|
|
148
|
+
padding-inline: var(--sl-item-padding-inline);
|
|
149
|
+
border-radius: var(--sl-item-radius);
|
|
150
|
+
color: var(--sl-item-color);
|
|
151
|
+
cursor: default;
|
|
152
|
+
user-select: none;
|
|
153
|
+
outline: none;
|
|
154
|
+
transition: var(--sl-item-transition);
|
|
155
|
+
font-family: var(--sl-font-base-font-family);
|
|
156
|
+
font-size: var(--sl-font-base-font-size);
|
|
157
|
+
font-weight: var(--sl-font-base-font-weight);
|
|
158
|
+
line-height: var(--sl-font-base-line-height);
|
|
159
|
+
letter-spacing: var(--sl-font-base-letter-spacing);
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.SelectItem[data-highlighted],
|
|
164
|
+
.SelectItem:hover:not([data-disabled]) {
|
|
165
|
+
background: var(--sl-item-background-hover);
|
|
166
|
+
color: var(--sl-item-color-hover);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.SelectItem[data-selected] {
|
|
170
|
+
font-family: var(--sl-font-base-selected-font-family);
|
|
171
|
+
font-size: var(--sl-font-base-selected-font-size);
|
|
172
|
+
font-weight: var(--sl-font-base-selected-font-weight);
|
|
173
|
+
line-height: var(--sl-font-base-selected-line-height);
|
|
174
|
+
letter-spacing: var(--sl-font-base-selected-letter-spacing);
|
|
175
|
+
background: var(--sl-item-background-selected);
|
|
176
|
+
color: var(--sl-item-color-selected);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.SelectItem[data-disabled] {
|
|
180
|
+
color: var(--sl-item-color-disabled);
|
|
181
|
+
cursor: not-allowed;
|
|
182
|
+
opacity: var(--sl-item-opacity-disabled);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.SelectItemText {
|
|
186
|
+
flex: 1;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.SelectItemIndicator {
|
|
190
|
+
display: inline-flex;
|
|
191
|
+
align-items: center;
|
|
192
|
+
justify-content: center;
|
|
193
|
+
flex-shrink: 0;
|
|
194
|
+
width: var(--sl-item-indicator-size);
|
|
195
|
+
height: var(--sl-item-indicator-size);
|
|
196
|
+
color: var(--sl-item-indicator-color);
|
|
197
|
+
line-height: 1;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.SelectItemIndicatorIcon {
|
|
201
|
+
font-size: var(--sl-item-indicator-size);
|
|
202
|
+
line-height: 1;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* ============================================
|
|
206
|
+
GROUP AND SEPARATOR
|
|
207
|
+
============================================ */
|
|
208
|
+
|
|
209
|
+
.SelectGroup {
|
|
210
|
+
display: flex;
|
|
211
|
+
flex-direction: column;
|
|
212
|
+
gap: var(--sl-space-1);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.SelectGroupLabel {
|
|
216
|
+
font-family: var(--sl-font-condense-subtitle-label-font-family);
|
|
217
|
+
font-size: var(--sl-font-condense-subtitle-label-font-size);
|
|
218
|
+
font-weight: var(--sl-font-condense-subtitle-label-font-weight);
|
|
219
|
+
line-height: var(--sl-font-condense-subtitle-label-line-height);
|
|
220
|
+
letter-spacing: var(--sl-font-condense-subtitle-label-letter-spacing);
|
|
221
|
+
text-transform: var(--sl-font-condense-subtitle-label-text-transform);
|
|
222
|
+
padding-block: var(--sl-popup-group-label-padding-top) var(--sl-popup-group-label-padding-bottom);
|
|
223
|
+
padding-inline: var(--sl-item-padding-inline);
|
|
224
|
+
color: var(--sl-text-secondary);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.SelectSeparator {
|
|
228
|
+
height: var(--sl-stroke-default);
|
|
229
|
+
margin-block: var(--sl-popup-separator-spacing);
|
|
230
|
+
border: none;
|
|
231
|
+
background: var(--sl-popup-separator-color);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* ============================================
|
|
235
|
+
SCROLL ARROWS
|
|
236
|
+
============================================ */
|
|
237
|
+
|
|
238
|
+
.SelectScrollArrow {
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
justify-content: center;
|
|
242
|
+
height: var(--sl-icon-button-size);
|
|
243
|
+
color: var(--sl-text-secondary);
|
|
244
|
+
background: var(--sl-popup-background);
|
|
245
|
+
cursor: pointer;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.SelectScrollArrow:hover {
|
|
249
|
+
background: var(--sl-fill-subtle);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.SelectScrollArrowIcon {
|
|
253
|
+
width: var(--sl-icon-size-minimize);
|
|
254
|
+
height: var(--sl-icon-size-minimize);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/* ============================================
|
|
258
|
+
ARROW (popup pointer)
|
|
259
|
+
============================================ */
|
|
260
|
+
|
|
261
|
+
.SelectArrow {
|
|
262
|
+
width: var(--sl-space-2-5);
|
|
263
|
+
height: var(--sl-space-2-5);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.SelectArrowFill {
|
|
267
|
+
fill: var(--sl-popup-arrow-fill);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.SelectArrowStroke {
|
|
271
|
+
stroke: var(--sl-popup-arrow-stroke);
|
|
272
|
+
stroke-width: var(--sl-stroke-default);
|
|
273
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* @scattered-light/loomiere-base-ui 0.1.1 · styles for @base-ui/react 1.9.0 */
|
|
2
|
+
/* Separator - Mojave Theme
|
|
3
|
+
*
|
|
4
|
+
* A hairline in the everyday divider color (border.default), one stroke thick, with a step of
|
|
5
|
+
* space on either side. No component tokens.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.Separator {
|
|
9
|
+
border: none;
|
|
10
|
+
background: var(--sl-border-default);
|
|
11
|
+
flex-shrink: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.Separator[data-orientation='horizontal'],
|
|
15
|
+
.Separator:not([data-orientation]) {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: var(--sl-stroke-default);
|
|
18
|
+
margin-block: var(--sl-space-4);
|
|
19
|
+
margin-inline: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.Separator[data-orientation='vertical'] {
|
|
23
|
+
width: var(--sl-stroke-default);
|
|
24
|
+
height: 100%;
|
|
25
|
+
margin-block: 0;
|
|
26
|
+
margin-inline: var(--sl-space-4);
|
|
27
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/* @scattered-light/loomiere-base-ui 0.1.1 · styles for @base-ui/react 1.9.0 */
|
|
2
|
+
/* Slider - Mojave Theme
|
|
3
|
+
*
|
|
4
|
+
* A slider is a gauge you can drag: the track, fill and label row are gauge.* (the same bar as
|
|
5
|
+
* Meter and Progress, thin size), and the fill is the scope's solid color, so data-color on the
|
|
6
|
+
* root re-colors it. The thumb is a field-colored knob ringed in that color. Only the knob size
|
|
7
|
+
* and the vertical length are slider tokens.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
.SliderRoot {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: var(--sl-gauge-gap);
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.SliderHeader {
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.SliderLabel {
|
|
24
|
+
font-family: var(--sl-font-base-label-font-family);
|
|
25
|
+
font-size: var(--sl-font-base-label-font-size);
|
|
26
|
+
font-weight: var(--sl-font-base-label-font-weight);
|
|
27
|
+
line-height: var(--sl-font-base-label-line-height);
|
|
28
|
+
letter-spacing: var(--sl-font-base-label-letter-spacing);
|
|
29
|
+
color: var(--sl-gauge-label-color);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.SliderValue {
|
|
33
|
+
font-family: var(--sl-font-minimize-font-family);
|
|
34
|
+
font-size: var(--sl-font-minimize-font-size);
|
|
35
|
+
font-weight: var(--sl-font-minimize-font-weight);
|
|
36
|
+
line-height: var(--sl-font-minimize-line-height);
|
|
37
|
+
letter-spacing: var(--sl-font-minimize-letter-spacing);
|
|
38
|
+
color: var(--sl-gauge-value-color);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* ============================================
|
|
42
|
+
CONTROL
|
|
43
|
+
============================================ */
|
|
44
|
+
|
|
45
|
+
/* Padding keeps the whole knob inside the hit area */
|
|
46
|
+
.SliderControl {
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
position: relative;
|
|
51
|
+
touch-action: none;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
width: 100%;
|
|
54
|
+
padding-block: calc(var(--sl-slider-thumb-size) / 2);
|
|
55
|
+
user-select: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Disabled fades as a whole, like a checkbox, so it keeps its color but reads as off */
|
|
59
|
+
.SliderControl[data-disabled] {
|
|
60
|
+
cursor: not-allowed;
|
|
61
|
+
opacity: var(--sl-check-opacity-disabled);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.SliderControl[data-orientation='vertical'] {
|
|
65
|
+
height: var(--sl-slider-vertical-height);
|
|
66
|
+
width: auto;
|
|
67
|
+
padding-block: 0;
|
|
68
|
+
padding-inline: calc(var(--sl-slider-thumb-size) / 2);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* ============================================
|
|
72
|
+
TRACK AND FILL
|
|
73
|
+
============================================ */
|
|
74
|
+
|
|
75
|
+
.SliderTrack {
|
|
76
|
+
position: relative;
|
|
77
|
+
width: 100%;
|
|
78
|
+
height: var(--sl-gauge-height-sm);
|
|
79
|
+
background: var(--sl-gauge-track-color);
|
|
80
|
+
border-radius: var(--sl-gauge-radius);
|
|
81
|
+
user-select: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.SliderControl[data-orientation='vertical'] .SliderTrack {
|
|
85
|
+
width: var(--sl-gauge-height-sm);
|
|
86
|
+
height: 100%;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.SliderIndicator {
|
|
90
|
+
position: absolute;
|
|
91
|
+
background: var(--sl-scope-solid);
|
|
92
|
+
border-radius: var(--sl-gauge-radius);
|
|
93
|
+
user-select: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.SliderControl[data-orientation='horizontal'] .SliderIndicator,
|
|
97
|
+
.SliderControl:not([data-orientation]) .SliderIndicator {
|
|
98
|
+
height: 100%;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.SliderControl[data-orientation='vertical'] .SliderIndicator {
|
|
102
|
+
width: 100%;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* ============================================
|
|
106
|
+
THUMB
|
|
107
|
+
============================================ */
|
|
108
|
+
|
|
109
|
+
.SliderThumb {
|
|
110
|
+
box-sizing: border-box;
|
|
111
|
+
width: var(--sl-slider-thumb-size);
|
|
112
|
+
height: var(--sl-slider-thumb-size);
|
|
113
|
+
background: var(--sl-field-background);
|
|
114
|
+
border: var(--sl-stroke-emphasis) solid var(--sl-scope-solid);
|
|
115
|
+
border-radius: var(--sl-radius-pill);
|
|
116
|
+
cursor: grab;
|
|
117
|
+
outline: none;
|
|
118
|
+
user-select: none;
|
|
119
|
+
transition: box-shadow var(--sl-duration-normal) var(--sl-easing-default);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* A pale halo grows as you reach for the knob and grows again while you drag it */
|
|
123
|
+
@media (hover: hover) {
|
|
124
|
+
.SliderThumb:hover:not([data-disabled]) {
|
|
125
|
+
box-shadow: 0 0 0 var(--sl-focus-halo-spread) var(--sl-scope-soft-hover);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.SliderThumb:has(:focus-visible) {
|
|
130
|
+
outline: var(--sl-focus-outline);
|
|
131
|
+
outline-offset: var(--sl-focus-outline-offset);
|
|
132
|
+
box-shadow: 0 0 0 var(--sl-focus-halo-spread) var(--sl-focus-halo-color);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.SliderThumb[data-dragging] {
|
|
136
|
+
cursor: grabbing;
|
|
137
|
+
box-shadow: 0 0 0 calc(var(--sl-focus-halo-spread) * 1.5) var(--sl-scope-soft-active);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.SliderThumb[data-disabled] {
|
|
141
|
+
cursor: not-allowed;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* ============================================
|
|
145
|
+
MARKS
|
|
146
|
+
============================================ */
|
|
147
|
+
|
|
148
|
+
/* A tick across the track: as long as the track is thick, twice over */
|
|
149
|
+
.SliderMark {
|
|
150
|
+
position: absolute;
|
|
151
|
+
top: 50%;
|
|
152
|
+
width: var(--sl-stroke-emphasis);
|
|
153
|
+
height: calc(var(--sl-gauge-height-sm) * 2);
|
|
154
|
+
background: var(--sl-fill-strong);
|
|
155
|
+
border-radius: var(--sl-radius-pill);
|
|
156
|
+
transform: translate(-50%, -50%);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.SliderControl[data-orientation='vertical'] .SliderMark {
|
|
160
|
+
width: calc(var(--sl-gauge-height-sm) * 2);
|
|
161
|
+
height: var(--sl-stroke-emphasis);
|
|
162
|
+
left: 50%;
|
|
163
|
+
top: auto;
|
|
164
|
+
transform: translate(-50%, 50%);
|
|
165
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/* @scattered-light/loomiere-base-ui 0.1.1 · styles for @base-ui/react 1.9.0 */
|
|
2
|
+
/* Switch - Mojave Theme
|
|
3
|
+
* Switch keeps its track sizes. The thumb, its travel and the ON/OFF text are
|
|
4
|
+
* worked out from them: the thumb fills the track's height inside the padding,
|
|
5
|
+
* travels (width - height), and the text centers in the part the thumb leaves free.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/* ============================================
|
|
9
|
+
CONTAINER
|
|
10
|
+
============================================ */
|
|
11
|
+
|
|
12
|
+
.SwitchContainer {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: var(--sl-gap-control);
|
|
16
|
+
color: var(--sl-text-primary);
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
user-select: none;
|
|
19
|
+
--switch-width: var(--sl-switch-track-width);
|
|
20
|
+
--switch-height: var(--sl-switch-track-height);
|
|
21
|
+
--switch-text-size: var(--sl-switch-track-text-font-size);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.SwitchContainer[data-size='sm'] {
|
|
25
|
+
--switch-width: var(--sl-switch-track-width-sm);
|
|
26
|
+
--switch-height: var(--sl-switch-track-height-sm);
|
|
27
|
+
--switch-text-size: var(--sl-switch-track-text-font-size-sm);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.SwitchContainer[data-size='lg'] {
|
|
31
|
+
--switch-width: var(--sl-switch-track-width-lg);
|
|
32
|
+
--switch-height: var(--sl-switch-track-height-lg);
|
|
33
|
+
--switch-text-size: var(--sl-switch-track-text-font-size-lg);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.SwitchContainer[data-disabled] {
|
|
37
|
+
cursor: not-allowed;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ============================================
|
|
41
|
+
ROOT (Switch.Root - the track)
|
|
42
|
+
============================================ */
|
|
43
|
+
|
|
44
|
+
.SwitchRoot {
|
|
45
|
+
position: relative;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
flex-shrink: 0;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
appearance: none;
|
|
51
|
+
margin: 0;
|
|
52
|
+
width: var(--switch-width);
|
|
53
|
+
height: var(--switch-height);
|
|
54
|
+
padding: var(--sl-switch-track-padding);
|
|
55
|
+
border: var(--sl-check-border-width) solid var(--sl-check-border-color);
|
|
56
|
+
border-radius: var(--sl-radius-pill);
|
|
57
|
+
background-color: var(--sl-fill-default);
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
outline: none;
|
|
60
|
+
transition: background-color var(--sl-duration-normal) var(--sl-easing-in-out);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Track text (on/off), centered in the free part of the track */
|
|
64
|
+
.SwitchRoot::before {
|
|
65
|
+
content: 'off';
|
|
66
|
+
position: absolute;
|
|
67
|
+
inset-block: 0;
|
|
68
|
+
right: var(--sl-switch-track-padding);
|
|
69
|
+
width: calc(var(--switch-width) - var(--switch-height));
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
font-family: var(--sl-font-condense-subtitle-label-font-family);
|
|
74
|
+
font-size: var(--sl-font-condense-subtitle-label-font-size);
|
|
75
|
+
font-weight: var(--sl-font-condense-subtitle-label-font-weight);
|
|
76
|
+
line-height: var(--sl-font-condense-subtitle-label-line-height);
|
|
77
|
+
letter-spacing: var(--sl-font-condense-subtitle-label-letter-spacing);
|
|
78
|
+
text-transform: var(--sl-font-condense-subtitle-label-text-transform);
|
|
79
|
+
font-size: var(--switch-text-size);
|
|
80
|
+
line-height: 1;
|
|
81
|
+
color: var(--sl-text-secondary);
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
transition: opacity var(--sl-duration-normal) var(--sl-easing-in-out);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.SwitchRoot[data-checked] {
|
|
87
|
+
background-color: var(--sl-check-background-checked);
|
|
88
|
+
border-color: var(--sl-check-border-color-checked);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.SwitchRoot[data-checked]::before {
|
|
92
|
+
content: 'on';
|
|
93
|
+
right: auto;
|
|
94
|
+
left: var(--sl-switch-track-padding);
|
|
95
|
+
color: var(--sl-check-mark-color);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.SwitchRoot:hover:not([data-disabled]) {
|
|
99
|
+
background-color: var(--sl-fill-strong);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.SwitchRoot[data-checked]:hover:not([data-disabled]) {
|
|
103
|
+
background-color: var(--sl-interactive-hover);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.SwitchRoot:focus-visible {
|
|
107
|
+
outline: var(--sl-focus-outline);
|
|
108
|
+
outline-offset: var(--sl-focus-outline-offset);
|
|
109
|
+
box-shadow: 0 0 0 var(--sl-focus-halo-spread) var(--sl-focus-halo-color);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.SwitchRoot[data-disabled] {
|
|
113
|
+
opacity: var(--sl-check-opacity-disabled);
|
|
114
|
+
cursor: not-allowed;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* ============================================
|
|
118
|
+
THUMB (Switch.Thumb - the moving circle)
|
|
119
|
+
============================================ */
|
|
120
|
+
|
|
121
|
+
.SwitchThumb {
|
|
122
|
+
aspect-ratio: 1 / 1;
|
|
123
|
+
height: 100%;
|
|
124
|
+
border-radius: var(--sl-radius-pill);
|
|
125
|
+
background-color: var(--sl-check-background);
|
|
126
|
+
box-shadow: var(--sl-elevation-sm);
|
|
127
|
+
transition: translate var(--sl-duration-normal) var(--sl-easing-in-out);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.SwitchThumb[data-checked] {
|
|
131
|
+
translate: calc(var(--switch-width) - var(--switch-height)) 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* ============================================
|
|
135
|
+
LABEL
|
|
136
|
+
============================================ */
|
|
137
|
+
|
|
138
|
+
/* Switch labels run one step smaller than checkbox and radio labels (switch.json). */
|
|
139
|
+
.SwitchLabel {
|
|
140
|
+
font-family: var(--sl-font-base-label-font-family);
|
|
141
|
+
font-size: var(--sl-font-base-label-font-size);
|
|
142
|
+
font-weight: var(--sl-font-base-label-font-weight);
|
|
143
|
+
line-height: var(--sl-font-base-label-line-height);
|
|
144
|
+
letter-spacing: var(--sl-font-base-label-letter-spacing);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.SwitchContainer[data-size='sm'] .SwitchLabel {
|
|
148
|
+
font-family: var(--sl-font-minimize-font-family);
|
|
149
|
+
font-size: var(--sl-font-minimize-font-size);
|
|
150
|
+
font-weight: var(--sl-font-minimize-font-weight);
|
|
151
|
+
line-height: var(--sl-font-minimize-line-height);
|
|
152
|
+
letter-spacing: var(--sl-font-minimize-letter-spacing);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.SwitchContainer[data-size='lg'] .SwitchLabel {
|
|
156
|
+
font-family: var(--sl-font-base-font-family);
|
|
157
|
+
font-size: var(--sl-font-base-font-size);
|
|
158
|
+
font-weight: var(--sl-font-base-font-weight);
|
|
159
|
+
line-height: var(--sl-font-base-line-height);
|
|
160
|
+
letter-spacing: var(--sl-font-base-letter-spacing);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.SwitchContainer[data-disabled] .SwitchLabel {
|
|
164
|
+
color: var(--sl-text-disabled);
|
|
165
|
+
}
|