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.
- package/README.md +14 -10
- package/dist/admin/Account.svelte +286 -83
- package/dist/admin/Admin.svelte +14 -1
- package/dist/admin/ApiKeys.svelte +146 -79
- package/dist/admin/AssetAttachment.svelte +10 -12
- package/dist/admin/AssetAttachment.svelte.d.ts +0 -1
- package/dist/admin/BlueprintFields.svelte +20 -5
- package/dist/admin/BlueprintFields.svelte.d.ts +2 -1
- package/dist/admin/Collection.svelte +111 -54
- package/dist/admin/Dashboard.svelte +3 -37
- package/dist/admin/DateField.svelte +75 -0
- package/dist/admin/DateField.svelte.d.ts +11 -0
- package/dist/admin/Editor.svelte +70 -65
- package/dist/admin/Fields.svelte +24 -23
- package/dist/admin/Fields.svelte.d.ts +0 -1
- package/dist/admin/FocusPicker.svelte +1 -2
- package/dist/admin/Gallery.svelte +2 -7
- package/dist/admin/Gallery.svelte.d.ts +0 -1
- package/dist/admin/GlobalSearch.svelte +54 -26
- package/dist/admin/HoverHint.svelte +37 -0
- package/dist/admin/HoverHint.svelte.d.ts +8 -0
- package/dist/admin/Inbox.svelte +6 -11
- package/dist/admin/LinkField.svelte +128 -66
- package/dist/admin/LinkField.svelte.d.ts +0 -1
- package/dist/admin/Login.svelte +0 -1
- package/dist/admin/MediaLibrary.svelte +70 -56
- package/dist/admin/MediaPicker.svelte +62 -55
- package/dist/admin/MediaPicker.svelte.d.ts +0 -1
- package/dist/admin/NotificationSettings.svelte +35 -27
- package/dist/admin/RichText.svelte +2 -2
- package/dist/admin/RowMenu.svelte +28 -0
- package/dist/admin/RowMenu.svelte.d.ts +10 -0
- package/dist/admin/SearchList.svelte +51 -14
- package/dist/admin/Shell.svelte +64 -29
- package/dist/admin/ThemePicker.svelte +72 -0
- package/dist/admin/ThemePicker.svelte.d.ts +18 -0
- package/dist/admin/UploadButton.svelte +2 -1
- package/dist/admin/UploadProgress.svelte +24 -0
- package/dist/admin/UploadProgress.svelte.d.ts +7 -0
- package/dist/admin/Users.svelte +106 -50
- package/dist/admin/client.d.ts +5 -670
- package/dist/admin/client.js +20 -1
- package/dist/admin/components/ui/alert/alert.svelte.d.ts +3 -13
- package/dist/admin/components/ui/attachment/attachment-media.svelte.d.ts +3 -13
- package/dist/admin/components/ui/attachment/attachment.svelte.d.ts +6 -26
- package/dist/admin/components/ui/badge/badge.svelte.d.ts +7 -25
- package/dist/admin/components/ui/button/button.svelte.d.ts +15 -53
- package/dist/admin/components/ui/calendar/calendar-caption.svelte +76 -0
- package/dist/admin/components/ui/calendar/calendar-caption.svelte.d.ts +19 -0
- package/dist/admin/components/ui/calendar/calendar-cell.svelte +19 -0
- package/dist/admin/components/ui/calendar/calendar-cell.svelte.d.ts +4 -0
- package/dist/admin/components/ui/calendar/calendar-day.svelte +33 -0
- package/dist/admin/components/ui/calendar/calendar-day.svelte.d.ts +4 -0
- package/dist/admin/components/ui/calendar/calendar-grid-body.svelte +12 -0
- package/dist/admin/components/ui/calendar/calendar-grid-body.svelte.d.ts +4 -0
- package/dist/admin/components/ui/calendar/calendar-grid-head.svelte +12 -0
- package/dist/admin/components/ui/calendar/calendar-grid-head.svelte.d.ts +4 -0
- package/dist/admin/components/ui/calendar/calendar-grid-row.svelte +12 -0
- package/dist/admin/components/ui/calendar/calendar-grid-row.svelte.d.ts +4 -0
- package/dist/admin/components/ui/calendar/calendar-grid.svelte +16 -0
- package/dist/admin/components/ui/calendar/calendar-grid.svelte.d.ts +4 -0
- package/dist/admin/components/ui/calendar/calendar-head-cell.svelte +19 -0
- package/dist/admin/components/ui/calendar/calendar-head-cell.svelte.d.ts +4 -0
- package/dist/admin/components/ui/calendar/calendar-header.svelte +19 -0
- package/dist/admin/components/ui/calendar/calendar-header.svelte.d.ts +4 -0
- package/dist/admin/components/ui/calendar/calendar-heading.svelte +16 -0
- package/dist/admin/components/ui/calendar/calendar-heading.svelte.d.ts +4 -0
- package/dist/admin/components/ui/calendar/calendar-month-select.svelte +48 -0
- package/dist/admin/components/ui/calendar/calendar-month-select.svelte.d.ts +4 -0
- package/dist/admin/components/ui/calendar/calendar-month.svelte +15 -0
- package/dist/admin/components/ui/calendar/calendar-month.svelte.d.ts +5 -0
- package/dist/admin/components/ui/calendar/calendar-months.svelte +19 -0
- package/dist/admin/components/ui/calendar/calendar-months.svelte.d.ts +5 -0
- package/dist/admin/components/ui/calendar/calendar-nav.svelte +19 -0
- package/dist/admin/components/ui/calendar/calendar-nav.svelte.d.ts +5 -0
- package/dist/admin/components/ui/calendar/calendar-next-button.svelte +37 -0
- package/dist/admin/components/ui/calendar/calendar-next-button.svelte.d.ts +8 -0
- package/dist/admin/components/ui/calendar/calendar-prev-button.svelte +37 -0
- package/dist/admin/components/ui/calendar/calendar-prev-button.svelte.d.ts +8 -0
- package/dist/admin/components/ui/calendar/calendar-year-select.svelte +47 -0
- package/dist/admin/components/ui/calendar/calendar-year-select.svelte.d.ts +4 -0
- package/dist/admin/components/ui/calendar/calendar.svelte +115 -0
- package/dist/admin/components/ui/calendar/calendar.svelte.d.ts +21 -0
- package/dist/admin/components/ui/calendar/index.d.ts +19 -0
- package/dist/admin/components/ui/calendar/index.js +21 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte +16 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte.d.ts +4 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +46 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +9 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-content.svelte +31 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +10 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +8 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-group.svelte +7 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-group.svelte.d.ts +4 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-item.svelte +27 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +8 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-label.svelte +24 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts +8 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-portal.svelte +7 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-portal.svelte.d.ts +3 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +16 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +4 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +36 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +4 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-separator.svelte +17 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +4 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +23 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +5 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +31 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +10 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +7 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-sub.svelte +7 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-sub.svelte.d.ts +3 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +7 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu-trigger.svelte.d.ts +4 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu.svelte +7 -0
- package/dist/admin/components/ui/dropdown-menu/dropdown-menu.svelte.d.ts +3 -0
- package/dist/admin/components/ui/dropdown-menu/index.d.ts +18 -0
- package/dist/admin/components/ui/dropdown-menu/index.js +18 -0
- package/dist/admin/components/ui/input-otp/index.d.ts +5 -0
- package/dist/admin/components/ui/input-otp/index.js +5 -0
- package/dist/admin/components/ui/input-otp/input-otp-group.svelte +23 -0
- package/dist/admin/components/ui/input-otp/input-otp-group.svelte.d.ts +5 -0
- package/dist/admin/components/ui/input-otp/input-otp-separator.svelte +27 -0
- package/dist/admin/components/ui/input-otp/input-otp-separator.svelte.d.ts +5 -0
- package/dist/admin/components/ui/input-otp/input-otp-slot.svelte +29 -0
- package/dist/admin/components/ui/input-otp/input-otp-slot.svelte.d.ts +4 -0
- package/dist/admin/components/ui/input-otp/input-otp.svelte +24 -0
- package/dist/admin/components/ui/input-otp/input-otp.svelte.d.ts +4 -0
- package/dist/admin/components/ui/popover/index.d.ts +9 -0
- package/dist/admin/components/ui/popover/index.js +11 -0
- package/dist/admin/components/ui/popover/popover-close.svelte +7 -0
- package/dist/admin/components/ui/popover/popover-close.svelte.d.ts +4 -0
- package/dist/admin/components/ui/popover/popover-content.svelte +31 -0
- package/dist/admin/components/ui/popover/popover-content.svelte.d.ts +10 -0
- package/dist/admin/components/ui/popover/popover-description.svelte +20 -0
- package/dist/admin/components/ui/popover/popover-description.svelte.d.ts +5 -0
- package/dist/admin/components/ui/popover/popover-header.svelte +20 -0
- package/dist/admin/components/ui/popover/popover-header.svelte.d.ts +5 -0
- package/dist/admin/components/ui/popover/popover-portal.svelte +7 -0
- package/dist/admin/components/ui/popover/popover-portal.svelte.d.ts +3 -0
- package/dist/admin/components/ui/popover/popover-title.svelte +20 -0
- package/dist/admin/components/ui/popover/popover-title.svelte.d.ts +5 -0
- package/dist/admin/components/ui/popover/popover-trigger.svelte +17 -0
- package/dist/admin/components/ui/popover/popover-trigger.svelte.d.ts +4 -0
- package/dist/admin/components/ui/popover/popover.svelte +7 -0
- package/dist/admin/components/ui/popover/popover.svelte.d.ts +3 -0
- package/dist/admin/components/ui/switch/switch.svelte +2 -2
- package/dist/admin/components/ui/toggle/toggle.svelte.d.ts +6 -26
- package/dist/admin/components/ui/tooltip/index.d.ts +6 -0
- package/dist/admin/components/ui/tooltip/index.js +8 -0
- package/dist/admin/components/ui/tooltip/tooltip-content.svelte +48 -0
- package/dist/admin/components/ui/tooltip/tooltip-content.svelte.d.ts +11 -0
- package/dist/admin/components/ui/tooltip/tooltip-portal.svelte +7 -0
- package/dist/admin/components/ui/tooltip/tooltip-portal.svelte.d.ts +4 -0
- package/dist/admin/components/ui/tooltip/tooltip-provider.svelte +7 -0
- package/dist/admin/components/ui/tooltip/tooltip-provider.svelte.d.ts +4 -0
- package/dist/admin/components/ui/tooltip/tooltip-trigger.svelte +7 -0
- package/dist/admin/components/ui/tooltip/tooltip-trigger.svelte.d.ts +25 -0
- package/dist/admin/components/ui/tooltip/tooltip.svelte +7 -0
- package/dist/admin/components/ui/tooltip/tooltip.svelte.d.ts +25 -0
- package/dist/admin/generated/admin.css +1298 -234
- package/dist/admin/slug.d.ts +1 -0
- package/dist/admin/slug.js +6 -0
- package/dist/admin/theme-context.d.ts +7 -0
- package/dist/admin/theme-context.js +3 -0
- package/dist/admin/theme.d.ts +7 -0
- package/dist/admin/theme.js +14 -0
- package/dist/admin/types.d.ts +2 -1
- package/dist/admin/uploads.d.ts +8 -1
- package/dist/admin/uploads.js +94 -16
- package/dist/blueprints/files.js +1 -0
- package/dist/blueprints/load.js +7 -2
- package/dist/blueprints/types.d.ts +4 -1
- package/dist/cli/doctor.d.ts +3 -1
- package/dist/cli/doctor.js +85 -30
- package/dist/cli/files.d.ts +2 -6
- package/dist/cli/files.js +11 -2
- package/dist/cli/index.js +99 -31
- package/dist/cli/scaffold.js +8 -8
- package/dist/cli/setup.js +16 -26
- package/dist/cli/upgrade.js +21 -2
- package/dist/env.d.ts +32 -0
- package/dist/env.js +53 -3
- package/dist/server/admin-load.d.ts +13 -5
- package/dist/server/admin-load.js +8 -3
- package/dist/server/api-access.d.ts +4 -0
- package/dist/server/api-access.js +15 -2
- package/dist/server/api-pagination.d.ts +3 -0
- package/dist/server/api.js +11 -3
- package/dist/server/auth.d.ts +11 -9
- package/dist/server/auth.js +23 -0
- package/dist/server/cms.d.ts +65 -18
- package/dist/server/cms.js +62 -6
- package/dist/server/db/migration-data.js +4 -0
- package/dist/server/db/migrations/0009_local_media.sql +9 -0
- package/dist/server/db/migrations/meta/0009_snapshot.json +1763 -0
- package/dist/server/db/migrations/meta/_journal.json +7 -0
- package/dist/server/db/schema.d.ts +119 -2
- package/dist/server/db/schema.js +15 -3
- package/dist/server/hooks.js +155 -81
- package/dist/server/media/contracts.d.ts +115 -0
- package/dist/server/media/contracts.js +12 -0
- package/dist/server/media/deletions.d.ts +2 -1
- package/dist/server/media/deletions.js +3 -3
- package/dist/server/media/delivery.js +7 -11
- package/dist/server/media/import-r2.d.ts +56 -0
- package/dist/server/media/import-r2.js +342 -0
- package/dist/server/media/processor-child.d.ts +2 -0
- package/dist/server/media/processor-child.js +236 -0
- package/dist/server/media/processor.d.ts +51 -0
- package/dist/server/media/processor.js +135 -0
- package/dist/server/media/render-math.d.ts +24 -0
- package/dist/server/media/render-math.js +50 -0
- package/dist/server/media/runner.d.ts +30 -1
- package/dist/server/media/runner.js +418 -165
- package/dist/server/media/service.d.ts +56 -10
- package/dist/server/media/service.js +309 -98
- package/dist/server/media/storage.d.ts +5 -0
- package/dist/server/media/storage.js +279 -0
- package/dist/server/media/svg.d.ts +5 -0
- package/dist/server/media/svg.js +142 -0
- package/dist/server/media/upload-ticket.d.ts +12 -0
- package/dist/server/media/upload-ticket.js +35 -0
- package/dist/server/media/verify.d.ts +36 -0
- package/dist/server/media/verify.js +109 -0
- package/dist/server/platform/http.d.ts +27 -0
- package/dist/server/platform/http.js +77 -0
- package/dist/server/platform/index.d.ts +52 -0
- package/dist/server/platform/index.js +98 -0
- package/dist/server/platform/snapshots.d.ts +18 -0
- package/dist/server/platform/snapshots.js +110 -0
- package/dist/server/platform/volume.d.ts +20 -0
- package/dist/server/platform/volume.js +60 -0
- package/dist/worker/svg.d.ts +1 -5
- package/dist/worker/svg.js +2 -142
- package/docs/acceptance.md +6 -4
- package/docs/api.md +42 -4
- package/docs/cloudflare.md +48 -142
- package/docs/content.md +2 -2
- package/docs/deployment.md +159 -57
- package/docs/forms.md +1 -1
- package/docs/media.md +85 -21
- package/docs/package.md +21 -18
- package/docs/plans/0.7-self-hosted.md +264 -0
- package/docs/releases.md +27 -1
- package/docs/upgrades.md +44 -6
- package/package.json +38 -37
- package/templates/Dockerfile +28 -0
- package/templates/integration.ts +18 -2
- package/templates/railpack.json +1 -1
- package/templates/sandcms/blueprints/files/image.yaml +1 -1
- package/templates/sandcms/config.yaml +0 -1
- package/dist/cli/cloudflare.d.ts +0 -8
- package/dist/cli/cloudflare.js +0 -135
- package/templates/sandcms/worker/index.ts +0 -1
- package/templates/sandcms/worker/local.ts +0 -1
- package/templates/sandcms/worker/wrangler.jsonc +0 -6
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type WithElementRef, cn } 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<HTMLElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div {...restProps} bind:this={ref} class={cn('flex w-full flex-col gap-4', className)}>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
declare const CalendarMonth: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
|
|
4
|
+
type CalendarMonth = ReturnType<typeof CalendarMonth>;
|
|
5
|
+
export default CalendarMonth;
|
|
@@ -0,0 +1,19 @@
|
|
|
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<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
class={cn('relative flex flex-col gap-4 md:flex-row', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
declare const CalendarMonths: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type CalendarMonths = ReturnType<typeof CalendarMonths>;
|
|
5
|
+
export default CalendarMonths;
|
|
@@ -0,0 +1,19 @@
|
|
|
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<HTMLElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<nav
|
|
14
|
+
{...restProps}
|
|
15
|
+
bind:this={ref}
|
|
16
|
+
class={cn('absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1', className)}
|
|
17
|
+
>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
</nav>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
declare const CalendarNav: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
|
|
4
|
+
type CalendarNav = ReturnType<typeof CalendarNav>;
|
|
5
|
+
export default CalendarNav;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Calendar as CalendarPrimitive } from 'bits-ui';
|
|
3
|
+
import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';
|
|
4
|
+
import { buttonVariants, type ButtonVariant } from '../button/index.js';
|
|
5
|
+
import { cn } from '../../../utils.js';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
children,
|
|
11
|
+
variant = 'ghost',
|
|
12
|
+
...restProps
|
|
13
|
+
}: CalendarPrimitive.NextButtonProps & {
|
|
14
|
+
variant?: ButtonVariant;
|
|
15
|
+
} = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
{#snippet Fallback()}
|
|
19
|
+
<ChevronRightIcon class={cn('cn-rtl-flip size-4', className)} />
|
|
20
|
+
{/snippet}
|
|
21
|
+
|
|
22
|
+
<CalendarPrimitive.NextButton
|
|
23
|
+
bind:ref
|
|
24
|
+
class={cn(
|
|
25
|
+
buttonVariants({ variant }),
|
|
26
|
+
'size-(--cell-size) bg-transparent p-0 select-none disabled:opacity-50',
|
|
27
|
+
'rtl:rotate-180',
|
|
28
|
+
className
|
|
29
|
+
)}
|
|
30
|
+
{...restProps}
|
|
31
|
+
>
|
|
32
|
+
{#if children}
|
|
33
|
+
{@render children?.()}
|
|
34
|
+
{:else}
|
|
35
|
+
{@render Fallback()}
|
|
36
|
+
{/if}
|
|
37
|
+
</CalendarPrimitive.NextButton>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Calendar as CalendarPrimitive } from 'bits-ui';
|
|
2
|
+
import { type ButtonVariant } from '../button/index.js';
|
|
3
|
+
type $$ComponentProps = CalendarPrimitive.NextButtonProps & {
|
|
4
|
+
variant?: ButtonVariant;
|
|
5
|
+
};
|
|
6
|
+
declare const CalendarNextButton: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
|
+
type CalendarNextButton = ReturnType<typeof CalendarNextButton>;
|
|
8
|
+
export default CalendarNextButton;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Calendar as CalendarPrimitive } from 'bits-ui';
|
|
3
|
+
import ChevronLeftIcon from '@lucide/svelte/icons/chevron-left';
|
|
4
|
+
import { buttonVariants, type ButtonVariant } from '../button/index.js';
|
|
5
|
+
import { cn } from '../../../utils.js';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
children,
|
|
11
|
+
variant = 'ghost',
|
|
12
|
+
...restProps
|
|
13
|
+
}: CalendarPrimitive.PrevButtonProps & {
|
|
14
|
+
variant?: ButtonVariant;
|
|
15
|
+
} = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
{#snippet Fallback()}
|
|
19
|
+
<ChevronLeftIcon class={cn('cn-rtl-flip size-4', className)} />
|
|
20
|
+
{/snippet}
|
|
21
|
+
|
|
22
|
+
<CalendarPrimitive.PrevButton
|
|
23
|
+
bind:ref
|
|
24
|
+
class={cn(
|
|
25
|
+
buttonVariants({ variant }),
|
|
26
|
+
'size-(--cell-size) bg-transparent p-0 select-none disabled:opacity-50',
|
|
27
|
+
'rtl:rotate-180',
|
|
28
|
+
className
|
|
29
|
+
)}
|
|
30
|
+
{...restProps}
|
|
31
|
+
>
|
|
32
|
+
{#if children}
|
|
33
|
+
{@render children?.()}
|
|
34
|
+
{:else}
|
|
35
|
+
{@render Fallback()}
|
|
36
|
+
{/if}
|
|
37
|
+
</CalendarPrimitive.PrevButton>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Calendar as CalendarPrimitive } from 'bits-ui';
|
|
2
|
+
import { type ButtonVariant } from '../button/index.js';
|
|
3
|
+
type $$ComponentProps = CalendarPrimitive.PrevButtonProps & {
|
|
4
|
+
variant?: ButtonVariant;
|
|
5
|
+
};
|
|
6
|
+
declare const CalendarPrevButton: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
|
+
type CalendarPrevButton = ReturnType<typeof CalendarPrevButton>;
|
|
8
|
+
export default CalendarPrevButton;
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
...restProps
|
|
11
|
+
}: WithoutChildrenOrChild<CalendarPrimitive.YearSelectProps> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<span
|
|
15
|
+
class={cn(
|
|
16
|
+
'relative flex rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
>
|
|
20
|
+
<CalendarPrimitive.YearSelect
|
|
21
|
+
bind:ref
|
|
22
|
+
class="absolute inset-0 opacity-0 dark:bg-popover dark:text-popover-foreground"
|
|
23
|
+
{...restProps}
|
|
24
|
+
>
|
|
25
|
+
{#snippet child({ props, yearItems, selectedYearItem })}
|
|
26
|
+
<select {...props} {value}>
|
|
27
|
+
{#each yearItems as yearItem (yearItem.value)}
|
|
28
|
+
<option
|
|
29
|
+
value={yearItem.value}
|
|
30
|
+
selected={value !== undefined
|
|
31
|
+
? yearItem.value === value
|
|
32
|
+
: yearItem.value === selectedYearItem.value}
|
|
33
|
+
>
|
|
34
|
+
{yearItem.label}
|
|
35
|
+
</option>
|
|
36
|
+
{/each}
|
|
37
|
+
</select>
|
|
38
|
+
<span
|
|
39
|
+
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"
|
|
40
|
+
aria-hidden="true"
|
|
41
|
+
>
|
|
42
|
+
{yearItems.find((item) => item.value === value)?.label || selectedYearItem.label}
|
|
43
|
+
<ChevronDownIcon class={cn('size-4', className)} />
|
|
44
|
+
</span>
|
|
45
|
+
{/snippet}
|
|
46
|
+
</CalendarPrimitive.YearSelect>
|
|
47
|
+
</span>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Calendar as CalendarPrimitive } from 'bits-ui';
|
|
2
|
+
declare const CalendarYearSelect: import("svelte").Component<Omit<Omit<CalendarPrimitive.YearSelectProps, "child">, "children">, {}, "ref">;
|
|
3
|
+
type CalendarYearSelect = ReturnType<typeof CalendarYearSelect>;
|
|
4
|
+
export default CalendarYearSelect;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { isEqualMonth, type DateValue } from '@internationalized/date';
|
|
3
|
+
import { Calendar as CalendarPrimitive } from 'bits-ui';
|
|
4
|
+
import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
|
|
5
|
+
import * as Calendar from './index.js';
|
|
6
|
+
import type { ButtonVariant } from '../button/button.svelte';
|
|
7
|
+
import type { Snippet } from 'svelte';
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
ref = $bindable(null),
|
|
11
|
+
value = $bindable(),
|
|
12
|
+
placeholder = $bindable(),
|
|
13
|
+
class: className,
|
|
14
|
+
weekdayFormat = 'short',
|
|
15
|
+
buttonVariant = 'ghost',
|
|
16
|
+
captionLayout = 'label',
|
|
17
|
+
locale = 'en-US',
|
|
18
|
+
months: monthsProp,
|
|
19
|
+
years,
|
|
20
|
+
monthFormat: monthFormatProp,
|
|
21
|
+
yearFormat = 'numeric',
|
|
22
|
+
day,
|
|
23
|
+
disableDaysOutsideMonth = false,
|
|
24
|
+
...restProps
|
|
25
|
+
}: WithoutChildrenOrChild<CalendarPrimitive.RootProps> & {
|
|
26
|
+
buttonVariant?: ButtonVariant;
|
|
27
|
+
captionLayout?: 'dropdown' | 'dropdown-months' | 'dropdown-years' | 'label';
|
|
28
|
+
months?: CalendarPrimitive.MonthSelectProps['months'];
|
|
29
|
+
years?: CalendarPrimitive.YearSelectProps['years'];
|
|
30
|
+
monthFormat?: CalendarPrimitive.MonthSelectProps['monthFormat'];
|
|
31
|
+
yearFormat?: CalendarPrimitive.YearSelectProps['yearFormat'];
|
|
32
|
+
day?: Snippet<[{ day: DateValue; outsideMonth: boolean }]>;
|
|
33
|
+
} = $props();
|
|
34
|
+
|
|
35
|
+
const monthFormat = $derived.by(() => {
|
|
36
|
+
if (monthFormatProp) return monthFormatProp;
|
|
37
|
+
if (captionLayout.startsWith('dropdown')) return 'short';
|
|
38
|
+
return 'long';
|
|
39
|
+
});
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<!--
|
|
43
|
+
Discriminated Unions + Destructing (required for bindable) do not
|
|
44
|
+
get along, so we shut typescript up by casting `value` to `never`.
|
|
45
|
+
-->
|
|
46
|
+
<CalendarPrimitive.Root
|
|
47
|
+
bind:value={value as never}
|
|
48
|
+
bind:ref
|
|
49
|
+
bind:placeholder
|
|
50
|
+
{weekdayFormat}
|
|
51
|
+
{disableDaysOutsideMonth}
|
|
52
|
+
class={cn(
|
|
53
|
+
'p-2 [--cell-size:--spacing(7)] group/calendar bg-background in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent',
|
|
54
|
+
className
|
|
55
|
+
)}
|
|
56
|
+
{locale}
|
|
57
|
+
{monthFormat}
|
|
58
|
+
{yearFormat}
|
|
59
|
+
{...restProps}
|
|
60
|
+
>
|
|
61
|
+
{#snippet children({ months, weekdays })}
|
|
62
|
+
<Calendar.Months>
|
|
63
|
+
<Calendar.Nav>
|
|
64
|
+
<Calendar.PrevButton variant={buttonVariant} />
|
|
65
|
+
<Calendar.NextButton variant={buttonVariant} />
|
|
66
|
+
</Calendar.Nav>
|
|
67
|
+
{#each months as month, monthIndex (month)}
|
|
68
|
+
<Calendar.Month>
|
|
69
|
+
<Calendar.Header>
|
|
70
|
+
<Calendar.Caption
|
|
71
|
+
{captionLayout}
|
|
72
|
+
months={monthsProp}
|
|
73
|
+
{monthFormat}
|
|
74
|
+
{years}
|
|
75
|
+
{yearFormat}
|
|
76
|
+
month={month.value}
|
|
77
|
+
bind:placeholder
|
|
78
|
+
{locale}
|
|
79
|
+
{monthIndex}
|
|
80
|
+
/>
|
|
81
|
+
</Calendar.Header>
|
|
82
|
+
<Calendar.Grid>
|
|
83
|
+
<Calendar.GridHead>
|
|
84
|
+
<Calendar.GridRow class="select-none">
|
|
85
|
+
{#each weekdays as weekday, i (i)}
|
|
86
|
+
<Calendar.HeadCell>
|
|
87
|
+
{weekday.slice(0, 2)}
|
|
88
|
+
</Calendar.HeadCell>
|
|
89
|
+
{/each}
|
|
90
|
+
</Calendar.GridRow>
|
|
91
|
+
</Calendar.GridHead>
|
|
92
|
+
<Calendar.GridBody>
|
|
93
|
+
{#each month.weeks as weekDates (weekDates)}
|
|
94
|
+
<Calendar.GridRow class="mt-2 w-full">
|
|
95
|
+
{#each weekDates as date (date)}
|
|
96
|
+
<Calendar.Cell {date} month={month.value}>
|
|
97
|
+
{#if day}
|
|
98
|
+
{@render day({
|
|
99
|
+
day: date,
|
|
100
|
+
outsideMonth: !isEqualMonth(date, month.value)
|
|
101
|
+
})}
|
|
102
|
+
{:else}
|
|
103
|
+
<Calendar.Day />
|
|
104
|
+
{/if}
|
|
105
|
+
</Calendar.Cell>
|
|
106
|
+
{/each}
|
|
107
|
+
</Calendar.GridRow>
|
|
108
|
+
{/each}
|
|
109
|
+
</Calendar.GridBody>
|
|
110
|
+
</Calendar.Grid>
|
|
111
|
+
</Calendar.Month>
|
|
112
|
+
{/each}
|
|
113
|
+
</Calendar.Months>
|
|
114
|
+
{/snippet}
|
|
115
|
+
</CalendarPrimitive.Root>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type DateValue } from '@internationalized/date';
|
|
2
|
+
import { Calendar as CalendarPrimitive } from 'bits-ui';
|
|
3
|
+
import { type WithoutChildrenOrChild } from '../../../utils.js';
|
|
4
|
+
import * as Calendar from './index.js';
|
|
5
|
+
import type { ButtonVariant } from '../button/button.svelte';
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
type $$ComponentProps = WithoutChildrenOrChild<CalendarPrimitive.RootProps> & {
|
|
8
|
+
buttonVariant?: ButtonVariant;
|
|
9
|
+
captionLayout?: 'dropdown' | 'dropdown-months' | 'dropdown-years' | 'label';
|
|
10
|
+
months?: CalendarPrimitive.MonthSelectProps['months'];
|
|
11
|
+
years?: CalendarPrimitive.YearSelectProps['years'];
|
|
12
|
+
monthFormat?: CalendarPrimitive.MonthSelectProps['monthFormat'];
|
|
13
|
+
yearFormat?: CalendarPrimitive.YearSelectProps['yearFormat'];
|
|
14
|
+
day?: Snippet<[{
|
|
15
|
+
day: DateValue;
|
|
16
|
+
outsideMonth: boolean;
|
|
17
|
+
}]>;
|
|
18
|
+
};
|
|
19
|
+
declare const Calendar: import("svelte").Component<$$ComponentProps, {}, "ref" | "value" | "placeholder">;
|
|
20
|
+
type Calendar = ReturnType<typeof Calendar>;
|
|
21
|
+
export default Calendar;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Caption from './calendar-caption.svelte';
|
|
2
|
+
import Cell from './calendar-cell.svelte';
|
|
3
|
+
import Day from './calendar-day.svelte';
|
|
4
|
+
import GridBody from './calendar-grid-body.svelte';
|
|
5
|
+
import GridHead from './calendar-grid-head.svelte';
|
|
6
|
+
import GridRow from './calendar-grid-row.svelte';
|
|
7
|
+
import Grid from './calendar-grid.svelte';
|
|
8
|
+
import HeadCell from './calendar-head-cell.svelte';
|
|
9
|
+
import Header from './calendar-header.svelte';
|
|
10
|
+
import Heading from './calendar-heading.svelte';
|
|
11
|
+
import MonthSelect from './calendar-month-select.svelte';
|
|
12
|
+
import Month from './calendar-month.svelte';
|
|
13
|
+
import Months from './calendar-months.svelte';
|
|
14
|
+
import Nav from './calendar-nav.svelte';
|
|
15
|
+
import NextButton from './calendar-next-button.svelte';
|
|
16
|
+
import PrevButton from './calendar-prev-button.svelte';
|
|
17
|
+
import YearSelect from './calendar-year-select.svelte';
|
|
18
|
+
import Root from './calendar.svelte';
|
|
19
|
+
export { Day, Cell, Grid, Header, Months, GridRow, Heading, GridBody, GridHead, HeadCell, NextButton, PrevButton, Nav, Month, YearSelect, MonthSelect, Caption, Root as Calendar };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Caption from './calendar-caption.svelte';
|
|
2
|
+
import Cell from './calendar-cell.svelte';
|
|
3
|
+
import Day from './calendar-day.svelte';
|
|
4
|
+
import GridBody from './calendar-grid-body.svelte';
|
|
5
|
+
import GridHead from './calendar-grid-head.svelte';
|
|
6
|
+
import GridRow from './calendar-grid-row.svelte';
|
|
7
|
+
import Grid from './calendar-grid.svelte';
|
|
8
|
+
import HeadCell from './calendar-head-cell.svelte';
|
|
9
|
+
import Header from './calendar-header.svelte';
|
|
10
|
+
import Heading from './calendar-heading.svelte';
|
|
11
|
+
import MonthSelect from './calendar-month-select.svelte';
|
|
12
|
+
import Month from './calendar-month.svelte';
|
|
13
|
+
import Months from './calendar-months.svelte';
|
|
14
|
+
import Nav from './calendar-nav.svelte';
|
|
15
|
+
import NextButton from './calendar-next-button.svelte';
|
|
16
|
+
import PrevButton from './calendar-prev-button.svelte';
|
|
17
|
+
import YearSelect from './calendar-year-select.svelte';
|
|
18
|
+
import Root from './calendar.svelte';
|
|
19
|
+
export { Day, Cell, Grid, Header, Months, GridRow, Heading, GridBody, GridHead, HeadCell, NextButton, PrevButton, Nav, Month, YearSelect, MonthSelect, Caption,
|
|
20
|
+
//
|
|
21
|
+
Root as Calendar };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
value = $bindable([]),
|
|
7
|
+
...restProps
|
|
8
|
+
}: DropdownMenuPrimitive.CheckboxGroupProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<DropdownMenuPrimitive.CheckboxGroup
|
|
12
|
+
bind:ref
|
|
13
|
+
bind:value
|
|
14
|
+
data-slot="dropdown-menu-checkbox-group"
|
|
15
|
+
{...restProps}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
declare const DropdownMenuCheckboxGroup: import("svelte").Component<DropdownMenuPrimitive.CheckboxGroupProps, {}, "ref" | "value">;
|
|
3
|
+
type DropdownMenuCheckboxGroup = ReturnType<typeof DropdownMenuCheckboxGroup>;
|
|
4
|
+
export default DropdownMenuCheckboxGroup;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import MinusIcon from '@lucide/svelte/icons/minus';
|
|
4
|
+
import CheckIcon from '@lucide/svelte/icons/check';
|
|
5
|
+
import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
checked = $bindable(false),
|
|
11
|
+
indeterminate = $bindable(false),
|
|
12
|
+
class: className,
|
|
13
|
+
children: childrenProp,
|
|
14
|
+
closeOnSelect = false,
|
|
15
|
+
...restProps
|
|
16
|
+
}: WithoutChildrenOrChild<DropdownMenuPrimitive.CheckboxItemProps> & {
|
|
17
|
+
children?: Snippet;
|
|
18
|
+
} = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
22
|
+
bind:ref
|
|
23
|
+
{closeOnSelect}
|
|
24
|
+
bind:checked
|
|
25
|
+
bind:indeterminate
|
|
26
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
27
|
+
class={cn(
|
|
28
|
+
"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-none py-2 pr-8 pl-2 text-xs data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
29
|
+
className
|
|
30
|
+
)}
|
|
31
|
+
{...restProps}
|
|
32
|
+
>
|
|
33
|
+
{#snippet children({ checked, indeterminate })}
|
|
34
|
+
<span
|
|
35
|
+
class="absolute right-2 flex items-center justify-center pointer-events-none"
|
|
36
|
+
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
37
|
+
>
|
|
38
|
+
{#if indeterminate}
|
|
39
|
+
<MinusIcon />
|
|
40
|
+
{:else if checked}
|
|
41
|
+
<CheckIcon />
|
|
42
|
+
{/if}
|
|
43
|
+
</span>
|
|
44
|
+
{@render childrenProp?.()}
|
|
45
|
+
{/snippet}
|
|
46
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
import { type WithoutChildrenOrChild } from '../../../utils.js';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
type $$ComponentProps = WithoutChildrenOrChild<DropdownMenuPrimitive.CheckboxItemProps> & {
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
};
|
|
7
|
+
declare const DropdownMenuCheckboxItem: import("svelte").Component<$$ComponentProps, {}, "ref" | "checked" | "indeterminate">;
|
|
8
|
+
type DropdownMenuCheckboxItem = ReturnType<typeof DropdownMenuCheckboxItem>;
|
|
9
|
+
export default DropdownMenuCheckboxItem;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
|
|
4
|
+
import DropdownMenuPortal from './dropdown-menu-portal.svelte';
|
|
5
|
+
import type { ComponentProps } from 'svelte';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
sideOffset = 4,
|
|
10
|
+
align = 'start',
|
|
11
|
+
portalProps,
|
|
12
|
+
class: className,
|
|
13
|
+
...restProps
|
|
14
|
+
}: DropdownMenuPrimitive.ContentProps & {
|
|
15
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof DropdownMenuPortal>>;
|
|
16
|
+
} = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<DropdownMenuPortal {...portalProps}>
|
|
20
|
+
<DropdownMenuPrimitive.Content
|
|
21
|
+
bind:ref
|
|
22
|
+
data-slot="dropdown-menu-content"
|
|
23
|
+
{sideOffset}
|
|
24
|
+
{align}
|
|
25
|
+
class={cn(
|
|
26
|
+
'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-none shadow-md ring-1 duration-100 z-50 max-h-(--bits-dropdown-menu-content-available-height) w-(--bits-dropdown-menu-anchor-width) origin-(--bits-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-closed:overflow-hidden',
|
|
27
|
+
className
|
|
28
|
+
)}
|
|
29
|
+
{...restProps}
|
|
30
|
+
/>
|
|
31
|
+
</DropdownMenuPortal>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
import { type WithoutChildrenOrChild } from '../../../utils.js';
|
|
3
|
+
import DropdownMenuPortal from './dropdown-menu-portal.svelte';
|
|
4
|
+
import type { ComponentProps } from 'svelte';
|
|
5
|
+
type $$ComponentProps = DropdownMenuPrimitive.ContentProps & {
|
|
6
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof DropdownMenuPortal>>;
|
|
7
|
+
};
|
|
8
|
+
declare const DropdownMenuContent: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
9
|
+
type DropdownMenuContent = ReturnType<typeof DropdownMenuContent>;
|
|
10
|
+
export default DropdownMenuContent;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
import type { ComponentProps } from 'svelte';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
inset,
|
|
10
|
+
...restProps
|
|
11
|
+
}: ComponentProps<typeof DropdownMenuPrimitive.GroupHeading> & {
|
|
12
|
+
inset?: boolean;
|
|
13
|
+
} = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<DropdownMenuPrimitive.GroupHeading
|
|
17
|
+
bind:ref
|
|
18
|
+
data-slot="dropdown-menu-group-heading"
|
|
19
|
+
data-inset={inset}
|
|
20
|
+
class={cn('text-muted-foreground px-2 py-2 text-xs data-inset:pl-7', className)}
|
|
21
|
+
{...restProps}
|
|
22
|
+
/>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
type $$ComponentProps = ComponentProps<typeof DropdownMenuPrimitive.GroupHeading> & {
|
|
4
|
+
inset?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const DropdownMenuGroupHeading: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
|
+
type DropdownMenuGroupHeading = ReturnType<typeof DropdownMenuGroupHeading>;
|
|
8
|
+
export default DropdownMenuGroupHeading;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
|
|
4
|
+
let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.GroupProps = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<DropdownMenuPrimitive.Group bind:ref data-slot="dropdown-menu-group" {...restProps} />
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
inset,
|
|
9
|
+
variant = 'default',
|
|
10
|
+
...restProps
|
|
11
|
+
}: DropdownMenuPrimitive.ItemProps & {
|
|
12
|
+
inset?: boolean;
|
|
13
|
+
variant?: 'default' | 'destructive';
|
|
14
|
+
} = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<DropdownMenuPrimitive.Item
|
|
18
|
+
bind:ref
|
|
19
|
+
data-slot="dropdown-menu-item"
|
|
20
|
+
data-inset={inset}
|
|
21
|
+
data-variant={variant}
|
|
22
|
+
class={cn(
|
|
23
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-none px-2 py-2 text-xs data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...restProps}
|
|
27
|
+
/>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
type $$ComponentProps = DropdownMenuPrimitive.ItemProps & {
|
|
3
|
+
inset?: boolean;
|
|
4
|
+
variant?: 'default' | 'destructive';
|
|
5
|
+
};
|
|
6
|
+
declare const DropdownMenuItem: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
|
+
type DropdownMenuItem = ReturnType<typeof DropdownMenuItem>;
|
|
8
|
+
export default DropdownMenuItem;
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
inset,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
12
|
+
inset?: boolean;
|
|
13
|
+
} = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<div
|
|
17
|
+
bind:this={ref}
|
|
18
|
+
data-slot="dropdown-menu-label"
|
|
19
|
+
data-inset={inset}
|
|
20
|
+
class={cn('text-muted-foreground px-2 py-2 text-xs data-inset:pl-7', className)}
|
|
21
|
+
{...restProps}
|
|
22
|
+
>
|
|
23
|
+
{@render children?.()}
|
|
24
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
4
|
+
inset?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const DropdownMenuLabel: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
|
+
type DropdownMenuLabel = ReturnType<typeof DropdownMenuLabel>;
|
|
8
|
+
export default DropdownMenuLabel;
|