@webamoki/web-svelte 0.7.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -3
- package/dist/components/form/Button.svelte +24 -23
- package/dist/components/form/Button.svelte.d.ts +2 -2
- package/dist/components/form/Errors.svelte +13 -13
- package/dist/components/form/FieldWrapper.svelte +57 -55
- package/dist/components/form/FieldWrapper.svelte.d.ts +4 -4
- package/dist/components/form/Form.svelte +18 -14
- package/dist/components/form/Form.svelte.d.ts +31 -22
- package/dist/components/form/IconInputWrapper.svelte +30 -29
- package/dist/components/form/IconInputWrapper.svelte.d.ts +7 -7
- package/dist/components/form/fields/ChoiceField.svelte +45 -43
- package/dist/components/form/fields/ChoiceField.svelte.d.ts +28 -23
- package/dist/components/form/fields/ChoiceMultiField.svelte +44 -42
- package/dist/components/form/fields/ChoiceMultiField.svelte.d.ts +28 -23
- package/dist/components/form/fields/DateField.svelte +42 -40
- package/dist/components/form/fields/DateField.svelte.d.ts +29 -22
- package/dist/components/form/fields/HexColorField.svelte +21 -19
- package/dist/components/form/fields/HexColorField.svelte.d.ts +24 -19
- package/dist/components/form/fields/MessageField.svelte +39 -60
- package/dist/components/form/fields/MessageField.svelte.d.ts +33 -24
- package/dist/components/form/fields/NumberField.svelte +38 -36
- package/dist/components/form/fields/NumberField.svelte.d.ts +32 -23
- package/dist/components/form/fields/PasswordField.svelte +45 -39
- package/dist/components/form/fields/PasswordField.svelte.d.ts +28 -21
- package/dist/components/form/fields/SelectField.svelte +84 -79
- package/dist/components/form/fields/SelectField.svelte.d.ts +39 -26
- package/dist/components/form/fields/SelectMultiField.svelte +90 -85
- package/dist/components/form/fields/SelectMultiField.svelte.d.ts +38 -25
- package/dist/components/form/fields/TextField.svelte +31 -29
- package/dist/components/form/fields/TextField.svelte.d.ts +32 -23
- package/dist/components/form/fields/TextFieldNullable.svelte +49 -47
- package/dist/components/form/fields/TextFieldNullable.svelte.d.ts +32 -23
- package/dist/components/form/fields/TimeField.svelte +66 -64
- package/dist/components/form/fields/TimeField.svelte.d.ts +33 -24
- package/dist/components/form/fields/WeekdayChoiceField.svelte +37 -35
- package/dist/components/form/fields/WeekdayChoiceField.svelte.d.ts +27 -22
- package/dist/components/form/fields/WeekdayChoiceMultiField.svelte +37 -35
- package/dist/components/form/fields/WeekdayChoiceMultiField.svelte.d.ts +27 -22
- package/dist/components/showcase/CodeBlock.svelte +41 -41
- package/dist/components/showcase/Container.svelte +7 -7
- package/dist/components/showcase/Preview.svelte +4 -4
- package/dist/components/showcase/Sidebar.svelte +4 -4
- package/dist/components/showcase/SidebarLink.svelte +3 -3
- package/dist/components/ui/choice/Choice.svelte +25 -22
- package/dist/components/ui/choice/Choice.svelte.d.ts +7 -7
- package/dist/components/ui/choice/ChoiceInternal.svelte +73 -69
- package/dist/components/ui/choice/ChoiceInternal.svelte.d.ts +9 -9
- package/dist/components/ui/choice/ChoiceMulti.svelte +59 -53
- package/dist/components/ui/choice/ChoiceMulti.svelte.d.ts +7 -7
- package/dist/components/ui/choice/WeekdayChoice.svelte +22 -21
- package/dist/components/ui/choice/WeekdayChoice.svelte.d.ts +6 -6
- package/dist/components/ui/choice/WeekdayChoiceMulti.svelte +24 -22
- package/dist/components/ui/choice/WeekdayChoiceMulti.svelte.d.ts +6 -6
- package/dist/components/ui/context-menu/ContextMenu.svelte +51 -50
- package/dist/components/ui/context-menu/ContextMenu.svelte.d.ts +1 -1
- package/dist/components/ui/context-menu/ContextMenuContent.svelte +92 -91
- package/dist/components/ui/context-menu/ContextMenuItem.svelte +26 -25
- package/dist/components/ui/context-menu/ContextMenuItem.svelte.d.ts +1 -1
- package/dist/components/ui/context-menu/ContextMenuTrigger.svelte +16 -15
- package/dist/components/ui/context-menu/context-menu-state.svelte.d.ts +3 -3
- package/dist/components/ui/context-menu/context-menu-state.svelte.js +15 -15
- package/dist/components/ui/drag-drop/Draggable.svelte +73 -72
- package/dist/components/ui/drag-drop/Draggable.svelte.d.ts +2 -2
- package/dist/components/ui/drag-drop/Dropzone.svelte +56 -54
- package/dist/components/ui/drag-drop/Dropzone.svelte.d.ts +3 -3
- package/dist/components/ui/drag-drop/drag-manager.d.ts +2 -2
- package/dist/components/ui/drag-drop/drag-manager.js +9 -9
- package/dist/components/ui/index.d.ts +2 -2
- package/dist/components/ui/index.js +5 -5
- package/dist/components/ui/search/SearchBar.svelte +18 -18
- package/dist/components/ui/search/SearchBar.svelte.d.ts +2 -2
- package/dist/highlight.js +2 -2
- package/dist/server/form-handler.d.ts +12 -12
- package/dist/server/form-handler.js +17 -17
- package/dist/server/form-processor.d.ts +1 -1
- package/dist/server/form-processor.js +0 -1
- package/dist/shadcn/components/ui/button/button.svelte +72 -71
- package/dist/shadcn/components/ui/button/button.svelte.d.ts +23 -23
- package/dist/shadcn/components/ui/button/index.d.ts +1 -1
- package/dist/shadcn/components/ui/button/index.js +2 -2
- package/dist/shadcn/components/ui/input/index.d.ts +1 -1
- package/dist/shadcn/components/ui/input/index.js +2 -2
- package/dist/shadcn/components/ui/input/input.svelte +35 -32
- package/dist/shadcn/components/ui/input/input.svelte.d.ts +2 -2
- package/dist/shadcn/components/ui/select/index.d.ts +6 -6
- package/dist/shadcn/components/ui/select/index.js +7 -7
- package/dist/shadcn/components/ui/select/select-content.svelte +35 -34
- package/dist/shadcn/components/ui/select/select-content.svelte.d.ts +1 -1
- package/dist/shadcn/components/ui/select/select-group-heading.svelte +15 -14
- package/dist/shadcn/components/ui/select/select-group.svelte +2 -2
- package/dist/shadcn/components/ui/select/select-item.svelte +31 -31
- package/dist/shadcn/components/ui/select/select-label.svelte +14 -13
- package/dist/shadcn/components/ui/select/select-label.svelte.d.ts +1 -1
- package/dist/shadcn/components/ui/select/select-scroll-down-button.svelte +13 -13
- package/dist/shadcn/components/ui/select/select-scroll-up-button.svelte +13 -13
- package/dist/shadcn/components/ui/select/select-separator.svelte +13 -12
- package/dist/shadcn/components/ui/select/select-trigger.svelte +26 -26
- package/dist/shadcn/components/ui/select/select-trigger.svelte.d.ts +2 -2
- package/dist/shadcn/components/ui/separator/separator.svelte +14 -14
- package/dist/shadcn/components/ui/textarea/textarea.svelte +22 -21
- package/dist/shadcn/components/ui/textarea/textarea.svelte.d.ts +1 -1
- package/dist/shadcn/utils.d.ts +4 -4
- package/dist/utils/datetime/index.d.ts +68 -68
- package/dist/utils/datetime/index.js +124 -124
- package/dist/utils/email/README.md +60 -60
- package/dist/utils/email/aws-signer.d.ts +1 -1
- package/dist/utils/email/aws-signer.js +39 -39
- package/dist/utils/email/ses.d.ts +8 -10
- package/dist/utils/email/ses.js +15 -23
- package/dist/utils/form/index.d.ts +11 -11
- package/dist/utils/form/index.js +23 -24
- package/dist/utils/form/virtual-form.d.ts +5 -5
- package/dist/utils/form/virtual-form.js +58 -58
- package/dist/utils/search.d.ts +1 -1
- package/dist/utils/search.js +22 -22
- package/dist/utils/types/arktype.d.ts +2 -2
- package/dist/utils/types/arktype.js +3 -3
- package/dist/utils/types/db.d.ts +2 -1
- package/dist/utils/types/db.js +7 -7
- package/package.json +69 -54
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import Root from './input.svelte';
|
|
2
|
-
export { Root
|
|
2
|
+
export { Root as Input, Root };
|
|
@@ -1,41 +1,44 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
-
type InputType = Exclude<HTMLInputTypeAttribute, 'file'>;
|
|
2
|
+
import type { HTMLInputAttributes, HTMLInputTypeAttribute } from 'svelte/elements';
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
({ type: 'file'; files?: FileList } | { type?: InputType; files?: undefined })
|
|
9
|
-
>;
|
|
4
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
5
|
+
type InputType = Exclude<HTMLInputTypeAttribute, 'file'>;
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
files = $bindable(),
|
|
16
|
-
class: className,
|
|
17
|
-
...restProps
|
|
18
|
-
}: Props = $props();
|
|
7
|
+
type Props = WithElementRef<
|
|
8
|
+
Omit<HTMLInputAttributes, 'type'> &
|
|
9
|
+
({ files?: FileList; type: 'file' } | { files?: undefined; type?: InputType })
|
|
10
|
+
>;
|
|
19
11
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
let {
|
|
13
|
+
class: className,
|
|
14
|
+
files = $bindable(),
|
|
15
|
+
ref = $bindable(null),
|
|
16
|
+
type,
|
|
17
|
+
value = $bindable(),
|
|
18
|
+
...restProps
|
|
19
|
+
}: Props = $props();
|
|
20
|
+
|
|
21
|
+
let inputClasses = $derived(
|
|
22
|
+
cn(
|
|
23
|
+
'w-full rounded-lg border border-gray-300 px-4 py-3 transition-all outline-none',
|
|
24
|
+
'focus:border-transparent focus:ring-2 focus:ring-primary',
|
|
25
|
+
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
26
|
+
'aria-invalid:border-red-500 aria-invalid:focus:ring-red-300',
|
|
27
|
+
className
|
|
28
|
+
)
|
|
29
|
+
);
|
|
27
30
|
</script>
|
|
28
31
|
|
|
29
32
|
{#if type === 'file'}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
<input
|
|
34
|
+
bind:this={ref}
|
|
35
|
+
class={inputClasses}
|
|
36
|
+
data-slot="input"
|
|
37
|
+
type="file"
|
|
38
|
+
bind:files
|
|
39
|
+
bind:value
|
|
40
|
+
{...restProps}
|
|
41
|
+
/>
|
|
39
42
|
{:else}
|
|
40
|
-
|
|
43
|
+
<input bind:this={ref} class={inputClasses} data-slot="input" {type} bind:value {...restProps} />
|
|
41
44
|
{/if}
|
|
@@ -2,11 +2,11 @@ import type { HTMLInputAttributes, HTMLInputTypeAttribute } from 'svelte/element
|
|
|
2
2
|
import { type WithElementRef } from '../../../utils.js';
|
|
3
3
|
type InputType = Exclude<HTMLInputTypeAttribute, 'file'>;
|
|
4
4
|
type Props = WithElementRef<Omit<HTMLInputAttributes, 'type'> & ({
|
|
5
|
-
type: 'file';
|
|
6
5
|
files?: FileList;
|
|
6
|
+
type: 'file';
|
|
7
7
|
} | {
|
|
8
|
-
type?: InputType;
|
|
9
8
|
files?: undefined;
|
|
9
|
+
type?: InputType;
|
|
10
10
|
})>;
|
|
11
11
|
declare const Input: import("svelte").Component<Props, {}, "ref" | "value" | "files">;
|
|
12
12
|
type Input = ReturnType<typeof Input>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import Content from './select-content.svelte';
|
|
2
|
+
import GroupHeading from './select-group-heading.svelte';
|
|
1
3
|
import Group from './select-group.svelte';
|
|
2
|
-
import Label from './select-label.svelte';
|
|
3
4
|
import Item from './select-item.svelte';
|
|
4
|
-
import
|
|
5
|
-
import Trigger from './select-trigger.svelte';
|
|
6
|
-
import Separator from './select-separator.svelte';
|
|
5
|
+
import Label from './select-label.svelte';
|
|
7
6
|
import ScrollDownButton from './select-scroll-down-button.svelte';
|
|
8
7
|
import ScrollUpButton from './select-scroll-up-button.svelte';
|
|
9
|
-
import
|
|
8
|
+
import Separator from './select-separator.svelte';
|
|
9
|
+
import Trigger from './select-trigger.svelte';
|
|
10
10
|
declare const Root: import("svelte").Component<import("bits-ui").SelectRootPropsWithoutHTML, {}, "value" | "open">;
|
|
11
|
-
export {
|
|
11
|
+
export { Content, Group, GroupHeading, Item, Label, Root, ScrollDownButton, ScrollUpButton, Root as Select, Content as SelectContent, Group as SelectGroup, GroupHeading as SelectGroupHeading, Item as SelectItem, Label as SelectLabel, ScrollDownButton as SelectScrollDownButton, ScrollUpButton as SelectScrollUpButton, Separator as SelectSeparator, Trigger as SelectTrigger, Separator, Trigger };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Select as SelectPrimitive } from 'bits-ui';
|
|
2
|
+
import Content from './select-content.svelte';
|
|
3
|
+
import GroupHeading from './select-group-heading.svelte';
|
|
2
4
|
import Group from './select-group.svelte';
|
|
3
|
-
import Label from './select-label.svelte';
|
|
4
5
|
import Item from './select-item.svelte';
|
|
5
|
-
import
|
|
6
|
-
import Trigger from './select-trigger.svelte';
|
|
7
|
-
import Separator from './select-separator.svelte';
|
|
6
|
+
import Label from './select-label.svelte';
|
|
8
7
|
import ScrollDownButton from './select-scroll-down-button.svelte';
|
|
9
8
|
import ScrollUpButton from './select-scroll-up-button.svelte';
|
|
10
|
-
import
|
|
9
|
+
import Separator from './select-separator.svelte';
|
|
10
|
+
import Trigger from './select-trigger.svelte';
|
|
11
11
|
const Root = SelectPrimitive.Root;
|
|
12
|
-
export {
|
|
12
|
+
export { Content, Group, GroupHeading, Item, Label, Root, ScrollDownButton, ScrollUpButton,
|
|
13
13
|
//
|
|
14
|
-
Root as Select, Group as SelectGroup,
|
|
14
|
+
Root as Select, Content as SelectContent, Group as SelectGroup, GroupHeading as SelectGroupHeading, Item as SelectItem, Label as SelectLabel, ScrollDownButton as SelectScrollDownButton, ScrollUpButton as SelectScrollUpButton, Separator as SelectSeparator, Trigger as SelectTrigger, Separator, Trigger };
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import SelectScrollDownButton from './select-scroll-down-button.svelte';
|
|
5
|
-
import { cn, type WithoutChild } from '../../../utils.js';
|
|
2
|
+
import { cn, type WithoutChild } from '../../../utils.js';
|
|
3
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
import SelectScrollDownButton from './select-scroll-down-button.svelte';
|
|
6
|
+
import SelectScrollUpButton from './select-scroll-up-button.svelte';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
children,
|
|
10
|
+
class: className,
|
|
11
|
+
portalProps,
|
|
12
|
+
ref = $bindable(null),
|
|
13
|
+
sideOffset = 4,
|
|
14
|
+
...restProps
|
|
15
|
+
}: WithoutChild<SelectPrimitive.ContentProps> & {
|
|
16
|
+
portalProps?: SelectPrimitive.PortalProps;
|
|
17
|
+
} = $props();
|
|
17
18
|
</script>
|
|
18
19
|
|
|
19
20
|
<SelectPrimitive.Portal {...portalProps}>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
21
|
+
<SelectPrimitive.Content
|
|
22
|
+
class={cn(
|
|
23
|
+
'relative z-50 max-h-(--bits-select-content-available-height) min-w-[8rem] origin-(--bits-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:translate-y-1 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:-translate-x-1 data-[side=left]:slide-in-from-right-2 data-[side=right]:translate-x-1 data-[side=right]:slide-in-from-left-2 data-[side=top]:-translate-y-1 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
data-slot="select-content"
|
|
27
|
+
{sideOffset}
|
|
28
|
+
bind:ref
|
|
29
|
+
{...restProps}
|
|
30
|
+
>
|
|
31
|
+
<SelectScrollUpButton />
|
|
32
|
+
<SelectPrimitive.Viewport
|
|
33
|
+
class={cn(
|
|
34
|
+
'h-(--bits-select-anchor-height) w-full min-w-(--bits-select-anchor-width) scroll-my-1 p-1'
|
|
35
|
+
)}
|
|
36
|
+
>
|
|
37
|
+
{@render children?.()}
|
|
38
|
+
</SelectPrimitive.Viewport>
|
|
39
|
+
<SelectScrollDownButton />
|
|
40
|
+
</SelectPrimitive.Content>
|
|
40
41
|
</SelectPrimitive.Portal>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Select as SelectPrimitive } from 'bits-ui';
|
|
2
1
|
import { type WithoutChild } from '../../../utils.js';
|
|
2
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
3
3
|
type $$ComponentProps = WithoutChild<SelectPrimitive.ContentProps> & {
|
|
4
4
|
portalProps?: SelectPrimitive.PortalProps;
|
|
5
5
|
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
import { cn } from '../../../utils.js';
|
|
4
|
-
import type { ComponentProps } from 'svelte';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { cn } from '../../../utils.js';
|
|
5
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
children,
|
|
9
|
+
class: className,
|
|
10
|
+
ref = $bindable(null),
|
|
11
|
+
...restProps
|
|
12
|
+
}: ComponentProps<typeof SelectPrimitive.GroupHeading> = $props();
|
|
12
13
|
</script>
|
|
13
14
|
|
|
14
15
|
<SelectPrimitive.GroupHeading
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
class={cn('px-2 py-1.5 text-xs text-muted-foreground', className)}
|
|
17
|
+
data-slot="select-group-heading"
|
|
18
|
+
bind:ref
|
|
19
|
+
{...restProps}
|
|
19
20
|
>
|
|
20
|
-
|
|
21
|
+
{@render children?.()}
|
|
21
22
|
</SelectPrimitive.GroupHeading>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
2
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
let { ref = $bindable(null), ...restProps }: SelectPrimitive.GroupProps = $props();
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<SelectPrimitive.Group data-slot="select-group" {...restProps} />
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { cn, type WithoutChild } from '../../../utils.js';
|
|
3
|
+
import CheckIcon from '@lucide/svelte/icons/check';
|
|
4
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
let {
|
|
7
|
+
children: childrenProp,
|
|
8
|
+
class: className,
|
|
9
|
+
label,
|
|
10
|
+
ref = $bindable(null),
|
|
11
|
+
value,
|
|
12
|
+
...restProps
|
|
13
|
+
}: WithoutChild<SelectPrimitive.ItemProps> = $props();
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<SelectPrimitive.Item
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
class={cn(
|
|
18
|
+
"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 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
data-slot="select-item"
|
|
22
|
+
{value}
|
|
23
|
+
bind:ref
|
|
24
|
+
{...restProps}
|
|
25
25
|
>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
{#snippet children({ highlighted, selected })}
|
|
27
|
+
<span class="absolute right-2 flex size-3.5 items-center justify-center">
|
|
28
|
+
{#if selected}
|
|
29
|
+
<CheckIcon class="size-4" />
|
|
30
|
+
{/if}
|
|
31
|
+
</span>
|
|
32
|
+
{#if childrenProp}
|
|
33
|
+
{@render childrenProp({ highlighted, selected })}
|
|
34
|
+
{:else}
|
|
35
|
+
{label || value}
|
|
36
|
+
{/if}
|
|
37
|
+
{/snippet}
|
|
38
38
|
</SelectPrimitive.Item>
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
children,
|
|
8
|
+
class: className,
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {} = $props();
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
14
|
<div
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
bind:this={ref}
|
|
16
|
+
class={cn('px-2 py-1.5 text-xs text-muted-foreground', className)}
|
|
17
|
+
data-slot="select-label"
|
|
18
|
+
{...restProps}
|
|
18
19
|
>
|
|
19
|
-
|
|
20
|
+
{@render children?.()}
|
|
20
21
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type WithElementRef } from '../../../utils.js';
|
|
2
1
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
3
|
type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLDivElement>> & {};
|
|
4
4
|
declare const SelectLabel: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
5
5
|
type SelectLabel = ReturnType<typeof SelectLabel>;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
|
|
3
|
+
import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
|
|
4
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
let {
|
|
7
|
+
class: className,
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithoutChildrenOrChild<SelectPrimitive.ScrollDownButtonProps> = $props();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<SelectPrimitive.ScrollDownButton
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
class={cn('flex cursor-default items-center justify-center py-1', className)}
|
|
15
|
+
data-slot="select-scroll-down-button"
|
|
16
|
+
bind:ref
|
|
17
|
+
{...restProps}
|
|
18
18
|
>
|
|
19
|
-
|
|
19
|
+
<ChevronDownIcon class="size-4" />
|
|
20
20
|
</SelectPrimitive.ScrollDownButton>
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
|
|
3
|
+
import ChevronUpIcon from '@lucide/svelte/icons/chevron-up';
|
|
4
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
let {
|
|
7
|
+
class: className,
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithoutChildrenOrChild<SelectPrimitive.ScrollUpButtonProps> = $props();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<SelectPrimitive.ScrollUpButton
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
class={cn('flex cursor-default items-center justify-center py-1', className)}
|
|
15
|
+
data-slot="select-scroll-up-button"
|
|
16
|
+
bind:ref
|
|
17
|
+
{...restProps}
|
|
18
18
|
>
|
|
19
|
-
|
|
19
|
+
<ChevronUpIcon class="size-4" />
|
|
20
20
|
</SelectPrimitive.ScrollUpButton>
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
import { Separator } from '../separator/index.js';
|
|
4
|
-
import { cn } from '../../../utils.js';
|
|
2
|
+
import type { Separator as SeparatorPrimitive } from 'bits-ui';
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { Separator } from '../separator/index.js';
|
|
5
|
+
import { cn } from '../../../utils.js';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
class: className,
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
...restProps
|
|
11
|
+
}: SeparatorPrimitive.RootProps = $props();
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
14
|
<Separator
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
class={cn('pointer-events-none -mx-1 my-1 h-px bg-border', className)}
|
|
16
|
+
data-slot="select-separator"
|
|
17
|
+
bind:ref
|
|
18
|
+
{...restProps}
|
|
18
19
|
/>
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { cn, type WithoutChild } from '../../../utils.js';
|
|
3
|
+
import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
|
|
4
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
let {
|
|
7
|
+
children,
|
|
8
|
+
class: className,
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
size = 'default',
|
|
11
|
+
...restProps
|
|
12
|
+
}: WithoutChild<SelectPrimitive.TriggerProps> & {
|
|
13
|
+
size?: 'default' | 'sm';
|
|
14
|
+
} = $props();
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<SelectPrimitive.Trigger
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
class={cn(
|
|
19
|
+
'flex w-full items-center justify-between gap-2 rounded-lg border border-gray-300 px-4 py-3 transition-all outline-none select-none',
|
|
20
|
+
'focus:border-transparent focus:ring-2 focus:ring-primary',
|
|
21
|
+
'disabled:opacity-50',
|
|
22
|
+
'aria-invalid:border-red-500 aria-invalid:focus:ring-red-300',
|
|
23
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
data-size={size}
|
|
27
|
+
data-slot="select-trigger"
|
|
28
|
+
bind:ref
|
|
29
|
+
{...restProps}
|
|
30
30
|
>
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
{@render children?.()}
|
|
32
|
+
<ChevronDownIcon class="size-4 opacity-50" />
|
|
33
33
|
</SelectPrimitive.Trigger>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Select as SelectPrimitive } from 'bits-ui';
|
|
2
1
|
import { type WithoutChild } from '../../../utils.js';
|
|
2
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
3
3
|
type $$ComponentProps = WithoutChild<SelectPrimitive.TriggerProps> & {
|
|
4
|
-
size?: '
|
|
4
|
+
size?: 'default' | 'sm';
|
|
5
5
|
};
|
|
6
6
|
declare const SelectTrigger: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
7
|
type SelectTrigger = ReturnType<typeof SelectTrigger>;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { cn } from '../../../utils.js';
|
|
3
|
+
import { Separator as SeparatorPrimitive } from 'bits-ui';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
let {
|
|
6
|
+
class: className,
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
...restProps
|
|
9
|
+
}: SeparatorPrimitive.RootProps = $props();
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<SeparatorPrimitive.Root
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
class={cn(
|
|
14
|
+
'shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
data-slot="separator"
|
|
18
|
+
bind:ref
|
|
19
|
+
{...restProps}
|
|
20
20
|
/>
|