@plexui/styles 0.1.32 → 0.1.34
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/es/components/Accordion/Accordion.module.css +30 -0
- package/dist/es/components/Alert/Alert.module.css +112 -1
- package/dist/es/components/Badge/Badge.module.css +41 -8
- package/dist/es/components/Breadcrumb/Breadcrumb.module.css +35 -1
- package/dist/es/components/Button/Button.module.css +178 -77
- package/dist/es/components/Button/NavigationButton.module.css +27 -0
- package/dist/es/components/Card/Card.module.css +27 -9
- package/dist/es/components/Checkbox/Checkbox.module.css +83 -90
- package/dist/es/components/CodeBlock/CodeBlock.module.css +20 -0
- package/dist/es/components/ColorPicker/ColorPicker.module.css +396 -0
- package/dist/es/components/ContextMenu/ContextMenu.module.css +55 -0
- package/dist/es/components/DataTable/DataTable.module.css +35 -5
- package/dist/es/components/DatePicker/Calendar.module.css +280 -3
- package/dist/es/components/DatePicker/CalendarNavigationIcon.module.css +20 -0
- package/dist/es/components/DateRangePicker/Calendar.module.css +223 -3
- package/dist/es/components/DateRangePicker/Trigger.module.css +29 -1
- package/dist/es/components/Dialog/Dialog.module.css +386 -86
- package/dist/es/components/EmptyMessage/EmptyMessage.module.css +89 -14
- package/dist/es/components/Field/Field.module.css +346 -19
- package/dist/es/components/FieldError/FieldError.module.css +13 -10
- package/dist/es/components/FieldGroup/FieldGroup.module.css +103 -4
- package/dist/es/components/FileUpload/FileUpload.module.css +103 -10
- package/dist/es/components/FloatingLabelInput/FloatingLabelInput.module.css +46 -14
- package/dist/es/components/FloatingLabelSelect/FloatingLabelSelect.module.css +36 -14
- package/dist/es/components/Indicator/LoadingIndicator.module.css +48 -6
- package/dist/es/components/Input/Input.module.css +195 -25
- package/dist/es/components/InputGroup/InputGroup.module.css +5 -1
- package/dist/es/components/MarkdownEditor/MarkdownEditor.module.css +27 -147
- package/dist/es/components/Menu/Menu.module.css +425 -33
- package/dist/es/components/OTPInput/OTPInput.module.css +11 -3
- package/dist/es/components/Page/Page.module.css +217 -20
- package/dist/es/components/PageControl/PageControl.module.css +81 -0
- package/dist/es/components/Popover/Popover.module.css +10 -1
- package/dist/es/components/RadioGroup/RadioGroup.module.css +10 -10
- package/dist/es/components/Select/Select.module.css +162 -13
- package/dist/es/components/SelectControl/SelectControl.module.css +118 -11
- package/dist/es/components/ShimmerText/ShimmerText.module.css +7 -0
- package/dist/es/components/Sidebar/Sidebar.module.css +347 -72
- package/dist/es/components/Skeleton/Skeleton.module.css +4 -0
- package/dist/es/components/Slider/Slider.module.css +96 -52
- package/dist/es/components/Sortable/Sortable.module.css +20 -7
- package/dist/es/components/Stepper/Stepper.module.css +98 -0
- package/dist/es/components/Switch/Switch.module.css +16 -7
- package/dist/es/components/TabBar/TabBar.module.css +233 -0
- package/dist/es/components/Table/Table.module.css +4 -2
- package/dist/es/components/Tabs/Tabs.module.css +186 -6
- package/dist/es/components/TagInput/TagInput.module.css +64 -19
- package/dist/es/components/TextLink/TextLink.module.css +4 -4
- package/dist/es/components/Textarea/Textarea.module.css +1 -1
- package/dist/es/components/Toast/Toast.module.css +120 -5
- package/dist/es/components/Toolbar/Toolbar.module.css +579 -0
- package/dist/es/components/Tooltip/Tooltip.module.css +1 -1
- package/dist/es/styles/base.css +1 -1
- package/dist/es/styles/katex-fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/es/styles/katex-fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/es/styles/katex-fonts/LICENSE +21 -0
- package/dist/es/styles/katex.min.css +666 -730
- package/dist/es/styles/mobile-materials.css +69 -0
- package/dist/es/styles/mobile-surfaces.css +46 -0
- package/dist/es/styles/touch.css +524 -63
- package/dist/es/styles/variables-components.css +286 -7
- package/package.json +1 -1
- package/postcss/mixins.mjs +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@layer components {
|
|
2
2
|
@media (hover: hover) and (pointer: fine) {
|
|
3
|
-
.SliderWrap:hover .Reset[data-hide="false"] {
|
|
3
|
+
.SliderWrap:hover:where(:not(:root[data-input="touch"] *)) .Reset[data-hide="false"] {
|
|
4
4
|
cursor: pointer;
|
|
5
5
|
opacity: 1;
|
|
6
6
|
transition:
|
|
@@ -11,23 +11,35 @@
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/* Without hover the reset could never appear */
|
|
14
|
-
@media (hover: none) {
|
|
14
|
+
@media (hover: none), (pointer: coarse) {
|
|
15
15
|
.SliderWrap .Reset[data-hide="false"] {
|
|
16
16
|
opacity: 1;
|
|
17
17
|
visibility: visible;
|
|
18
18
|
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:where(:root[data-input="touch"]) .SliderWrap .Reset[data-hide="false"] {
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
opacity: 1;
|
|
24
|
+
visibility: visible;
|
|
19
25
|
}.Slider {
|
|
20
26
|
position: relative;
|
|
21
27
|
display: flex;
|
|
22
28
|
align-items: center;
|
|
23
29
|
width: 100%;
|
|
24
|
-
|
|
30
|
+
min-height: var(--slider-control-height, auto);
|
|
31
|
+
padding-bottom: var(--slider-padding-bottom, 6px);
|
|
25
32
|
touch-action: none;
|
|
26
33
|
-webkit-user-select: none;
|
|
27
34
|
-moz-user-select: none;
|
|
28
35
|
user-select: none;
|
|
29
36
|
}
|
|
30
37
|
|
|
38
|
+
.Slider[data-disabled] {
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
touch-action: auto;
|
|
41
|
+
}
|
|
42
|
+
|
|
31
43
|
/* Animate thumb position for single-mode programmatic changes */
|
|
32
44
|
.Slider .Thumb {
|
|
33
45
|
transition: left var(--slider-duration) var(--cubic-move);
|
|
@@ -50,34 +62,36 @@
|
|
|
50
62
|
padding-bottom: 0;
|
|
51
63
|
padding-right: 6px;
|
|
52
64
|
}.SliderWrap[data-orientation="vertical"] .Track {
|
|
53
|
-
width: 4px;
|
|
65
|
+
width: var(--slider-track-size, 4px);
|
|
54
66
|
height: 100%;
|
|
55
67
|
}.SliderWrap[data-orientation="vertical"] .Range {
|
|
56
68
|
width: 100%;
|
|
57
69
|
height: auto;
|
|
58
70
|
}.SliderWrap[data-orientation="vertical"] .Thumb {
|
|
71
|
+
width: var(--slider-thumb-height, 14px);
|
|
72
|
+
height: var(--slider-thumb-width, 14px);
|
|
59
73
|
transition: none;
|
|
60
74
|
}.Track {
|
|
61
75
|
position: relative;
|
|
62
76
|
flex-grow: 1;
|
|
63
77
|
width: 100%;
|
|
64
|
-
height: 4px;
|
|
65
|
-
border-radius: var(--radius-2xs);
|
|
78
|
+
height: var(--slider-track-size, 4px);
|
|
79
|
+
border-radius: var(--slider-track-radius, var(--radius-2xs));
|
|
66
80
|
background: var(--slider-track-color);
|
|
67
81
|
}.Range {
|
|
68
82
|
position: absolute;
|
|
69
83
|
height: 100%;
|
|
70
|
-
border-radius: var(--radius-2xs);
|
|
84
|
+
border-radius: var(--slider-track-radius, var(--radius-2xs));
|
|
71
85
|
background: var(--slider-range-color);
|
|
72
86
|
transition: right var(--slider-duration) var(--cubic-move);
|
|
73
87
|
}.Thumb {
|
|
74
88
|
position: relative;
|
|
75
89
|
display: block;
|
|
76
|
-
width: 14px;
|
|
77
|
-
height: 14px;
|
|
78
|
-
border-radius: 50
|
|
79
|
-
background: var(--gray-0);
|
|
80
|
-
box-shadow: inset 0 0 0 2px var(--slider-range-color);
|
|
90
|
+
width: var(--slider-thumb-width, 14px);
|
|
91
|
+
height: var(--slider-thumb-height, 14px);
|
|
92
|
+
border-radius: var(--slider-thumb-radius, 50%);
|
|
93
|
+
background: var(--slider-thumb-background, var(--gray-0));
|
|
94
|
+
box-shadow: var(--slider-thumb-shadow, inset 0 0 0 2px var(--slider-range-color));
|
|
81
95
|
cursor: grab;
|
|
82
96
|
outline: none;
|
|
83
97
|
}
|
|
@@ -91,16 +105,20 @@
|
|
|
91
105
|
cursor: grabbing;
|
|
92
106
|
}
|
|
93
107
|
|
|
94
|
-
.Thumb:disabled
|
|
108
|
+
.Thumb:disabled,
|
|
109
|
+
.Thumb[data-disabled] {
|
|
110
|
+
cursor: default;
|
|
95
111
|
pointer-events: none;
|
|
96
112
|
}.SliderLabel {
|
|
97
113
|
display: flex;
|
|
98
114
|
align-items: center;
|
|
99
115
|
justify-content: space-between;
|
|
100
116
|
gap: 4px;
|
|
101
|
-
|
|
117
|
+
min-height: var(--slider-label-height, var(--control-size-2xs));
|
|
118
|
+
margin-bottom: var(--slider-label-gap, 8px);
|
|
102
119
|
color: var(--color-text);
|
|
103
|
-
font-size:
|
|
120
|
+
font-size: var(--slider-label-font-size, var(--font-text-sm-size));
|
|
121
|
+
line-height: var(--slider-label-line-height, var(--font-text-sm-line-height));
|
|
104
122
|
}.Reset {
|
|
105
123
|
/* Ensures cursor switches back immediately after clicking reset button. */
|
|
106
124
|
cursor: default;
|
|
@@ -111,48 +129,50 @@
|
|
|
111
129
|
visibility: hidden;
|
|
112
130
|
}
|
|
113
131
|
|
|
114
|
-
/*
|
|
132
|
+
/* The 2xs ghost button stands as high as the value field beside it; its glyph is the reset arrow alone.
|
|
133
|
+
The data attribute wins over the Button's own size rules. */
|
|
115
134
|
.Reset[data-size="2xs"] {
|
|
116
|
-
width:
|
|
117
|
-
height:
|
|
135
|
+
width: var(--slider-reset-size, var(--control-size-2xs));
|
|
136
|
+
height: var(--slider-reset-size, var(--control-size-2xs));
|
|
118
137
|
}
|
|
119
138
|
|
|
120
139
|
.Reset[data-size="2xs"] svg {
|
|
121
|
-
width: 14px;
|
|
122
|
-
height: 14px;
|
|
123
|
-
}
|
|
140
|
+
width: var(--slider-reset-icon-size, 14px);
|
|
141
|
+
height: var(--slider-reset-icon-size, 14px);
|
|
142
|
+
}/* The value is an outline field of the 2xs size (24px, 6px gutter, the Input's outline borders) that shows
|
|
143
|
+
its border on hover and focus; the value and its unit are one line of the label's size, the unit in the
|
|
144
|
+
secondary text a space apart, and the text lines up with the end of the track. */.SliderValue {
|
|
124
145
|
overflow: hidden;
|
|
125
146
|
display: flex;
|
|
126
|
-
align-items:
|
|
147
|
+
align-items: center;
|
|
127
148
|
justify-content: flex-end;
|
|
128
|
-
gap:
|
|
129
|
-
height:
|
|
130
|
-
padding: 0
|
|
131
|
-
border:
|
|
132
|
-
border-radius: var(--radius-sm);
|
|
133
|
-
margin-
|
|
149
|
+
gap: var(--slider-value-unit-gap, 0.25em);
|
|
150
|
+
height: var(--slider-value-height, var(--control-size-2xs));
|
|
151
|
+
padding: 0 var(--slider-value-gutter, var(--control-gutter-2xs));
|
|
152
|
+
border: 1px solid transparent;
|
|
153
|
+
border-radius: var(--slider-value-radius, var(--control-radius-sm));
|
|
154
|
+
margin-inline-end: calc(-1 * var(--slider-value-gutter, var(--control-gutter-2xs)) - 1px);
|
|
134
155
|
-webkit-appearance: none;
|
|
135
156
|
-moz-appearance: none;
|
|
136
157
|
appearance: none;
|
|
137
158
|
background: transparent;
|
|
159
|
+
color: var(--slider-value-color, var(--color-text));
|
|
138
160
|
cursor: text;
|
|
161
|
+
font-size: var(--slider-value-font-size, var(--font-text-sm-size));
|
|
162
|
+
line-height: var(--slider-value-line-height, var(--font-text-sm-line-height));
|
|
139
163
|
outline: none;
|
|
140
|
-
|
|
141
|
-
transition: border-color 250ms ease;
|
|
164
|
+
transition: border-color var(--transition-duration-basic) var(--transition-ease-basic);
|
|
142
165
|
}
|
|
143
166
|
|
|
144
|
-
@media (
|
|
145
|
-
.SliderValue {
|
|
146
|
-
|
|
167
|
+
@media (hover: hover) and (pointer: fine) {
|
|
168
|
+
.SliderWrap:hover:where(:not(:root[data-input="touch"] *)) .SliderValue:not(:focus-within) {
|
|
169
|
+
border-color: var(--slider-value-border-color-hover, var(--input-outline-border-color));
|
|
147
170
|
}
|
|
148
171
|
}
|
|
149
172
|
|
|
150
|
-
.SliderWrap:hover .SliderValue:not(:focus-within) {
|
|
151
|
-
border-color: var(--gray-200);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
173
|
.SliderValue:focus-within {
|
|
155
|
-
border-color: var(--
|
|
174
|
+
border-color: var(--slider-value-border-color-focus, var(--input-outline-border-color-focus));
|
|
175
|
+
color: var(--slider-value-color-focus, var(--color-text));
|
|
156
176
|
}.ValueInput {
|
|
157
177
|
height: 100%;
|
|
158
178
|
padding: 0;
|
|
@@ -161,21 +181,14 @@
|
|
|
161
181
|
-moz-appearance: none;
|
|
162
182
|
appearance: none;
|
|
163
183
|
background: transparent;
|
|
164
|
-
color:
|
|
165
|
-
font
|
|
184
|
+
color: inherit;
|
|
185
|
+
font: inherit;
|
|
166
186
|
font-variant-numeric: tabular-nums;
|
|
167
187
|
outline: none;
|
|
168
|
-
text-align:
|
|
188
|
+
text-align: right;
|
|
169
189
|
transition: width 100ms ease;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
@media (min-width: 768px) {
|
|
173
|
-
.ValueInput {
|
|
174
|
-
font-size: 13px;
|
|
175
|
-
}
|
|
176
|
-
}.ValueUnit {
|
|
177
|
-
color: var(--color-text-secondary);
|
|
178
|
-
font-size: 12px;
|
|
190
|
+
}.ValueUnit {
|
|
191
|
+
color: var(--slider-unit-color, var(--color-text-secondary));
|
|
179
192
|
-webkit-user-select: none;
|
|
180
193
|
-moz-user-select: none;
|
|
181
194
|
user-select: none;
|
|
@@ -199,9 +212,40 @@
|
|
|
199
212
|
}/* =============================================
|
|
200
213
|
Range display (read-only value for range mode)
|
|
201
214
|
============================================= */.RangeDisplay {
|
|
202
|
-
color: var(--color-text);
|
|
203
|
-
font-size:
|
|
215
|
+
color: var(--slider-value-color, var(--color-text));
|
|
216
|
+
font-size: var(--slider-value-font-size, var(--font-text-sm-size));
|
|
204
217
|
font-variant-numeric: tabular-nums;
|
|
205
218
|
white-space: nowrap;
|
|
219
|
+
}/* The label row is a web adaptation: iOS sliders have no label or editable value. On a phone it reads as the
|
|
220
|
+
label and value of an iOS list row (touch.css: 17px label, the value and unit in the secondary label), a
|
|
221
|
+
44px line whose value and reset are touch targets. The value has no border, as the text fields of iOS
|
|
222
|
+
rows; while it is edited its text is the primary label. */@media (max-width: 767px) {
|
|
223
|
+
.SliderValue {
|
|
224
|
+
height: auto;
|
|
225
|
+
min-height: 44px;
|
|
226
|
+
padding: 0;
|
|
227
|
+
border: 0;
|
|
228
|
+
margin-inline-end: 0;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.ValueInput {
|
|
232
|
+
min-width: 44px;
|
|
233
|
+
height: 44px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* The reset is the row's accessory: its glyph alone on the 44px target in the secondary label, without the
|
|
237
|
+
button's face (three classes and the variant, over the Button's color rules in any sheet order). */
|
|
238
|
+
.SliderWrap .SliderLabel .Reset[data-variant="ghost"] {
|
|
239
|
+
color: var(--slider-reset-color, var(--color-text-secondary));
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.SliderWrap .SliderLabel .Reset[data-variant="ghost"]::before {
|
|
243
|
+
visibility: hidden;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.SliderWrap[data-orientation="vertical"] .Slider {
|
|
247
|
+
width: max(44px, var(--slider-control-height, 44px));
|
|
248
|
+
padding-right: 0;
|
|
249
|
+
}
|
|
206
250
|
}
|
|
207
251
|
}
|
|
@@ -8,17 +8,23 @@
|
|
|
8
8
|
}/* Without a grip in sight an item drags from anywhere but a control */.Sortable:not([data-disabled]):not(tbody):not([data-handles="true"]) > :not([data-sortable-static]),
|
|
9
9
|
.Sortable:not([data-disabled])[data-handles="false"] > :not([data-sortable-static]) {
|
|
10
10
|
cursor: grab;
|
|
11
|
-
}/* While a drag runs the neighbours of the gap slide apart
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
}/* While a drag runs the neighbours of the gap slide apart */@media (prefers-reduced-motion: no-preference) {
|
|
12
|
+
.Sortable[data-dragging] > * {
|
|
13
|
+
transition: transform 200ms var(--cubic-enter);
|
|
14
|
+
}
|
|
15
|
+
}/* A row with a handle: the handle, then the row. With touch.css a phone moves the handle to the end of the
|
|
16
|
+
row, where iOS puts its reorder control (--sortable-handle-order and the two margins). */.Sortable > :has(> .Handle) {
|
|
14
17
|
display: flex;
|
|
15
18
|
align-items: center;
|
|
16
19
|
}.Sortable > :has(> .Handle) > :not(.Handle) {
|
|
17
20
|
flex: 1;
|
|
18
21
|
min-width: 0;
|
|
19
22
|
}.Sortable > :has(> .Handle) > .Handle {
|
|
20
|
-
|
|
21
|
-
margin-inline-
|
|
23
|
+
order: var(--sortable-handle-order, 0);
|
|
24
|
+
margin-inline-start: var(--sortable-handle-margin-start, var(--sortable-handle-inset));
|
|
25
|
+
margin-inline-end: var(--sortable-handle-margin-end, calc(var(--sortable-handle-inset) * -1));
|
|
26
|
+
}/* Before a Field row a shown handle may reach into the row's own inline padding (touch.css: the kit's 12px from the value) */.Sortable[data-handles="true"] > :has(> .Handle) > .Handle:has(+ [data-slot="field"][data-row]) {
|
|
27
|
+
margin-inline-start: var(--sortable-handle-field-margin-start, var(--sortable-handle-margin-start, var(--sortable-handle-inset)));
|
|
22
28
|
}/* =============================================
|
|
23
29
|
Slot (the place a dragged item left, until the drop)
|
|
24
30
|
============================================= */.Sortable > [data-sortable-source] {
|
|
@@ -76,7 +82,7 @@
|
|
|
76
82
|
transition: color var(--transition-duration-basic);
|
|
77
83
|
}
|
|
78
84
|
|
|
79
|
-
@media (hover: hover) and (pointer: fine) {.Handle:hover {
|
|
85
|
+
@media (hover: hover) and (pointer: fine) {.Handle:hover:where(:not(:root[data-input="touch"] *)) {
|
|
80
86
|
color: var(--sortable-handle-color-hover);
|
|
81
87
|
}
|
|
82
88
|
}
|
|
@@ -89,7 +95,14 @@
|
|
|
89
95
|
.Handle > svg {
|
|
90
96
|
width: 1em;
|
|
91
97
|
height: 1em;
|
|
92
|
-
}/*
|
|
98
|
+
}/* Keep the desktop grip and the phone reorder symbol independent of the touch target. */.Handle > .DesktopGrip {
|
|
99
|
+
display: var(--sortable-desktop-grip-display, block);
|
|
100
|
+
}.Handle > .PhoneGrip {
|
|
101
|
+
display: var(--sortable-phone-grip-display, none);
|
|
102
|
+
/* Hamburger ink occupies x3…21 of its 24-unit viewBox. */
|
|
103
|
+
width: calc(var(--sortable-phone-grip-ink-width, 17px) * 24 / 18);
|
|
104
|
+
height: calc(var(--sortable-phone-grip-ink-width, 17px) * 24 / 18);
|
|
105
|
+
}/* Important: a page's own rule for every button stands outside the layer of this file */.Handle {
|
|
93
106
|
cursor: grab !important;
|
|
94
107
|
}.Sortable[data-disabled] .Handle {
|
|
95
108
|
cursor: not-allowed !important;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
@layer components {/* Two segments that decrease and increase a value: a minus and a plus, a short separator between them, a
|
|
2
|
+
segment at the end of the range in the tertiary label. On a desktop one fill lies under both segments and a
|
|
3
|
+
pressed one darkens; on a phone (touch.css) each segment has its own fill, as in the iOS 27 kit Stepper, and a
|
|
4
|
+
pressed one or one at the end of the range takes the lighter fill. Sizes and colors are tokens: the PlexUI
|
|
5
|
+
control size on a desktop, the kit's 92 x 32 capsule on a phone. */.Stepper {
|
|
6
|
+
position: relative;
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
flex-shrink: 0;
|
|
9
|
+
align-items: stretch;
|
|
10
|
+
vertical-align: middle;
|
|
11
|
+
height: var(--stepper-height);
|
|
12
|
+
border-radius: var(--stepper-radius);
|
|
13
|
+
background: var(--stepper-background);
|
|
14
|
+
-moz-user-select: none;
|
|
15
|
+
user-select: none;
|
|
16
|
+
-webkit-user-select: none;
|
|
17
|
+
-webkit-touch-callout: none;
|
|
18
|
+
touch-action: manipulation;
|
|
19
|
+
-webkit-tap-highlight-color: transparent;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.Stepper[data-pill] {
|
|
23
|
+
border-radius: calc(var(--stepper-height) / 2);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.Stepper:focus {
|
|
27
|
+
outline: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.Stepper:focus-visible {
|
|
31
|
+
outline: 2px solid var(--color-ring);
|
|
32
|
+
outline-offset: 2px;
|
|
33
|
+
}.Segment {
|
|
34
|
+
position: relative;
|
|
35
|
+
display: grid;
|
|
36
|
+
place-items: center;
|
|
37
|
+
flex-shrink: 0;
|
|
38
|
+
width: var(--stepper-segment-width);
|
|
39
|
+
margin: 0;
|
|
40
|
+
padding: 0;
|
|
41
|
+
border: 0;
|
|
42
|
+
border-radius: inherit;
|
|
43
|
+
background: var(--stepper-segment-background, transparent);
|
|
44
|
+
color: var(--stepper-icon-color);
|
|
45
|
+
font: inherit;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
z-index: 1;
|
|
48
|
+
transition: background-color var(--stepper-transition-duration, 150ms) ease;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.Segment:first-child {
|
|
52
|
+
border-start-end-radius: 0;
|
|
53
|
+
border-end-end-radius: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.Segment:last-of-type {
|
|
57
|
+
border-start-start-radius: 0;
|
|
58
|
+
border-end-start-radius: 0;
|
|
59
|
+
}
|
|
60
|
+
@media (hover: hover) and (pointer: fine) {
|
|
61
|
+
.Segment:hover:where(:not(:root[data-input="touch"] *)):not([data-disabled]):not([data-pressed]) {
|
|
62
|
+
background: var(--stepper-segment-background-hover);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Hover gives way to the pressed fill, which a pointer always presses over. */
|
|
67
|
+
|
|
68
|
+
.Segment[data-pressed] {
|
|
69
|
+
background: var(--stepper-segment-background-active);
|
|
70
|
+
transition-duration: 0ms;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.Segment[data-disabled] {
|
|
74
|
+
background: var(--stepper-segment-background-disabled, var(--stepper-segment-background, transparent));
|
|
75
|
+
color: var(--stepper-icon-disabled-color);
|
|
76
|
+
cursor: default;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* The pressed fill stays on the visible segment; the target reaches 44px where the control is shorter. */
|
|
80
|
+
.Segment::after {
|
|
81
|
+
position: absolute;
|
|
82
|
+
inset: min(0px, calc((var(--stepper-height) - var(--stepper-target-size, 0px)) / 2)) 0;
|
|
83
|
+
content: "";
|
|
84
|
+
}/* As in the kit, the separator sits under the two segments at the center and adds no width: 46 + 46 = 92. */.Separator {
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: var(--stepper-separator-inset);
|
|
87
|
+
left: 50%;
|
|
88
|
+
width: 1px;
|
|
89
|
+
height: calc(var(--stepper-height) - 2 * var(--stepper-separator-inset));
|
|
90
|
+
border-radius: 1px;
|
|
91
|
+
background: var(--stepper-separator-color);
|
|
92
|
+
transform: translateX(-50%);
|
|
93
|
+
pointer-events: none;
|
|
94
|
+
}.Icon {
|
|
95
|
+
width: var(--stepper-icon-size);
|
|
96
|
+
height: var(--stepper-icon-size);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
@layer components {.Container {
|
|
2
2
|
display: flex;
|
|
3
|
-
font-size: var(--font-text-sm-size);
|
|
4
|
-
line-height: var(--font-text-sm-line-height);
|
|
3
|
+
font-size: var(--switch-label-font-size, var(--font-text-sm-size));
|
|
4
|
+
line-height: var(--switch-label-line-height, var(--font-text-sm-line-height));
|
|
5
5
|
-webkit-user-select: none;
|
|
6
6
|
-moz-user-select: none;
|
|
7
7
|
user-select: none;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
.Container[data-color="accent"] {
|
|
11
|
+
--switch-track-color-checked: var(--switch-accent-color, light-dark(#34c759, #30d158));
|
|
12
|
+
--switch-track-color-checked-disabled: color-mix(in srgb, var(--switch-track-color-checked) 50%, transparent);
|
|
13
|
+
--switch-thumb-color: var(--white);
|
|
14
|
+
}
|
|
15
|
+
|
|
10
16
|
.Container[data-has-label] {
|
|
11
17
|
align-items: flex-start;
|
|
12
18
|
}
|
|
@@ -25,7 +31,7 @@
|
|
|
25
31
|
cursor: pointer;
|
|
26
32
|
transition: background-color 200ms var(--cubic-enter);
|
|
27
33
|
}
|
|
28
|
-
@media (hover: hover) and (pointer: fine) {.Track:where(:not([data-disabled], [data-state="checked"])):hover {
|
|
34
|
+
@media (hover: hover) and (pointer: fine) {.Track:where(:not([data-disabled], [data-state="checked"])):hover:where(:not(:root[data-input="touch"] *)) {
|
|
29
35
|
background: var(--switch-track-color-hover);
|
|
30
36
|
}
|
|
31
37
|
}
|
|
@@ -75,7 +81,10 @@
|
|
|
75
81
|
.Thumb[data-disabled] {
|
|
76
82
|
background: var(--switch-thumb-color-disabled);
|
|
77
83
|
box-shadow: none;
|
|
78
|
-
}.
|
|
84
|
+
}/* Center the first text line on the track without moving the track outside its box. */.Container > .Label,
|
|
85
|
+
.LabelGroup {
|
|
86
|
+
padding-block-start: var(--switch-label-padding-top, 0px);
|
|
87
|
+
}.LabelGroup {
|
|
79
88
|
display: flex;
|
|
80
89
|
flex-direction: column;
|
|
81
90
|
gap: 0;
|
|
@@ -93,7 +102,7 @@
|
|
|
93
102
|
[data-disabled] .LabelGroup {
|
|
94
103
|
cursor: not-allowed;
|
|
95
104
|
}.Label {
|
|
96
|
-
font-weight: var(--field-label-font-weight);
|
|
105
|
+
font-weight: var(--switch-label-font-weight, var(--field-label-font-weight));
|
|
97
106
|
cursor: pointer;
|
|
98
107
|
}
|
|
99
108
|
|
|
@@ -110,8 +119,8 @@
|
|
|
110
119
|
cursor: not-allowed;
|
|
111
120
|
}.Description {
|
|
112
121
|
color: var(--color-text-secondary);
|
|
113
|
-
font-size: var(--font-text-xs-size);
|
|
114
|
-
line-height: var(--font-text-xs-line-height);
|
|
122
|
+
font-size: var(--switch-description-font-size, var(--font-text-xs-size));
|
|
123
|
+
line-height: var(--switch-description-line-height, var(--font-text-xs-line-height));
|
|
115
124
|
cursor: pointer;
|
|
116
125
|
}
|
|
117
126
|
|