@stacksjs/components 0.2.20 → 0.2.24
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/image/README.md
CHANGED
|
@@ -13,79 +13,73 @@ bun add @stacksjs/components
|
|
|
13
13
|
### Basic Image
|
|
14
14
|
|
|
15
15
|
```stx
|
|
16
|
-
|
|
17
|
-
src
|
|
18
|
-
alt
|
|
19
|
-
width
|
|
20
|
-
height
|
|
21
|
-
|
|
22
|
-
@endcomponent
|
|
16
|
+
<Image
|
|
17
|
+
src="/path/to/image.jpg"
|
|
18
|
+
alt="Description of image"
|
|
19
|
+
:width="400"
|
|
20
|
+
:height="300"
|
|
21
|
+
/>
|
|
23
22
|
```
|
|
24
23
|
|
|
25
24
|
### Lazy Loading (default)
|
|
26
25
|
|
|
27
26
|
```stx
|
|
28
|
-
|
|
29
|
-
src
|
|
30
|
-
alt
|
|
31
|
-
lazy
|
|
32
|
-
placeholder
|
|
33
|
-
|
|
34
|
-
@endcomponent
|
|
27
|
+
<Image
|
|
28
|
+
src="/large-image.jpg"
|
|
29
|
+
alt="Large image"
|
|
30
|
+
lazy
|
|
31
|
+
placeholder="/thumbnail.jpg"
|
|
32
|
+
/>
|
|
35
33
|
```
|
|
36
34
|
|
|
37
35
|
### Aspect Ratio
|
|
38
36
|
|
|
39
37
|
```stx
|
|
40
|
-
|
|
41
|
-
src
|
|
42
|
-
alt
|
|
43
|
-
aspectRatio
|
|
44
|
-
objectFit
|
|
45
|
-
|
|
46
|
-
@endcomponent
|
|
38
|
+
<Image
|
|
39
|
+
src="/hero.jpg"
|
|
40
|
+
alt="Hero image"
|
|
41
|
+
:aspectRatio="16/9"
|
|
42
|
+
objectFit="cover"
|
|
43
|
+
/>
|
|
47
44
|
```
|
|
48
45
|
|
|
49
46
|
### Rounded Images
|
|
50
47
|
|
|
51
48
|
```stx
|
|
52
49
|
<!-- Rounded corners -->
|
|
53
|
-
|
|
54
|
-
src
|
|
55
|
-
alt
|
|
56
|
-
rounded
|
|
57
|
-
|
|
58
|
-
@endcomponent
|
|
50
|
+
<Image
|
|
51
|
+
src="/avatar.jpg"
|
|
52
|
+
alt="Avatar"
|
|
53
|
+
rounded
|
|
54
|
+
/>
|
|
59
55
|
|
|
60
56
|
<!-- Circular -->
|
|
61
|
-
|
|
62
|
-
src
|
|
63
|
-
alt
|
|
64
|
-
rounded
|
|
65
|
-
|
|
66
|
-
@endcomponent
|
|
57
|
+
<Image
|
|
58
|
+
src="/profile.jpg"
|
|
59
|
+
alt="Profile"
|
|
60
|
+
rounded="full"
|
|
61
|
+
/>
|
|
67
62
|
```
|
|
68
63
|
|
|
69
64
|
### With Callbacks
|
|
70
65
|
|
|
71
66
|
```stx
|
|
72
|
-
<script>
|
|
73
|
-
|
|
67
|
+
<script server>
|
|
68
|
+
const handleLoad = () => {
|
|
74
69
|
console.log('Image loaded!')
|
|
75
70
|
}
|
|
76
71
|
|
|
77
|
-
|
|
72
|
+
const handleError = () => {
|
|
78
73
|
console.error('Failed to load image')
|
|
79
74
|
}
|
|
80
75
|
</script>
|
|
81
76
|
|
|
82
|
-
|
|
83
|
-
src
|
|
84
|
-
alt
|
|
85
|
-
onLoad
|
|
86
|
-
onError
|
|
87
|
-
|
|
88
|
-
@endcomponent
|
|
77
|
+
<Image
|
|
78
|
+
src="/photo.jpg"
|
|
79
|
+
alt="Photo"
|
|
80
|
+
:onLoad="handleLoad"
|
|
81
|
+
:onError="handleError"
|
|
82
|
+
/>
|
|
89
83
|
```
|
|
90
84
|
|
|
91
85
|
## Props
|
|
@@ -157,15 +151,14 @@ export const handleError = () => {
|
|
|
157
151
|
```stx
|
|
158
152
|
<div class="grid grid-cols-3 gap-4">
|
|
159
153
|
@foreach(image in images)
|
|
160
|
-
|
|
161
|
-
src
|
|
162
|
-
alt
|
|
163
|
-
aspectRatio
|
|
164
|
-
objectFit
|
|
165
|
-
rounded
|
|
166
|
-
lazy
|
|
167
|
-
|
|
168
|
-
@endcomponent
|
|
154
|
+
<Image
|
|
155
|
+
:src="image.url"
|
|
156
|
+
:alt="image.description"
|
|
157
|
+
:aspectRatio="1"
|
|
158
|
+
objectFit="cover"
|
|
159
|
+
rounded
|
|
160
|
+
lazy
|
|
161
|
+
/>
|
|
169
162
|
@endforeach
|
|
170
163
|
</div>
|
|
171
164
|
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
export const value = $props.value || ''
|
|
3
3
|
export const onChange = $props.onChange || (() => {})
|
|
4
4
|
export const placeholder = $props.placeholder || '0'
|
|
@@ -76,7 +76,7 @@ export const helperClasses = `mt-2 text-sm ${error ? 'text-red-600 dark:text-red
|
|
|
76
76
|
<div class="absolute inset-y-0 right-0 flex flex-col">
|
|
77
77
|
<button
|
|
78
78
|
type="button"
|
|
79
|
-
|
|
79
|
+
@click="handleIncrement()"
|
|
80
80
|
class="flex items-center justify-center w-8 h-1/2 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 focus:outline-none border-b border-gray-300 dark:border-gray-600"
|
|
81
81
|
aria-label="Increment"
|
|
82
82
|
>
|
|
@@ -86,7 +86,7 @@ export const helperClasses = `mt-2 text-sm ${error ? 'text-red-600 dark:text-red
|
|
|
86
86
|
</button>
|
|
87
87
|
<button
|
|
88
88
|
type="button"
|
|
89
|
-
|
|
89
|
+
@click="handleDecrement()"
|
|
90
90
|
class="flex items-center justify-center w-8 h-1/2 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 focus:outline-none"
|
|
91
91
|
aria-label="Decrement"
|
|
92
92
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
export const value = $props.value || ''
|
|
3
3
|
export const onChange = $props.onChange || (() => {})
|
|
4
4
|
export const placeholder = $props.placeholder || 'Enter your password'
|
|
@@ -94,7 +94,7 @@ export const strengthText = strength < 40 ? 'Weak' : strength < 70 ? 'Medium' :
|
|
|
94
94
|
<div class="absolute inset-y-0 right-0 flex items-center pr-3">
|
|
95
95
|
<button
|
|
96
96
|
type="button"
|
|
97
|
-
|
|
97
|
+
@click="toggleVisibility()"
|
|
98
98
|
class="text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 focus:outline-none"
|
|
99
99
|
aria-label="{{ showPassword ? 'Hide password' : 'Show password' }}"
|
|
100
100
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
export const value = $props.value || ''
|
|
3
3
|
export const onChange = $props.onChange || (() => {})
|
|
4
4
|
export const placeholder = $props.placeholder || ''
|
|
@@ -91,7 +91,7 @@ export const hasValue = value && value.length > 0
|
|
|
91
91
|
<div class="absolute inset-y-0 right-0 flex items-center pr-3">
|
|
92
92
|
<button
|
|
93
93
|
type="button"
|
|
94
|
-
|
|
94
|
+
@click="handleClear()"
|
|
95
95
|
class="text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 focus:outline-none"
|
|
96
96
|
aria-label="Clear input"
|
|
97
97
|
>
|
package/src/ui/listbox/README.md
CHANGED
|
@@ -11,41 +11,33 @@ bun add @stacksjs/components
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```stx
|
|
14
|
-
<script>
|
|
15
|
-
|
|
14
|
+
<script server>
|
|
15
|
+
const people = [
|
|
16
16
|
{ id: 1, name: 'Wade Cooper' },
|
|
17
17
|
{ id: 2, name: 'Arlene Mccoy' },
|
|
18
18
|
{ id: 3, name: 'Devon Webb' }
|
|
19
19
|
]
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
let selected = people[0]
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
function handleChange(person) {
|
|
24
24
|
selected = person
|
|
25
25
|
}
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Assign to
|
|
31
|
-
@endcomponent
|
|
28
|
+
<Listbox :value="selected" :onChange="handleChange">
|
|
29
|
+
<ListboxLabel>Assign to</ListboxLabel>
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
{{ selected.name }}
|
|
35
|
-
@endcomponent
|
|
31
|
+
<ListboxButton>{{ selected.name }}</ListboxButton>
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
<ListboxOptions>
|
|
38
34
|
@foreach(person in people)
|
|
39
|
-
|
|
40
|
-
value: person,
|
|
41
|
-
currentValue: selected,
|
|
42
|
-
onChange: handleChange
|
|
43
|
-
})
|
|
35
|
+
<ListboxOption :value="person" :currentValue="selected" :onChange="handleChange">
|
|
44
36
|
{{ person.name }}
|
|
45
|
-
|
|
37
|
+
</ListboxOption>
|
|
46
38
|
@endforeach
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
</ListboxOptions>
|
|
40
|
+
</Listbox>
|
|
49
41
|
```
|
|
50
42
|
|
|
51
43
|
## Props
|
|
@@ -94,10 +86,10 @@ export function handleChange(person) {
|
|
|
94
86
|
### Multiple Selection
|
|
95
87
|
|
|
96
88
|
```stx
|
|
97
|
-
<script>
|
|
98
|
-
|
|
89
|
+
<script server>
|
|
90
|
+
let selectedPeople = [people[0], people[1]]
|
|
99
91
|
|
|
100
|
-
|
|
92
|
+
function handleChange(person) {
|
|
101
93
|
if (selectedPeople.includes(person)) {
|
|
102
94
|
selectedPeople = selectedPeople.filter(p => p !== person)
|
|
103
95
|
} else {
|
|
@@ -106,28 +98,28 @@ export function handleChange(person) {
|
|
|
106
98
|
}
|
|
107
99
|
</script>
|
|
108
100
|
|
|
109
|
-
|
|
101
|
+
<Listbox :value="selectedPeople" :onChange="handleChange" multiple>
|
|
110
102
|
<!-- ... -->
|
|
111
|
-
|
|
103
|
+
</Listbox>
|
|
112
104
|
```
|
|
113
105
|
|
|
114
106
|
### With Avatars
|
|
115
107
|
|
|
116
108
|
```stx
|
|
117
|
-
|
|
109
|
+
<ListboxOption :value="person">
|
|
118
110
|
<div class="flex items-center">
|
|
119
111
|
<img src="{{ person.avatar }}" alt="" class="h-6 w-6 rounded-full mr-2" />
|
|
120
112
|
{{ person.name }}
|
|
121
113
|
</div>
|
|
122
|
-
|
|
114
|
+
</ListboxOption>
|
|
123
115
|
```
|
|
124
116
|
|
|
125
117
|
### Disabled Option
|
|
126
118
|
|
|
127
119
|
```stx
|
|
128
|
-
|
|
120
|
+
<ListboxOption :value="person" disabled>
|
|
129
121
|
{{ person.name }} (unavailable)
|
|
130
|
-
|
|
122
|
+
</ListboxOption>
|
|
131
123
|
```
|
|
132
124
|
|
|
133
125
|
## Features
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
// Navigator Component Props
|
|
3
3
|
export const items = $props.items || []
|
|
4
4
|
export const active = $props.active || ''
|
|
@@ -94,7 +94,7 @@ function handleClick(item, event) {
|
|
|
94
94
|
<a
|
|
95
95
|
href="{{ item.href }}"
|
|
96
96
|
class="{{ getItemClasses(item) }}"
|
|
97
|
-
|
|
97
|
+
@click="handleClick(item, event)"
|
|
98
98
|
@if(isActive(item))
|
|
99
99
|
aria-current="page"
|
|
100
100
|
@endif
|
|
@@ -117,7 +117,7 @@ function handleClick(item, event) {
|
|
|
117
117
|
<button
|
|
118
118
|
type="button"
|
|
119
119
|
class="{{ getItemClasses(item) }}"
|
|
120
|
-
|
|
120
|
+
@click="handleClick(item, event)"
|
|
121
121
|
@if(item.disabled)
|
|
122
122
|
disabled
|
|
123
123
|
aria-disabled="true"
|
|
@@ -11,21 +11,21 @@ bun add @stacksjs/components
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```stx
|
|
14
|
-
<script>
|
|
15
|
-
|
|
14
|
+
<script server>
|
|
15
|
+
let showNotification = true
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
function closeNotification() {
|
|
18
18
|
showNotification = false
|
|
19
19
|
}
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
show
|
|
24
|
-
title
|
|
25
|
-
message
|
|
26
|
-
type
|
|
27
|
-
onClose
|
|
28
|
-
|
|
22
|
+
<Notification
|
|
23
|
+
:show="showNotification"
|
|
24
|
+
title="Success!"
|
|
25
|
+
message="Your changes have been saved."
|
|
26
|
+
type="success"
|
|
27
|
+
:onClose="closeNotification"
|
|
28
|
+
/>
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Props
|
|
@@ -46,37 +46,37 @@ export function closeNotification() {
|
|
|
46
46
|
### Types
|
|
47
47
|
|
|
48
48
|
```stx
|
|
49
|
-
|
|
49
|
+
<Notification type="info" title="Information" message="This is an info message" />
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
<Notification type="success" title="Success" message="Operation completed" />
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
<Notification type="warning" title="Warning" message="Please be careful" />
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
<Notification type="error" title="Error" message="Something went wrong" />
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
### Positions
|
|
59
59
|
|
|
60
60
|
```stx
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
<Notification position="top-left" title="Top Left" />
|
|
62
|
+
<Notification position="top-center" title="Top Center" />
|
|
63
|
+
<Notification position="bottom-right" title="Bottom Right" />
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
### No Auto-Hide
|
|
67
67
|
|
|
68
68
|
```stx
|
|
69
|
-
|
|
70
|
-
duration
|
|
71
|
-
title
|
|
72
|
-
message
|
|
73
|
-
|
|
69
|
+
<Notification
|
|
70
|
+
:duration="0"
|
|
71
|
+
title="Important"
|
|
72
|
+
message="This will not auto-hide"
|
|
73
|
+
/>
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
### Custom Content
|
|
77
77
|
|
|
78
78
|
```stx
|
|
79
|
-
|
|
79
|
+
<Notification type="info">
|
|
80
80
|
<div class="flex items-start gap-3">
|
|
81
81
|
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
82
82
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
@@ -86,23 +86,19 @@ export function closeNotification() {
|
|
|
86
86
|
<p class="mt-1 text-sm">With custom content and layout</p>
|
|
87
87
|
</div>
|
|
88
88
|
</div>
|
|
89
|
-
|
|
89
|
+
</Notification>
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
### With Actions
|
|
93
93
|
|
|
94
94
|
```stx
|
|
95
|
-
|
|
95
|
+
<Notification type="info" title="New message">
|
|
96
96
|
<p>You have a new message from John</p>
|
|
97
97
|
<div class="mt-3 flex gap-2">
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
@endcomponent
|
|
101
|
-
@component('Button', { size: 'sm', variant: 'ghost' })
|
|
102
|
-
Dismiss
|
|
103
|
-
@endcomponent
|
|
98
|
+
<Button size="sm" variant="primary">View</Button>
|
|
99
|
+
<Button size="sm" variant="ghost">Dismiss</Button>
|
|
104
100
|
</div>
|
|
105
|
-
|
|
101
|
+
</Notification>
|
|
106
102
|
```
|
|
107
103
|
|
|
108
104
|
## Features
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
export const currentPage = $props.currentPage || 1
|
|
3
3
|
export const totalPages = $props.totalPages || 1
|
|
4
4
|
export const siblingCount = $props.siblingCount || 1
|
|
@@ -94,7 +94,7 @@ export const iconClasses = `w-5 h-5`.trim()
|
|
|
94
94
|
@if(showFirstLast)
|
|
95
95
|
<button
|
|
96
96
|
type="button"
|
|
97
|
-
|
|
97
|
+
@click="goToFirst()"
|
|
98
98
|
class="{{ buttonClasses }}"
|
|
99
99
|
aria-label="Go to first page"
|
|
100
100
|
disabled="{{ currentPage === 1 }}"
|
|
@@ -109,7 +109,7 @@ export const iconClasses = `w-5 h-5`.trim()
|
|
|
109
109
|
@if(showPrevNext)
|
|
110
110
|
<button
|
|
111
111
|
type="button"
|
|
112
|
-
|
|
112
|
+
@click="goToPrevious()"
|
|
113
113
|
class="{{ buttonClasses }}"
|
|
114
114
|
aria-label="Go to previous page"
|
|
115
115
|
disabled="{{ currentPage === 1 }}"
|
|
@@ -141,7 +141,7 @@ export const iconClasses = `w-5 h-5`.trim()
|
|
|
141
141
|
<!-- Other pages -->
|
|
142
142
|
<button
|
|
143
143
|
type="button"
|
|
144
|
-
|
|
144
|
+
@click="goToPage({{ page }})"
|
|
145
145
|
class="{{ buttonClasses }}"
|
|
146
146
|
aria-label="Go to page {{ page }}"
|
|
147
147
|
>
|
|
@@ -155,7 +155,7 @@ export const iconClasses = `w-5 h-5`.trim()
|
|
|
155
155
|
@if(showPrevNext)
|
|
156
156
|
<button
|
|
157
157
|
type="button"
|
|
158
|
-
|
|
158
|
+
@click="goToNext()"
|
|
159
159
|
class="{{ buttonClasses }}"
|
|
160
160
|
aria-label="Go to next page"
|
|
161
161
|
disabled="{{ currentPage === totalPages }}"
|
|
@@ -170,7 +170,7 @@ export const iconClasses = `w-5 h-5`.trim()
|
|
|
170
170
|
@if(showFirstLast)
|
|
171
171
|
<button
|
|
172
172
|
type="button"
|
|
173
|
-
|
|
173
|
+
@click="goToLast()"
|
|
174
174
|
class="{{ buttonClasses }}"
|
|
175
175
|
aria-label="Go to last page"
|
|
176
176
|
disabled="{{ currentPage === totalPages }}"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
export const paymentMethods = $props.paymentMethods || []
|
|
3
3
|
export const onDeletePaymentMethod = $props.onDeletePaymentMethod
|
|
4
4
|
export const onMakeDefault = $props.onMakeDefault
|
|
@@ -53,7 +53,7 @@ export const containerClasses = `mt-4 ${className}`.trim()
|
|
|
53
53
|
<button
|
|
54
54
|
type="button"
|
|
55
55
|
class="border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-blue-gray-700 px-2 py-1 text-sm text-gray-700 dark:text-gray-300 font-semibold shadow-sm hover:bg-gray-50 dark:hover:bg-blue-gray-600 focus-visible:outline-2 focus-visible:outline-blue-600 focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
56
|
-
|
|
56
|
+
@click="handleMakeDefault('{{ method.id }}')"
|
|
57
57
|
title="Make default"
|
|
58
58
|
>
|
|
59
59
|
<svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
@@ -67,7 +67,7 @@ export const containerClasses = `mt-4 ${className}`.trim()
|
|
|
67
67
|
<button
|
|
68
68
|
type="button"
|
|
69
69
|
class="border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-blue-gray-700 px-2 py-1 text-sm text-red-600 dark:text-red-400 font-semibold shadow-sm hover:bg-red-50 dark:hover:bg-red-900/20 focus-visible:outline-2 focus-visible:outline-red-600 focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
70
|
-
|
|
70
|
+
@click="handleDelete('{{ method.id }}')"
|
|
71
71
|
title="Delete payment method"
|
|
72
72
|
>
|
|
73
73
|
<svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|