@signal9/era-ui 2.35.2 → 2.35.3
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/ui/cycle/cycle.svelte +23 -19
- package/package.json +1 -1
|
@@ -120,27 +120,31 @@
|
|
|
120
120
|
bind:ref
|
|
121
121
|
aria-label={label ? `${label}: ${current?.label}` : current?.label}
|
|
122
122
|
data-value={value}
|
|
123
|
-
class={
|
|
123
|
+
class={className}
|
|
124
124
|
onclick={click}
|
|
125
125
|
onkeydown={keydown}
|
|
126
126
|
{...restProps}
|
|
127
127
|
>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
{:
|
|
139
|
-
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
128
|
+
<!--
|
|
129
|
+
The stack owns its OWN grid, rather than making the Button the grid: the
|
|
130
|
+
Button wraps its content in a flex layer (for the surface press treatment),
|
|
131
|
+
so faces handed straight to it would lay out in a ROW, not a stack. All faces
|
|
132
|
+
occupy ONE cell of THIS grid, so it sizes to the widest of them and the button
|
|
133
|
+
never resizes as you cycle. (`absolute` would collapse the box to nothing.)
|
|
134
|
+
-->
|
|
135
|
+
<span class="grid place-items-center">
|
|
136
|
+
{#each options as option (option.value)}
|
|
137
|
+
{@const isCurrent = option.value === current?.value}
|
|
138
|
+
<span aria-hidden={!isCurrent} class={cn(faceBase, isCurrent ? faceIn : faceOut)}>
|
|
139
|
+
{#if children}
|
|
140
|
+
{@render children(option)}
|
|
141
|
+
{:else if option.icon}
|
|
142
|
+
{@const Icon = option.icon}
|
|
143
|
+
<Icon class="size-(--era-h-xs) shrink-0" />
|
|
144
|
+
{:else}
|
|
145
|
+
{option.label}
|
|
146
|
+
{/if}
|
|
147
|
+
</span>
|
|
148
|
+
{/each}
|
|
149
|
+
</span>
|
|
146
150
|
</Button>
|