sandcms 0.6.2 → 0.7.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 (260) hide show
  1. package/README.md +14 -10
  2. package/dist/admin/Account.svelte +286 -83
  3. package/dist/admin/Admin.svelte +14 -1
  4. package/dist/admin/ApiKeys.svelte +146 -79
  5. package/dist/admin/AssetAttachment.svelte +10 -12
  6. package/dist/admin/AssetAttachment.svelte.d.ts +0 -1
  7. package/dist/admin/BlueprintFields.svelte +20 -5
  8. package/dist/admin/BlueprintFields.svelte.d.ts +2 -1
  9. package/dist/admin/Collection.svelte +111 -54
  10. package/dist/admin/Dashboard.svelte +3 -37
  11. package/dist/admin/DateField.svelte +75 -0
  12. package/dist/admin/DateField.svelte.d.ts +11 -0
  13. package/dist/admin/Editor.svelte +70 -65
  14. package/dist/admin/Fields.svelte +24 -23
  15. package/dist/admin/Fields.svelte.d.ts +0 -1
  16. package/dist/admin/FocusPicker.svelte +1 -2
  17. package/dist/admin/Gallery.svelte +2 -7
  18. package/dist/admin/Gallery.svelte.d.ts +0 -1
  19. package/dist/admin/GlobalSearch.svelte +54 -26
  20. package/dist/admin/HoverHint.svelte +37 -0
  21. package/dist/admin/HoverHint.svelte.d.ts +8 -0
  22. package/dist/admin/Inbox.svelte +6 -11
  23. package/dist/admin/LinkField.svelte +128 -66
  24. package/dist/admin/LinkField.svelte.d.ts +0 -1
  25. package/dist/admin/Login.svelte +0 -1
  26. package/dist/admin/MediaLibrary.svelte +70 -56
  27. package/dist/admin/MediaPicker.svelte +62 -55
  28. package/dist/admin/MediaPicker.svelte.d.ts +0 -1
  29. package/dist/admin/NotificationSettings.svelte +35 -27
  30. package/dist/admin/RichText.svelte +2 -2
  31. package/dist/admin/RowMenu.svelte +28 -0
  32. package/dist/admin/RowMenu.svelte.d.ts +10 -0
  33. package/dist/admin/SearchList.svelte +51 -14
  34. package/dist/admin/Shell.svelte +64 -29
  35. package/dist/admin/ThemePicker.svelte +72 -0
  36. package/dist/admin/ThemePicker.svelte.d.ts +18 -0
  37. package/dist/admin/UploadButton.svelte +2 -1
  38. package/dist/admin/UploadProgress.svelte +24 -0
  39. package/dist/admin/UploadProgress.svelte.d.ts +7 -0
  40. package/dist/admin/Users.svelte +106 -50
  41. package/dist/admin/client.d.ts +5 -670
  42. package/dist/admin/client.js +20 -1
  43. package/dist/admin/components/ui/alert/alert.svelte.d.ts +3 -13
  44. package/dist/admin/components/ui/attachment/attachment-media.svelte.d.ts +3 -13
  45. package/dist/admin/components/ui/attachment/attachment.svelte.d.ts +6 -26
  46. package/dist/admin/components/ui/badge/badge.svelte.d.ts +7 -25
  47. package/dist/admin/components/ui/button/button.svelte.d.ts +15 -53
  48. package/dist/admin/components/ui/calendar/calendar-caption.svelte +76 -0
  49. package/dist/admin/components/ui/calendar/calendar-caption.svelte.d.ts +19 -0
  50. package/dist/admin/components/ui/calendar/calendar-cell.svelte +19 -0
  51. package/dist/admin/components/ui/calendar/calendar-cell.svelte.d.ts +4 -0
  52. package/dist/admin/components/ui/calendar/calendar-day.svelte +33 -0
  53. package/dist/admin/components/ui/calendar/calendar-day.svelte.d.ts +4 -0
  54. package/dist/admin/components/ui/calendar/calendar-grid-body.svelte +12 -0
  55. package/dist/admin/components/ui/calendar/calendar-grid-body.svelte.d.ts +4 -0
  56. package/dist/admin/components/ui/calendar/calendar-grid-head.svelte +12 -0
  57. package/dist/admin/components/ui/calendar/calendar-grid-head.svelte.d.ts +4 -0
  58. package/dist/admin/components/ui/calendar/calendar-grid-row.svelte +12 -0
  59. package/dist/admin/components/ui/calendar/calendar-grid-row.svelte.d.ts +4 -0
  60. package/dist/admin/components/ui/calendar/calendar-grid.svelte +16 -0
  61. package/dist/admin/components/ui/calendar/calendar-grid.svelte.d.ts +4 -0
  62. package/dist/admin/components/ui/calendar/calendar-head-cell.svelte +19 -0
  63. package/dist/admin/components/ui/calendar/calendar-head-cell.svelte.d.ts +4 -0
  64. package/dist/admin/components/ui/calendar/calendar-header.svelte +19 -0
  65. package/dist/admin/components/ui/calendar/calendar-header.svelte.d.ts +4 -0
  66. package/dist/admin/components/ui/calendar/calendar-heading.svelte +16 -0
  67. package/dist/admin/components/ui/calendar/calendar-heading.svelte.d.ts +4 -0
  68. package/dist/admin/components/ui/calendar/calendar-month-select.svelte +48 -0
  69. package/dist/admin/components/ui/calendar/calendar-month-select.svelte.d.ts +4 -0
  70. package/dist/admin/components/ui/calendar/calendar-month.svelte +15 -0
  71. package/dist/admin/components/ui/calendar/calendar-month.svelte.d.ts +5 -0
  72. package/dist/admin/components/ui/calendar/calendar-months.svelte +19 -0
  73. package/dist/admin/components/ui/calendar/calendar-months.svelte.d.ts +5 -0
  74. package/dist/admin/components/ui/calendar/calendar-nav.svelte +19 -0
  75. package/dist/admin/components/ui/calendar/calendar-nav.svelte.d.ts +5 -0
  76. package/dist/admin/components/ui/calendar/calendar-next-button.svelte +37 -0
  77. package/dist/admin/components/ui/calendar/calendar-next-button.svelte.d.ts +8 -0
  78. package/dist/admin/components/ui/calendar/calendar-prev-button.svelte +37 -0
  79. package/dist/admin/components/ui/calendar/calendar-prev-button.svelte.d.ts +8 -0
  80. package/dist/admin/components/ui/calendar/calendar-year-select.svelte +47 -0
  81. package/dist/admin/components/ui/calendar/calendar-year-select.svelte.d.ts +4 -0
  82. package/dist/admin/components/ui/calendar/calendar.svelte +115 -0
  83. package/dist/admin/components/ui/calendar/calendar.svelte.d.ts +21 -0
  84. package/dist/admin/components/ui/calendar/index.d.ts +19 -0
  85. package/dist/admin/components/ui/calendar/index.js +21 -0
  86. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte +16 -0
  87. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte.d.ts +4 -0
  88. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +46 -0
  89. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +9 -0
  90. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-content.svelte +31 -0
  91. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +10 -0
  92. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
  93. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +8 -0
  94. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-group.svelte +7 -0
  95. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-group.svelte.d.ts +4 -0
  96. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-item.svelte +27 -0
  97. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +8 -0
  98. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-label.svelte +24 -0
  99. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts +8 -0
  100. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-portal.svelte +7 -0
  101. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-portal.svelte.d.ts +3 -0
  102. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +16 -0
  103. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +4 -0
  104. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +36 -0
  105. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +4 -0
  106. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-separator.svelte +17 -0
  107. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +4 -0
  108. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +23 -0
  109. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +5 -0
  110. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +31 -0
  111. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +10 -0
  112. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
  113. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +7 -0
  114. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-sub.svelte +7 -0
  115. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-sub.svelte.d.ts +3 -0
  116. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +7 -0
  117. package/dist/admin/components/ui/dropdown-menu/dropdown-menu-trigger.svelte.d.ts +4 -0
  118. package/dist/admin/components/ui/dropdown-menu/dropdown-menu.svelte +7 -0
  119. package/dist/admin/components/ui/dropdown-menu/dropdown-menu.svelte.d.ts +3 -0
  120. package/dist/admin/components/ui/dropdown-menu/index.d.ts +18 -0
  121. package/dist/admin/components/ui/dropdown-menu/index.js +18 -0
  122. package/dist/admin/components/ui/input-otp/index.d.ts +5 -0
  123. package/dist/admin/components/ui/input-otp/index.js +5 -0
  124. package/dist/admin/components/ui/input-otp/input-otp-group.svelte +23 -0
  125. package/dist/admin/components/ui/input-otp/input-otp-group.svelte.d.ts +5 -0
  126. package/dist/admin/components/ui/input-otp/input-otp-separator.svelte +27 -0
  127. package/dist/admin/components/ui/input-otp/input-otp-separator.svelte.d.ts +5 -0
  128. package/dist/admin/components/ui/input-otp/input-otp-slot.svelte +29 -0
  129. package/dist/admin/components/ui/input-otp/input-otp-slot.svelte.d.ts +4 -0
  130. package/dist/admin/components/ui/input-otp/input-otp.svelte +24 -0
  131. package/dist/admin/components/ui/input-otp/input-otp.svelte.d.ts +4 -0
  132. package/dist/admin/components/ui/popover/index.d.ts +9 -0
  133. package/dist/admin/components/ui/popover/index.js +11 -0
  134. package/dist/admin/components/ui/popover/popover-close.svelte +7 -0
  135. package/dist/admin/components/ui/popover/popover-close.svelte.d.ts +4 -0
  136. package/dist/admin/components/ui/popover/popover-content.svelte +31 -0
  137. package/dist/admin/components/ui/popover/popover-content.svelte.d.ts +10 -0
  138. package/dist/admin/components/ui/popover/popover-description.svelte +20 -0
  139. package/dist/admin/components/ui/popover/popover-description.svelte.d.ts +5 -0
  140. package/dist/admin/components/ui/popover/popover-header.svelte +20 -0
  141. package/dist/admin/components/ui/popover/popover-header.svelte.d.ts +5 -0
  142. package/dist/admin/components/ui/popover/popover-portal.svelte +7 -0
  143. package/dist/admin/components/ui/popover/popover-portal.svelte.d.ts +3 -0
  144. package/dist/admin/components/ui/popover/popover-title.svelte +20 -0
  145. package/dist/admin/components/ui/popover/popover-title.svelte.d.ts +5 -0
  146. package/dist/admin/components/ui/popover/popover-trigger.svelte +17 -0
  147. package/dist/admin/components/ui/popover/popover-trigger.svelte.d.ts +4 -0
  148. package/dist/admin/components/ui/popover/popover.svelte +7 -0
  149. package/dist/admin/components/ui/popover/popover.svelte.d.ts +3 -0
  150. package/dist/admin/components/ui/switch/switch.svelte +2 -2
  151. package/dist/admin/components/ui/toggle/toggle.svelte.d.ts +6 -26
  152. package/dist/admin/components/ui/tooltip/index.d.ts +6 -0
  153. package/dist/admin/components/ui/tooltip/index.js +8 -0
  154. package/dist/admin/components/ui/tooltip/tooltip-content.svelte +48 -0
  155. package/dist/admin/components/ui/tooltip/tooltip-content.svelte.d.ts +11 -0
  156. package/dist/admin/components/ui/tooltip/tooltip-portal.svelte +7 -0
  157. package/dist/admin/components/ui/tooltip/tooltip-portal.svelte.d.ts +4 -0
  158. package/dist/admin/components/ui/tooltip/tooltip-provider.svelte +7 -0
  159. package/dist/admin/components/ui/tooltip/tooltip-provider.svelte.d.ts +4 -0
  160. package/dist/admin/components/ui/tooltip/tooltip-trigger.svelte +7 -0
  161. package/dist/admin/components/ui/tooltip/tooltip-trigger.svelte.d.ts +25 -0
  162. package/dist/admin/components/ui/tooltip/tooltip.svelte +7 -0
  163. package/dist/admin/components/ui/tooltip/tooltip.svelte.d.ts +25 -0
  164. package/dist/admin/generated/admin.css +1298 -234
  165. package/dist/admin/slug.d.ts +1 -0
  166. package/dist/admin/slug.js +6 -0
  167. package/dist/admin/theme-context.d.ts +7 -0
  168. package/dist/admin/theme-context.js +3 -0
  169. package/dist/admin/theme.d.ts +7 -0
  170. package/dist/admin/theme.js +14 -0
  171. package/dist/admin/types.d.ts +2 -1
  172. package/dist/admin/uploads.d.ts +8 -1
  173. package/dist/admin/uploads.js +94 -16
  174. package/dist/blueprints/files.js +1 -0
  175. package/dist/blueprints/load.js +7 -2
  176. package/dist/blueprints/types.d.ts +4 -1
  177. package/dist/cli/doctor.d.ts +3 -1
  178. package/dist/cli/doctor.js +85 -30
  179. package/dist/cli/files.d.ts +2 -6
  180. package/dist/cli/files.js +11 -2
  181. package/dist/cli/index.js +99 -31
  182. package/dist/cli/scaffold.js +8 -8
  183. package/dist/cli/setup.js +16 -26
  184. package/dist/cli/upgrade.js +21 -2
  185. package/dist/env.d.ts +32 -0
  186. package/dist/env.js +53 -3
  187. package/dist/server/admin-load.d.ts +13 -5
  188. package/dist/server/admin-load.js +8 -3
  189. package/dist/server/api-access.d.ts +4 -0
  190. package/dist/server/api-access.js +15 -2
  191. package/dist/server/api-pagination.d.ts +3 -0
  192. package/dist/server/api.js +11 -3
  193. package/dist/server/auth.d.ts +11 -9
  194. package/dist/server/auth.js +23 -0
  195. package/dist/server/cms.d.ts +65 -18
  196. package/dist/server/cms.js +62 -6
  197. package/dist/server/db/migration-data.js +4 -0
  198. package/dist/server/db/migrations/0009_local_media.sql +9 -0
  199. package/dist/server/db/migrations/meta/0009_snapshot.json +1763 -0
  200. package/dist/server/db/migrations/meta/_journal.json +7 -0
  201. package/dist/server/db/schema.d.ts +119 -2
  202. package/dist/server/db/schema.js +15 -3
  203. package/dist/server/hooks.js +155 -81
  204. package/dist/server/media/contracts.d.ts +115 -0
  205. package/dist/server/media/contracts.js +12 -0
  206. package/dist/server/media/deletions.d.ts +2 -1
  207. package/dist/server/media/deletions.js +3 -3
  208. package/dist/server/media/delivery.js +7 -11
  209. package/dist/server/media/import-r2.d.ts +56 -0
  210. package/dist/server/media/import-r2.js +342 -0
  211. package/dist/server/media/processor-child.d.ts +2 -0
  212. package/dist/server/media/processor-child.js +236 -0
  213. package/dist/server/media/processor.d.ts +51 -0
  214. package/dist/server/media/processor.js +135 -0
  215. package/dist/server/media/render-math.d.ts +24 -0
  216. package/dist/server/media/render-math.js +50 -0
  217. package/dist/server/media/runner.d.ts +30 -1
  218. package/dist/server/media/runner.js +418 -165
  219. package/dist/server/media/service.d.ts +56 -10
  220. package/dist/server/media/service.js +309 -98
  221. package/dist/server/media/storage.d.ts +5 -0
  222. package/dist/server/media/storage.js +279 -0
  223. package/dist/server/media/svg.d.ts +5 -0
  224. package/dist/server/media/svg.js +142 -0
  225. package/dist/server/media/upload-ticket.d.ts +12 -0
  226. package/dist/server/media/upload-ticket.js +35 -0
  227. package/dist/server/media/verify.d.ts +36 -0
  228. package/dist/server/media/verify.js +109 -0
  229. package/dist/server/platform/http.d.ts +27 -0
  230. package/dist/server/platform/http.js +77 -0
  231. package/dist/server/platform/index.d.ts +52 -0
  232. package/dist/server/platform/index.js +98 -0
  233. package/dist/server/platform/snapshots.d.ts +18 -0
  234. package/dist/server/platform/snapshots.js +110 -0
  235. package/dist/server/platform/volume.d.ts +20 -0
  236. package/dist/server/platform/volume.js +60 -0
  237. package/dist/worker/svg.d.ts +1 -5
  238. package/dist/worker/svg.js +2 -142
  239. package/docs/acceptance.md +6 -4
  240. package/docs/api.md +42 -4
  241. package/docs/cloudflare.md +48 -142
  242. package/docs/content.md +2 -2
  243. package/docs/deployment.md +159 -57
  244. package/docs/forms.md +1 -1
  245. package/docs/media.md +85 -21
  246. package/docs/package.md +21 -18
  247. package/docs/plans/0.7-self-hosted.md +264 -0
  248. package/docs/releases.md +27 -1
  249. package/docs/upgrades.md +44 -6
  250. package/package.json +38 -37
  251. package/templates/Dockerfile +28 -0
  252. package/templates/integration.ts +18 -2
  253. package/templates/railpack.json +1 -1
  254. package/templates/sandcms/blueprints/files/image.yaml +1 -1
  255. package/templates/sandcms/config.yaml +0 -1
  256. package/dist/cli/cloudflare.d.ts +0 -8
  257. package/dist/cli/cloudflare.js +0 -135
  258. package/templates/sandcms/worker/index.ts +0 -1
  259. package/templates/sandcms/worker/local.ts +0 -1
  260. package/templates/sandcms/worker/wrangler.jsonc +0 -6
