@profidev/pleiades 1.7.1 → 1.8.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/form/form-dialog.svelte +1 -1
- package/dist/components/table/multiselect.svelte +2 -2
- package/dist/components/ui/command/command-input.svelte +6 -3
- package/dist/components/ui/field/field-label.svelte +1 -1
- package/dist/components/ui/field/field-title.svelte +1 -1
- package/dist/components/ui/native-select/native-select-option.svelte +8 -2
- package/dist/components/ui/native-select/native-select-option.svelte.d.ts +1 -1
- package/dist/components/ui/pagination/pagination-next.svelte +15 -9
- package/dist/components/ui/pagination/pagination-next.svelte.d.ts +2 -13
- package/dist/components/ui/pagination/pagination-previous.svelte +15 -9
- package/dist/components/ui/pagination/pagination-previous.svelte.d.ts +2 -13
- package/dist/components/ui/sidebar/constants.d.ts +1 -1
- package/dist/components/ui/sidebar/constants.js +1 -1
- package/dist/components/ui/slider/slider.svelte +1 -1
- package/dist/components/ui/tooltip/tooltip.svelte +1 -4
- package/dist/components/ui-extra/alert-dialog/alert-dialog-action.svelte +40 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-action.svelte.d.ts +10 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-cancel.svelte +31 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-cancel.svelte.d.ts +9 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-content.svelte +38 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-content.svelte.d.ts +11 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-description.svelte +20 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-description.svelte.d.ts +4 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-footer.svelte +23 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-footer.svelte.d.ts +5 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-header.svelte +23 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-header.svelte.d.ts +5 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-media.svelte +23 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-media.svelte.d.ts +5 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-overlay.svelte +20 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-overlay.svelte.d.ts +4 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-portal.svelte +7 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-portal.svelte.d.ts +3 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-title.svelte +20 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-title.svelte.d.ts +4 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-trigger.svelte +14 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog-trigger.svelte.d.ts +4 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog.svelte +10 -0
- package/dist/components/ui-extra/alert-dialog/alert-dialog.svelte.d.ts +3 -0
- package/dist/components/ui-extra/alert-dialog/index.d.ts +13 -0
- package/dist/components/ui-extra/alert-dialog/index.js +15 -0
- package/dist/components/ui-extra/button-group/button-group-separator.svelte +23 -0
- package/dist/components/ui-extra/button-group/button-group-separator.svelte.d.ts +13 -0
- package/dist/components/ui-extra/button-group/button-group-text.svelte +31 -0
- package/dist/components/ui-extra/button-group/button-group-text.svelte.d.ts +11 -0
- package/dist/components/ui-extra/button-group/button-group.svelte +48 -0
- package/dist/components/ui-extra/button-group/button-group.svelte.d.ts +26 -0
- package/dist/components/ui-extra/button-group/index.d.ts +4 -0
- package/dist/components/ui-extra/button-group/index.js +6 -0
- package/dist/components/ui-extra/confirm-delete-dialog/confirm-delete-dialog.svelte +131 -0
- package/dist/components/ui-extra/confirm-delete-dialog/confirm-delete-dialog.svelte.d.ts +35 -0
- package/dist/components/ui-extra/confirm-delete-dialog/index.d.ts +2 -0
- package/dist/components/ui-extra/confirm-delete-dialog/index.js +2 -0
- package/dist/components/ui-extra/copy-button/copy-button.svelte +12 -6
- package/dist/components/ui-extra/github-button/github-button.svelte +81 -0
- package/dist/components/ui-extra/github-button/github-button.svelte.d.ts +13 -0
- package/dist/components/ui-extra/github-button/index.d.ts +20 -0
- package/dist/components/ui-extra/github-button/index.js +27 -0
- package/dist/components/ui-extra/select/index.d.ts +12 -0
- package/dist/components/ui-extra/select/index.js +14 -0
- package/dist/components/ui-extra/select/select-content.svelte +45 -0
- package/dist/components/ui-extra/select/select-content.svelte.d.ts +11 -0
- package/dist/components/ui-extra/select/select-group-heading.svelte +21 -0
- package/dist/components/ui-extra/select/select-group-heading.svelte.d.ts +10 -0
- package/dist/components/ui-extra/select/select-group.svelte +17 -0
- package/dist/components/ui-extra/select/select-group.svelte.d.ts +4 -0
- package/dist/components/ui-extra/select/select-item.svelte +38 -0
- package/dist/components/ui-extra/select/select-item.svelte.d.ts +4 -0
- package/dist/components/ui-extra/select/select-label.svelte +20 -0
- package/dist/components/ui-extra/select/select-label.svelte.d.ts +6 -0
- package/dist/components/ui-extra/select/select-portal.svelte +7 -0
- package/dist/components/ui-extra/select/select-portal.svelte.d.ts +3 -0
- package/dist/components/ui-extra/select/select-scroll-down-button.svelte +23 -0
- package/dist/components/ui-extra/select/select-scroll-down-button.svelte.d.ts +4 -0
- package/dist/components/ui-extra/select/select-scroll-up-button.svelte +23 -0
- package/dist/components/ui-extra/select/select-scroll-up-button.svelte.d.ts +4 -0
- package/dist/components/ui-extra/select/select-separator.svelte +18 -0
- package/dist/components/ui-extra/select/select-separator.svelte.d.ts +4 -0
- package/dist/components/ui-extra/select/select-trigger.svelte +29 -0
- package/dist/components/ui-extra/select/select-trigger.svelte.d.ts +8 -0
- package/dist/components/ui-extra/select/select.svelte +11 -0
- package/dist/components/ui-extra/select/select.svelte.d.ts +3 -0
- package/dist/components/ui-extra/separator/index.d.ts +2 -0
- package/dist/components/ui-extra/separator/index.js +4 -0
- package/dist/components/ui-extra/separator/separator.svelte +23 -0
- package/dist/components/ui-extra/separator/separator.svelte.d.ts +4 -0
- package/dist/components/ui-extra/split-button/index.d.ts +14 -0
- package/dist/components/ui-extra/split-button/index.js +9 -0
- package/dist/components/ui-extra/split-button/split-button-action.svelte +41 -0
- package/dist/components/ui-extra/split-button/split-button-action.svelte.d.ts +9 -0
- package/dist/components/ui-extra/split-button/split-button-content.svelte +19 -0
- package/dist/components/ui-extra/split-button/split-button-content.svelte.d.ts +6 -0
- package/dist/components/ui-extra/split-button/split-button-select-action.svelte +54 -0
- package/dist/components/ui-extra/split-button/split-button-select-action.svelte.d.ts +6 -0
- package/dist/components/ui-extra/split-button/split-button-select-trigger.svelte +47 -0
- package/dist/components/ui-extra/split-button/split-button-select-trigger.svelte.d.ts +10 -0
- package/dist/components/ui-extra/split-button/split-button-select.svelte +31 -0
- package/dist/components/ui-extra/split-button/split-button-select.svelte.d.ts +6 -0
- package/dist/components/ui-extra/split-button/split-button.svelte +53 -0
- package/dist/components/ui-extra/split-button/split-button.svelte.d.ts +17 -0
- package/dist/components/ui-extra/split-button/split-button.svelte.js +82 -0
- package/dist/components/ui-extra/stepper/stepper-indicator.svelte +1 -0
- package/dist/components/ui-extra/stepper/stepper-trigger.svelte +1 -1
- package/package.json +49 -21
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../blocks/utils.js';
|
|
4
|
+
import type { ComponentProps } from 'svelte';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: ComponentProps<typeof SelectPrimitive.GroupHeading> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<SelectPrimitive.GroupHeading
|
|
15
|
+
bind:ref
|
|
16
|
+
data-slot="select-group-heading"
|
|
17
|
+
class={cn('text-muted-foreground px-2 py-1.5 text-xs', className)}
|
|
18
|
+
{...restProps}
|
|
19
|
+
>
|
|
20
|
+
{@render children?.()}
|
|
21
|
+
</SelectPrimitive.GroupHeading>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const SelectGroupHeading: import("svelte").Component<Omit<{}, "child" | "children"> & {
|
|
2
|
+
child?: import("svelte").Snippet<[{
|
|
3
|
+
props: Record<string, unknown>;
|
|
4
|
+
}]> | undefined;
|
|
5
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
6
|
+
style?: import("bits-ui").StyleProperties | string | null | undefined;
|
|
7
|
+
ref?: HTMLElement | null | undefined;
|
|
8
|
+
} & import("bits-ui").Without<import("bits-ui").BitsPrimitiveDivAttributes, import("bits-ui").ComboboxGroupHeadingPropsWithoutHTML>, {}, "ref">;
|
|
9
|
+
type SelectGroupHeading = ReturnType<typeof SelectGroupHeading>;
|
|
10
|
+
export default SelectGroupHeading;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../blocks/utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: SelectPrimitive.GroupProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<SelectPrimitive.Group
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="select-group"
|
|
15
|
+
class={cn('scroll-my-1 p-1', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn, type WithoutChild } from '../../../blocks/utils.js';
|
|
4
|
+
import CheckIcon from '@lucide/svelte/icons/check';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
value,
|
|
10
|
+
label,
|
|
11
|
+
children: childrenProp,
|
|
12
|
+
...restProps
|
|
13
|
+
}: WithoutChild<SelectPrimitive.ItemProps> = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<SelectPrimitive.Item
|
|
17
|
+
bind:ref
|
|
18
|
+
{value}
|
|
19
|
+
data-slot="select-item"
|
|
20
|
+
class={cn(
|
|
21
|
+
"focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground focus:bg-accent data-highlighted:bg-accent data-highlighted:text-accent-foreground focus:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...restProps}
|
|
25
|
+
>
|
|
26
|
+
{#snippet children({ selected, highlighted })}
|
|
27
|
+
<span class="absolute end-2 flex size-3.5 items-center justify-center">
|
|
28
|
+
{#if selected}
|
|
29
|
+
<CheckIcon class="cn-select-item-indicator-icon" />
|
|
30
|
+
{/if}
|
|
31
|
+
</span>
|
|
32
|
+
{#if childrenProp}
|
|
33
|
+
{@render childrenProp({ selected, highlighted })}
|
|
34
|
+
{:else}
|
|
35
|
+
{label || value}
|
|
36
|
+
{/if}
|
|
37
|
+
{/snippet}
|
|
38
|
+
</SelectPrimitive.Item>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from '../../../blocks/utils.js';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {} = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="select-label"
|
|
16
|
+
class={cn('text-muted-foreground px-2 py-1.5 text-xs', className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type WithElementRef } from '../../../blocks/utils.js';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLDivElement>> & {};
|
|
4
|
+
declare const SelectLabel: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
5
|
+
type SelectLabel = ReturnType<typeof SelectLabel>;
|
|
6
|
+
export default SelectLabel;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn, type WithoutChildrenOrChild } from '../../../blocks/utils.js';
|
|
4
|
+
import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithoutChildrenOrChild<SelectPrimitive.ScrollDownButtonProps> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<SelectPrimitive.ScrollDownButton
|
|
14
|
+
bind:ref
|
|
15
|
+
data-slot="select-scroll-down-button"
|
|
16
|
+
class={cn(
|
|
17
|
+
"bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
<ChevronDownIcon />
|
|
23
|
+
</SelectPrimitive.ScrollDownButton>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
2
|
+
declare const SelectScrollDownButton: import("svelte").Component<Omit<Omit<SelectPrimitive.ScrollDownButtonProps, "child">, "children">, {}, "ref">;
|
|
3
|
+
type SelectScrollDownButton = ReturnType<typeof SelectScrollDownButton>;
|
|
4
|
+
export default SelectScrollDownButton;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn, type WithoutChildrenOrChild } from '../../../blocks/utils.js';
|
|
4
|
+
import ChevronUpIcon from '@lucide/svelte/icons/chevron-up';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithoutChildrenOrChild<SelectPrimitive.ScrollUpButtonProps> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<SelectPrimitive.ScrollUpButton
|
|
14
|
+
bind:ref
|
|
15
|
+
data-slot="select-scroll-up-button"
|
|
16
|
+
class={cn(
|
|
17
|
+
"bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
<ChevronUpIcon />
|
|
23
|
+
</SelectPrimitive.ScrollUpButton>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
2
|
+
declare const SelectScrollUpButton: import("svelte").Component<Omit<Omit<SelectPrimitive.ScrollUpButtonProps, "child">, "children">, {}, "ref">;
|
|
3
|
+
type SelectScrollUpButton = ReturnType<typeof SelectScrollUpButton>;
|
|
4
|
+
export default SelectScrollUpButton;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Separator as SeparatorPrimitive } from 'bits-ui';
|
|
3
|
+
import { Separator } from '../separator/index.js';
|
|
4
|
+
import { cn } from '../../../blocks/utils.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
...restProps
|
|
10
|
+
}: SeparatorPrimitive.RootProps = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<Separator
|
|
14
|
+
bind:ref
|
|
15
|
+
data-slot="select-separator"
|
|
16
|
+
class={cn('bg-border pointer-events-none -mx-1 my-1 h-px', className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
/>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn, type WithoutChild } from '../../../blocks/utils.js';
|
|
4
|
+
import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
size = 'default',
|
|
11
|
+
...restProps
|
|
12
|
+
}: WithoutChild<SelectPrimitive.TriggerProps> & {
|
|
13
|
+
size?: 'sm' | 'default';
|
|
14
|
+
} = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<SelectPrimitive.Trigger
|
|
18
|
+
bind:ref
|
|
19
|
+
data-slot="select-trigger"
|
|
20
|
+
data-size={size}
|
|
21
|
+
class={cn(
|
|
22
|
+
"border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 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 flex w-fit items-center justify-between gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
{...restProps}
|
|
26
|
+
>
|
|
27
|
+
{@render children?.()}
|
|
28
|
+
<ChevronDownIcon class="text-muted-foreground pointer-events-none size-4" />
|
|
29
|
+
</SelectPrimitive.Trigger>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
2
|
+
import { type WithoutChild } from '../../../blocks/utils.js';
|
|
3
|
+
type $$ComponentProps = WithoutChild<SelectPrimitive.TriggerProps> & {
|
|
4
|
+
size?: 'sm' | 'default';
|
|
5
|
+
};
|
|
6
|
+
declare const SelectTrigger: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
|
+
type SelectTrigger = ReturnType<typeof SelectTrigger>;
|
|
8
|
+
export default SelectTrigger;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
open = $bindable(false),
|
|
6
|
+
value = $bindable(),
|
|
7
|
+
...restProps
|
|
8
|
+
}: SelectPrimitive.RootProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<SelectPrimitive.Root bind:open bind:value={value as never} {...restProps} />
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Separator as SeparatorPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../blocks/utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
'data-slot': dataSlot = 'separator',
|
|
9
|
+
...restProps
|
|
10
|
+
}: SeparatorPrimitive.RootProps = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<SeparatorPrimitive.Root
|
|
14
|
+
bind:ref
|
|
15
|
+
data-slot={dataSlot}
|
|
16
|
+
class={cn(
|
|
17
|
+
'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px',
|
|
18
|
+
// this is different in shadcn/ui but self-stretch breaks things for us
|
|
19
|
+
'data-[orientation=vertical]:h-full',
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
{...restProps}
|
|
23
|
+
/>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Root from './split-button.svelte';
|
|
2
|
+
import Action from './split-button-action.svelte';
|
|
3
|
+
import Select from './split-button-select.svelte';
|
|
4
|
+
import SelectTrigger from './split-button-select-trigger.svelte';
|
|
5
|
+
import SelectAction from './split-button-select-action.svelte';
|
|
6
|
+
import SelectContent from './split-button-content.svelte';
|
|
7
|
+
import { SelectGroup, SelectGroupHeading, SelectLabel, SelectSeparator } from '../select';
|
|
8
|
+
export type { SplitButtonProps, SplitButtonPropsWithoutHTML } from './split-button.svelte';
|
|
9
|
+
export type { SplitButtonActionProps } from './split-button-action.svelte';
|
|
10
|
+
export type { SplitButtonSelectProps } from './split-button-select.svelte';
|
|
11
|
+
export type { SplitButtonSelectTriggerProps } from './split-button-select-trigger.svelte';
|
|
12
|
+
export type { SplitButtonSelectActionProps } from './split-button-select-action.svelte';
|
|
13
|
+
export type { SplitButtonClickEvent } from './split-button.svelte.js';
|
|
14
|
+
export { Root, Action, Select, SelectTrigger, SelectContent, SelectAction, SelectGroup, SelectGroupHeading, SelectLabel, SelectSeparator };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Root from './split-button.svelte';
|
|
2
|
+
import Action from './split-button-action.svelte';
|
|
3
|
+
import Select from './split-button-select.svelte';
|
|
4
|
+
import SelectTrigger from './split-button-select-trigger.svelte';
|
|
5
|
+
import SelectAction from './split-button-select-action.svelte';
|
|
6
|
+
import SelectContent from './split-button-content.svelte';
|
|
7
|
+
// re-export select components
|
|
8
|
+
import { SelectGroup, SelectGroupHeading, SelectLabel, SelectSeparator } from '../select';
|
|
9
|
+
export { Root, Action, Select, SelectTrigger, SelectContent, SelectAction, SelectGroup, SelectGroupHeading, SelectLabel, SelectSeparator };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { WithoutChildren } from 'bits-ui';
|
|
3
|
+
|
|
4
|
+
export type SplitButtonActionProps = WithoutChildren<ButtonProps> & {
|
|
5
|
+
value: string;
|
|
6
|
+
children?: import('svelte').Snippet;
|
|
7
|
+
};
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import Button, { type ButtonProps } from '../../../blocks/button.svelte';
|
|
12
|
+
import { useSplitButtonAction } from './split-button.svelte.js';
|
|
13
|
+
import { box } from 'svelte-toolbelt';
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
ref = $bindable(null),
|
|
17
|
+
value,
|
|
18
|
+
onclick,
|
|
19
|
+
disabled,
|
|
20
|
+
loading,
|
|
21
|
+
children,
|
|
22
|
+
...rest
|
|
23
|
+
}: SplitButtonActionProps = $props();
|
|
24
|
+
|
|
25
|
+
const state = useSplitButtonAction({
|
|
26
|
+
value: box.with(() => value),
|
|
27
|
+
onclick: box.with(() => onclick)
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
{#if state.isActive}
|
|
32
|
+
<Button
|
|
33
|
+
bind:ref
|
|
34
|
+
disabled={disabled || state.rootState.disabled}
|
|
35
|
+
loading={loading || state.rootState.loading}
|
|
36
|
+
onclick={(e) => state.onclick(e)}
|
|
37
|
+
{...rest}
|
|
38
|
+
>
|
|
39
|
+
{@render children?.()}
|
|
40
|
+
</Button>
|
|
41
|
+
{/if}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WithoutChildren } from 'bits-ui';
|
|
2
|
+
export type SplitButtonActionProps = WithoutChildren<ButtonProps> & {
|
|
3
|
+
value: string;
|
|
4
|
+
children?: import('svelte').Snippet;
|
|
5
|
+
};
|
|
6
|
+
import { type ButtonProps } from '../../../blocks/button.svelte';
|
|
7
|
+
declare const SplitButtonAction: import("svelte").Component<SplitButtonActionProps, {}, "ref">;
|
|
8
|
+
type SplitButtonAction = ReturnType<typeof SplitButtonAction>;
|
|
9
|
+
export default SplitButtonAction;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { SelectContent } from '../select';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
align = 'end',
|
|
7
|
+
children,
|
|
8
|
+
...restProps
|
|
9
|
+
}: ComponentProps<typeof SelectContent> = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<SelectContent
|
|
13
|
+
data-slot="split-button-content"
|
|
14
|
+
{align}
|
|
15
|
+
class="p-2"
|
|
16
|
+
{...restProps}
|
|
17
|
+
>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
</SelectContent>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentProps } from 'svelte';
|
|
2
|
+
declare const SplitButtonContent: import("svelte").Component<Omit<import("bits-ui").ComboboxContentProps, "child"> & {
|
|
3
|
+
portalProps?: import("../../../blocks/utils").WithoutChildrenOrChild<ComponentProps<typeof import("../select").Portal>>;
|
|
4
|
+
}, {}, "">;
|
|
5
|
+
type SplitButtonContent = ReturnType<typeof SplitButtonContent>;
|
|
6
|
+
export default SplitButtonContent;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Select as SelectPrimitiveNs } from 'bits-ui';
|
|
3
|
+
import type { WithoutChild } from '../../../blocks/utils.js';
|
|
4
|
+
|
|
5
|
+
export type SplitButtonSelectActionProps =
|
|
6
|
+
WithoutChild<SelectPrimitiveNs.ItemProps>;
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
11
|
+
import { cn } from '../../../blocks/utils.js';
|
|
12
|
+
import { useSplitButtonSelectAction } from './split-button.svelte.js';
|
|
13
|
+
import { box } from 'svelte-toolbelt';
|
|
14
|
+
import CheckIcon from '@lucide/svelte/icons/check';
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
ref = $bindable(null),
|
|
18
|
+
class: className,
|
|
19
|
+
value,
|
|
20
|
+
label,
|
|
21
|
+
children: childrenProp,
|
|
22
|
+
...restProps
|
|
23
|
+
}: SplitButtonSelectActionProps = $props();
|
|
24
|
+
|
|
25
|
+
useSplitButtonSelectAction({
|
|
26
|
+
value: box.with(() => value)
|
|
27
|
+
});
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<SelectPrimitive.Item
|
|
31
|
+
bind:ref
|
|
32
|
+
{value}
|
|
33
|
+
data-slot="split-button-select-action"
|
|
34
|
+
class={cn(
|
|
35
|
+
"focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-highlighted:bg-accent data-highlighted:text-accent-foreground relative flex w-full cursor-default items-start gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
36
|
+
className
|
|
37
|
+
)}
|
|
38
|
+
{...restProps}
|
|
39
|
+
>
|
|
40
|
+
{#snippet children({ selected, highlighted })}
|
|
41
|
+
<span
|
|
42
|
+
class="absolute end-2 top-2 flex size-3.5 items-center justify-center"
|
|
43
|
+
>
|
|
44
|
+
{#if selected}
|
|
45
|
+
<CheckIcon />
|
|
46
|
+
{/if}
|
|
47
|
+
</span>
|
|
48
|
+
{#if childrenProp}
|
|
49
|
+
{@render childrenProp({ selected, highlighted })}
|
|
50
|
+
{:else}
|
|
51
|
+
{label || value}
|
|
52
|
+
{/if}
|
|
53
|
+
{/snippet}
|
|
54
|
+
</SelectPrimitive.Item>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Select as SelectPrimitiveNs } from 'bits-ui';
|
|
2
|
+
import type { WithoutChild } from '../../../blocks/utils.js';
|
|
3
|
+
export type SplitButtonSelectActionProps = WithoutChild<SelectPrimitiveNs.ItemProps>;
|
|
4
|
+
declare const SplitButtonSelectAction: import("svelte").Component<Omit<SelectPrimitiveNs.ItemProps, "child">, {}, "ref">;
|
|
5
|
+
type SplitButtonSelectAction = ReturnType<typeof SplitButtonSelectAction>;
|
|
6
|
+
export default SplitButtonSelectAction;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { WithoutChild } from '../../../blocks/utils.js';
|
|
3
|
+
import type {
|
|
4
|
+
ButtonSize,
|
|
5
|
+
ButtonVariant
|
|
6
|
+
} from '../button';
|
|
7
|
+
|
|
8
|
+
export type SplitButtonSelectTriggerProps =
|
|
9
|
+
WithoutChild<SelectPrimitive.TriggerProps> & {
|
|
10
|
+
variant?: ButtonVariant;
|
|
11
|
+
size?: ButtonSize;
|
|
12
|
+
};
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
17
|
+
import { cn } from '../../../blocks/utils.js';
|
|
18
|
+
import { buttonVariants } from '../button';
|
|
19
|
+
import { useSplitButtonRootCtx } from './split-button.svelte.js';
|
|
20
|
+
import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
|
|
21
|
+
|
|
22
|
+
let {
|
|
23
|
+
ref = $bindable(null),
|
|
24
|
+
class: className,
|
|
25
|
+
variant = 'default',
|
|
26
|
+
size = 'icon',
|
|
27
|
+
disabled,
|
|
28
|
+
children,
|
|
29
|
+
...restProps
|
|
30
|
+
}: SplitButtonSelectTriggerProps = $props();
|
|
31
|
+
|
|
32
|
+
const root = useSplitButtonRootCtx();
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<SelectPrimitive.Trigger
|
|
36
|
+
bind:ref
|
|
37
|
+
data-slot="split-button-select-trigger"
|
|
38
|
+
disabled={disabled || root.disabled}
|
|
39
|
+
class={cn(buttonVariants({ variant, size }), className)}
|
|
40
|
+
{...restProps}
|
|
41
|
+
>
|
|
42
|
+
{#if children}
|
|
43
|
+
{@render children()}
|
|
44
|
+
{:else}
|
|
45
|
+
<ChevronDownIcon />
|
|
46
|
+
{/if}
|
|
47
|
+
</SelectPrimitive.Trigger>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WithoutChild } from '../../../blocks/utils.js';
|
|
2
|
+
import type { ButtonSize, ButtonVariant } from '../button';
|
|
3
|
+
export type SplitButtonSelectTriggerProps = WithoutChild<SelectPrimitive.TriggerProps> & {
|
|
4
|
+
variant?: ButtonVariant;
|
|
5
|
+
size?: ButtonSize;
|
|
6
|
+
};
|
|
7
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
8
|
+
declare const SplitButtonSelectTrigger: import("svelte").Component<SplitButtonSelectTriggerProps, {}, "ref">;
|
|
9
|
+
type SplitButtonSelectTrigger = ReturnType<typeof SplitButtonSelectTrigger>;
|
|
10
|
+
export default SplitButtonSelectTrigger;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { WithoutChild } from '../../../blocks/utils.js';
|
|
3
|
+
|
|
4
|
+
export type SplitButtonSelectProps = Omit<
|
|
5
|
+
WithoutChild<SelectPrimitive.RootProps>,
|
|
6
|
+
'type' | 'value' | 'onValueChange'
|
|
7
|
+
>;
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
12
|
+
import { useSplitButtonRootCtx } from './split-button.svelte.js';
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
open = $bindable(false),
|
|
16
|
+
children,
|
|
17
|
+
...restProps
|
|
18
|
+
}: SplitButtonSelectProps = $props();
|
|
19
|
+
|
|
20
|
+
const root = useSplitButtonRootCtx();
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<SelectPrimitive.Root
|
|
24
|
+
type="single"
|
|
25
|
+
bind:open
|
|
26
|
+
bind:value={root.action}
|
|
27
|
+
onValueChange={(v) => root.onSelect(v)}
|
|
28
|
+
{...restProps}
|
|
29
|
+
>
|
|
30
|
+
{@render children?.()}
|
|
31
|
+
</SelectPrimitive.Root>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { WithoutChild } from '../../../blocks/utils.js';
|
|
2
|
+
export type SplitButtonSelectProps = Omit<WithoutChild<SelectPrimitive.RootProps>, 'type' | 'value' | 'onValueChange'>;
|
|
3
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
4
|
+
declare const SplitButtonSelect: import("svelte").Component<SplitButtonSelectProps, {}, "open">;
|
|
5
|
+
type SplitButtonSelect = ReturnType<typeof SplitButtonSelect>;
|
|
6
|
+
export default SplitButtonSelect;
|