@widgetic/design-system 0.5.22 → 0.5.24
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 +2 -0
- package/dist/components/CopyableHeader.svelte +260 -448
- package/dist/components/CopyableHeader.svelte.d.ts +8 -5
- package/dist/components/EmptyState.svelte +100 -128
- package/dist/components/EmptyState.svelte.d.ts +16 -19
- package/dist/components/GenerateLoader.svelte +17 -10
- package/dist/components/PasswordInput.svelte +41 -44
- package/dist/components/PasswordInput.svelte.d.ts +2 -0
- package/dist/components/ThumbHashImage.svelte +117 -119
- package/dist/components/WScrollArea.svelte +47 -41
- package/dist/components/chat/ActivityRow.svelte +115 -0
- package/dist/components/chat/ActivityRow.svelte.d.ts +18 -0
- package/dist/components/chat/ChatHeader.svelte +114 -0
- package/dist/components/chat/ChatHeader.svelte.d.ts +26 -0
- package/dist/components/chat/Composer.svelte +172 -0
- package/dist/components/chat/Composer.svelte.d.ts +27 -0
- package/dist/components/chat/Message.svelte +158 -0
- package/dist/components/chat/Message.svelte.d.ts +28 -0
- package/dist/components/chat/OptionRow.svelte +59 -0
- package/dist/components/chat/OptionRow.svelte.d.ts +14 -0
- package/dist/components/chat/PlanCard.svelte +220 -0
- package/dist/components/chat/PlanCard.svelte.d.ts +34 -0
- package/dist/components/chat/QuestionCard.svelte +265 -0
- package/dist/components/chat/QuestionCard.svelte.d.ts +38 -0
- package/dist/components/chat/ScrollToBottom.svelte +51 -0
- package/dist/components/chat/ScrollToBottom.svelte.d.ts +11 -0
- package/dist/components/chat/SuggestionCard.svelte +79 -0
- package/dist/components/chat/SuggestionCard.svelte.d.ts +20 -0
- package/dist/components/chat/TaskRow.svelte +59 -0
- package/dist/components/chat/TaskRow.svelte.d.ts +11 -0
- package/dist/components/chat/composerLogic.d.ts +16 -0
- package/dist/components/chat/composerLogic.js +29 -0
- package/dist/components/chat/index.d.ts +16 -0
- package/dist/components/chat/index.js +16 -0
- package/dist/components/chat/questionCardLogic.d.ts +11 -0
- package/dist/components/chat/questionCardLogic.js +39 -0
- package/dist/components/index.d.ts +10 -1
- package/dist/components/index.js +10 -0
- package/dist/components/modals/ActionModal.svelte +186 -180
- package/dist/components/modals/BaseModal.svelte +495 -401
- package/dist/components/modals/BaseModal.svelte.d.ts +4 -0
- package/dist/components/modals/NewItemDialog.svelte +198 -243
- package/dist/components/modals/Portal.svelte +109 -105
- package/dist/components/modals/README.md +16 -2
- package/dist/components/modals/RenameDialog.svelte +232 -292
- package/dist/components/modals/modalStore.d.ts +9 -1
- package/dist/components/modals/modalStore.js +44 -11
- package/dist/components/navigation/Breadcrumbs.svelte +421 -377
- package/dist/components/navigation/Breadcrumbs.svelte.d.ts +3 -2
- package/dist/components/navigation/breadcrumbsAvailableWidth.d.ts +10 -0
- package/dist/components/navigation/breadcrumbsAvailableWidth.js +10 -0
- package/dist/components/navigation/types.d.ts +2 -0
- package/dist/components/pdf/PDFViewer.svelte +1 -1
- package/dist/components/search-input/SearchInput.svelte +63 -104
- package/dist/components/search-input/SearchInput.svelte.d.ts +13 -27
- package/dist/components/search-input/index2.d.ts +14 -9
- package/dist/components/shad-editor/editor.css +1 -1
- package/dist/components/shad-editor/i18n/messages.d.ts +1 -1
- package/dist/components/shad-editor/i18n/messages.js +1 -1
- package/dist/components/shell/AppShell.svelte +52 -0
- package/dist/components/shell/AppShell.svelte.d.ts +13 -0
- package/dist/components/shell/Banner.svelte +90 -0
- package/dist/components/shell/Banner.svelte.d.ts +61 -0
- package/dist/components/shell/ErrorState.svelte +60 -0
- package/dist/components/shell/ErrorState.svelte.d.ts +13 -0
- package/dist/components/shell/Link.svelte +63 -0
- package/dist/components/shell/Link.svelte.d.ts +53 -0
- package/dist/components/shell/NavDrawer.svelte +117 -0
- package/dist/components/shell/NavDrawer.svelte.d.ts +10 -0
- package/dist/components/shell/NavRow.svelte +128 -0
- package/dist/components/shell/NavRow.svelte.d.ts +65 -0
- package/dist/components/shell/NavSectionLabel.svelte +27 -0
- package/dist/components/shell/NavSectionLabel.svelte.d.ts +9 -0
- package/dist/components/shell/NotificationRow.svelte +76 -0
- package/dist/components/shell/NotificationRow.svelte.d.ts +16 -0
- package/dist/components/shell/PageHeader.svelte +42 -0
- package/dist/components/shell/PageHeader.svelte.d.ts +12 -0
- package/dist/components/shell/ProfileRow.svelte +95 -0
- package/dist/components/shell/ProfileRow.svelte.d.ts +54 -0
- package/dist/components/shell/SettingsDialog.svelte +163 -0
- package/dist/components/shell/SettingsDialog.svelte.d.ts +19 -0
- package/dist/components/shell/SettingsNav.svelte +46 -0
- package/dist/components/shell/SettingsNav.svelte.d.ts +11 -0
- package/dist/components/shell/Sidebar.svelte +82 -0
- package/dist/components/shell/Sidebar.svelte.d.ts +25 -0
- package/dist/components/shell/Stat.svelte +63 -0
- package/dist/components/shell/Stat.svelte.d.ts +58 -0
- package/dist/components/shell/TopBar.svelte +37 -0
- package/dist/components/shell/TopBar.svelte.d.ts +11 -0
- package/dist/components/shell/WidgetRow.svelte +126 -0
- package/dist/components/shell/WidgetRow.svelte.d.ts +78 -0
- package/dist/components/shell/error-state-messages.d.ts +7 -0
- package/dist/components/shell/error-state-messages.js +9 -0
- package/dist/components/shell/index.d.ts +22 -0
- package/dist/components/shell/index.js +25 -0
- package/dist/components/shell/link-external.d.ts +2 -0
- package/dist/components/shell/link-external.js +7 -0
- package/dist/components/shell/messages.d.ts +7 -0
- package/dist/components/shell/messages.js +5 -0
- package/dist/components/shell/nested-modal-guard.d.ts +25 -0
- package/dist/components/shell/nested-modal-guard.js +33 -0
- package/dist/components/shell/settings-nav-types.d.ts +12 -0
- package/dist/components/shell/settings-nav-types.js +3 -0
- package/dist/components/shell/shell-utils.d.ts +7 -0
- package/dist/components/shell/shell-utils.js +27 -0
- package/dist/components/shell/stat-tone.d.ts +3 -0
- package/dist/components/shell/stat-tone.js +11 -0
- package/dist/components/toast/ToasterModal.svelte +102 -168
- package/dist/components/toast/ToasterModal.svelte.d.ts +2 -12
- package/dist/components/ui/accordion/accordion-content.svelte +3 -2
- package/dist/components/ui/accordion/accordion-item.svelte +10 -1
- package/dist/components/ui/accordion/accordion-trigger.svelte +4 -3
- package/dist/components/ui/alert/alert-description.svelte +5 -1
- package/dist/components/ui/alert/alert-title.svelte +2 -1
- package/dist/components/ui/alert/index.d.ts +13 -11
- package/dist/components/ui/alert/index.js +4 -4
- package/dist/components/ui/avatar/avatar-utils.d.ts +2 -0
- package/dist/components/ui/avatar/avatar-utils.js +9 -0
- package/dist/components/ui/avatar/avatar.svelte +63 -0
- package/dist/components/ui/avatar/avatar.svelte.d.ts +80 -0
- package/dist/components/ui/avatar/index.d.ts +4 -0
- package/dist/components/ui/avatar/index.js +4 -0
- package/dist/components/ui/badge/badge.svelte +22 -10
- package/dist/components/ui/badge/badge.svelte.d.ts +14 -15
- package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +2 -2
- package/dist/components/ui/breadcrumb/breadcrumb-link.svelte +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb-page.svelte +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte +2 -2
- package/dist/components/ui/button/button-padding.d.ts +9 -0
- package/dist/components/ui/button/button-padding.js +15 -0
- package/dist/components/ui/button/button.svelte +81 -31
- package/dist/components/ui/button/button.svelte.d.ts +48 -29
- package/dist/components/ui/calendar/calendar-cell.svelte +1 -1
- package/dist/components/ui/calendar/calendar-head-cell.svelte +1 -1
- package/dist/components/ui/calendar/calendar-next-button.svelte +2 -2
- package/dist/components/ui/calendar/calendar-prev-button.svelte +2 -2
- package/dist/components/ui/calendar/calendar.svelte.d.ts +1 -1
- package/dist/components/ui/card/card-description.svelte +1 -1
- package/dist/components/ui/card/card-title.svelte +1 -1
- package/dist/components/ui/card/card.svelte +1 -1
- package/dist/components/ui/checkbox/checkbox.svelte +9 -5
- package/dist/components/ui/chip/chip.svelte +48 -0
- package/dist/components/ui/chip/chip.svelte.d.ts +13 -0
- package/dist/components/ui/chip/index.d.ts +2 -0
- package/dist/components/ui/chip/index.js +2 -0
- package/dist/components/ui/command/command-dialog.svelte +1 -1
- package/dist/components/ui/command/command-input.svelte +4 -4
- package/dist/components/ui/command/command-item.svelte +1 -1
- package/dist/components/ui/command/command-link-item.svelte +1 -1
- package/dist/components/ui/command/command.svelte +1 -1
- package/dist/components/ui/dialog/dialog-content.svelte +11 -4
- package/dist/components/ui/dialog/dialog-description.svelte +1 -1
- package/dist/components/ui/dialog/dialog-overlay.svelte +8 -1
- package/dist/components/ui/dialog/dialog-title.svelte +1 -1
- package/dist/components/ui/drawer/drawer-content.svelte +1 -1
- package/dist/components/ui/drawer/drawer-overlay.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +5 -5
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +20 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +4 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +5 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +3 -3
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +2 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +3 -3
- package/dist/components/ui/field/field-ids.d.ts +7 -0
- package/dist/components/ui/field/field-ids.js +15 -0
- package/dist/components/ui/field/field.svelte +62 -0
- package/dist/components/ui/field/field.svelte.d.ts +21 -0
- package/dist/components/ui/field/index.d.ts +3 -0
- package/dist/components/ui/field/index.js +3 -0
- package/dist/components/ui/hover-card/hover-card-content.svelte +1 -1
- package/dist/components/ui/icon-button/icon-button.svelte +72 -0
- package/dist/components/ui/icon-button/icon-button.svelte.d.ts +90 -0
- package/dist/components/ui/icon-button/index.d.ts +2 -0
- package/dist/components/ui/icon-button/index.js +4 -0
- package/dist/components/ui/input/index.d.ts +1 -0
- package/dist/components/ui/input/input.svelte +11 -4
- package/dist/components/ui/input/input.svelte.d.ts +4 -1
- package/dist/components/ui/input-otp/input-otp-separator.svelte +2 -2
- package/dist/components/ui/input-otp/input-otp-slot.svelte +5 -4
- package/dist/components/ui/input-otp/input-otp-slot.svelte.d.ts +1 -1
- package/dist/components/ui/input-otp/input-otp.svelte +1 -1
- package/dist/components/ui/label/label.svelte +3 -2
- package/dist/components/ui/popover/popover-content.svelte +1 -1
- package/dist/components/ui/progress/progress.svelte +19 -5
- package/dist/components/ui/progress/progress.svelte.d.ts +4 -2
- package/dist/components/ui/radio-group/radio-group-item.svelte +4 -4
- package/dist/components/ui/range-calendar/range-calendar-head-cell.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-next-button.svelte +2 -2
- package/dist/components/ui/range-calendar/range-calendar-prev-button.svelte +2 -2
- package/dist/components/ui/range-calendar/range-calendar.svelte.d.ts +1 -1
- package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte +4 -1
- package/dist/components/ui/scroll-area/scroll-area.svelte +1 -1
- package/dist/components/ui/select/select-content.svelte +1 -3
- package/dist/components/ui/select/select-item.svelte +5 -4
- package/dist/components/ui/select/select-scroll-down-button.svelte +2 -2
- package/dist/components/ui/select/select-scroll-up-button.svelte +2 -2
- package/dist/components/ui/select/select-trigger.svelte +4 -3
- package/dist/components/ui/skeleton/index.d.ts +2 -0
- package/dist/components/ui/skeleton/index.js +2 -0
- package/dist/components/ui/skeleton/skeleton.svelte +24 -0
- package/dist/components/ui/skeleton/skeleton.svelte.d.ts +8 -0
- package/dist/components/ui/slider/slider.svelte +5 -10
- package/dist/components/ui/sonner/sonner.svelte +19 -13
- package/dist/components/ui/stepper-button/index.d.ts +3 -0
- package/dist/components/ui/stepper-button/index.js +2 -0
- package/dist/components/ui/stepper-button/stepper-button.svelte +37 -0
- package/dist/components/ui/stepper-button/stepper-button.svelte.d.ts +9 -0
- package/dist/components/ui/switch/switch.svelte +8 -3
- package/dist/components/ui/table/table-cell.svelte +1 -1
- package/dist/components/ui/table/table-head.svelte +1 -1
- package/dist/components/ui/table/table-row.svelte +1 -1
- package/dist/components/ui/tabs/tabs-list.svelte +1 -1
- package/dist/components/ui/tabs/tabs-trigger.svelte +1 -1
- package/dist/components/ui/tag/index.d.ts +2 -0
- package/dist/components/ui/tag/index.js +2 -0
- package/dist/components/ui/tag/tag.svelte +42 -0
- package/dist/components/ui/tag/tag.svelte.d.ts +11 -0
- package/dist/components/ui/textarea/textarea.svelte +4 -3
- package/dist/components/ui/textarea/textarea.svelte.d.ts +2 -2
- package/dist/components/ui/toggle/toggle.svelte +9 -9
- package/dist/components/ui/toggle/toggle.svelte.d.ts +14 -21
- package/dist/components/ui/tooltip/tooltip-content.svelte +1 -1
- package/dist/fonts/Inter/Inter-Black.woff2 +0 -0
- package/dist/fonts/Inter/Inter-BlackItalic.woff2 +0 -0
- package/dist/fonts/Inter/Inter-Bold.woff2 +0 -0
- package/dist/fonts/Inter/Inter-BoldItalic.woff2 +0 -0
- package/dist/fonts/Inter/Inter-ExtraBold.woff2 +0 -0
- package/dist/fonts/Inter/Inter-ExtraBoldItalic.woff2 +0 -0
- package/dist/fonts/Inter/Inter-ExtraLight-BETA.woff2 +0 -0
- package/dist/fonts/Inter/Inter-ExtraLightItalic-BETA.woff2 +0 -0
- package/dist/fonts/Inter/Inter-Italic.woff2 +0 -0
- package/dist/fonts/Inter/Inter-Light-BETA.woff2 +0 -0
- package/dist/fonts/Inter/Inter-LightItalic-BETA.woff2 +0 -0
- package/dist/fonts/Inter/Inter-Medium.woff2 +0 -0
- package/dist/fonts/Inter/Inter-MediumItalic.woff2 +0 -0
- package/dist/fonts/Inter/Inter-Regular.woff2 +0 -0
- package/dist/fonts/Inter/Inter-SemiBold.woff2 +0 -0
- package/dist/fonts/Inter/Inter-SemiBoldItalic.woff2 +0 -0
- package/dist/fonts/Inter/Inter-Thin-BETA.woff2 +0 -0
- package/dist/fonts/Inter/Inter-ThinItalic-BETA.woff2 +0 -0
- package/dist/fonts/Inter/Inter-italic.var.woff2 +0 -0
- package/dist/fonts/Inter/Inter-upright.var.woff2 +0 -0
- package/dist/fonts/Inter/Inter.var.woff2 +0 -0
- package/dist/fonts/JetBrainsMono/JetBrainsMono-Regular.woff2 +0 -0
- package/dist/i18n/audit/designSystemWords.d.ts +1 -1
- package/dist/i18n/audit/designSystemWords.js +1 -1
- package/dist/styles/fonts.css +18 -14
- package/dist/styles/global.css +10 -21
- package/dist/styles/tokens.css +332 -0
- package/dist/utils/overlayMotion.d.ts +49 -0
- package/dist/utils/overlayMotion.js +71 -0
- package/dist/utils.d.ts +27 -0
- package/dist/utils.js +33 -2
- package/package.json +2 -1
- package/tailwind.config.ts +7 -47
|
@@ -1,17 +1,15 @@
|
|
|
1
|
+
<!-- Figma: Badge (component set 50:4, node 50:2). -->
|
|
1
2
|
<script lang="ts" module>
|
|
2
|
-
import {
|
|
3
|
+
import type { VariantProps } from "tailwind-variants";
|
|
3
4
|
|
|
4
5
|
export const badgeVariants = tv({
|
|
5
|
-
base: "
|
|
6
|
+
base: "inline-flex h-5 max-w-full items-center gap-1.5 rounded-full border border-transparent px-2 text-label-small focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
6
7
|
variants: {
|
|
7
8
|
variant: {
|
|
8
|
-
default:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
destructive:
|
|
13
|
-
"bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent",
|
|
14
|
-
outline: "text-foreground",
|
|
9
|
+
default: "bg-secondary text-secondary-foreground",
|
|
10
|
+
secondary: "bg-brand-subtle text-brand-foreground",
|
|
11
|
+
destructive: "bg-destructive text-destructive-foreground",
|
|
12
|
+
outline: "border-border bg-transparent text-foreground",
|
|
15
13
|
},
|
|
16
14
|
},
|
|
17
15
|
defaultVariants: {
|
|
@@ -25,17 +23,19 @@
|
|
|
25
23
|
<script lang="ts">
|
|
26
24
|
import type { WithElementRef } from "bits-ui";
|
|
27
25
|
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
28
|
-
import { cn } from "../../../utils.js";
|
|
26
|
+
import { cn, tv } from "../../../utils.js";
|
|
29
27
|
|
|
30
28
|
let {
|
|
31
29
|
ref = $bindable(null),
|
|
32
30
|
href,
|
|
33
31
|
class: className,
|
|
34
32
|
variant = "default",
|
|
33
|
+
showDot = false,
|
|
35
34
|
children,
|
|
36
35
|
...restProps
|
|
37
36
|
}: WithElementRef<HTMLAnchorAttributes> & {
|
|
38
37
|
variant?: BadgeVariant;
|
|
38
|
+
showDot?: boolean;
|
|
39
39
|
} = $props();
|
|
40
40
|
</script>
|
|
41
41
|
|
|
@@ -46,5 +46,17 @@
|
|
|
46
46
|
class={cn(badgeVariants({ variant }), className)}
|
|
47
47
|
{...restProps}
|
|
48
48
|
>
|
|
49
|
+
{#if showDot}
|
|
50
|
+
<span
|
|
51
|
+
class={cn(
|
|
52
|
+
"size-1.5 shrink-0 rounded-full bg-current",
|
|
53
|
+
variant === "default" && "bg-secondary-foreground",
|
|
54
|
+
variant === "secondary" && "bg-brand-foreground",
|
|
55
|
+
variant === "destructive" && "bg-destructive-foreground",
|
|
56
|
+
variant === "outline" && "bg-foreground"
|
|
57
|
+
)}
|
|
58
|
+
aria-hidden="true"
|
|
59
|
+
></span>
|
|
60
|
+
{/if}
|
|
49
61
|
{@render children?.()}
|
|
50
62
|
</svelte:element>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { VariantProps } from "tailwind-variants";
|
|
2
2
|
export declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
3
3
|
variant: {
|
|
4
4
|
default: string;
|
|
@@ -6,12 +6,17 @@ export declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
|
6
6
|
destructive: string;
|
|
7
7
|
outline: string;
|
|
8
8
|
};
|
|
9
|
-
}, undefined, "
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
}, undefined, "inline-flex h-5 max-w-full items-center gap-1.5 rounded-full border border-transparent px-2 text-label-small focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", {
|
|
10
|
+
responsiveVariants?: boolean | (string | number | symbol)[] | {
|
|
11
|
+
variant?: boolean | (string | number | symbol)[] | undefined;
|
|
12
|
+
} | undefined;
|
|
13
|
+
} & import("tailwind-variants/dist/config.js").TWMConfig & {
|
|
14
|
+
twMergeConfig: {
|
|
15
|
+
classGroups: {
|
|
16
|
+
"font-size": {
|
|
17
|
+
text: ("display-hero" | "heading-page" | "heading-section" | "body" | "body-medium" | "body-large" | "caption" | "caption-medium" | "label" | "label-small" | "code")[];
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
15
20
|
};
|
|
16
21
|
}, {
|
|
17
22
|
variant: {
|
|
@@ -20,13 +25,6 @@ export declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
|
20
25
|
destructive: string;
|
|
21
26
|
outline: string;
|
|
22
27
|
};
|
|
23
|
-
}>, {
|
|
24
|
-
variant: {
|
|
25
|
-
default: string;
|
|
26
|
-
secondary: string;
|
|
27
|
-
destructive: string;
|
|
28
|
-
outline: string;
|
|
29
|
-
};
|
|
30
28
|
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
31
29
|
variant: {
|
|
32
30
|
default: string;
|
|
@@ -34,7 +32,7 @@ export declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
|
34
32
|
destructive: string;
|
|
35
33
|
outline: string;
|
|
36
34
|
};
|
|
37
|
-
}, undefined, "
|
|
35
|
+
}, undefined, "inline-flex h-5 max-w-full items-center gap-1.5 rounded-full border border-transparent px-2 text-label-small focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
38
36
|
variant: {
|
|
39
37
|
default: string;
|
|
40
38
|
secondary: string;
|
|
@@ -54,6 +52,7 @@ import type { WithElementRef } from "bits-ui";
|
|
|
54
52
|
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
55
53
|
type $$ComponentProps = WithElementRef<HTMLAnchorAttributes> & {
|
|
56
54
|
variant?: BadgeVariant;
|
|
55
|
+
showDot?: boolean;
|
|
57
56
|
};
|
|
58
57
|
declare const Badge: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
59
58
|
type Badge = ReturnType<typeof Badge>;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<script lang="ts">
|
|
7
|
-
import
|
|
7
|
+
import IconDots from "@tabler/icons-svelte/icons/dots";
|
|
8
8
|
import type { WithElementRef, WithoutChildren } from "bits-ui";
|
|
9
9
|
import type { HTMLAttributes } from "svelte/elements";
|
|
10
10
|
import { cn } from "../../../utils.js";
|
|
@@ -23,6 +23,6 @@
|
|
|
23
23
|
class={cn("flex size-9 items-center justify-center", className)}
|
|
24
24
|
{...restProps}
|
|
25
25
|
>
|
|
26
|
-
<
|
|
26
|
+
<IconDots class="size-4 stroke-[1.333]" />
|
|
27
27
|
<span class="sr-only">More</span>
|
|
28
28
|
</span>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
} = $props();
|
|
17
17
|
|
|
18
18
|
const attrs = $derived({
|
|
19
|
-
class: cn("hover:text-foreground transition-colors", className),
|
|
19
|
+
class: cn("text-caption-medium text-muted-foreground hover:text-foreground transition-colors duration-fast", className),
|
|
20
20
|
href,
|
|
21
21
|
...restProps,
|
|
22
22
|
});
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<script lang="ts">
|
|
7
|
-
import
|
|
7
|
+
import IconChevronRight from "@tabler/icons-svelte/icons/chevron-right";
|
|
8
8
|
import type { WithElementRef } from "bits-ui";
|
|
9
9
|
import type { HTMLLiAttributes } from "svelte/elements";
|
|
10
10
|
import { cn } from "../../../utils.js";
|
|
@@ -27,6 +27,6 @@
|
|
|
27
27
|
{#if children}
|
|
28
28
|
{@render children?.()}
|
|
29
29
|
{:else}
|
|
30
|
-
<
|
|
30
|
+
<IconChevronRight class="stroke-[1.333] rtl:-scale-x-100" />
|
|
31
31
|
{/if}
|
|
32
32
|
</li>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when a `class` string sets the padding of a side: `p-0`, `px-2`, `ps-4`, `pr-1`, also with a modifier in front
|
|
3
|
+
* (`!px-3`, `md:px-2`, `[&_svg]:p-0`) or behind it (`px-3!`).
|
|
4
|
+
*
|
|
5
|
+
* The Button reads this to leave its icon rule out (Figma pads the icon side by 12 and the label side by 16, see the note
|
|
6
|
+
* at the top of `button.svelte`): a caller that has chosen the sides itself, like an icon-only button with `p-0`, would
|
|
7
|
+
* otherwise get one of them changed by a rule it knows nothing about.
|
|
8
|
+
*/
|
|
9
|
+
export declare function classNameSetsPadding(className: string | null | undefined): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when a `class` string sets the padding of a side: `p-0`, `px-2`, `ps-4`, `pr-1`, also with a modifier in front
|
|
3
|
+
* (`!px-3`, `md:px-2`, `[&_svg]:p-0`) or behind it (`px-3!`).
|
|
4
|
+
*
|
|
5
|
+
* The Button reads this to leave its icon rule out (Figma pads the icon side by 12 and the label side by 16, see the note
|
|
6
|
+
* at the top of `button.svelte`): a caller that has chosen the sides itself, like an icon-only button with `p-0`, would
|
|
7
|
+
* otherwise get one of them changed by a rule it knows nothing about.
|
|
8
|
+
*/
|
|
9
|
+
export function classNameSetsPadding(className) {
|
|
10
|
+
if (!className)
|
|
11
|
+
return false;
|
|
12
|
+
// The utility has to start a class name (`px-` in `placeholder-x` or `peer-x` is not a padding): at the start, after a
|
|
13
|
+
// space or after the `:` of a modifier. The hyphen after the letters is what tells `pl-` from `placeholder`.
|
|
14
|
+
return /(^|[\s:])!?-?(?:p|px|ps|pe|pl|pr)-/.test(className);
|
|
15
|
+
}
|
|
@@ -1,48 +1,102 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Figma: Button (component set 33:4, page Button); Button Small (33:215) maps to size `sm`.
|
|
3
|
+
Width: the button pads its sides by 12 (small: 8) and the label sits in a box with 4 more on each side, so a button with
|
|
4
|
+
only a label is the text + 32 wide (small: + 24). With an icon first it is the text + 48 (small: + 40): the icon touches
|
|
5
|
+
the 12 and the label keeps its 4 + 12 on the other side; with an icon at each end both sides are 12 (text + 64).
|
|
6
|
+
The 1px stroke of Outline and Stroke sits inside that padding and takes no room in Figma.
|
|
7
|
+
With bits-ui triggers (Dialog, DropdownMenu, Tooltip, …), use `{#snippet child({ props })}` and spread
|
|
8
|
+
`props` onto `<Button {...props}>` — do not wrap `<Button>` inside a default trigger (nested buttons).
|
|
9
|
+
-->
|
|
1
10
|
<script lang="ts" module>
|
|
2
11
|
import type { WithElementRef } from "bits-ui";
|
|
3
12
|
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
|
|
4
|
-
import {
|
|
13
|
+
import type { VariantProps } from "tailwind-variants";
|
|
5
14
|
|
|
6
15
|
export const buttonVariants = tv({
|
|
7
|
-
base: "
|
|
16
|
+
base: "inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-lg text-label transition-colors duration-fast press-feedback focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.333]",
|
|
8
17
|
variants: {
|
|
9
18
|
variant: {
|
|
10
19
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
11
|
-
destructive:
|
|
20
|
+
destructive:
|
|
21
|
+
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
12
22
|
outline:
|
|
13
|
-
"border-input bg-background hover:bg-accent hover:text-
|
|
14
|
-
secondary:
|
|
15
|
-
|
|
23
|
+
"border border-input bg-background text-foreground hover:bg-accent hover:text-foreground",
|
|
24
|
+
secondary:
|
|
25
|
+
"bg-secondary text-secondary-foreground hover:bg-accent hover:text-foreground",
|
|
26
|
+
ghost: "text-foreground hover:bg-accent hover:text-foreground",
|
|
27
|
+
accent: "bg-brand text-brand-foreground hover:bg-brand/90",
|
|
28
|
+
stroke:
|
|
29
|
+
"border border-border-strong/30 bg-transparent text-foreground hover:bg-accent hover:text-foreground",
|
|
16
30
|
link: "text-primary underline-offset-4 hover:underline",
|
|
17
31
|
},
|
|
18
32
|
size: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
// The 12 of the side (small: 8) and the 4 of the label box (see the note at the top), as Figma
|
|
34
|
+
default: "h-9 px-4",
|
|
35
|
+
sm: "h-8 px-3",
|
|
36
|
+
lg: "h-10 px-6",
|
|
37
|
+
icon: "h-9 w-9",
|
|
38
|
+
"icon-sm": "h-8 w-8",
|
|
39
|
+
},
|
|
40
|
+
// Switched on by the Button below and not by every caller of `buttonVariants` (a calendar cell or a menu trigger
|
|
41
|
+
// sets its own padding): an icon sits at the side with no label box, so that side is 12 (small: 8)
|
|
42
|
+
iconPadding: {
|
|
43
|
+
true: "",
|
|
44
|
+
false: "",
|
|
23
45
|
},
|
|
24
46
|
},
|
|
47
|
+
compoundVariants: [
|
|
48
|
+
// The first icon is taken as the leading one (CSS cannot tell a leading icon from a trailing one, text is no
|
|
49
|
+
// element); a second icon makes the other side 12 as well. Either way the width is the one Figma draws.
|
|
50
|
+
{
|
|
51
|
+
size: "default",
|
|
52
|
+
iconPadding: true,
|
|
53
|
+
class: "has-[>svg]:ps-3 has-[>svg:nth-of-type(2)]:pe-3",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
size: "sm",
|
|
57
|
+
iconPadding: true,
|
|
58
|
+
class: "has-[>svg]:ps-2 has-[>svg:nth-of-type(2)]:pe-2",
|
|
59
|
+
},
|
|
60
|
+
// Figma draws the 1px stroke of Outline and Stroke inside the padding, a CSS border sits outside it: those two take
|
|
61
|
+
// 1px off every side, so that they are as wide as the other styles
|
|
62
|
+
{ variant: ["outline", "stroke"], size: "default", class: "px-[15px]" },
|
|
63
|
+
{ variant: ["outline", "stroke"], size: "sm", class: "px-[11px]" },
|
|
64
|
+
{
|
|
65
|
+
variant: ["outline", "stroke"],
|
|
66
|
+
size: "default",
|
|
67
|
+
iconPadding: true,
|
|
68
|
+
class: "has-[>svg]:ps-[11px] has-[>svg:nth-of-type(2)]:pe-[11px]",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
variant: ["outline", "stroke"],
|
|
72
|
+
size: "sm",
|
|
73
|
+
iconPadding: true,
|
|
74
|
+
class: "has-[>svg]:ps-[7px] has-[>svg:nth-of-type(2)]:pe-[7px]",
|
|
75
|
+
},
|
|
76
|
+
],
|
|
25
77
|
defaultVariants: {
|
|
26
78
|
variant: "default",
|
|
27
79
|
size: "default",
|
|
80
|
+
iconPadding: false,
|
|
28
81
|
},
|
|
29
82
|
});
|
|
30
83
|
|
|
31
84
|
export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
|
|
32
85
|
export type ButtonSize = VariantProps<typeof buttonVariants>["size"];
|
|
33
86
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
87
|
+
export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
|
|
88
|
+
WithElementRef<HTMLAnchorAttributes> & {
|
|
89
|
+
ref?: any;
|
|
90
|
+
href?: string;
|
|
91
|
+
class?: string;
|
|
92
|
+
variant?: ButtonVariant;
|
|
93
|
+
size?: ButtonSize;
|
|
94
|
+
};
|
|
42
95
|
</script>
|
|
43
96
|
|
|
44
97
|
<script lang="ts">
|
|
45
|
-
import { cn } from "../../../utils.js";
|
|
98
|
+
import { cn, tv } from "../../../utils.js";
|
|
99
|
+
import { classNameSetsPadding } from "./button-padding.js";
|
|
46
100
|
|
|
47
101
|
let {
|
|
48
102
|
class: className,
|
|
@@ -54,24 +108,20 @@
|
|
|
54
108
|
children,
|
|
55
109
|
...restProps
|
|
56
110
|
}: ButtonProps = $props();
|
|
111
|
+
|
|
112
|
+
// A caller that sets the padding itself (`p-0` on an icon-only button, `px-2`, `!px-3`, …) has chosen the sides: the rule
|
|
113
|
+
// for an icon would change one of them, so it stays off then
|
|
114
|
+
const classes = $derived(
|
|
115
|
+
cn(buttonVariants({ variant, size, iconPadding: !classNameSetsPadding(className), className })),
|
|
116
|
+
);
|
|
57
117
|
</script>
|
|
58
118
|
|
|
59
119
|
{#if href}
|
|
60
|
-
<a
|
|
61
|
-
bind:this={ref}
|
|
62
|
-
class={cn(buttonVariants({ variant, size, className }))}
|
|
63
|
-
{href}
|
|
64
|
-
{...restProps}
|
|
65
|
-
>
|
|
120
|
+
<a bind:this={ref} class={classes} {href} {...restProps}>
|
|
66
121
|
{@render children?.()}
|
|
67
122
|
</a>
|
|
68
123
|
{:else}
|
|
69
|
-
<button
|
|
70
|
-
bind:this={ref}
|
|
71
|
-
class={cn(buttonVariants({ variant, size, className }))}
|
|
72
|
-
{type}
|
|
73
|
-
{...restProps}
|
|
74
|
-
>
|
|
124
|
+
<button bind:this={ref} class={classes} {type} {...restProps}>
|
|
75
125
|
{@render children?.()}
|
|
76
126
|
</button>
|
|
77
127
|
{/if}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WithElementRef } from "bits-ui";
|
|
2
2
|
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
|
|
3
|
-
import {
|
|
3
|
+
import type { VariantProps } from "tailwind-variants";
|
|
4
4
|
export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
5
5
|
variant: {
|
|
6
6
|
default: string;
|
|
@@ -8,6 +8,8 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
8
8
|
outline: string;
|
|
9
9
|
secondary: string;
|
|
10
10
|
ghost: string;
|
|
11
|
+
accent: string;
|
|
12
|
+
stroke: string;
|
|
11
13
|
link: string;
|
|
12
14
|
};
|
|
13
15
|
size: {
|
|
@@ -15,21 +17,25 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
15
17
|
sm: string;
|
|
16
18
|
lg: string;
|
|
17
19
|
icon: string;
|
|
20
|
+
"icon-sm": string;
|
|
18
21
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
destructive: string;
|
|
23
|
-
outline: string;
|
|
24
|
-
secondary: string;
|
|
25
|
-
ghost: string;
|
|
26
|
-
link: string;
|
|
22
|
+
iconPadding: {
|
|
23
|
+
true: string;
|
|
24
|
+
false: string;
|
|
27
25
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
}, undefined, "inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-lg text-label transition-colors duration-fast press-feedback focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.333]", {
|
|
27
|
+
responsiveVariants?: boolean | (string | number | symbol)[] | {
|
|
28
|
+
size?: boolean | (string | number | symbol)[] | undefined;
|
|
29
|
+
variant?: boolean | (string | number | symbol)[] | undefined;
|
|
30
|
+
iconPadding?: boolean | (string | number | symbol)[] | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
} & import("tailwind-variants/dist/config.js").TWMConfig & {
|
|
33
|
+
twMergeConfig: {
|
|
34
|
+
classGroups: {
|
|
35
|
+
"font-size": {
|
|
36
|
+
text: ("display-hero" | "heading-page" | "heading-section" | "body" | "body-medium" | "body-large" | "caption" | "caption-medium" | "label" | "label-small" | "code")[];
|
|
37
|
+
}[];
|
|
38
|
+
};
|
|
33
39
|
};
|
|
34
40
|
}, {
|
|
35
41
|
variant: {
|
|
@@ -38,6 +44,8 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
38
44
|
outline: string;
|
|
39
45
|
secondary: string;
|
|
40
46
|
ghost: string;
|
|
47
|
+
accent: string;
|
|
48
|
+
stroke: string;
|
|
41
49
|
link: string;
|
|
42
50
|
};
|
|
43
51
|
size: {
|
|
@@ -45,21 +53,11 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
45
53
|
sm: string;
|
|
46
54
|
lg: string;
|
|
47
55
|
icon: string;
|
|
56
|
+
"icon-sm": string;
|
|
48
57
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
destructive: string;
|
|
53
|
-
outline: string;
|
|
54
|
-
secondary: string;
|
|
55
|
-
ghost: string;
|
|
56
|
-
link: string;
|
|
57
|
-
};
|
|
58
|
-
size: {
|
|
59
|
-
default: string;
|
|
60
|
-
sm: string;
|
|
61
|
-
lg: string;
|
|
62
|
-
icon: string;
|
|
58
|
+
iconPadding: {
|
|
59
|
+
true: string;
|
|
60
|
+
false: string;
|
|
63
61
|
};
|
|
64
62
|
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
65
63
|
variant: {
|
|
@@ -68,6 +66,8 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
68
66
|
outline: string;
|
|
69
67
|
secondary: string;
|
|
70
68
|
ghost: string;
|
|
69
|
+
accent: string;
|
|
70
|
+
stroke: string;
|
|
71
71
|
link: string;
|
|
72
72
|
};
|
|
73
73
|
size: {
|
|
@@ -75,14 +75,21 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
75
75
|
sm: string;
|
|
76
76
|
lg: string;
|
|
77
77
|
icon: string;
|
|
78
|
+
"icon-sm": string;
|
|
78
79
|
};
|
|
79
|
-
|
|
80
|
+
iconPadding: {
|
|
81
|
+
true: string;
|
|
82
|
+
false: string;
|
|
83
|
+
};
|
|
84
|
+
}, undefined, "inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-lg text-label transition-colors duration-fast press-feedback focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.333]", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
80
85
|
variant: {
|
|
81
86
|
default: string;
|
|
82
87
|
destructive: string;
|
|
83
88
|
outline: string;
|
|
84
89
|
secondary: string;
|
|
85
90
|
ghost: string;
|
|
91
|
+
accent: string;
|
|
92
|
+
stroke: string;
|
|
86
93
|
link: string;
|
|
87
94
|
};
|
|
88
95
|
size: {
|
|
@@ -90,6 +97,11 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
90
97
|
sm: string;
|
|
91
98
|
lg: string;
|
|
92
99
|
icon: string;
|
|
100
|
+
"icon-sm": string;
|
|
101
|
+
};
|
|
102
|
+
iconPadding: {
|
|
103
|
+
true: string;
|
|
104
|
+
false: string;
|
|
93
105
|
};
|
|
94
106
|
}, {
|
|
95
107
|
variant: {
|
|
@@ -98,6 +110,8 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
98
110
|
outline: string;
|
|
99
111
|
secondary: string;
|
|
100
112
|
ghost: string;
|
|
113
|
+
accent: string;
|
|
114
|
+
stroke: string;
|
|
101
115
|
link: string;
|
|
102
116
|
};
|
|
103
117
|
size: {
|
|
@@ -105,6 +119,11 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
105
119
|
sm: string;
|
|
106
120
|
lg: string;
|
|
107
121
|
icon: string;
|
|
122
|
+
"icon-sm": string;
|
|
123
|
+
};
|
|
124
|
+
iconPadding: {
|
|
125
|
+
true: string;
|
|
126
|
+
false: string;
|
|
108
127
|
};
|
|
109
128
|
}>, unknown, unknown, undefined>>;
|
|
110
129
|
export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<CalendarPrimitive.Cell
|
|
17
17
|
bind:ref
|
|
18
18
|
class={cn(
|
|
19
|
-
"[&:has([data-selected])]:bg-accent [&:has([data-selected][data-outside-month])]:bg-accent/50 relative size-9 p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:rounded-
|
|
19
|
+
"[&:has([data-selected])]:bg-accent [&:has([data-selected][data-outside-month])]:bg-accent/50 relative size-9 p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:rounded-lg",
|
|
20
20
|
className
|
|
21
21
|
)}
|
|
22
22
|
{...restProps}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<script lang="ts">
|
|
14
|
-
|
|
14
|
+
import IconChevronRight from "@tabler/icons-svelte/icons/chevron-right";
|
|
15
15
|
import { buttonVariants } from "../button/index.js";
|
|
16
16
|
import { cn } from "../../../utils.js";
|
|
17
17
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
27
|
{#snippet Fallback()}
|
|
28
|
-
<
|
|
28
|
+
<IconChevronRight class="size-4 stroke-[1.333] rtl:-scale-x-100" />
|
|
29
29
|
{/snippet}
|
|
30
30
|
|
|
31
31
|
<CalendarPrimitive.NextButton
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<script lang="ts">
|
|
14
|
-
|
|
14
|
+
import IconChevronLeft from "@tabler/icons-svelte/icons/chevron-left";
|
|
15
15
|
import { buttonVariants } from "../button/index.js";
|
|
16
16
|
import { cn } from "../../../utils.js";
|
|
17
17
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
27
|
{#snippet Fallback()}
|
|
28
|
-
<
|
|
28
|
+
<IconChevronLeft class="size-4 stroke-[1.333] rtl:-scale-x-100" />
|
|
29
29
|
{/snippet}
|
|
30
30
|
|
|
31
31
|
<CalendarPrimitive.PrevButton
|
|
@@ -6,6 +6,6 @@ export type CalendarProps = WithoutChildrenOrChild<CalendarPrimitive.RootProps>
|
|
|
6
6
|
nextLabel?: string;
|
|
7
7
|
};
|
|
8
8
|
import * as Calendar from "./index.js";
|
|
9
|
-
declare const Calendar: import("svelte").Component<CalendarProps, {}, "
|
|
9
|
+
declare const Calendar: import("svelte").Component<CalendarProps, {}, "ref" | "value" | "placeholder">;
|
|
10
10
|
type Calendar = ReturnType<typeof Calendar>;
|
|
11
11
|
export default Calendar;
|
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
}: CardDescriptionProps = $props();
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
|
-
<p bind:this={ref} class={cn("text-muted-foreground
|
|
19
|
+
<p bind:this={ref} class={cn("text-body text-muted-foreground", className)} {...restProps}>
|
|
20
20
|
{@render children?.()}
|
|
21
21
|
</p>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
<!-- Figma: Checkbox (component set 170:73, node 170:73). -->
|
|
1
2
|
<script lang="ts" module>
|
|
2
3
|
import { Checkbox as CheckboxPrimitive, type WithoutChildrenOrChild } from "bits-ui";
|
|
3
4
|
export type CheckboxProps = WithoutChildrenOrChild<CheckboxPrimitive.RootProps>;
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
7
|
<script lang="ts">
|
|
7
|
-
|
|
8
|
-
import
|
|
8
|
+
import IconCheck from "@tabler/icons-svelte/icons/check";
|
|
9
|
+
import IconMinus from "@tabler/icons-svelte/icons/minus";
|
|
9
10
|
import { cn } from "../../../utils.js";
|
|
10
11
|
|
|
11
12
|
let {
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
<CheckboxPrimitive.Root
|
|
21
22
|
bind:ref
|
|
22
23
|
class={cn(
|
|
23
|
-
"
|
|
24
|
+
"peer flex size-4 shrink-0 items-center justify-center rounded-sm border border-input bg-background text-primary-foreground transition-colors duration-fast hover:bg-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary",
|
|
24
25
|
className
|
|
25
26
|
)}
|
|
26
27
|
bind:checked
|
|
@@ -30,9 +31,12 @@
|
|
|
30
31
|
{#snippet children({ checked, indeterminate })}
|
|
31
32
|
<div class="flex size-4 items-center justify-center text-current">
|
|
32
33
|
{#if indeterminate}
|
|
33
|
-
<
|
|
34
|
+
<IconMinus class="size-3.5 stroke-[1.333]" aria-hidden="true" />
|
|
34
35
|
{:else}
|
|
35
|
-
<
|
|
36
|
+
<IconCheck
|
|
37
|
+
class={cn("size-3.5 stroke-[1.333]", !checked && "text-transparent")}
|
|
38
|
+
aria-hidden="true"
|
|
39
|
+
/>
|
|
36
40
|
{/if}
|
|
37
41
|
</div>
|
|
38
42
|
{/snippet}
|