@motion-proto/live-tokens 0.16.1 → 0.16.2
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
CHANGED
|
@@ -37,13 +37,25 @@
|
|
|
37
37
|
|
|
38
38
|
<section class="es-root variant-{variant} {className}">
|
|
39
39
|
{#if href}
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
<!-- Linked header: the chevron is a standalone toggle button so the
|
|
41
|
+
section can still be collapsed even when the label is a link. Both
|
|
42
|
+
live inside the same `.section-header` flex row so paint (hover,
|
|
43
|
+
background, indicator) continues to land on the row as a whole. -->
|
|
44
|
+
<div class="section-header section-header--linked" class:expanded>
|
|
45
|
+
<button
|
|
46
|
+
type="button"
|
|
47
|
+
class="section-toggle-button"
|
|
48
|
+
onclick={fireToggle}
|
|
49
|
+
aria-label={expanded ? 'Collapse section' : 'Expand section'}
|
|
50
|
+
aria-expanded={expanded}
|
|
51
|
+
>
|
|
42
52
|
<i class="fas fa-chevron-right toggle-icon"></i>
|
|
53
|
+
</button>
|
|
54
|
+
<a {href} class="section-link">
|
|
43
55
|
<span class="section-label">{label}</span>
|
|
44
|
-
</
|
|
56
|
+
</a>
|
|
45
57
|
{@render summary?.()}
|
|
46
|
-
</
|
|
58
|
+
</div>
|
|
47
59
|
{:else}
|
|
48
60
|
<!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_noninteractive_element_interactions, a11y_no_static_element_interactions -->
|
|
49
61
|
<div class="section-header" class:expanded onclick={fireToggle}>
|
|
@@ -170,6 +182,37 @@
|
|
|
170
182
|
flex-shrink: 0;
|
|
171
183
|
}
|
|
172
184
|
|
|
185
|
+
/* Linked header: chevron is a sibling button next to the label link, not a
|
|
186
|
+
child of an enveloping <a>. Use the tighter gap that the inner
|
|
187
|
+
`.section-toggle` wrapper provides in the no-href branch, so both
|
|
188
|
+
layouts read the same visually. */
|
|
189
|
+
.section-header.section-header--linked {
|
|
190
|
+
gap: var(--space-8);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.section-toggle-button {
|
|
194
|
+
display: inline-flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
justify-content: center;
|
|
197
|
+
flex-shrink: 0;
|
|
198
|
+
background: transparent;
|
|
199
|
+
border: none;
|
|
200
|
+
padding: 0;
|
|
201
|
+
margin: 0;
|
|
202
|
+
color: inherit;
|
|
203
|
+
font: inherit;
|
|
204
|
+
cursor: pointer;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.section-link {
|
|
208
|
+
display: inline-flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
min-width: 0;
|
|
211
|
+
color: inherit;
|
|
212
|
+
text-decoration: none;
|
|
213
|
+
flex: 1 1 auto;
|
|
214
|
+
}
|
|
215
|
+
|
|
173
216
|
@mixin header-paint($variant, $state) {
|
|
174
217
|
background: var(--collapsiblesection-#{$variant}-#{$state}-surface);
|
|
175
218
|
@include themed-padding(--collapsiblesection-#{$variant}-#{$state}-padding, $h: 2);
|