@stacksjs/components 0.2.35 → 0.2.53

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.
Files changed (237) hide show
  1. package/dist/Accordion-19x8q4rj.stx +88 -0
  2. package/dist/{Audio-vdmg1258.stx → Audio-hjywk3qc.stx} +4 -4
  3. package/dist/{Avatar-365cvrh4.stx → Avatar-h3jmwcq0.stx} +23 -34
  4. package/dist/{Badge-8m3qete4.stx → Badge-k8dy3d53.stx} +11 -19
  5. package/dist/{Button-3tt4vsqt.stx → Button-1vknasy3.stx} +18 -33
  6. package/dist/Calendar-reny0et7.stx +189 -0
  7. package/dist/{Card-6wdbexqr.stx → Card-c1g1fd1w.stx} +27 -33
  8. package/dist/{Checkbox-p3q3e3nf.stx → Checkbox-zgdmy3p5.stx} +36 -44
  9. package/dist/{Checkout-e4037tyy.stx → Checkout-agt0ngpw.stx} +8 -16
  10. package/dist/Combobox-fdkr6cdq.stx +96 -0
  11. package/dist/{ComboboxButton-8gxwkhdx.stx → ComboboxButton-g76stp1e.stx} +14 -2
  12. package/dist/{ComboboxInput-mk99z65n.stx → ComboboxInput-z1293bbh.stx} +12 -5
  13. package/dist/ComboboxOption-hmxt3gte.stx +49 -0
  14. package/dist/{ListboxOptions-8kqvfp7z.stx → ComboboxOptions-sq5360ae.stx} +2 -2
  15. package/dist/CommandPalette-36mxf05w.stx +81 -0
  16. package/dist/CommandPaletteItem-mvk6q7a2.stx +27 -0
  17. package/dist/Dialog-hczpexs4.stx +37 -0
  18. package/dist/{Drawer-p7m351bn.stx → Drawer-xhevp5cw.stx} +29 -49
  19. package/dist/Dropdown-vvhemtc0.stx +82 -0
  20. package/dist/{DropdownButton-9w8zkfwj.stx → DropdownButton-wcz67dxy.stx} +12 -6
  21. package/dist/DropdownItem-c7rz08e5.stx +35 -0
  22. package/dist/{DropdownItems-aygjpxkx.stx → DropdownItems-1sxnd5qn.stx} +2 -2
  23. package/dist/EmailInput-vak3kkmk.stx +30 -0
  24. package/dist/Form-mas630hy.stx +95 -0
  25. package/dist/{Image-jhkm6w1f.stx → Image-yhxcvgzs.stx} +68 -100
  26. package/dist/Listbox-q49tnr90.stx +101 -0
  27. package/dist/{ListboxButton-spwx7513.stx → ListboxButton-keb8gm0q.stx} +12 -1
  28. package/dist/ListboxOption-e0dtv1gc.stx +49 -0
  29. package/dist/{ComboboxOptions-6b5ywc5x.stx → ListboxOptions-ejkatcfg.stx} +7 -3
  30. package/dist/{Login-rx9gyqhx.stx → Login-gepemsth.stx} +17 -19
  31. package/dist/Navigator-rk2a5wvk.stx +113 -0
  32. package/dist/Notification-tb9b525s.stx +78 -0
  33. package/dist/{NumberInput-nzpkx1ry.stx → NumberInput-drnvtqej.stx} +40 -53
  34. package/dist/{Pagination-h61eq390.stx → Pagination-n3d31cns.stx} +73 -108
  35. package/dist/PasswordInput-n02x6053.stx +142 -0
  36. package/dist/{PaymentMethods-j42jsk5x.stx → PaymentMethods-x4vrx9yb.stx} +21 -30
  37. package/dist/Popover-et2q44m7.stx +60 -0
  38. package/dist/{PopoverButton-fnaqc77g.stx → PopoverButton-mffzc9pr.stx} +12 -6
  39. package/dist/{PopoverPanel-y0vtf5w9.stx → PopoverPanel-054yh38h.stx} +6 -6
  40. package/dist/{Portal-s2q37yp0.stx → Portal-1vf14s4x.stx} +20 -37
  41. package/dist/{Progress-vmdkm06p.stx → Progress-yxcntr4x.stx} +36 -48
  42. package/dist/{Radio-04bs3d21.stx → Radio-cgjv2hb2.stx} +29 -34
  43. package/dist/RadioGroup-qxmnm3xm.stx +60 -0
  44. package/dist/RadioGroupOption-s1d6r221.stx +58 -0
  45. package/dist/SearchInput-pdx7agn0.stx +44 -0
  46. package/dist/{Select-g4mmvfv8.stx → Select-28y0pg83.stx} +23 -31
  47. package/dist/Sidebar-73vc78as.stx +236 -0
  48. package/dist/SidebarFooter-zsfsgcxb.stx +109 -0
  49. package/dist/SidebarHeader-7v174a9c.stx +122 -0
  50. package/dist/SidebarItem-3y3e8g2t.stx +92 -0
  51. package/dist/SidebarSection-z5ey6awe.stx +113 -0
  52. package/dist/{Signup-c4dyv6f3.stx → Signup-hxm5hwkr.stx} +26 -28
  53. package/dist/{StepperStep-en4r00zv.stx → StepperStep-wxgembat.stx} +9 -5
  54. package/dist/{SubscriptionCheckout-gawjzf3q.stx → SubscriptionCheckout-zy2ycrmw.stx} +99 -129
  55. package/dist/Switch-r5t5w04w.stx +70 -0
  56. package/dist/{TableHeader-ydys9rzz.stx → TableHeader-0eyzbqpz.stx} +10 -3
  57. package/dist/Tabs-bzvvn4ke.stx +126 -0
  58. package/dist/Teleport-tsx4bt4n.stx +65 -0
  59. package/dist/{TextInput-k2kfkgy1.stx → TextInput-kf084763.stx} +42 -59
  60. package/dist/{Textarea-szad57dz.stx → Textarea-xg4rr2xz.stx} +42 -54
  61. package/dist/{Tooltip-em7t551n.stx → Tooltip-m0tqd72e.stx} +34 -40
  62. package/dist/Transition-7smenaz8.stx +102 -0
  63. package/dist/{TwoFactorChallenge-an9yvxvq.stx → TwoFactorChallenge-y5m3nk79.stx} +49 -63
  64. package/dist/{Video-crxva65p.stx → Video-84j4pv6h.stx} +4 -4
  65. package/dist/VirtualList-fa7v5a3h.stx +67 -0
  66. package/dist/VirtualTable-f9crbfjr.stx +103 -0
  67. package/dist/components/CodeBlock.stx +1 -6
  68. package/dist/index.js +13 -13
  69. package/dist/ui/accordion/Accordion.stx +1 -3
  70. package/dist/ui/auth/Login.stx +0 -1
  71. package/dist/ui/auth/Signup.stx +0 -1
  72. package/dist/ui/auth/TwoFactorChallenge.stx +1 -3
  73. package/dist/ui/avatar/Avatar.stx +0 -2
  74. package/dist/ui/badge/Badge.stx +0 -1
  75. package/dist/ui/button/Button.stx +1 -2
  76. package/dist/ui/calendar/Calendar.stx +12 -2
  77. package/dist/ui/card/Card.stx +0 -2
  78. package/dist/ui/checkbox/Checkbox.stx +2 -2
  79. package/dist/ui/combobox/Combobox.stx +2 -1
  80. package/dist/ui/combobox/ComboboxButton.stx +1 -0
  81. package/dist/ui/combobox/ComboboxInput.stx +1 -4
  82. package/dist/ui/combobox/ComboboxOption.stx +2 -9
  83. package/dist/ui/combobox/ComboboxOptions.stx +1 -1
  84. package/dist/ui/command-palette/CommandPalette.stx +3 -6
  85. package/dist/ui/command-palette/CommandPaletteItem.stx +2 -7
  86. package/dist/ui/dialog/Dialog.stx +1 -3
  87. package/dist/ui/drawer/Drawer.stx +1 -3
  88. package/dist/ui/dropdown/Dropdown.stx +2 -5
  89. package/dist/ui/dropdown/DropdownButton.stx +1 -3
  90. package/dist/ui/dropdown/DropdownItem.stx +2 -7
  91. package/dist/ui/dropdown/DropdownItems.stx +1 -1
  92. package/dist/ui/form/Form.stx +0 -5
  93. package/dist/ui/image/Image.stx +1 -6
  94. package/dist/ui/input/EmailInput.stx +1 -1
  95. package/dist/ui/input/NumberInput.stx +0 -1
  96. package/dist/ui/input/PasswordInput.stx +1 -4
  97. package/dist/ui/input/SearchInput.stx +2 -2
  98. package/dist/ui/input/TextInput.stx +1 -2
  99. package/dist/ui/listbox/Listbox.stx +2 -1
  100. package/dist/ui/listbox/ListboxButton.stx +1 -0
  101. package/dist/ui/listbox/ListboxOption.stx +2 -9
  102. package/dist/ui/listbox/ListboxOptions.stx +1 -1
  103. package/dist/ui/navigator/Navigator.stx +4 -4
  104. package/dist/ui/notification/Notification.stx +1 -5
  105. package/dist/ui/pagination/Pagination.stx +1 -2
  106. package/dist/ui/payment/Checkout.stx +0 -4
  107. package/dist/ui/payment/PaymentMethods.stx +15 -2
  108. package/dist/ui/payment/SubscriptionCheckout.stx +3 -184
  109. package/dist/ui/popover/Popover.stx +2 -5
  110. package/dist/ui/popover/PopoverButton.stx +1 -3
  111. package/dist/ui/popover/PopoverPanel.stx +1 -1
  112. package/dist/ui/portal/Portal.stx +1 -0
  113. package/dist/ui/progress/Progress.stx +6 -1
  114. package/dist/ui/radio/Radio.stx +1 -1
  115. package/dist/ui/radio-group/RadioGroup.stx +2 -1
  116. package/dist/ui/radio-group/RadioGroupOption.stx +2 -9
  117. package/dist/ui/select/Select.stx +1 -1
  118. package/dist/ui/sidebar/Sidebar.stx +9 -26
  119. package/dist/ui/sidebar/SidebarFooter.stx +6 -21
  120. package/dist/ui/sidebar/SidebarHeader.stx +7 -18
  121. package/dist/ui/sidebar/SidebarItem.stx +4 -20
  122. package/dist/ui/sidebar/SidebarSection.stx +5 -18
  123. package/dist/ui/sidebar/index.d.ts +13 -1
  124. package/dist/ui/stepper/StepperStep.stx +1 -5
  125. package/dist/ui/switch/Switch.stx +4 -10
  126. package/dist/ui/table/TableHeader.stx +1 -1
  127. package/dist/ui/tabs/Tabs.stx +0 -1
  128. package/dist/ui/teleport/Teleport.stx +1 -0
  129. package/dist/ui/textarea/Textarea.stx +1 -1
  130. package/dist/ui/tooltip/Tooltip.stx +1 -2
  131. package/dist/ui/transition/Transition.stx +9 -16
  132. package/dist/ui/virtual-list/VirtualList.stx +2 -4
  133. package/dist/ui/virtual-table/VirtualTable.stx +1 -1
  134. package/package.json +3 -3
  135. package/src/components/CodeBlock.stx +26 -29
  136. package/src/components/Footer.stx +1 -1
  137. package/src/components/Hero.stx +1 -1
  138. package/src/components/Installation.stx +5 -7
  139. package/src/ui/accordion/Accordion.stx +48 -68
  140. package/src/ui/audio/Audio.stx +4 -4
  141. package/src/ui/auth/Login.stx +17 -19
  142. package/src/ui/auth/Signup.stx +26 -28
  143. package/src/ui/auth/TwoFactorChallenge.stx +49 -63
  144. package/src/ui/avatar/Avatar.stx +23 -34
  145. package/src/ui/badge/Badge.stx +11 -19
  146. package/src/ui/button/Button.stx +18 -33
  147. package/src/ui/calendar/Calendar.stx +93 -136
  148. package/src/ui/card/Card.stx +27 -33
  149. package/src/ui/checkbox/Checkbox.stx +36 -44
  150. package/src/ui/combobox/Combobox.stx +87 -4
  151. package/src/ui/combobox/ComboboxButton.stx +14 -2
  152. package/src/ui/combobox/ComboboxInput.stx +12 -5
  153. package/src/ui/combobox/ComboboxOption.stx +29 -32
  154. package/src/ui/combobox/ComboboxOptions.stx +7 -3
  155. package/src/ui/command-palette/CommandPalette.stx +70 -28
  156. package/src/ui/command-palette/CommandPaletteItem.stx +15 -20
  157. package/src/ui/dialog/Dialog.stx +28 -10
  158. package/src/ui/drawer/Drawer.stx +29 -49
  159. package/src/ui/dropdown/Dropdown.stx +69 -11
  160. package/src/ui/dropdown/DropdownButton.stx +12 -6
  161. package/src/ui/dropdown/DropdownItem.stx +18 -26
  162. package/src/ui/dropdown/DropdownItems.stx +2 -2
  163. package/src/ui/form/Form.stx +50 -164
  164. package/src/ui/heatmap/Heatmap.stx +16 -37
  165. package/src/ui/image/Image.stx +68 -100
  166. package/src/ui/input/EmailInput.stx +16 -27
  167. package/src/ui/input/NumberInput.stx +40 -53
  168. package/src/ui/input/PasswordInput.stx +64 -77
  169. package/src/ui/input/SearchInput.stx +27 -46
  170. package/src/ui/input/TextInput.stx +42 -59
  171. package/src/ui/listbox/Listbox.stx +91 -4
  172. package/src/ui/listbox/ListboxButton.stx +12 -1
  173. package/src/ui/listbox/ListboxOption.stx +30 -38
  174. package/src/ui/listbox/ListboxOptions.stx +2 -2
  175. package/src/ui/navigator/Navigator.stx +52 -77
  176. package/src/ui/notification/Notification.stx +46 -39
  177. package/src/ui/pagination/Pagination.stx +73 -108
  178. package/src/ui/payment/Checkout.stx +8 -16
  179. package/src/ui/payment/PaymentMethods.stx +21 -30
  180. package/src/ui/payment/SubscriptionCheckout.stx +99 -129
  181. package/src/ui/popover/Popover.stx +50 -14
  182. package/src/ui/popover/PopoverButton.stx +12 -6
  183. package/src/ui/popover/PopoverPanel.stx +6 -6
  184. package/src/ui/portal/Portal.stx +20 -37
  185. package/src/ui/progress/Progress.stx +36 -48
  186. package/src/ui/radio/Radio.stx +29 -34
  187. package/src/ui/radio-group/RadioGroup.stx +51 -4
  188. package/src/ui/radio-group/RadioGroupOption.stx +37 -30
  189. package/src/ui/select/Select.stx +23 -31
  190. package/src/ui/sidebar/Sidebar.stx +136 -188
  191. package/src/ui/sidebar/SidebarFooter.stx +49 -35
  192. package/src/ui/sidebar/SidebarHeader.stx +52 -30
  193. package/src/ui/sidebar/SidebarItem.stx +52 -78
  194. package/src/ui/sidebar/SidebarSection.stx +56 -51
  195. package/src/ui/sidebar/index.ts +21 -1
  196. package/src/ui/stepper/StepperStep.stx +9 -5
  197. package/src/ui/switch/Switch.stx +38 -42
  198. package/src/ui/table/TableHeader.stx +10 -3
  199. package/src/ui/tabs/Tabs.stx +68 -87
  200. package/src/ui/teleport/Teleport.stx +23 -59
  201. package/src/ui/textarea/Textarea.stx +42 -54
  202. package/src/ui/tooltip/Tooltip.stx +34 -40
  203. package/src/ui/transition/Transition.stx +76 -148
  204. package/src/ui/video/Video.stx +4 -4
  205. package/src/ui/virtual-list/VirtualList.stx +45 -61
  206. package/src/ui/virtual-table/VirtualTable.stx +62 -72
  207. package/dist/Accordion-sbfra0mz.stx +0 -108
  208. package/dist/Calendar-58nnkdh8.stx +0 -232
  209. package/dist/Combobox-th5ebw62.stx +0 -13
  210. package/dist/ComboboxOption-an9zyan6.stx +0 -52
  211. package/dist/CommandPalette-kwmdf2np.stx +0 -39
  212. package/dist/CommandPaletteItem-zx2fbpts.stx +0 -32
  213. package/dist/Dialog-rgmj8q2j.stx +0 -19
  214. package/dist/Dropdown-jz4jy0n3.stx +0 -24
  215. package/dist/DropdownItem-wagdspb8.stx +0 -43
  216. package/dist/EmailInput-ajsp9vw6.stx +0 -41
  217. package/dist/Form-1mdmx9b6.stx +0 -209
  218. package/dist/Listbox-pqqh72g8.stx +0 -14
  219. package/dist/ListboxOption-7nxzaexq.stx +0 -57
  220. package/dist/Navigator-aay8bjab.stx +0 -138
  221. package/dist/Notification-gk33gv7b.stx +0 -71
  222. package/dist/PasswordInput-zv4hm43j.stx +0 -155
  223. package/dist/Popover-469gbt6r.stx +0 -24
  224. package/dist/RadioGroup-bvb1mrhd.stx +0 -13
  225. package/dist/RadioGroupOption-cpdwgnhw.stx +0 -51
  226. package/dist/SearchInput-2521m475.stx +0 -63
  227. package/dist/Sidebar-40ckbzh8.stx +0 -288
  228. package/dist/SidebarFooter-hnth56mg.stx +0 -95
  229. package/dist/SidebarHeader-3wrte2p2.stx +0 -100
  230. package/dist/SidebarItem-zqtvvzpc.stx +0 -118
  231. package/dist/SidebarSection-3etwnbjr.stx +0 -108
  232. package/dist/Switch-036j9vm1.stx +0 -74
  233. package/dist/Tabs-svh721m0.stx +0 -145
  234. package/dist/Teleport-qfch3w0b.stx +0 -101
  235. package/dist/Transition-0hmr6zxb.stx +0 -174
  236. package/dist/VirtualList-cndhjejh.stx +0 -83
  237. package/dist/VirtualTable-ng0b48yp.stx +0 -113