@@ -22,9 +22,28 @@ export async function api(path, body) {
22
22
  throw new ApiError(data.error ?? data.message ?? 'Request failed', data.fields);
23
23
  return data;
24
24
  }
25
+ /** Copy text, falling back to a hidden textarea when the Clipboard API is unavailable. */
26
+ export async function copyText(value) {
27
+ try {
28
+ if (navigator.clipboard)
29
+ return await navigator.clipboard.writeText(value);
30
+ }
31
+ catch {
32
+ // The Clipboard API needs a secure context and permission; fall through.
33
+ }
34
+ const area = document.createElement('textarea');
35
+ area.value = value;
36
+ area.style.position = 'fixed';
37
+ area.style.opacity = '0';
38
+ document.body.appendChild(area);
39
+ area.select();
40
+ document.execCommand('copy');
41
+ area.remove();
42
+ }
25
43
  export const message = (e) => e instanceof Error ? e.message : 'Something went wrong. Please try again.';
26
- export function assetUrl(asset, _workerUrl) {
44
+ export function assetUrl(asset) {
27
45
  const preview = asset.variants.find((v) => v.preset === 'sandcms-preview') ?? asset.variants[0];
28
46
  return preview ? '/api/cms/media/' + preview.key : '';
29
47
  }
48
+ export const megabytes = (bytes) => (bytes / 1_000_000).toLocaleString('en', { maximumFractionDigits: 1 });
30
49
  export const date = (timestamp) => new Intl.DateTimeFormat('en', { month: 'short', day: 'numeric', year: 'numeric' }).format(timestamp);
@@ -1,20 +1,10 @@
1
1
  import { type VariantProps } from 'tailwind-variants';
2
2
  export declare const alertVariants: import("tailwind-variants").TVReturnType<{
3
3
  variant: {
4
- default: "bg-card text-card-foreground";
5
- destructive: "text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current";
4
+ default: string;
5
+ destructive: string;
6
6
  };
7
- }, undefined, "grid gap-0.5 rounded-none border px-2.5 py-2 text-left text-xs has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full", {
8
- variant: {
9
- default: "bg-card text-card-foreground";
10
- destructive: "text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current";
11
- };
12
- }, undefined, import("tailwind-variants").TVReturnTypeLike<{
13
- variant: {
14
- default: "bg-card text-card-foreground";
15
- destructive: "text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current";
16
- };
17
- }, undefined>>;
7
+ }, undefined, "grid gap-0.5 rounded-none border px-2.5 py-2 text-left text-xs has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full", undefined, undefined, undefined>;
18
8
  export type AlertVariant = VariantProps<typeof alertVariants>['variant'];
