pika-ux 1.0.0-beta.0

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 (292) hide show
  1. package/LICENSE +9 -0
  2. package/dist/icon-generator/generate-icon-ts-indices.js +78 -0
  3. package/dist/shadcn-postinstall/index.js +114 -0
  4. package/package.json +102 -0
  5. package/readme.md +50 -0
  6. package/scripts/setup.js +100 -0
  7. package/src/App.svelte +51 -0
  8. package/src/app.css +349 -0
  9. package/src/icons/ci/index.d.ts +5009 -0
  10. package/src/icons/lucide/index.d.ts +11274 -0
  11. package/src/index.ts +23 -0
  12. package/src/lib/docsite/Navigation.svelte +77 -0
  13. package/src/lib/docsite/pages/Colors.svelte +35 -0
  14. package/src/lib/docsite/pages/Components.svelte +50 -0
  15. package/src/lib/docsite/pages/GettingStarted.svelte +21 -0
  16. package/src/lib/docsite/pages/Icons.svelte +22 -0
  17. package/src/lib/docsite/pages/components/Button.svelte +40 -0
  18. package/src/main.ts +9 -0
  19. package/src/pika/chip/chip.svelte +95 -0
  20. package/src/pika/chip/index.ts +1 -0
  21. package/src/pika/combobox/combobox-types.ts +5 -0
  22. package/src/pika/combobox/combobox.svelte +221 -0
  23. package/src/pika/combobox/index.ts +2 -0
  24. package/src/pika/confirm-dialog/confirm-dialog.svelte +48 -0
  25. package/src/pika/confirm-dialog/index.ts +1 -0
  26. package/src/pika/copy-button/copy-button.svelte +134 -0
  27. package/src/pika/copy-button/index.ts +1 -0
  28. package/src/pika/create-copy-link-button/create-copy-link-button.svelte +133 -0
  29. package/src/pika/create-copy-link-button/index.ts +1 -0
  30. package/src/pika/date-picker/date-picker.svelte +33 -0
  31. package/src/pika/date-picker/index.ts +1 -0
  32. package/src/pika/date-range-picker/date-range-picker.svelte +48 -0
  33. package/src/pika/date-range-picker/index.ts +1 -0
  34. package/src/pika/date-time-picker/date-time-picker.svelte +336 -0
  35. package/src/pika/date-time-picker/index.ts +1 -0
  36. package/src/pika/expandable-container/expandable-container.svelte +155 -0
  37. package/src/pika/expandable-container/index.ts +1 -0
  38. package/src/pika/index.ts +29 -0
  39. package/src/pika/list/index.ts +2 -0
  40. package/src/pika/list/list-types.ts +5 -0
  41. package/src/pika/list/list.svelte +349 -0
  42. package/src/pika/markdown-editor/github.scss +87 -0
  43. package/src/pika/markdown-editor/index.ts +1 -0
  44. package/src/pika/markdown-editor/markdown-editor.svelte +44 -0
  45. package/src/pika/permanent-toast/index.ts +1 -0
  46. package/src/pika/permanent-toast/permanent-toast.svelte +47 -0
  47. package/src/pika/pika-alert/index.ts +1 -0
  48. package/src/pika/pika-alert/pika-alert.svelte +53 -0
  49. package/src/pika/pika-badge/index.ts +1 -0
  50. package/src/pika/pika-badge/pika-badge.svelte +61 -0
  51. package/src/pika/pika-table/index.ts +7 -0
  52. package/src/pika/pika-table/pika-table-cell.svelte +9 -0
  53. package/src/pika/pika-table/pika-table-checkbox.svelte +8 -0
  54. package/src/pika/pika-table/pika-table-column-header.svelte +88 -0
  55. package/src/pika/pika-table/pika-table-faceted-filter.svelte +109 -0
  56. package/src/pika/pika-table/pika-table-pagination.svelte +95 -0
  57. package/src/pika/pika-table/pika-table-row-actions.svelte +58 -0
  58. package/src/pika/pika-table/pika-table-toolbar.svelte +88 -0
  59. package/src/pika/pika-table/pika-table-view-options.svelte +35 -0
  60. package/src/pika/pika-table/pika-table.svelte +295 -0
  61. package/src/pika/pika-table/types.ts +106 -0
  62. package/src/pika/pika-tabs/index.ts +18 -0
  63. package/src/pika/pika-tabs/tabs-content.svelte +16 -0
  64. package/src/pika/pika-tabs/tabs-list.svelte +12 -0
  65. package/src/pika/pika-tabs/tabs-trigger.svelte +23 -0
  66. package/src/pika/popup-help/index.ts +1 -0
  67. package/src/pika/popup-help/popup-help.svelte +33 -0
  68. package/src/pika/simple-dropdown/index.ts +2 -0
  69. package/src/pika/simple-dropdown/simple-dropdown-types.ts +5 -0
  70. package/src/pika/simple-dropdown/simple-dropdown.svelte +288 -0
  71. package/src/pika/slideout/constants.ts +5 -0
  72. package/src/pika/slideout/context.svelte.ts +110 -0
  73. package/src/pika/slideout/index.ts +19 -0
  74. package/src/pika/slideout/slideout-content.svelte +36 -0
  75. package/src/pika/slideout/slideout-panel.svelte +126 -0
  76. package/src/pika/slideout/slideout-provider.svelte +49 -0
  77. package/src/pika/slideout/slideout-rail.svelte.die +69 -0
  78. package/src/pika/slideout/slideout.svelte +33 -0
  79. package/src/pika/slideout/slideout.svelte.old +113 -0
  80. package/src/pika/text-wave-shimmer/index.ts +1 -0
  81. package/src/pika/text-wave-shimmer/text-wave-shimmer.svelte +43 -0
  82. package/src/pika/tooltip-plus/index.ts +1 -0
  83. package/src/pika/tooltip-plus/tooltip-plus.svelte +42 -0
  84. package/src/shadcn/.DS_Store +0 -0
  85. package/src/shadcn/alert/alert-description.svelte +11 -0
  86. package/src/shadcn/alert/alert-title.svelte +24 -0
  87. package/src/shadcn/alert/alert.svelte +39 -0
  88. package/src/shadcn/alert/index.ts +14 -0
  89. package/src/shadcn/avatar/avatar-fallback.svelte +13 -0
  90. package/src/shadcn/avatar/avatar-image.svelte +13 -0
  91. package/src/shadcn/avatar/avatar.svelte +19 -0
  92. package/src/shadcn/avatar/index.ts +13 -0
  93. package/src/shadcn/badge/badge.svelte +48 -0
  94. package/src/shadcn/badge/index.ts +2 -0
  95. package/src/shadcn/breadcrumb/breadcrumb-ellipsis.svelte +12 -0
  96. package/src/shadcn/breadcrumb/breadcrumb-item.svelte +20 -0
  97. package/src/shadcn/breadcrumb/breadcrumb-link.svelte +31 -0
  98. package/src/shadcn/breadcrumb/breadcrumb-list.svelte +20 -0
  99. package/src/shadcn/breadcrumb/breadcrumb-page.svelte +23 -0
  100. package/src/shadcn/breadcrumb/breadcrumb-separator.svelte +15 -0
  101. package/src/shadcn/breadcrumb/breadcrumb.svelte +15 -0
  102. package/src/shadcn/breadcrumb/index.ts +25 -0
  103. package/src/shadcn/button/button.svelte +81 -0
  104. package/src/shadcn/button/index.ts +17 -0
  105. package/src/shadcn/calendar/calendar-caption.svelte +76 -0
  106. package/src/shadcn/calendar/calendar-cell.svelte +19 -0
  107. package/src/shadcn/calendar/calendar-day.svelte +31 -0
  108. package/src/shadcn/calendar/calendar-grid-body.svelte +12 -0
  109. package/src/shadcn/calendar/calendar-grid-head.svelte +12 -0
  110. package/src/shadcn/calendar/calendar-grid-row.svelte +12 -0
  111. package/src/shadcn/calendar/calendar-grid.svelte +16 -0
  112. package/src/shadcn/calendar/calendar-head-cell.svelte +16 -0
  113. package/src/shadcn/calendar/calendar-header.svelte +16 -0
  114. package/src/shadcn/calendar/calendar-heading.svelte +12 -0
  115. package/src/shadcn/calendar/calendar-month-select.svelte +25 -0
  116. package/src/shadcn/calendar/calendar-month.svelte +15 -0
  117. package/src/shadcn/calendar/calendar-months.svelte +20 -0
  118. package/src/shadcn/calendar/calendar-nav.svelte +19 -0
  119. package/src/shadcn/calendar/calendar-next-button.svelte +19 -0
  120. package/src/shadcn/calendar/calendar-prev-button.svelte +19 -0
  121. package/src/shadcn/calendar/calendar-year-select.svelte +25 -0
  122. package/src/shadcn/calendar/calendar.svelte +61 -0
  123. package/src/shadcn/calendar/index.ts +30 -0
  124. package/src/shadcn/card/card-content.svelte +16 -0
  125. package/src/shadcn/card/card-description.svelte +16 -0
  126. package/src/shadcn/card/card-footer.svelte +16 -0
  127. package/src/shadcn/card/card-header.svelte +16 -0
  128. package/src/shadcn/card/card-title.svelte +25 -0
  129. package/src/shadcn/card/card.svelte +20 -0
  130. package/src/shadcn/card/index.ts +22 -0
  131. package/src/shadcn/carousel/carousel-content.svelte +39 -0
  132. package/src/shadcn/carousel/carousel-item.svelte +26 -0
  133. package/src/shadcn/carousel/carousel-next.svelte +30 -0
  134. package/src/shadcn/carousel/carousel-previous.svelte +30 -0
  135. package/src/shadcn/carousel/carousel.svelte +88 -0
  136. package/src/shadcn/carousel/context.ts +51 -0
  137. package/src/shadcn/carousel/index.ts +19 -0
  138. package/src/shadcn/checkbox/checkbox.svelte +36 -0
  139. package/src/shadcn/checkbox/index.ts +6 -0
  140. package/src/shadcn/collapsible/collapsible-content.svelte +7 -0
  141. package/src/shadcn/collapsible/collapsible-trigger.svelte +7 -0
  142. package/src/shadcn/collapsible/collapsible.svelte +11 -0
  143. package/src/shadcn/collapsible/index.ts +13 -0
  144. package/src/shadcn/command/command-dialog.svelte +40 -0
  145. package/src/shadcn/command/command-empty.svelte +13 -0
  146. package/src/shadcn/command/command-group.svelte +30 -0
  147. package/src/shadcn/command/command-input.svelte +21 -0
  148. package/src/shadcn/command/command-item.svelte +16 -0
  149. package/src/shadcn/command/command-link-item.svelte +16 -0
  150. package/src/shadcn/command/command-list.svelte +13 -0
  151. package/src/shadcn/command/command-separator.svelte +13 -0
  152. package/src/shadcn/command/command-shortcut.svelte +20 -0
  153. package/src/shadcn/command/command.svelte +19 -0
  154. package/src/shadcn/command/index.ts +40 -0
  155. package/src/shadcn/data-table/data-table.svelte.ts +141 -0
  156. package/src/shadcn/data-table/flex-render.svelte +36 -0
  157. package/src/shadcn/data-table/index.ts +3 -0
  158. package/src/shadcn/data-table/render-helpers.ts +111 -0
  159. package/src/shadcn/dialog/dialog-close.svelte +7 -0
  160. package/src/shadcn/dialog/dialog-content.svelte +43 -0
  161. package/src/shadcn/dialog/dialog-description.svelte +13 -0
  162. package/src/shadcn/dialog/dialog-footer.svelte +20 -0
  163. package/src/shadcn/dialog/dialog-header.svelte +20 -0
  164. package/src/shadcn/dialog/dialog-overlay.svelte +16 -0
  165. package/src/shadcn/dialog/dialog-title.svelte +13 -0
  166. package/src/shadcn/dialog/dialog-trigger.svelte +7 -0
  167. package/src/shadcn/dialog/index.ts +37 -0
  168. package/src/shadcn/dropdown-menu/dropdown-menu-checkbox-item.svelte +41 -0
  169. package/src/shadcn/dropdown-menu/dropdown-menu-content.svelte +27 -0
  170. package/src/shadcn/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
  171. package/src/shadcn/dropdown-menu/dropdown-menu-group.svelte +7 -0
  172. package/src/shadcn/dropdown-menu/dropdown-menu-item.svelte +27 -0
  173. package/src/shadcn/dropdown-menu/dropdown-menu-label.svelte +24 -0
  174. package/src/shadcn/dropdown-menu/dropdown-menu-radio-group.svelte +16 -0
  175. package/src/shadcn/dropdown-menu/dropdown-menu-radio-item.svelte +26 -0
  176. package/src/shadcn/dropdown-menu/dropdown-menu-separator.svelte +13 -0
  177. package/src/shadcn/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
  178. package/src/shadcn/dropdown-menu/dropdown-menu-sub-content.svelte +16 -0
  179. package/src/shadcn/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
  180. package/src/shadcn/dropdown-menu/dropdown-menu-trigger.svelte +7 -0
  181. package/src/shadcn/dropdown-menu/index.ts +49 -0
  182. package/src/shadcn/index.ts +40 -0
  183. package/src/shadcn/input/index.ts +7 -0
  184. package/src/shadcn/input/input.svelte +51 -0
  185. package/src/shadcn/is-mobile.svelte.ts +9 -0
  186. package/src/shadcn/label/index.ts +7 -0
  187. package/src/shadcn/label/label.svelte +16 -0
  188. package/src/shadcn/popover/index.ts +17 -0
  189. package/src/shadcn/popover/popover-content.svelte +29 -0
  190. package/src/shadcn/popover/popover-trigger.svelte +8 -0
  191. package/src/shadcn/radio-group/index.ts +10 -0
  192. package/src/shadcn/radio-group/radio-group-item.svelte +25 -0
  193. package/src/shadcn/radio-group/radio-group.svelte +19 -0
  194. package/src/shadcn/range-calendar/index.ts +30 -0
  195. package/src/shadcn/range-calendar/range-calendar-cell.svelte +19 -0
  196. package/src/shadcn/range-calendar/range-calendar-day.svelte +35 -0
  197. package/src/shadcn/range-calendar/range-calendar-grid-body.svelte +12 -0
  198. package/src/shadcn/range-calendar/range-calendar-grid-head.svelte +12 -0
  199. package/src/shadcn/range-calendar/range-calendar-grid-row.svelte +12 -0
  200. package/src/shadcn/range-calendar/range-calendar-grid.svelte +16 -0
  201. package/src/shadcn/range-calendar/range-calendar-head-cell.svelte +16 -0
  202. package/src/shadcn/range-calendar/range-calendar-header.svelte +16 -0
  203. package/src/shadcn/range-calendar/range-calendar-heading.svelte +16 -0
  204. package/src/shadcn/range-calendar/range-calendar-months.svelte +20 -0
  205. package/src/shadcn/range-calendar/range-calendar-next-button.svelte +18 -0
  206. package/src/shadcn/range-calendar/range-calendar-prev-button.svelte +18 -0
  207. package/src/shadcn/range-calendar/range-calendar.svelte +57 -0
  208. package/src/shadcn/resizable/index.ts +13 -0
  209. package/src/shadcn/resizable/resizable-handle.svelte +30 -0
  210. package/src/shadcn/resizable/resizable-pane-group.svelte +22 -0
  211. package/src/shadcn/scroll-area/index.ts +10 -0
  212. package/src/shadcn/scroll-area/scroll-area-scrollbar.svelte +28 -0
  213. package/src/shadcn/scroll-area/scroll-area.svelte +35 -0
  214. package/src/shadcn/select/index.ts +37 -0
  215. package/src/shadcn/select/select-content.svelte +38 -0
  216. package/src/shadcn/select/select-group-heading.svelte +21 -0
  217. package/src/shadcn/select/select-group.svelte +7 -0
  218. package/src/shadcn/select/select-item.svelte +31 -0
  219. package/src/shadcn/select/select-label.svelte +20 -0
  220. package/src/shadcn/select/select-scroll-down-button.svelte +11 -0
  221. package/src/shadcn/select/select-scroll-up-button.svelte +11 -0
  222. package/src/shadcn/select/select-separator.svelte +14 -0
  223. package/src/shadcn/select/select-trigger.svelte +30 -0
  224. package/src/shadcn/separator/index.ts +7 -0
  225. package/src/shadcn/separator/separator.svelte +16 -0
  226. package/src/shadcn/sheet/index.ts +36 -0
  227. package/src/shadcn/sheet/sheet-close.svelte +7 -0
  228. package/src/shadcn/sheet/sheet-content.svelte +66 -0
  229. package/src/shadcn/sheet/sheet-description.svelte +13 -0
  230. package/src/shadcn/sheet/sheet-footer.svelte +15 -0
  231. package/src/shadcn/sheet/sheet-header.svelte +15 -0
  232. package/src/shadcn/sheet/sheet-overlay.svelte +16 -0
  233. package/src/shadcn/sheet/sheet-title.svelte +13 -0
  234. package/src/shadcn/sheet/sheet-trigger.svelte +7 -0
  235. package/src/shadcn/sidebar/constants.ts +6 -0
  236. package/src/shadcn/sidebar/context.svelte.ts +80 -0
  237. package/src/shadcn/sidebar/index.ts +75 -0
  238. package/src/shadcn/sidebar/sidebar-content.svelte +24 -0
  239. package/src/shadcn/sidebar/sidebar-footer.svelte +21 -0
  240. package/src/shadcn/sidebar/sidebar-group-action.svelte +36 -0
  241. package/src/shadcn/sidebar/sidebar-group-content.svelte +21 -0
  242. package/src/shadcn/sidebar/sidebar-group-label.svelte +34 -0
  243. package/src/shadcn/sidebar/sidebar-group.svelte +21 -0
  244. package/src/shadcn/sidebar/sidebar-header.svelte +21 -0
  245. package/src/shadcn/sidebar/sidebar-input.svelte +21 -0
  246. package/src/shadcn/sidebar/sidebar-inset.svelte +24 -0
  247. package/src/shadcn/sidebar/sidebar-menu-action.svelte +43 -0
  248. package/src/shadcn/sidebar/sidebar-menu-badge.svelte +29 -0
  249. package/src/shadcn/sidebar/sidebar-menu-button.svelte +101 -0
  250. package/src/shadcn/sidebar/sidebar-menu-item.svelte +21 -0
  251. package/src/shadcn/sidebar/sidebar-menu-skeleton.svelte +36 -0
  252. package/src/shadcn/sidebar/sidebar-menu-sub-button.svelte +43 -0
  253. package/src/shadcn/sidebar/sidebar-menu-sub-item.svelte +21 -0
  254. package/src/shadcn/sidebar/sidebar-menu-sub.svelte +25 -0
  255. package/src/shadcn/sidebar/sidebar-menu.svelte +21 -0
  256. package/src/shadcn/sidebar/sidebar-provider.svelte +46 -0
  257. package/src/shadcn/sidebar/sidebar-rail.svelte +36 -0
  258. package/src/shadcn/sidebar/sidebar-separator.svelte +15 -0
  259. package/src/shadcn/sidebar/sidebar-trigger.svelte +35 -0
  260. package/src/shadcn/sidebar/sidebar.svelte +94 -0
  261. package/src/shadcn/skeleton/index.ts +7 -0
  262. package/src/shadcn/skeleton/skeleton.svelte +17 -0
  263. package/src/shadcn/slider/index.ts +7 -0
  264. package/src/shadcn/slider/slider.svelte +44 -0
  265. package/src/shadcn/sonner/index.ts +1 -0
  266. package/src/shadcn/sonner/sonner.svelte +13 -0
  267. package/src/shadcn/switch/index.ts +7 -0
  268. package/src/shadcn/switch/switch.svelte +27 -0
  269. package/src/shadcn/table/index.ts +28 -0
  270. package/src/shadcn/table/table-body.svelte +15 -0
  271. package/src/shadcn/table/table-caption.svelte +20 -0
  272. package/src/shadcn/table/table-cell.svelte +20 -0
  273. package/src/shadcn/table/table-footer.svelte +20 -0
  274. package/src/shadcn/table/table-head.svelte +23 -0
  275. package/src/shadcn/table/table-header.svelte +15 -0
  276. package/src/shadcn/table/table-row.svelte +23 -0
  277. package/src/shadcn/table/table.svelte +17 -0
  278. package/src/shadcn/tabs/index.ts +18 -0
  279. package/src/shadcn/tabs/tabs-content.svelte +21 -0
  280. package/src/shadcn/tabs/tabs-list.svelte +19 -0
  281. package/src/shadcn/tabs/tabs-trigger.svelte +21 -0
  282. package/src/shadcn/textarea/index.ts +7 -0
  283. package/src/shadcn/textarea/textarea.svelte +22 -0
  284. package/src/shadcn/toggle/index.ts +13 -0
  285. package/src/shadcn/toggle/toggle.svelte +51 -0
  286. package/src/shadcn/toggle-group/index.ts +10 -0
  287. package/src/shadcn/toggle-group/toggle-group-item.svelte +30 -0
  288. package/src/shadcn/toggle-group/toggle-group.svelte +41 -0
  289. package/src/shadcn/tooltip/index.ts +21 -0
  290. package/src/shadcn/tooltip/tooltip-content.svelte +47 -0
  291. package/src/shadcn/tooltip/tooltip-trigger.svelte +7 -0
  292. package/src/shadcn/utils.ts +14 -0
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import type { WithElementRef } from "bits-ui";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+ import { cn } from "../utils.js";
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ children,
10
+ ...restProps
11
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
12
+ </script>
13
+
14
+ <div bind:this={ref} class={cn("flex flex-col space-y-1.5 p-6 pb-0", className)} {...restProps}>
15
+ {@render children?.()}
16
+ </div>
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ import type { WithElementRef } from "bits-ui";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+ import { cn } from "../utils.js";
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ level = 3,
10
+ children,
11
+ ...restProps
12
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
13
+ level?: 1 | 2 | 3 | 4 | 5 | 6;
14
+ } = $props();
15
+ </script>
16
+
17
+ <div
18
+ role="heading"
19
+ aria-level={level}
20
+ bind:this={ref}
21
+ class={cn("font-semibold leading-none tracking-tight", className)}
22
+ {...restProps}
23
+ >
24
+ {@render children?.()}
25
+ </div>
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { WithElementRef } from "bits-ui";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+ import { cn } from "../utils.js";
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ children,
10
+ ...restProps
11
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
12
+ </script>
13
+
14
+ <div
15
+ bind:this={ref}
16
+ class={cn("bg-card text-card-foreground rounded-xl border shadow", className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,22 @@
1
+ import Root from "./card.svelte";
2
+ import Content from "./card-content.svelte";
3
+ import Description from "./card-description.svelte";
4
+ import Footer from "./card-footer.svelte";
5
+ import Header from "./card-header.svelte";
6
+ import Title from "./card-title.svelte";
7
+
8
+ export {
9
+ Root,
10
+ Content,
11
+ Description,
12
+ Footer,
13
+ Header,
14
+ Title,
15
+ //
16
+ Root as Card,
17
+ Content as CardContent,
18
+ Description as CardDescription,
19
+ Footer as CardFooter,
20
+ Header as CardHeader,
21
+ Title as CardTitle,
22
+ };
@@ -0,0 +1,39 @@
1
+ <script lang="ts">
2
+ import emblaCarouselSvelte from 'embla-carousel-svelte';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ import { getEmblaContext } from './context.js';
5
+ import { cn, type WithElementRef } from '../utils.js';
6
+
7
+ let {
8
+ ref = $bindable(null),
9
+ class: className,
10
+ children,
11
+ ...restProps
12
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
13
+
14
+ const emblaCtx = getEmblaContext('<Carousel.Content/>');
15
+ </script>
16
+
17
+ <div
18
+ data-slot="carousel-content"
19
+ class="overflow-hidden"
20
+ use:emblaCarouselSvelte={{
21
+ options: {
22
+ container: '[data-embla-container]',
23
+ slides: '[data-embla-slide]',
24
+ ...emblaCtx.options,
25
+ axis: emblaCtx.orientation === 'horizontal' ? 'x' : 'y',
26
+ },
27
+ plugins: emblaCtx.plugins,
28
+ }}
29
+ onemblaInit={emblaCtx.onInit}
30
+ >
31
+ <div
32
+ bind:this={ref}
33
+ class={cn('flex', emblaCtx.orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)}
34
+ data-embla-container=""
35
+ {...restProps}
36
+ >
37
+ {@render children?.()}
38
+ </div>
39
+ </div>
@@ -0,0 +1,26 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { getEmblaContext } from './context.js';
4
+ import { cn, type WithElementRef } from '../utils.js';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ children,
10
+ ...restProps
11
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
12
+
13
+ const emblaCtx = getEmblaContext('<Carousel.Item/>');
14
+ </script>
15
+
16
+ <div
17
+ bind:this={ref}
18
+ data-slot="carousel-item"
19
+ role="group"
20
+ aria-roledescription="slide"
21
+ class={cn('min-w-0 shrink-0 grow-0 basis-full', emblaCtx.orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}
22
+ data-embla-slide=""
23
+ {...restProps}
24
+ >
25
+ {@render children?.()}
26
+ </div>
@@ -0,0 +1,30 @@
1
+ <script lang="ts">
2
+ import ArrowRightIcon from '$icons/lucide/arrow-right';
3
+ import type { WithoutChildren } from 'bits-ui';
4
+ import { getEmblaContext } from './context.js';
5
+ import { cn } from '../utils.js';
6
+ import { Button, type Props } from '../button/index.js';
7
+
8
+ let { ref = $bindable(null), class: className, variant = 'outline', size = 'icon', ...restProps }: WithoutChildren<Props> = $props();
9
+
10
+ const emblaCtx = getEmblaContext('<Carousel.Next/>');
11
+ </script>
12
+
13
+ <Button
14
+ data-slot="carousel-next"
15
+ {variant}
16
+ {size}
17
+ aria-disabled={!emblaCtx.canScrollNext}
18
+ class={cn(
19
+ 'absolute size-8 rounded-full',
20
+ emblaCtx.orientation === 'horizontal' ? '-right-12 top-1/2 -translate-y-1/2' : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
21
+ className
22
+ )}
23
+ onclick={emblaCtx.scrollNext}
24
+ onkeydown={emblaCtx.handleKeyDown}
25
+ bind:ref
26
+ {...restProps}
27
+ >
28
+ <ArrowRightIcon class="size-4" />
29
+ <span class="sr-only">Next slide</span>
30
+ </Button>
@@ -0,0 +1,30 @@
1
+ <script lang="ts">
2
+ import ArrowLeftIcon from '$icons/lucide/arrow-left';
3
+ import type { WithoutChildren } from 'bits-ui';
4
+ import { getEmblaContext } from './context.js';
5
+ import { cn } from '../utils.js';
6
+ import { Button, type Props } from '../button/index.js';
7
+
8
+ let { ref = $bindable(null), class: className, variant = 'outline', size = 'icon', ...restProps }: WithoutChildren<Props> = $props();
9
+
10
+ const emblaCtx = getEmblaContext('<Carousel.Previous/>');
11
+ </script>
12
+
13
+ <Button
14
+ data-slot="carousel-previous"
15
+ {variant}
16
+ {size}
17
+ aria-disabled={!emblaCtx.canScrollPrev}
18
+ class={cn(
19
+ 'absolute size-8 rounded-full',
20
+ emblaCtx.orientation === 'horizontal' ? '-left-12 top-1/2 -translate-y-1/2' : '-top-12 left-1/2 -translate-x-1/2 rotate-90',
21
+ className
22
+ )}
23
+ onclick={emblaCtx.scrollPrev}
24
+ onkeydown={emblaCtx.handleKeyDown}
25
+ {...restProps}
26
+ bind:ref
27
+ >
28
+ <ArrowLeftIcon class="size-4" />
29
+ <span class="sr-only">Previous slide</span>
30
+ </Button>
@@ -0,0 +1,88 @@
1
+ <script lang="ts">
2
+ import { type CarouselAPI, type CarouselProps, type EmblaContext, setEmblaContext } from './context.js';
3
+ import { cn, type WithElementRef } from '../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ opts = {},
8
+ plugins = [],
9
+ setApi = () => {},
10
+ orientation = 'horizontal',
11
+ class: className,
12
+ children,
13
+ ...restProps
14
+ }: WithElementRef<CarouselProps> = $props();
15
+
16
+ let carouselState = $state<EmblaContext>({
17
+ api: undefined,
18
+ scrollPrev,
19
+ scrollNext,
20
+ orientation,
21
+ canScrollNext: false,
22
+ canScrollPrev: false,
23
+ handleKeyDown,
24
+ options: opts,
25
+ plugins,
26
+ onInit,
27
+ scrollSnaps: [],
28
+ selectedIndex: 0,
29
+ scrollTo,
30
+ });
31
+
32
+ setEmblaContext(carouselState);
33
+
34
+ function scrollPrev() {
35
+ carouselState.api?.scrollPrev();
36
+ }
37
+
38
+ function scrollNext() {
39
+ carouselState.api?.scrollNext();
40
+ }
41
+
42
+ function scrollTo(index: number, jump?: boolean) {
43
+ carouselState.api?.scrollTo(index, jump);
44
+ }
45
+
46
+ function onSelect() {
47
+ if (!carouselState.api) return;
48
+ carouselState.selectedIndex = carouselState.api.selectedScrollSnap();
49
+ carouselState.canScrollNext = carouselState.api.canScrollNext();
50
+ carouselState.canScrollPrev = carouselState.api.canScrollPrev();
51
+ }
52
+
53
+ function handleKeyDown(e: KeyboardEvent) {
54
+ if (e.key === 'ArrowLeft') {
55
+ e.preventDefault();
56
+ scrollPrev();
57
+ } else if (e.key === 'ArrowRight') {
58
+ e.preventDefault();
59
+ scrollNext();
60
+ }
61
+ }
62
+
63
+ function onInit(event: CustomEvent<CarouselAPI>) {
64
+ carouselState.api = event.detail;
65
+ setApi(carouselState.api);
66
+
67
+ carouselState.scrollSnaps = carouselState.api.scrollSnapList();
68
+ carouselState.api.on('select', onSelect);
69
+ onSelect();
70
+ }
71
+
72
+ $effect(() => {
73
+ return () => {
74
+ carouselState.api?.off('select', onSelect);
75
+ };
76
+ });
77
+ </script>
78
+
79
+ <div
80
+ bind:this={ref}
81
+ data-slot="carousel"
82
+ class={cn('relative', className)}
83
+ role="region"
84
+ aria-roledescription="carousel"
85
+ {...restProps}
86
+ >
87
+ {@render children?.()}
88
+ </div>
@@ -0,0 +1,51 @@
1
+ import type { WithElementRef } from '../utils.js';
2
+ import type { EmblaCarouselSvelteType, default as emblaCarouselSvelte } from 'embla-carousel-svelte';
3
+ import { getContext, hasContext, setContext } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+
6
+ export type CarouselAPI =
7
+ NonNullable<NonNullable<EmblaCarouselSvelteType['$$_attributes']>['on:emblaInit']> extends (evt: CustomEvent<infer CarouselAPI>) => void ? CarouselAPI : never;
8
+
9
+ type EmblaCarouselConfig = NonNullable<Parameters<typeof emblaCarouselSvelte>[1]>;
10
+
11
+ export type CarouselOptions = EmblaCarouselConfig['options'];
12
+ export type CarouselPlugins = EmblaCarouselConfig['plugins'];
13
+
14
+ ////
15
+
16
+ export type CarouselProps = {
17
+ opts?: CarouselOptions;
18
+ plugins?: CarouselPlugins;
19
+ setApi?: (api: CarouselAPI | undefined) => void;
20
+ orientation?: 'horizontal' | 'vertical';
21
+ } & WithElementRef<HTMLAttributes<HTMLDivElement>>;
22
+
23
+ const EMBLA_CAROUSEL_CONTEXT = Symbol('EMBLA_CAROUSEL_CONTEXT');
24
+
25
+ export type EmblaContext = {
26
+ api: CarouselAPI | undefined;
27
+ orientation: 'horizontal' | 'vertical';
28
+ scrollNext: () => void;
29
+ scrollPrev: () => void;
30
+ canScrollNext: boolean;
31
+ canScrollPrev: boolean;
32
+ handleKeyDown: (e: KeyboardEvent) => void;
33
+ options: CarouselOptions;
34
+ plugins: CarouselPlugins;
35
+ onInit: (e: CustomEvent<CarouselAPI>) => void;
36
+ scrollTo: (index: number, jump?: boolean) => void;
37
+ scrollSnaps: number[];
38
+ selectedIndex: number;
39
+ };
40
+
41
+ export function setEmblaContext(config: EmblaContext): EmblaContext {
42
+ setContext(EMBLA_CAROUSEL_CONTEXT, config);
43
+ return config;
44
+ }
45
+
46
+ export function getEmblaContext(name = 'This component') {
47
+ if (!hasContext(EMBLA_CAROUSEL_CONTEXT)) {
48
+ throw new Error(`${name} must be used within a <Carousel.Root> component`);
49
+ }
50
+ return getContext<ReturnType<typeof setEmblaContext>>(EMBLA_CAROUSEL_CONTEXT);
51
+ }
@@ -0,0 +1,19 @@
1
+ import Root from "./carousel.svelte";
2
+ import Content from "./carousel-content.svelte";
3
+ import Item from "./carousel-item.svelte";
4
+ import Previous from "./carousel-previous.svelte";
5
+ import Next from "./carousel-next.svelte";
6
+
7
+ export {
8
+ Root,
9
+ Content,
10
+ Item,
11
+ Previous,
12
+ Next,
13
+ //
14
+ Root as Carousel,
15
+ Content as CarouselContent,
16
+ Item as CarouselItem,
17
+ Previous as CarouselPrevious,
18
+ Next as CarouselNext,
19
+ };
@@ -0,0 +1,36 @@
1
+ <script lang="ts">
2
+ import { Checkbox as CheckboxPrimitive } from 'bits-ui';
3
+ import CheckIcon from '$icons/lucide/check';
4
+ import MinusIcon from '$icons/lucide/minus';
5
+ import { cn, type WithoutChildrenOrChild } from '../utils.js';
6
+
7
+ let {
8
+ ref = $bindable(null),
9
+ checked = $bindable(false),
10
+ indeterminate = $bindable(false),
11
+ class: className,
12
+ ...restProps
13
+ }: WithoutChildrenOrChild<CheckboxPrimitive.RootProps> = $props();
14
+ </script>
15
+
16
+ <CheckboxPrimitive.Root
17
+ bind:ref
18
+ data-slot="checkbox"
19
+ class={cn(
20
+ 'border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive shadow-xs peer flex size-4 shrink-0 items-center justify-center rounded-[4px] border outline-none transition-shadow focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
21
+ className
22
+ )}
23
+ bind:checked
24
+ bind:indeterminate
25
+ {...restProps}
26
+ >
27
+ {#snippet children({ checked, indeterminate })}
28
+ <div data-slot="checkbox-indicator" class="text-current transition-none">
29
+ {#if checked}
30
+ <CheckIcon class="size-3.5" />
31
+ {:else if indeterminate}
32
+ <MinusIcon class="size-3.5" />
33
+ {/if}
34
+ </div>
35
+ {/snippet}
36
+ </CheckboxPrimitive.Root>
@@ -0,0 +1,6 @@
1
+ import Root from "./checkbox.svelte";
2
+ export {
3
+ Root,
4
+ //
5
+ Root as Checkbox,
6
+ };
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { Collapsible as CollapsiblePrimitive } from "bits-ui";
3
+
4
+ let { ref = $bindable(null), ...restProps }: CollapsiblePrimitive.ContentProps = $props();
5
+ </script>
6
+
7
+ <CollapsiblePrimitive.Content bind:ref data-slot="collapsible-content" {...restProps} />
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { Collapsible as CollapsiblePrimitive } from "bits-ui";
3
+
4
+ let { ref = $bindable(null), ...restProps }: CollapsiblePrimitive.TriggerProps = $props();
5
+ </script>
6
+
7
+ <CollapsiblePrimitive.Trigger bind:ref data-slot="collapsible-trigger" {...restProps} />
@@ -0,0 +1,11 @@
1
+ <script lang="ts">
2
+ import { Collapsible as CollapsiblePrimitive } from "bits-ui";
3
+
4
+ let {
5
+ ref = $bindable(null),
6
+ open = $bindable(false),
7
+ ...restProps
8
+ }: CollapsiblePrimitive.RootProps = $props();
9
+ </script>
10
+
11
+ <CollapsiblePrimitive.Root bind:ref bind:open data-slot="collapsible" {...restProps} />
@@ -0,0 +1,13 @@
1
+ import Root from "./collapsible.svelte";
2
+ import Trigger from "./collapsible-trigger.svelte";
3
+ import Content from "./collapsible-content.svelte";
4
+
5
+ export {
6
+ Root,
7
+ Content,
8
+ Trigger,
9
+ //
10
+ Root as Collapsible,
11
+ Content as CollapsibleContent,
12
+ Trigger as CollapsibleTrigger,
13
+ };
@@ -0,0 +1,40 @@
1
+ <script lang="ts">
2
+ import type { Command as CommandPrimitive, Dialog as DialogPrimitive } from 'bits-ui';
3
+ import type { Snippet } from 'svelte';
4
+ import Command from './command.svelte';
5
+ import * as Dialog from '../dialog/index.js';
6
+ import type { WithoutChildrenOrChild } from '../utils.js';
7
+
8
+ let {
9
+ open = $bindable(false),
10
+ ref = $bindable(null),
11
+ value = $bindable(''),
12
+ title = 'Command Palette',
13
+ description = 'Search for a command to run',
14
+ portalProps,
15
+ children,
16
+ ...restProps
17
+ }: WithoutChildrenOrChild<DialogPrimitive.RootProps> &
18
+ WithoutChildrenOrChild<CommandPrimitive.RootProps> & {
19
+ portalProps?: DialogPrimitive.PortalProps;
20
+ children: Snippet;
21
+ title?: string;
22
+ description?: string;
23
+ } = $props();
24
+ </script>
25
+
26
+ <Dialog.Root bind:open {...restProps}>
27
+ <Dialog.Header class="sr-only">
28
+ <Dialog.Title>{title}</Dialog.Title>
29
+ <Dialog.Description>{description}</Dialog.Description>
30
+ </Dialog.Header>
31
+ <Dialog.Content class="overflow-hidden p-0" {portalProps}>
32
+ <Command
33
+ class="**:data-[slot=command-input-wrapper]:h-12 [&_[data-command-group]:not([hidden])_~[data-command-group]]:pt-0 [&_[data-command-group]]:px-2 [&_[data-command-input-wrapper]_svg]:h-5 [&_[data-command-input-wrapper]_svg]:w-5 [&_[data-command-input]]:h-12 [&_[data-command-item]]:px-2 [&_[data-command-item]]:py-3 [&_[data-command-item]_svg]:h-5 [&_[data-command-item]_svg]:w-5"
34
+ {...restProps}
35
+ bind:value
36
+ bind:ref
37
+ {children}
38
+ />
39
+ </Dialog.Content>
40
+ </Dialog.Root>
@@ -0,0 +1,13 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive } from 'bits-ui';
3
+ import { cn } from '../utils.js';
4
+
5
+ let { ref = $bindable(null), class: className, ...restProps }: CommandPrimitive.EmptyProps = $props();
6
+ </script>
7
+
8
+ <CommandPrimitive.Empty
9
+ bind:ref
10
+ data-slot="command-empty"
11
+ class={cn('py-6 text-center text-sm', className)}
12
+ {...restProps}
13
+ />
@@ -0,0 +1,30 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive, useId } from 'bits-ui';
3
+ import { cn } from '../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ heading,
10
+ value,
11
+ ...restProps
12
+ }: CommandPrimitive.GroupProps & {
13
+ heading?: string;
14
+ } = $props();
15
+ </script>
16
+
17
+ <CommandPrimitive.Group
18
+ bind:ref
19
+ data-slot="command-group"
20
+ class={cn('text-foreground overflow-hidden p-1', className)}
21
+ value={value ?? heading ?? `----${useId()}`}
22
+ {...restProps}
23
+ >
24
+ {#if heading}
25
+ <CommandPrimitive.GroupHeading class="text-muted-foreground px-2 py-1.5 text-xs font-medium">
26
+ {heading}
27
+ </CommandPrimitive.GroupHeading>
28
+ {/if}
29
+ <CommandPrimitive.GroupItems {children} />
30
+ </CommandPrimitive.Group>
@@ -0,0 +1,21 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive } from 'bits-ui';
3
+ import SearchIcon from '$icons/lucide/search';
4
+ import { cn } from '../utils.js';
5
+
6
+ let { ref = $bindable(null), class: className, value = $bindable(''), ...restProps }: CommandPrimitive.InputProps = $props();
7
+ </script>
8
+
9
+ <div class="flex h-9 items-center gap-2 border-b px-3" data-slot="command-input-wrapper">
10
+ <SearchIcon class="size-4 shrink-0 opacity-50" />
11
+ <CommandPrimitive.Input
12
+ data-slot="command-input"
13
+ class={cn(
14
+ 'placeholder:text-muted-foreground outline-hidden flex h-10 w-full rounded-md bg-transparent py-3 text-sm disabled:cursor-not-allowed disabled:opacity-50',
15
+ className
16
+ )}
17
+ bind:ref
18
+ {...restProps}
19
+ bind:value
20
+ />
21
+ </div>
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive } from 'bits-ui';
3
+ import { cn } from '../utils.js';
4
+
5
+ let { ref = $bindable(null), class: className, ...restProps }: CommandPrimitive.ItemProps = $props();
6
+ </script>
7
+
8
+ <CommandPrimitive.Item
9
+ bind:ref
10
+ data-slot="command-item"
11
+ class={cn(
12
+ "aria-selected:bg-accent aria-selected:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
13
+ className
14
+ )}
15
+ {...restProps}
16
+ />
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive } from 'bits-ui';
3
+ import { cn } from '../utils.js';
4
+
5
+ let { ref = $bindable(null), class: className, ...restProps }: CommandPrimitive.LinkItemProps = $props();
6
+ </script>
7
+
8
+ <CommandPrimitive.LinkItem
9
+ bind:ref
10
+ data-slot="command-item"
11
+ class={cn(
12
+ "aria-selected:bg-accent aria-selected:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
13
+ className
14
+ )}
15
+ {...restProps}
16
+ />
@@ -0,0 +1,13 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive } from 'bits-ui';
3
+ import { cn } from '../utils.js';
4
+
5
+ let { ref = $bindable(null), class: className, ...restProps }: CommandPrimitive.ListProps = $props();
6
+ </script>
7
+
8
+ <CommandPrimitive.List
9
+ bind:ref
10
+ data-slot="command-list"
11
+ class={cn('max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden', className)}
12
+ {...restProps}
13
+ />
@@ -0,0 +1,13 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive } from 'bits-ui';
3
+ import { cn } from '../utils.js';
4
+
5
+ let { ref = $bindable(null), class: className, ...restProps }: CommandPrimitive.SeparatorProps = $props();
6
+ </script>
7
+
8
+ <CommandPrimitive.Separator
9
+ bind:ref
10
+ data-slot="command-separator"
11
+ class={cn('bg-border -mx-1 h-px', className)}
12
+ {...restProps}
13
+ />
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from '../utils.js';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLSpanElement>> = $props();
11
+ </script>
12
+
13
+ <span
14
+ bind:this={ref}
15
+ data-slot="command-shortcut"
16
+ class={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </span>