@stacksjs/components 0.2.21 → 0.2.26
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/README.md +36 -92
- package/dist/{Accordion-x2gjedap.stx → Accordion-sbfra0mz.stx} +2 -2
- package/dist/{Audio-0fk6p9tn.stx → Audio-vdmg1258.stx} +1 -1
- package/dist/{Avatar-5m0v0s4x.stx → Avatar-365cvrh4.stx} +1 -1
- package/dist/{Badge-ynes82vv.stx → Badge-8m3qete4.stx} +2 -2
- package/dist/{Breadcrumb-h9n427sk.stx → Breadcrumb-7f7s4d02.stx} +1 -1
- package/dist/{Button-7xtrzn14.stx → Button-3tt4vsqt.stx} +2 -2
- package/dist/{Calendar-egvx1pma.stx → Calendar-58nnkdh8.stx} +5 -5
- package/dist/{Card-r9w7vy1a.stx → Card-6wdbexqr.stx} +2 -2
- package/dist/{Checkbox-m8v46pmx.stx → Checkbox-p3q3e3nf.stx} +1 -1
- package/dist/{Checkout-vcnnr176.stx → Checkout-e4037tyy.stx} +1 -1
- package/dist/{Combobox-npb08vkp.stx → Combobox-th5ebw62.stx} +1 -1
- package/dist/{ComboboxButton-vcdyq4zw.stx → ComboboxButton-8gxwkhdx.stx} +1 -1
- package/dist/{ComboboxInput-c9d2p02m.stx → ComboboxInput-mk99z65n.stx} +1 -1
- package/dist/{ComboboxOption-7d0h9ash.stx → ComboboxOption-an9zyan6.stx} +1 -1
- package/dist/{ComboboxOptions-4dtqc0qa.stx → ComboboxOptions-6b5ywc5x.stx} +1 -1
- package/dist/{CommandPalette-ah00bf8v.stx → CommandPalette-kwmdf2np.stx} +1 -1
- package/dist/{CommandPaletteItem-2yx0gvtj.stx → CommandPaletteItem-zx2fbpts.stx} +1 -1
- package/dist/{DefaultPaymentMethod-emw5fg8s.stx → DefaultPaymentMethod-shhf6aap.stx} +1 -1
- package/dist/{Dialog-1w4rz7x0.stx → Dialog-rgmj8q2j.stx} +1 -1
- package/dist/{DialogBackdrop-qbm3y5ab.stx → DialogBackdrop-rxax3sec.stx} +1 -1
- package/dist/{DialogDescription-01w5j74b.stx → DialogDescription-76prd1m2.stx} +1 -1
- package/dist/{DialogPanel-brsszrrs.stx → DialogPanel-44d8jeqy.stx} +1 -1
- package/dist/{DialogTitle-3rxhwg21.stx → DialogTitle-x0r6k8x9.stx} +1 -1
- package/dist/{Drawer-yfaz8q7f.stx → Drawer-p7m351bn.stx} +3 -3
- package/dist/{Dropdown-ng7nx556.stx → Dropdown-jz4jy0n3.stx} +1 -1
- package/dist/{DropdownButton-vc4zpyrb.stx → DropdownButton-9w8zkfwj.stx} +1 -1
- package/dist/{DropdownItem-z491y23c.stx → DropdownItem-wagdspb8.stx} +1 -1
- package/dist/{DropdownItems-7ykf29sj.stx → DropdownItems-aygjpxkx.stx} +1 -1
- package/dist/{EmailInput-bfshpj92.stx → EmailInput-ajsp9vw6.stx} +1 -1
- package/dist/{Form-z4f7w6r1.stx → Form-1mdmx9b6.stx} +1 -1
- package/dist/{Image-ktk0451c.stx → Image-jhkm6w1f.stx} +1 -1
- package/dist/{Listbox-xcejcmyc.stx → Listbox-pqqh72g8.stx} +1 -1
- package/dist/{ListboxButton-nx5kmw19.stx → ListboxButton-spwx7513.stx} +1 -1
- package/dist/{RadioGroupLabel-aky8a73n.stx → ListboxLabel-7mymt1b8.stx} +1 -1
- package/dist/{ListboxOption-6h4hsdz5.stx → ListboxOption-7nxzaexq.stx} +1 -1
- package/dist/{ListboxOptions-2sacdtm5.stx → ListboxOptions-8kqvfp7z.stx} +1 -1
- package/dist/{Login-s2jkvd9y.stx → Login-rx9gyqhx.stx} +1 -1
- package/dist/{Navigator-tqqdgdkw.stx → Navigator-aay8bjab.stx} +3 -3
- package/dist/{Notification-sry8egea.stx → Notification-gk33gv7b.stx} +1 -1
- package/dist/{NumberInput-zm93ddfw.stx → NumberInput-nzpkx1ry.stx} +3 -3
- package/dist/{Pagination-yza9v4qw.stx → Pagination-h61eq390.stx} +6 -6
- package/dist/{PasswordInput-4xnndp5y.stx → PasswordInput-zv4hm43j.stx} +2 -2
- package/dist/{PaymentMethods-jxba6kek.stx → PaymentMethods-j42jsk5x.stx} +3 -3
- package/dist/{Popover-scbqatjq.stx → Popover-469gbt6r.stx} +1 -1
- package/dist/{PopoverButton-rbxhzj4k.stx → PopoverButton-fnaqc77g.stx} +1 -1
- package/dist/{PopoverPanel-9ng1rm6e.stx → PopoverPanel-y0vtf5w9.stx} +1 -1
- package/dist/{Portal-j111yvqp.stx → Portal-s2q37yp0.stx} +1 -1
- package/dist/{Progress-gbmw3akr.stx → Progress-vmdkm06p.stx} +1 -1
- package/dist/{Radio-1n9qamv1.stx → Radio-04bs3d21.stx} +1 -1
- package/dist/{RadioGroup-12dw2vhk.stx → RadioGroup-bvb1mrhd.stx} +1 -1
- package/dist/{RadioGroupDescription-bjm3mdht.stx → RadioGroupDescription-yej78fak.stx} +1 -1
- package/dist/{ListboxLabel-aky8a73n.stx → RadioGroupLabel-7mymt1b8.stx} +1 -1
- package/dist/{RadioGroupOption-9pcxgwmd.stx → RadioGroupOption-cpdwgnhw.stx} +1 -1
- package/dist/{SearchInput-g240e2nq.stx → SearchInput-2521m475.stx} +1 -1
- package/dist/{Select-p9f94b20.stx → Select-g4mmvfv8.stx} +1 -1
- package/dist/{Sidebar-gwxw8q38.stx → Sidebar-40ckbzh8.stx} +1 -1
- package/dist/{SidebarFooter-887kxret.stx → SidebarFooter-hnth56mg.stx} +1 -1
- package/dist/{SidebarHeader-qjeyx0hv.stx → SidebarHeader-3wrte2p2.stx} +1 -1
- package/dist/{SidebarItem-4dpwtmb4.stx → SidebarItem-zqtvvzpc.stx} +1 -1
- package/dist/{SidebarSection-kh92fk4m.stx → SidebarSection-3etwnbjr.stx} +1 -1
- package/dist/{Signup-3nxq5zag.stx → Signup-c4dyv6f3.stx} +1 -1
- package/dist/{Skeleton-g0nx1njm.stx → Skeleton-v1pwa8nr.stx} +1 -1
- package/dist/{Spinner-w4zj58xp.stx → Spinner-7dahavkd.stx} +1 -1
- package/dist/{Stepper-rwc5actp.stx → Stepper-rgbk76hd.stx} +1 -1
- package/dist/{StepperStep-h0k657nm.stx → StepperStep-en4r00zv.stx} +1 -1
- package/dist/{SubscriptionCheckout-4cbxdg7w.stx → SubscriptionCheckout-gawjzf3q.stx} +2 -2
- package/dist/{Switch-kjq8qd2p.stx → Switch-036j9vm1.stx} +1 -1
- package/dist/{Table-59j9qwp0.stx → Table-6cx8az9h.stx} +1 -1
- package/dist/{TableBody-reka2gwv.stx → TableBody-wf6t13j9.stx} +1 -1
- package/dist/{TableCell-j7nh4sgr.stx → TableCell-ntx0edbn.stx} +1 -1
- package/dist/{TableHead-ecbrwpqm.stx → TableHead-3k4hnm2k.stx} +1 -1
- package/dist/{TableHeader-jn2shwsv.stx → TableHeader-ydys9rzz.stx} +1 -1
- package/dist/{TableRow-xz8rrxhc.stx → TableRow-z09p2ebf.stx} +1 -1
- package/dist/{Tabs-kb6ex6m7.stx → Tabs-svh721m0.stx} +2 -2
- package/dist/{Teleport-819cg9zm.stx → Teleport-qfch3w0b.stx} +1 -1
- package/dist/{TextInput-zx9kgr79.stx → TextInput-k2kfkgy1.stx} +2 -2
- package/dist/{Textarea-5xvmrb0z.stx → Textarea-szad57dz.stx} +1 -1
- package/dist/{Tooltip-5ehqsy49.stx → Tooltip-em7t551n.stx} +1 -1
- package/dist/{Transition-2j39s044.stx → Transition-0hmr6zxb.stx} +1 -1
- package/dist/{TwoFactorChallenge-2q4gg89m.stx → TwoFactorChallenge-an9yvxvq.stx} +2 -2
- package/dist/{Video-6aq4shh4.stx → Video-crxva65p.stx} +1 -1
- package/dist/{VirtualList-weh5qtm1.stx → VirtualList-cndhjejh.stx} +1 -1
- package/dist/{VirtualTable-59a1eskc.stx → VirtualTable-ng0b48yp.stx} +1 -1
- package/dist/components/CodeBlock.stx +12 -0
- package/dist/components/Footer.stx +8 -0
- package/dist/components/Hero.stx +3 -0
- package/dist/components/Installation.stx +5 -0
- package/dist/index.js +9 -9
- package/dist/ui/accordion/Accordion.stx +10 -0
- package/dist/ui/audio/Audio.stx +11 -0
- package/dist/ui/auth/Login.stx +10 -0
- package/dist/ui/auth/Signup.stx +5 -0
- package/dist/ui/auth/TwoFactorChallenge.stx +9 -0
- package/dist/ui/avatar/Avatar.stx +15 -0
- package/dist/ui/badge/Badge.stx +9 -0
- package/dist/ui/breadcrumb/Breadcrumb.stx +9 -0
- package/dist/ui/button/Button.stx +14 -0
- package/dist/ui/button/index.d.ts +2 -2
- package/dist/ui/calendar/Calendar.stx +10 -0
- package/dist/ui/card/Card.stx +12 -0
- package/dist/ui/checkbox/Checkbox.stx +15 -0
- package/dist/ui/combobox/Combobox.stx +4 -0
- package/dist/ui/combobox/ComboboxButton.stx +2 -0
- package/dist/ui/combobox/ComboboxInput.stx +8 -0
- package/dist/ui/combobox/ComboboxOption.stx +13 -0
- package/dist/ui/combobox/ComboboxOptions.stx +3 -0
- package/dist/ui/command-palette/CommandPalette.stx +8 -0
- package/dist/ui/command-palette/CommandPaletteItem.stx +8 -0
- package/dist/ui/dialog/Dialog.stx +5 -0
- package/dist/ui/dialog/DialogBackdrop.stx +2 -0
- package/dist/ui/dialog/DialogDescription.stx +2 -0
- package/dist/ui/dialog/DialogPanel.stx +2 -0
- package/dist/ui/dialog/DialogTitle.stx +2 -0
- package/dist/ui/drawer/Drawer.stx +9 -0
- package/dist/ui/dropdown/Dropdown.stx +7 -0
- package/dist/ui/dropdown/DropdownButton.stx +6 -0
- package/dist/ui/dropdown/DropdownItem.stx +10 -0
- package/dist/ui/dropdown/DropdownItems.stx +3 -0
- package/dist/ui/form/Form.stx +11 -0
- package/dist/ui/form/index.d.ts +2 -2
- package/dist/ui/image/Image.stx +26 -0
- package/dist/ui/input/EmailInput.stx +11 -0
- package/dist/ui/input/NumberInput.stx +19 -0
- package/dist/ui/input/PasswordInput.stx +19 -0
- package/dist/ui/input/SearchInput.stx +12 -0
- package/dist/ui/input/TextInput.stx +22 -0
- package/dist/ui/input/index.d.ts +6 -6
- package/dist/ui/listbox/Listbox.stx +5 -0
- package/dist/ui/listbox/ListboxButton.stx +3 -0
- package/dist/ui/listbox/ListboxLabel.stx +2 -0
- package/dist/ui/listbox/ListboxOption.stx +13 -0
- package/dist/ui/listbox/ListboxOptions.stx +3 -0
- package/dist/ui/navigator/Navigator.stx +8 -0
- package/dist/ui/notification/Notification.stx +12 -0
- package/dist/ui/pagination/Pagination.stx +12 -0
- package/dist/ui/payment/Checkout.stx +13 -0
- package/dist/ui/payment/DefaultPaymentMethod.stx +4 -0
- package/dist/ui/payment/PaymentMethods.stx +6 -0
- package/dist/ui/payment/SubscriptionCheckout.stx +191 -0
- package/dist/ui/popover/Popover.stx +7 -0
- package/dist/ui/popover/PopoverButton.stx +6 -0
- package/dist/ui/popover/PopoverPanel.stx +4 -0
- package/dist/ui/portal/Portal.stx +2 -0
- package/dist/ui/progress/Progress.stx +14 -0
- package/dist/ui/radio/Radio.stx +14 -0
- package/dist/ui/radio-group/RadioGroup.stx +4 -0
- package/dist/ui/radio-group/RadioGroupDescription.stx +2 -0
- package/dist/ui/radio-group/RadioGroupLabel.stx +2 -0
- package/dist/ui/radio-group/RadioGroupOption.stx +13 -0
- package/dist/ui/select/Select.stx +14 -0
- package/dist/ui/sidebar/Sidebar.stx +33 -0
- package/dist/ui/sidebar/SidebarFooter.stx +27 -0
- package/dist/ui/sidebar/SidebarHeader.stx +26 -0
- package/dist/ui/sidebar/SidebarItem.stx +28 -0
- package/dist/ui/sidebar/SidebarSection.stx +25 -0
- package/dist/ui/skeleton/Skeleton.stx +9 -0
- package/dist/ui/spinner/Spinner.stx +9 -0
- package/dist/ui/stepper/Stepper.stx +4 -0
- package/dist/ui/stepper/StepperStep.stx +12 -0
- package/dist/ui/switch/Switch.stx +15 -0
- package/dist/ui/table/Table.stx +3 -0
- package/dist/ui/table/TableBody.stx +1 -0
- package/dist/ui/table/TableCell.stx +1 -0
- package/dist/ui/table/TableHead.stx +1 -0
- package/dist/ui/table/TableHeader.stx +3 -0
- package/dist/ui/table/TableRow.stx +2 -0
- package/dist/ui/tabs/Tabs.stx +9 -0
- package/dist/ui/teleport/Teleport.stx +3 -0
- package/dist/ui/textarea/Textarea.stx +18 -0
- package/dist/ui/tooltip/Tooltip.stx +9 -0
- package/dist/ui/transition/Transition.stx +27 -0
- package/dist/ui/video/Video.stx +15 -0
- package/dist/ui/virtual-list/VirtualList.stx +9 -0
- package/dist/ui/virtual-table/VirtualTable.stx +16 -0
- package/dist/utils/accessibility.d.ts +10 -25
- package/dist/utils/animation/easing.d.ts +75 -0
- package/dist/utils/error-handling.d.ts +8 -21
- package/dist/utils/i18n.d.ts +36 -86
- package/package.json +5 -3
- package/src/ui/accordion/Accordion.stx +2 -2
- package/src/ui/audio/Audio.stx +1 -1
- package/src/ui/audio/README.md +5 -6
- package/src/ui/auth/Login.stx +1 -1
- package/src/ui/auth/README.md +30 -33
- package/src/ui/auth/Signup.stx +1 -1
- package/src/ui/auth/TwoFactorChallenge.stx +2 -2
- package/src/ui/avatar/Avatar.stx +1 -1
- package/src/ui/badge/Badge.stx +2 -2
- package/src/ui/breadcrumb/Breadcrumb.stx +1 -1
- package/src/ui/button/Button.stx +2 -2
- package/src/ui/button/README.md +12 -32
- package/src/ui/calendar/Calendar.stx +5 -5
- package/src/ui/card/Card.stx +2 -2
- package/src/ui/checkbox/Checkbox.stx +1 -1
- package/src/ui/combobox/Combobox.stx +1 -1
- package/src/ui/combobox/ComboboxButton.stx +1 -1
- package/src/ui/combobox/ComboboxInput.stx +1 -1
- package/src/ui/combobox/ComboboxOption.stx +1 -1
- package/src/ui/combobox/ComboboxOptions.stx +1 -1
- package/src/ui/combobox/README.md +25 -29
- package/src/ui/command-palette/CommandPalette.stx +1 -1
- package/src/ui/command-palette/CommandPaletteItem.stx +1 -1
- package/src/ui/command-palette/README.md +8 -8
- package/src/ui/dialog/Dialog.stx +1 -1
- package/src/ui/dialog/DialogBackdrop.stx +1 -1
- package/src/ui/dialog/DialogDescription.stx +1 -1
- package/src/ui/dialog/DialogPanel.stx +1 -1
- package/src/ui/dialog/DialogTitle.stx +1 -1
- package/src/ui/dialog/README.md +26 -38
- package/src/ui/drawer/Drawer.stx +3 -3
- package/src/ui/drawer/README.md +13 -33
- package/src/ui/dropdown/Dropdown.stx +1 -1
- package/src/ui/dropdown/DropdownButton.stx +1 -1
- package/src/ui/dropdown/DropdownItem.stx +1 -1
- package/src/ui/dropdown/DropdownItems.stx +1 -1
- package/src/ui/dropdown/README.md +28 -56
- package/src/ui/form/Form.stx +1 -1
- package/src/ui/image/Image.stx +1 -1
- package/src/ui/image/README.md +45 -52
- package/src/ui/input/EmailInput.stx +1 -1
- package/src/ui/input/NumberInput.stx +3 -3
- package/src/ui/input/PasswordInput.stx +2 -2
- package/src/ui/input/SearchInput.stx +1 -1
- package/src/ui/input/TextInput.stx +2 -2
- package/src/ui/listbox/Listbox.stx +1 -1
- package/src/ui/listbox/ListboxButton.stx +1 -1
- package/src/ui/listbox/ListboxLabel.stx +1 -1
- package/src/ui/listbox/ListboxOption.stx +1 -1
- package/src/ui/listbox/ListboxOptions.stx +1 -1
- package/src/ui/listbox/README.md +21 -29
- package/src/ui/navigator/Navigator.stx +3 -3
- package/src/ui/notification/Notification.stx +1 -1
- package/src/ui/notification/README.md +28 -32
- package/src/ui/pagination/Pagination.stx +6 -6
- package/src/ui/payment/Checkout.stx +1 -1
- package/src/ui/payment/DefaultPaymentMethod.stx +1 -1
- package/src/ui/payment/PaymentMethods.stx +3 -3
- package/src/ui/payment/README.md +59 -141
- package/src/ui/payment/SubscriptionCheckout.stx +2 -2
- package/src/ui/popover/Popover.stx +1 -1
- package/src/ui/popover/PopoverButton.stx +1 -1
- package/src/ui/popover/PopoverPanel.stx +1 -1
- package/src/ui/popover/README.md +10 -14
- package/src/ui/portal/Portal.stx +1 -1
- package/src/ui/progress/Progress.stx +1 -1
- package/src/ui/radio/Radio.stx +1 -1
- package/src/ui/radio-group/README.md +29 -35
- package/src/ui/radio-group/RadioGroup.stx +1 -1
- package/src/ui/radio-group/RadioGroupDescription.stx +1 -1
- package/src/ui/radio-group/RadioGroupLabel.stx +1 -1
- package/src/ui/radio-group/RadioGroupOption.stx +1 -1
- package/src/ui/select/README.md +49 -73
- package/src/ui/select/Select.stx +1 -1
- package/src/ui/sidebar/Sidebar.stx +1 -1
- package/src/ui/sidebar/SidebarFooter.stx +1 -1
- package/src/ui/sidebar/SidebarHeader.stx +1 -1
- package/src/ui/sidebar/SidebarItem.stx +1 -1
- package/src/ui/sidebar/SidebarSection.stx +1 -1
- package/src/ui/skeleton/Skeleton.stx +1 -1
- package/src/ui/spinner/Spinner.stx +1 -1
- package/src/ui/stepper/README.md +8 -8
- package/src/ui/stepper/Stepper.stx +1 -1
- package/src/ui/stepper/StepperStep.stx +1 -1
- package/src/ui/switch/README.md +10 -29
- package/src/ui/switch/Switch.stx +1 -1
- package/src/ui/table/README.md +17 -17
- package/src/ui/table/Table.stx +1 -1
- package/src/ui/table/TableBody.stx +1 -1
- package/src/ui/table/TableCell.stx +1 -1
- package/src/ui/table/TableHead.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 +2 -2
- package/src/ui/teleport/Teleport.stx +1 -1
- package/src/ui/textarea/Textarea.stx +1 -1
- package/src/ui/tooltip/Tooltip.stx +1 -1
- package/src/ui/transition/README.md +4 -4
- package/src/ui/transition/Transition.stx +1 -1
- package/src/ui/video/README.md +7 -8
- package/src/ui/video/Video.stx +1 -1
- package/src/ui/virtual-list/VirtualList.stx +1 -1
- package/src/ui/virtual-table/VirtualTable.stx +1 -1
package/src/ui/select/README.md
CHANGED
|
@@ -13,110 +13,87 @@ bun add @stacksjs/components
|
|
|
13
13
|
### Basic Select
|
|
14
14
|
|
|
15
15
|
```stx
|
|
16
|
-
<script>
|
|
17
|
-
|
|
16
|
+
<script server>
|
|
17
|
+
const options = [
|
|
18
18
|
{ value: 'option1', label: 'Option 1' },
|
|
19
19
|
{ value: 'option2', label: 'Option 2' },
|
|
20
20
|
{ value: 'option3', label: 'Option 3' },
|
|
21
21
|
]
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
const selected = 'option1'
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
const handleChange = (value) => {
|
|
26
26
|
console.log('Selected:', value)
|
|
27
27
|
selected = value
|
|
28
28
|
}
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
value
|
|
33
|
-
onChange
|
|
34
|
-
|
|
35
|
-
placeholder
|
|
36
|
-
|
|
37
|
-
@endcomponent
|
|
31
|
+
<Select
|
|
32
|
+
:value="selected"
|
|
33
|
+
:onChange="handleChange"
|
|
34
|
+
:options="options"
|
|
35
|
+
placeholder="Choose an option"
|
|
36
|
+
/>
|
|
38
37
|
```
|
|
39
38
|
|
|
40
39
|
### With Label and Helper Text
|
|
41
40
|
|
|
42
41
|
```stx
|
|
43
|
-
|
|
44
|
-
label
|
|
45
|
-
helperText
|
|
46
|
-
value
|
|
47
|
-
onChange
|
|
48
|
-
options
|
|
49
|
-
required
|
|
50
|
-
|
|
51
|
-
@endcomponent
|
|
42
|
+
<Select
|
|
43
|
+
label="Country"
|
|
44
|
+
helperText="Select your country of residence"
|
|
45
|
+
:value="country"
|
|
46
|
+
:onChange="(val) => country = val"
|
|
47
|
+
:options="countries"
|
|
48
|
+
required
|
|
49
|
+
/>
|
|
52
50
|
```
|
|
53
51
|
|
|
54
52
|
### With Error State
|
|
55
53
|
|
|
56
54
|
```stx
|
|
57
|
-
|
|
58
|
-
label
|
|
59
|
-
value
|
|
60
|
-
onChange
|
|
61
|
-
options
|
|
62
|
-
error
|
|
63
|
-
helperText
|
|
64
|
-
required
|
|
65
|
-
|
|
66
|
-
@endcomponent
|
|
55
|
+
<Select
|
|
56
|
+
label="Category"
|
|
57
|
+
:value="category"
|
|
58
|
+
:onChange="(val) => category = val"
|
|
59
|
+
:options="categories"
|
|
60
|
+
error
|
|
61
|
+
helperText="Please select a valid category"
|
|
62
|
+
required
|
|
63
|
+
/>
|
|
67
64
|
```
|
|
68
65
|
|
|
69
66
|
### Different Sizes
|
|
70
67
|
|
|
71
68
|
```stx
|
|
72
69
|
<!-- Small -->
|
|
73
|
-
|
|
74
|
-
size: 'sm',
|
|
75
|
-
options: options
|
|
76
|
-
})
|
|
77
|
-
@endcomponent
|
|
70
|
+
<Select size="sm" :options="options" />
|
|
78
71
|
|
|
79
72
|
<!-- Medium (default) -->
|
|
80
|
-
|
|
81
|
-
size: 'md',
|
|
82
|
-
options: options
|
|
83
|
-
})
|
|
84
|
-
@endcomponent
|
|
73
|
+
<Select size="md" :options="options" />
|
|
85
74
|
|
|
86
75
|
<!-- Large -->
|
|
87
|
-
|
|
88
|
-
size: 'lg',
|
|
89
|
-
options: options
|
|
90
|
-
})
|
|
91
|
-
@endcomponent
|
|
76
|
+
<Select size="lg" :options="options" />
|
|
92
77
|
```
|
|
93
78
|
|
|
94
79
|
### Disabled State
|
|
95
80
|
|
|
96
81
|
```stx
|
|
97
|
-
|
|
98
|
-
disabled: true,
|
|
99
|
-
value: 'locked',
|
|
100
|
-
options: options
|
|
101
|
-
})
|
|
102
|
-
@endcomponent
|
|
82
|
+
<Select disabled value="locked" :options="options" />
|
|
103
83
|
```
|
|
104
84
|
|
|
105
85
|
### With Disabled Options
|
|
106
86
|
|
|
107
87
|
```stx
|
|
108
|
-
<script>
|
|
109
|
-
|
|
88
|
+
<script server>
|
|
89
|
+
const options = [
|
|
110
90
|
{ value: '1', label: 'Available Option' },
|
|
111
91
|
{ value: '2', label: 'Disabled Option', disabled: true },
|
|
112
92
|
{ value: '3', label: 'Another Available' },
|
|
113
93
|
]
|
|
114
94
|
</script>
|
|
115
95
|
|
|
116
|
-
|
|
117
|
-
options: options
|
|
118
|
-
})
|
|
119
|
-
@endcomponent
|
|
96
|
+
<Select :options="options" />
|
|
120
97
|
```
|
|
121
98
|
|
|
122
99
|
## Props
|
|
@@ -170,8 +147,8 @@ interface SelectOption {
|
|
|
170
147
|
## Example: Form Select
|
|
171
148
|
|
|
172
149
|
```stx
|
|
173
|
-
<script>
|
|
174
|
-
|
|
150
|
+
<script server>
|
|
151
|
+
const countries = [
|
|
175
152
|
{ value: 'us', label: 'United States' },
|
|
176
153
|
{ value: 'ca', label: 'Canada' },
|
|
177
154
|
{ value: 'mx', label: 'Mexico' },
|
|
@@ -179,26 +156,25 @@ export const countries = [
|
|
|
179
156
|
{ value: 'de', label: 'Germany' },
|
|
180
157
|
]
|
|
181
158
|
|
|
182
|
-
|
|
183
|
-
|
|
159
|
+
let selectedCountry = ''
|
|
160
|
+
let hasError = false
|
|
184
161
|
|
|
185
|
-
|
|
162
|
+
const handleCountryChange = (value) => {
|
|
186
163
|
selectedCountry = value
|
|
187
164
|
hasError = !value
|
|
188
165
|
}
|
|
189
166
|
</script>
|
|
190
167
|
|
|
191
168
|
<form>
|
|
192
|
-
|
|
193
|
-
label
|
|
194
|
-
value
|
|
195
|
-
onChange
|
|
196
|
-
options
|
|
197
|
-
placeholder
|
|
198
|
-
required
|
|
199
|
-
error
|
|
200
|
-
helperText
|
|
201
|
-
|
|
202
|
-
@endcomponent
|
|
169
|
+
<Select
|
|
170
|
+
label="Country"
|
|
171
|
+
:value="selectedCountry"
|
|
172
|
+
:onChange="handleCountryChange"
|
|
173
|
+
:options="countries"
|
|
174
|
+
placeholder="Select your country"
|
|
175
|
+
required
|
|
176
|
+
:error="hasError"
|
|
177
|
+
:helperText="hasError ? 'Country is required' : 'Choose your country'"
|
|
178
|
+
/>
|
|
203
179
|
</form>
|
|
204
180
|
```
|
package/src/ui/select/Select.stx
CHANGED
package/src/ui/stepper/README.md
CHANGED
|
@@ -11,19 +11,19 @@ bun add @stacksjs/components
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```stx
|
|
14
|
-
<script>
|
|
15
|
-
|
|
14
|
+
<script server>
|
|
15
|
+
let currentStep = 0
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
function handleStepClick(step) {
|
|
18
18
|
currentStep = step
|
|
19
19
|
}
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
<Stepper :currentStep="currentStep">
|
|
23
|
+
<StepperStep :stepNumber="0" :currentStep="currentStep" label="Account" :onClick="handleStepClick" />
|
|
24
|
+
<StepperStep :stepNumber="1" :currentStep="currentStep" label="Profile" :onClick="handleStepClick" />
|
|
25
|
+
<StepperStep :stepNumber="2" :currentStep="currentStep" label="Confirmation" :onClick="handleStepClick" />
|
|
26
|
+
</Stepper>
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## Features
|
package/src/ui/switch/README.md
CHANGED
|
@@ -11,7 +11,7 @@ bun add @stacksjs/components
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```stx
|
|
14
|
-
|
|
14
|
+
<Switch checked label="Enable notifications" />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Props
|
|
@@ -30,60 +30,44 @@ bun add @stacksjs/components
|
|
|
30
30
|
### Basic Switch
|
|
31
31
|
|
|
32
32
|
```stx
|
|
33
|
-
<script>
|
|
33
|
+
<script server>
|
|
34
34
|
let enabled = false
|
|
35
35
|
|
|
36
36
|
function handleChange(checked) {
|
|
37
37
|
enabled = checked
|
|
38
38
|
console.log('Switch is now:', checked)
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
module.exports = { enabled, handleChange }
|
|
42
40
|
</script>
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
checked: enabled,
|
|
46
|
-
onChange: handleChange
|
|
47
|
-
})
|
|
42
|
+
<Switch :checked="enabled" :onChange="handleChange" />
|
|
48
43
|
```
|
|
49
44
|
|
|
50
45
|
### With Label
|
|
51
46
|
|
|
52
47
|
```stx
|
|
53
|
-
|
|
54
|
-
checked: true,
|
|
55
|
-
label: 'Enable notifications',
|
|
56
|
-
onChange: handleChange
|
|
57
|
-
})
|
|
48
|
+
<Switch checked label="Enable notifications" :onChange="handleChange" />
|
|
58
49
|
```
|
|
59
50
|
|
|
60
51
|
### Sizes
|
|
61
52
|
|
|
62
53
|
```stx
|
|
63
|
-
|
|
54
|
+
<Switch size="sm" checked />
|
|
64
55
|
|
|
65
|
-
|
|
56
|
+
<Switch size="md" checked />
|
|
66
57
|
|
|
67
|
-
|
|
58
|
+
<Switch size="lg" checked />
|
|
68
59
|
```
|
|
69
60
|
|
|
70
61
|
### Disabled State
|
|
71
62
|
|
|
72
63
|
```stx
|
|
73
|
-
|
|
74
|
-
checked: true,
|
|
75
|
-
disabled: true,
|
|
76
|
-
label: 'Cannot toggle'
|
|
77
|
-
})
|
|
64
|
+
<Switch checked disabled label="Cannot toggle" />
|
|
78
65
|
```
|
|
79
66
|
|
|
80
67
|
### Custom Styling
|
|
81
68
|
|
|
82
69
|
```stx
|
|
83
|
-
|
|
84
|
-
checked: true,
|
|
85
|
-
className: 'my-4'
|
|
86
|
-
})
|
|
70
|
+
<Switch checked className="my-4" />
|
|
87
71
|
```
|
|
88
72
|
|
|
89
73
|
## Accessibility
|
|
@@ -126,8 +110,5 @@ To customize colors, you can:
|
|
|
126
110
|
|
|
127
111
|
Example:
|
|
128
112
|
```stx
|
|
129
|
-
|
|
130
|
-
checked: true,
|
|
131
|
-
className: '!bg-green-500'
|
|
132
|
-
})
|
|
113
|
+
<Switch checked className="!bg-green-500" />
|
|
133
114
|
```
|
package/src/ui/switch/Switch.stx
CHANGED
package/src/ui/table/README.md
CHANGED
|
@@ -11,23 +11,23 @@ bun add @stacksjs/components
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```stx
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
14
|
+
<Table>
|
|
15
|
+
<TableHead>
|
|
16
|
+
<TableRow>
|
|
17
|
+
<TableHeader>Name</TableHeader>
|
|
18
|
+
<TableHeader>Email</TableHeader>
|
|
19
|
+
<TableHeader>Role</TableHeader>
|
|
20
|
+
</TableRow>
|
|
21
|
+
</TableHead>
|
|
22
|
+
|
|
23
|
+
<TableBody>
|
|
24
|
+
<TableRow>
|
|
25
|
+
<TableCell>John Doe</TableCell>
|
|
26
|
+
<TableCell>john@example.com</TableCell>
|
|
27
|
+
<TableCell>Admin</TableCell>
|
|
28
|
+
</TableRow>
|
|
29
|
+
</TableBody>
|
|
30
|
+
</Table>
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
## Features
|
package/src/ui/table/Table.stx
CHANGED
package/src/ui/tabs/Tabs.stx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
export const tabs = $props.tabs || []
|
|
3
3
|
export const defaultTab = $props.defaultTab || 0
|
|
4
4
|
export const orientation = $props.orientation || 'horizontal'
|
|
@@ -71,7 +71,7 @@ export const tabPanelClasses = `p-4 focus:outline-none`.trim()
|
|
|
71
71
|
aria-controls="tab-panel-{{ $loop.index }}"
|
|
72
72
|
id="tab-{{ $loop.index }}"
|
|
73
73
|
tabindex="{{ activeTab === $loop.index ? '0' : '-1' }}"
|
|
74
|
-
|
|
74
|
+
@click="selectTab({{ $loop.index }})"
|
|
75
75
|
onkeydown="handleKeyDown(event, {{ $loop.index }})"
|
|
76
76
|
>
|
|
77
77
|
@if(tab.icon)
|
|
@@ -11,15 +11,15 @@ bun add @stacksjs/components
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```stx
|
|
14
|
-
<script>
|
|
15
|
-
|
|
14
|
+
<script server>
|
|
15
|
+
let isOpen = true
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
<Transition :show="isOpen">
|
|
19
19
|
<div class="p-4 bg-white rounded-lg shadow-lg">
|
|
20
20
|
Content with fade transition
|
|
21
21
|
</div>
|
|
22
|
-
|
|
22
|
+
</Transition>
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Features
|
package/src/ui/video/README.md
CHANGED
|
@@ -11,14 +11,13 @@ bun add @stacksjs/components
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```stx
|
|
14
|
-
|
|
15
|
-
src
|
|
16
|
-
poster
|
|
17
|
-
title
|
|
18
|
-
aspectRatio
|
|
19
|
-
controls
|
|
20
|
-
|
|
21
|
-
@endcomponent
|
|
14
|
+
<Video
|
|
15
|
+
src="/videos/demo.mp4"
|
|
16
|
+
poster="/images/video-thumbnail.jpg"
|
|
17
|
+
title="Product Demo"
|
|
18
|
+
aspectRatio="16/9"
|
|
19
|
+
controls
|
|
20
|
+
/>
|
|
22
21
|
```
|
|
23
22
|
|
|
24
23
|
## Props
|
package/src/ui/video/Video.stx
CHANGED