sandcms 0.6.3 → 0.8.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 +15 -11
- package/dist/admin/Account.svelte +2 -0
- package/dist/admin/Admin.svelte +21 -6
- package/dist/admin/AssetAttachment.svelte +9 -6
- package/dist/admin/AssetAttachment.svelte.d.ts +3 -1
- package/dist/admin/BlueprintFields.svelte +0 -3
- package/dist/admin/BlueprintFields.svelte.d.ts +0 -1
- package/dist/admin/Editor.svelte +5 -10
- package/dist/admin/Fields.svelte +2 -8
- package/dist/admin/Fields.svelte.d.ts +0 -1
- package/dist/admin/Gallery.svelte +221 -80
- package/dist/admin/Gallery.svelte.d.ts +0 -1
- package/dist/admin/Inbox.svelte +3 -2
- package/dist/admin/LinkField.svelte +0 -3
- package/dist/admin/LinkField.svelte.d.ts +0 -1
- package/dist/admin/MediaLibrary.svelte +10 -7
- package/dist/admin/MediaPicker.svelte +43 -35
- package/dist/admin/MediaPicker.svelte.d.ts +0 -1
- package/dist/admin/Navigation.svelte +13 -2
- package/dist/admin/Pages.svelte +195 -0
- package/dist/admin/Pages.svelte.d.ts +7 -0
- package/dist/admin/Shell.svelte +27 -5
- package/dist/admin/SortableList.svelte +82 -61
- package/dist/admin/SortableList.svelte.d.ts +3 -1
- 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 +8 -3
- package/dist/admin/client.d.ts +3 -670
- package/dist/admin/client.js +2 -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/toggle/toggle.svelte.d.ts +6 -26
- package/dist/admin/generated/admin.css +823 -115
- package/dist/admin/navigation.d.ts +9 -0
- package/dist/admin/navigation.js +20 -1
- 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 +3 -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/labels.d.ts +6 -0
- package/dist/blueprints/labels.js +14 -0
- package/dist/blueprints/load.js +16 -2
- package/dist/blueprints/types.d.ts +4 -1
- package/dist/cli/admin.d.ts +39 -0
- package/dist/cli/admin.js +95 -0
- package/dist/cli/backup.js +4 -4
- package/dist/cli/doctor.d.ts +10 -1
- package/dist/cli/doctor.js +98 -33
- package/dist/cli/email-test.d.ts +3 -0
- package/dist/cli/email-test.js +20 -0
- package/dist/cli/files.d.ts +2 -6
- package/dist/cli/files.js +12 -2
- package/dist/cli/index.js +401 -95
- package/dist/cli/rebaseline.d.ts +10 -0
- package/dist/cli/rebaseline.js +117 -0
- package/dist/cli/scaffold.js +8 -8
- package/dist/cli/setup.js +16 -26
- package/dist/cli/upgrade.js +34 -7
- package/dist/env.d.ts +26 -2
- package/dist/env.js +48 -6
- package/dist/notification-fields.js +2 -1
- package/dist/server/admin-load.d.ts +85 -5
- package/dist/server/admin-load.js +26 -1
- package/dist/server/api-access.d.ts +4 -0
- package/dist/server/api-access.js +15 -2
- package/dist/server/api-keys.d.ts +96 -0
- package/dist/server/api-keys.js +115 -0
- package/dist/server/api-pagination.d.ts +3 -0
- package/dist/server/api.js +21 -63
- package/dist/server/auth.d.ts +10 -9
- package/dist/server/cms.d.ts +63 -21
- package/dist/server/cms.js +64 -7
- package/dist/server/db/auto-migrate.d.ts +0 -4
- package/dist/server/db/auto-migrate.js +12 -3
- package/dist/server/db/legacy.d.ts +13 -0
- package/dist/server/db/legacy.js +60 -0
- package/dist/server/db/migration-data.js +2 -34
- package/dist/server/db/migrations/{0000_foundation.sql → 0000_baseline.sql} +120 -4
- package/dist/server/db/migrations/meta/0000_snapshot.json +578 -3
- package/dist/server/db/migrations/meta/_journal.json +2 -58
- package/dist/server/db/schema.d.ts +119 -2
- package/dist/server/db/schema.js +23 -9
- package/dist/server/db/store.d.ts +25 -2
- package/dist/server/db/store.js +90 -26
- package/dist/server/forms.js +2 -1
- 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/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 +53 -11
- package/dist/server/media/service.js +307 -98
- package/dist/server/media/storage.d.ts +5 -0
- package/dist/server/media/storage.js +279 -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 +64 -0
- package/dist/server/media/verify.js +201 -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/docs/acceptance.md +7 -5
- package/docs/api.md +56 -4
- package/docs/cloudflare.md +26 -152
- package/docs/content.md +20 -5
- package/docs/deployment.md +222 -57
- package/docs/email.md +6 -0
- package/docs/forms.md +2 -2
- package/docs/media.md +94 -21
- package/docs/package.md +21 -18
- package/docs/plans/0.7-self-hosted.md +264 -0
- package/docs/releases.md +37 -1
- package/docs/upgrades.md +72 -9
- package/package.json +37 -44
- package/templates/Dockerfile +32 -0
- package/templates/integration.ts +26 -5
- package/templates/openship.json +9 -0
- package/templates/railpack.json +1 -1
- package/templates/sandcms/blueprints/files/image.yaml +1 -1
- package/templates/sandcms/config.yaml +1 -1
- package/dist/cli/cloudflare.d.ts +0 -8
- package/dist/cli/cloudflare.js +0 -135
- package/dist/server/db/migrations/0001_independent_password_resets.sql +0 -3
- package/dist/server/db/migrations/0002_email_failure_reason.sql +0 -1
- package/dist/server/db/migrations/0003_direct_r2_uploads.sql +0 -10
- package/dist/server/db/migrations/0004_agent_api_keys.sql +0 -38
- package/dist/server/db/migrations/0005_api_retention_and_pagination.sql +0 -3
- package/dist/server/db/migrations/0006_durable_media_deletion.sql +0 -7
- package/dist/server/db/migrations/0007_content_and_job_indexes.sql +0 -2
- package/dist/server/db/migrations/0008_search_text_cache.sql +0 -45
- package/dist/server/db/migrations/meta/0001_snapshot.json +0 -1197
- package/dist/server/db/migrations/meta/0002_snapshot.json +0 -1204
- package/dist/server/db/migrations/meta/0003_snapshot.json +0 -1281
- package/dist/server/db/migrations/meta/0004_snapshot.json +0 -1546
- package/dist/server/db/migrations/meta/0005_snapshot.json +0 -1572
- package/dist/server/db/migrations/meta/0006_snapshot.json +0 -1627
- package/dist/server/db/migrations/meta/0007_snapshot.json +0 -1643
- package/dist/server/db/migrations/meta/0008_snapshot.json +0 -1711
- package/dist/worker/index.d.ts +0 -10
- package/dist/worker/index.js +0 -460
- package/dist/worker/local.d.ts +0 -5
- package/dist/worker/local.js +0 -57
- package/dist/worker/source.d.ts +0 -2
- package/dist/worker/source.js +0 -31
- package/dist/worker/uploads.d.ts +0 -22
- package/dist/worker/uploads.js +0 -48
- package/templates/sandcms/worker/index.ts +0 -1
- package/templates/sandcms/worker/local.ts +0 -1
- package/templates/sandcms/worker/wrangler.jsonc +0 -6
- /package/dist/{worker → server/media}/svg.d.ts +0 -0
- /package/dist/{worker → server/media}/svg.js +0 -0
package/dist/admin/client.js
CHANGED
|
@@ -41,8 +41,9 @@ export async function copyText(value) {
|
|
|
41
41
|
area.remove();
|
|
42
42
|
}
|
|
43
43
|
export const message = (e) => e instanceof Error ? e.message : 'Something went wrong. Please try again.';
|
|
44
|
-
export function assetUrl(asset
|
|
44
|
+
export function assetUrl(asset) {
|
|
45
45
|
const preview = asset.variants.find((v) => v.preset === 'sandcms-preview') ?? asset.variants[0];
|
|
46
46
|
return preview ? '/api/cms/media/' + preview.key : '';
|
|
47
47
|
}
|
|
48
|
+
export const megabytes = (bytes) => (bytes / 1_000_000).toLocaleString('en', { maximumFractionDigits: 1 });
|
|
48
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:
|
|
5
|
-
destructive:
|
|
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:
|
|
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:
|
|
5
|
-
sm:
|
|
6
|
-
xs:
|
|
4
|
+
default: string;
|
|
5
|
+
sm: string;
|
|
6
|
+
xs: string;
|
|
7
7
|
};
|
|
8
8
|
orientation: {
|
|
9
|
-
horizontal:
|
|
10
|
-
vertical:
|
|
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:
|
|
5
|
-
secondary:
|
|
6
|
-
destructive:
|
|
7
|
-
outline:
|
|
8
|
-
ghost:
|
|
9
|
-
link:
|
|
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:
|
|
7
|
-
outline:
|
|
8
|
-
secondary:
|
|
9
|
-
ghost:
|
|
10
|
-
destructive:
|
|
11
|
-
link:
|
|
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:
|
|
15
|
-
xs:
|
|
16
|
-
sm:
|
|
17
|
-
lg:
|
|
18
|
-
icon:
|
|
19
|
-
'icon-xs':
|
|
20
|
-
'icon-sm':
|
|
21
|
-
'icon-lg':
|
|
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> & {
|
|
@@ -1,35 +1,15 @@
|
|
|
1
1
|
import { type VariantProps } from 'tailwind-variants';
|
|
2
2
|
export declare const toggleVariants: import("tailwind-variants").TVReturnType<{
|
|
3
3
|
variant: {
|
|
4
|
-
default:
|
|
5
|
-
outline:
|
|
4
|
+
default: string;
|
|
5
|
+
outline: string;
|
|
6
6
|
};
|
|
7
7
|
size: {
|
|
8
|
-
default:
|
|
9
|
-
sm:
|
|
10
|
-
lg:
|
|
8
|
+
default: string;
|
|
9
|
+
sm: string;
|
|
10
|
+
lg: string;
|
|
11
11
|
};
|
|
12
|
-
}, undefined, "hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-muted gap-1 rounded-none text-xs font-medium transition-all [&_svg:not([class*='size-'])]:size-4 group/toggle inline-flex items-center justify-center whitespace-nowrap outline-none hover:bg-muted focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
13
|
-
variant: {
|
|
14
|
-
default: "bg-transparent";
|
|
15
|
-
outline: "border-input hover:bg-muted border bg-transparent";
|
|
16
|
-
};
|
|
17
|
-
size: {
|
|
18
|
-
default: "h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
|
|
19
|
-
sm: "h-7 min-w-7 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5";
|
|
20
|
-
lg: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
|
|
21
|
-
};
|
|
22
|
-
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
23
|
-
variant: {
|
|
24
|
-
default: "bg-transparent";
|
|
25
|
-
outline: "border-input hover:bg-muted border bg-transparent";
|
|
26
|
-
};
|
|
27
|
-
size: {
|
|
28
|
-
default: "h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
|
|
29
|
-
sm: "h-7 min-w-7 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5";
|
|
30
|
-
lg: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
|
|
31
|
-
};
|
|
32
|
-
}, undefined>>;
|
|
12
|
+
}, undefined, "hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-muted gap-1 rounded-none text-xs font-medium transition-all [&_svg:not([class*='size-'])]:size-4 group/toggle inline-flex items-center justify-center whitespace-nowrap outline-none hover:bg-muted focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", undefined, undefined, undefined>;
|
|
33
13
|
export type ToggleVariant = VariantProps<typeof toggleVariants>['variant'];
|
|
34
14
|
export type ToggleSize = VariantProps<typeof toggleVariants>['size'];
|
|
35
15
|
export type ToggleVariants = VariantProps<typeof toggleVariants>;
|