@stacksjs/components 0.2.21 → 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
|
@@ -11,61 +11,57 @@ 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
|
-
|
|
22
|
-
|
|
21
|
+
let selected = people[0]
|
|
22
|
+
let query = ''
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const filtered = query === ''
|
|
25
25
|
? people
|
|
26
26
|
: people.filter(person =>
|
|
27
27
|
person.name.toLowerCase().includes(query.toLowerCase())
|
|
28
28
|
)
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
function handleChange(person) {
|
|
31
31
|
selected = person
|
|
32
32
|
query = ''
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
function handleQueryChange(value) {
|
|
36
36
|
query = value
|
|
37
37
|
}
|
|
38
38
|
</script>
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
<Combobox :value="selected" :onChange="handleChange">
|
|
41
41
|
<div class="relative mt-1">
|
|
42
|
-
|
|
43
|
-
displayValue
|
|
44
|
-
onChange
|
|
45
|
-
placeholder
|
|
46
|
-
|
|
42
|
+
<ComboboxInput
|
|
43
|
+
:displayValue="selected.name"
|
|
44
|
+
:onChange="handleQueryChange"
|
|
45
|
+
placeholder="Search people..."
|
|
46
|
+
/>
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
<ComboboxButton />
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
<ComboboxOptions>
|
|
51
51
|
@if(filtered.length === 0 && query !== '')
|
|
52
52
|
<div class="relative cursor-default select-none py-2 px-4 text-neutral-700 dark:text-neutral-300">
|
|
53
53
|
Nothing found.
|
|
54
54
|
</div>
|
|
55
55
|
@else
|
|
56
56
|
@foreach(person in filtered)
|
|
57
|
-
|
|
58
|
-
value: person,
|
|
59
|
-
currentValue: selected,
|
|
60
|
-
onChange: handleChange
|
|
61
|
-
})
|
|
57
|
+
<ComboboxOption :value="person" :currentValue="selected" :onChange="handleChange">
|
|
62
58
|
{{ person.name }}
|
|
63
|
-
|
|
59
|
+
</ComboboxOption>
|
|
64
60
|
@endforeach
|
|
65
61
|
@endif
|
|
66
|
-
|
|
62
|
+
</ComboboxOptions>
|
|
67
63
|
</div>
|
|
68
|
-
|
|
64
|
+
</Combobox>
|
|
69
65
|
```
|
|
70
66
|
|
|
71
67
|
## Props
|
|
@@ -115,30 +111,30 @@ export function handleQueryChange(value) {
|
|
|
115
111
|
### With Empty State
|
|
116
112
|
|
|
117
113
|
```stx
|
|
118
|
-
|
|
114
|
+
<ComboboxOptions>
|
|
119
115
|
@if(filtered.length === 0)
|
|
120
116
|
<div class="py-2 px-4 text-neutral-500 dark:text-neutral-400">
|
|
121
117
|
No results found for "{{ query }}"
|
|
122
118
|
</div>
|
|
123
119
|
@else
|
|
124
120
|
@foreach(item in filtered)
|
|
125
|
-
|
|
121
|
+
<ComboboxOption :value="item">
|
|
126
122
|
{{ item.name }}
|
|
127
|
-
|
|
123
|
+
</ComboboxOption>
|
|
128
124
|
@endforeach
|
|
129
125
|
@endif
|
|
130
|
-
|
|
126
|
+
</ComboboxOptions>
|
|
131
127
|
```
|
|
132
128
|
|
|
133
129
|
### With Avatars
|
|
134
130
|
|
|
135
131
|
```stx
|
|
136
|
-
|
|
132
|
+
<ComboboxOption :value="person">
|
|
137
133
|
<div class="flex items-center gap-2">
|
|
138
134
|
<img src="{{ person.avatar }}" alt="" class="h-6 w-6 rounded-full" />
|
|
139
135
|
<span>{{ person.name }}</span>
|
|
140
136
|
</div>
|
|
141
|
-
|
|
137
|
+
</ComboboxOption>
|
|
142
138
|
```
|
|
143
139
|
|
|
144
140
|
## Features
|
|
@@ -11,27 +11,27 @@ bun add @stacksjs/components
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```stx
|
|
14
|
-
<script>
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
<script server>
|
|
15
|
+
let open = false
|
|
16
|
+
let query = ''
|
|
17
17
|
|
|
18
18
|
const commands = [
|
|
19
19
|
{ name: 'Create new file', action: () => console.log('create') },
|
|
20
20
|
{ name: 'Open settings', action: () => console.log('settings') }
|
|
21
21
|
]
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
const filtered = query === ''
|
|
24
24
|
? commands
|
|
25
25
|
: commands.filter(cmd => cmd.name.toLowerCase().includes(query.toLowerCase()))
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
<CommandPalette :open="open" :onClose="() => open = false" :query="query" :onQueryChange="(q) => query = q">
|
|
29
29
|
@foreach(command in filtered)
|
|
30
|
-
|
|
30
|
+
<CommandPaletteItem :onClick="command.action">
|
|
31
31
|
{{ command.name }}
|
|
32
|
-
|
|
32
|
+
</CommandPaletteItem>
|
|
33
33
|
@endforeach
|
|
34
|
-
|
|
34
|
+
</CommandPalette>
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
## Features
|
package/src/ui/dialog/Dialog.stx
CHANGED
package/src/ui/dialog/README.md
CHANGED
|
@@ -11,37 +11,33 @@ bun add @stacksjs/components
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```stx
|
|
14
|
-
<script>
|
|
15
|
-
|
|
14
|
+
<script server>
|
|
15
|
+
let isOpen = false
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
function closeModal() {
|
|
18
18
|
isOpen = false
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
function openModal() {
|
|
22
22
|
isOpen = true
|
|
23
23
|
}
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
<Dialog :open="isOpen" :onClose="closeModal">
|
|
27
|
+
<DialogBackdrop />
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Payment successful
|
|
32
|
-
@endcomponent
|
|
29
|
+
<DialogPanel className="max-w-md">
|
|
30
|
+
<DialogTitle>Payment successful</DialogTitle>
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
<DialogDescription>
|
|
35
33
|
Your payment has been successfully submitted.
|
|
36
|
-
|
|
34
|
+
</DialogDescription>
|
|
37
35
|
|
|
38
36
|
<div class="mt-4">
|
|
39
|
-
|
|
40
|
-
Got it, thanks!
|
|
41
|
-
@endcomponent
|
|
37
|
+
<Button :onClick="closeModal">Got it, thanks!</Button>
|
|
42
38
|
</div>
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
</DialogPanel>
|
|
40
|
+
</Dialog>
|
|
45
41
|
```
|
|
46
42
|
|
|
47
43
|
## Props
|
|
@@ -83,42 +79,34 @@ export function openModal() {
|
|
|
83
79
|
### Confirmation Dialog
|
|
84
80
|
|
|
85
81
|
```stx
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
<Dialog :open="isOpen" :onClose="closeModal">
|
|
83
|
+
<DialogBackdrop />
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Delete account
|
|
92
|
-
@endcomponent
|
|
85
|
+
<DialogPanel className="max-w-md">
|
|
86
|
+
<DialogTitle>Delete account</DialogTitle>
|
|
93
87
|
|
|
94
|
-
|
|
88
|
+
<DialogDescription>
|
|
95
89
|
Are you sure you want to delete your account? This action cannot be undone.
|
|
96
|
-
|
|
90
|
+
</DialogDescription>
|
|
97
91
|
|
|
98
92
|
<div class="mt-4 flex gap-2">
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
@endcomponent
|
|
102
|
-
@component('Button', { variant: 'secondary', onClick: closeModal })
|
|
103
|
-
Cancel
|
|
104
|
-
@endcomponent
|
|
93
|
+
<Button variant="danger" :onClick="handleDelete">Delete</Button>
|
|
94
|
+
<Button variant="secondary" :onClick="closeModal">Cancel</Button>
|
|
105
95
|
</div>
|
|
106
|
-
|
|
107
|
-
|
|
96
|
+
</DialogPanel>
|
|
97
|
+
</Dialog>
|
|
108
98
|
```
|
|
109
99
|
|
|
110
100
|
### Large Dialog
|
|
111
101
|
|
|
112
102
|
```stx
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
Terms and Conditions
|
|
116
|
-
@endcomponent
|
|
103
|
+
<DialogPanel className="max-w-4xl">
|
|
104
|
+
<DialogTitle>Terms and Conditions</DialogTitle>
|
|
117
105
|
|
|
118
106
|
<div class="mt-4 max-h-96 overflow-y-auto">
|
|
119
107
|
<!-- Long content -->
|
|
120
108
|
</div>
|
|
121
|
-
|
|
109
|
+
</DialogPanel>
|
|
122
110
|
```
|
|
123
111
|
|
|
124
112
|
## Features
|
package/src/ui/drawer/Drawer.stx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
export const open = $props.open ?? false
|
|
3
3
|
export const onClose = $props.onClose || (() => {})
|
|
4
4
|
export const position = $props.position || 'right'
|
|
@@ -60,7 +60,7 @@ export const closeButtonClasses = `absolute top-0 ${closeButtonPosition[position
|
|
|
60
60
|
<div
|
|
61
61
|
class="fixed inset-0 z-50 bg-gray-500/75 dark:bg-gray-900/75 transition-opacity duration-500"
|
|
62
62
|
style="animation: fadeIn 0.5s ease-in-out"
|
|
63
|
-
|
|
63
|
+
@click="handleBackdropClick()"
|
|
64
64
|
></div>
|
|
65
65
|
|
|
66
66
|
<!-- Drawer Container -->
|
|
@@ -77,7 +77,7 @@ export const closeButtonClasses = `absolute top-0 ${closeButtonPosition[position
|
|
|
77
77
|
<button
|
|
78
78
|
type="button"
|
|
79
79
|
class="relative rounded-md text-gray-300 dark:text-gray-400 hover:text-white dark:hover:text-white focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
|
|
80
|
-
|
|
80
|
+
@click="handleClose()"
|
|
81
81
|
>
|
|
82
82
|
<span class="absolute -inset-2.5"></span>
|
|
83
83
|
<span class="sr-only">Close panel</span>
|
package/src/ui/drawer/README.md
CHANGED
|
@@ -11,8 +11,8 @@ bun add @stacksjs/components
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```stx
|
|
14
|
-
<script>
|
|
15
|
-
|
|
14
|
+
<script server>
|
|
15
|
+
let drawerOpen = false
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<button
|
|
@@ -22,16 +22,16 @@ export let drawerOpen = false
|
|
|
22
22
|
Open drawer
|
|
23
23
|
</button>
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
open
|
|
27
|
-
onClose
|
|
28
|
-
position
|
|
29
|
-
title
|
|
30
|
-
|
|
25
|
+
<Drawer
|
|
26
|
+
:open="drawerOpen"
|
|
27
|
+
:onClose="() => drawerOpen = false"
|
|
28
|
+
position="right"
|
|
29
|
+
title="Panel title"
|
|
30
|
+
>
|
|
31
31
|
<p class="text-sm text-gray-500 dark:text-gray-400">
|
|
32
32
|
Your drawer content goes here.
|
|
33
33
|
</p>
|
|
34
|
-
|
|
34
|
+
</Drawer>
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
## Props
|
|
@@ -48,42 +48,22 @@ export let drawerOpen = false
|
|
|
48
48
|
|
|
49
49
|
### Right (default)
|
|
50
50
|
```stx
|
|
51
|
-
|
|
52
|
-
open: true,
|
|
53
|
-
position: 'right'
|
|
54
|
-
})
|
|
55
|
-
Content
|
|
56
|
-
@endcomponent
|
|
51
|
+
<Drawer open position="right">Content</Drawer>
|
|
57
52
|
```
|
|
58
53
|
|
|
59
54
|
### Left
|
|
60
55
|
```stx
|
|
61
|
-
|
|
62
|
-
open: true,
|
|
63
|
-
position: 'left'
|
|
64
|
-
})
|
|
65
|
-
Content
|
|
66
|
-
@endcomponent
|
|
56
|
+
<Drawer open position="left">Content</Drawer>
|
|
67
57
|
```
|
|
68
58
|
|
|
69
59
|
### Top
|
|
70
60
|
```stx
|
|
71
|
-
|
|
72
|
-
open: true,
|
|
73
|
-
position: 'top'
|
|
74
|
-
})
|
|
75
|
-
Content
|
|
76
|
-
@endcomponent
|
|
61
|
+
<Drawer open position="top">Content</Drawer>
|
|
77
62
|
```
|
|
78
63
|
|
|
79
64
|
### Bottom
|
|
80
65
|
```stx
|
|
81
|
-
|
|
82
|
-
open: true,
|
|
83
|
-
position: 'bottom'
|
|
84
|
-
})
|
|
85
|
-
Content
|
|
86
|
-
@endcomponent
|
|
66
|
+
<Drawer open position="bottom">Content</Drawer>
|
|
87
67
|
```
|
|
88
68
|
|
|
89
69
|
## Features
|
|
@@ -11,20 +11,14 @@ bun add @stacksjs/components
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```stx
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
@endcomponent
|
|
23
|
-
@component('DropdownItem')
|
|
24
|
-
Delete
|
|
25
|
-
@endcomponent
|
|
26
|
-
@endcomponent
|
|
27
|
-
@endcomponent
|
|
14
|
+
<Dropdown>
|
|
15
|
+
<DropdownButton className="btn-primary">Options</DropdownButton>
|
|
16
|
+
|
|
17
|
+
<DropdownItems>
|
|
18
|
+
<DropdownItem>Edit</DropdownItem>
|
|
19
|
+
<DropdownItem>Delete</DropdownItem>
|
|
20
|
+
</DropdownItems>
|
|
21
|
+
</Dropdown>
|
|
28
22
|
```
|
|
29
23
|
|
|
30
24
|
## Props
|
|
@@ -63,71 +57,49 @@ bun add @stacksjs/components
|
|
|
63
57
|
### Basic Dropdown
|
|
64
58
|
|
|
65
59
|
```stx
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
className: 'px-4 py-2 bg-blue-500 text-white rounded-md'
|
|
69
|
-
})
|
|
60
|
+
<Dropdown>
|
|
61
|
+
<DropdownButton className="px-4 py-2 bg-blue-500 text-white rounded-md">
|
|
70
62
|
Actions
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
Duplicate
|
|
81
|
-
@endcomponent
|
|
82
|
-
@component('DropdownItem', { disabled: true })
|
|
83
|
-
Archive (coming soon)
|
|
84
|
-
@endcomponent
|
|
85
|
-
@component('DropdownItem')
|
|
86
|
-
Delete
|
|
87
|
-
@endcomponent
|
|
88
|
-
@endcomponent
|
|
89
|
-
@endcomponent
|
|
63
|
+
</DropdownButton>
|
|
64
|
+
|
|
65
|
+
<DropdownItems className="w-56">
|
|
66
|
+
<DropdownItem>Edit</DropdownItem>
|
|
67
|
+
<DropdownItem>Duplicate</DropdownItem>
|
|
68
|
+
<DropdownItem disabled>Archive (coming soon)</DropdownItem>
|
|
69
|
+
<DropdownItem>Delete</DropdownItem>
|
|
70
|
+
</DropdownItems>
|
|
71
|
+
</Dropdown>
|
|
90
72
|
```
|
|
91
73
|
|
|
92
74
|
### With Icons
|
|
93
75
|
|
|
94
76
|
```stx
|
|
95
|
-
|
|
77
|
+
<DropdownItem>
|
|
96
78
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
97
79
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" />
|
|
98
80
|
</svg>
|
|
99
81
|
Edit
|
|
100
|
-
|
|
82
|
+
</DropdownItem>
|
|
101
83
|
```
|
|
102
84
|
|
|
103
85
|
### Grouped Items
|
|
104
86
|
|
|
105
87
|
```stx
|
|
106
|
-
|
|
88
|
+
<DropdownItems>
|
|
107
89
|
<div class="px-1 py-1">
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
@endcomponent
|
|
111
|
-
@component('DropdownItem')
|
|
112
|
-
Duplicate
|
|
113
|
-
@endcomponent
|
|
90
|
+
<DropdownItem>Edit</DropdownItem>
|
|
91
|
+
<DropdownItem>Duplicate</DropdownItem>
|
|
114
92
|
</div>
|
|
115
93
|
|
|
116
94
|
<div class="px-1 py-1">
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
@endcomponent
|
|
120
|
-
@component('DropdownItem')
|
|
121
|
-
Move
|
|
122
|
-
@endcomponent
|
|
95
|
+
<DropdownItem>Archive</DropdownItem>
|
|
96
|
+
<DropdownItem>Move</DropdownItem>
|
|
123
97
|
</div>
|
|
124
98
|
|
|
125
99
|
<div class="px-1 py-1">
|
|
126
|
-
|
|
127
|
-
Delete
|
|
128
|
-
@endcomponent
|
|
100
|
+
<DropdownItem>Delete</DropdownItem>
|
|
129
101
|
</div>
|
|
130
|
-
|
|
102
|
+
</DropdownItems>
|
|
131
103
|
```
|
|
132
104
|
|
|
133
105
|
## Features
|
package/src/ui/form/Form.stx
CHANGED
package/src/ui/image/Image.stx
CHANGED