@stacksjs/components 0.2.343 → 0.2.345
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-kescmd4y.stx} +24 -4
- package/dist/{AccordionItem-7bd3ga36.stx → AccordionItem-1q9k2qyc.stx} +1 -1
- 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-tcjt3m8s.stx +193 -0
- package/dist/{Calendar-gjjhhfnt.stx → Calendar-ppqdw19s.stx} +7 -7
- package/dist/{Card-7byck6ep.stx → Card-r55zpjqh.stx} +6 -6
- package/dist/{Checkbox-2s2a7n4h.stx → Checkbox-e7gn3w06.stx} +10 -10
- 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-00ja5jhz.stx} +27 -3
- 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-nmmkt5yd.stx} +14 -14
- package/dist/{NavBar-wcb6f2d3.stx → NavBar-qqrrhdnk.stx} +24 -0
- package/dist/{Navigator-smpa7my4.stx → Navigator-7rspzjys.stx} +4 -4
- 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-bvk2ss15.stx} +4 -4
- package/dist/{PasswordInput-4qykq1dz.stx → PasswordInput-3snyppj4.stx} +24 -14
- package/dist/{PaymentMethods-2xy66bwk.stx → PaymentMethods-tttjpa1m.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-nr8rbb6g.stx} +9 -9
- 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-wa31mdyc.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-5c1cy7az.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/{TableRow-xd542nvb.stx → TableRow-ytr6b5by.stx} +1 -1
- package/dist/{Tabs-b4xsba1w.stx → Tabs-esrn6j8p.stx} +29 -9
- 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-g2j17eg9.stx} +13 -10
- 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-jhdnq8xe.stx} +5 -5
- 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 +24 -4
- package/src/ui/accordion/AccordionItem.stx +1 -1
- 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 +149 -30
- package/src/ui/calendar/Calendar.stx +7 -7
- package/src/ui/card/Card.stx +6 -6
- package/src/ui/checkbox/Checkbox.stx +10 -10
- 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 +27 -3
- 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 +4 -4
- 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 +9 -9
- 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/table/TableRow.stx +1 -1
- package/src/ui/tabs/Tabs.stx +29 -9
- package/src/ui/teleport/Teleport.stx +2 -2
- package/src/ui/textarea/Textarea.stx +11 -11
- package/src/ui/tooltip/Tooltip.stx +13 -10
- package/src/ui/transition/Transition.stx +1 -1
- package/src/ui/video/Video.stx +6 -6
- package/src/ui/virtual-table/VirtualTable.stx +5 -5
- 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
|
@@ -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 }}"
|
|
@@ -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
|
-
const baseClasses = 'border-line-strong text-accent focus:ring-accent focus:ring-2 focus:ring-offset-2
|
|
15
|
-
const stateClasses = error ? 'border-
|
|
14
|
+
const baseClasses = 'border-line-strong text-accent focus:ring-accent focus:ring-2 focus:ring-offset-2 focus:ring-offset-panel transition-colors'
|
|
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)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script server>
|
|
2
2
|
export const value = $props.value || ''
|
|
3
3
|
export const placeholder = $props.placeholder || 'Search...'
|
|
4
|
-
export const disabled = $props.disabled
|
|
4
|
+
export const disabled = $bool($props.disabled)
|
|
5
5
|
export const size = $props.size || 'md'
|
|
6
|
-
export const error = $props.error
|
|
6
|
+
export const error = $bool($props.error)
|
|
7
7
|
export const label = $props.label || ''
|
|
8
8
|
export const helperText = $props.helperText || ''
|
|
9
|
-
export const loading = $props.loading
|
|
9
|
+
export const loading = $bool($props.loading)
|
|
10
10
|
export const className = $props.className || ''
|
|
11
11
|
|
|
12
12
|
export const searchIcon = '<svg fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" /></svg>'
|
|
@@ -21,6 +21,27 @@ export const cardClasses = `
|
|
|
21
21
|
overflow-hidden rounded-2xl border border-line bg-surface-raised
|
|
22
22
|
divide-y divide-line
|
|
23
23
|
`.replace(/\s+/g, ' ').trim()
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* Whether the router should own this link.
|
|
27
|
+
*
|
|
28
|
+
* The SPA router intercepts `[data-stx-link]` and nothing else, so a plain
|
|
29
|
+
* `<a href>` here was a full document load: the runtime rebooted, every signal
|
|
30
|
+
* and store was discarded, and the screen flashed white. On a phone this is
|
|
31
|
+
* the primary navigation control, so the app's main interaction was its worst
|
|
32
|
+
* one - the single largest reason a wrapped build feels like a browser rather
|
|
33
|
+
* than an app. stacksjs/stx#1988
|
|
34
|
+
*
|
|
35
|
+
* An absolute URL, a scheme (mailto:, tel:), a protocol-relative URL and a
|
|
36
|
+
* bare fragment are left to the browser: the router does not handle those, and
|
|
37
|
+
* claiming them would break a tab that points off-site.
|
|
38
|
+
*/
|
|
39
|
+
function routerOwns(url) {
|
|
40
|
+
if (!url || url === '#') return false
|
|
41
|
+
return !/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(url)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const actionRouterOwned = routerOwns(actionHref)
|
|
24
45
|
</script>
|
|
25
46
|
|
|
26
47
|
<section class="{{ className }}" data-stx-section-card>
|
|
@@ -31,7 +52,13 @@ export const cardClasses = `
|
|
|
31
52
|
@endif
|
|
32
53
|
|
|
33
54
|
@if (action)
|
|
34
|
-
<a
|
|
55
|
+
<a
|
|
56
|
+
href="{{ actionHref }}"
|
|
57
|
+
class="text-sm font-medium text-accent"
|
|
58
|
+
@if (actionRouterOwned)
|
|
59
|
+
data-stx-link
|
|
60
|
+
@endif
|
|
61
|
+
>{{ action }}</a>
|
|
35
62
|
@endif
|
|
36
63
|
</header>
|
|
37
64
|
@endif
|
|
@@ -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
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script server>
|
|
2
2
|
export const headingText = $props.headingText || 'Sign up for Stacks'
|
|
3
|
-
export const showSocialSignup = $props.showSocialSignup
|
|
3
|
+
export const showSocialSignup = $bool($props.showSocialSignup, true)
|
|
4
4
|
export const className = $props.className || ''
|
|
5
5
|
|
|
6
|
-
export const containerClasses = `min-h-full flex flex-col justify-center py-12 lg:px-8 sm:px-6 dark:bg-
|
|
6
|
+
export const containerClasses = `min-h-full flex flex-col justify-center py-12 lg:px-8 sm:px-6 dark:bg-neutral-900 ${className}`.trim()
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<script client>
|
|
@@ -47,7 +47,7 @@ function onSubmit(event) {
|
|
|
47
47
|
</div>
|
|
48
48
|
|
|
49
49
|
<div class="mt-10 sm:mx-auto sm:max-w-[480px] sm:w-full">
|
|
50
|
-
<div class="bg-
|
|
50
|
+
<div class="bg-panel px-6 py-12 shadow sm:rounded-panel sm:px-12">
|
|
51
51
|
<form class="space-y-6" @submit="onSubmit($event)">
|
|
52
52
|
<div>
|
|
53
53
|
<label for="name" class="block text-sm text-fg font-medium leading-6">
|
|
@@ -60,7 +60,7 @@ function onSubmit(event) {
|
|
|
60
60
|
type="text"
|
|
61
61
|
autocomplete="name"
|
|
62
62
|
required
|
|
63
|
-
class="block w-full border-0 rounded-
|
|
63
|
+
class="block w-full border-0 rounded-control p-2 py-1.5 text-fg shadow-sm ring-1 ring-line-strong ring-inset sm:text-sm placeholder:text-fg-subtle sm:leading-6 focus:ring-2 focus:ring-teal-600 focus:ring-inset dark:bg-neutral-700"
|
|
64
64
|
/>
|
|
65
65
|
</div>
|
|
66
66
|
</div>
|
|
@@ -76,7 +76,7 @@ function onSubmit(event) {
|
|
|
76
76
|
type="email"
|
|
77
77
|
autocomplete="email"
|
|
78
78
|
required
|
|
79
|
-
class="block w-full border-0 rounded-
|
|
79
|
+
class="block w-full border-0 rounded-control p-2 py-1.5 text-fg shadow-sm ring-1 ring-line-strong ring-inset sm:text-sm placeholder:text-fg-subtle sm:leading-6 focus:ring-2 focus:ring-teal-600 focus:ring-inset dark:bg-neutral-700"
|
|
80
80
|
/>
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
@@ -92,7 +92,7 @@ function onSubmit(event) {
|
|
|
92
92
|
type="email"
|
|
93
93
|
autocomplete="email"
|
|
94
94
|
required
|
|
95
|
-
class="block w-full border-0 rounded-
|
|
95
|
+
class="block w-full border-0 rounded-control p-2 py-1.5 text-fg shadow-sm ring-1 ring-line-strong ring-inset sm:text-sm placeholder:text-fg-subtle sm:leading-6 focus:ring-2 focus:ring-teal-600 focus:ring-inset dark:bg-neutral-700"
|
|
96
96
|
/>
|
|
97
97
|
</div>
|
|
98
98
|
</div>
|
|
@@ -108,7 +108,7 @@ function onSubmit(event) {
|
|
|
108
108
|
type="password"
|
|
109
109
|
autocomplete="new-password"
|
|
110
110
|
required
|
|
111
|
-
class="block w-full border-0 rounded-
|
|
111
|
+
class="block w-full border-0 rounded-control p-2 py-1.5 text-fg shadow-sm ring-1 ring-line-strong ring-inset sm:text-sm placeholder:text-fg-subtle sm:leading-6 focus:ring-2 focus:ring-teal-600 focus:ring-inset dark:bg-neutral-700"
|
|
112
112
|
/>
|
|
113
113
|
</div>
|
|
114
114
|
</div>
|
|
@@ -116,7 +116,7 @@ function onSubmit(event) {
|
|
|
116
116
|
<div>
|
|
117
117
|
<button
|
|
118
118
|
type="submit"
|
|
119
|
-
class="w-full flex justify-center rounded-
|
|
119
|
+
class="w-full flex justify-center rounded-control bg-teal-600 px-3 py-1.5 text-sm text-white font-semibold leading-6 shadow-sm hover:bg-teal-500 focus-visible:outline-2 focus-visible:outline-teal-600 focus-visible:outline-offset-2 focus-visible:outline"
|
|
120
120
|
>
|
|
121
121
|
Sign up
|
|
122
122
|
</button>
|
|
@@ -130,7 +130,7 @@ function onSubmit(event) {
|
|
|
130
130
|
<div class="w-full border-t border-line"></div>
|
|
131
131
|
</div>
|
|
132
132
|
<div class="relative flex justify-center text-sm font-medium leading-6">
|
|
133
|
-
<span class="bg-
|
|
133
|
+
<span class="bg-panel px-6 text-fg">
|
|
134
134
|
Or signup with
|
|
135
135
|
</span>
|
|
136
136
|
</div>
|
|
@@ -140,7 +140,7 @@ function onSubmit(event) {
|
|
|
140
140
|
<button
|
|
141
141
|
type="button"
|
|
142
142
|
@click="onSocial('google')"
|
|
143
|
-
class="w-full flex items-center justify-center gap-3 rounded-
|
|
143
|
+
class="w-full flex items-center justify-center gap-3 rounded-control bg-field px-3 py-2 text-sm text-fg font-semibold shadow-sm ring-1 ring-line-strong ring-inset hover:bg-field-hover focus-visible:ring-transparent"
|
|
144
144
|
>
|
|
145
145
|
<svg class="h-5 w-5" viewBox="0 0 24 24" aria-hidden="true">
|
|
146
146
|
<path d="M12.0003 4.75C13.7703 4.75 15.3553 5.36002 16.6053 6.54998L20.0303 3.125C17.9502 1.19 15.2353 0 12.0003 0C7.31028 0 3.25527 2.69 1.28027 6.60998L5.27028 9.70498C6.21525 6.86002 8.87028 4.75 12.0003 4.75Z" fill="#EA4335" />
|
|
@@ -154,7 +154,7 @@ function onSubmit(event) {
|
|
|
154
154
|
<button
|
|
155
155
|
type="button"
|
|
156
156
|
@click="onSocial('github')"
|
|
157
|
-
class="w-full flex items-center justify-center gap-3 rounded-
|
|
157
|
+
class="w-full flex items-center justify-center gap-3 rounded-control bg-field px-3 py-2 text-sm text-fg font-semibold shadow-sm ring-1 ring-line-strong ring-inset hover:bg-field-hover focus-visible:ring-transparent"
|
|
158
158
|
>
|
|
159
159
|
<svg class="h-5 w-5 fill-[#24292F] dark:fill-white" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
|
|
160
160
|
<path fill-rule="evenodd" d="M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z" clip-rule="evenodd" />
|
|
@@ -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">
|