@stacksjs/components 0.2.342 → 0.2.344
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/{Accordion-8tv78bh9.stx → Accordion-ccye7erw.stx} +23 -3
- package/dist/{Audio-y0sgq50z.stx → Audio-tnjd6anm.stx} +7 -7
- package/dist/{Avatar-e43x17z1.stx → Avatar-7vegrsg6.stx} +3 -3
- package/dist/Badge-439n5p0a.stx +74 -0
- package/dist/{Breadcrumb-csf164sd.stx → Breadcrumb-7hwnfyyw.stx} +21 -6
- package/dist/Button-y8fnx29x.stx +193 -0
- package/dist/{Calendar-gjjhhfnt.stx → Calendar-8q76ees6.stx} +6 -6
- package/dist/{Card-7byck6ep.stx → Card-r55zpjqh.stx} +6 -6
- package/dist/{Checkbox-2s2a7n4h.stx → Checkbox-xnm8ax5q.stx} +9 -9
- package/dist/{ComboboxInput-z1293bbh.stx → ComboboxInput-9q87fb22.stx} +2 -2
- package/dist/{ComboboxOption-6yh7xk7q.stx → ComboboxOption-qm38e8e9.stx} +2 -2
- package/dist/{ComboboxOptions-sq5360ae.stx → ComboboxOptions-nbndbrxz.stx} +1 -1
- package/dist/{CommandPalette-fzfv1pme.stx → CommandPalette-mkqqep2s.stx} +4 -4
- package/dist/{DefaultPaymentMethod-6qrem3sg.stx → DefaultPaymentMethod-v11254p4.stx} +8 -8
- package/dist/Dialog-d1020hj6.stx +268 -0
- package/dist/DialogBackdrop-de5m5m4w.stx +12 -0
- package/dist/DialogPanel-vhdqymc2.stx +19 -0
- package/dist/{DialogTitle-x0r6k8x9.stx → DialogTitle-0jjdk5ra.stx} +1 -1
- package/dist/{Drawer-9jx39xef.stx → Drawer-rymajw9v.stx} +86 -21
- package/dist/{DropdownButton-wcz67dxy.stx → DropdownButton-n6gsmcte.stx} +2 -2
- package/dist/{DropdownItem-d8ht2bp5.stx → DropdownItem-qs772agw.stx} +1 -1
- package/dist/{DropdownItems-1sxnd5qn.stx → DropdownItems-yf25hdh1.stx} +1 -1
- package/dist/{EmailInput-vak3kkmk.stx → EmailInput-agb8kqae.stx} +4 -4
- package/dist/{FilterChip-h896vrxm.stx → FilterChip-ww5nkepm.stx} +26 -2
- package/dist/{Image-4ezne2xj.stx → Image-79xyzb5j.stx} +3 -3
- package/dist/{ListRow-v45ymhcn.stx → ListRow-8d3e1yxh.stx} +2 -2
- package/dist/{Listbox-0cyysv0f.stx → Listbox-e5jreb0a.stx} +1 -1
- package/dist/{ListboxButton-keb8gm0q.stx → ListboxButton-w3vfvte7.stx} +2 -2
- package/dist/{RadioGroupLabel-7mymt1b8.stx → ListboxLabel-ka0hfm7b.stx} +1 -1
- package/dist/{ListboxOption-4j070101.stx → ListboxOption-ea0j02a8.stx} +2 -2
- package/dist/{ListboxOptions-ejkatcfg.stx → ListboxOptions-qxrkrb8z.stx} +1 -1
- package/dist/{Login-2cp65d41.stx → Login-hh53d6tw.stx} +14 -14
- package/dist/{NavBar-wcb6f2d3.stx → NavBar-qqrrhdnk.stx} +24 -0
- package/dist/{Navigator-smpa7my4.stx → Navigator-55wpcpx1.stx} +2 -2
- package/dist/{Notification-03vfh3k6.stx → Notification-7wgk0sw6.stx} +6 -6
- package/dist/{NumberInput-j9p5bm5y.stx → NumberInput-54d23rq0.stx} +21 -11
- package/dist/{Pagination-ff7nzp7d.stx → Pagination-0ra20dja.stx} +4 -4
- package/dist/{PasswordInput-4qykq1dz.stx → PasswordInput-3snyppj4.stx} +24 -14
- package/dist/{PaymentMethods-2xy66bwk.stx → PaymentMethods-zwa7c6kh.stx} +10 -10
- package/dist/{PopoverButton-mffzc9pr.stx → PopoverButton-panmcysh.stx} +2 -2
- package/dist/{PopoverPanel-054yh38h.stx → PopoverPanel-7771yf35.stx} +2 -2
- package/dist/{Portal-yghnqdj8.stx → Portal-m73vz879.stx} +1 -1
- package/dist/{Progress-twhhzsd9.stx → Progress-cj0z83rx.stx} +47 -18
- package/dist/{Radio-ccm07b2m.stx → Radio-m2wz5ny6.stx} +8 -8
- package/dist/{RadioGroup-82ytfqdb.stx → RadioGroup-jg9s4ttg.stx} +1 -1
- package/dist/{ListboxLabel-7mymt1b8.stx → RadioGroupLabel-ka0hfm7b.stx} +1 -1
- package/dist/{RadioGroupOption-7pq7rw84.stx → RadioGroupOption-zvp0y9sn.stx} +2 -2
- package/dist/{SearchInput-pdx7agn0.stx → SearchInput-psbjk2ye.stx} +3 -3
- package/dist/{SectionCard-r73hvvbc.stx → SectionCard-8ctdacjr.stx} +28 -1
- package/dist/{Select-zt72gg1e.stx → Select-pj584jza.stx} +19 -9
- package/dist/{Sidebar-f1tff5p3.stx → Sidebar-ve2asgf3.stx} +6 -6
- package/dist/{SidebarHeader-3dppxxjh.stx → SidebarHeader-esvby82n.stx} +3 -3
- package/dist/{SidebarItem-5v8atp7p.stx → SidebarItem-r4f2pref.stx} +4 -4
- package/dist/{SidebarSection-sqz49ary.stx → SidebarSection-5sqza2j6.stx} +2 -2
- package/dist/{SidebarSpace-nmbvgrky.stx → SidebarSpace-bwv98azf.stx} +3 -3
- package/dist/{SidebarSpaceSwitcher-v5e472j0.stx → SidebarSpaceSwitcher-1mycft2g.stx} +1 -1
- package/dist/{SidebarSpaces-6v3p9htw.stx → SidebarSpaces-mdtrynr2.stx} +2 -2
- package/dist/{Signup-cbncrtvd.stx → Signup-egdrk3rh.stx} +11 -11
- package/dist/{Skeleton-y9tycz2h.stx → Skeleton-me2hwqrc.stx} +4 -4
- package/dist/{Spinner-reb6rse4.stx → Spinner-grahbp9a.stx} +9 -9
- package/dist/{StepperStep-3ahq4d9m.stx → StepperStep-xw55xjh0.stx} +9 -4
- package/dist/{SubscriptionCheckout-7fdkwf04.stx → SubscriptionCheckout-wj4s182k.stx} +13 -13
- package/dist/{Switch-cgy7hy0s.stx → Switch-fxbw7s16.stx} +7 -4
- package/dist/{TabBarItem-hd2r2ayy.stx → TabBarItem-cnxhgy92.stx} +25 -1
- package/dist/{Table-0mc3fdek.stx → Table-akbk3t5q.stx} +1 -1
- package/dist/{TableHeader-sxc77b4d.stx → TableHeader-qsc3e208.stx} +1 -1
- package/dist/{Tabs-b4xsba1w.stx → Tabs-2cjt68my.stx} +28 -8
- package/dist/{Teleport-3gnjtsjf.stx → Teleport-c8nn3757.stx} +2 -2
- package/dist/{TextInput-hbe2ynzj.stx → TextInput-9wqzeeg1.stx} +23 -13
- package/dist/{Textarea-xcdym703.stx → Textarea-xwkdg8se.stx} +11 -11
- package/dist/{Tooltip-y0kzkwh4.stx → Tooltip-14gt4f1w.stx} +9 -6
- package/dist/{Transition-7smenaz8.stx → Transition-yrvqbhjy.stx} +1 -1
- package/dist/{TwoFactorChallenge-y7n4yrk9.stx → TwoFactorChallenge-0200pjc0.stx} +5 -5
- package/dist/{Video-a0aeyexv.stx → Video-rhy7dskw.stx} +6 -6
- package/dist/{VirtualTable-jvm1784g.stx → VirtualTable-jvje0ybn.stx} +4 -4
- package/dist/composables/index.js +2 -2
- package/dist/index.js +13 -13
- package/dist/utils/highlighter.d.ts +1 -0
- package/dist/utils/highlighter.js +1 -1
- package/package.json +3 -3
- package/src/components/CodeBlock.stx +7 -1
- package/src/components/Footer.stx +1 -1
- package/src/components/Hero.stx +2 -2
- package/src/components/Installation.stx +4 -4
- package/src/ui/accordion/Accordion.stx +23 -3
- package/src/ui/audio/Audio.stx +7 -7
- package/src/ui/auth/Login.stx +14 -14
- package/src/ui/auth/Signup.stx +11 -11
- package/src/ui/auth/TwoFactorChallenge.stx +5 -5
- package/src/ui/avatar/Avatar.stx +3 -3
- package/src/ui/badge/Badge.stx +31 -19
- package/src/ui/breadcrumb/Breadcrumb.stx +21 -6
- package/src/ui/button/Button.stx +148 -29
- package/src/ui/calendar/Calendar.stx +6 -6
- package/src/ui/card/Card.stx +6 -6
- package/src/ui/checkbox/Checkbox.stx +9 -9
- package/src/ui/combobox/ComboboxInput.stx +2 -2
- package/src/ui/combobox/ComboboxOption.stx +2 -2
- package/src/ui/combobox/ComboboxOptions.stx +1 -1
- package/src/ui/command-palette/CommandPalette.stx +4 -4
- package/src/ui/dialog/Dialog.stx +231 -4
- package/src/ui/dialog/DialogBackdrop.stx +5 -2
- package/src/ui/dialog/DialogPanel.stx +5 -2
- package/src/ui/dialog/DialogTitle.stx +1 -1
- package/src/ui/dialog/README.md +15 -4
- package/src/ui/drawer/Drawer.stx +86 -21
- package/src/ui/dropdown/DropdownButton.stx +2 -2
- package/src/ui/dropdown/DropdownItem.stx +1 -1
- package/src/ui/dropdown/DropdownItems.stx +1 -1
- package/src/ui/heatmap/Heatmap.stx +1 -1
- package/src/ui/image/Image.stx +3 -3
- package/src/ui/input/EmailInput.stx +4 -4
- package/src/ui/input/NumberInput.stx +21 -11
- package/src/ui/input/PasswordInput.stx +24 -14
- package/src/ui/input/SearchInput.stx +3 -3
- package/src/ui/input/TextInput.stx +23 -13
- package/src/ui/listbox/Listbox.stx +1 -1
- package/src/ui/listbox/ListboxButton.stx +2 -2
- package/src/ui/listbox/ListboxLabel.stx +1 -1
- package/src/ui/listbox/ListboxOption.stx +2 -2
- package/src/ui/listbox/ListboxOptions.stx +1 -1
- package/src/ui/mobile/FilterChip.stx +26 -2
- package/src/ui/mobile/ListRow.stx +2 -2
- package/src/ui/mobile/NavBar.stx +24 -0
- package/src/ui/mobile/SectionCard.stx +28 -1
- package/src/ui/mobile/TabBarItem.stx +25 -1
- package/src/ui/navigator/Navigator.stx +2 -2
- package/src/ui/notification/Notification.stx +6 -6
- package/src/ui/pagination/Pagination.stx +4 -4
- package/src/ui/payment/DefaultPaymentMethod.stx +8 -8
- package/src/ui/payment/PaymentMethods.stx +10 -10
- package/src/ui/payment/SubscriptionCheckout.stx +13 -13
- package/src/ui/popover/PopoverButton.stx +2 -2
- package/src/ui/popover/PopoverPanel.stx +2 -2
- package/src/ui/portal/Portal.stx +1 -1
- package/src/ui/progress/Progress.stx +47 -18
- package/src/ui/radio/Radio.stx +8 -8
- package/src/ui/radio-group/RadioGroup.stx +1 -1
- package/src/ui/radio-group/RadioGroupLabel.stx +1 -1
- package/src/ui/radio-group/RadioGroupOption.stx +2 -2
- package/src/ui/select/Select.stx +19 -9
- package/src/ui/sidebar/Sidebar.stx +6 -6
- package/src/ui/sidebar/SidebarHeader.stx +3 -3
- package/src/ui/sidebar/SidebarItem.stx +4 -4
- package/src/ui/sidebar/SidebarSection.stx +2 -2
- package/src/ui/sidebar/SidebarSpace.stx +3 -3
- package/src/ui/sidebar/SidebarSpaceSwitcher.stx +1 -1
- package/src/ui/sidebar/SidebarSpaces.stx +2 -2
- package/src/ui/skeleton/Skeleton.stx +4 -4
- package/src/ui/spinner/Spinner.stx +9 -9
- package/src/ui/stepper/StepperStep.stx +9 -4
- package/src/ui/switch/Switch.stx +7 -4
- package/src/ui/table/Table.stx +1 -1
- package/src/ui/table/TableHeader.stx +1 -1
- package/src/ui/tabs/Tabs.stx +28 -8
- package/src/ui/teleport/Teleport.stx +2 -2
- package/src/ui/textarea/Textarea.stx +11 -11
- package/src/ui/tooltip/Tooltip.stx +9 -6
- package/src/ui/transition/Transition.stx +1 -1
- package/src/ui/video/Video.stx +6 -6
- package/src/ui/virtual-table/VirtualTable.stx +4 -4
- package/src/utils/highlighter.ts +65 -4
- package/dist/Badge-xwjeq24d.stx +0 -62
- package/dist/Button-h2mk4wfw.stx +0 -74
- package/dist/Dialog-y5rz2vrq.stx +0 -41
- package/dist/DialogBackdrop-rxax3sec.stx +0 -9
- package/dist/DialogPanel-44d8jeqy.stx +0 -16
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export const products = $props.products || []
|
|
3
3
|
export const stripePublicKey = $props.stripePublicKey || ''
|
|
4
4
|
export const apiUrl = $props.apiUrl || ''
|
|
5
|
-
export const showRemoveProduct = $props.showRemoveProduct
|
|
5
|
+
export const showRemoveProduct = $bool($props.showRemoveProduct, true)
|
|
6
6
|
export const shipping = $props.shipping || 0
|
|
7
7
|
export const taxes = $props.taxes || 0
|
|
8
8
|
export const className = $props.className || ''
|
|
@@ -10,7 +10,7 @@ export const className = $props.className || ''
|
|
|
10
10
|
export const subtotal = products.reduce((sum, product) => sum + (product.price * (product.quantity || 1)), 0)
|
|
11
11
|
export const total = subtotal + shipping + taxes
|
|
12
12
|
|
|
13
|
-
export const containerClasses = `bg-
|
|
13
|
+
export const containerClasses = `bg-neutral-50 dark:bg-neutral-900 ${className}`.trim()
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<script client>
|
|
@@ -130,7 +130,7 @@ onMount(() => initializeStripe())
|
|
|
130
130
|
name="email-address"
|
|
131
131
|
autocomplete="email"
|
|
132
132
|
required
|
|
133
|
-
class="block w-full border border-line-strong rounded-
|
|
133
|
+
class="block w-full border border-line-strong rounded-control p-2 shadow-sm bg-field text-fg focus:border-indigo-500 dark:focus:border-indigo-400 sm:text-sm focus:ring-indigo-500 dark:focus:ring-indigo-400"
|
|
134
134
|
/>
|
|
135
135
|
</div>
|
|
136
136
|
</div>
|
|
@@ -154,14 +154,14 @@ onMount(() => initializeStripe())
|
|
|
154
154
|
name="card-name"
|
|
155
155
|
autocomplete="cc-name"
|
|
156
156
|
required
|
|
157
|
-
class="block w-full border border-line-strong rounded-
|
|
157
|
+
class="block w-full border border-line-strong rounded-control p-2 shadow-sm bg-field text-fg focus:border-indigo-500 sm:text-sm focus:ring-indigo-500"
|
|
158
158
|
/>
|
|
159
159
|
</div>
|
|
160
160
|
</div>
|
|
161
161
|
|
|
162
162
|
<!-- Stripe Element Mount Point -->
|
|
163
163
|
<div class="sm:col-span-2">
|
|
164
|
-
<div id="payment-element" class="mt-2 border border-line-strong rounded-
|
|
164
|
+
<div id="payment-element" class="mt-2 border border-line-strong rounded-control bg-field p-3"></div>
|
|
165
165
|
</div>
|
|
166
166
|
</div>
|
|
167
167
|
</div>
|
|
@@ -198,7 +198,7 @@ onMount(() => initializeStripe())
|
|
|
198
198
|
Order summary
|
|
199
199
|
</h2>
|
|
200
200
|
|
|
201
|
-
<div class="mt-4 border border-line rounded-
|
|
201
|
+
<div class="mt-4 border border-line rounded-panel bg-panel shadow-sm">
|
|
202
202
|
<h3 class="sr-only">Items in your cart</h3>
|
|
203
203
|
|
|
204
204
|
<!-- Product List -->
|
|
@@ -207,10 +207,10 @@ onMount(() => initializeStripe())
|
|
|
207
207
|
<li class="flex px-4 py-6 sm:px-6">
|
|
208
208
|
<div class="flex-shrink-0">
|
|
209
209
|
@if(product.images)
|
|
210
|
-
<img src="{{ product.images }}" alt="{{ product.name }}" class="w-20 rounded-
|
|
210
|
+
<img src="{{ product.images }}" alt="{{ product.name }}" class="w-20 rounded-control" />
|
|
211
211
|
@else
|
|
212
|
-
<div class="w-20 h-20 bg-surface-sunken rounded-
|
|
213
|
-
<svg class="h-8 w-8 text-
|
|
212
|
+
<div class="w-20 h-20 bg-surface-sunken rounded-control flex items-center justify-center">
|
|
213
|
+
<svg class="h-8 w-8 text-neutral-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
214
214
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
|
|
215
215
|
</svg>
|
|
216
216
|
</div>
|
|
@@ -222,7 +222,7 @@ onMount(() => initializeStripe())
|
|
|
222
222
|
<div class="min-w-0 flex-1">
|
|
223
223
|
<h4 class="text-sm">
|
|
224
224
|
@if(product.href)
|
|
225
|
-
<StxLink to="{{ product.href }}" class="text-fg-strong font-medium hover:text-
|
|
225
|
+
<StxLink to="{{ product.href }}" class="text-fg-strong font-medium hover:text-neutral-800 dark:hover:text-neutral-200">
|
|
226
226
|
{{ product.name }}
|
|
227
227
|
</StxLink>
|
|
228
228
|
@else
|
|
@@ -237,7 +237,7 @@ onMount(() => initializeStripe())
|
|
|
237
237
|
<div class="ml-4 flow-root flex-shrink-0">
|
|
238
238
|
<button
|
|
239
239
|
type="button"
|
|
240
|
-
class="flex items-center justify-center bg-
|
|
240
|
+
class="flex items-center justify-center bg-field p-2.5 text-fg-subtle -m-2.5 hover:text-fg-soft"
|
|
241
241
|
@click="onRemoveProduct('{{ product.id }}')"
|
|
242
242
|
title="Remove"
|
|
243
243
|
>
|
|
@@ -260,7 +260,7 @@ onMount(() => initializeStripe())
|
|
|
260
260
|
<select
|
|
261
261
|
id="quantity-{{ product.id }}"
|
|
262
262
|
name="quantity"
|
|
263
|
-
class="border border-line-strong rounded-
|
|
263
|
+
class="border border-line-strong rounded-control text-left text-base text-fg-strong font-medium shadow-sm bg-field focus:border-indigo-500 sm:text-sm focus:outline-none focus:ring-1 focus:ring-indigo-500"
|
|
264
264
|
>
|
|
265
265
|
<option value="1" {{ (product.quantity || 1) === 1 ? 'selected' : '' }}>1</option>
|
|
266
266
|
<option value="2" {{ (product.quantity || 1) === 2 ? 'selected' : '' }}>2</option>
|
|
@@ -317,7 +317,7 @@ onMount(() => initializeStripe())
|
|
|
317
317
|
<div class="border-t border-line px-4 py-6 sm:px-6">
|
|
318
318
|
<button
|
|
319
319
|
type="submit"
|
|
320
|
-
class="w-full border border-transparent rounded-
|
|
320
|
+
class="w-full border border-transparent rounded-control bg-accent-solid px-4 py-3 text-base text-white font-medium shadow-sm hover:bg-indigo-700 dark:hover:bg-indigo-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 focus:ring-offset-gray-50 dark:focus:ring-offset-gray-900"
|
|
321
321
|
>
|
|
322
322
|
Confirm order
|
|
323
323
|
</button>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script server>
|
|
2
2
|
export const className = $props.className || ''
|
|
3
3
|
export const as = $props.as || 'button'
|
|
4
|
-
export const disabled = $props.disabled
|
|
4
|
+
export const disabled = $bool($props.disabled)
|
|
5
5
|
|
|
6
|
-
const baseClasses = 'inline-flex items-center gap-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-white
|
|
6
|
+
const baseClasses = 'inline-flex items-center gap-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75'
|
|
7
7
|
export const buttonClasses = `${baseClasses} ${className}`.trim()
|
|
8
8
|
</script>
|
|
9
9
|
|
|
@@ -10,8 +10,8 @@ const positionClasses = {
|
|
|
10
10
|
right: 'left-full ml-2',
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const baseClasses = 'absolute z-10 rounded-
|
|
14
|
-
export const panelClasses = `${baseClasses} ${positionClasses[position]} ${className}`.trim()
|
|
13
|
+
const baseClasses = 'absolute z-10 rounded-panel bg-panel p-4 shadow-lg ring-1 ring-black/5 focus:outline-none'
|
|
14
|
+
export const panelClasses = `${baseClasses} ${positionClasses[position] || positionClasses.bottom} ${className}`.trim()
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<component
|
package/src/ui/portal/Portal.stx
CHANGED
|
@@ -4,17 +4,17 @@ export const max = $props.max || 100
|
|
|
4
4
|
export const variant = $props.variant || 'linear'
|
|
5
5
|
export const size = $props.size || 'md'
|
|
6
6
|
export const color = $props.color || 'primary'
|
|
7
|
-
export const showLabel = $props.showLabel
|
|
8
|
-
export const indeterminate = $props.indeterminate
|
|
7
|
+
export const showLabel = $bool($props.showLabel)
|
|
8
|
+
export const indeterminate = $bool($props.indeterminate)
|
|
9
9
|
export const className = $props.className || ''
|
|
10
10
|
|
|
11
11
|
const linearSizeClasses = { sm: 'h-1', md: 'h-2', lg: 'h-3' }
|
|
12
12
|
const circularSizeClasses = { sm: 'w-12 h-12', md: 'w-16 h-16', lg: 'w-24 h-24' }
|
|
13
13
|
const colorClasses = {
|
|
14
|
-
primary: 'bg-
|
|
15
|
-
secondary: 'bg-
|
|
14
|
+
primary: 'bg-accent-solid',
|
|
15
|
+
secondary: 'bg-secondary-solid',
|
|
16
16
|
success: 'bg-success-solid',
|
|
17
|
-
warning: 'bg-
|
|
17
|
+
warning: 'bg-warning-solid',
|
|
18
18
|
danger: 'bg-danger-solid',
|
|
19
19
|
info: 'bg-cyan-600 dark:bg-cyan-500',
|
|
20
20
|
}
|
|
@@ -28,30 +28,56 @@ export const containerClasses = variant === 'linear'
|
|
|
28
28
|
? `w-full ${className}`.trim()
|
|
29
29
|
: `inline-flex items-center justify-center ${className}`.trim()
|
|
30
30
|
|
|
31
|
-
export const linearTrackClasses = `w-full ${linearSizeClasses[size]} bg-surface-sunken rounded-full overflow-hidden`.trim()
|
|
32
|
-
export const linearBarClasses = `h-full ${colorClasses[color]} transition-all duration-300 ease-in-out ${indeterminate ? 'animate-progress-indeterminate' : ''}`.trim()
|
|
33
|
-
export const circularSizeClass = circularSizeClasses[size]
|
|
31
|
+
export const linearTrackClasses = `w-full ${linearSizeClasses[size] || linearSizeClasses.md} bg-surface-sunken rounded-full overflow-hidden`.trim()
|
|
32
|
+
export const linearBarClasses = `h-full ${colorClasses[color] || colorClasses.primary} transition-all duration-300 ease-in-out ${indeterminate ? 'animate-progress-indeterminate' : ''}`.trim()
|
|
33
|
+
export const circularSizeClass = circularSizeClasses[size] || circularSizeClasses.md
|
|
34
34
|
export const labelClasses = `text-sm font-medium text-fg-strong mb-2`.trim()
|
|
35
|
-
export const circularTrackColor = 'stroke-
|
|
36
|
-
export const circularBarColor = color === 'primary' ? 'stroke-
|
|
37
|
-
: color === 'secondary' ? 'stroke-
|
|
35
|
+
export const circularTrackColor = 'stroke-line'
|
|
36
|
+
export const circularBarColor = color === 'primary' ? 'stroke-accent'
|
|
37
|
+
: color === 'secondary' ? 'stroke-secondary-solid'
|
|
38
38
|
: color === 'success' ? 'stroke-success'
|
|
39
|
-
: color === 'warning' ? 'stroke-
|
|
39
|
+
: color === 'warning' ? 'stroke-warning-solid'
|
|
40
40
|
: color === 'danger' ? 'stroke-danger'
|
|
41
41
|
: 'stroke-cyan-600 dark:stroke-cyan-500'
|
|
42
42
|
</script>
|
|
43
43
|
|
|
44
44
|
<script client>
|
|
45
|
-
const max = {{ max }}
|
|
46
|
-
const indeterminate = {{ indeterminate }}
|
|
47
45
|
const circumference = {{ circumference }}
|
|
48
|
-
|
|
46
|
+
const circularBarColor = {{ circularBarColor }}
|
|
47
|
+
|
|
48
|
+
/*
|
|
49
|
+
* `value` has been a live prop since #1704. `max` and `indeterminate` were not,
|
|
50
|
+
* and they are bound for the same reasons:
|
|
51
|
+
*
|
|
52
|
+
* :max="total()" the denominator is often unknown until the
|
|
53
|
+
* response that supplies it arrives
|
|
54
|
+
* :indeterminate="!total()" and the bar starts indeterminate precisely
|
|
55
|
+
* BECAUSE the total is not known yet
|
|
56
|
+
*
|
|
57
|
+
* Frozen, those two could only ever describe the state the page was built in,
|
|
58
|
+
* so a bar could never stop spinning once the total showed up. See #1997 for
|
|
59
|
+
* the same freeze on Button.
|
|
60
|
+
*/
|
|
61
|
+
/*
|
|
62
|
+
* The locals are deliberately NOT named `max` / `indeterminate`.
|
|
63
|
+
*
|
|
64
|
+
* A client-script name that matches a server-script export stops the server
|
|
65
|
+
* interpolating that name in the template: the `animate-spin` ternary below
|
|
66
|
+
* rendered as literal text rather than being evaluated. The attribute
|
|
67
|
+
* useReactiveProp watches is its first argument, so the local is free to be
|
|
68
|
+
* called something else — and has to be.
|
|
69
|
+
*/
|
|
49
70
|
const value = useReactiveProp('value', {{ value }})
|
|
71
|
+
const maxValue = useReactiveProp('max', {{ max }})
|
|
72
|
+
const isIndeterminate = useReactiveProp('indeterminate', {{ indeterminate }})
|
|
50
73
|
|
|
51
|
-
const percentage = derived(() => Math.min(Math.max((value() /
|
|
74
|
+
const percentage = derived(() => Math.min(Math.max((value() / maxValue()) * 100, 0), 100))
|
|
52
75
|
const percentLabel = derived(() => `${Math.round(percentage())}%`)
|
|
53
|
-
const linearWidth = derived(() =>
|
|
54
|
-
const dashOffset = derived(() =>
|
|
76
|
+
const linearWidth = derived(() => isIndeterminate() ? '30%' : `${percentage()}%`)
|
|
77
|
+
const dashOffset = derived(() => isIndeterminate() ? 0 : circumference - (percentage() / 100) * circumference)
|
|
78
|
+
// The spin is part of what `indeterminate` MEANS, so it follows the signal
|
|
79
|
+
// rather than the server's snapshot of it.
|
|
80
|
+
const circularBarClass = derived(() => `${circularBarColor} transition-all duration-300 ease-in-out ${isIndeterminate() ? 'animate-spin' : ''}`.trim())
|
|
55
81
|
|
|
56
82
|
defineExpose({ value, setValue: (v) => value.set(v) })
|
|
57
83
|
</script>
|
|
@@ -70,6 +96,7 @@ defineExpose({ value, setValue: (v) => value.set(v) })
|
|
|
70
96
|
:aria-valuenow="value()"
|
|
71
97
|
aria-valuemin="0"
|
|
72
98
|
aria-valuemax="{{ max }}"
|
|
99
|
+
:aria-valuemax="maxValue()"
|
|
73
100
|
>
|
|
74
101
|
<div
|
|
75
102
|
class="{{ linearBarClasses }}"
|
|
@@ -88,6 +115,7 @@ defineExpose({ value, setValue: (v) => value.set(v) })
|
|
|
88
115
|
:aria-valuenow="value()"
|
|
89
116
|
aria-valuemin="0"
|
|
90
117
|
aria-valuemax="{{ max }}"
|
|
118
|
+
:aria-valuemax="maxValue()"
|
|
91
119
|
>
|
|
92
120
|
<circle
|
|
93
121
|
class="{{ circularTrackColor }}"
|
|
@@ -99,6 +127,7 @@ defineExpose({ value, setValue: (v) => value.set(v) })
|
|
|
99
127
|
/>
|
|
100
128
|
<circle
|
|
101
129
|
class="{{ circularBarColor }} transition-all duration-300 ease-in-out {{ indeterminate ? 'animate-spin' : '' }}"
|
|
130
|
+
:class="circularBarClass()"
|
|
102
131
|
cx="{{ circularSize / 2 }}"
|
|
103
132
|
cy="{{ circularSize / 2 }}"
|
|
104
133
|
r="{{ radius }}"
|
package/src/ui/radio/Radio.stx
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
<script server>
|
|
2
|
-
export const checked = $props.checked
|
|
3
|
-
export const disabled = $props.disabled
|
|
2
|
+
export const checked = $bool($props.checked)
|
|
3
|
+
export const disabled = $bool($props.disabled)
|
|
4
4
|
export const size = $props.size || 'md'
|
|
5
5
|
export const label = $props.label || ''
|
|
6
6
|
export const description = $props.description || ''
|
|
7
|
-
export const error = $props.error
|
|
8
|
-
export const required = $props.required
|
|
7
|
+
export const error = $bool($props.error)
|
|
8
|
+
export const required = $bool($props.required)
|
|
9
9
|
export const value = $props.value || ''
|
|
10
10
|
export const name = $props.name || ''
|
|
11
11
|
export const className = $props.className || ''
|
|
12
12
|
|
|
13
13
|
const sizeClasses = { sm: 'h-4 w-4', md: 'h-5 w-5', lg: 'h-6 w-6' }
|
|
14
14
|
const baseClasses = 'border-line-strong text-accent focus:ring-accent focus:ring-2 focus:ring-offset-2 dark:focus:ring-offset-gray-900 transition-colors'
|
|
15
|
-
const stateClasses = error ? 'border-
|
|
15
|
+
const stateClasses = error ? 'border-danger-line text-danger focus:ring-danger-focus' : ''
|
|
16
16
|
const disabledClasses = disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'
|
|
17
17
|
|
|
18
|
-
export const radioClasses = `${baseClasses} ${sizeClasses[size]} ${stateClasses} ${disabledClasses}`.trim()
|
|
18
|
+
export const radioClasses = `${baseClasses} ${sizeClasses[size] || sizeClasses.md} ${stateClasses} ${disabledClasses}`.trim()
|
|
19
19
|
export const labelClasses = `text-sm font-medium ${error ? 'text-danger' : 'text-fg'} ${disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}`.trim()
|
|
20
|
-
export const descriptionClasses = `text-sm ${error ? 'text-
|
|
20
|
+
export const descriptionClasses = `text-sm ${error ? 'text-danger' : 'text-fg-soft'}`.trim()
|
|
21
21
|
export const inputId = `radio-${value || label}`
|
|
22
22
|
</script>
|
|
23
23
|
|
|
@@ -63,7 +63,7 @@ defineExpose({ isChecked })
|
|
|
63
63
|
<label for="{{ inputId }}" class="{{ labelClasses }}">
|
|
64
64
|
{{ label }}
|
|
65
65
|
@if(required)
|
|
66
|
-
<span class="text-
|
|
66
|
+
<span class="text-danger ml-1">*</span>
|
|
67
67
|
@endif
|
|
68
68
|
</label>
|
|
69
69
|
@endif
|
|
@@ -23,7 +23,7 @@ export const as = $props.as || 'div'
|
|
|
23
23
|
export const options = Array.isArray($props.options) ? $props.options : []
|
|
24
24
|
export const hasPropOptions = options.length > 0
|
|
25
25
|
|
|
26
|
-
const optionBaseClasses = 'relative flex cursor-pointer rounded-
|
|
26
|
+
const optionBaseClasses = 'relative flex cursor-pointer rounded-panel px-5 py-4 shadow-md focus:outline-none transition-all bg-panel text-fg focus-visible:ring-2 focus-visible:ring-white/60 focus-visible:ring-offset-2 focus-visible:ring-offset-blue-300 dark:focus-visible:ring-offset-blue-700'
|
|
27
27
|
export const optionClasses = optionBaseClasses
|
|
28
28
|
export const optionDisabledClasses = `${optionBaseClasses} opacity-50 cursor-not-allowed`
|
|
29
29
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export const className = $props.className || ''
|
|
3
3
|
export const as = $props.as || 'label'
|
|
4
4
|
|
|
5
|
-
const baseClasses = 'block text-sm font-medium text-
|
|
5
|
+
const baseClasses = 'block text-sm font-medium text-fg'
|
|
6
6
|
const labelClasses = `${baseClasses} ${className}`.trim()
|
|
7
7
|
</script>
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script server>
|
|
2
2
|
export const value = $props.value
|
|
3
|
-
export const disabled = $props.disabled
|
|
3
|
+
export const disabled = $bool($props.disabled)
|
|
4
4
|
export const className = $props.className || ''
|
|
5
5
|
export const as = $props.as || 'div'
|
|
6
6
|
|
|
7
|
-
const baseClasses = 'relative flex cursor-pointer rounded-
|
|
7
|
+
const baseClasses = 'relative flex cursor-pointer rounded-panel px-5 py-4 shadow-md focus:outline-none transition-all bg-panel text-fg focus-visible:ring-2 focus-visible:ring-white/60 focus-visible:ring-offset-2 focus-visible:ring-offset-blue-300 dark:focus-visible:ring-offset-blue-700'
|
|
8
8
|
const disabledClasses = disabled ? 'opacity-50 cursor-not-allowed' : ''
|
|
9
9
|
export const optionClasses = `${baseClasses} ${disabledClasses} ${className}`.trim()
|
|
10
10
|
export const valueJson = JSON.stringify(value === undefined ? null : value)
|
package/src/ui/select/Select.stx
CHANGED
|
@@ -2,24 +2,34 @@
|
|
|
2
2
|
export const value = $props.value || ''
|
|
3
3
|
export const options = $props.options || []
|
|
4
4
|
export const placeholder = $props.placeholder || 'Select an option'
|
|
5
|
-
export const disabled = $props.disabled
|
|
5
|
+
export const disabled = $bool($props.disabled)
|
|
6
6
|
export const size = $props.size || 'md'
|
|
7
|
-
export const error = $props.error
|
|
7
|
+
export const error = $bool($props.error)
|
|
8
8
|
export const label = $props.label || ''
|
|
9
9
|
export const helperText = $props.helperText || ''
|
|
10
|
-
export const required = $props.required
|
|
10
|
+
export const required = $bool($props.required)
|
|
11
11
|
export const className = $props.className || ''
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
/*
|
|
14
|
+
* Padding decides the height here too, with no `h-*` to override it: an app
|
|
15
|
+
* passing its own `py-1.5` got the padding it asked for and the height it did
|
|
16
|
+
* not, and `className` cannot beat `h-10` at equal specificity
|
|
17
|
+
* (stacksjs/stx#1993).
|
|
18
|
+
*
|
|
19
|
+
* `lg` also needed a padding step adjusted - py-3 around a 1.75rem line-height
|
|
20
|
+
* is 3.25rem of content inside a declared 3rem box - so py-2.5 lands on the
|
|
21
|
+
* 3rem it always claimed. sm and md were already exact.
|
|
22
|
+
*/
|
|
23
|
+
const sizeClasses = { sm: 'px-3 py-1.5 text-sm', md: 'px-4 py-2 text-base', lg: 'px-5 py-2.5 text-lg' }
|
|
24
|
+
const baseClasses = 'block w-full border-0 rounded-control shadow-sm ring-1 ring-inset transition-colors duration-200 focus:ring-2 focus:ring-inset dark:bg-neutral-700 dark:text-neutral-100'
|
|
15
25
|
const stateClasses = error
|
|
16
|
-
? 'ring-
|
|
26
|
+
? 'ring-danger-line text-danger-fg placeholder-danger-fg-subtle focus:ring-danger-focus'
|
|
17
27
|
: 'ring-line-strong text-fg placeholder-fg-subtle focus:ring-accent'
|
|
18
28
|
const disabledClasses = disabled
|
|
19
29
|
? 'opacity-50 cursor-not-allowed bg-surface'
|
|
20
|
-
: 'bg-
|
|
30
|
+
: 'bg-field cursor-pointer hover:ring-neutral-400 dark:hover:ring-neutral-500'
|
|
21
31
|
|
|
22
|
-
export const selectClasses = `${baseClasses} ${sizeClasses[size]} ${stateClasses} ${disabledClasses} ${className}`.trim()
|
|
32
|
+
export const selectClasses = `${baseClasses} ${sizeClasses[size] || sizeClasses.md} ${stateClasses} ${disabledClasses} ${className}`.trim()
|
|
23
33
|
export const labelClasses = `block text-sm font-medium leading-6 ${error ? 'text-danger' : 'text-fg'}`.trim()
|
|
24
34
|
export const helperClasses = `mt-2 text-sm ${error ? 'text-danger' : 'text-fg-soft'}`.trim()
|
|
25
35
|
export const selectId = `select-${value}`
|
|
@@ -43,7 +53,7 @@ defineExpose({ value: selectedValue })
|
|
|
43
53
|
<label for="{{ selectId }}" class="{{ labelClasses }}">
|
|
44
54
|
{{ label }}
|
|
45
55
|
@if(required)
|
|
46
|
-
<span class="text-
|
|
56
|
+
<span class="text-danger ml-1">*</span>
|
|
47
57
|
@endif
|
|
48
58
|
</label>
|
|
49
59
|
@endif
|
|
@@ -22,8 +22,8 @@ export const sections = $props.sections || []
|
|
|
22
22
|
export const spaces = $props.spaces || []
|
|
23
23
|
export const hasSpaces = spaces.length > 0
|
|
24
24
|
export const activeSpace = $props.space || $props.activeSpace || ''
|
|
25
|
-
export const showSpaceSwitcher = $props.showSpaceSwitcher
|
|
26
|
-
export const showSpaceAdd = $props.showSpaceAdd
|
|
25
|
+
export const showSpaceSwitcher = $bool($props.showSpaceSwitcher, true)
|
|
26
|
+
export const showSpaceAdd = $bool($props.showSpaceAdd)
|
|
27
27
|
export const spaceAddLabel = $props.spaceAddLabel || 'New space'
|
|
28
28
|
export const spacePersistKey = $props.spacePersistKey || ''
|
|
29
29
|
|
|
@@ -32,12 +32,12 @@ export const theme = $props.theme || $props.variant || (hasSpaces ? 'arc' : 'mac
|
|
|
32
32
|
export const width = $props.width || 250
|
|
33
33
|
export const position = $props.position || 'left'
|
|
34
34
|
export const placement = $props.placement || 'fixed'
|
|
35
|
-
export const bordered = $props.bordered
|
|
35
|
+
export const bordered = $bool($props.bordered)
|
|
36
36
|
|
|
37
37
|
// Collapsing. macOS sidebars hide entirely (toolbar button / drag); legacy
|
|
38
38
|
// themes may collapse to a compact rail instead.
|
|
39
|
-
export const collapsed = $props.collapsed
|
|
40
|
-
export const collapsible = $props.collapsible
|
|
39
|
+
export const collapsed = $bool($props.collapsed)
|
|
40
|
+
export const collapsible = $bool($props.collapsible, true)
|
|
41
41
|
export const collapseMode = $props.collapseMode || (theme === 'workspace' || theme === 'desktop' ? 'rail' : 'hidden')
|
|
42
42
|
export const minWidth = $props.minWidth || 64
|
|
43
43
|
export const persistKey = $props.persistKey || ''
|
|
@@ -52,7 +52,7 @@ export const className = $props.className || ''
|
|
|
52
52
|
// the document's business, not a navigation pane's. Left on by default so a
|
|
53
53
|
// sidebar dropped into a page with no theme controller still behaves; turn it
|
|
54
54
|
// off in any app that owns its own light/dark switch.
|
|
55
|
-
export const followSystemAppearance = $props.followSystemAppearance
|
|
55
|
+
export const followSystemAppearance = $bool($props.followSystemAppearance, true)
|
|
56
56
|
|
|
57
57
|
// Unique id so the client controller can find this pane even with several
|
|
58
58
|
// sidebars on the page.
|
|
@@ -7,7 +7,7 @@ export const actions = $props.actions || [] // [{ id, icon, label }]
|
|
|
7
7
|
export const title = $props.title || ''
|
|
8
8
|
export const subtitle = $props.subtitle || ''
|
|
9
9
|
export const logo = $props.logo || ''
|
|
10
|
-
export const showSearch = $props.showSearch
|
|
10
|
+
export const showSearch = $bool($props.showSearch)
|
|
11
11
|
export const searchPlaceholder = $props.searchPlaceholder || 'Search'
|
|
12
12
|
|
|
13
13
|
export const isMacos = theme === 'macos' || theme === 'tahoe' || theme === 'macos-tahoe' || theme === 'macos-latest'
|
|
@@ -77,7 +77,7 @@ export const windowControls = controlsProp
|
|
|
77
77
|
export const autoWindowControls = windowControls === 'auto'
|
|
78
78
|
export const showWindowControls = windowControls === 'draw' || autoWindowControls
|
|
79
79
|
export const reserveWindowControls = windowControls === 'native' || autoWindowControls
|
|
80
|
-
export const showNavigation = $props.showNavigation
|
|
80
|
+
export const showNavigation = $bool($props.showNavigation)
|
|
81
81
|
|
|
82
82
|
// A replica yields to the real thing — but only when it was the default that
|
|
83
83
|
// put it there. An author who asked for 'draw' gets replicas everywhere.
|
|
@@ -326,7 +326,7 @@ function onChromePress(event) {
|
|
|
326
326
|
@else
|
|
327
327
|
<div class="flex h-13 items-center gap-3 border-b border-black/5 px-4 dark:border-white/10">
|
|
328
328
|
@if(logo)
|
|
329
|
-
<img src="{{ logo }}" alt="{{ title }}" class="h-8 w-8 rounded-
|
|
329
|
+
<img src="{{ logo }}" alt="{{ title }}" class="h-8 w-8 rounded-panel object-cover" />
|
|
330
330
|
@endif
|
|
331
331
|
<div class="min-w-0">
|
|
332
332
|
@if(title)
|
|
@@ -8,10 +8,10 @@ export const iconColor = $props.iconColor || ''
|
|
|
8
8
|
export const image = $props.image || ''
|
|
9
9
|
export const href = $props.href || ''
|
|
10
10
|
export const count = $props.count ?? $props.badge ?? ''
|
|
11
|
-
export const active = $props.active
|
|
12
|
-
export const disabled = $props.disabled
|
|
13
|
-
export const expandable = $props.expandable
|
|
14
|
-
export const expanded = $props.expanded
|
|
11
|
+
export const active = $bool($props.active)
|
|
12
|
+
export const disabled = $bool($props.disabled)
|
|
13
|
+
export const expandable = $bool($props.expandable)
|
|
14
|
+
export const expanded = $bool($props.expanded, true)
|
|
15
15
|
export const depth = $props.depth || 0
|
|
16
16
|
export const parents = $props.parents || ''
|
|
17
17
|
export const theme = $props.theme || $props.variant || 'macos'
|
|
@@ -4,8 +4,8 @@ import { resolveSidebarTheme } from './themes'
|
|
|
4
4
|
export const id = $props.id || ''
|
|
5
5
|
export const label = $props.label || ''
|
|
6
6
|
export const items = $props.items || []
|
|
7
|
-
export const collapsible = $props.collapsible
|
|
8
|
-
export const collapsed = $props.collapsed
|
|
7
|
+
export const collapsible = $bool($props.collapsible, true)
|
|
8
|
+
export const collapsed = $bool($props.collapsed)
|
|
9
9
|
export const theme = $props.theme || $props.variant || 'macos'
|
|
10
10
|
|
|
11
11
|
const themeStyle = resolveSidebarTheme(theme)
|
|
@@ -14,7 +14,7 @@ export const sections = $props.sections || []
|
|
|
14
14
|
export const action = $props.action || null
|
|
15
15
|
export const clear = $props.clear || null
|
|
16
16
|
export const theme = $props.theme || 'arc'
|
|
17
|
-
export const active = $props.active
|
|
17
|
+
export const active = $bool($props.active)
|
|
18
18
|
|
|
19
19
|
// Render the shell without its contents.
|
|
20
20
|
//
|
|
@@ -27,14 +27,14 @@ export const active = $props.active ?? false
|
|
|
27
27
|
// The space still announces itself as a tabpanel, so the switcher and keyboard
|
|
28
28
|
// navigation are unchanged; `data-space-deferred` tells the controller this one
|
|
29
29
|
// has nothing yet, and `spaceChange` is where a host fills it or navigates.
|
|
30
|
-
export const deferred = $props.deferred
|
|
30
|
+
export const deferred = $bool($props.deferred)
|
|
31
31
|
|
|
32
32
|
// Whether to draw `label` as a title above the rows. An app that names the
|
|
33
33
|
// space somewhere else — an Arc header with a title puts it beside the traffic
|
|
34
34
|
// lights, the way Dia does — turns this off rather than saying it twice.
|
|
35
35
|
// `label` is still needed: it is the panel's accessible name and the
|
|
36
36
|
// switcher's tooltip.
|
|
37
|
-
export const showTitle = $props.showTitle
|
|
37
|
+
export const showTitle = $bool($props.showTitle, true)
|
|
38
38
|
|
|
39
39
|
const themeStyle = resolveSidebarTheme(theme)
|
|
40
40
|
export const scrollAreaClasses = themeStyle.scrollArea
|
|
@@ -24,7 +24,7 @@ export const spaces = ($props.spaces || []).map(space => ({
|
|
|
24
24
|
}))
|
|
25
25
|
|
|
26
26
|
export const active = $props.active || (spaces[0] && spaces[0].id) || ''
|
|
27
|
-
export const showAdd = $props.showAdd
|
|
27
|
+
export const showAdd = $bool($props.showAdd)
|
|
28
28
|
export const addLabel = $props.addLabel || 'New space'
|
|
29
29
|
|
|
30
30
|
// A single space has nothing to indicate. Dia hides the row entirely rather
|
|
@@ -22,8 +22,8 @@ export const theme = $props.theme || 'arc'
|
|
|
22
22
|
export const activeId = $props.space || $props.active || (spaceList[0] && spaceList[0].id) || ''
|
|
23
23
|
export const activeIndex = spaceIndexOf(spaceList, activeId)
|
|
24
24
|
|
|
25
|
-
export const showSwitcher = $props.showSwitcher
|
|
26
|
-
export const showAdd = $props.showAdd
|
|
25
|
+
export const showSwitcher = $bool($props.showSwitcher, true)
|
|
26
|
+
export const showAdd = $bool($props.showAdd)
|
|
27
27
|
export const addLabel = $props.addLabel || 'New space'
|
|
28
28
|
export const persistKey = $props.persistKey || ''
|
|
29
29
|
|
|
@@ -3,9 +3,9 @@ export const variant = $props.variant || 'text'
|
|
|
3
3
|
export const count = $props.count || 1
|
|
4
4
|
export const width = $props.width || ''
|
|
5
5
|
export const height = $props.height || ''
|
|
6
|
-
export const circle = $props.circle
|
|
6
|
+
export const circle = $bool($props.circle)
|
|
7
7
|
export const className = $props.className || ''
|
|
8
|
-
export const animate = $props.animate
|
|
8
|
+
export const animate = $bool($props.animate, true)
|
|
9
9
|
|
|
10
10
|
// Variant classes
|
|
11
11
|
const variantClasses = {
|
|
@@ -19,10 +19,10 @@ const variantClasses = {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// Animation classes
|
|
22
|
-
const animationClasses = animate ? 'animate-pulse' : ''
|
|
22
|
+
const animationClasses = animate ? 'motion-safe:animate-pulse' : ''
|
|
23
23
|
|
|
24
24
|
// Build base classes
|
|
25
|
-
const baseClasses = circle ? 'rounded-full' : variantClasses[variant]
|
|
25
|
+
const baseClasses = circle ? 'rounded-full' : variantClasses[variant] || variantClasses.text
|
|
26
26
|
|
|
27
27
|
// Build style object
|
|
28
28
|
let styleString = ''
|
|
@@ -16,10 +16,10 @@ const sizeClasses = {
|
|
|
16
16
|
|
|
17
17
|
// Color classes
|
|
18
18
|
const colorClasses = {
|
|
19
|
-
primary: 'text-
|
|
20
|
-
secondary: 'text-
|
|
19
|
+
primary: 'text-accent',
|
|
20
|
+
secondary: 'text-secondary-solid',
|
|
21
21
|
success: 'text-success',
|
|
22
|
-
warning: 'text-
|
|
22
|
+
warning: 'text-warning-solid',
|
|
23
23
|
danger: 'text-danger',
|
|
24
24
|
info: 'text-cyan-600 dark:text-cyan-500',
|
|
25
25
|
white: 'text-white',
|
|
@@ -27,7 +27,7 @@ const colorClasses = {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export const containerClasses = `inline-flex flex-col items-center gap-2 ${className}`.trim()
|
|
30
|
-
export const spinnerClasses = `${sizeClasses[size]} ${colorClasses[color]} animate-spin`.trim()
|
|
30
|
+
export const spinnerClasses = `${sizeClasses[size] || sizeClasses.md} ${colorClasses[color] || colorClasses.primary} animate-spin`.trim()
|
|
31
31
|
export const labelClasses = `text-sm font-medium text-fg-strong`.trim()
|
|
32
32
|
|
|
33
33
|
// Dots size classes
|
|
@@ -40,17 +40,17 @@ const dotsSizeClasses = {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
const dotsColorClasses = {
|
|
43
|
-
primary: 'bg-
|
|
44
|
-
secondary: 'bg-
|
|
43
|
+
primary: 'bg-accent-solid',
|
|
44
|
+
secondary: 'bg-secondary-solid',
|
|
45
45
|
success: 'bg-success-solid',
|
|
46
|
-
warning: 'bg-
|
|
46
|
+
warning: 'bg-warning-solid',
|
|
47
47
|
danger: 'bg-danger-solid',
|
|
48
48
|
info: 'bg-cyan-600 dark:bg-cyan-500',
|
|
49
49
|
white: 'bg-white',
|
|
50
|
-
gray: 'bg-
|
|
50
|
+
gray: 'bg-neutral-600 dark:bg-neutral-400',
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
export const dotClasses = `${dotsSizeClasses[size]} ${dotsColorClasses[color]} rounded-full`.trim()
|
|
53
|
+
export const dotClasses = `${dotsSizeClasses[size] || dotsSizeClasses.md} ${dotsColorClasses[color] || dotsColorClasses.primary} rounded-full`.trim()
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
56
|
<div class="{{ containerClasses }}" role="status" aria-live="polite" aria-busy="true">
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<script server>
|
|
2
|
-
|
|
2
|
+
// Defaulted, and not only for tidiness: this value is spliced into the client
|
|
3
|
+
// script below as `const stepNumber = {{ stepNumber }}`. An undefined server
|
|
4
|
+
// value leaves the mustache in the JavaScript, which is a SyntaxError that
|
|
5
|
+
// takes the whole scoped script down -- onClick included. `??` rather than
|
|
6
|
+
// `||` so an explicit 0 (the first step) survives.
|
|
7
|
+
export const stepNumber = $props.stepNumber ?? 0
|
|
3
8
|
export const currentStep = $props.currentStep || 0
|
|
4
9
|
export const label = $props.label || ''
|
|
5
10
|
export const description = $props.description || ''
|
|
@@ -27,9 +32,9 @@ function onClick() {
|
|
|
27
32
|
<button
|
|
28
33
|
type="button"
|
|
29
34
|
@click="onClick()"
|
|
30
|
-
class="flex items-center gap-3 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 rounded-
|
|
35
|
+
class="flex items-center gap-3 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 rounded-panel p-2"
|
|
31
36
|
>
|
|
32
|
-
<div class="{{ isComplete ? 'bg-
|
|
37
|
+
<div class="{{ isComplete ? 'bg-accent-solid' : isCurrent ? 'bg-accent-solid ring-4 ring-blue-200 dark:ring-blue-800' : 'bg-neutral-300 dark:bg-neutral-600' }} w-10 h-10 rounded-full flex items-center justify-center text-white font-semibold transition-all">
|
|
33
38
|
@if(isComplete)
|
|
34
39
|
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
35
40
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
|
|
@@ -41,7 +46,7 @@ function onClick() {
|
|
|
41
46
|
|
|
42
47
|
@if(label)
|
|
43
48
|
<div class="text-left">
|
|
44
|
-
<div class="text-sm font-medium {{ isCurrent ? 'text-
|
|
49
|
+
<div class="text-sm font-medium {{ isCurrent ? 'text-accent' : 'text-fg' }}">
|
|
45
50
|
{{ label }}
|
|
46
51
|
</div>
|
|
47
52
|
@if(description)
|