@thalassic/themes 22.15.3 → 22.16.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/package.json +1 -1
- package/themes/thalassic/components/_confirm.scss +28 -3
- package/themes/thalassic/components/_password.scss +1 -1
- package/themes/thalassic/components/index.scss +1 -0
- package/themes/thalassic/components/slider/_index.scss +3 -0
- package/themes/thalassic/components/slider/_slider-color.scss +50 -0
- package/themes/thalassic/components/slider/_slider-size.scss +16 -0
- package/themes/thalassic/components/slider/_slider.scss +216 -0
package/package.json
CHANGED
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
|
|
19
19
|
display: flex;
|
|
20
20
|
flex-direction: column;
|
|
21
|
-
|
|
21
|
+
// The question and its consequence are one block, so they sit close together;
|
|
22
|
+
// the actions are set apart by their own margin below.
|
|
23
|
+
gap: var(--spacing-2);
|
|
22
24
|
|
|
23
25
|
border: var(--tls-confirm-border-width) solid var(--tls-confirm-border-color);
|
|
24
26
|
border-radius: var(--tls-confirm-border-radius);
|
|
@@ -33,18 +35,25 @@
|
|
|
33
35
|
&__title {
|
|
34
36
|
margin: 0;
|
|
35
37
|
|
|
36
|
-
font-size: var(--font-size
|
|
38
|
+
font-size: var(--font-title-medium-size);
|
|
39
|
+
line-height: var(--font-title-medium-line-height);
|
|
37
40
|
font-weight: var(--font-weight-semibold);
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
&__message {
|
|
41
44
|
margin: 0;
|
|
42
45
|
|
|
43
|
-
font-size: var(--font-size
|
|
46
|
+
font-size: var(--font-body-small-size);
|
|
47
|
+
line-height: var(--font-body-small-line-height);
|
|
44
48
|
color: var(--color-on-surface-variant);
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
&__actions {
|
|
52
|
+
// Stands apart from the text: acting is a distinct step from reading, and
|
|
53
|
+
// the room guards against a mis-click on a destructive action. Adds to the
|
|
54
|
+
// column gap, so the clearance above the actions totals `--spacing-4`.
|
|
55
|
+
margin-top: var(--spacing-2);
|
|
56
|
+
|
|
48
57
|
display: flex;
|
|
49
58
|
gap: var(--spacing-2);
|
|
50
59
|
|
|
@@ -64,4 +73,20 @@
|
|
|
64
73
|
justify-content: space-between;
|
|
65
74
|
}
|
|
66
75
|
}
|
|
76
|
+
|
|
77
|
+
// Width steps, centered on `md` so a confirm can be narrowed as readily as it
|
|
78
|
+
// is widened. `md` restates the base width, keeping every size stated in one
|
|
79
|
+
// place. The width is a cap, so a small screen still shrinks the panel below
|
|
80
|
+
// its step.
|
|
81
|
+
&--sm {
|
|
82
|
+
--tls-confirm-max-width: 280px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&--md {
|
|
86
|
+
--tls-confirm-max-width: 320px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&--lg {
|
|
90
|
+
--tls-confirm-max-width: 400px;
|
|
91
|
+
}
|
|
67
92
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@use '../mixins' as mixins;
|
|
2
2
|
|
|
3
3
|
.tls-password {
|
|
4
|
-
//
|
|
4
|
+
// Layout and border live on the inner tls-form-control-group; the host stays
|
|
5
5
|
// transparent so size/fluid set on the group resolve against the password's parent.
|
|
6
6
|
display: contents;
|
|
7
7
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.tls-slider {
|
|
2
|
+
&.tls-slider--primary {
|
|
3
|
+
--tls-slider-fill-color: var(--color-primary);
|
|
4
|
+
--tls-slider-thumb-color: var(--color-primary);
|
|
5
|
+
--tls-slider-tooltip-color: var(--color-primary);
|
|
6
|
+
--tls-slider-tooltip-on-color: var(--color-on-primary);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&.tls-slider--secondary {
|
|
10
|
+
--tls-slider-fill-color: var(--color-secondary);
|
|
11
|
+
--tls-slider-thumb-color: var(--color-secondary);
|
|
12
|
+
--tls-slider-tooltip-color: var(--color-secondary);
|
|
13
|
+
--tls-slider-tooltip-on-color: var(--color-on-secondary);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&.tls-slider--tertiary {
|
|
17
|
+
--tls-slider-fill-color: var(--color-tertiary);
|
|
18
|
+
--tls-slider-thumb-color: var(--color-tertiary);
|
|
19
|
+
--tls-slider-tooltip-color: var(--color-tertiary);
|
|
20
|
+
--tls-slider-tooltip-on-color: var(--color-on-tertiary);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&.tls-slider--success {
|
|
24
|
+
--tls-slider-fill-color: var(--color-success);
|
|
25
|
+
--tls-slider-thumb-color: var(--color-success);
|
|
26
|
+
--tls-slider-tooltip-color: var(--color-success);
|
|
27
|
+
--tls-slider-tooltip-on-color: var(--color-on-success);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.tls-slider--info {
|
|
31
|
+
--tls-slider-fill-color: var(--color-info);
|
|
32
|
+
--tls-slider-thumb-color: var(--color-info);
|
|
33
|
+
--tls-slider-tooltip-color: var(--color-info);
|
|
34
|
+
--tls-slider-tooltip-on-color: var(--color-on-info);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.tls-slider--warning {
|
|
38
|
+
--tls-slider-fill-color: var(--color-warning);
|
|
39
|
+
--tls-slider-thumb-color: var(--color-warning);
|
|
40
|
+
--tls-slider-tooltip-color: var(--color-warning);
|
|
41
|
+
--tls-slider-tooltip-on-color: var(--color-on-warning);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.tls-slider--danger {
|
|
45
|
+
--tls-slider-fill-color: var(--color-danger);
|
|
46
|
+
--tls-slider-thumb-color: var(--color-danger);
|
|
47
|
+
--tls-slider-tooltip-color: var(--color-danger);
|
|
48
|
+
--tls-slider-tooltip-on-color: var(--color-on-danger);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.tls-slider {
|
|
2
|
+
&.tls-slider--sm {
|
|
3
|
+
--tls-slider-track-height: 3px;
|
|
4
|
+
--tls-slider-thumb-size: 12px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
&.tls-slider--md {
|
|
8
|
+
--tls-slider-track-height: 4px;
|
|
9
|
+
--tls-slider-thumb-size: 16px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&.tls-slider--lg {
|
|
13
|
+
--tls-slider-track-height: 6px;
|
|
14
|
+
--tls-slider-thumb-size: 20px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
@use '../../mixins' as mixins;
|
|
2
|
+
|
|
3
|
+
.tls-slider {
|
|
4
|
+
--tls-slider-track-height: 4px;
|
|
5
|
+
--tls-slider-thumb-size: 16px;
|
|
6
|
+
--tls-slider-thumb-border-width: 2px;
|
|
7
|
+
--tls-slider-thumb-active-scale: 1.25;
|
|
8
|
+
|
|
9
|
+
// Bound by the component as the filled share of the track, unitless 0–1.
|
|
10
|
+
--tls-slider-fill: 0;
|
|
11
|
+
--tls-slider-fill-direction: to right;
|
|
12
|
+
|
|
13
|
+
// The thumb's centre travels only across `track − thumb`, inset by half a thumb
|
|
14
|
+
// at each end, so the fill has to stop on that travel line rather than at a raw
|
|
15
|
+
// share of the track — otherwise the colour edge drifts off the thumb by up to
|
|
16
|
+
// half a thumb width toward the extremes. The value bubble rides the same line.
|
|
17
|
+
--tls-slider-fill-position: calc(
|
|
18
|
+
var(--tls-slider-fill) * (100% - var(--tls-slider-thumb-size)) +
|
|
19
|
+
(var(--tls-slider-thumb-size) / 2)
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
--tls-slider-track-color: var(--color-surface-variant);
|
|
23
|
+
--tls-slider-fill-color: var(--color-primary);
|
|
24
|
+
--tls-slider-thumb-color: var(--color-primary);
|
|
25
|
+
--tls-slider-thumb-border-color: var(--color-surface);
|
|
26
|
+
--tls-slider-tooltip-color: var(--color-primary);
|
|
27
|
+
--tls-slider-tooltip-on-color: var(--color-on-primary);
|
|
28
|
+
--tls-slider-tooltip-offset: var(--spacing-2);
|
|
29
|
+
// Centers the bubble on the thumb; RTL anchors from the opposite edge.
|
|
30
|
+
--tls-slider-tooltip-translate: -50%;
|
|
31
|
+
|
|
32
|
+
// The filled portion is painted as a hard-stop gradient on the track itself,
|
|
33
|
+
// so no extra element is needed and the fill never lags the native thumb.
|
|
34
|
+
--tls-slider-track-image: linear-gradient(
|
|
35
|
+
var(--tls-slider-fill-direction),
|
|
36
|
+
var(--tls-slider-fill-color) var(--tls-slider-fill-position),
|
|
37
|
+
var(--tls-slider-track-color) var(--tls-slider-fill-position)
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
.tls-slider-input {
|
|
41
|
+
// Positioning context for the touch-target expansion below.
|
|
42
|
+
position: relative;
|
|
43
|
+
|
|
44
|
+
// The input box is the thumb's height; the track is centered inside it.
|
|
45
|
+
height: var(--tls-slider-thumb-size);
|
|
46
|
+
|
|
47
|
+
margin: 0;
|
|
48
|
+
|
|
49
|
+
appearance: none;
|
|
50
|
+
|
|
51
|
+
background-color: transparent;
|
|
52
|
+
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
|
|
55
|
+
// Grows the grabbable band vertically to the accessible minimum without
|
|
56
|
+
// thickening the track. Taps in the expansion still reach the input, so the
|
|
57
|
+
// value follows the finger from anywhere in the band.
|
|
58
|
+
@include mixins.touch-target(var(--tls-slider-thumb-size));
|
|
59
|
+
|
|
60
|
+
// The ring belongs on the thumb, not the full-width input box.
|
|
61
|
+
&:focus {
|
|
62
|
+
outline: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:focus-visible::-webkit-slider-thumb {
|
|
66
|
+
@include mixins.focus-ring;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:focus-visible::-moz-range-thumb {
|
|
70
|
+
@include mixins.focus-ring;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&::-webkit-slider-runnable-track {
|
|
74
|
+
height: var(--tls-slider-track-height);
|
|
75
|
+
|
|
76
|
+
border-radius: var(--radius-sm);
|
|
77
|
+
|
|
78
|
+
background-image: var(--tls-slider-track-image);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&::-moz-range-track {
|
|
82
|
+
height: var(--tls-slider-track-height);
|
|
83
|
+
|
|
84
|
+
border-radius: var(--radius-sm);
|
|
85
|
+
|
|
86
|
+
background-image: var(--tls-slider-track-image);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&::-webkit-slider-thumb {
|
|
90
|
+
width: var(--tls-slider-thumb-size);
|
|
91
|
+
height: var(--tls-slider-thumb-size);
|
|
92
|
+
|
|
93
|
+
// WebKit lays the thumb out from the track's top edge, so it has to be
|
|
94
|
+
// pulled back up by half their size difference to sit centered on it.
|
|
95
|
+
margin-block-start: calc(
|
|
96
|
+
(var(--tls-slider-track-height) - var(--tls-slider-thumb-size)) / 2
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
appearance: none;
|
|
100
|
+
|
|
101
|
+
border: var(--tls-slider-thumb-border-width) solid var(--tls-slider-thumb-border-color);
|
|
102
|
+
border-radius: 50%;
|
|
103
|
+
|
|
104
|
+
background-color: var(--tls-slider-thumb-color);
|
|
105
|
+
box-shadow: var(--shadow-xs);
|
|
106
|
+
|
|
107
|
+
cursor: inherit;
|
|
108
|
+
|
|
109
|
+
@include mixins.motion {
|
|
110
|
+
transition: transform var(--motion-fast) var(--motion-ease-spring);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&::-moz-range-thumb {
|
|
115
|
+
width: var(--tls-slider-thumb-size);
|
|
116
|
+
height: var(--tls-slider-thumb-size);
|
|
117
|
+
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
|
|
120
|
+
border: var(--tls-slider-thumb-border-width) solid var(--tls-slider-thumb-border-color);
|
|
121
|
+
border-radius: 50%;
|
|
122
|
+
|
|
123
|
+
background-color: var(--tls-slider-thumb-color);
|
|
124
|
+
box-shadow: var(--shadow-xs);
|
|
125
|
+
|
|
126
|
+
cursor: inherit;
|
|
127
|
+
|
|
128
|
+
@include mixins.motion {
|
|
129
|
+
transition: transform var(--motion-fast) var(--motion-ease-spring);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// A bare label rather than the `tls-tooltip` overlay: it tracks the thumb
|
|
135
|
+
// continuously during a drag, which an anchored overlay would lag behind.
|
|
136
|
+
.tls-slider-tooltip {
|
|
137
|
+
position: absolute;
|
|
138
|
+
inset-inline-start: var(--tls-slider-fill-position);
|
|
139
|
+
inset-block-end: calc(100% + var(--tls-slider-tooltip-offset));
|
|
140
|
+
|
|
141
|
+
padding: var(--spacing-1) var(--spacing-2);
|
|
142
|
+
|
|
143
|
+
border-radius: var(--radius-sm);
|
|
144
|
+
|
|
145
|
+
background-color: var(--tls-slider-tooltip-color);
|
|
146
|
+
|
|
147
|
+
font-size: var(--font-label-small-size);
|
|
148
|
+
font-weight: 600;
|
|
149
|
+
line-height: 1;
|
|
150
|
+
white-space: nowrap;
|
|
151
|
+
color: var(--tls-slider-tooltip-on-color);
|
|
152
|
+
|
|
153
|
+
opacity: 0;
|
|
154
|
+
// Never intercepts a drag that starts on the thumb underneath it.
|
|
155
|
+
pointer-events: none;
|
|
156
|
+
transform: translateX(var(--tls-slider-tooltip-translate)) scale(0.9);
|
|
157
|
+
|
|
158
|
+
@include mixins.motion {
|
|
159
|
+
transition:
|
|
160
|
+
opacity var(--motion-fast) var(--motion-ease-out),
|
|
161
|
+
transform var(--motion-fast) var(--motion-ease-spring);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&:hover .tls-slider-tooltip,
|
|
166
|
+
&:active .tls-slider-tooltip,
|
|
167
|
+
&:focus-within .tls-slider-tooltip {
|
|
168
|
+
opacity: 1;
|
|
169
|
+
transform: translateX(var(--tls-slider-tooltip-translate)) scale(1);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&:not(.tls-slider--disabled) .tls-slider-input:hover::-webkit-slider-thumb {
|
|
173
|
+
box-shadow: var(--shadow-sm);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&:not(.tls-slider--disabled) .tls-slider-input:hover::-moz-range-thumb {
|
|
177
|
+
box-shadow: var(--shadow-sm);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Grows the thumb under the finger/cursor while the value is being dragged.
|
|
181
|
+
// The scale itself is ungated so the state still reads at every motion level;
|
|
182
|
+
// only the easing into it is (see the thumb rules above).
|
|
183
|
+
&:not(.tls-slider--disabled):not(.tls-slider--readonly)
|
|
184
|
+
.tls-slider-input:active::-webkit-slider-thumb {
|
|
185
|
+
transform: scale(var(--tls-slider-thumb-active-scale));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&:not(.tls-slider--disabled):not(.tls-slider--readonly)
|
|
189
|
+
.tls-slider-input:active::-moz-range-thumb {
|
|
190
|
+
transform: scale(var(--tls-slider-thumb-active-scale));
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// The browser mirrors the thumb's travel under `dir="rtl"`, but a gradient
|
|
194
|
+
// direction and a centering translate are physical and have to be flipped.
|
|
195
|
+
:root[dir='rtl'] & {
|
|
196
|
+
--tls-slider-fill-direction: to left;
|
|
197
|
+
--tls-slider-tooltip-translate: 50%;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Form control
|
|
201
|
+
&.tls-slider--disabled .tls-slider-input {
|
|
202
|
+
cursor: not-allowed;
|
|
203
|
+
filter: brightness(0.9);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
&.tls-slider--readonly .tls-slider-input {
|
|
207
|
+
cursor: default;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
&:not(.tls-slider--disabled).tls-slider--show-error {
|
|
211
|
+
--tls-slider-fill-color: var(--color-danger);
|
|
212
|
+
--tls-slider-thumb-color: var(--color-danger);
|
|
213
|
+
--tls-slider-tooltip-color: var(--color-danger);
|
|
214
|
+
--tls-slider-tooltip-on-color: var(--color-on-danger);
|
|
215
|
+
}
|
|
216
|
+
}
|