19
9
  import { type WithElementRef } from '../../../utils.js';
20
10
  import type { HTMLAttributes } from 'svelte/elements';
@@ -1,20 +1,10 @@
1
1
  import { type VariantProps } from 'tailwind-variants';
2
2
  export declare const attachmentMediaVariants: import("tailwind-variants").TVReturnType<{
3
3
  variant: {
4
- icon: "";
5
- image: "opacity-60 group-data-[state=idle]/attachment:opacity-100 group-data-[state=done]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover";
4
+ icon: string;
5
+ image: string;
6
6
  };
7
- }, undefined, "bg-muted text-foreground w-10 rounded-none group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-none [&_svg:not([class*='size-'])]:size-4 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5 group-data-[orientation=vertical]/attachment:w-full group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! relative flex aspect-square shrink-0 items-center justify-center overflow-hidden group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive [&_svg]:pointer-events-none", {
8
- variant: {
9
- icon: "";
10
- image: "opacity-60 group-data-[state=idle]/attachment:opacity-100 group-data-[state=done]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover";
11
- };
12
- }, undefined, import("tailwind-variants").TVReturnTypeLike<{
13
- variant: {
14
- icon: "";
15
- image: "opacity-60 group-data-[state=idle]/attachment:opacity-100 group-data-[state=done]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover";
16
- };
17
- }, undefined>>;
7
+ }, undefined, "bg-muted text-foreground w-10 rounded-none group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-none [&_svg:not([class*='size-'])]:size-4 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5 group-data-[orientation=vertical]/attachment:w-full group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! relative flex aspect-square shrink-0 items-center justify-center overflow-hidden group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive [&_svg]:pointer-events-none", undefined, undefined, undefined>;
18
8
  export type AttachmentMediaVariant = VariantProps<typeof attachmentMediaVariants>['variant'];
