@casinogate/ui 1.3.7 → 1.5.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 +4 -9
- package/dist/assets/css/root.css +428 -21
- package/dist/assets/css/theme.css +38 -0
- package/dist/components/badge/badge.stories.svelte +81 -0
- package/dist/components/badge/badge.stories.svelte.d.ts +19 -0
- package/dist/components/badge/badge.svelte +30 -0
- package/dist/components/badge/badge.svelte.d.ts +4 -0
- package/dist/components/badge/exports.d.ts +1 -0
- package/dist/components/badge/exports.js +1 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/badge/styles.d.ts +99 -0
- package/dist/components/badge/styles.js +126 -0
- package/dist/components/badge/types.d.ts +8 -0
- package/dist/components/badge/types.js +1 -0
- package/dist/components/breadcrumb/breadcrumb.stories.svelte +60 -0
- package/dist/components/breadcrumb/breadcrumb.stories.svelte.d.ts +19 -0
- package/dist/components/breadcrumb/breadcrumb.svelte +32 -0
- package/dist/components/breadcrumb/breadcrumb.svelte.d.ts +4 -0
- package/dist/components/breadcrumb/components/breadcrumb.item.svelte +16 -0
- package/dist/components/breadcrumb/components/breadcrumb.item.svelte.d.ts +4 -0
- package/dist/components/breadcrumb/components/breadcrumb.link.svelte +29 -0
- package/dist/components/breadcrumb/components/breadcrumb.link.svelte.d.ts +4 -0
- package/dist/components/breadcrumb/components/breadcrumb.list.svelte +16 -0
- package/dist/components/breadcrumb/components/breadcrumb.list.svelte.d.ts +4 -0
- package/dist/components/breadcrumb/components/breadcrumb.page.svelte +19 -0
- package/dist/components/breadcrumb/components/breadcrumb.page.svelte.d.ts +4 -0
- package/dist/components/breadcrumb/components/breadcrumb.root.svelte +22 -0
- package/dist/components/breadcrumb/components/breadcrumb.root.svelte.d.ts +4 -0
- package/dist/components/breadcrumb/components/breadcrumb.separator.svelte +24 -0
- package/dist/components/breadcrumb/components/breadcrumb.separator.svelte.d.ts +4 -0
- package/dist/components/breadcrumb/exports-primitive.d.ts +6 -0
- package/dist/components/breadcrumb/exports-primitive.js +6 -0
- package/dist/components/breadcrumb/exports.d.ts +1 -0
- package/dist/components/breadcrumb/exports.js +1 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/breadcrumb/index.js +2 -0
- package/dist/components/breadcrumb/styles.d.ts +62 -0
- package/dist/components/breadcrumb/styles.js +18 -0
- package/dist/components/breadcrumb/types.d.ts +19 -0
- package/dist/components/breadcrumb/types.js +1 -0
- package/dist/components/collapsible/components/collapsaible.svelte.d.ts +11 -0
- package/dist/components/collapsible/components/collapsaible.svelte.js +16 -0
- package/dist/components/collapsible/components/collapsaible.trigger.svelte +17 -5
- package/dist/components/collapsible/types.d.ts +5 -2
- package/dist/components/icons/caret-down.svelte +3 -3
- package/dist/components/icons/caret-up.svelte +3 -3
- package/dist/components/icons/check.svelte +3 -3
- package/dist/components/icons/checkmark.svelte +12 -0
- package/dist/components/icons/checkmark.svelte.d.ts +3 -0
- package/dist/components/icons/chevron-down.svelte +3 -3
- package/dist/components/icons/chevron-left.svelte +3 -3
- package/dist/components/icons/chevron-right.svelte +3 -3
- package/dist/components/icons/chevron-small-down.svelte +3 -3
- package/dist/components/icons/chevron-small-left.svelte +3 -3
- package/dist/components/icons/chevron-small-right.svelte +3 -3
- package/dist/components/icons/chevron-small-up.svelte +3 -3
- package/dist/components/icons/chevron-up.svelte +3 -3
- package/dist/components/icons/dots.svelte +5 -5
- package/dist/components/icons/error.svelte +3 -3
- package/dist/components/icons/exports.d.ts +2 -0
- package/dist/components/icons/exports.js +2 -0
- package/dist/components/icons/eye-crossed.svelte +3 -3
- package/dist/components/icons/eye.svelte +3 -3
- package/dist/components/icons/info.svelte +3 -3
- package/dist/components/icons/minus.svelte +3 -3
- package/dist/components/icons/sidebar-toggle.svelte +4 -4
- package/dist/components/icons/slash.svelte +9 -0
- package/dist/components/icons/slash.svelte.d.ts +3 -0
- package/dist/components/icons/sort.svelte +4 -4
- package/dist/components/icons/spinner.svelte +3 -3
- package/dist/components/icons/success.svelte +3 -3
- package/dist/components/icons/warning.svelte +3 -3
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/navigation/components/navigation.content.svelte +2 -2
- package/dist/components/navigation/components/navigation.root.svelte +3 -1
- package/dist/components/navigation/components/navigation.root.svelte.d.ts +1 -1
- package/dist/components/navigation/components/navigation.sub-content.svelte +12 -5
- package/dist/components/navigation/components/navigation.svelte.d.ts +8 -2
- package/dist/components/navigation/components/navigation.svelte.js +8 -4
- package/dist/components/navigation/components/navigation.trigger.svelte +83 -25
- package/dist/components/navigation/exports.d.ts +1 -1
- package/dist/components/navigation/exports.js +1 -1
- package/dist/components/navigation/index.d.ts +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/navigation/navigation.stories.svelte +34 -20
- package/dist/components/navigation/navigation.stories.svelte.d.ts +1 -0
- package/dist/components/navigation/navigation.svelte +35 -2
- package/dist/components/navigation/navigation.svelte.d.ts +3 -17
- package/dist/components/navigation/styles.d.ts +3 -3
- package/dist/components/navigation/styles.js +5 -4
- package/dist/components/navigation/types.d.ts +35 -4
- package/dist/components/popover/styles.d.ts +3 -3
- package/dist/components/popover/styles.js +1 -1
- package/dist/components/select/components/select.content.svelte +31 -0
- package/dist/components/select/components/select.content.svelte.d.ts +3 -25
- package/dist/components/select/components/select.group-heading.svelte +19 -0
- package/dist/components/select/components/select.group-heading.svelte.d.ts +4 -0
- package/dist/components/select/components/select.group.svelte +8 -0
- package/dist/components/select/components/select.group.svelte.d.ts +4 -0
- package/dist/components/select/components/select.item.svelte +38 -0
- package/dist/components/select/components/select.item.svelte.d.ts +3 -25
- package/dist/components/select/components/select.portal.svelte +10 -0
- package/dist/components/select/components/select.portal.svelte.d.ts +3 -0
- package/dist/components/select/components/select.trigger.svelte +28 -27
- package/dist/components/select/components/select.viewport.svelte +24 -0
- package/dist/components/select/components/select.viewport.svelte.d.ts +3 -25
- package/dist/components/select/exports-primitive.d.ts +6 -0
- package/dist/components/select/exports-primitive.js +6 -0
- package/dist/components/select/exports.d.ts +1 -0
- package/dist/components/select/exports.js +1 -0
- package/dist/components/select/index.d.ts +2 -1
- package/dist/components/select/index.js +1 -0
- package/dist/components/select/select.stories.svelte +178 -15
- package/dist/components/select/select.stories.svelte.d.ts +3 -17
- package/dist/components/select/select.svelte +141 -0
- package/dist/components/select/select.svelte.d.ts +4 -0
- package/dist/components/select/styles.d.ts +15 -3
- package/dist/components/select/styles.js +24 -8
- package/dist/components/select/types.d.ts +42 -4
- package/dist/components/textarea/exports.d.ts +1 -0
- package/dist/components/textarea/exports.js +1 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/textarea/styles.d.ts +54 -0
- package/dist/components/textarea/styles.js +39 -0
- package/dist/components/textarea/textarea.stories.svelte +36 -0
- package/dist/components/textarea/textarea.stories.svelte.d.ts +19 -0
- package/dist/components/textarea/textarea.svelte +22 -0
- package/dist/components/textarea/textarea.svelte.d.ts +4 -0
- package/dist/components/textarea/types.d.ts +6 -0
- package/dist/components/textarea/types.js +1 -0
- package/dist/internal/types/html-attributes.d.ts +2 -1
- package/dist/internal/utils/tailwindcss.js +16 -0
- package/package.json +2 -1
|
@@ -1,3 +1,36 @@
|
|
|
1
|
-
<script lang="ts"
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Content from './components/navigation.content.svelte';
|
|
3
|
+
import Item from './components/navigation.item.svelte';
|
|
4
|
+
import Root from './components/navigation.root.svelte';
|
|
5
|
+
import SubContent from './components/navigation.sub-content.svelte';
|
|
6
|
+
import Trigger from './components/navigation.trigger.svelte';
|
|
7
|
+
import type { NavigationProps } from './types.js';
|
|
2
8
|
|
|
3
|
-
|
|
9
|
+
let { items, ref = $bindable(null), compact = $bindable(false), ...restProps }: NavigationProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Root bind:ref bind:compact {...restProps}>
|
|
13
|
+
<Content>
|
|
14
|
+
{#each items as item (item.key)}
|
|
15
|
+
<Item>
|
|
16
|
+
<Trigger label={item.label} {...'href' in item ? { href: item.href } : {}}>
|
|
17
|
+
{#snippet icon()}
|
|
18
|
+
{#if item.icon}
|
|
19
|
+
<item.icon width={24} height={24} />
|
|
20
|
+
{/if}
|
|
21
|
+
{/snippet}
|
|
22
|
+
</Trigger>
|
|
23
|
+
|
|
24
|
+
{#if 'children' in item}
|
|
25
|
+
<SubContent>
|
|
26
|
+
{#each item.children as child (child.key)}
|
|
27
|
+
<Item>
|
|
28
|
+
<Trigger label={child.label} href={child.href} />
|
|
29
|
+
</Item>
|
|
30
|
+
{/each}
|
|
31
|
+
</SubContent>
|
|
32
|
+
{/if}
|
|
33
|
+
</Item>
|
|
34
|
+
{/each}
|
|
35
|
+
</Content>
|
|
36
|
+
</Root>
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const Navigation: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
}, {}, {}, string>;
|
|
17
|
-
type Navigation = InstanceType<typeof Navigation>;
|
|
1
|
+
import type { NavigationProps } from './types.js';
|
|
2
|
+
declare const Navigation: import("svelte").Component<NavigationProps, {}, "ref" | "compact">;
|
|
3
|
+
type Navigation = ReturnType<typeof Navigation>;
|
|
18
4
|
export default Navigation;
|
|
@@ -7,7 +7,7 @@ export declare const navigationVariants: import("tailwind-variants").TVReturnTyp
|
|
|
7
7
|
};
|
|
8
8
|
}, {
|
|
9
9
|
root: string[];
|
|
10
|
-
content:
|
|
10
|
+
content: string[];
|
|
11
11
|
item: never[];
|
|
12
12
|
subContent: string[];
|
|
13
13
|
trigger: string[];
|
|
@@ -17,7 +17,7 @@ export declare const navigationVariants: import("tailwind-variants").TVReturnTyp
|
|
|
17
17
|
};
|
|
18
18
|
}, {
|
|
19
19
|
root: string[];
|
|
20
|
-
content:
|
|
20
|
+
content: string[];
|
|
21
21
|
item: never[];
|
|
22
22
|
subContent: string[];
|
|
23
23
|
trigger: string[];
|
|
@@ -27,7 +27,7 @@ export declare const navigationVariants: import("tailwind-variants").TVReturnTyp
|
|
|
27
27
|
};
|
|
28
28
|
}, {
|
|
29
29
|
root: string[];
|
|
30
|
-
content:
|
|
30
|
+
content: string[];
|
|
31
31
|
item: never[];
|
|
32
32
|
subContent: string[];
|
|
33
33
|
trigger: string[];
|
|
@@ -7,9 +7,8 @@ export const navigationVariants = tv({
|
|
|
7
7
|
'cgui:group/navigation',
|
|
8
8
|
'cgui:data-[compact=true]:w-fit cgui:min-w-px cgui:w-full',
|
|
9
9
|
'cgui:transition-all cgui:duration-250 cgui:ease-in-out',
|
|
10
|
-
'cgui:bg-surface-darkest',
|
|
11
10
|
],
|
|
12
|
-
content: [],
|
|
11
|
+
content: ['cgui:overflow-hidden'],
|
|
13
12
|
item: [],
|
|
14
13
|
subContent: [
|
|
15
14
|
'cgui:data-[compact=false]:pl-10',
|
|
@@ -17,12 +16,14 @@ export const navigationVariants = tv({
|
|
|
17
16
|
'cgui:data-[popover-content]:bg-surface-darkest cgui:data-[popover-content]:rounded-md',
|
|
18
17
|
],
|
|
19
18
|
trigger: [
|
|
20
|
-
'cgui:flex cgui:items-center cgui:gap-
|
|
19
|
+
'cgui:flex cgui:items-center cgui:gap-2',
|
|
20
|
+
'cgui:overflow-hidden cgui:truncate',
|
|
21
21
|
'cgui:w-full cgui:px-3 cgui:py-4',
|
|
22
|
-
'cgui:group-data-[compact=true]/navigation:py-3',
|
|
22
|
+
'cgui:group-data-[compact=true]/navigation:py-3 cgui:data-[sub-content="false"]:group-data-[compact=true]/navigation:justify-center',
|
|
23
23
|
'cgui:text-fg-semilight cgui:text-body',
|
|
24
24
|
'cgui:cursor-pointer cgui:transition-all cgui:duration-250 cgui:ease-in-out',
|
|
25
25
|
'cgui:[data-disabled]:cursor-not-allowed cgui:[data-disabled]:opacity-50',
|
|
26
|
+
'cgui:[&_[data-slot="icon"]]:size-6',
|
|
26
27
|
],
|
|
27
28
|
},
|
|
28
29
|
variants: {
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { PrimitiveElementAttributes } from '../../internal/types/html-attributes.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Component, Snippet } from 'svelte';
|
|
3
|
+
import type { WithChild, WithElementRef, Without, WithoutChildren, WithoutChildrenOrChild } from 'svelte-toolbelt';
|
|
3
4
|
import type { NavigationVariantsProps } from './styles.js';
|
|
4
|
-
type NavigationRootPropsWithoutHTML = WithElementRef<WithChild<{
|
|
5
|
+
type NavigationRootPropsWithoutHTML = WithElementRef<WithChild<{
|
|
6
|
+
popoverProps?: {
|
|
7
|
+
sideOffset?: number;
|
|
8
|
+
alignOffset?: number;
|
|
9
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
10
|
+
};
|
|
11
|
+
}, {
|
|
5
12
|
compact: boolean;
|
|
6
13
|
}>> & NavigationVariantsProps;
|
|
7
14
|
export type NavigationRootProps = NavigationRootPropsWithoutHTML & Without<PrimitiveElementAttributes, NavigationRootPropsWithoutHTML>;
|
|
@@ -13,11 +20,35 @@ type NavigationSubContentPropsWithoutHTML = WithElementRef<WithChild<{}, {
|
|
|
13
20
|
compact: boolean;
|
|
14
21
|
}>>;
|
|
15
22
|
export type NavigationSubContentProps = NavigationSubContentPropsWithoutHTML & Without<PrimitiveElementAttributes, NavigationSubContentPropsWithoutHTML>;
|
|
16
|
-
type NavigationTriggerPropsWithoutHTML = WithElementRef<WithChild<{
|
|
23
|
+
type NavigationTriggerPropsWithoutHTML = WithElementRef<WithoutChildren<WithChild<{
|
|
17
24
|
href?: string;
|
|
18
25
|
disabled?: boolean;
|
|
26
|
+
icon?: Snippet;
|
|
27
|
+
label?: string | Snippet<[{
|
|
28
|
+
props: Record<string, unknown>;
|
|
29
|
+
}]>;
|
|
19
30
|
}, {
|
|
20
31
|
compact: boolean;
|
|
21
|
-
}
|
|
32
|
+
}>>>;
|
|
22
33
|
export type NavigationTriggerProps = NavigationTriggerPropsWithoutHTML & Without<PrimitiveElementAttributes, NavigationTriggerPropsWithoutHTML>;
|
|
34
|
+
type NavigationItemBaseValue = {
|
|
35
|
+
key: string | number;
|
|
36
|
+
label: string;
|
|
37
|
+
icon?: Component<{
|
|
38
|
+
width?: number;
|
|
39
|
+
height?: number;
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
42
|
+
type NavigationItemValueWithHref = NavigationItemBaseValue & {
|
|
43
|
+
href: string;
|
|
44
|
+
children?: never;
|
|
45
|
+
};
|
|
46
|
+
type NavigationItemValueWithChildren = NavigationItemBaseValue & {
|
|
47
|
+
children: Omit<NavigationItemValueWithHref, 'icon'>[];
|
|
48
|
+
href?: never;
|
|
49
|
+
};
|
|
50
|
+
export type NavigationItemValue = NavigationItemValueWithHref | NavigationItemValueWithChildren;
|
|
51
|
+
export type NavigationProps = WithoutChildrenOrChild<NavigationRootProps> & {
|
|
52
|
+
items: NavigationItemValue[];
|
|
53
|
+
};
|
|
23
54
|
export {};
|
|
@@ -10,7 +10,7 @@ export declare const popoverVariants: import("tailwind-variants").TVReturnType<{
|
|
|
10
10
|
}, {
|
|
11
11
|
root: never[];
|
|
12
12
|
trigger: string[];
|
|
13
|
-
content:
|
|
13
|
+
content: string[];
|
|
14
14
|
}, undefined, {
|
|
15
15
|
shadow: {
|
|
16
16
|
true: {
|
|
@@ -20,7 +20,7 @@ export declare const popoverVariants: import("tailwind-variants").TVReturnType<{
|
|
|
20
20
|
}, {
|
|
21
21
|
root: never[];
|
|
22
22
|
trigger: string[];
|
|
23
|
-
content:
|
|
23
|
+
content: string[];
|
|
24
24
|
}, import("tailwind-variants").TVReturnType<{
|
|
25
25
|
shadow: {
|
|
26
26
|
true: {
|
|
@@ -30,7 +30,7 @@ export declare const popoverVariants: import("tailwind-variants").TVReturnType<{
|
|
|
30
30
|
}, {
|
|
31
31
|
root: never[];
|
|
32
32
|
trigger: string[];
|
|
33
|
-
content:
|
|
33
|
+
content: string[];
|
|
34
34
|
}, undefined, unknown, unknown, undefined>>;
|
|
35
35
|
export type PopoverVariantsProps = VariantProps<typeof popoverVariants>;
|
|
36
36
|
export declare const PopoverStylesContext: Context<ReadableBox<{
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
3
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
4
|
+
import { SelectStylesContext } from '../styles.js';
|
|
5
|
+
import type { SelectContentProps } from '../types.js';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
sideOffset = 4,
|
|
11
|
+
children,
|
|
12
|
+
side = 'bottom',
|
|
13
|
+
forceMount = false,
|
|
14
|
+
...restProps
|
|
15
|
+
}: SelectContentProps = $props();
|
|
16
|
+
|
|
17
|
+
const variants = SelectStylesContext.get();
|
|
18
|
+
|
|
19
|
+
const attrs = $derived({
|
|
20
|
+
'data-slot': 'select-content',
|
|
21
|
+
class: cn(variants.current.content(), className),
|
|
22
|
+
sideOffset,
|
|
23
|
+
forceMount,
|
|
24
|
+
side,
|
|
25
|
+
...restProps,
|
|
26
|
+
});
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<SelectPrimitive.Content bind:ref {...attrs}>
|
|
30
|
+
{@render children?.()}
|
|
31
|
+
</SelectPrimitive.Content>
|
|
@@ -1,26 +1,4 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
2
|
+
declare const Select: import("svelte").Component<Omit<SelectPrimitive.ContentProps, "child">, {}, "ref">;
|
|
3
|
+
type Select = ReturnType<typeof Select>;
|
|
1
4
|
export default Select;
|
|
2
|
-
type Select = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const Select: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { SelectStylesContext } from '../styles.js';
|
|
3
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
4
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
5
|
+
import type { SelectGroupHeadingProps } from '../types.js';
|
|
6
|
+
|
|
7
|
+
let { ref = $bindable(null), class: className, children, ...restProps }: SelectGroupHeadingProps = $props();
|
|
8
|
+
|
|
9
|
+
const variants = SelectStylesContext.get();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<SelectPrimitive.GroupHeading
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="select-group-heading"
|
|
15
|
+
class={cn(variants.current.label(), className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
</SelectPrimitive.GroupHeading>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
3
|
+
import type { SelectGroupProps } from '../types.js';
|
|
4
|
+
|
|
5
|
+
let { ref = $bindable(null), ...restProps }: SelectGroupProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SelectPrimitive.Group data-slot="select-group" bind:ref {...restProps} />
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Icon } from '../../icons/index.js';
|
|
3
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
4
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
5
|
+
import { SelectStylesContext } from '../styles.js';
|
|
6
|
+
import type { SelectItemProps } from '../types.js';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
class: className,
|
|
11
|
+
value,
|
|
12
|
+
label,
|
|
13
|
+
children: childrenProp,
|
|
14
|
+
...restProps
|
|
15
|
+
}: SelectItemProps = $props();
|
|
16
|
+
|
|
17
|
+
const variants = SelectStylesContext.get();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<SelectPrimitive.Item
|
|
21
|
+
bind:ref
|
|
22
|
+
{value}
|
|
23
|
+
data-slot="select-item"
|
|
24
|
+
class={cn(variants.current.item(), className)}
|
|
25
|
+
{...restProps}
|
|
26
|
+
>
|
|
27
|
+
{#snippet children({ selected, highlighted })}
|
|
28
|
+
{#if childrenProp}
|
|
29
|
+
{@render childrenProp({ selected, highlighted })}
|
|
30
|
+
{:else}
|
|
31
|
+
{label || value}
|
|
32
|
+
|
|
33
|
+
{#if selected}
|
|
34
|
+
<Icon.Checkmark width={16} height={16} />
|
|
35
|
+
{/if}
|
|
36
|
+
{/if}
|
|
37
|
+
{/snippet}
|
|
38
|
+
</SelectPrimitive.Item>
|
|
@@ -1,26 +1,4 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
2
|
+
declare const Select: import("svelte").Component<Omit<SelectPrimitive.ItemProps, "child">, {}, "ref">;
|
|
3
|
+
type Select = ReturnType<typeof Select>;
|
|
1
4
|
export default Select;
|
|
2
|
-
type Select = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const Select: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
3
|
+
import type { SelectPortalProps } from '../types.js';
|
|
4
|
+
|
|
5
|
+
let { children, ...restProps }: SelectPortalProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SelectPrimitive.Portal {...restProps}>
|
|
9
|
+
{@render children?.()}
|
|
10
|
+
</SelectPrimitive.Portal>
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import { cn
|
|
2
|
+
import { Icon } from '../../icons/index.js';
|
|
3
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
4
4
|
import { Select as SelectPrimitive } from 'bits-ui';
|
|
5
5
|
import { SelectStylesContext } from '../styles.js';
|
|
6
6
|
import type { SelectTriggerProps } from '../types.js';
|
|
7
7
|
|
|
8
8
|
let {
|
|
9
9
|
ref = $bindable(null),
|
|
10
|
-
id = useId(),
|
|
11
10
|
class: className,
|
|
12
|
-
|
|
13
|
-
endChevron,
|
|
11
|
+
child,
|
|
14
12
|
children,
|
|
13
|
+
hasChevron = true,
|
|
15
14
|
...restProps
|
|
16
15
|
}: SelectTriggerProps = $props();
|
|
17
16
|
|
|
18
17
|
const styles = SelectStylesContext.get();
|
|
19
|
-
</script>
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class={cn(styles.current.trigger(), className)}
|
|
28
|
-
{...restProps}
|
|
29
|
-
>
|
|
30
|
-
{#if startChevron}
|
|
31
|
-
<span data-slot="start-chevron" class={styles.current.chevron()}>
|
|
32
|
-
{@render startChevron()}
|
|
33
|
-
</span>
|
|
34
|
-
{/if}
|
|
19
|
+
const attrs = $derived({
|
|
20
|
+
'data-slot': 'trigger',
|
|
21
|
+
class: cn(styles.current.trigger(), className),
|
|
22
|
+
...restProps,
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
35
25
|
|
|
36
|
-
|
|
26
|
+
{#if child}
|
|
27
|
+
{@render child({ props: attrs })}
|
|
28
|
+
{:else}
|
|
29
|
+
<SelectPrimitive.Trigger bind:ref {...attrs}>
|
|
30
|
+
{@render children?.()}
|
|
37
31
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
{#if hasChevron}
|
|
33
|
+
<span
|
|
34
|
+
data-slot="chevron"
|
|
35
|
+
class={cn(
|
|
36
|
+
'cgui:transition-transform cgui:duration-250 cgui:ease-in-out',
|
|
37
|
+
'cgui:group-data-[state=open]/select-trigger:-rotate-180'
|
|
38
|
+
)}
|
|
39
|
+
>
|
|
40
|
+
<Icon.ChevronDown width={20} height={20} />
|
|
41
|
+
</span>
|
|
42
|
+
{/if}
|
|
43
|
+
</SelectPrimitive.Trigger>
|
|
44
|
+
{/if}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
3
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
4
|
+
import { SelectStylesContext } from '../styles.js';
|
|
5
|
+
import type { SelectViewportProps } from '../types.js';
|
|
6
|
+
|
|
7
|
+
let { ref = $bindable(null), class: className, children, child, ...restProps }: SelectViewportProps = $props();
|
|
8
|
+
|
|
9
|
+
const variants = SelectStylesContext.get();
|
|
10
|
+
|
|
11
|
+
const attrs = $derived({
|
|
12
|
+
'data-slot': 'select-viewport',
|
|
13
|
+
class: cn(variants.current.viewport(), className),
|
|
14
|
+
...restProps,
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
{#if child}
|
|
19
|
+
{@render child({ props: attrs })}
|
|
20
|
+
{:else}
|
|
21
|
+
<SelectPrimitive.Viewport bind:ref {...attrs}>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</SelectPrimitive.Viewport>
|
|
24
|
+
{/if}
|
|
@@ -1,26 +1,4 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from 'bits-ui';
|
|
2
|
+
declare const Select: import("svelte").Component<SelectPrimitive.ViewportProps, {}, "ref">;
|
|
3
|
+
type Select = ReturnType<typeof Select>;
|
|
1
4
|
export default Select;
|
|
2
|
-
type Select = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const Select: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
export { default as Content } from './components/select.content.svelte';
|
|
2
|
+
export { default as GroupHeading } from './components/select.group-heading.svelte';
|
|
3
|
+
export { default as Group } from './components/select.group.svelte';
|
|
4
|
+
export { default as Item } from './components/select.item.svelte';
|
|
5
|
+
export { default as Portal } from './components/select.portal.svelte';
|
|
1
6
|
export { default as Root } from './components/select.root.svelte';
|
|
2
7
|
export { default as Trigger } from './components/select.trigger.svelte';
|
|
8
|
+
export { default as Viewport } from './components/select.viewport.svelte';
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
export { default as Content } from './components/select.content.svelte';
|
|
2
|
+
export { default as GroupHeading } from './components/select.group-heading.svelte';
|
|
3
|
+
export { default as Group } from './components/select.group.svelte';
|
|
4
|
+
export { default as Item } from './components/select.item.svelte';
|
|
5
|
+
export { default as Portal } from './components/select.portal.svelte';
|
|
1
6
|
export { default as Root } from './components/select.root.svelte';
|
|
2
7
|
export { default as Trigger } from './components/select.trigger.svelte';
|
|
8
|
+
export { default as Viewport } from './components/select.viewport.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Root } from './select.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Root } from './select.svelte';
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export * as SelectPrimitive from './exports-primitive.js';
|
|
2
|
-
export
|
|
2
|
+
export * as Select from './exports.js';
|
|
3
|
+
export type { SelectContentProps, SelectGroupHeadingProps, SelectGroupProps, SelectItem, SelectItemData, SelectItemGroup, SelectItemProps, SelectRootProps, SelectTriggerProps, SelectViewportProps, } from './types.js';
|