@stacksjs/defaults 0.70.54

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 (286) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +2 -0
  3. package/package.json +20 -0
  4. package/resources/assets/fonts/013717e9.woff +0 -0
  5. package/resources/assets/fonts/03355817.woff2 +0 -0
  6. package/resources/assets/fonts/0380de7e.woff2 +0 -0
  7. package/resources/assets/fonts/0ba5d32a.woff +0 -0
  8. package/resources/assets/fonts/0bd57ddf.woff2 +0 -0
  9. package/resources/assets/fonts/19de0a60.woff2 +0 -0
  10. package/resources/assets/fonts/20b87e84.woff +0 -0
  11. package/resources/assets/fonts/4bbc67e1.woff +0 -0
  12. package/resources/assets/fonts/576fb0d7.woff +0 -0
  13. package/resources/assets/fonts/5ea10ee5.woff2 +0 -0
  14. package/resources/assets/fonts/6413fc0a.woff +0 -0
  15. package/resources/assets/fonts/72c114cf.woff +0 -0
  16. package/resources/assets/fonts/73c57e73.woff2 +0 -0
  17. package/resources/assets/fonts/813dca6c.woff +0 -0
  18. package/resources/assets/fonts/8a9b0995.woff2 +0 -0
  19. package/resources/assets/fonts/90b4832f.woff +0 -0
  20. package/resources/assets/fonts/9394ab85.woff2 +0 -0
  21. package/resources/assets/fonts/9b3c7d7f.woff2 +0 -0
  22. package/resources/assets/fonts/Monaco.ttf +0 -0
  23. package/resources/assets/fonts/b1b36d74.woff +0 -0
  24. package/resources/assets/fonts/b5d74798.woff2 +0 -0
  25. package/resources/assets/fonts/b9f81a4d.woff +0 -0
  26. package/resources/assets/fonts/c9784008.woff2 +0 -0
  27. package/resources/assets/fonts/cf692227.woff +0 -0
  28. package/resources/assets/fonts/d1c6ab51.woff2 +0 -0
  29. package/resources/assets/fonts/e2eb62fc.woff +0 -0
  30. package/resources/assets/fonts/fe21f8d8.woff2 +0 -0
  31. package/resources/assets/fonts/nps/CampmateScript-Regular.woff2 +0 -0
  32. package/resources/assets/fonts/nps/NPS_2026-variable.woff2 +0 -0
  33. package/resources/assets/fonts/nps/RedwoodSerif-Regular.woff2 +0 -0
  34. package/resources/assets/fonts/nps/SequoiaSans-Regular.woff2 +0 -0
  35. package/resources/assets/fonts/nps/Switchback-Regular.woff2 +0 -0
  36. package/resources/assets/images/app-icon.png +0 -0
  37. package/resources/assets/images/bg-img.png +0 -0
  38. package/resources/assets/images/park-ridge.svg +15 -0
  39. package/resources/assets/images/topography.svg +1 -0
  40. package/resources/assets/scripts/main.ts +2153 -0
  41. package/resources/assets/styles/README.md +19 -0
  42. package/resources/assets/styles/docs/main.css +1 -0
  43. package/resources/assets/styles/docs/overrides.css +1 -0
  44. package/resources/assets/styles/docs/vars.css +8 -0
  45. package/resources/assets/styles/main.css +1419 -0
  46. package/resources/components/Button.stx +70 -0
  47. package/resources/components/Buttons/BaseButton.stx +39 -0
  48. package/resources/components/Buttons/Counter.stx +28 -0
  49. package/resources/components/Buttons/ToggleDark.stx +11 -0
  50. package/resources/components/Container.stx +10 -0
  51. package/resources/components/Dashboard/.gitkeep +0 -0
  52. package/resources/components/Dashboard/Auth/ForgotPassword.stx +127 -0
  53. package/resources/components/Dashboard/Auth/Login.stx +212 -0
  54. package/resources/components/Dashboard/Auth/Register.stx +306 -0
  55. package/resources/components/Dashboard/Avatar.stx +123 -0
  56. package/resources/components/Dashboard/Billing/ActivePlan.stx +57 -0
  57. package/resources/components/Dashboard/Billing/CardBrands.stx +32 -0
  58. package/resources/components/Dashboard/Billing/CardForm.stx +34 -0
  59. package/resources/components/Dashboard/Billing/OneTimePayment.stx +28 -0
  60. package/resources/components/Dashboard/Billing/PaymentForm.stx +33 -0
  61. package/resources/components/Dashboard/Billing/PaymentMethod.stx +66 -0
  62. package/resources/components/Dashboard/Billing/PaymentMethodList.stx +52 -0
  63. package/resources/components/Dashboard/Billing/Plans.stx +136 -0
  64. package/resources/components/Dashboard/Buttons/AppButton.stx +48 -0
  65. package/resources/components/Dashboard/Buttons/IconButton.stx +20 -0
  66. package/resources/components/Dashboard/Card.stx +78 -0
  67. package/resources/components/Dashboard/Chart.stx +75 -0
  68. package/resources/components/Dashboard/CodeEditor.stx +41 -0
  69. package/resources/components/Dashboard/Commerce/BulkActionBar.stx +70 -0
  70. package/resources/components/Dashboard/Commerce/CategoriesTable.stx +133 -0
  71. package/resources/components/Dashboard/Commerce/CouponsTable.stx +161 -0
  72. package/resources/components/Dashboard/Commerce/CustomersTable.stx +142 -0
  73. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +80 -0
  74. package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryTable.stx +85 -0
  75. package/resources/components/Dashboard/Commerce/Delivery/DriversTable.stx +99 -0
  76. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysTable.stx +92 -0
  77. package/resources/components/Dashboard/Commerce/Delivery/LicenseTemplatesTable.stx +88 -0
  78. package/resources/components/Dashboard/Commerce/Delivery/Pagination.stx +122 -0
  79. package/resources/components/Dashboard/Commerce/Delivery/SearchFilter.stx +23 -0
  80. package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsTable.stx +80 -0
  81. package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesTable.stx +59 -0
  82. package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesTable.stx +71 -0
  83. package/resources/components/Dashboard/Commerce/Delivery/TabNavigation.stx +36 -0
  84. package/resources/components/Dashboard/Commerce/Forms/CouponsForm.stx +191 -0
  85. package/resources/components/Dashboard/Commerce/OrdersTable.stx +131 -0
  86. package/resources/components/Dashboard/Commerce/ProductsTable.stx +170 -0
  87. package/resources/components/Dashboard/CreateRecordModal.stx +363 -0
  88. package/resources/components/Dashboard/DashboardLayout.stx +155 -0
  89. package/resources/components/Dashboard/Deployments/ActivityFeed.stx +54 -0
  90. package/resources/components/Dashboard/Deployments/DeployScript.stx +23 -0
  91. package/resources/components/Dashboard/Deployments/DeploymentHistory.stx +97 -0
  92. package/resources/components/Dashboard/Deployments/DeploymentList.stx +94 -0
  93. package/resources/components/Dashboard/Deployments/LiveTerminalOutput.stx +18 -0
  94. package/resources/components/Dashboard/Elements/Dropdown.stx +57 -0
  95. package/resources/components/Dashboard/Email/EmailActivityChart.stx +111 -0
  96. package/resources/components/Dashboard/Email/EmailCompose.stx +72 -0
  97. package/resources/components/Dashboard/Email/EmailDetail.stx +105 -0
  98. package/resources/components/Dashboard/Email/EmailList.stx +117 -0
  99. package/resources/components/Dashboard/Email/EmailSearch.stx +40 -0
  100. package/resources/components/Dashboard/Email/EmailSidebar.stx +133 -0
  101. package/resources/components/Dashboard/GlobalSearch.stx +124 -0
  102. package/resources/components/Dashboard/MobileSidebar.stx +47 -0
  103. package/resources/components/Dashboard/Modals/BaseModal.stx +50 -0
  104. package/resources/components/Dashboard/Modals/Popups/Alert.stx +112 -0
  105. package/resources/components/Dashboard/Modals/Popups/Toast.stx +70 -0
  106. package/resources/components/Dashboard/Modals/ToastWrapper.stx +35 -0
  107. package/resources/components/Dashboard/Monitoring/ErrorDetailModal.stx +228 -0
  108. package/resources/components/Dashboard/Monitoring/ErrorsTable.stx +184 -0
  109. package/resources/components/Dashboard/Navbar.stx +194 -0
  110. package/resources/components/Dashboard/NavbarModern.stx +188 -0
  111. package/resources/components/Dashboard/NotificationErrorModal.stx +105 -0
  112. package/resources/components/Dashboard/NotificationStatusBadge.stx +20 -0
  113. package/resources/components/Dashboard/Pagination.stx +90 -0
  114. package/resources/components/Dashboard/Queue/QueueTable.stx +127 -0
  115. package/resources/components/Dashboard/Settings/Forms/AIForm.stx +126 -0
  116. package/resources/components/Dashboard/Settings/Forms/AnalyticsForm.stx +52 -0
  117. package/resources/components/Dashboard/Settings/Forms/AppForm.stx +157 -0
  118. package/resources/components/Dashboard/Settings/Forms/CLIForm.stx +66 -0
  119. package/resources/components/Dashboard/Settings/Forms/CacheForm.stx +253 -0
  120. package/resources/components/Dashboard/Settings/Forms/CloudForm.stx +441 -0
  121. package/resources/components/Dashboard/Settings/Forms/DNSForm.stx +307 -0
  122. package/resources/components/Dashboard/Settings/Forms/DatabaseForm.stx +168 -0
  123. package/resources/components/Dashboard/Settings/Forms/EmailForm.stx +100 -0
  124. package/resources/components/Dashboard/Settings/Forms/FileSystemForm.stx +259 -0
  125. package/resources/components/Dashboard/Settings/Forms/HashingForm.stx +119 -0
  126. package/resources/components/Dashboard/Settings/Forms/LibraryForm.stx +389 -0
  127. package/resources/components/Dashboard/Settings/Forms/QueueForm.stx +219 -0
  128. package/resources/components/Dashboard/Settings/Forms/SearchEngineForm.stx +48 -0
  129. package/resources/components/Dashboard/Settings/Forms/SecurityForm.stx +143 -0
  130. package/resources/components/Dashboard/Settings/Forms/ServicesForm.stx +194 -0
  131. package/resources/components/Dashboard/Settings/Forms/StorageForm.stx +191 -0
  132. package/resources/components/Dashboard/Settings/Forms/TeamsForm.stx +33 -0
  133. package/resources/components/Dashboard/Settings/SettingsFormManager.stx +181 -0
  134. package/resources/components/Dashboard/SettingsHeader.stx +88 -0
  135. package/resources/components/Dashboard/SettingsSidebar.stx +234 -0
  136. package/resources/components/Dashboard/Sidebar.stx +23 -0
  137. package/resources/components/Dashboard/SidebarModern.stx +249 -0
  138. package/resources/components/Dashboard/Skeleton/LoadingCard.stx +15 -0
  139. package/resources/components/Dashboard/Skeleton/LoadingDetails.stx +26 -0
  140. package/resources/components/Dashboard/Table.stx +82 -0
  141. package/resources/components/Dashboard/TerminalContainer.stx +97 -0
  142. package/resources/components/Dashboard/Tooltip.stx +166 -0
  143. package/resources/components/Dashboard/Transaction/index.stx +88 -0
  144. package/resources/components/Dashboard/UI/ActivityTable.stx +54 -0
  145. package/resources/components/Dashboard/UI/Avatar.stx +102 -0
  146. package/resources/components/Dashboard/UI/Badge.stx +66 -0
  147. package/resources/components/Dashboard/UI/Button.stx +73 -0
  148. package/resources/components/Dashboard/UI/Card.stx +51 -0
  149. package/resources/components/Dashboard/UI/ChartCard.stx +36 -0
  150. package/resources/components/Dashboard/UI/Checkbox.stx +74 -0
  151. package/resources/components/Dashboard/UI/ConfirmDialog.stx +74 -0
  152. package/resources/components/Dashboard/UI/DataTable.stx +45 -0
  153. package/resources/components/Dashboard/UI/Dropdown.stx +72 -0
  154. package/resources/components/Dashboard/UI/DropdownItem.stx +80 -0
  155. package/resources/components/Dashboard/UI/EmptyState.stx +50 -0
  156. package/resources/components/Dashboard/UI/FilterBar.stx +48 -0
  157. package/resources/components/Dashboard/UI/Input.stx +77 -0
  158. package/resources/components/Dashboard/UI/Modal.stx +75 -0
  159. package/resources/components/Dashboard/UI/PageHeader.stx +69 -0
  160. package/resources/components/Dashboard/UI/PageLayout.stx +84 -0
  161. package/resources/components/Dashboard/UI/Pagination.stx +126 -0
  162. package/resources/components/Dashboard/UI/QuickLinks.stx +31 -0
  163. package/resources/components/Dashboard/UI/RouterLink.stx +31 -0
  164. package/resources/components/Dashboard/UI/Select.stx +84 -0
  165. package/resources/components/Dashboard/UI/ServiceHealth.stx +38 -0
  166. package/resources/components/Dashboard/UI/StatsCard.stx +79 -0
  167. package/resources/components/Dashboard/UI/Table.stx +143 -0
  168. package/resources/components/Dashboard/UI/Tabs.stx +45 -0
  169. package/resources/components/Dashboard/UI/Textarea.stx +93 -0
  170. package/resources/components/Dashboard/UI/Toggle.stx +84 -0
  171. package/resources/components/Dashboard/UI/WindowControls.stx +135 -0
  172. package/resources/components/Dashboard/Widget.stx +89 -0
  173. package/resources/components/Dashboard/WindowControls.stx +119 -0
  174. package/resources/components/Dashboard/index.ts +106 -0
  175. package/resources/components/Docs/Demo/ComboboxCode.md +114 -0
  176. package/resources/components/Docs/Demo/ComboboxDemo.stx +91 -0
  177. package/resources/components/Docs/Demo/DialogCode.md +42 -0
  178. package/resources/components/Docs/Demo/DialogDemo.stx +76 -0
  179. package/resources/components/Docs/Demo/DocsPlayground.stx +39 -0
  180. package/resources/components/Docs/Demo/DropdownCode.md +109 -0
  181. package/resources/components/Docs/Demo/DropdownDemo.stx +82 -0
  182. package/resources/components/Docs/Demo/Hero.stx +100 -0
  183. package/resources/components/Docs/Demo/ListboxCode.md +87 -0
  184. package/resources/components/Docs/Demo/ListboxDemo.stx +59 -0
  185. package/resources/components/Docs/Demo/NotificationCode.md +173 -0
  186. package/resources/components/Docs/Demo/NotificationDemo.stx +99 -0
  187. package/resources/components/Docs/Demo/PopoverCode.md +161 -0
  188. package/resources/components/Docs/Demo/PopoverDemo.stx +96 -0
  189. package/resources/components/Docs/Demo/RadioGroupCode.md +98 -0
  190. package/resources/components/Docs/Demo/RadioGroupDemo.stx +53 -0
  191. package/resources/components/Docs/Demo/StepperCode.md +216 -0
  192. package/resources/components/Docs/Demo/StepperDemo.stx +137 -0
  193. package/resources/components/Docs/Demo/SwitchCode.md +24 -0
  194. package/resources/components/Docs/Demo/SwitchDemo.stx +28 -0
  195. package/resources/components/Docs/Home.stx +7 -0
  196. package/resources/components/Docs/HomeContributors.stx +23 -0
  197. package/resources/components/Docs/HomeSponsors.stx +17 -0
  198. package/resources/components/Docs/HomeTeam.stx +18 -0
  199. package/resources/components/Docs/TeamMember.stx +79 -0
  200. package/resources/components/Email/EmailButton.stx +32 -0
  201. package/resources/components/Email/EmailDivider.stx +20 -0
  202. package/resources/components/Email/EmailImage.stx +24 -0
  203. package/resources/components/Email/EmailLayout.stx +55 -0
  204. package/resources/components/Email/EmailLink.stx +22 -0
  205. package/resources/components/Email/EmailSection.stx +20 -0
  206. package/resources/components/Email/EmailText.stx +30 -0
  207. package/resources/components/Forum/ForumBreadcrumb.stx +38 -0
  208. package/resources/components/Forum/ForumCategory.stx +16 -0
  209. package/resources/components/Forum/ForumCategoryItem.stx +46 -0
  210. package/resources/components/Forum/ForumLayout.stx +36 -0
  211. package/resources/components/Forum/ForumPagination.stx +39 -0
  212. package/resources/components/Forum/ForumPost.stx +71 -0
  213. package/resources/components/Forum/ForumReplyForm.stx +76 -0
  214. package/resources/components/Forum/ForumSidebar.stx +86 -0
  215. package/resources/components/Forum/ForumTopicItem.stx +77 -0
  216. package/resources/components/Forum/ForumTopicList.stx +23 -0
  217. package/resources/components/HelloWorld.stx +253 -0
  218. package/resources/components/Logo.stx +10 -0
  219. package/resources/components/Marketing/CallToAction.stx +30 -0
  220. package/resources/components/Marketing/ComingSoon.stx +155 -0
  221. package/resources/components/Marketing/Faqs.stx +99 -0
  222. package/resources/components/Marketing/Feature.stx +32 -0
  223. package/resources/components/Marketing/Fields.stx +28 -0
  224. package/resources/components/Marketing/Footer.stx +33 -0
  225. package/resources/components/Marketing/Header.stx +51 -0
  226. package/resources/components/Marketing/Hero.stx +46 -0
  227. package/resources/components/Marketing/Layout.stx +26 -0
  228. package/resources/components/Marketing/NavLink.stx +13 -0
  229. package/resources/components/Marketing/Plan.stx +43 -0
  230. package/resources/components/Marketing/Pricing.stx +120 -0
  231. package/resources/components/Marketing/PrimaryFeatures.stx +80 -0
  232. package/resources/components/Marketing/PrimaryFeatures2.stx +98 -0
  233. package/resources/components/Marketing/SecondaryFeatures.stx +80 -0
  234. package/resources/components/Marketing/Testimonials.stx +120 -0
  235. package/resources/components/Pagination.stx +149 -0
  236. package/resources/components/Playground.stx +9 -0
  237. package/resources/components/README.md +87 -0
  238. package/resources/components/Storefront/AnnouncementBar.stx +17 -0
  239. package/resources/components/Storefront/CartDrawer.stx +227 -0
  240. package/resources/components/Storefront/CheckoutSteps.stx +50 -0
  241. package/resources/components/Storefront/Footer.stx +81 -0
  242. package/resources/components/Storefront/Header.stx +66 -0
  243. package/resources/components/Storefront/OrderSummary.stx +79 -0
  244. package/resources/components/Storefront/ProductCard.stx +63 -0
  245. package/resources/components/Storefront/ProductGallery.stx +88 -0
  246. package/resources/components/Storefront/QuantitySelector.stx +97 -0
  247. package/resources/components/index.ts +13 -0
  248. package/resources/emails/email-verification.stx +46 -0
  249. package/resources/emails/layouts/base.html +113 -0
  250. package/resources/emails/password-changed.stx +55 -0
  251. package/resources/emails/password-reset.stx +43 -0
  252. package/resources/emails/subscription-confirmation.stx +99 -0
  253. package/resources/emails/welcome.stx +48 -0
  254. package/resources/functions/README.md +28 -0
  255. package/resources/functions/counter.ts +13 -0
  256. package/resources/functions/dark.ts +4 -0
  257. package/resources/functions/dashboard/analytics.ts +238 -0
  258. package/resources/functions/dashboard/config-io.ts +316 -0
  259. package/resources/functions/dashboard/data.ts +375 -0
  260. package/resources/functions/dashboard/library.ts +250 -0
  261. package/resources/functions/dashboard/sidebar.ts +537 -0
  262. package/resources/functions/dashboard/system.ts +150 -0
  263. package/resources/layouts/403.stx +188 -0
  264. package/resources/layouts/404.stx +34 -0
  265. package/resources/layouts/README.md +14 -0
  266. package/resources/layouts/dashboard/default.stx +20 -0
  267. package/resources/layouts/dashboard/guest.stx +10 -0
  268. package/resources/layouts/default.stx +3 -0
  269. package/resources/layouts/maintenance.stx +11 -0
  270. package/resources/layouts/storefront.stx +73 -0
  271. package/resources/layouts/system-tray/default.stx +3 -0
  272. package/resources/modules/.gitkeep +0 -0
  273. package/resources/plugins/.gitkeep +0 -0
  274. package/resources/plugins/preloader.ts +308 -0
  275. package/resources/types/README.md +3 -0
  276. package/resources/views/cart.stx +149 -0
  277. package/resources/views/checkout/contact.stx +101 -0
  278. package/resources/views/checkout/payment.stx +114 -0
  279. package/resources/views/checkout/shipping.stx +120 -0
  280. package/resources/views/coming-soon.stx +9 -0
  281. package/resources/views/dashboard/custom-page.stx +45 -0
  282. package/resources/views/dashboard/index.stx +24 -0
  283. package/resources/views/emails/welcome.stx +0 -0
  284. package/resources/views/errors/tester.stx +26 -0
  285. package/resources/views/index.stx +2865 -0
  286. package/resources/views/orders/[id].stx +130 -0