19
9
  import { type WithElementRef } from '../../../utils.js';
20
10
  import type { HTMLAttributes } from 'svelte/elements';
@@ -1,35 +1,15 @@
1
1
  import { type VariantProps } from 'tailwind-variants';
2
2
  export declare const attachmentVariants: import("tailwind-variants").TVReturnType<{
3
3
  size: {
4
- default: "gap-2 has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5 text-xs";
5
- sm: "gap-2.5 has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1 text-xs";
6
- xs: "gap-1.5 has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1 text-xs rounded-none";
4
+ default: string;
5
+ sm: string;
6
+ xs: string;
7
7
  };
8
8
  orientation: {
9
- horizontal: "min-w-40 items-center";
10
- vertical: "w-24 has-data-[slot=attachment-content]:w-30 flex-col";
9
+ horizontal: string;
10
+ vertical: string;
11
11
  };
12
- }, undefined, "rounded-none w-fit focus-within:ring-1 focus-within:ring-ring/50 group/attachment relative flex max-w-full min-w-0 shrink-0 flex-wrap border bg-card text-card-foreground transition-colors has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed", {
13
- size: {
14
- default: "gap-2 has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5 text-xs";
15
- sm: "gap-2.5 has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1 text-xs";
16
- xs: "gap-1.5 has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1 text-xs rounded-none";
17
- };
18
- orientation: {
19
- horizontal: "min-w-40 items-center";
20
- vertical: "w-24 has-data-[slot=attachment-content]:w-30 flex-col";
21
- };
22
- }, undefined, import("tailwind-variants").TVReturnTypeLike<{
23
- size: {
24
- default: "gap-2 has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5 text-xs";
25
- sm: "gap-2.5 has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1 text-xs";
26
- xs: "gap-1.5 has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1 text-xs rounded-none";
27
- };
28
- orientation: {
29
- horizontal: "min-w-40 items-center";
30
- vertical: "w-24 has-data-[slot=attachment-content]:w-30 flex-col";
31
- };
32
- }, undefined>>;
12
+ }, undefined, "rounded-none w-fit focus-within:ring-1 focus-within:ring-ring/50 group/attachment relative flex max-w-full min-w-0 shrink-0 flex-wrap border bg-card text-card-foreground transition-colors has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed", undefined, undefined, undefined>;
33
13
  export type AttachmentSize = VariantProps<typeof attachmentVariants>['size'];
