@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/dist/utils/i18n.d.ts
CHANGED
|
@@ -69,6 +69,29 @@ export declare function d(date: Date | number, format?: string): string;
|
|
|
69
69
|
* @returns Formatted number string
|
|
70
70
|
*/
|
|
71
71
|
export declare function n(value: number, format?: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* RTL (Right-to-Left) language detection
|
|
74
|
+
*
|
|
75
|
+
* @param locale - Locale code
|
|
76
|
+
* @returns Whether locale is RTL
|
|
77
|
+
*/
|
|
78
|
+
export declare function isRTL(locale: string): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Load locale messages dynamically
|
|
81
|
+
*
|
|
82
|
+
* @param locale - Locale code
|
|
83
|
+
* @param loadFn - Function to load messages
|
|
84
|
+
* @returns Promise of messages
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* const messages = await loadLocaleMessages('es', async () => {
|
|
89
|
+
* const module = await import('./locales/es.json')
|
|
90
|
+
* return module.default
|
|
91
|
+
* })
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
export declare function loadLocaleMessages(locale: string, loadFn: () => Promise<Messages>): Promise<Messages>;
|
|
72
95
|
/**
|
|
73
96
|
* Predefined pluralization rules for common languages
|
|
74
97
|
*/
|
|
@@ -83,17 +106,16 @@ export declare const pluralRules: {
|
|
|
83
106
|
pl: (count) => unknown;
|
|
84
107
|
cs: (count) => unknown;
|
|
85
108
|
ar: (count) => unknown;
|
|
86
|
-
ja: () =>
|
|
87
|
-
ko: () =>
|
|
88
|
-
zh: () =>
|
|
89
|
-
th: () =>
|
|
90
|
-
vi: () =>
|
|
91
|
-
|
|
92
|
-
|
|
109
|
+
ja: () => 0;
|
|
110
|
+
ko: () => 0;
|
|
111
|
+
zh: () => 0;
|
|
112
|
+
th: () => 0;
|
|
113
|
+
vi: () => 0
|
|
114
|
+
};
|
|
93
115
|
/**
|
|
94
116
|
* Common date/time format presets
|
|
95
117
|
*/
|
|
96
|
-
export const dateTimeFormats:
|
|
118
|
+
export declare const dateTimeFormats: {
|
|
97
119
|
short: {
|
|
98
120
|
year: 'numeric';
|
|
99
121
|
month: 'numeric';
|
|
@@ -120,13 +142,12 @@ export const dateTimeFormats: Record<string, Intl.DateTimeFormatOptions> = {
|
|
|
120
142
|
day: 'numeric';
|
|
121
143
|
hour: 'numeric';
|
|
122
144
|
minute: 'numeric'
|
|
145
|
+
}
|
|
123
146
|
};
|
|
124
|
-
}
|
|
125
|
-
|
|
126
147
|
/**
|
|
127
148
|
* Common number format presets
|
|
128
149
|
*/
|
|
129
|
-
export const numberFormats:
|
|
150
|
+
export declare const numberFormats: {
|
|
130
151
|
decimal: {
|
|
131
152
|
style: 'decimal';
|
|
132
153
|
minimumFractionDigits: 2;
|
|
@@ -143,85 +164,14 @@ export const numberFormats: Record<string, Intl.NumberFormatOptions> = {
|
|
|
143
164
|
};
|
|
144
165
|
compact: {
|
|
145
166
|
notation: 'compact'
|
|
167
|
+
}
|
|
146
168
|
};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
169
|
/**
|
|
150
|
-
*
|
|
170
|
+
* Component-specific i18n messages
|
|
151
171
|
*
|
|
152
|
-
*
|
|
153
|
-
* @returns Whether locale is RTL
|
|
172
|
+
* Provides default translations for component library
|
|
154
173
|
*/
|
|
155
|
-
export
|
|
156
|
-
loadFn: () => unknown;
|
|
157
|
-
): Promise<Messages> {
|
|
158
|
-
try {
|
|
159
|
-
return await loadFn()
|
|
160
|
-
}
|
|
161
|
-
catch: (error) => unknown;
|
|
162
|
-
es: {
|
|
163
|
-
common: {
|
|
164
|
-
loading: 'Cargando...';
|
|
165
|
-
error: 'Error';
|
|
166
|
-
retry: 'Reintentar';
|
|
167
|
-
cancel: 'Cancelar';
|
|
168
|
-
confirm: 'Confirmar';
|
|
169
|
-
close: 'Cerrar';
|
|
170
|
-
save: 'Guardar';
|
|
171
|
-
delete: 'Eliminar';
|
|
172
|
-
edit: 'Editar';
|
|
173
|
-
search: 'Buscar';
|
|
174
|
-
clear: 'Limpiar';
|
|
175
|
-
submit: 'Enviar';
|
|
176
|
-
reset: 'Restablecer'
|
|
177
|
-
};
|
|
178
|
-
form: {
|
|
179
|
-
required: 'Este campo es obligatorio';
|
|
180
|
-
invalid: 'Valor inválido';
|
|
181
|
-
tooShort: 'El valor es demasiado corto (mínimo {min} caracteres)';
|
|
182
|
-
tooLong: 'El valor es demasiado largo (máximo {max} caracteres)';
|
|
183
|
-
invalidEmail: 'Dirección de correo electrónico inválida';
|
|
184
|
-
invalidUrl: 'URL inválida'
|
|
185
|
-
};
|
|
186
|
-
pagination: {
|
|
187
|
-
previous: 'Anterior';
|
|
188
|
-
next: 'Siguiente';
|
|
189
|
-
page: 'Página {page}';
|
|
190
|
-
of: 'de {total}'
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
fr: {
|
|
194
|
-
common: {
|
|
195
|
-
loading: 'Chargement...';
|
|
196
|
-
error: 'Erreur';
|
|
197
|
-
retry: 'Réessayer';
|
|
198
|
-
cancel: 'Annuler';
|
|
199
|
-
confirm: 'Confirmer';
|
|
200
|
-
close: 'Fermer';
|
|
201
|
-
save: 'Enregistrer';
|
|
202
|
-
delete: 'Supprimer';
|
|
203
|
-
edit: 'Modifier';
|
|
204
|
-
search: 'Rechercher';
|
|
205
|
-
clear: 'Effacer';
|
|
206
|
-
submit: 'Soumettre';
|
|
207
|
-
reset: 'Réinitialiser'
|
|
208
|
-
};
|
|
209
|
-
form: {
|
|
210
|
-
required: 'Ce champ est obligatoire';
|
|
211
|
-
invalid: 'Valeur invalide';
|
|
212
|
-
tooShort: 'La valeur est trop courte (minimum {min} caractères)';
|
|
213
|
-
tooLong: 'La valeur est trop longue (maximum {max} caractères)';
|
|
214
|
-
invalidEmail: 'Adresse e-mail invalide';
|
|
215
|
-
invalidUrl: 'URL invalide'
|
|
216
|
-
};
|
|
217
|
-
pagination: {
|
|
218
|
-
previous: 'Précédent';
|
|
219
|
-
next: 'Suivant';
|
|
220
|
-
page: 'Page {page}';
|
|
221
|
-
of: 'sur {total}'
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
};
|
|
174
|
+
export declare const componentMessages: LocaleMessages;
|
|
225
175
|
/**
|
|
226
176
|
* I18n configuration
|
|
227
177
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.26",
|
|
5
5
|
"description": "A modern component library built with STX, featuring headwind utility classes and TypeScript syntax highlighting.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -28,10 +28,12 @@
|
|
|
28
28
|
],
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
|
+
"bun": "./src/index.ts",
|
|
31
32
|
"types": "./dist/index.d.ts",
|
|
32
33
|
"import": "./dist/index.js"
|
|
33
34
|
},
|
|
34
35
|
"./*": {
|
|
36
|
+
"bun": "./src/*/index.ts",
|
|
35
37
|
"types": "./dist/*/index.d.ts",
|
|
36
38
|
"import": "./dist/*/index.js"
|
|
37
39
|
}
|
|
@@ -56,8 +58,8 @@
|
|
|
56
58
|
},
|
|
57
59
|
"dependencies": {
|
|
58
60
|
"@cwcss/crosswind": "^0.2.0",
|
|
59
|
-
"@stacksjs/stx": "0.2.
|
|
60
|
-
"bun-plugin-stx": "0.2.
|
|
61
|
+
"@stacksjs/stx": "0.2.26",
|
|
62
|
+
"bun-plugin-stx": "0.2.26",
|
|
61
63
|
"ts-syntax-highlighter": "^0.2.1"
|
|
62
64
|
},
|
|
63
65
|
"devDependencies": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
export const items = $props.items || []
|
|
3
3
|
export const allowMultiple = $props.allowMultiple || false
|
|
4
4
|
export const defaultOpen = $props.defaultOpen || []
|
|
@@ -49,7 +49,7 @@ export const contentClasses = `px-4 py-3 text-gray-700 dark:text-gray-300`.trim(
|
|
|
49
49
|
<button
|
|
50
50
|
type="button"
|
|
51
51
|
class="{{ headerClasses }}"
|
|
52
|
-
|
|
52
|
+
@click="toggleItem({{ $loop.index }})"
|
|
53
53
|
aria-expanded="{{ isOpen($loop.index) ? 'true' : 'false' }}"
|
|
54
54
|
aria-controls="accordion-content-{{ $loop.index }}"
|
|
55
55
|
>
|
package/src/ui/audio/Audio.stx
CHANGED
package/src/ui/audio/README.md
CHANGED
|
@@ -11,12 +11,11 @@ bun add @stacksjs/components
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```stx
|
|
14
|
-
|
|
15
|
-
src
|
|
16
|
-
title
|
|
17
|
-
controls
|
|
18
|
-
|
|
19
|
-
@endcomponent
|
|
14
|
+
<Audio
|
|
15
|
+
src="/audio/podcast.mp3"
|
|
16
|
+
title="Episode 42: Building with STX"
|
|
17
|
+
controls
|
|
18
|
+
/>
|
|
20
19
|
```
|
|
21
20
|
|
|
22
21
|
## Props
|
package/src/ui/auth/Login.stx
CHANGED
package/src/ui/auth/README.md
CHANGED
|
@@ -24,64 +24,61 @@ bun add @stacksjs/components
|
|
|
24
24
|
### Login Component
|
|
25
25
|
|
|
26
26
|
```stx
|
|
27
|
-
<script>
|
|
28
|
-
|
|
27
|
+
<script server>
|
|
28
|
+
const handleLogin = (data) => {
|
|
29
29
|
console.log('Login:', data.email, data.password)
|
|
30
30
|
}
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
showLogo
|
|
35
|
-
headingText
|
|
36
|
-
showSocialLogin
|
|
37
|
-
showRememberMe
|
|
38
|
-
showForgotPassword
|
|
39
|
-
showSignup
|
|
40
|
-
signupText
|
|
41
|
-
onSubmit
|
|
42
|
-
|
|
43
|
-
@endcomponent
|
|
33
|
+
<Login
|
|
34
|
+
showLogo
|
|
35
|
+
headingText="Sign in to your account"
|
|
36
|
+
showSocialLogin
|
|
37
|
+
showRememberMe
|
|
38
|
+
showForgotPassword
|
|
39
|
+
showSignup
|
|
40
|
+
signupText="Start a 14 day free trial"
|
|
41
|
+
:onSubmit="handleLogin"
|
|
42
|
+
/>
|
|
44
43
|
```
|
|
45
44
|
|
|
46
45
|
### Signup Component
|
|
47
46
|
|
|
48
47
|
```stx
|
|
49
|
-
<script>
|
|
50
|
-
|
|
48
|
+
<script server>
|
|
49
|
+
const handleSignup = (data) => {
|
|
51
50
|
console.log('Signup:', data.name, data.email, data.password)
|
|
52
51
|
}
|
|
53
52
|
</script>
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
headingText
|
|
57
|
-
showSocialSignup
|
|
58
|
-
onSubmit
|
|
59
|
-
|
|
60
|
-
@endcomponent
|
|
54
|
+
<Signup
|
|
55
|
+
headingText="Sign up for Stacks"
|
|
56
|
+
showSocialSignup
|
|
57
|
+
:onSubmit="handleSignup"
|
|
58
|
+
/>
|
|
61
59
|
```
|
|
62
60
|
|
|
63
61
|
### TwoFactorChallenge Component
|
|
64
62
|
|
|
65
63
|
```stx
|
|
66
|
-
<script>
|
|
67
|
-
|
|
64
|
+
<script server>
|
|
65
|
+
const handleVerify = (code) => {
|
|
68
66
|
console.log('2FA Code:', code)
|
|
69
67
|
}
|
|
70
68
|
|
|
71
|
-
|
|
69
|
+
const handleRecoveryCode = () => {
|
|
72
70
|
console.log('Using recovery code')
|
|
73
71
|
}
|
|
74
72
|
</script>
|
|
75
73
|
|
|
76
|
-
|
|
77
|
-
headingText
|
|
78
|
-
labelText
|
|
79
|
-
instructionText
|
|
80
|
-
codeLength
|
|
81
|
-
onSubmit
|
|
82
|
-
onUseRecoveryCode
|
|
83
|
-
|
|
84
|
-
@endcomponent
|
|
74
|
+
<TwoFactorChallenge
|
|
75
|
+
headingText="Two Factor Authentication"
|
|
76
|
+
labelText="Authentication code"
|
|
77
|
+
instructionText="Open your 2FA app to view your authentication code."
|
|
78
|
+
:codeLength="6"
|
|
79
|
+
:onSubmit="handleVerify"
|
|
80
|
+
:onUseRecoveryCode="handleRecoveryCode"
|
|
81
|
+
/>
|
|
85
82
|
```
|
|
86
83
|
|
|
87
84
|
## Props
|
package/src/ui/auth/Signup.stx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
export const headingText = $props.headingText || 'Two Factor Authentication'
|
|
3
3
|
export const labelText = $props.labelText || 'Authentication code'
|
|
4
4
|
export const instructionText = $props.instructionText || 'Open your Symantec 2FA app to view your authentication code.'
|
|
@@ -57,7 +57,7 @@ export const codes = Array(codeLength).fill('')
|
|
|
57
57
|
</p>
|
|
58
58
|
<a
|
|
59
59
|
href="#"
|
|
60
|
-
|
|
60
|
+
@click="event.preventDefault(); handleRecoveryCode()"
|
|
61
61
|
class="text-xs text-blue-500 hover:underline"
|
|
62
62
|
>
|
|
63
63
|
Use recovery code instead
|
package/src/ui/avatar/Avatar.stx
CHANGED
package/src/ui/badge/Badge.stx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
export const variant = $props.variant || 'default'
|
|
3
3
|
export const size = $props.size || 'md'
|
|
4
4
|
export const dot = $props.dot || false
|
|
@@ -50,7 +50,7 @@ export const removeButtonClasses = `ml-0.5 -mr-1 text-current hover:bg-black hov
|
|
|
50
50
|
@if(removable && onRemove)
|
|
51
51
|
<button
|
|
52
52
|
type="button"
|
|
53
|
-
|
|
53
|
+
@click="handleRemove()"
|
|
54
54
|
class="{{ removeButtonClasses }}"
|
|
55
55
|
aria-label="Remove"
|
|
56
56
|
>
|
package/src/ui/button/Button.stx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
export const variant = $props.variant || 'primary'
|
|
3
3
|
export const size = $props.size || 'md'
|
|
4
4
|
export const disabled = $props.disabled || false
|
|
@@ -56,7 +56,7 @@ export const spinnerClasses = `animate-spin ${iconClasses}`.trim()
|
|
|
56
56
|
type="{{ type }}"
|
|
57
57
|
class="{{ buttonClasses }}"
|
|
58
58
|
@if(isDisabled)disabled@endif
|
|
59
|
-
@if(onClick)
|
|
59
|
+
@if(onClick)@click="handleClick(event)"@endif
|
|
60
60
|
aria-busy="{{ loading ? 'true' : 'false' }}"
|
|
61
61
|
>
|
|
62
62
|
@if(loading)
|
package/src/ui/button/README.md
CHANGED
|
@@ -11,9 +11,7 @@ bun add @stacksjs/components
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```stx
|
|
14
|
-
|
|
15
|
-
Click me
|
|
16
|
-
@endcomponent
|
|
14
|
+
<Button variant="primary" size="md">Click me</Button>
|
|
17
15
|
```
|
|
18
16
|
|
|
19
17
|
## Props
|
|
@@ -32,60 +30,42 @@ bun add @stacksjs/components
|
|
|
32
30
|
### Variants
|
|
33
31
|
|
|
34
32
|
```stx
|
|
35
|
-
|
|
36
|
-
Primary Button
|
|
37
|
-
@endcomponent
|
|
33
|
+
<Button variant="primary">Primary Button</Button>
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
Secondary Button
|
|
41
|
-
@endcomponent
|
|
35
|
+
<Button variant="secondary">Secondary Button</Button>
|
|
42
36
|
|
|
43
|
-
|
|
44
|
-
Outline Button
|
|
45
|
-
@endcomponent
|
|
37
|
+
<Button variant="outline">Outline Button</Button>
|
|
46
38
|
|
|
47
|
-
|
|
48
|
-
Ghost Button
|
|
49
|
-
@endcomponent
|
|
39
|
+
<Button variant="ghost">Ghost Button</Button>
|
|
50
40
|
|
|
51
|
-
|
|
52
|
-
Danger Button
|
|
53
|
-
@endcomponent
|
|
41
|
+
<Button variant="danger">Danger Button</Button>
|
|
54
42
|
```
|
|
55
43
|
|
|
56
44
|
### Sizes
|
|
57
45
|
|
|
58
46
|
```stx
|
|
59
|
-
|
|
60
|
-
Small Button
|
|
61
|
-
@endcomponent
|
|
47
|
+
<Button size="sm">Small Button</Button>
|
|
62
48
|
|
|
63
|
-
|
|
64
|
-
Medium Button
|
|
65
|
-
@endcomponent
|
|
49
|
+
<Button size="md">Medium Button</Button>
|
|
66
50
|
|
|
67
|
-
|
|
68
|
-
Large Button
|
|
69
|
-
@endcomponent
|
|
51
|
+
<Button size="lg">Large Button</Button>
|
|
70
52
|
```
|
|
71
53
|
|
|
72
54
|
### Disabled State
|
|
73
55
|
|
|
74
56
|
```stx
|
|
75
|
-
|
|
76
|
-
Disabled Button
|
|
77
|
-
@endcomponent
|
|
57
|
+
<Button disabled>Disabled Button</Button>
|
|
78
58
|
```
|
|
79
59
|
|
|
80
60
|
### With Icon
|
|
81
61
|
|
|
82
62
|
```stx
|
|
83
|
-
|
|
63
|
+
<Button variant="primary">
|
|
84
64
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
85
65
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
|
|
86
66
|
</svg>
|
|
87
67
|
Add Item
|
|
88
|
-
|
|
68
|
+
</Button>
|
|
89
69
|
```
|
|
90
70
|
|
|
91
71
|
## Features
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
// Calendar Component Props
|
|
3
3
|
export const value = $props.value || new Date()
|
|
4
4
|
export const onChange = $props.onChange
|
|
@@ -170,7 +170,7 @@ const calendarDays = getCalendarDays()
|
|
|
170
170
|
<button
|
|
171
171
|
type="button"
|
|
172
172
|
class="{{ buttonClasses }}"
|
|
173
|
-
|
|
173
|
+
@click="previousMonth()"
|
|
174
174
|
aria-label="Previous month"
|
|
175
175
|
>
|
|
176
176
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
@@ -185,7 +185,7 @@ const calendarDays = getCalendarDays()
|
|
|
185
185
|
<button
|
|
186
186
|
type="button"
|
|
187
187
|
class="{{ buttonClasses }}"
|
|
188
|
-
|
|
188
|
+
@click="nextMonth()"
|
|
189
189
|
aria-label="Next month"
|
|
190
190
|
>
|
|
191
191
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
@@ -207,7 +207,7 @@ const calendarDays = getCalendarDays()
|
|
|
207
207
|
<button
|
|
208
208
|
type="button"
|
|
209
209
|
class="{{ getDayClasses(day) }}"
|
|
210
|
-
|
|
210
|
+
@click="selectDate(day.date)"
|
|
211
211
|
aria-label="{{ day.date.toLocaleDateString(locale) }}"
|
|
212
212
|
@if(isDisabled(day.date))
|
|
213
213
|
disabled
|
|
@@ -223,7 +223,7 @@ const calendarDays = getCalendarDays()
|
|
|
223
223
|
<button
|
|
224
224
|
type="button"
|
|
225
225
|
class="px-4 py-2 text-sm font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-gray-700 rounded-md transition-colors"
|
|
226
|
-
|
|
226
|
+
@click="goToToday()"
|
|
227
227
|
>
|
|
228
228
|
Today
|
|
229
229
|
</button>
|
package/src/ui/card/Card.stx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script server>
|
|
2
2
|
export const variant = $props.variant || 'default'
|
|
3
3
|
export const padding = $props.padding || 'default'
|
|
4
4
|
export const hover = $props.hover || false
|
|
@@ -37,7 +37,7 @@ export const contentClasses = `${image ? paddingClasses[padding] : ''}`.trim()
|
|
|
37
37
|
</script>
|
|
38
38
|
|
|
39
39
|
@if(onClick)
|
|
40
|
-
<div class="{{ cardClasses }}"
|
|
40
|
+
<div class="{{ cardClasses }}" @click="handleClick(event)" role="button" tabindex="0" onkeydown="handleKeyDown(event)">
|
|
41
41
|
@if(image)
|
|
42
42
|
<img src="{{ image }}" alt="{{ imageAlt }}" class="{{ imageClasses }}" />
|
|
43
43
|
@endif
|