@kayord/ui 2.1.14 → 3.0.1
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/dist/components/ui/accordion/accordion-content.svelte +7 -2
- package/dist/components/ui/accordion/accordion-item.svelte +1 -1
- package/dist/components/ui/accordion/accordion-trigger.svelte +9 -3
- package/dist/components/ui/accordion/accordion.svelte +14 -2
- package/dist/components/ui/alert/alert-action.svelte +15 -0
- package/dist/components/ui/alert/alert-action.svelte.d.ts +5 -0
- package/dist/components/ui/alert/alert-description.svelte +1 -1
- package/dist/components/ui/alert/alert-title.svelte +4 -1
- package/dist/components/ui/alert/alert.svelte +2 -2
- package/dist/components/ui/alert/alert.svelte.d.ts +2 -2
- package/dist/components/ui/alert/index.d.ts +2 -1
- package/dist/components/ui/alert/index.js +3 -2
- package/dist/components/ui/alert-dialog/alert-dialog-action.svelte +12 -3
- package/dist/components/ui/alert-dialog/alert-dialog-action.svelte.d.ts +6 -1
- package/dist/components/ui/alert-dialog/alert-dialog-cancel.svelte +12 -3
- package/dist/components/ui/alert-dialog/alert-dialog-cancel.svelte.d.ts +6 -1
- package/dist/components/ui/alert-dialog/alert-dialog-content.svelte +4 -1
- package/dist/components/ui/alert-dialog/alert-dialog-content.svelte.d.ts +1 -0
- package/dist/components/ui/alert-dialog/alert-dialog-description.svelte +4 -1
- package/dist/components/ui/alert-dialog/alert-dialog-footer.svelte +4 -1
- package/dist/components/ui/alert-dialog/alert-dialog-header.svelte +4 -1
- package/dist/components/ui/alert-dialog/alert-dialog-media.svelte +23 -0
- package/dist/components/ui/alert-dialog/alert-dialog-media.svelte.d.ts +5 -0
- package/dist/components/ui/alert-dialog/alert-dialog-overlay.svelte +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog-title.svelte +4 -1
- package/dist/components/ui/alert-dialog/index.d.ts +2 -1
- package/dist/components/ui/alert-dialog/index.js +3 -2
- package/dist/components/ui/avatar/avatar-badge.svelte +26 -0
- package/dist/components/ui/avatar/avatar-badge.svelte.d.ts +5 -0
- package/dist/components/ui/avatar/avatar-fallback.svelte +4 -1
- package/dist/components/ui/avatar/avatar-group-count.svelte +23 -0
- package/dist/components/ui/avatar/avatar-group-count.svelte.d.ts +5 -0
- package/dist/components/ui/avatar/avatar-group.svelte +23 -0
- package/dist/components/ui/avatar/avatar-group.svelte.d.ts +5 -0
- package/dist/components/ui/avatar/avatar-image.svelte +1 -1
- package/dist/components/ui/avatar/avatar.svelte +9 -2
- package/dist/components/ui/avatar/avatar.svelte.d.ts +4 -1
- package/dist/components/ui/avatar/index.d.ts +4 -1
- package/dist/components/ui/avatar/index.js +5 -2
- package/dist/components/ui/badge/badge.svelte +7 -5
- package/dist/components/ui/badge/badge.svelte.d.ts +8 -2
- package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +3 -3
- package/dist/components/ui/breadcrumb/breadcrumb-item.svelte +1 -6
- package/dist/components/ui/breadcrumb/breadcrumb-list.svelte +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.svelte +8 -1
- package/dist/components/ui/button/button.svelte +18 -13
- package/dist/components/ui/button/button.svelte.d.ts +11 -5
- package/dist/components/ui/button-group/button-group-separator.svelte +4 -1
- package/dist/components/ui/button-group/button-group-text.svelte +2 -1
- package/dist/components/ui/button-group/button-group.svelte +3 -3
- package/dist/components/ui/button-group/button-group.svelte.d.ts +2 -2
- package/dist/components/ui/button-group/index.d.ts +2 -2
- package/dist/components/ui/button-group/index.js +2 -2
- package/dist/components/ui/calendar/calendar-cell.svelte +1 -1
- package/dist/components/ui/calendar/calendar-day.svelte +4 -6
- package/dist/components/ui/calendar/calendar-grid.svelte +1 -5
- package/dist/components/ui/calendar/calendar-month-select.svelte +2 -2
- package/dist/components/ui/calendar/calendar-month.svelte +1 -1
- package/dist/components/ui/calendar/calendar-next-button.svelte +7 -2
- package/dist/components/ui/calendar/calendar-prev-button.svelte +7 -2
- package/dist/components/ui/calendar/calendar-year-select.svelte +1 -1
- package/dist/components/ui/calendar/calendar.svelte +1 -1
- package/dist/components/ui/card/card-action.svelte +1 -1
- package/dist/components/ui/card/card-content.svelte +6 -1
- package/dist/components/ui/card/card-footer.svelte +1 -1
- package/dist/components/ui/card/card-header.svelte +1 -1
- package/dist/components/ui/card/card-title.svelte +6 -1
- package/dist/components/ui/card/card.svelte +7 -2
- package/dist/components/ui/card/card.svelte.d.ts +4 -1
- package/dist/components/ui/carousel/carousel-next.svelte +5 -4
- package/dist/components/ui/carousel/carousel-previous.svelte +5 -4
- package/dist/components/ui/carousel/carousel.svelte +1 -0
- package/dist/components/ui/chart/chart-container.svelte +1 -1
- package/dist/components/ui/chart/chart-tooltip.svelte +1 -0
- package/dist/components/ui/checkbox/checkbox.svelte +5 -5
- package/dist/components/ui/command/command-dialog.svelte +12 -10
- package/dist/components/ui/command/command-dialog.svelte.d.ts +3 -1
- package/dist/components/ui/command/command-group.svelte +4 -1
- package/dist/components/ui/command/command-input.svelte +17 -13
- package/dist/components/ui/command/command-item.svelte +9 -3
- package/dist/components/ui/command/command-list.svelte +1 -1
- package/dist/components/ui/command/command-shortcut.svelte +4 -1
- package/dist/components/ui/command/command.svelte +1 -1
- package/dist/components/ui/context-menu/context-menu-checkbox-item.svelte +7 -4
- package/dist/components/ui/context-menu/context-menu-checkbox-item.svelte.d.ts +1 -0
- package/dist/components/ui/context-menu/context-menu-content.svelte +1 -1
- package/dist/components/ui/context-menu/context-menu-group-heading.svelte +1 -1
- package/dist/components/ui/context-menu/context-menu-item.svelte +1 -1
- package/dist/components/ui/context-menu/context-menu-label.svelte +1 -1
- package/dist/components/ui/context-menu/context-menu-radio-item.svelte +9 -5
- package/dist/components/ui/context-menu/context-menu-radio-item.svelte.d.ts +5 -1
- package/dist/components/ui/context-menu/context-menu-shortcut.svelte +4 -1
- package/dist/components/ui/context-menu/context-menu-sub-content.svelte +1 -1
- package/dist/components/ui/context-menu/context-menu-sub-trigger.svelte +3 -3
- package/dist/components/ui/context-menu/context-menu-trigger.svelte +8 -2
- package/dist/components/ui/dialog/dialog-close.svelte +2 -2
- package/dist/components/ui/dialog/dialog-content.svelte +10 -7
- package/dist/components/ui/dialog/dialog-description.svelte +4 -1
- package/dist/components/ui/dialog/dialog-footer.svelte +17 -2
- package/dist/components/ui/dialog/dialog-footer.svelte.d.ts +4 -1
- package/dist/components/ui/dialog/dialog-header.svelte +1 -6
- package/dist/components/ui/dialog/dialog-overlay.svelte +1 -1
- package/dist/components/ui/dialog/dialog-title.svelte +1 -1
- package/dist/components/ui/dialog/dialog-trigger.svelte +2 -2
- package/dist/components/ui/drawer/drawer-content.svelte +2 -6
- package/dist/components/ui/drawer/drawer-header.svelte +9 -1
- package/dist/components/ui/drawer/drawer-overlay.svelte +1 -1
- package/dist/components/ui/drawer/drawer-title.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +9 -6
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +3 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +7 -4
- package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +4 -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 +2 -2
- package/dist/components/ui/empty/empty-content.svelte +1 -1
- package/dist/components/ui/empty/empty-description.svelte +1 -1
- package/dist/components/ui/empty/empty-header.svelte +1 -1
- package/dist/components/ui/empty/empty-media.svelte +1 -1
- package/dist/components/ui/empty/empty-title.svelte +1 -1
- package/dist/components/ui/empty/empty.svelte +1 -1
- package/dist/components/ui/field/field-content.svelte +1 -1
- package/dist/components/ui/field/field-description.svelte +2 -2
- package/dist/components/ui/field/field-error.svelte +1 -1
- package/dist/components/ui/field/field-group.svelte +1 -1
- package/dist/components/ui/field/field-label.svelte +2 -3
- package/dist/components/ui/field/field-legend.svelte +1 -1
- package/dist/components/ui/field/field-separator.svelte +1 -1
- package/dist/components/ui/field/field-set.svelte +1 -2
- package/dist/components/ui/field/field-title.svelte +1 -1
- package/dist/components/ui/field/field.svelte +6 -12
- package/dist/components/ui/field/field.svelte.d.ts +8 -8
- package/dist/components/ui/hover-card/hover-card-content.svelte +1 -1
- package/dist/components/ui/input/input.svelte +2 -6
- package/dist/components/ui/input-group/input-group-addon.svelte +5 -5
- package/dist/components/ui/input-group/input-group-addon.svelte.d.ts +2 -2
- package/dist/components/ui/input-group/input-group-button.svelte +4 -4
- package/dist/components/ui/input-group/input-group-button.svelte.d.ts +2 -2
- package/dist/components/ui/input-group/input-group-input.svelte +1 -1
- package/dist/components/ui/input-group/input-group-textarea.svelte +1 -1
- package/dist/components/ui/input-group/input-group.svelte +1 -15
- package/dist/components/ui/input-otp/input-otp-group.svelte +9 -1
- package/dist/components/ui/input-otp/input-otp-separator.svelte +14 -2
- package/dist/components/ui/input-otp/input-otp-slot.svelte +3 -5
- package/dist/components/ui/input-otp/input-otp.svelte +5 -1
- package/dist/components/ui/item/item-content.svelte +4 -1
- package/dist/components/ui/item/item-description.svelte +1 -2
- package/dist/components/ui/item/item-group.svelte +4 -1
- package/dist/components/ui/item/item-media.svelte +4 -3
- package/dist/components/ui/item/item-media.svelte.d.ts +2 -2
- package/dist/components/ui/item/item-separator.svelte +1 -1
- package/dist/components/ui/item/item-title.svelte +4 -1
- package/dist/components/ui/item/item.svelte +6 -5
- package/dist/components/ui/item/item.svelte.d.ts +5 -2
- package/dist/components/ui/kbd/kbd.svelte +1 -3
- package/dist/components/ui/menubar/menubar-checkbox-item.svelte +13 -8
- package/dist/components/ui/menubar/menubar-checkbox-item.svelte.d.ts +1 -0
- package/dist/components/ui/menubar/menubar-content.svelte +2 -2
- package/dist/components/ui/menubar/menubar-item.svelte +1 -1
- package/dist/components/ui/menubar/menubar-label.svelte +1 -1
- package/dist/components/ui/menubar/menubar-radio-item.svelte +11 -5
- package/dist/components/ui/menubar/menubar-radio-item.svelte.d.ts +5 -1
- package/dist/components/ui/menubar/menubar-shortcut.svelte +4 -1
- package/dist/components/ui/menubar/menubar-sub-content.svelte +1 -1
- package/dist/components/ui/menubar/menubar-sub-trigger.svelte +3 -3
- package/dist/components/ui/menubar/menubar-trigger.svelte +1 -1
- package/dist/components/ui/menubar/menubar.svelte +1 -1
- package/dist/components/ui/native-select/native-select.svelte +15 -10
- package/dist/components/ui/native-select/native-select.svelte.d.ts +4 -1
- package/dist/components/ui/navigation-menu/navigation-menu-content.svelte +1 -2
- package/dist/components/ui/navigation-menu/navigation-menu-indicator.svelte +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu-item.svelte +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu-link.svelte +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu-list.svelte +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu-trigger.svelte +2 -4
- package/dist/components/ui/navigation-menu/navigation-menu-trigger.svelte.d.ts +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu-viewport.svelte +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.svelte +1 -2
- package/dist/components/ui/pagination/index.d.ts +4 -4
- package/dist/components/ui/pagination/index.js +4 -4
- package/dist/components/ui/pagination/pagination-content.svelte +1 -6
- package/dist/components/ui/pagination/pagination-ellipsis.svelte +7 -4
- package/dist/components/ui/pagination/pagination-ellipsis.svelte.d.ts +1 -1
- package/dist/components/ui/pagination/pagination-link.svelte +14 -15
- package/dist/components/ui/pagination/pagination-link.svelte.d.ts +3 -2
- package/dist/components/ui/pagination/pagination-next-button.svelte +9 -11
- package/dist/components/ui/pagination/pagination-next.svelte +10 -20
- package/dist/components/ui/pagination/pagination-next.svelte.d.ts +13 -2
- package/dist/components/ui/pagination/pagination-prev-button.svelte +9 -11
- package/dist/components/ui/pagination/pagination-previous.svelte +10 -20
- package/dist/components/ui/pagination/pagination-previous.svelte.d.ts +13 -2
- package/dist/components/ui/pagination/pagination.svelte +1 -1
- package/dist/components/ui/popover/index.d.ts +4 -1
- package/dist/components/ui/popover/index.js +5 -2
- package/dist/components/ui/popover/popover-content.svelte +1 -1
- package/dist/components/ui/popover/popover-description.svelte +15 -0
- package/dist/components/ui/popover/popover-description.svelte.d.ts +5 -0
- package/dist/components/ui/popover/popover-header.svelte +15 -0
- package/dist/components/ui/popover/popover-header.svelte.d.ts +5 -0
- package/dist/components/ui/popover/popover-title.svelte +15 -0
- package/dist/components/ui/popover/popover-title.svelte.d.ts +5 -0
- package/dist/components/ui/progress/progress.svelte +2 -2
- package/dist/components/ui/radio-group/radio-group-item.svelte +5 -3
- package/dist/components/ui/radio-group/radio-group.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-cell.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-day.svelte +4 -7
- package/dist/components/ui/range-calendar/range-calendar-month-select.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-next-button.svelte +7 -2
- package/dist/components/ui/range-calendar/range-calendar-prev-button.svelte +7 -2
- package/dist/components/ui/range-calendar/range-calendar-year-select.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar.svelte +1 -1
- package/dist/components/ui/resizable/resizable-handle.svelte +2 -5
- package/dist/components/ui/resizable/resizable-pane-group.svelte +2 -1
- package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte +2 -3
- package/dist/components/ui/scroll-area/scroll-area.svelte +1 -1
- package/dist/components/ui/select/select-content.svelte +2 -2
- package/dist/components/ui/select/select-group.svelte +3 -2
- package/dist/components/ui/select/select-item.svelte +3 -3
- package/dist/components/ui/select/select-label.svelte +1 -1
- package/dist/components/ui/select/select-scroll-down-button.svelte +6 -3
- package/dist/components/ui/select/select-scroll-up-button.svelte +6 -3
- package/dist/components/ui/select/select-trigger.svelte +3 -3
- package/dist/components/ui/separator/separator.svelte +3 -1
- package/dist/components/ui/sheet/sheet-content.svelte +20 -27
- package/dist/components/ui/sheet/sheet-content.svelte.d.ts +2 -24
- package/dist/components/ui/sheet/sheet-header.svelte +1 -1
- package/dist/components/ui/sheet/sheet-overlay.svelte +1 -4
- package/dist/components/ui/sheet/sheet-title.svelte +1 -1
- package/dist/components/ui/sidebar/sidebar-content.svelte +1 -1
- package/dist/components/ui/sidebar/sidebar-group-action.svelte +1 -4
- package/dist/components/ui/sidebar/sidebar-group-label.svelte +1 -2
- package/dist/components/ui/sidebar/sidebar-inset.svelte +1 -2
- package/dist/components/ui/sidebar/sidebar-menu-action.svelte +2 -8
- package/dist/components/ui/sidebar/sidebar-menu-badge.svelte +1 -6
- package/dist/components/ui/sidebar/sidebar-menu-button.svelte +2 -2
- package/dist/components/ui/sidebar/sidebar-menu-button.svelte.d.ts +2 -2
- package/dist/components/ui/sidebar/sidebar-menu-sub-button.svelte +1 -5
- package/dist/components/ui/sidebar/sidebar-menu-sub.svelte +1 -2
- package/dist/components/ui/sidebar/sidebar-menu.svelte +1 -1
- package/dist/components/ui/sidebar/sidebar-rail.svelte +4 -4
- package/dist/components/ui/sidebar/sidebar-separator.svelte +1 -1
- package/dist/components/ui/sidebar/sidebar-trigger.svelte +3 -3
- package/dist/components/ui/sidebar/sidebar.svelte +3 -3
- package/dist/components/ui/skeleton/skeleton.svelte +1 -1
- package/dist/components/ui/slider/slider.svelte +8 -8
- package/dist/components/ui/sonner/sonner.svelte +6 -6
- package/dist/components/ui/spinner/spinner.svelte +18 -4
- package/dist/components/ui/spinner/spinner.svelte.d.ts +2 -1
- package/dist/components/ui/switch/switch.svelte +7 -5
- package/dist/components/ui/switch/switch.svelte.d.ts +5 -1
- 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 -4
- package/dist/components/ui/tabs/index.d.ts +2 -2
- package/dist/components/ui/tabs/index.js +2 -2
- package/dist/components/ui/tabs/tabs-content.svelte +6 -1
- package/dist/components/ui/tabs/tabs-list.svelte +29 -5
- package/dist/components/ui/tabs/tabs-list.svelte.d.ts +22 -1
- package/dist/components/ui/tabs/tabs-trigger.svelte +4 -1
- package/dist/components/ui/tabs/tabs.svelte +7 -1
- package/dist/components/ui/textarea/textarea.svelte +1 -1
- package/dist/components/ui/toggle/toggle.svelte +5 -5
- package/dist/components/ui/toggle/toggle.svelte.d.ts +2 -2
- package/dist/components/ui/toggle-group/toggle-group-item.svelte +1 -1
- package/dist/components/ui/toggle-group/toggle-group.svelte +21 -5
- package/dist/components/ui/toggle-group/toggle-group.svelte.d.ts +2 -0
- package/dist/components/ui/tooltip/tooltip-content.svelte +6 -6
- package/dist/components/ui/tooltip/tooltip-provider.svelte +2 -2
- package/dist/components/ui/tooltip/tooltip.svelte +4 -1
- package/package.json +16 -16
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Checkbox as CheckboxPrimitive } from "bits-ui";
|
|
3
|
+
import { cn, type WithoutChildrenOrChild } from "../../../utils.js";
|
|
3
4
|
import CheckIcon from "@lucide/svelte/icons/check";
|
|
4
5
|
import MinusIcon from "@lucide/svelte/icons/minus";
|
|
5
|
-
import { cn, type WithoutChildrenOrChild } from "../../../utils.js";
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
ref = $bindable(null),
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
bind:ref
|
|
18
18
|
data-slot="checkbox"
|
|
19
19
|
class={cn(
|
|
20
|
-
"border-input dark:bg-input/30 data-
|
|
20
|
+
"border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",
|
|
21
21
|
className
|
|
22
22
|
)}
|
|
23
23
|
bind:checked
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
{...restProps}
|
|
26
26
|
>
|
|
27
27
|
{#snippet children({ checked, indeterminate })}
|
|
28
|
-
<div data-slot="checkbox-indicator" class="text-current transition-none">
|
|
28
|
+
<div data-slot="checkbox-indicator" class="grid place-content-center text-current transition-none [&>svg]:size-3.5">
|
|
29
29
|
{#if checked}
|
|
30
|
-
<CheckIcon
|
|
30
|
+
<CheckIcon />
|
|
31
31
|
{:else if indeterminate}
|
|
32
|
-
<MinusIcon
|
|
32
|
+
<MinusIcon />
|
|
33
33
|
{/if}
|
|
34
34
|
</div>
|
|
35
35
|
{/snippet}
|
|
@@ -3,16 +3,18 @@
|
|
|
3
3
|
import type { Snippet } from "svelte";
|
|
4
4
|
import Command from "./command.svelte";
|
|
5
5
|
import * as Dialog from "../dialog/index.js";
|
|
6
|
-
import type
|
|
6
|
+
import { cn, type WithoutChildrenOrChild } from "../../../utils.js";
|
|
7
7
|
|
|
8
8
|
let {
|
|
9
9
|
open = $bindable(false),
|
|
10
10
|
ref = $bindable(null),
|
|
11
11
|
value = $bindable(""),
|
|
12
12
|
title = "Command Palette",
|
|
13
|
-
description = "Search for a command to run",
|
|
13
|
+
description = "Search for a command to run...",
|
|
14
|
+
showCloseButton = false,
|
|
14
15
|
portalProps,
|
|
15
16
|
children,
|
|
17
|
+
class: className,
|
|
16
18
|
...restProps
|
|
17
19
|
}: WithoutChildrenOrChild<DialogPrimitive.RootProps> &
|
|
18
20
|
WithoutChildrenOrChild<CommandPrimitive.RootProps> & {
|
|
@@ -20,6 +22,8 @@
|
|
|
20
22
|
children: Snippet;
|
|
21
23
|
title?: string;
|
|
22
24
|
description?: string;
|
|
25
|
+
showCloseButton?: boolean;
|
|
26
|
+
class?: string;
|
|
23
27
|
} = $props();
|
|
24
28
|
</script>
|
|
25
29
|
|
|
@@ -28,13 +32,11 @@
|
|
|
28
32
|
<Dialog.Title>{title}</Dialog.Title>
|
|
29
33
|
<Dialog.Description>{description}</Dialog.Description>
|
|
30
34
|
</Dialog.Header>
|
|
31
|
-
<Dialog.Content
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{children}
|
|
38
|
-
/>
|
|
35
|
+
<Dialog.Content
|
|
36
|
+
class={cn("top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0", className)}
|
|
37
|
+
{showCloseButton}
|
|
38
|
+
{portalProps}
|
|
39
|
+
>
|
|
40
|
+
<Command {...restProps} bind:value bind:ref {children} />
|
|
39
41
|
</Dialog.Content>
|
|
40
42
|
</Dialog.Root>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { Command as CommandPrimitive, Dialog as DialogPrimitive } from "bits-ui";
|
|
2
2
|
import type { Snippet } from "svelte";
|
|
3
|
-
import type
|
|
3
|
+
import { type WithoutChildrenOrChild } from "../../../utils.js";
|
|
4
4
|
type $$ComponentProps = WithoutChildrenOrChild<DialogPrimitive.RootProps> & WithoutChildrenOrChild<CommandPrimitive.RootProps> & {
|
|
5
5
|
portalProps?: DialogPrimitive.PortalProps;
|
|
6
6
|
children: Snippet;
|
|
7
7
|
title?: string;
|
|
8
8
|
description?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
class?: string;
|
|
9
11
|
};
|
|
10
12
|
declare const CommandDialog: import("svelte").Component<$$ComponentProps, {}, "ref" | "value" | "open">;
|
|
11
13
|
type CommandDialog = ReturnType<typeof CommandDialog>;
|
|
@@ -17,7 +17,10 @@
|
|
|
17
17
|
<CommandPrimitive.Group
|
|
18
18
|
bind:ref
|
|
19
19
|
data-slot="command-group"
|
|
20
|
-
class={cn(
|
|
20
|
+
class={cn(
|
|
21
|
+
"text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
21
24
|
value={value ?? heading ?? `----${useId()}`}
|
|
22
25
|
{...restProps}
|
|
23
26
|
>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Command as CommandPrimitive } from "bits-ui";
|
|
3
|
-
import SearchIcon from "@lucide/svelte/icons/search";
|
|
4
3
|
import { cn } from "../../../utils.js";
|
|
4
|
+
import * as InputGroup from "../input-group/index.js";
|
|
5
|
+
import SearchIcon from "@lucide/svelte/icons/search";
|
|
5
6
|
|
|
6
7
|
let {
|
|
7
8
|
ref = $bindable(null),
|
|
@@ -11,16 +12,19 @@
|
|
|
11
12
|
}: CommandPrimitive.InputProps = $props();
|
|
12
13
|
</script>
|
|
13
14
|
|
|
14
|
-
<div
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
className
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
<div data-slot="command-input-wrapper" class="p-1 pb-0">
|
|
16
|
+
<InputGroup.Root
|
|
17
|
+
class="bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!"
|
|
18
|
+
>
|
|
19
|
+
<CommandPrimitive.Input
|
|
20
|
+
data-slot="command-input"
|
|
21
|
+
class={cn("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className)}
|
|
22
|
+
bind:ref
|
|
23
|
+
{...restProps}
|
|
24
|
+
bind:value
|
|
25
|
+
/>
|
|
26
|
+
<InputGroup.Addon>
|
|
27
|
+
<SearchIcon class="size-4 shrink-0 opacity-50" />
|
|
28
|
+
</InputGroup.Addon>
|
|
29
|
+
</InputGroup.Root>
|
|
26
30
|
</div>
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Command as CommandPrimitive } from "bits-ui";
|
|
3
3
|
import { cn } from "../../../utils.js";
|
|
4
|
+
import CheckIcon from "@lucide/svelte/icons/check";
|
|
4
5
|
|
|
5
|
-
let { ref = $bindable(null), class: className, ...restProps }: CommandPrimitive.ItemProps = $props();
|
|
6
|
+
let { ref = $bindable(null), class: className, children, ...restProps }: CommandPrimitive.ItemProps = $props();
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
9
|
<CommandPrimitive.Item
|
|
9
10
|
bind:ref
|
|
10
11
|
data-slot="command-item"
|
|
11
12
|
class={cn(
|
|
12
|
-
"
|
|
13
|
+
"group/command-item data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
13
14
|
className
|
|
14
15
|
)}
|
|
15
16
|
{...restProps}
|
|
16
|
-
|
|
17
|
+
>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
<CheckIcon
|
|
20
|
+
class="cn-command-item-indicator ml-auto opacity-0 group-has-[[data-slot=command-shortcut]]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"
|
|
21
|
+
/>
|
|
22
|
+
</CommandPrimitive.Item>
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
<CommandPrimitive.List
|
|
9
9
|
bind:ref
|
|
10
10
|
data-slot="command-list"
|
|
11
|
-
class={cn("max-h-
|
|
11
|
+
class={cn("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none", className)}
|
|
12
12
|
{...restProps}
|
|
13
13
|
/>
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
<span
|
|
14
14
|
bind:this={ref}
|
|
15
15
|
data-slot="command-shortcut"
|
|
16
|
-
class={cn(
|
|
16
|
+
class={cn(
|
|
17
|
+
"text-muted-foreground group-data-selected/command-item:text-foreground ml-auto text-xs tracking-widest",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
17
20
|
{...restProps}
|
|
18
21
|
>
|
|
19
22
|
{@render children?.()}
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
bind:value
|
|
21
21
|
bind:ref
|
|
22
22
|
data-slot="command"
|
|
23
|
-
class={cn("bg-popover text-popover-foreground flex
|
|
23
|
+
class={cn("bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-xl! p-1", className)}
|
|
24
24
|
{...restProps}
|
|
25
25
|
/>
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
|
|
3
|
-
import CheckIcon from "@lucide/svelte/icons/check";
|
|
4
3
|
import { cn, type WithoutChildrenOrChild } from "../../../utils.js";
|
|
5
4
|
import type { Snippet } from "svelte";
|
|
5
|
+
import CheckIcon from "@lucide/svelte/icons/check";
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
ref = $bindable(null),
|
|
9
9
|
checked = $bindable(false),
|
|
10
10
|
indeterminate = $bindable(false),
|
|
11
11
|
class: className,
|
|
12
|
+
inset,
|
|
12
13
|
children: childrenProp,
|
|
13
14
|
...restProps
|
|
14
15
|
}: WithoutChildrenOrChild<ContextMenuPrimitive.CheckboxItemProps> & {
|
|
16
|
+
inset?: boolean;
|
|
15
17
|
children?: Snippet;
|
|
16
18
|
} = $props();
|
|
17
19
|
</script>
|
|
@@ -21,16 +23,17 @@
|
|
|
21
23
|
bind:checked
|
|
22
24
|
bind:indeterminate
|
|
23
25
|
data-slot="context-menu-checkbox-item"
|
|
26
|
+
data-inset={inset}
|
|
24
27
|
class={cn(
|
|
25
|
-
"
|
|
28
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
26
29
|
className
|
|
27
30
|
)}
|
|
28
31
|
{...restProps}
|
|
29
32
|
>
|
|
30
33
|
{#snippet children({ checked })}
|
|
31
|
-
<span class="pointer-events-none absolute
|
|
34
|
+
<span class="pointer-events-none absolute right-2">
|
|
32
35
|
{#if checked}
|
|
33
|
-
<CheckIcon
|
|
36
|
+
<CheckIcon />
|
|
34
37
|
{/if}
|
|
35
38
|
</span>
|
|
36
39
|
{@render childrenProp?.()}
|
|
@@ -2,6 +2,7 @@ import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
|
|
|
2
2
|
import { type WithoutChildrenOrChild } from "../../../utils.js";
|
|
3
3
|
import type { Snippet } from "svelte";
|
|
4
4
|
type $$ComponentProps = WithoutChildrenOrChild<ContextMenuPrimitive.CheckboxItemProps> & {
|
|
5
|
+
inset?: boolean;
|
|
5
6
|
children?: Snippet;
|
|
6
7
|
};
|
|
7
8
|
declare const ContextMenuCheckboxItem: import("svelte").Component<$$ComponentProps, {}, "ref" | "checked" | "indeterminate">;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
bind:ref
|
|
21
21
|
data-slot="context-menu-content"
|
|
22
22
|
class={cn(
|
|
23
|
-
"
|
|
23
|
+
"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 z-50 min-w-36 overflow-x-hidden overflow-y-auto rounded-lg p-1 shadow-md ring-1 duration-100 outline-none",
|
|
24
24
|
className
|
|
25
25
|
)}
|
|
26
26
|
{...restProps}
|
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
bind:ref
|
|
17
17
|
data-slot="context-menu-group-heading"
|
|
18
18
|
data-inset={inset}
|
|
19
|
-
class={cn("text-foreground px-2 py-1.5 text-sm font-medium data-
|
|
19
|
+
class={cn("text-foreground px-2 py-1.5 text-sm font-medium data-inset:ps-8", className)}
|
|
20
20
|
{...restProps}
|
|
21
21
|
/>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
data-inset={inset}
|
|
21
21
|
data-variant={variant}
|
|
22
22
|
class={cn(
|
|
23
|
-
"
|
|
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 focus:*:[svg]:text-accent-foreground group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
24
24
|
className
|
|
25
25
|
)}
|
|
26
26
|
{...restProps}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
bind:this={ref}
|
|
18
18
|
data-slot="context-menu-label"
|
|
19
19
|
data-inset={inset}
|
|
20
|
-
class={cn("text-foreground px-
|
|
20
|
+
class={cn("text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:pl-7 data-inset:pl-8", className)}
|
|
21
21
|
{...restProps}
|
|
22
22
|
>
|
|
23
23
|
{@render children?.()}
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
|
|
3
|
-
import CircleIcon from "@lucide/svelte/icons/circle";
|
|
4
3
|
import { cn, type WithoutChild } from "../../../utils.js";
|
|
4
|
+
import CheckIcon from "@lucide/svelte/icons/check";
|
|
5
5
|
|
|
6
6
|
let {
|
|
7
7
|
ref = $bindable(null),
|
|
8
8
|
class: className,
|
|
9
|
+
inset,
|
|
9
10
|
children: childrenProp,
|
|
10
11
|
...restProps
|
|
11
|
-
}: WithoutChild<ContextMenuPrimitive.RadioItemProps>
|
|
12
|
+
}: WithoutChild<ContextMenuPrimitive.RadioItemProps> & {
|
|
13
|
+
inset?: boolean;
|
|
14
|
+
} = $props();
|
|
12
15
|
</script>
|
|
13
16
|
|
|
14
17
|
<ContextMenuPrimitive.RadioItem
|
|
15
18
|
bind:ref
|
|
16
19
|
data-slot="context-menu-radio-item"
|
|
20
|
+
data-inset={inset}
|
|
17
21
|
class={cn(
|
|
18
|
-
"
|
|
22
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
19
23
|
className
|
|
20
24
|
)}
|
|
21
25
|
{...restProps}
|
|
22
26
|
>
|
|
23
27
|
{#snippet children({ checked })}
|
|
24
|
-
<span class="pointer-events-none absolute
|
|
28
|
+
<span class="pointer-events-none absolute right-2">
|
|
25
29
|
{#if checked}
|
|
26
|
-
<
|
|
30
|
+
<CheckIcon />
|
|
27
31
|
{/if}
|
|
28
32
|
</span>
|
|
29
33
|
{@render childrenProp?.({ checked })}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
|
|
2
|
-
|
|
2
|
+
import { type WithoutChild } from "../../../utils.js";
|
|
3
|
+
type $$ComponentProps = WithoutChild<ContextMenuPrimitive.RadioItemProps> & {
|
|
4
|
+
inset?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const ContextMenuRadioItem: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
3
7
|
type ContextMenuRadioItem = ReturnType<typeof ContextMenuRadioItem>;
|
|
4
8
|
export default ContextMenuRadioItem;
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
<span
|
|
14
14
|
bind:this={ref}
|
|
15
15
|
data-slot="context-menu-shortcut"
|
|
16
|
-
class={cn(
|
|
16
|
+
class={cn(
|
|
17
|
+
"text-muted-foreground group-focus/context-menu-item:text-accent-foreground ml-auto text-xs tracking-widest",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
17
20
|
{...restProps}
|
|
18
21
|
>
|
|
19
22
|
{@render children?.()}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
bind:ref
|
|
10
10
|
data-slot="context-menu-sub-content"
|
|
11
11
|
class={cn(
|
|
12
|
-
"
|
|
12
|
+
"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 bg-popover text-popover-foreground min-w-32 rounded-lg border p-1 shadow-lg duration-100",
|
|
13
13
|
className
|
|
14
14
|
)}
|
|
15
15
|
{...restProps}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
|
|
3
|
-
import ChevronRightIcon from "@lucide/svelte/icons/chevron-right";
|
|
4
3
|
import { cn, type WithoutChild } from "../../../utils.js";
|
|
4
|
+
import ChevronRightIcon from "@lucide/svelte/icons/chevron-right";
|
|
5
5
|
|
|
6
6
|
let {
|
|
7
7
|
ref = $bindable(null),
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
data-slot="context-menu-sub-trigger"
|
|
20
20
|
data-inset={inset}
|
|
21
21
|
class={cn(
|
|
22
|
-
"
|
|
22
|
+
"focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-inset:ps-8 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
23
23
|
className
|
|
24
24
|
)}
|
|
25
25
|
{...restProps}
|
|
26
26
|
>
|
|
27
27
|
{@render children?.()}
|
|
28
|
-
<ChevronRightIcon class="
|
|
28
|
+
<ChevronRightIcon class="ml-auto" />
|
|
29
29
|
</ContextMenuPrimitive.SubTrigger>
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
3
4
|
|
|
4
|
-
let { ref = $bindable(null), ...restProps }: ContextMenuPrimitive.TriggerProps = $props();
|
|
5
|
+
let { ref = $bindable(null), class: className, ...restProps }: ContextMenuPrimitive.TriggerProps = $props();
|
|
5
6
|
</script>
|
|
6
7
|
|
|
7
|
-
<ContextMenuPrimitive.Trigger
|
|
8
|
+
<ContextMenuPrimitive.Trigger
|
|
9
|
+
bind:ref
|
|
10
|
+
data-slot="context-menu-trigger"
|
|
11
|
+
class={cn("cn-context-menu-trigger select-none", className)}
|
|
12
|
+
{...restProps}
|
|
13
|
+
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
3
|
|
|
4
|
-
let { ref = $bindable(null), ...restProps }: DialogPrimitive.CloseProps = $props();
|
|
4
|
+
let { ref = $bindable(null), type = "button", ...restProps }: DialogPrimitive.CloseProps = $props();
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
|
-
<DialogPrimitive.Close bind:ref data-slot="dialog-close" {...restProps} />
|
|
7
|
+
<DialogPrimitive.Close bind:ref data-slot="dialog-close" {type} {...restProps} />
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
3
|
import DialogPortal from "./dialog-portal.svelte";
|
|
4
|
-
import XIcon from "@lucide/svelte/icons/x";
|
|
5
4
|
import type { Snippet } from "svelte";
|
|
6
5
|
import * as Dialog from "./index.js";
|
|
7
6
|
import { cn, type WithoutChildrenOrChild } from "../../../utils.js";
|
|
8
7
|
import type { ComponentProps } from "svelte";
|
|
8
|
+
import { Button } from "../button/index.js";
|
|
9
|
+
import XIcon from "@lucide/svelte/icons/x";
|
|
9
10
|
|
|
10
11
|
let {
|
|
11
12
|
ref = $bindable(null),
|
|
@@ -27,18 +28,20 @@
|
|
|
27
28
|
bind:ref
|
|
28
29
|
data-slot="dialog-content"
|
|
29
30
|
class={cn(
|
|
30
|
-
"bg-background data-
|
|
31
|
+
"bg-background 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 ring-foreground/10 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl p-4 text-sm ring-1 duration-100 outline-none sm:max-w-sm",
|
|
31
32
|
className
|
|
32
33
|
)}
|
|
33
34
|
{...restProps}
|
|
34
35
|
>
|
|
35
36
|
{@render children?.()}
|
|
36
37
|
{#if showCloseButton}
|
|
37
|
-
<DialogPrimitive.Close
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
<DialogPrimitive.Close data-slot="dialog-close">
|
|
39
|
+
{#snippet child({ props })}
|
|
40
|
+
<Button variant="ghost" class="absolute top-2 right-2" size="icon-sm" {...props}>
|
|
41
|
+
<XIcon />
|
|
42
|
+
<span class="sr-only">Close</span>
|
|
43
|
+
</Button>
|
|
44
|
+
{/snippet}
|
|
42
45
|
</DialogPrimitive.Close>
|
|
43
46
|
{/if}
|
|
44
47
|
</DialogPrimitive.Content>
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
<DialogPrimitive.Description
|
|
9
9
|
bind:ref
|
|
10
10
|
data-slot="dialog-description"
|
|
11
|
-
class={cn(
|
|
11
|
+
class={cn(
|
|
12
|
+
"text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
12
15
|
{...restProps}
|
|
13
16
|
/>
|
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { cn, type WithElementRef } from "../../../utils.js";
|
|
3
3
|
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
5
|
+
import { Button } from "../button/index.js";
|
|
4
6
|
|
|
5
7
|
let {
|
|
6
8
|
ref = $bindable(null),
|
|
7
9
|
class: className,
|
|
8
10
|
children,
|
|
11
|
+
showCloseButton = false,
|
|
9
12
|
...restProps
|
|
10
|
-
}: WithElementRef<HTMLAttributes<HTMLDivElement>>
|
|
13
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
14
|
+
showCloseButton?: boolean;
|
|
15
|
+
} = $props();
|
|
11
16
|
</script>
|
|
12
17
|
|
|
13
18
|
<div
|
|
14
19
|
bind:this={ref}
|
|
15
20
|
data-slot="dialog-footer"
|
|
16
|
-
class={cn(
|
|
21
|
+
class={cn(
|
|
22
|
+
"bg-muted/50 -mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t p-4 sm:flex-row sm:justify-end",
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
17
25
|
{...restProps}
|
|
18
26
|
>
|
|
19
27
|
{@render children?.()}
|
|
28
|
+
{#if showCloseButton}
|
|
29
|
+
<DialogPrimitive.Close>
|
|
30
|
+
{#snippet child({ props })}
|
|
31
|
+
<Button variant="outline" {...props}>Close</Button>
|
|
32
|
+
{/snippet}
|
|
33
|
+
</DialogPrimitive.Close>
|
|
34
|
+
{/if}
|
|
20
35
|
</div>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type WithElementRef } from "../../../utils.js";
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
-
|
|
3
|
+
type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
4
|
+
showCloseButton?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const DialogFooter: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
4
7
|
type DialogFooter = ReturnType<typeof DialogFooter>;
|
|
5
8
|
export default DialogFooter;
|
|
@@ -10,11 +10,6 @@
|
|
|
10
10
|
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
|
-
<div
|
|
14
|
-
bind:this={ref}
|
|
15
|
-
data-slot="dialog-header"
|
|
16
|
-
class={cn("flex flex-col gap-2 text-center sm:text-start", className)}
|
|
17
|
-
{...restProps}
|
|
18
|
-
>
|
|
13
|
+
<div bind:this={ref} data-slot="dialog-header" class={cn("flex flex-col gap-2", className)} {...restProps}>
|
|
19
14
|
{@render children?.()}
|
|
20
15
|
</div>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
bind:ref
|
|
10
10
|
data-slot="dialog-overlay"
|
|
11
11
|
class={cn(
|
|
12
|
-
"data-
|
|
12
|
+
"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs",
|
|
13
13
|
className
|
|
14
14
|
)}
|
|
15
15
|
{...restProps}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
3
|
|
|
4
|
-
let { ref = $bindable(null), ...restProps }: DialogPrimitive.TriggerProps = $props();
|
|
4
|
+
let { ref = $bindable(null), type = "button", ...restProps }: DialogPrimitive.TriggerProps = $props();
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
|
-
<DialogPrimitive.Trigger bind:ref data-slot="dialog-trigger" {...restProps} />
|
|
7
|
+
<DialogPrimitive.Trigger bind:ref data-slot="dialog-trigger" {type} {...restProps} />
|
|
@@ -23,17 +23,13 @@
|
|
|
23
23
|
bind:ref
|
|
24
24
|
data-slot="drawer-content"
|
|
25
25
|
class={cn(
|
|
26
|
-
"group/drawer-content
|
|
27
|
-
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
|
|
28
|
-
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
|
|
29
|
-
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:end-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-s data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
30
|
-
"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:start-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-e data-[vaul-drawer-direction=left]:sm:max-w-sm",
|
|
26
|
+
"bg-background group/drawer-content fixed z-50 flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
31
27
|
className
|
|
32
28
|
)}
|
|
33
29
|
{...restProps}
|
|
34
30
|
>
|
|
35
31
|
<div
|
|
36
|
-
class="bg-muted mx-auto mt-4 hidden h-
|
|
32
|
+
class="bg-muted bg-muted mx-auto mt-4 hidden h-1 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"
|
|
37
33
|
></div>
|
|
38
34
|
{@render children?.()}
|
|
39
35
|
</DrawerPrimitive.Content>
|