34
14
  export type AttachmentOrientation = VariantProps<typeof attachmentVariants>['orientation'];
35
15
  export type AttachmentState = 'idle' | 'uploading' | 'processing' | 'error' | 'done';
@@ -1,32 +1,14 @@
1
1
  import { type VariantProps } from 'tailwind-variants';
2
2
  export declare const badgeVariants: import("tailwind-variants").TVReturnType<{
3
3
  variant: {
4
- default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80";
5
- secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80";
6
- destructive: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20";
7
- outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground";
8
- ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50";
9
- link: "text-primary underline-offset-4 hover:underline";
4
+ default: string;
5
+ secondary: string;
6
+ destructive: string;
7
+ outline: string;
8
+ ghost: string;
9
+ link: string;
10
10
  };
11
- }, undefined, "h-5 gap-1 rounded-none border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none", {
12
- variant: {
13
- default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80";
14
- secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80";
15
- destructive: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20";
16
- outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground";
17
- ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50";
18
- link: "text-primary underline-offset-4 hover:underline";
19
- };
20
- }, undefined, import("tailwind-variants").TVReturnTypeLike<{
21
- variant: {
22
- default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80";
23
- secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80";
24
- destructive: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20";
25
- outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground";
26
- ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50";
27
- link: "text-primary underline-offset-4 hover:underline";
28
- };
29
- }, undefined>>;
11
+ }, undefined, "h-5 gap-1 rounded-none border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none", undefined, undefined, undefined>;
30
12
  export type BadgeVariant = VariantProps<typeof badgeVariants>['variant'];
31
13
  import { type WithElementRef } from '../../../utils.js';
32
14
  import type { HTMLAnchorAttributes } from 'svelte/elements';
@@ -3,62 +3,24 @@ import { type WithElementRef } from '../../../utils.js';
3
3
  import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
4
4
  export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