@@ -0,0 +1,42 @@
1
+ ```vue
2
+ <!-- App.vue -->
3
+ <script lang="ts" setup>
4
+ import { Dialog, DialogPanel } from '@stacksjs/dialog'
5
+
6
+ const visible = ref(false)
7
+
8
+ const handleClose = () => {
9
+ visible.value = false
10
+ }
11
+ </script>
12
+
13
+ <template>
14
+ <Transition name="fade" appear>
15
+ <Dialog v-if="visible" @close="handleClose">
16
+
17
+ <Transition name="fade" appear>
18
+ <DialogPanel as="div">
19
+ <h2>Greetings! This is a dialog.</h2>
20
+ </DialogPanel>
21
+ </Transition>
22
+ </Dialog>
23
+ </Transition>
24
+
25
+ <button @click="visible = true">
26
+ Open Dialog
27
+ </button>
28
+ </template>
29
+
30
+ <style scoped>
31
+ .fade-enter-active,
32
+ .fade-leave-active {
33
+ transition: opacity .4s linear;
34
+ }
35
+
36
+ .fade-enter-from,
37
+ .fade-leave-to {
38
+ opacity: 0;
39
+ }
40
+ </style>
41
+
42
+ ```
@@ -0,0 +1,76 @@
1
+ <script>
2
+ interface DialogDemoProps {
3
+ visible?: boolean
4
+ currentTransition?: string
5
+ }
6
+
7
+ const { visible = false, currentTransition = 'fade' } = defineProps<DialogDemoProps>()
8
+ </script>
9
+ <div class="max-w-4xl">
10
+ <DocsPlayground>
11
+ <div class="flex flex-col items-center justify-center mb-12 space-y-4 h-[300px]">
12
+ <button
13
+ class="inline-flex items-center px-4 py-2 font-medium text-sm text-white bg-indigo-600 hover:bg-indigo-700 border border-transparent rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 shadow-sm duration-200 transition-colors"
14
+ data-action="open-dialog"
15
+ >
16
+ <div class="mr-2 h-5 w-5"></div>
17
+ <i class="hgi hgi-check hgi-stroke"></i> Show Dialog
18
+ </button>
19
+ </div>
20
+
21
+ <div slot="code">
22
+ <!-- DialogCode component would be rendered here -->
23
+ </div>
24
+ </DocsPlayground>
25
+
26
+ <!-- Dialog Component -->
27
+ @if(visible)
28
+ <div class="relative z-50">
29
+ <div class="fixed inset-0 bg-black/30" aria-hidden="true" data-action="close-dialog"></div>
30
+
31
+ <div class="flex fixed inset-0 items-center justify-center p-4">
32
+ <div class="mx-auto p-6 max-w-sm bg-white rounded-xl shadow-xl">
33
+ <div class="flex items-center justify-between mb-4">
34
+ <h3 class="font-medium text-gray-900 text-lg">Dialog Title</h3>
35
+ <button
36
+ class="p-1 text-gray-400 hover:text-gray-500 rounded-full focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
37
+ data-action="close-dialog"
38
+ >
39
+ <div class="h-5 w-5 i-hugeicons-cancel-01-20-solid"></div>
40
+ </button>
41
+ </div>
42
+
43
+ <p class="text-gray-500 text-sm">
44
+ Here is the content of the dialog. You can customize this content to show any information you need.
45
+ </p>
46
+
47
+ <div class="flex gap-3 justify-end mt-6">
48
+ <button
49
+ class="inline-flex items-center px-3 py-2 font-medium text-gray-700 text-sm bg-white hover:bg-gray-50 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
50
+ data-action="close-dialog"
51
+ >
52
+ Cancel
53
+ </button>
54
+ <button
55
+ class="inline-flex items-center px-3 py-2 font-medium text-sm text-white bg-indigo-600 hover:bg-indigo-700 border border-transparent rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
56
+ data-action="close-dialog"
57
+ >
58
+ Confirm
59
+ </button>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ @endif
65
+ </div>
66
+ <style>
67
+ .fade-enter-active,
68
+ .fade-leave-active {
69
+ transition: opacity .4s linear;
70
+ }
71
+
72
+ .fade-enter-from,
73
+ .fade-leave-to {
74
+ opacity: 0;
75
+ }
76
+ </style>
@@ -0,0 +1,39 @@
1
+ <script>
2
+ interface DocsPlaygroundProps {
3
+ isPreviewMode?: boolean
4
+ }
5
+
6
+ const { isPreviewMode = true } = defineProps<DocsPlaygroundProps>()
7
+ </script>
8
+ <div class="flex flex-col gap-4">
9
+ <div class="flex flex-col gap-2">
10
+ <div class="relative bg-gray-100 dark:bg-neutral-800 rounded-lg">
11
+ <div class="flex items-stretch justify-end px-3 py-1 md:m-1 bg-gray-100 dark:bg-neutral-800 rounded-t-[10px] md:rounded-lg">
12
+ <button
13
+ class="flex mr-1 px-3 py-2 font-medium text-blue-500' text-xs dark:text-neutral-300 hover:bg-gray-300 dark:hover:bg-neutral-600' rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/50 pointer-events-auto : ? 'bg-white 'text-gray-600 {{ }} isPreviewMode"
14
+ data-action="toggle-preview"
15
+ >
16
+ Preview
17
+ </button>
18
+ <button
19
+ class="flex px-3 py-2 font-medium text-blue-500' text-xs dark:text-neutral-300 hover:bg-gray-300 dark:hover:bg-neutral-600' rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/50 pointer-events-auto : !isPreviewMode ? 'bg-white 'text-gray-600 {{ }}"
20
+ data-action="toggle-code"
21
+ >
22
+ Code
23
+ </button>
24
+ </div>
25
+
26
+ <div>
27
+ @if(isPreviewMode)
28
+ <div class="relative z-30 px-4 py-4 h-full">
29
+ <slot />
30
+ </div>
31
+ @else
32
+ <div class="overflow-auto relative z-30 h-[350px] text-sm">
33
+ <slot name="code" />
34
+ </div>
35
+ @endif
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </div>
@@ -0,0 +1,109 @@
1
+ ```vue
2
+ <script lang="ts" setup>
3
+ import { ref } from '@stacksjs/stx'
4
+ import { Dropdown, DropdownButton, DropdownItem, DropdownItems } from '@stacksjs/dropdown'
5
+
6
+ interface MenuItem {
7
+ icon?: string
8
+ label?: string
9
+ action?: () => void
10
+ divider?: boolean
11
+ variant?: 'danger' | 'default'
12
+ }
13
+
14
+ type MenuSection = (MenuItem | { divider: true })[]
15
+
16
+ const menuItems: MenuSection = [
17
+ { icon: 'i-hugeicons-pencil-20-solid', label: 'Edit', action: () => console.log('Edit clicked') },
18
+ { icon: 'i-hugeicons-document-duplicate-20-solid', label: 'Duplicate', action: () => console.log('Duplicate clicked') },
19
+ { divider: true },
20
+ { icon: 'i-hugeicons-archive-box-20-solid', label: 'Archive', action: () => console.log('Archive clicked') },
21
+ { icon: 'i-hugeicons-arrow-path-20-solid', label: 'Move', action: () => console.log('Move clicked') },
22
+ { divider: true },
23
+ { icon: 'i-hugeicons-trash-20-solid', label: 'Delete', variant: 'danger', action: () => console.log('Delete clicked') },
24
+ ]
25
+
26
+ const isOpen = ref(false)
27
+
28
+ function groupMenuItems(items: MenuSection): MenuItem[][] {
29
+ return items.reduce((acc: MenuItem[][], item) => {
30
+ if ('divider' in item && item.divider && acc.length > 0) {
31
+ acc.push([])
32
+ } else if (!('divider' in item) || !item.divider) {
33
+ if (acc.length === 0) acc.push([])
34
+ acc[acc.length - 1].push(item as MenuItem)
35
+ }
36
+ return acc
37
+ }, [])
38
+ }
39
+ </script>
40
+
41
+ <template>
42
+ <Dropdown v-model="isOpen" as="div" class="inline-block relative text-left">
43
+ <DropdownButton
44
+ class="inline-flex gap-2 items-center justify-center px-4 py-2.5 font-medium text-sm text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 shadow-sm duration-200 transition-all"
45
+ >
46
+ Options
47
+ <div
48
+ class="h-5 w-5 duration-200 transition-transform i-hugeicons-chevron-down-20-solid"
49
+ :class="'rotate-180': { } isOpen"
50
+ />
51
+ </DropdownButton>
52
+
53
+ <transition
54
+ enter-active-class="duration-100 ease-out transition"
55
+ enter-from-class="opacity-0 scale-95 transform"
56
+ enter-to-class="opacity-100 scale-100 transform"
57
+ leave-active-class="duration-75 ease-in transition"
58
+ leave-from-class="opacity-100 scale-100 transform"
59
+ leave-to-class="opacity-0 scale-95 transform"
60
+ >
61
+ <DropdownItems
62
+ class="absolute right-0 mt-2 w-56 bg-white divide-gray-100 divide-y ring-1 ring-black/5 rounded-lg focus:outline-none shadow-lg origin-top-right"
63
+ >
64
+ <div
65
+ v-for="(section, index) in groupMenuItems(menuItems)"
66
+ :key="index"
67
+ class="p-1"
68
+ >
69
+ <DropdownItem
70
+ v-for="(item, itemIndex) in section"
71
+ :key="itemIndex"
72
+ v-slot="{ active }"
73
+ @click="item.action?.()"
74
+ >
75
+ <button
76
+ type="button"
77
+ class="flex relative items-center px-2 py-2 w-full text-sm outline-none rounded-md transition-colors group"
78
+ :class="[
79
+ active
80
+ ? item.variant === 'danger'
81
+ ? 'bg-red-500 text-white'
82
+ : 'bg-indigo-500 text-white'
83
+ : item.variant === 'danger'
84
+ ? 'text-red-600 hover:bg-red-50'
85
+ : 'text-gray-700 hover:bg-gray-50',
86
+ ]"
87
+ >
88
+ <div
89
+ v-if="item.icon"
90
+ :class="[
91
+ item.icon,
92
+ 'mr-2 h-5 w-5',
93
+ active
94
+ ? 'text-white'
95
+ : item.variant === 'danger'
96
+ ? 'text-red-600'
97
+ : 'text-gray-500 group-hover:text-gray-700'
98
+ ]"
99
+ />
100
+ {{ item.label }}
101
+ </button>
102
+ </DropdownItem>
103
+ </div>
104
+ </DropdownItems>
105
+ </transition>
106
+ </Dropdown>
107
+ </template>
108
+
109
+ ```
@@ -0,0 +1,82 @@
1
+ <script>
2
+ interface DropdownDemoProps {
3
+ menuItems?: string
4
+ isOpen?: boolean
5
+ }
6
+
7
+ const { menuItems = [, isOpen = false } = defineProps<DropdownDemoProps>()
8
+
9
+ { icon: 'i-hugeicons-pencil-20-solid', label: 'Edit' },
10
+ { icon: 'i-hugeicons-document-duplicate-20-solid', label: 'Duplicate' },
11
+ { divider: true },
12
+ { icon: 'i-hugeicons-archive-box-20-solid', label: 'Archive' },
13
+ { icon: 'i-hugeicons-arrow-path-20-solid', label: 'Move' },
14
+ { divider: true },
15
+ { icon: 'i-hugeicons-trash-20-solid', label: 'Delete', variant: 'danger' },
16
+ ]
17
+ function getMenuSections(items) {
18
+ const sections = []
19
+ let currentSection = []
20
+
21
+ for (const item of items) {
22
+ if (item.divider) {
23
+ if (currentSection.length > 0) {
24
+ sections.push(currentSection)
25
+ currentSection = []
26
+ }
27
+ } else {
28
+ currentSection.push(item)
29
+ }
30
+ }
31
+
32
+ if (currentSection.length > 0) {
33
+ sections.push(currentSection)
34
+ }
35
+
36
+ return sections
37
+ }
38
+ </script>
39
+ <div class="max-w-4xl">
40
+ <DocsPlayground>
41
+ <div class="flex flex-col items-center justify-center mb-12 space-y-4 h-[200px]">
42
+ <div class="inline-block relative text-left">
43
+ <button
44
+ class="inline-flex gap-2 items-center justify-center px-4 py-2.5 font-medium text-sm text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 shadow-sm duration-200 transition-all"
45
+ data-action="toggle-dropdown"
46
+ >
47
+ Options
48
+ <div class="h-5 w-5 duration-200 transition-transform : ? '' 'rotate-180' {{ }} i-hugeicons-chevron-down-20-solid isOpen"></div>
49
+ </button>
50
+
51
+ @if(isOpen)
52
+ <div class="absolute right-0 mt-2 w-56 bg-white divide-gray-100 divide-y ring-1 ring-black/5 rounded-lg focus:outline-none shadow-lg origin-top-right">
53
+ @foreach(getMenuSections(menuItems) as section)
54
+ <div class="p-1">
55
+ @foreach(section as item)
56
+ <button
57
+ type="button"
58
+ class="flex relative items-center px-2 py-2 w-full text-sm hover:bg-gray-50' hover:bg-red-50' outline-none rounded-md transition-colors : ? 'danger' 'text-gray-700 'text-red-600 {{ }} == group item.variant"
59
+ data-action="menu-item"
60
+ data-item-label="{{ item.label }}"
61
+ >
62
+ <div class="mr-2 h-5 w-5 group-hover:text-gray-700' : ? 'danger' 'text-gray-500 'text-red-600' {{ {{ }} }} == item.icon item.variant"></div>
63
+ {{ item.label }}
64
+ </button>
65
+ @endforeach
66
+ </div>
67
+ @endforeach
68
+ </div>
69
+ @endif
70
+ </div>
71
+ </div>
72
+
73
+ <div slot="code">
74
+ <!-- DropdownCode component would be rendered here -->
75
+ </div>
76
+ </DocsPlayground>
77
+ </div>
78
+ <style>
79
+ .rotate-180 {
80
+ transform: rotate(180deg);
81
+ }
82
+ </style>
@@ -0,0 +1,100 @@
1
+ <script>
2
+ interface HeroProps {
3
+ title?: string
4
+ description?: string
5
+ link?: string
6
+ }
7
+
8
+ const { title = '', description = '', link = '' } = defineProps<HeroProps>()
9
+ </script>
10
+ <div class="flex flex-col gap-3 items-center">
11
+ <div class="dropdownWrapper">
12
+ <div class="toast"></div>
13
+ <div class="toast"></div>
14
+ <div class="toast"></div>
15
+ </div>
16
+ <h1 class="-mt-5 mb-3 font-bold text-5xl text-transparent bg-clip-text bg-gradient-to-r from-blue-500 to-blue-700 dark:to-blue-300">
17
+ {{ title }}
18
+ </h1>
19
+ <p class="mb-3 mt-0 text-lg">
20
+ {{ description }}
21
+ </p>
22
+
23
+ <a
24
+ class="btn-secondary button"
25
+ href="{{ link }}"
26
+ target="_blank"
27
+ >
28
+ Github
29
+ </a>
30
+ </div>
31
+ <style>
32
+ .dropdownWrapper {
33
+ display: flex;
34
+ flex-direction: column;
35
+ margin: 0 auto;
36
+ width: 400px;
37
+ height: 100px;
38
+ position: relative;
39
+ -webkit-mask-image: linear-gradient(to top, transparent 0%, black 35%);
40
+ mask-image: linear-gradient(to top, transparent 0%, black 35%);
41
+ opacity: 1;
42
+ }
43
+
44
+ .toast {
45
+ width: 356px;
46
+ height: 40px;
47
+ background: #ffffff;
48
+ box-shadow: 0 4px 12px #00000068;
49
+ border: 1px solid #f5f5f5;
50
+ border-radius: 6px;
51
+ position: absolute;
52
+ bottom: 0;
53
+ left: 50%;
54
+ transform: translateX(-50%);
55
+ }
56
+
57
+ .toast:nth-child(1) {
58
+ transform: translateY(-60%) translateX(-50%) scale(0.9);
59
+ }
60
+
61
+ .toast:nth-child(2) {
62
+ transform: translateY(-30%) translateX(-50%) scale(0.95);
63
+ }
64
+
65
+ .button {
66
+ height: 40px;
67
+ border-radius: 6px;
68
+ border: none;
69
+ padding: 0 30px;
70
+ font-weight: 600;
71
+ flex-shrink: 0;
72
+ font-family: inherit;
73
+ box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.06),
74
+ 0px 1px 0px 0px rgba(0, 0, 0, 0.08), 0px 2px 2px 0px rgba(0, 0, 0, 0.04),
75
+ 0px 3px 3px 0px rgba(0, 0, 0, 0.02), 0px 4px 4px 0px rgba(0, 0, 0, 0.01);
76
+ position: relative;
77
+ overflow: hidden;
78
+ cursor: pointer;
79
+ text-decoration: none;
80
+ color: hsl(0, 0%, 9%);
81
+ font-size: 13px;
82
+ display: inline-flex;
83
+ align-items: center;
84
+ transition: box-shadow 200ms, background 200ms;
85
+ }
86
+
87
+ .btn-secondary {
88
+ background: linear-gradient(
89
+ 156deg,
90
+ rgba(255, 255, 255, 1) 0%,
91
+ rgba(240, 240, 240, 1) 100%
92
+ );
93
+ }
94
+
95
+ @media (max-width: 600px) {
96
+ .dropdownWrapper {
97
+ width: 100%;
98
+ }
99
+ }
100
+ </style>
@@ -0,0 +1,87 @@
1
+ ```vue
2
+ <script lang="ts" setup>
3
+ import { ref } from '@stacksjs/stx'
4
+ import {
5
+ Listbox,
6
+ ListboxButton,
7
+ ListboxOption,
8
+ ListboxOptions,
9
+ } from '@stacksjs/listbox'
10
+
11
+ interface Person {
12
+ id: number
13
+ name: string
14
+ unavailable: boolean
15
+ }
16
+
17
+ const people: Person[] = [
18
+ { id: 1, name: 'Chris Breuer', unavailable: false },
19
+ { id: 2, name: 'Avery Hill', unavailable: false },
20
+ { id: 3, name: 'Glenn Michael', unavailable: false },
21
+ { id: 4, name: 'Michael Vincent', unavailable: true },
22
+ { id: 5, name: 'Blake Ayer', unavailable: false },
23
+ ]
24
+
25
+ const selectedPerson = ref<Person>(people[0] as Person)
26
+
27
+ </script>
28
+
29
+ <template>
30
+ <div class="max-w-4xl">
31
+ <div class="items-center mx-auto my-12 space-y-4 h-[150px] w-[300px] w-3/5">
32
+ <Listbox v-model="selectedPerson">
33
+ <div class="relative mt-1">
34
+ <ListboxButton
35
+ class="relative pl-3 pr-10 py-2 w-full text-left sm:text-sm bg-white rounded-lg focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-orange-300 focus-visible:ring-white/75 focus:outline-none shadow-md cursor-default"
36
+ >
37
+ <span class="block truncate">{{ selectedPerson.name }}</span>
38
+ <span
39
+ class="flex absolute inset-y-0 right-0 items-center pr-2 pointer-events-none"
40
+ >
41
+ <div class="i-hugeicons-chevron-up-down-20-solid" />
42
+ </span>
43
+ </ListboxButton>
44
+
45
+ <transition
46
+ leave-active-class="duration-100 ease-in transition"
47
+ leave-from-class="opacity-100"
48
+ leave-to-class="opacity-0"
49
+ >
50
+ <ListboxOptions
51
+ class="absolute overflow-auto mt-1 py-1 max-h-60 w-full text-base sm:text-sm bg-white outline-none ring-1 ring-black/5 rounded-md focus:outline-none shadow-lg"
52
+ >
53
+ <ListboxOption
54
+ v-for="person in people"
55
+ class="-ml-4 list-none"
56
+ v-slot="{ active, selected }"
57
+ :key="person.name"
58
+ :value="person"
59
+ as="template"
60
+ >
61
+ <li
62
+ class="relative pl-10 pr-4 py-2 cursor-default select-none" :class="[
63
+ active ? 'bg-amber-100 text-amber-900' : 'text-gray-900',
64
+ ]"
65
+ >
66
+ <span
67
+ class="block truncate" :class="[
68
+ selected ? 'font-medium' : 'font-normal',
69
+ ]"
70
+ >{{ person.name }}</span>
71
+ <span
72
+ v-if="selected"
73
+ class="flex absolute inset-y-0 left-0 items-center pl-3 text-amber-600"
74
+ >
75
+ <div class="i-hugeicons-check-20-solid" />
76
+ </span>
77
+ </li>
78
+ </ListboxOption>
79
+ </ListboxOptions>
80
+ </transition>
81
+ </div>
82
+ </Listbox>
83
+ </div>
84
+ </div>
85
+ </template>
86
+
87
+ ```
@@ -0,0 +1,59 @@
1
+ <script>
2
+ interface ListboxDemoProps {
3
+ people?: string
4
+ selectedPerson?: boolean
5
+ isOpen?: boolean
6
+ }
7
+
8
+ const { people = [, selectedPerson = people[0], isOpen = false } = defineProps<ListboxDemoProps>()
9
+
10
+ { id: 1, name: 'Chris Breuer', unavailable: false },
11
+ { id: 2, name: 'Avery Hill', unavailable: false },
12
+ { id: 3, name: 'Glenn Michael', unavailable: false },
13
+ { id: 4, name: 'Michael Vincent', unavailable: true },
14
+ { id: 5, name: 'Blake Ayer', unavailable: false },
15
+ ]
16
+ </script>
17
+ <div class="max-w-4xl">
18
+ <DocsPlayground>
19
+ <div class="items-center mx-auto my-12 space-y-4 h-[150px] w-[300px] w-3/5">
20
+ <div class="relative mt-1">
21
+ <button
22
+ class="relative pl-3 pr-10 py-2 w-full text-left sm:text-sm bg-white rounded-lg focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-orange-300 focus-visible:ring-white/75 focus:outline-none shadow-md cursor-default"
23
+ data-action="toggle-listbox"
24
+ >
25
+ <span class="block truncate">{{ selectedPerson.name }}</span>
26
+ <span class="flex absolute inset-y-0 right-0 items-center pr-2 pointer-events-none">
27
+ <div class="i-hugeicons-chevron-up-down-20-solid"></div>
28
+ </span>
29
+ </button>
30
+
31
+ @if(isOpen)
32
+ <div class="absolute overflow-auto mt-1 py-1 max-h-60 w-full text-base sm:text-sm bg-white outline-none ring-1 ring-black/5 rounded-md focus:outline-none shadow-lg">
33
+ @foreach(people as person)
34
+ <div
35
+ class="relative pl-10 pr-4 py-2 list-none text-amber-900' hover:text-amber-900 hover:bg-amber-100 cursor-default select-none selectedPerson.id : ? 'bg-amber-100 'text-gray-900' {{ }} == person.id"
36
+ data-action="select-person"
37
+ data-person-id="{{ person.id }}"
38
+ data-person-name="{{ person.name }}"
39
+ >
40
+ <span class="block truncate selectedPerson.id : ? 'font-medium' 'font-normal' {{ }} == person.id">
41
+ {{ person.name }}
42
+ </span>
43
+ @if(selectedPerson.id == person.id)
44
+ <span class="flex absolute inset-y-0 left-0 items-center pl-3 text-amber-600">
45
+ <div class="i-hugeicons-check-20-solid"></div>
46
+ </span>
47
+ @endif
48
+ </div>
49
+ @endforeach
50
+ </div>
51
+ @endif
52
+ </div>
53
+ </div>
54
+
55
+ <div slot="code">
56
+ <!-- ListboxCode component would be rendered here -->
57
+ </div>
58
+ </DocsPlayground>
59
+ </div>