@adia-ai/web-components 0.7.3 → 0.7.5
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/CHANGELOG.md +31 -0
- package/components/accordion/accordion.css +2 -2
- package/components/action-list/action-list.css +2 -2
- package/components/agent-artifact/agent-artifact.css +31 -31
- package/components/agent-feedback-bar/agent-feedback-bar.css +10 -10
- package/components/agent-questions/agent-questions.css +59 -57
- package/components/agent-reasoning/agent-reasoning.css +54 -54
- package/components/agent-suggestions/agent-suggestions.css +4 -4
- package/components/agent-trace/agent-trace.css +53 -53
- package/components/alert/alert.css +53 -53
- package/components/avatar/avatar.css +27 -27
- package/components/badge/badge.css +56 -53
- package/components/block/block.css +16 -16
- package/components/blockquote/blockquote.css +16 -16
- package/components/breadcrumb/breadcrumb.css +23 -23
- package/components/button/button.css +123 -101
- package/components/calendar-grid/calendar-grid.css +95 -92
- package/components/calendar-picker/calendar-picker.css +141 -139
- package/components/canvas/canvas.css +12 -12
- package/components/card/card.css +83 -83
- package/components/chart/chart.css +218 -218
- package/components/chart-legend/chart-legend.css +26 -26
- package/components/check/check.css +40 -40
- package/components/code/code.css +125 -125
- package/components/col/col.css +15 -15
- package/components/color-picker/color-picker.css +55 -55
- package/components/combobox/combobox.css +64 -62
- package/components/command/command.css +91 -91
- package/components/context-menu/context-menu.css +1 -1
- package/components/date-range-picker/date-range-picker.css +59 -59
- package/components/datetime-picker/datetime-picker.css +25 -25
- package/components/demo-toggle/demo-toggle.css +27 -27
- package/components/description-list/description-list.css +18 -18
- package/components/divider/divider.css +24 -24
- package/components/embed/embed.css +6 -6
- package/components/empty-state/empty-state.css +29 -29
- package/components/feed/feed.css +12 -12
- package/components/field/field.css +28 -28
- package/components/field/field.test.js +2 -2
- package/components/fields/fields.css +5 -5
- package/components/grid/grid.a2ui.json +10 -0
- package/components/grid/grid.css +23 -5
- package/components/grid/grid.d.ts +4 -0
- package/components/grid/grid.yaml +13 -0
- package/components/heatmap/heatmap.css +61 -61
- package/components/icon/icon.css +12 -12
- package/components/image/image.css +14 -14
- package/components/inline-edit/inline-edit.css +16 -16
- package/components/inline-message/inline-message.css +16 -16
- package/components/input/input.css +69 -66
- package/components/inspector/inspector.css +6 -6
- package/components/integration-card/integration-card.css +41 -41
- package/components/integration-card/integration-card.test.js +4 -4
- package/components/kbd/kbd.css +47 -40
- package/components/link/link.css +12 -12
- package/components/list/list.css +8 -8
- package/components/list-window/list-window.css +10 -10
- package/components/loading-overlay/loading-overlay.css +17 -18
- package/components/loading-overlay/loading-overlay.test.js +8 -8
- package/components/mark/mark.css +16 -16
- package/components/menu/menu.css +9 -9
- package/components/modal/modal.class.js +5 -9
- package/components/modal/modal.css +43 -43
- package/components/nav/nav.css +40 -40
- package/components/nav-group/nav-group.css +54 -54
- package/components/nav-item/nav-item.css +44 -44
- package/components/noodles/noodles.css +31 -31
- package/components/number-format/number-format.css +4 -4
- package/components/option-card/option-card.css +70 -70
- package/components/otp-input/otp-input.css +29 -29
- package/components/page/page.a2ui.json +1 -1
- package/components/page/page.css +27 -27
- package/components/page/page.d.ts +1 -1
- package/components/page/page.yaml +1 -1
- package/components/pagination/pagination.css +6 -6
- package/components/pane/pane.css +57 -57
- package/components/password-strength/password-strength.css +32 -32
- package/components/pipeline-status/pipeline-status.css +67 -67
- package/components/popover/popover.css +11 -11
- package/components/preview/preview.css +21 -21
- package/components/progress/progress.css +23 -23
- package/components/progress-row/progress-row.css +17 -17
- package/components/qr-code/qr-code.css +4 -4
- package/components/radio/radio.css +39 -39
- package/components/range/range.css +58 -55
- package/components/rating/rating.css +28 -28
- package/components/relative-time/relative-time.css +6 -6
- package/components/richtext/richtext.css +133 -133
- package/components/row/row.css +19 -19
- package/components/search/search.css +5 -5
- package/components/segment/segment.css +29 -24
- package/components/segmented/segmented.css +30 -25
- package/components/select/select.css +95 -93
- package/components/skeleton/skeleton.css +14 -14
- package/components/skip-nav/skip-nav.css +4 -4
- package/components/slider/slider.css +61 -61
- package/components/spinner/spinner.css +40 -40
- package/components/spinner/spinner.test.js +10 -12
- package/components/stack/stack.css +11 -11
- package/components/stat/stat.css +27 -27
- package/components/step-progress/step-progress.css +20 -20
- package/components/stepper/stepper.css +29 -29
- package/components/stream/stream.css +12 -12
- package/components/swatch/swatch.css +68 -68
- package/components/swiper/swiper.class.js +5 -12
- package/components/swiper/swiper.css +57 -57
- package/components/switch/switch.css +53 -53
- package/components/table/table.css +166 -163
- package/components/table-toolbar/table-toolbar.css +33 -33
- package/components/tabs/tabs.css +54 -51
- package/components/tag/tag.css +74 -71
- package/components/tag/tag.test.js +14 -14
- package/components/tags-input/tags-input.css +51 -49
- package/components/text/text.css +44 -44
- package/components/textarea/textarea.css +49 -46
- package/components/time-picker/time-picker.css +47 -47
- package/components/timeline/timeline.css +54 -54
- package/components/toast/toast.css +58 -58
- package/components/toc/toc.css +28 -28
- package/components/toggle-group/toggle-group.css +9 -6
- package/components/toggle-scheme/toggle-scheme.css +2 -2
- package/components/toolbar/toolbar.css +18 -18
- package/components/tooltip/tooltip.css +2 -2
- package/components/tour/tour.css +4 -4
- package/components/tree/tree.css +37 -37
- package/components/upload/upload.css +49 -49
- package/dist/host.min.css +1 -0
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +2 -2
- package/package.json +1 -1
- package/styles/api/text.css +9 -2
- package/styles/foundation/space.css +19 -18
- package/styles/host.css +48 -0
- package/styles/prose.css +187 -173
- package/styles/type/scale.css +6 -0
- package/styles/typography.css +10 -5
- package/styles/verse.css +122 -0
|
@@ -21,45 +21,45 @@
|
|
|
21
21
|
@scope (swiper-ui) {
|
|
22
22
|
:where(:scope) {
|
|
23
23
|
/* ── Layout ── */
|
|
24
|
-
--swiper-gap
|
|
25
|
-
--swiper-peek
|
|
26
|
-
--swiper-snap
|
|
27
|
-
--swiper-columns
|
|
24
|
+
--swiper-gap: var(--a-gap-self, var(--a-gap));
|
|
25
|
+
--swiper-peek: var(--a-space-8);
|
|
26
|
+
--swiper-snap: start;
|
|
27
|
+
--swiper-columns: 1;
|
|
28
28
|
|
|
29
29
|
/* ── Pagination dots ── */
|
|
30
30
|
/* Component-intrinsic visual constant; no --a-space-* equivalent */
|
|
31
|
-
--swiper-dot-size
|
|
31
|
+
--swiper-dot-size: 6px;
|
|
32
32
|
/* Active dot is one space token (4px @ density=1) larger than the
|
|
33
33
|
inactive dot — small, deliberate emphasis without rearranging
|
|
34
34
|
the row. The hitbox stays at 1rem; only the visible circle grows. */
|
|
35
|
-
--swiper-dot-size-active
|
|
36
|
-
--swiper-dot-gap
|
|
37
|
-
--swiper-dot-bg
|
|
38
|
-
--swiper-dot-bg-active
|
|
39
|
-
--swiper-dot-radius
|
|
35
|
+
--swiper-dot-size-active: calc(var(--swiper-dot-size) + var(--a-space-1));
|
|
36
|
+
--swiper-dot-gap: var(--a-space-2);
|
|
37
|
+
--swiper-dot-bg: var(--a-border);
|
|
38
|
+
--swiper-dot-bg-active: var(--a-fg);
|
|
39
|
+
--swiper-dot-radius: var(--a-radius-full);
|
|
40
40
|
|
|
41
41
|
/* ── Host vertical rhythm ── */
|
|
42
|
-
--swiper-gap-vertical
|
|
42
|
+
--swiper-gap-vertical: var(--a-space-3);
|
|
43
43
|
|
|
44
44
|
/* ── Paddle bottom offset ── */
|
|
45
|
-
--swiper-btn-bottom
|
|
45
|
+
--swiper-btn-bottom: var(--a-space-3);
|
|
46
46
|
|
|
47
47
|
/* ── Autoplay pause button offset ── */
|
|
48
|
-
--swiper-pause-top
|
|
49
|
-
--swiper-pause-right
|
|
48
|
+
--swiper-pause-top: var(--a-space-2);
|
|
49
|
+
--swiper-pause-right: var(--a-space-2);
|
|
50
50
|
|
|
51
51
|
/* ── Paddles ── */
|
|
52
|
-
--swiper-btn-size
|
|
53
|
-
--swiper-btn-bg
|
|
54
|
-
--swiper-btn-bg-hover
|
|
55
|
-
--swiper-btn-fg
|
|
56
|
-
--swiper-btn-radius
|
|
57
|
-
--swiper-btn-shadow
|
|
58
|
-
--swiper-btn-offset
|
|
52
|
+
--swiper-btn-size: 3rem;
|
|
53
|
+
--swiper-btn-bg: transparent;
|
|
54
|
+
--swiper-btn-bg-hover: var(--a-bg-muted);
|
|
55
|
+
--swiper-btn-fg: var(--a-fg);
|
|
56
|
+
--swiper-btn-radius: var(--a-radius-full);
|
|
57
|
+
--swiper-btn-shadow: none;
|
|
58
|
+
--swiper-btn-offset: var(--a-space-2);
|
|
59
59
|
|
|
60
60
|
/* ── Motion ── */
|
|
61
|
-
--swiper-duration
|
|
62
|
-
--swiper-easing
|
|
61
|
+
--swiper-duration: var(--a-duration);
|
|
62
|
+
--swiper-easing: var(--a-easing);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/* ── Host: flex column so dots sit below the scroll track ── */
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
box-sizing: border-box;
|
|
69
69
|
display: flex;
|
|
70
70
|
flex-direction: column;
|
|
71
|
-
gap: var(--swiper-gap-vertical
|
|
71
|
+
gap: var(--swiper-gap-vertical);
|
|
72
72
|
width: 100%;
|
|
73
73
|
position: relative;
|
|
74
74
|
/* Host is the container so @container queries below read the
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
display: grid;
|
|
85
85
|
grid-auto-flow: column;
|
|
86
86
|
grid-auto-columns: calc(
|
|
87
|
-
(100% - (var(--swiper-columns
|
|
87
|
+
(100% - (var(--swiper-columns) - 1) * var(--swiper-gap)) / var(--swiper-columns)
|
|
88
88
|
);
|
|
89
89
|
overflow-x: auto;
|
|
90
90
|
overflow-y: hidden;
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
scroll-behavior: smooth;
|
|
93
93
|
scrollbar-width: none;
|
|
94
94
|
-webkit-overflow-scrolling: touch;
|
|
95
|
-
gap: var(--swiper-gap
|
|
95
|
+
gap: var(--swiper-gap);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
:scope > [data-swiper-track]::-webkit-scrollbar { display: none; }
|
|
@@ -110,29 +110,29 @@
|
|
|
110
110
|
/* ── Slides ── */
|
|
111
111
|
|
|
112
112
|
:scope > [data-swiper-track] > * {
|
|
113
|
-
scroll-snap-align: var(--swiper-snap
|
|
113
|
+
scroll-snap-align: var(--swiper-snap);
|
|
114
114
|
scroll-snap-stop: always;
|
|
115
115
|
min-width: 0;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
/* ── Snap alignment ── */
|
|
119
119
|
|
|
120
|
-
:scope[snap="center"] { --swiper-snap
|
|
121
|
-
:scope[snap="end"] { --swiper-snap
|
|
120
|
+
:scope[snap="center"] { --swiper-snap: center; }
|
|
121
|
+
:scope[snap="end"] { --swiper-snap: end; }
|
|
122
122
|
|
|
123
123
|
/* ── Peek: show partial adjacent slides ── */
|
|
124
124
|
|
|
125
125
|
:scope[peek] > [data-swiper-track] {
|
|
126
|
-
padding-inline: var(--swiper-peek
|
|
127
|
-
scroll-padding-inline: var(--swiper-peek
|
|
126
|
+
padding-inline: var(--swiper-peek);
|
|
127
|
+
scroll-padding-inline: var(--swiper-peek);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/* ── Explicit slides-per-view ── */
|
|
131
131
|
|
|
132
|
-
:scope[slides-per-view="1"] { --swiper-columns
|
|
133
|
-
:scope[slides-per-view="2"] { --swiper-columns
|
|
134
|
-
:scope[slides-per-view="3"] { --swiper-columns
|
|
135
|
-
:scope[slides-per-view="4"] { --swiper-columns
|
|
132
|
+
:scope[slides-per-view="1"] { --swiper-columns: 1; }
|
|
133
|
+
:scope[slides-per-view="2"] { --swiper-columns: 2; }
|
|
134
|
+
:scope[slides-per-view="3"] { --swiper-columns: 3; }
|
|
135
|
+
:scope[slides-per-view="4"] { --swiper-columns: 4; }
|
|
136
136
|
|
|
137
137
|
/* ── Responsive auto (container queries) ──
|
|
138
138
|
The host IS the named `swiper` container, so @container queries
|
|
@@ -141,15 +141,15 @@
|
|
|
141
141
|
the swiper's own width. */
|
|
142
142
|
|
|
143
143
|
:scope:not([slides-per-view]) {
|
|
144
|
-
--swiper-columns
|
|
144
|
+
--swiper-columns: 1;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
@container swiper (min-width: 640px) {
|
|
148
|
-
:scope:not([slides-per-view]) > [data-swiper-track] { --swiper-columns
|
|
148
|
+
:scope:not([slides-per-view]) > [data-swiper-track] { --swiper-columns: 2; }
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
@container swiper (min-width: 960px) {
|
|
152
|
-
:scope:not([slides-per-view]) > [data-swiper-track] { --swiper-columns
|
|
152
|
+
:scope:not([slides-per-view]) > [data-swiper-track] { --swiper-columns: 3; }
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
/* ══════════════════════════════════════════════════════════
|
|
@@ -162,16 +162,16 @@
|
|
|
162
162
|
:scope > [data-swiper-btn] {
|
|
163
163
|
position: absolute;
|
|
164
164
|
top: 0;
|
|
165
|
-
bottom: var(--swiper-btn-bottom
|
|
165
|
+
bottom: var(--swiper-btn-bottom);
|
|
166
166
|
margin-block: auto;
|
|
167
167
|
height: fit-content;
|
|
168
168
|
z-index: 2;
|
|
169
|
-
--button-size: var(--swiper-btn-size
|
|
170
|
-
--button-radius: var(--swiper-btn-radius
|
|
169
|
+
--button-size: var(--swiper-btn-size);
|
|
170
|
+
--button-radius: var(--swiper-btn-radius);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
:scope > [data-swiper-prev] { left: var(--swiper-btn-offset
|
|
174
|
-
:scope > [data-swiper-next] { right: var(--swiper-btn-offset
|
|
173
|
+
:scope > [data-swiper-prev] { left: var(--swiper-btn-offset); }
|
|
174
|
+
:scope > [data-swiper-next] { right: var(--swiper-btn-offset); }
|
|
175
175
|
|
|
176
176
|
/* ══════════════════════════════════════════════════════════
|
|
177
177
|
JS-stamped pagination dots
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
display: flex;
|
|
183
183
|
align-items: center;
|
|
184
184
|
justify-content: center;
|
|
185
|
-
gap: var(--swiper-dot-gap
|
|
185
|
+
gap: var(--swiper-dot-gap);
|
|
186
186
|
min-height: 1.5rem;
|
|
187
187
|
}
|
|
188
188
|
|
|
@@ -192,16 +192,16 @@
|
|
|
192
192
|
for the active one (one space token larger). Padding is computed
|
|
193
193
|
from the size so the dot stays centered in the hitbox. */
|
|
194
194
|
:scope [data-swiper-dots] > button {
|
|
195
|
-
width: var(--swiper-dot-size
|
|
196
|
-
height: var(--swiper-dot-size
|
|
197
|
-
border-radius: var(--swiper-dot-radius
|
|
198
|
-
background: var(--swiper-dot-bg
|
|
195
|
+
width: var(--swiper-dot-size);
|
|
196
|
+
height: var(--swiper-dot-size);
|
|
197
|
+
border-radius: var(--swiper-dot-radius);
|
|
198
|
+
background: var(--swiper-dot-bg);
|
|
199
199
|
border: none;
|
|
200
|
-
padding: calc((1rem - var(--swiper-dot-size
|
|
200
|
+
padding: calc((1rem - var(--swiper-dot-size)) / 2);
|
|
201
201
|
background-clip: content-box;
|
|
202
202
|
box-sizing: content-box;
|
|
203
203
|
cursor: pointer;
|
|
204
|
-
transition: background var(--swiper-duration
|
|
204
|
+
transition: background var(--swiper-duration) var(--swiper-easing);
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
/* Long-hand `background-color` (not the `background` shorthand!) so
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
its initial `border-box` value — the colored area would otherwise
|
|
210
210
|
fill the full 1rem hitbox and turn into a huge circle. */
|
|
211
211
|
:scope [data-swiper-dots] > button:hover {
|
|
212
|
-
background-color: var(--swiper-dot-bg-active
|
|
212
|
+
background-color: var(--swiper-dot-bg-active);
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
/* Focus ring is rendered INSIDE the padding area (inset shadow), so
|
|
@@ -220,10 +220,10 @@
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
:scope [data-swiper-dots] > button[aria-current="true"] {
|
|
223
|
-
background-color: var(--swiper-dot-bg-active
|
|
224
|
-
width: var(--swiper-dot-size-active
|
|
225
|
-
height: var(--swiper-dot-size-active
|
|
226
|
-
padding: calc((1rem - var(--swiper-dot-size-active
|
|
223
|
+
background-color: var(--swiper-dot-bg-active);
|
|
224
|
+
width: var(--swiper-dot-size-active);
|
|
225
|
+
height: var(--swiper-dot-size-active);
|
|
226
|
+
padding: calc((1rem - var(--swiper-dot-size-active)) / 2);
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
/* ══════════════════════════════════════════════════════════
|
|
@@ -271,8 +271,8 @@
|
|
|
271
271
|
|
|
272
272
|
:scope[autoplay] > [data-swiper-pause] {
|
|
273
273
|
position: absolute;
|
|
274
|
-
top: var(--swiper-pause-top
|
|
275
|
-
right: var(--swiper-pause-right
|
|
274
|
+
top: var(--swiper-pause-top);
|
|
275
|
+
right: var(--swiper-pause-right);
|
|
276
276
|
z-index: 1;
|
|
277
277
|
}
|
|
278
278
|
|
|
@@ -2,64 +2,64 @@
|
|
|
2
2
|
token-block (Flavor B — attribute-removal restyle) both fail inside
|
|
3
3
|
`@scope`. Selectors moved out. See docs/BROWSER-COMPAT.md §3a. */
|
|
4
4
|
switch-ui:not([disabled]):hover {
|
|
5
|
-
--switch-track-bg
|
|
6
|
-
--switch-track-border
|
|
5
|
+
--switch-track-bg: var(--switch-track-bg-hover);
|
|
6
|
+
--switch-track-border: var(--switch-track-border-hover);
|
|
7
7
|
}
|
|
8
8
|
switch-ui[checked]:not([disabled]):hover {
|
|
9
|
-
--switch-track-bg
|
|
10
|
-
--switch-track-border
|
|
9
|
+
--switch-track-bg: var(--switch-track-bg-checked-hover);
|
|
10
|
+
--switch-track-border: var(--switch-track-border-checked-hover);
|
|
11
11
|
}
|
|
12
12
|
switch-ui[checked] {
|
|
13
|
-
--switch-track-bg
|
|
14
|
-
--switch-track-border
|
|
15
|
-
--switch-thumb-bg
|
|
13
|
+
--switch-track-bg: var(--switch-track-bg-checked);
|
|
14
|
+
--switch-track-border: var(--switch-track-border-checked);
|
|
15
|
+
--switch-thumb-bg: var(--switch-thumb-bg-checked);
|
|
16
16
|
}
|
|
17
17
|
switch-ui[checked] [slot="thumb"] {
|
|
18
|
-
transform: translateX(var(--switch-thumb-travel
|
|
18
|
+
transform: translateX(var(--switch-thumb-travel));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
@scope (switch-ui) {
|
|
22
22
|
:where(:scope) {
|
|
23
23
|
/* ── Layout ── */
|
|
24
|
-
--switch-gap
|
|
25
|
-
--switch-radius
|
|
24
|
+
--switch-gap: var(--a-space-2);
|
|
25
|
+
--switch-radius: var(--a-radius-full);
|
|
26
26
|
|
|
27
27
|
/* ── Typography ── */
|
|
28
|
-
--switch-font-size
|
|
28
|
+
--switch-font-size: var(--a-ui-size);
|
|
29
29
|
|
|
30
30
|
/* ── Colors ── */
|
|
31
|
-
--switch-track-bg-hover
|
|
32
|
-
--switch-track-bg-checked-hover
|
|
33
|
-
--switch-track-border-checked-hover
|
|
34
|
-
--switch-thumb-shadow
|
|
31
|
+
--switch-track-bg-hover: var(--a-bg-muted);
|
|
32
|
+
--switch-track-bg-checked-hover: var(--a-primary-hover);
|
|
33
|
+
--switch-track-border-checked-hover: var(--a-primary-hover);
|
|
34
|
+
--switch-thumb-shadow: var(--a-shadow-sm);
|
|
35
35
|
|
|
36
36
|
/* ── Transition ── */
|
|
37
|
-
--switch-duration
|
|
38
|
-
--switch-easing
|
|
37
|
+
--switch-duration: var(--a-duration-fast);
|
|
38
|
+
--switch-easing: var(--a-easing);
|
|
39
39
|
|
|
40
40
|
/* ── Focus ── */
|
|
41
|
-
--switch-focus-ring
|
|
41
|
+
--switch-focus-ring: var(--a-focus-ring);
|
|
42
42
|
|
|
43
43
|
/* ── Track ── (sizes scale with universal [size] attribute via --a-toggle-size) */
|
|
44
|
-
--switch-track-height
|
|
45
|
-
--switch-track-width
|
|
46
|
-
--switch-track-bg
|
|
47
|
-
--switch-track-border
|
|
48
|
-
--switch-track-border-hover
|
|
44
|
+
--switch-track-height: var(--a-toggle-size);
|
|
45
|
+
--switch-track-width: calc(var(--a-toggle-size) * 1.8);
|
|
46
|
+
--switch-track-bg: var(--a-ui-bg);
|
|
47
|
+
--switch-track-border: var(--a-ui-border);
|
|
48
|
+
--switch-track-border-hover: var(--a-fg-subtle);
|
|
49
49
|
|
|
50
50
|
/* ── Track: checked ── */
|
|
51
|
-
--switch-track-bg-checked
|
|
52
|
-
--switch-track-border-checked
|
|
51
|
+
--switch-track-bg-checked: var(--a-primary);
|
|
52
|
+
--switch-track-border-checked: var(--a-primary);
|
|
53
53
|
|
|
54
54
|
/* ── Thumb ── (derived from track; inset accounts for border + visual gap) */
|
|
55
|
-
--switch-thumb-inset
|
|
56
|
-
--switch-thumb-size
|
|
57
|
-
--switch-thumb-bg
|
|
58
|
-
--switch-thumb-bg-checked
|
|
59
|
-
--switch-thumb-travel
|
|
55
|
+
--switch-thumb-inset: 2px;
|
|
56
|
+
--switch-thumb-size: calc(var(--a-toggle-size) - 2 * var(--switch-thumb-inset) - 2px); /* -2px for 1px border each side */
|
|
57
|
+
--switch-thumb-bg: var(--a-fg-muted);
|
|
58
|
+
--switch-thumb-bg-checked: var(--a-chrome-light);
|
|
59
|
+
--switch-thumb-travel: calc(var(--switch-track-width) - var(--switch-thumb-size) - 2 * var(--switch-thumb-inset) - 2px);
|
|
60
60
|
|
|
61
61
|
/* ── State: disabled ── */
|
|
62
|
-
--switch-fg-disabled
|
|
62
|
+
--switch-fg-disabled: var(--a-ui-text-disabled);
|
|
63
63
|
text-align: start; /* §text-align-reset — blocks inheritance from centered ancestors */
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -68,43 +68,43 @@ switch-ui[checked] [slot="thumb"] {
|
|
|
68
68
|
box-sizing: border-box;
|
|
69
69
|
display: inline-flex;
|
|
70
70
|
align-items: center;
|
|
71
|
-
gap: var(--switch-gap
|
|
71
|
+
gap: var(--switch-gap);
|
|
72
72
|
cursor: pointer;
|
|
73
73
|
user-select: none;
|
|
74
|
-
font-size: var(--switch-font-size
|
|
74
|
+
font-size: var(--switch-font-size);
|
|
75
75
|
}
|
|
76
|
-
:scope[disabled] { cursor: not-allowed; color: var(--switch-fg-disabled
|
|
76
|
+
:scope[disabled] { cursor: not-allowed; color: var(--switch-fg-disabled); }
|
|
77
77
|
|
|
78
78
|
[slot="track"] {
|
|
79
79
|
position: relative;
|
|
80
|
-
width: var(--switch-track-width
|
|
81
|
-
height: var(--switch-track-height
|
|
82
|
-
border-radius: var(--switch-radius
|
|
83
|
-
background: var(--switch-track-bg
|
|
84
|
-
border: 1px solid var(--switch-track-border
|
|
80
|
+
width: var(--switch-track-width);
|
|
81
|
+
height: var(--switch-track-height);
|
|
82
|
+
border-radius: var(--switch-radius);
|
|
83
|
+
background: var(--switch-track-bg);
|
|
84
|
+
border: 1px solid var(--switch-track-border);
|
|
85
85
|
flex-shrink: 0;
|
|
86
86
|
transition:
|
|
87
|
-
background var(--switch-duration
|
|
88
|
-
border-color var(--switch-duration
|
|
87
|
+
background var(--switch-duration) var(--switch-easing),
|
|
88
|
+
border-color var(--switch-duration) var(--switch-easing);
|
|
89
89
|
}
|
|
90
90
|
/* hover + [checked] rules moved outside @scope — see Safari 17.x bug note at top. */
|
|
91
91
|
|
|
92
92
|
[slot="thumb"] {
|
|
93
93
|
position: absolute;
|
|
94
|
-
top: var(--switch-thumb-inset
|
|
95
|
-
left: var(--switch-thumb-inset
|
|
96
|
-
width: var(--switch-thumb-size
|
|
97
|
-
height: var(--switch-thumb-size
|
|
98
|
-
border-radius: var(--switch-radius
|
|
99
|
-
background: var(--switch-thumb-bg
|
|
100
|
-
box-shadow: var(--switch-thumb-shadow
|
|
94
|
+
top: var(--switch-thumb-inset);
|
|
95
|
+
left: var(--switch-thumb-inset);
|
|
96
|
+
width: var(--switch-thumb-size);
|
|
97
|
+
height: var(--switch-thumb-size);
|
|
98
|
+
border-radius: var(--switch-radius);
|
|
99
|
+
background: var(--switch-thumb-bg);
|
|
100
|
+
box-shadow: var(--switch-thumb-shadow);
|
|
101
101
|
transition:
|
|
102
|
-
transform var(--switch-duration
|
|
103
|
-
background var(--switch-duration
|
|
102
|
+
transform var(--switch-duration) var(--switch-easing),
|
|
103
|
+
background var(--switch-duration) var(--switch-easing);
|
|
104
104
|
}
|
|
105
105
|
/* :scope[checked] [slot="thumb"] moved outside @scope — see Safari 17.x bug note at top. */
|
|
106
106
|
|
|
107
|
-
[slot="label"] { font-size: var(--switch-font-size
|
|
107
|
+
[slot="label"] { font-size: var(--switch-font-size); }
|
|
108
108
|
|
|
109
109
|
/* ── Hint (§184, v0.5.5, FEEDBACK-08 §7) ──
|
|
110
110
|
Caption beneath the toggle row; wired to aria-describedby on host. */
|
|
@@ -126,11 +126,11 @@ switch-ui[checked] [slot="thumb"] {
|
|
|
126
126
|
:scope:has([slot="hint"]) { flex-wrap: wrap; }
|
|
127
127
|
:scope:has([slot="hint"]) [slot="hint"] {
|
|
128
128
|
flex-basis: 100%;
|
|
129
|
-
padding-inline-start: calc(var(--switch-track-width
|
|
129
|
+
padding-inline-start: calc(var(--switch-track-width) + var(--switch-gap));
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
:scope:focus-visible { outline: none; }
|
|
133
|
-
:scope:focus-visible [slot="track"] { box-shadow: var(--switch-focus-ring
|
|
133
|
+
:scope:focus-visible [slot="track"] { box-shadow: var(--switch-focus-ring); }
|
|
134
134
|
|
|
135
135
|
/* Size handled by universal [size] attribute system. */
|
|
136
136
|
}
|