5
5
  variant: {
6
- default: "bg-primary text-primary-foreground hover:bg-primary/80";
7
- outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground";
8
- secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground";
9
- ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground";
10
- destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30";
11
- link: "text-primary underline-offset-4 hover:underline";
6
+ default: string;
7
+ outline: string;
8
+ secondary: string;
9
+ ghost: string;
10
+ destructive: string;
11
+ link: string;
12
12
  };
13
13
  size: {
14
- default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
15
- xs: "h-6 gap-1 rounded-none px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3";
16
- sm: "h-7 gap-1 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5";
17
- lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
18
- icon: "size-8";
19
- 'icon-xs': "size-6 rounded-none [&_svg:not([class*='size-'])]:size-3";
20
- 'icon-sm': "size-7 rounded-none";
21
- 'icon-lg': "size-9";
14
+ default: string;
15
+ xs: string;
16
+ sm: string;
17
+ lg: string;
18
+ icon: string;
19
+ 'icon-xs': string;
20
+ 'icon-sm': string;
21
+ 'icon-lg': string;
22
22
  };
23
- }, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-none border border-transparent bg-clip-padding text-xs font-medium focus-visible:ring-1 aria-invalid:ring-1 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
24
- variant: {
25
- default: "bg-primary text-primary-foreground hover:bg-primary/80";
26
- outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground";
27
- secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground";
28
- ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground";
29
- destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30";
30
- link: "text-primary underline-offset-4 hover:underline";
31
- };
32
- size: {
33
- default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
34
- xs: "h-6 gap-1 rounded-none px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3";
35
- sm: "h-7 gap-1 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5";
36
- lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
37
- icon: "size-8";
38
- 'icon-xs': "size-6 rounded-none [&_svg:not([class*='size-'])]:size-3";
39
- 'icon-sm': "size-7 rounded-none";
40
- 'icon-lg': "size-9";
41
- };
42
- }, undefined, import("tailwind-variants").TVReturnTypeLike<{
43
- variant: {
44
- default: "bg-primary text-primary-foreground hover:bg-primary/80";
45
- outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground";
46
- secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground";
47
- ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground";
48
- destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30";
49
- link: "text-primary underline-offset-4 hover:underline";
50
- };
51
- size: {
52
- default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
53
- xs: "h-6 gap-1 rounded-none px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3";
54
- sm: "h-7 gap-1 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5";
55
- lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
56
- icon: "size-8";
57
- 'icon-xs': "size-6 rounded-none [&_svg:not([class*='size-'])]:size-3";
58
- 'icon-sm': "size-7 rounded-none";
59
- 'icon-lg': "size-9";
60
- };
61
- }, undefined>>;
23
+ }, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-none border border-transparent bg-clip-padding text-xs font-medium focus-visible:ring-1 aria-invalid:ring-1 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", undefined, undefined, undefined>;
62
24
  export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
63
25
  export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
