@adia-ai/web-components 0.6.33 → 0.6.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/CHANGELOG.md +22 -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 +57 -57
- package/components/agent-reasoning/agent-reasoning.css +62 -62
- package/components/agent-suggestions/agent-suggestions.css +4 -4
- package/components/agent-trace/agent-trace.css +53 -53
- package/components/alert/alert.css +41 -41
- package/components/avatar/avatar.css +27 -27
- package/components/badge/badge.css +27 -27
- package/components/block/block.css +16 -16
- package/components/breadcrumb/breadcrumb.css +23 -23
- package/components/button/button.css +101 -91
- package/components/calendar-grid/calendar-grid.a2ui.json +136 -0
- package/components/calendar-grid/calendar-grid.css +226 -0
- package/components/calendar-grid/calendar-grid.d.ts +37 -0
- package/components/calendar-grid/calendar-grid.js +17 -0
- package/components/calendar-grid/calendar-grid.yaml +116 -0
- package/components/calendar-grid/class.js +300 -0
- package/components/calendar-picker/calendar-picker.css +139 -139
- package/components/canvas/canvas.css +12 -12
- package/components/card/card.css +83 -83
- package/components/chart/chart.css +224 -224
- 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/class.js +861 -0
- package/components/combobox/combobox.a2ui.json +363 -0
- package/components/combobox/combobox.css +244 -0
- package/components/combobox/combobox.d.ts +113 -0
- package/components/combobox/combobox.examples.md +59 -0
- package/components/combobox/combobox.js +17 -0
- package/components/combobox/combobox.test.js +181 -0
- package/components/combobox/combobox.yaml +369 -0
- package/components/command/command.css +90 -90
- package/components/date-range-picker/class.js +775 -0
- package/components/date-range-picker/date-range-picker.a2ui.json +300 -0
- package/components/date-range-picker/date-range-picker.css +178 -0
- package/components/date-range-picker/date-range-picker.d.ts +82 -0
- package/components/date-range-picker/date-range-picker.examples.md +37 -0
- package/components/date-range-picker/date-range-picker.js +17 -0
- package/components/date-range-picker/date-range-picker.test.js +387 -0
- package/components/date-range-picker/date-range-picker.yaml +285 -0
- package/components/datetime-picker/class.js +706 -0
- package/components/datetime-picker/datetime-picker.a2ui.json +334 -0
- package/components/datetime-picker/datetime-picker.css +150 -0
- package/components/datetime-picker/datetime-picker.d.ts +86 -0
- package/components/datetime-picker/datetime-picker.examples.md +46 -0
- package/components/datetime-picker/datetime-picker.js +17 -0
- package/components/datetime-picker/datetime-picker.test.js +454 -0
- package/components/datetime-picker/datetime-picker.yaml +332 -0
- 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 +27 -27
- package/components/feed/feed.css +12 -12
- package/components/field/field.css +28 -28
- package/components/fields/fields.css +5 -5
- package/components/grid/grid.css +5 -5
- package/components/heatmap/heatmap.css +63 -63
- package/components/icon/icon.css +12 -12
- package/components/image/image.css +14 -14
- package/components/index.js +8 -0
- package/components/input/input.css +66 -66
- package/components/inspector/inspector.css +6 -6
- package/components/integration-card/class.js +410 -0
- package/components/integration-card/integration-card.a2ui.json +268 -0
- package/components/integration-card/integration-card.css +169 -0
- package/components/integration-card/integration-card.d.ts +63 -0
- package/components/integration-card/integration-card.examples.md +41 -0
- package/components/integration-card/integration-card.js +17 -0
- package/components/integration-card/integration-card.test.js +306 -0
- package/components/integration-card/integration-card.yaml +280 -0
- package/components/kbd/kbd.css +32 -32
- package/components/link/link.css +12 -12
- package/components/list/list.css +8 -8
- package/components/list-window/class.js +688 -0
- package/components/list-window/list-window.a2ui.json +277 -0
- package/components/list-window/list-window.css +124 -0
- package/components/list-window/list-window.d.ts +84 -0
- package/components/list-window/list-window.examples.md +73 -0
- package/components/list-window/list-window.js +17 -0
- package/components/list-window/list-window.test.js +303 -0
- package/components/list-window/list-window.yaml +270 -0
- package/components/menu/menu.css +8 -8
- package/components/modal/modal.css +43 -43
- package/components/nav/nav.css +40 -40
- package/components/nav-group/nav-group.css +52 -52
- package/components/nav-item/nav-item.css +44 -44
- package/components/noodles/noodles.css +31 -31
- package/components/option-card/option-card.css +69 -69
- package/components/otp-input/otp-input.css +30 -30
- package/components/page/page.css +18 -18
- package/components/pagination/pagination.css +61 -61
- package/components/pane/pane.css +57 -57
- package/components/pipeline-status/pipeline-status.css +65 -65
- package/components/popover/popover.css +17 -17
- package/components/progress/progress.css +23 -23
- package/components/progress-row/progress-row.css +17 -17
- package/components/radio/radio.css +39 -39
- package/components/range/range.css +55 -55
- package/components/rating/rating.css +28 -28
- 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 +24 -24
- package/components/segmented/segmented.css +25 -25
- package/components/select/select.css +84 -84
- package/components/skeleton/skeleton.css +14 -14
- package/components/slider/slider.css +46 -46
- package/components/spinner/class.js +69 -0
- package/components/spinner/spinner.a2ui.json +197 -0
- package/components/spinner/spinner.css +165 -0
- package/components/spinner/spinner.d.ts +26 -0
- package/components/spinner/spinner.examples.md +26 -0
- package/components/spinner/spinner.js +17 -0
- package/components/spinner/spinner.test.js +234 -0
- package/components/spinner/spinner.yaml +230 -0
- package/components/stack/stack.css +11 -11
- package/components/stat/stat.css +25 -25
- 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.css +57 -57
- package/components/switch/switch.css +52 -52
- package/components/table/table.css +162 -162
- package/components/table-toolbar/table-toolbar.css +32 -32
- package/components/tabs/tabs.css +51 -51
- package/components/tag/tag.css +48 -48
- package/components/text/text.css +44 -44
- package/components/textarea/textarea.css +46 -46
- package/components/time-picker/class.js +693 -0
- package/components/time-picker/time-picker.a2ui.json +267 -0
- package/components/time-picker/time-picker.css +122 -0
- package/components/time-picker/time-picker.d.ts +75 -0
- package/components/time-picker/time-picker.examples.md +35 -0
- package/components/time-picker/time-picker.js +17 -0
- package/components/time-picker/time-picker.test.js +287 -0
- package/components/time-picker/time-picker.yaml +256 -0
- package/components/timeline/timeline.css +50 -50
- package/components/toast/toast.css +58 -58
- package/components/toggle-group/toggle-group.css +6 -6
- package/components/toggle-scheme/toggle-scheme.css +2 -2
- package/components/toolbar/toolbar.css +17 -17
- package/components/tooltip/tooltip.css +2 -2
- package/components/tree/tree.css +37 -37
- package/components/upload/upload.css +49 -49
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +121 -83
- package/package.json +1 -1
- package/styles/components.css +8 -0
|
@@ -21,45 +21,45 @@
|
|
|
21
21
|
@scope (swiper-ui) {
|
|
22
22
|
:where(:scope) {
|
|
23
23
|
/* ── Layout ── */
|
|
24
|
-
--swiper-gap: var(--a-gap);
|
|
25
|
-
--swiper-peek: var(--a-space-8);
|
|
26
|
-
--swiper-snap: start;
|
|
27
|
-
--swiper-columns: 1;
|
|
24
|
+
--swiper-gap-default: var(--a-gap);
|
|
25
|
+
--swiper-peek-default: var(--a-space-8);
|
|
26
|
+
--swiper-snap-default: start;
|
|
27
|
+
--swiper-columns-default: 1;
|
|
28
28
|
|
|
29
29
|
/* ── Pagination dots ── */
|
|
30
30
|
/* Component-intrinsic visual constant; no --a-space-* equivalent */
|
|
31
|
-
--swiper-dot-size: 6px;
|
|
31
|
+
--swiper-dot-size-default: 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: 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);
|
|
35
|
+
--swiper-dot-size-active-default: calc(var(--swiper-dot-size, var(--swiper-dot-size-default)) + var(--a-space-1));
|
|
36
|
+
--swiper-dot-gap-default: var(--a-space-2);
|
|
37
|
+
--swiper-dot-bg-default: var(--a-border);
|
|
38
|
+
--swiper-dot-bg-active-default: var(--a-fg);
|
|
39
|
+
--swiper-dot-radius-default: var(--a-radius-full);
|
|
40
40
|
|
|
41
41
|
/* ── Host vertical rhythm ── */
|
|
42
|
-
--swiper-gap-vertical: var(--a-space-3);
|
|
42
|
+
--swiper-gap-vertical-default: var(--a-space-3);
|
|
43
43
|
|
|
44
44
|
/* ── Paddle bottom offset ── */
|
|
45
|
-
--swiper-btn-bottom: var(--a-space-3);
|
|
45
|
+
--swiper-btn-bottom-default: var(--a-space-3);
|
|
46
46
|
|
|
47
47
|
/* ── Autoplay pause button offset ── */
|
|
48
|
-
--swiper-pause-top: var(--a-space-2);
|
|
49
|
-
--swiper-pause-right: var(--a-space-2);
|
|
48
|
+
--swiper-pause-top-default: var(--a-space-2);
|
|
49
|
+
--swiper-pause-right-default: var(--a-space-2);
|
|
50
50
|
|
|
51
51
|
/* ── Paddles ── */
|
|
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);
|
|
52
|
+
--swiper-btn-size-default: 3rem;
|
|
53
|
+
--swiper-btn-bg-default: transparent;
|
|
54
|
+
--swiper-btn-bg-hover-default: var(--a-bg-muted);
|
|
55
|
+
--swiper-btn-fg-default: var(--a-fg);
|
|
56
|
+
--swiper-btn-radius-default: var(--a-radius-full);
|
|
57
|
+
--swiper-btn-shadow-default: none;
|
|
58
|
+
--swiper-btn-offset-default: var(--a-space-2);
|
|
59
59
|
|
|
60
60
|
/* ── Motion ── */
|
|
61
|
-
--swiper-duration: var(--a-duration);
|
|
62
|
-
--swiper-easing: var(--a-easing);
|
|
61
|
+
--swiper-duration-default: var(--a-duration);
|
|
62
|
+
--swiper-easing-default: 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, var(--swiper-gap-vertical-default));
|
|
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) - 1) * var(--swiper-gap)) / var(--swiper-columns)
|
|
87
|
+
(100% - (var(--swiper-columns, var(--swiper-columns-default)) - 1) * var(--swiper-gap, var(--swiper-gap-default))) / var(--swiper-columns, var(--swiper-columns-default))
|
|
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, var(--swiper-gap-default));
|
|
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, var(--swiper-snap-default));
|
|
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: center; }
|
|
121
|
-
:scope[snap="end"] { --swiper-snap: end; }
|
|
120
|
+
:scope[snap="center"] { --swiper-snap-default: center; }
|
|
121
|
+
:scope[snap="end"] { --swiper-snap-default: 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, var(--swiper-peek-default));
|
|
127
|
+
scroll-padding-inline: var(--swiper-peek, var(--swiper-peek-default));
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/* ── Explicit slides-per-view ── */
|
|
131
131
|
|
|
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; }
|
|
132
|
+
:scope[slides-per-view="1"] { --swiper-columns-default: 1; }
|
|
133
|
+
:scope[slides-per-view="2"] { --swiper-columns-default: 2; }
|
|
134
|
+
:scope[slides-per-view="3"] { --swiper-columns-default: 3; }
|
|
135
|
+
:scope[slides-per-view="4"] { --swiper-columns-default: 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: 1;
|
|
144
|
+
--swiper-columns-default: 1;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
@container swiper (min-width: 640px) {
|
|
148
|
-
:scope:not([slides-per-view]) > [data-swiper-track] { --swiper-columns: 2; }
|
|
148
|
+
:scope:not([slides-per-view]) > [data-swiper-track] { --swiper-columns-default: 2; }
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
@container swiper (min-width: 960px) {
|
|
152
|
-
:scope:not([slides-per-view]) > [data-swiper-track] { --swiper-columns: 3; }
|
|
152
|
+
:scope:not([slides-per-view]) > [data-swiper-track] { --swiper-columns-default: 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, var(--swiper-btn-bottom-default));
|
|
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, var(--swiper-btn-size-default));
|
|
170
|
+
--button-radius: var(--swiper-btn-radius, var(--swiper-btn-radius-default));
|
|
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, var(--swiper-btn-offset-default)); }
|
|
174
|
+
:scope > [data-swiper-next] { right: var(--swiper-btn-offset, var(--swiper-btn-offset-default)); }
|
|
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, var(--swiper-dot-gap-default));
|
|
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, var(--swiper-dot-size-default));
|
|
196
|
+
height: var(--swiper-dot-size, var(--swiper-dot-size-default));
|
|
197
|
+
border-radius: var(--swiper-dot-radius, var(--swiper-dot-radius-default));
|
|
198
|
+
background: var(--swiper-dot-bg, var(--swiper-dot-bg-default));
|
|
199
199
|
border: none;
|
|
200
|
-
padding: calc((1rem - var(--swiper-dot-size)) / 2);
|
|
200
|
+
padding: calc((1rem - var(--swiper-dot-size, var(--swiper-dot-size-default))) / 2);
|
|
201
201
|
background-clip: content-box;
|
|
202
202
|
box-sizing: content-box;
|
|
203
203
|
cursor: pointer;
|
|
204
|
-
transition: background var(--swiper-duration) var(--swiper-easing);
|
|
204
|
+
transition: background var(--swiper-duration, var(--swiper-duration-default)) var(--swiper-easing, var(--swiper-easing-default));
|
|
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, var(--swiper-dot-bg-active-default));
|
|
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)) / 2);
|
|
223
|
+
background-color: var(--swiper-dot-bg-active, var(--swiper-dot-bg-active-default));
|
|
224
|
+
width: var(--swiper-dot-size-active, var(--swiper-dot-size-active-default));
|
|
225
|
+
height: var(--swiper-dot-size-active, var(--swiper-dot-size-active-default));
|
|
226
|
+
padding: calc((1rem - var(--swiper-dot-size-active, var(--swiper-dot-size-active-default))) / 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, var(--swiper-pause-top-default));
|
|
275
|
+
right: var(--swiper-pause-right, var(--swiper-pause-right-default));
|
|
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: var(--switch-track-bg-hover);
|
|
6
|
-
--switch-track-border: var(--switch-track-border-hover);
|
|
5
|
+
--switch-track-bg-default: var(--switch-track-bg-hover, var(--switch-track-bg-hover-default));
|
|
6
|
+
--switch-track-border-default: var(--switch-track-border-hover, var(--switch-track-border-hover-default));
|
|
7
7
|
}
|
|
8
8
|
switch-ui[checked]:not([disabled]):hover {
|
|
9
|
-
--switch-track-bg: var(--switch-track-bg-checked-hover);
|
|
10
|
-
--switch-track-border: var(--switch-track-border-checked-hover);
|
|
9
|
+
--switch-track-bg-default: var(--switch-track-bg-checked-hover, var(--switch-track-bg-checked-hover-default));
|
|
10
|
+
--switch-track-border-default: var(--switch-track-border-checked-hover, var(--switch-track-border-checked-hover-default));
|
|
11
11
|
}
|
|
12
12
|
switch-ui[checked] {
|
|
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);
|
|
13
|
+
--switch-track-bg-default: var(--switch-track-bg-checked, var(--switch-track-bg-checked-default));
|
|
14
|
+
--switch-track-border-default: var(--switch-track-border-checked, var(--switch-track-border-checked-default));
|
|
15
|
+
--switch-thumb-bg-default: var(--switch-thumb-bg-checked, var(--switch-thumb-bg-checked-default));
|
|
16
16
|
}
|
|
17
17
|
switch-ui[checked] [slot="thumb"] {
|
|
18
|
-
transform: translateX(var(--switch-thumb-travel));
|
|
18
|
+
transform: translateX(var(--switch-thumb-travel, var(--switch-thumb-travel-default)));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
@scope (switch-ui) {
|
|
22
22
|
:where(:scope) {
|
|
23
23
|
/* ── Layout ── */
|
|
24
|
-
--switch-gap: var(--a-space-2);
|
|
25
|
-
--switch-radius: var(--a-radius-full);
|
|
24
|
+
--switch-gap-default: var(--a-space-2);
|
|
25
|
+
--switch-radius-default: var(--a-radius-full);
|
|
26
26
|
|
|
27
27
|
/* ── Typography ── */
|
|
28
|
-
--switch-font-size: var(--a-ui-size);
|
|
28
|
+
--switch-font-size-default: var(--a-ui-size);
|
|
29
29
|
|
|
30
30
|
/* ── Colors ── */
|
|
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);
|
|
31
|
+
--switch-track-bg-hover-default: var(--a-bg-muted);
|
|
32
|
+
--switch-track-bg-checked-hover-default: var(--a-primary-hover);
|
|
33
|
+
--switch-track-border-checked-hover-default: var(--a-primary-hover);
|
|
34
|
+
--switch-thumb-shadow-default: var(--a-shadow-sm);
|
|
35
35
|
|
|
36
36
|
/* ── Transition ── */
|
|
37
|
-
--switch-duration: var(--a-duration-fast);
|
|
38
|
-
--switch-easing: var(--a-easing);
|
|
37
|
+
--switch-duration-default: var(--a-duration-fast);
|
|
38
|
+
--switch-easing-default: var(--a-easing);
|
|
39
39
|
|
|
40
40
|
/* ── Focus ── */
|
|
41
|
-
--switch-focus-ring: var(--a-focus-ring);
|
|
41
|
+
--switch-focus-ring-default: var(--a-focus-ring);
|
|
42
42
|
|
|
43
43
|
/* ── Track ── (sizes scale with universal [size] attribute via --a-toggle-size) */
|
|
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);
|
|
44
|
+
--switch-track-height-default: var(--a-toggle-size);
|
|
45
|
+
--switch-track-width-default: calc(var(--a-toggle-size) * 1.8);
|
|
46
|
+
--switch-track-bg-default: var(--a-ui-bg);
|
|
47
|
+
--switch-track-border-default: var(--a-ui-border);
|
|
48
|
+
--switch-track-border-hover-default: var(--a-fg-subtle);
|
|
49
49
|
|
|
50
50
|
/* ── Track: checked ── */
|
|
51
|
-
--switch-track-bg-checked: var(--a-primary);
|
|
52
|
-
--switch-track-border-checked: var(--a-primary);
|
|
51
|
+
--switch-track-bg-checked-default: var(--a-primary);
|
|
52
|
+
--switch-track-border-checked-default: var(--a-primary);
|
|
53
53
|
|
|
54
54
|
/* ── Thumb ── (derived from track; inset accounts for border + visual gap) */
|
|
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);
|
|
55
|
+
--switch-thumb-inset-default: 2px;
|
|
56
|
+
--switch-thumb-size-default: calc(var(--a-toggle-size) - 2 * var(--switch-thumb-inset, var(--switch-thumb-inset-default)) - 2px); /* -2px for 1px border each side */
|
|
57
|
+
--switch-thumb-bg-default: var(--a-fg-muted);
|
|
58
|
+
--switch-thumb-bg-checked-default: var(--a-chrome-light);
|
|
59
|
+
--switch-thumb-travel-default: calc(var(--switch-track-width, var(--switch-track-width-default)) - var(--switch-thumb-size, var(--switch-thumb-size-default)) - 2 * var(--switch-thumb-inset, var(--switch-thumb-inset-default)) - 2px);
|
|
60
60
|
|
|
61
61
|
/* ── State: disabled ── */
|
|
62
|
-
--switch-fg-disabled: var(--a-ui-text-disabled);
|
|
62
|
+
--switch-fg-disabled-default: 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, var(--switch-gap-default));
|
|
72
72
|
cursor: pointer;
|
|
73
73
|
user-select: none;
|
|
74
|
-
font-size: var(--switch-font-size);
|
|
74
|
+
font-size: var(--switch-font-size, var(--switch-font-size-default));
|
|
75
75
|
}
|
|
76
|
-
:scope[disabled] { cursor: not-allowed; color: var(--switch-fg-disabled); }
|
|
76
|
+
:scope[disabled] { cursor: not-allowed; color: var(--switch-fg-disabled, var(--switch-fg-disabled-default)); }
|
|
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, var(--switch-track-width-default));
|
|
81
|
+
height: var(--switch-track-height, var(--switch-track-height-default));
|
|
82
|
+
border-radius: var(--switch-radius, var(--switch-radius-default));
|
|
83
|
+
background: var(--switch-track-bg, var(--switch-track-bg-default));
|
|
84
|
+
border: 1px solid var(--switch-track-border, var(--switch-track-border-default));
|
|
85
85
|
flex-shrink: 0;
|
|
86
86
|
transition:
|
|
87
|
-
background var(--switch-duration) var(--switch-easing),
|
|
88
|
-
border-color var(--switch-duration) var(--switch-easing);
|
|
87
|
+
background var(--switch-duration, var(--switch-duration-default)) var(--switch-easing, var(--switch-easing-default)),
|
|
88
|
+
border-color var(--switch-duration, var(--switch-duration-default)) var(--switch-easing, var(--switch-easing-default));
|
|
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, var(--switch-thumb-inset-default));
|
|
95
|
+
left: var(--switch-thumb-inset, var(--switch-thumb-inset-default));
|
|
96
|
+
width: var(--switch-thumb-size, var(--switch-thumb-size-default));
|
|
97
|
+
height: var(--switch-thumb-size, var(--switch-thumb-size-default));
|
|
98
|
+
border-radius: var(--switch-radius, var(--switch-radius-default));
|
|
99
|
+
background: var(--switch-thumb-bg, var(--switch-thumb-bg-default));
|
|
100
|
+
box-shadow: var(--switch-thumb-shadow, var(--switch-thumb-shadow-default));
|
|
101
101
|
transition:
|
|
102
|
-
transform var(--switch-duration) var(--switch-easing),
|
|
103
|
-
background var(--switch-duration) var(--switch-easing);
|
|
102
|
+
transform var(--switch-duration, var(--switch-duration-default)) var(--switch-easing, var(--switch-easing-default)),
|
|
103
|
+
background var(--switch-duration, var(--switch-duration-default)) var(--switch-easing, var(--switch-easing-default));
|
|
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, var(--switch-font-size-default)); }
|
|
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. */
|
|
@@ -117,7 +117,7 @@ switch-ui[checked] [slot="thumb"] {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
:scope:focus-visible { outline: none; }
|
|
120
|
-
:scope:focus-visible [slot="track"] { box-shadow: var(--switch-focus-ring); }
|
|
120
|
+
:scope:focus-visible [slot="track"] { box-shadow: var(--switch-focus-ring, var(--switch-focus-ring-default)); }
|
|
121
121
|
|
|
122
122
|
/* Size handled by universal [size] attribute system. */
|
|
123
123
|
}
|