@@ -1,118 +0,0 @@
1
- <script server>
2
- /**
3
- * SidebarItem Component
4
- *
5
- * An individual navigation item within a sidebar section.
6
- * Supports icons, badges, active states, and keyboard navigation.
7
- *
8
- * @example
9
- * <SidebarItem
10
- * id="home"
11
- * label="Home"
12
- * icon="i-hugeicons-home-02"
13
- * href="/"
14
- * :active="true"
15
- * />
16
- */
17
-
18
- // Props
19
- export const id = $props.id || ''
20
- export const label = $props.label || ''
21
- export const icon = $props.icon || ''
22
- export const href = $props.href || ''
23
- export const badge = $props.badge || ''
24
- export const active = $props.active ?? false
25
- export const disabled = $props.disabled ?? false
26
- export const indent = $props.indent ?? false
27
- export const onClick = $props.onClick
28
-
29
- // Handle click
30
- function handleClick(event) {
31
- if (disabled) {
32
- event.preventDefault()
33
- return
34
- }
35
-
36
- if (onClick) {
37
- onClick(event)
38
- }
39
- }
40
-
41
- // Build item classes - macOS Tahoe style with translucent-friendly colors
42
- function getItemClasses() {
43
- const baseClasses = [
44
- 'flex items-center gap-2.5 px-2.5 py-1.5 rounded-md text-[13px]',
45
- 'transition-all duration-150',
46
- indent ? 'ml-2' : ''
47
- ]
48
-
49
- if (disabled) {
50
- baseClasses.push('opacity-50 cursor-not-allowed')
51
- } else if (active) {
52
- // Active state - subtle blue highlight like macOS
53
- baseClasses.push(
54
- 'bg-blue-500/20 text-blue-600 dark:bg-blue-400/25 dark:text-blue-300 font-medium'
55
- )
56
- } else {
57
- // Default state - works with translucent backgrounds
58
- baseClasses.push(
59
- 'text-black/80 dark:text-white/80',
60
- 'hover:bg-black/5 dark:hover:bg-white/10'
61
- )
62
- }
63
-
64
- return baseClasses.filter(Boolean).join(' ')
65
- }
66
-
67
- // Icon classes
68
- function getIconClasses() {
69
- const baseClasses = 'w-4 h-4 flex-shrink-0'
70
-
71
- if (active) {
72
- return `${icon} ${baseClasses} text-blue-600 dark:text-blue-300`
73
- }
74
-
75
- return `${icon} ${baseClasses} text-black/50 dark:text-white/50`
76
- }
77
- </script>
78
-
79
- @if(href && !disabled)
80
- <a
81
- href="{{ href }}"
82
- class="{{ getItemClasses() }}"
83
- @click="handleClick"
84
- @if(active)
85
- aria-current="page"
86
- @endif
87
- >
88
- @if(icon)
89
- <div class="{{ getIconClasses() }}"></div>
90
- @endif
91
- <span class="flex-1 truncate">{{ label }}</span>
92
- @if(badge)
93
- <span class="ml-auto px-2 py-0.5 text-xs font-medium rounded-full bg-black/10 text-black/70 dark:bg-white/15 dark:text-white/70">
94
- {{ badge }}
95
- </span>
96
- @endif
97
- </a>
98
- @else
99
- <button
100
- type="button"
101
- class="{{ getItemClasses() }}"
102
- @click="handleClick"
103
- @if(disabled)
104
- disabled
105
- aria-disabled="true"
106
- @endif
107
- >
108
- @if(icon)
109
- <div class="{{ getIconClasses() }}"></div>
110
- @endif
111
- <span class="flex-1 truncate text-left">{{ label }}</span>
112
- @if(badge)
113
- <span class="ml-auto px-2 py-0.5 text-xs font-medium rounded-full bg-black/10 text-black/70 dark:bg-white/15 dark:text-white/70">
114
- {{ badge }}
115
- </span>
116
- @endif
117
- </button>
118
- @endif
@@ -1,108 +0,0 @@
1
- <script server>
2
- /**
3
- * SidebarSection Component
4
- *
5
- * A collapsible section within the sidebar containing navigation items.
6
- * Follows macOS Finder sidebar conventions.
7
- *
8
- * @example
9
- * <SidebarSection
10
- * id="favorites"
11
- * label="Favorites"
12
- * icon="i-hugeicons-star"
13
- * :items="favoriteItems"
14
- * :expanded="true"
15
- * />
16
- */
17
-
18
- // Props
19
- export const id = $props.id || ''
20
- export const label = $props.label || ''
21
- export const icon = $props.icon || ''
22
- export const items = $props.items || []
23
- export const expanded = $props.expanded ?? true
24
- export const collapsible = $props.collapsible ?? true
25
- export const showLabel = $props.showLabel ?? true
26
- export const onToggle = $props.onToggle
27
- export const onItemClick = $props.onItemClick
28
-
29
- // Handle section header click
30
- function handleHeaderClick() {
31
- if (collapsible && onToggle) {
32
- onToggle(id)
33
- }
34
- }
35
-
36
- // Handle item click
37
- function handleItemClick(item, event) {
38
- if (onItemClick) {
39
- onItemClick(item, event)
40
- }
41
- }
42
-
43
- // Section header classes - macOS Finder style
44
- const headerClasses = [
45
- 'w-full flex items-center gap-2.5 px-2.5 py-1.5 rounded-md text-left',
46
- 'transition-all duration-150',
47
- 'text-black/60 dark:text-white/60',
48
- collapsible ? 'hover:bg-black/5 dark:hover:bg-white/10 cursor-pointer' : ''
49
- ].filter(Boolean).join(' ')
50
- </script>
51
-
52
- <div class="py-1">
53
- <!-- Section header -->
54
- @if(collapsible)
55
- <button
56
- type="button"
57
- class="{{ headerClasses }}"
58
- @click="handleHeaderClick"
59
- aria-expanded="{{ expanded }}"
60
- aria-controls="sidebar-section-{{ id }}"
61
- >
62
- @if(icon)
63
- <div class="{{ icon }} w-4 h-4 flex-shrink-0 opacity-70"></div>
64
- @endif
65
- @if(showLabel)
66
- <span class="flex-1 text-[13px] font-semibold tracking-tight truncate">
67
- {{ label }}
68
- </span>
69
- <div class="i-hugeicons-arrow-right-01 w-3 h-3 transition-transform duration-200 opacity-50 {{ expanded ? 'rotate-90' : '' }}"></div>
70
- @endif
71
- </button>
72
- @else
73
- <div class="{{ headerClasses }}">
74
- @if(icon)
75
- <div class="{{ icon }} w-4 h-4 flex-shrink-0 opacity-70"></div>
76
- @endif
77
- @if(showLabel)
78
- <span class="flex-1 text-[13px] font-semibold tracking-tight truncate">
79
- {{ label }}
80
- </span>
81
- @endif
82
- </div>
83
- @endif
84
-
85
- <!-- Section items -->
86
- @if(expanded && showLabel && items.length > 0)
87
- <div
88
- id="sidebar-section-{{ id }}"
89
- class="mt-1 space-y-0.5 overflow-hidden"
90
- role="group"
91
- aria-label="{{ label }}"
92
- >
93
- @foreach(items as item)
94
- <SidebarItem
95
- :id="item.id"
96
- :label="item.label"
97
- :icon="item.icon"
98
- :href="item.href"
99
- :badge="item.badge"
100
- :active="item.active"
101
- :disabled="item.disabled"
102
- :indent="true"
103
- @click="handleItemClick(item, $event)"
104
- />
105
- @endforeach
106
- </div>
107
- @endif
108
- </div>
@@ -1,74 +0,0 @@
1
- <script server>
2
- export const checked = $props.checked || false
3
- export const disabled = $props.disabled || false
4
- export const size = $props.size || 'md'
5
- export const className = $props.className || ''
6
- export const onChange = $props.onChange
7
- export const label = $props.label || ''
8
-
9
- // Size configurations using headwind
10
- const sizeConfig = {
11
- sm: {
12
- track: 'h-5 w-9',
13
- thumb: 'h-4 w-4',
14
- translate: 'translate-x-4',
15
- },
16
- md: {
17
- track: 'h-[38px] w-[74px]',
18
- thumb: 'h-[34px] w-[34px]',
19
- translate: 'translate-x-9',
20
- },
21
- lg: {
22
- track: 'h-12 w-24',
23
- thumb: 'h-11 w-11',
24
- translate: 'translate-x-12',
25
- },
26
- }
27
-
28
- const config = sizeConfig[size]
29
-
30
- // Track classes
31
- const trackBaseClasses = 'relative inline-flex shrink-0 cursor-pointer border-2 border-transparent rounded-full transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-offset-2 focus-visible:ring-offset-neutral-300 dark:focus-visible:ring-offset-neutral-700'
32
- const trackStateClasses = checked
33
- ? 'bg-blue-500 dark:bg-blue-600'
34
- : 'bg-neutral-400 dark:bg-neutral-600'
35
- const trackDisabledClasses = disabled
36
- ? 'opacity-50 cursor-not-allowed pointer-events-none'
37
- : ''
38
-
39
- export const trackClasses = `${trackBaseClasses} ${trackStateClasses} ${trackDisabledClasses} ${config.track} ${className}`.trim()
40
-
41
- // Thumb classes
42
- const thumbBaseClasses = 'pointer-events-none inline-block transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out'
43
- const thumbPositionClasses = checked ? config.translate : 'translate-x-0'
44
- export const thumbClasses = `${thumbBaseClasses} ${thumbPositionClasses} ${config.thumb}`.trim()
45
-
46
- // Toggle function
47
- export function toggle() {
48
- if (disabled) return
49
- onChange?.(!checked)
50
- }
51
- </script>
52
-
53
- <label class="inline-flex items-center gap-3 cursor-pointer">
54
- @if(label)
55
- <span class="text-sm font-medium text-neutral-700 dark:text-neutral-300">
56
- {{ label }}
57
- </span>
58
- @endif
59
-
60
- <button
61
- type="button"
62
- role="switch"
63
- aria-checked="{{ checked ? 'true' : 'false' }}"
64
- class="{{ trackClasses }}"
65
- @if(disabled)disabled aria-disabled="true"@endif
66
- @click="toggle"
67
- >
68
- <span class="sr-only">@if(label){{ label }}@else Toggle switch@endif</span>
69
- <span
70
- aria-hidden="true"
71
- class="{{ thumbClasses }}"
72
- />
73
- </button>
74
- </label>
@@ -1,145 +0,0 @@
1
- <script server>
2
- export const tabs = $props.tabs || []
3
- export const defaultTab = $props.defaultTab || 0
4
- export const orientation = $props.orientation || 'horizontal'
5
- export const variant = $props.variant || 'line'
6
- export const className = $props.className || ''
7
- export const onChange = $props.onChange
8
-
9
- let activeTab = defaultTab
10
-
11
- function selectTab(index) {
12
- activeTab = index
13
- if (onChange) {
14
- onChange(index, tabs[index])
15
- }
16
- }
17
-
18
- // Orientation classes
19
- const orientationClasses = {
20
- horizontal: 'flex-col',
21
- vertical: 'flex-row',
22
- }
23
-
24
- // Tab list orientation classes
25
- const tabListOrientationClasses = {
26
- horizontal: 'flex-row border-b',
27
- vertical: 'flex-col border-r',
28
- }
29
-
30
- // Variant classes for tab list
31
- const variantClasses = {
32
- line: 'border-gray-200 dark:border-gray-700',
33
- pills: 'gap-2 border-0 bg-gray-100 dark:bg-gray-800 p-1 rounded-lg',
34
- enclosed: 'border-gray-200 dark:border-gray-700',
35
- }
36
-
37
- // Tab button classes based on variant
38
- function getTabClasses(index, variant, orientation) {
39
- const isActive = index === activeTab
40
- const baseClasses = 'px-4 py-2 font-medium text-sm transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900'
41
-
42
- if (variant === 'line') {
43
- const borderPosition = orientation === 'horizontal' ? 'border-b-2' : 'border-r-2'
44
- return `${baseClasses} ${borderPosition} ${isActive ? 'border-blue-500 text-blue-600 dark:text-blue-400' : 'border-transparent text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:border-gray-300 dark:hover:border-gray-600'}`
45
- } else if (variant === 'pills') {
46
- return `${baseClasses} rounded-md ${isActive ? 'bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 shadow-sm' : 'text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200'}`
47
- } else if (variant === 'enclosed') {
48
- const borderClasses = orientation === 'horizontal' ? 'border-t border-l border-r rounded-t-md' : 'border-t border-l border-b rounded-l-md'
49
- return `${baseClasses} ${borderClasses} ${isActive ? 'bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 -mb-px' : 'bg-gray-50 dark:bg-gray-900 border-transparent hover:border-gray-200 dark:hover:border-gray-700'}`
50
- }
51
- }
52
-
53
- export const containerClasses = `flex ${orientationClasses[orientation]} ${className}`.trim()
54
- export const tabListClasses = `flex ${tabListOrientationClasses[orientation]} ${variantClasses[variant]}`.trim()
55
- export const tabPanelClasses = `p-4 focus:outline-none`.trim()
56
- </script>
57
-
58
- <div class="{{ containerClasses }}">
59
- <!-- Tab List -->
60
- <div
61
- class="{{ tabListClasses }}"
62
- role="tablist"
63
- aria-orientation="{{ orientation }}"
64
- >
65
- @foreach(tab in tabs)
66
- <button
67
- type="button"
68
- class="{{ getTabClasses($loop.index, variant, orientation) }}"
69
- role="tab"
70
- aria-selected="{{ activeTab === $loop.index ? 'true' : 'false' }}"
71
- aria-controls="tab-panel-{{ $loop.index }}"
72
- id="tab-{{ $loop.index }}"
73
- tabindex="{{ activeTab === $loop.index ? '0' : '-1' }}"
74
- @click="selectTab({{ $loop.index }})"
75
- onkeydown="handleKeyDown(event, {{ $loop.index }})"
76
- >
77
- @if(tab.icon)
78
- <span class="inline-flex items-center gap-2">
79
- <span innerHTML="{!! tab.icon !!}"></span>
80
- <span>{{ tab.label }}</span>
81
- </span>
82
- @else
83
- {{ tab.label }}
84
- @endif
85
- </button>
86
- @endforeach
87
- </div>
88
-
89
- <!-- Tab Panels -->
90
- @foreach(tab in tabs)
91
- @if(activeTab === $loop.index)
92
- <div
93
- id="tab-panel-{{ $loop.index }}"
94
- class="{{ tabPanelClasses }}"
95
- role="tabpanel"
96
- aria-labelledby="tab-{{ $loop.index }}"
97
- tabindex="0"
98
- >
99
- {!! tab.content !!}
100
- </div>
101
- @endif
102
- @endforeach
103
- </div>
104
-
105
- <script>
106
- function handleKeyDown(event, currentIndex) {
107
- const tabCount = tabs.length
108
- let newIndex = currentIndex
109
-
110
- if (orientation === 'horizontal') {
111
- if (event.key === 'ArrowRight') {
112
- event.preventDefault()
113
- newIndex = (currentIndex + 1) % tabCount
114
- } else if (event.key === 'ArrowLeft') {
115
- event.preventDefault()
116
- newIndex = (currentIndex - 1 + tabCount) % tabCount
117
- }
118
- } else {
119
- if (event.key === 'ArrowDown') {
120
- event.preventDefault()
121
- newIndex = (currentIndex + 1) % tabCount
122
- } else if (event.key === 'ArrowUp') {
123
- event.preventDefault()
124
- newIndex = (currentIndex - 1 + tabCount) % tabCount
125
- }
126
- }
127
-
128
- if (event.key === 'Home') {
129
- event.preventDefault()
130
- newIndex = 0
131
- } else if (event.key === 'End') {
132
- event.preventDefault()
133
- newIndex = tabCount - 1
134
- }
135
-
136
- if (newIndex !== currentIndex) {
137
- selectTab(newIndex)
138
- // Focus the new tab
139
- if (typeof window !== 'undefined') {
140
- const newTab = document.getElementById(`tab-${newIndex}`)
141
- if (newTab) newTab.focus()
142
- }
143
- }
144
- }
145
- </script>
@@ -1,101 +0,0 @@
1
- <script server>
2
- export const to = $props.to || 'body'
3
- export const disabled = $props.disabled || false
4
- export const defer = $props.defer || false
5
-
6
- let teleportContainer = null
7
- let teleportId = `teleport-${Math.random().toString(36).substr(2, 9)}`
8
-
9
- // Teleport content to target
10
- function teleport() {
11
- if (typeof window === 'undefined' || disabled)
12
- return
13
-
14
- // Get target element
15
- const targetElement = typeof to === 'string'
16
- ? document.querySelector(to)
17
- : to
18
-
19
- if (!targetElement) {
20
- console.warn(`Teleport target "${to}" not found`)
21
- return
22
- }
23
-
24
- // Get source element
25
- const sourceElement = document.getElementById(teleportId)
26
- if (!sourceElement)
27
- return
28
-
29
- // Create teleport container if needed
30
- if (!teleportContainer) {
31
- teleportContainer = document.createElement('div')
32
- teleportContainer.setAttribute('data-teleport-id', teleportId)
33
- }
34
-
35
- // Move all child nodes to container
36
- while (sourceElement.firstChild) {
37
- teleportContainer.appendChild(sourceElement.firstChild)
38
- }
39
-
40
- // Append to target
41
- targetElement.appendChild(teleportContainer)
42
- }
43
-
44
- // Return content back to original location
45
- function returnContent() {
46
- if (!teleportContainer || !teleportContainer.parentNode)
47
- return
48
-
49
- const sourceElement = document.getElementById(teleportId)
50
- if (!sourceElement)
51
- return
52
-
53
- // Move content back
54
- while (teleportContainer.firstChild) {
55
- sourceElement.appendChild(teleportContainer.firstChild)
56
- }
57
-
58
- // Remove container
59
- teleportContainer.parentNode.removeChild(teleportContainer)
60
- teleportContainer = null
61
- }
62
-
63
- // Initialize teleport
64
- if (typeof window !== 'undefined') {
65
- if (defer) {
66
- // Defer until next tick
67
- window.addEventListener('DOMContentLoaded', () => {
68
- setTimeout(teleport, 0)
69
- })
70
- }
71
- else {
72
- // Immediate
73
- window.addEventListener('DOMContentLoaded', teleport)
74
- }
75
-
76
- // Cleanup on page unload
77
- window.addEventListener('beforeunload', returnContent)
78
- }
79
- </script>
80
-
81
- @if(disabled)
82
- <!-- Render in place if disabled -->
83
- <slot />
84
- @else
85
- <!-- Source container -->
86
- <div id="{{ teleportId }}" data-teleport-source="true">
87
- <slot />
88
- </div>
89
- @endif
90
-
91
- <script>
92
- // Trigger teleport after render
93
- if (typeof window !== 'undefined' && document.readyState === 'complete') {
94
- if (defer) {
95
- setTimeout(teleport, 0)
96
- }
97
- else {
98
- teleport()
99
- }
100
- }
101
- </script>