64
26
  export type ButtonProps = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes> & {
@@ -0,0 +1,76 @@
1
+ <script lang="ts">
2
+ import { DateFormatter, getLocalTimeZone, type DateValue } from '@internationalized/date';
3
+ import CalendarMonthSelect from './calendar-month-select.svelte';
4
+ import CalendarYearSelect from './calendar-year-select.svelte';
5
+ import type Calendar from './calendar.svelte';
6
+ import type { ComponentProps } from 'svelte';
7
+
8
+ let {
9
+ captionLayout,
10
+ months,
11
+ monthFormat,
12
+ years,
13
+ yearFormat,
14
+ month,
15
+ locale,
16
+ placeholder = $bindable(),
17
+ monthIndex = 0
18
+ }: {
19
+ captionLayout: ComponentProps<typeof Calendar>['captionLayout'];
20
+ months: ComponentProps<typeof CalendarMonthSelect>['months'];
21
+ monthFormat: ComponentProps<typeof CalendarMonthSelect>['monthFormat'];
22
+ years: ComponentProps<typeof CalendarYearSelect>['years'];
23
+ yearFormat: ComponentProps<typeof CalendarYearSelect>['yearFormat'];
24
+ month: DateValue;
25
+ placeholder: DateValue | undefined;
26
+ locale: string;
27
+ monthIndex: number;
28
+ } = $props();
29
+
30
+ function formatYear(date: DateValue) {
31
+ const dateObj = date.toDate(getLocalTimeZone());
32
+ if (typeof yearFormat === 'function') return yearFormat(dateObj.getFullYear());
33
+ return new DateFormatter(locale, { year: yearFormat }).format(dateObj);
34
+ }
35
+
36
+ function formatMonth(date: DateValue) {
37
+ const dateObj = date.toDate(getLocalTimeZone());
38
+ if (typeof monthFormat === 'function') return monthFormat(dateObj.getMonth() + 1);
39
+ return new DateFormatter(locale, { month: monthFormat }).format(dateObj);
40
+ }
41
+ </script>
42
+
43
+ {#snippet MonthSelect()}
44
+ <CalendarMonthSelect
45
+ {months}
46
+ {monthFormat}
47
+ value={month.month}
48
+ onchange={(e) => {
49
+ if (!placeholder) return;
50
+ const v = Number.parseInt(e.currentTarget.value);
51
+ const newPlaceholder = placeholder.set({ month: v });
52
+ placeholder = newPlaceholder.subtract({ months: monthIndex });
53
+ }}
54
+ />
55
+ {/snippet}
56
+
57
+ {#snippet YearSelect()}
58
+ <CalendarYearSelect {years} {yearFormat} value={month.year} />
59
+ {/snippet}
60
+
61
+ {#if captionLayout === 'dropdown'}
62
+ {@render MonthSelect()}
63
+ {@render YearSelect()}
64
+ {:else if captionLayout === 'dropdown-months'}
65
+ {@render MonthSelect()}
66
+ {#if placeholder}
67
+ {formatYear(placeholder)}
68
+ {/if}
69
+ {:else if captionLayout === 'dropdown-years'}
70
+ {#if placeholder}
71
+ {formatMonth(placeholder)}
72
+ {/if}
73
+ {@render YearSelect()}
74
+ {:else}
75
+ {formatMonth(month)} {formatYear(month)}
76
+ {/if}
@@ -0,0 +1,19 @@
1
+ import { type DateValue } from '@internationalized/date';
2
+ import CalendarMonthSelect from './calendar-month-select.svelte';
3
+ import CalendarYearSelect from './calendar-year-select.svelte';
4
+ import type Calendar from './calendar.svelte';
5
+ import type { ComponentProps } from 'svelte';
6
+ type $$ComponentProps = {
7
+ captionLayout: ComponentProps<typeof Calendar>['captionLayout'];
8
+ months: ComponentProps<typeof CalendarMonthSelect>['months'];
9
+ monthFormat: ComponentProps<typeof CalendarMonthSelect>['monthFormat'];
10
+ years: ComponentProps<typeof CalendarYearSelect>['years'];
11
+ yearFormat: ComponentProps<typeof CalendarYearSelect>['yearFormat'];
12
+ month: DateValue;
13
+ placeholder: DateValue | undefined;
14
+ locale: string;
15
+ monthIndex: number;
16
+ };
17
+ declare const CalendarCaption: import("svelte").Component<$$ComponentProps, {}, "placeholder">;
18
+ type CalendarCaption = ReturnType<typeof CalendarCaption>;
19
+ export default CalendarCaption;
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CalendarPrimitive.CellProps = $props();
10
+ </script>
11
+
12
+ <CalendarPrimitive.Cell
13
+ bind:ref
14
+ class={cn(
15
+ 'relative size-(--cell-size) p-0 text-center text-sm focus-within:z-20 [&:first-child[data-selected]_[data-bits-day]]:rounded-s-(--cell-radius) [&:last-child[data-selected]_[data-bits-day]]:rounded-e-(--cell-radius)',
16
+ className
17
+ )}
18
+ {...restProps}
19
+ />
@@ -0,0 +1,4 @@
1
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
2
+ declare const CalendarCell: import("svelte").Component<CalendarPrimitive.CellProps, {}, "ref">;
3
+ type CalendarCell = ReturnType<typeof CalendarCell>;
4
+ export default CalendarCell;
@@ -0,0 +1,33 @@
1
+ <script lang="ts">
2
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CalendarPrimitive.DayProps = $props();
10
+ </script>
11
+
12
+ <CalendarPrimitive.Day
13
+ bind:ref
14
+ class={cn(
15
+ 'flex size-(--cell-size) flex-col items-center justify-center gap-1 rounded-(--cell-radius) p-0 leading-none font-normal whitespace-nowrap select-none',
16
+ '[&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)',
17
+ 'not-data-selected:hover:bg-accent/50 not-data-selected:hover:text-accent-foreground',
18
+ '[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground [&[data-today][data-disabled]]:text-muted-foreground',
19
+ 'data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:hover:text-foreground',
20
+ // Outside months
21
+ '[&[data-outside-month]:not([data-selected])]:text-muted-foreground [&[data-outside-month]:not([data-selected])]:hover:text-accent-foreground',
22
+ // Disabled
23
+ 'data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground data-[disabled]:opacity-50',
24
+ // Unavailable
25
+ 'data-[unavailable]:text-muted-foreground data-[unavailable]:line-through',
26
+ // focus
27
+ 'focus:relative focus:border-ring focus:ring-ring/50',
28
+ // inner spans
29
+ '[&>span]:text-xs [&>span]:opacity-70',
30
+ className
31
+ )}
32
+ {...restProps}
33
+ />
@@ -0,0 +1,4 @@
1
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
2
+ declare const CalendarDay: import("svelte").Component<CalendarPrimitive.DayProps, {}, "ref">;
3
+ type CalendarDay = ReturnType<typeof CalendarDay>;
4
+ export default CalendarDay;
@@ -0,0 +1,12 @@
1
+ <script lang="ts">
2
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CalendarPrimitive.GridBodyProps = $props();
10
+ </script>
11
+
12
+ <CalendarPrimitive.GridBody bind:ref class={cn(className)} {...restProps} />
@@ -0,0 +1,4 @@
1
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
2
+ declare const CalendarGridBody: import("svelte").Component<CalendarPrimitive.GridBodyProps, {}, "ref">;
3
+ type CalendarGridBody = ReturnType<typeof CalendarGridBody>;
4
+ export default CalendarGridBody;
@@ -0,0 +1,12 @@
1
+ <script lang="ts">
2
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CalendarPrimitive.GridHeadProps = $props();
10
+ </script>
11
+
12
+ <CalendarPrimitive.GridHead bind:ref class={cn(className)} {...restProps} />
@@ -0,0 +1,4 @@
1
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
2
+ declare const CalendarGridHead: import("svelte").Component<CalendarPrimitive.GridHeadProps, {}, "ref">;
3
+ type CalendarGridHead = ReturnType<typeof CalendarGridHead>;
4
+ export default CalendarGridHead;
@@ -0,0 +1,12 @@
1
+ <script lang="ts">
2
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CalendarPrimitive.GridRowProps = $props();
10
+ </script>
11
+
12
+ <CalendarPrimitive.GridRow bind:ref class={cn('flex', className)} {...restProps} />
@@ -0,0 +1,4 @@
1
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
2
+ declare const CalendarGridRow: import("svelte").Component<CalendarPrimitive.GridRowProps, {}, "ref">;
3
+ type CalendarGridRow = ReturnType<typeof CalendarGridRow>;
4
+ export default CalendarGridRow;
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CalendarPrimitive.GridProps = $props();
10
+ </script>
11
+
12
+ <CalendarPrimitive.Grid
13
+ bind:ref
14
+ class={cn('flex w-full border-collapse flex-col', className)}
15
+ {...restProps}
16
+ />
@@ -0,0 +1,4 @@
1
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
2
+ declare const CalendarGrid: import("svelte").Component<CalendarPrimitive.GridProps, {}, "ref">;
3
+ type CalendarGrid = ReturnType<typeof CalendarGrid>;
4
+ export default CalendarGrid;
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CalendarPrimitive.HeadCellProps = $props();
10
+ </script>
11
+
12
+ <CalendarPrimitive.HeadCell
13
+ bind:ref
14
+ class={cn(
15
+ 'w-(--cell-size) rounded-md text-[0.8rem] font-normal text-muted-foreground',
16
+ className
17
+ )}
18
+ {...restProps}
19
+ />
@@ -0,0 +1,4 @@
1
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
2
+ declare const CalendarHeadCell: import("svelte").Component<CalendarPrimitive.HeadCellProps, {}, "ref">;
3
+ type CalendarHeadCell = ReturnType<typeof CalendarHeadCell>;
4
+ export default CalendarHeadCell;
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CalendarPrimitive.HeaderProps = $props();
10
+ </script>
11
+
12
+ <CalendarPrimitive.Header
13
+ bind:ref
14
+ class={cn(
15
+ 'flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium',
16
+ className
17
+ )}
18
+ {...restProps}
19
+ />
@@ -0,0 +1,4 @@
1
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
2
+ declare const CalendarHeader: import("svelte").Component<CalendarPrimitive.HeaderProps, {}, "ref">;
3
+ type CalendarHeader = ReturnType<typeof CalendarHeader>;
4
+ export default CalendarHeader;
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CalendarPrimitive.HeadingProps = $props();
10
+ </script>
11
+
12
+ <CalendarPrimitive.Heading
13
+ bind:ref
14
+ class={cn('px-(--cell-size) text-sm font-medium', className)}
15
+ {...restProps}
16
+ />
@@ -0,0 +1,4 @@
1
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
2
+ declare const CalendarHeading: import("svelte").Component<CalendarPrimitive.HeadingProps, {}, "ref">;
3
+ type CalendarHeading = ReturnType<typeof CalendarHeading>;
4
+ export default CalendarHeading;
@@ -0,0 +1,48 @@
1
+ <script lang="ts">
2
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
3
+ import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
4
+ import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ value,
10
+ onchange,
11
+ ...restProps
12
+ }: WithoutChildrenOrChild<CalendarPrimitive.MonthSelectProps> = $props();
13
+ </script>
14
+
15
+ <span
16
+ class={cn(
17
+ 'relative flex rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50',
18
+ className
19
+ )}
20
+ >
21
+ <CalendarPrimitive.MonthSelect
22
+ bind:ref
23
+ class="absolute inset-0 bg-background opacity-0 dark:bg-popover dark:text-popover-foreground"
24
+ {...restProps}
25
+ >
26
+ {#snippet child({ props, monthItems, selectedMonthItem })}
27
+ <select {...props} {value} {onchange}>
28
+ {#each monthItems as monthItem (monthItem.value)}
29
+ <option
30
+ value={monthItem.value}
31
+ selected={value !== undefined
32
+ ? monthItem.value === value
33
+ : monthItem.value === selectedMonthItem.value}
34
+ >
35
+ {monthItem.label}
36
+ </option>
37
+ {/each}
38
+ </select>
39
+ <span
40
+ class="flex h-(--cell-size) items-center gap-1 rounded-md ps-2 pe-1 text-sm font-medium select-none [&>svg]:size-3.5 [&>svg]:text-muted-foreground"
41
+ aria-hidden="true"
42
+ >
43
+ {monthItems.find((item) => item.value === value)?.label || selectedMonthItem.label}
44
+ <ChevronDownIcon class={cn('size-4', className)} />
45
+ </span>
46
+ {/snippet}
47
+ </CalendarPrimitive.MonthSelect>
48
+ </span>
@@ -0,0 +1,4 @@
1
+ import { Calendar as CalendarPrimitive } from 'bits-ui';
2
+ declare const CalendarMonthSelect: import("svelte").Component<Omit<Omit<CalendarPrimitive.MonthSelectProps, "child">, "children">, {}, "ref">;
3
+ type CalendarMonthSelect = ReturnType<typeof CalendarMonthSelect>;
4
+ export default CalendarMonthSelect;