@casinogate/ui 1.6.2 → 1.8.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/dist/assets/css/root.css +236 -32
- package/dist/assets/css/theme.css +6 -3
- package/dist/components/breadcrumb/breadcrumb.svelte +2 -2
- package/dist/components/breadcrumb/styles.d.ts +21 -21
- package/dist/components/breadcrumb/types.d.ts +2 -2
- package/dist/components/button/button.component.svelte +2 -1
- package/dist/components/button/styles.d.ts +15 -0
- package/dist/components/button/styles.js +10 -5
- package/dist/components/button-group/components/button-group.root.svelte +1 -3
- package/dist/components/collapsible/components/collapsaible.svelte.js +3 -3
- package/dist/components/collapsible/styles.d.ts +8 -8
- package/dist/components/data-table/data-table.svelte +1 -1
- package/dist/components/data-table/utils/pagination-state.svelte.js +3 -3
- package/dist/components/data-table/utils/resize-state.svelte.js +3 -3
- package/dist/components/data-table/utils/row-selection-state.svelte.js +3 -3
- package/dist/components/dialog/components/dialog.overlay.svelte +1 -7
- package/dist/components/dropdown/components/dropdown.content.svelte +39 -0
- package/dist/components/dropdown/components/dropdown.content.svelte.d.ts +4 -0
- package/dist/components/dropdown/components/dropdown.group-heading.svelte +16 -0
- package/dist/components/dropdown/components/dropdown.group-heading.svelte.d.ts +4 -0
- package/dist/components/dropdown/components/dropdown.group.svelte +16 -0
- package/dist/components/dropdown/components/dropdown.group.svelte.d.ts +4 -0
- package/dist/components/dropdown/components/dropdown.item.svelte +22 -0
- package/dist/components/dropdown/components/dropdown.item.svelte.d.ts +4 -0
- package/dist/components/dropdown/components/dropdown.portal.svelte +10 -0
- package/dist/components/dropdown/components/dropdown.portal.svelte.d.ts +3 -0
- package/dist/components/dropdown/components/dropdown.root.svelte +10 -0
- package/dist/components/dropdown/components/dropdown.root.svelte.d.ts +3 -0
- package/dist/components/dropdown/components/dropdown.separator.svelte +22 -0
- package/dist/components/dropdown/components/dropdown.separator.svelte.d.ts +4 -0
- package/dist/components/dropdown/components/dropdown.sub-content.svelte +16 -0
- package/dist/components/dropdown/components/dropdown.sub-content.svelte.d.ts +4 -0
- package/dist/components/dropdown/components/dropdown.sub-trigger.svelte +21 -0
- package/dist/components/dropdown/components/dropdown.sub-trigger.svelte.d.ts +4 -0
- package/dist/components/dropdown/components/dropdown.sub.svelte +8 -0
- package/dist/components/dropdown/components/dropdown.sub.svelte.d.ts +3 -0
- package/dist/components/dropdown/components/dropdown.trigger.svelte +16 -0
- package/dist/components/dropdown/components/dropdown.trigger.svelte.d.ts +4 -0
- package/dist/components/dropdown/dropdown.svelte +196 -0
- package/dist/components/dropdown/dropdown.svelte.d.ts +7 -0
- package/dist/components/dropdown/exports-primitive.d.ts +11 -0
- package/dist/components/dropdown/exports-primitive.js +11 -0
- package/dist/components/dropdown/exports.d.ts +1 -0
- package/dist/components/dropdown/exports.js +1 -0
- package/dist/components/dropdown/index.d.ts +3 -0
- package/dist/components/dropdown/index.js +2 -0
- package/dist/components/dropdown/styles.d.ts +496 -0
- package/dist/components/dropdown/styles.js +111 -0
- package/dist/components/dropdown/types.d.ts +86 -0
- package/dist/components/dropdown/types.js +1 -0
- package/dist/components/field/field.svelte +0 -1
- package/dist/components/field/styles.d.ts +15 -15
- package/dist/components/popover/components/popover.content.svelte +7 -2
- package/dist/components/popover/components/popover.content.svelte.d.ts +2 -2
- package/dist/components/popover/components/popover.root.svelte +0 -6
- package/dist/components/popover/components/popover.trigger.svelte +6 -2
- package/dist/components/popover/components/popover.trigger.svelte.d.ts +2 -2
- package/dist/components/popover/styles.d.ts +60 -52
- package/dist/components/popover/styles.js +37 -14
- package/dist/components/popover/types.d.ts +4 -4
- package/dist/components/segment/components/segment.root.svelte +2 -1
- package/dist/components/segment/components/segmet.svelte.d.ts +0 -1
- package/dist/components/segment/components/segmet.svelte.js +0 -1
- package/dist/components/segment/styles.d.ts +18 -0
- package/dist/components/segment/styles.js +7 -1
- package/dist/components/select/components/select.content.svelte +2 -4
- package/dist/components/select/components/select.group-heading.svelte +2 -4
- package/dist/components/select/components/select.group-heading.svelte.d.ts +2 -2
- package/dist/components/select/components/select.group.svelte.d.ts +2 -2
- package/dist/components/select/components/select.item.svelte +5 -13
- package/dist/components/select/components/select.item.svelte.d.ts +2 -2
- package/dist/components/select/components/select.root.svelte +1 -17
- package/dist/components/select/components/select.root.svelte.d.ts +1 -2
- package/dist/components/select/components/select.trigger.svelte +17 -5
- package/dist/components/select/components/select.viewport.svelte +2 -4
- package/dist/components/select/components/select.viewport.svelte.d.ts +2 -2
- package/dist/components/select/exports.d.ts +1 -1
- package/dist/components/select/exports.js +1 -1
- package/dist/components/select/select.async.svelte +146 -83
- package/dist/components/select/select.async.svelte.d.ts +1 -1
- package/dist/components/select/select.svelte +107 -62
- package/dist/components/select/select.svelte.d.ts +4 -2
- package/dist/components/select/styles.d.ts +48 -139
- package/dist/components/select/styles.js +74 -101
- package/dist/components/select/types.d.ts +69 -29
- package/dist/components/select/types.js +0 -1
- package/dist/components/select/utils/get-item-key.d.ts +1 -1
- package/dist/components/separator/separator.svelte +4 -5
- package/dist/components/separator/separator.svelte.d.ts +2 -2
- package/dist/components/separator/styles.d.ts +18 -0
- package/dist/components/separator/styles.js +10 -0
- package/dist/components/separator/types.d.ts +2 -1
- package/dist/components/spinner/spinner.svelte +1 -6
- package/dist/internal/index.d.ts +1 -0
- package/dist/internal/index.js +1 -0
- package/dist/internal/lib/collection/grid-collection.d.ts +3 -0
- package/dist/internal/lib/collection/grid-collection.js +2 -0
- package/dist/internal/lib/collection/index.d.ts +5 -0
- package/dist/internal/lib/collection/index.js +5 -0
- package/dist/internal/lib/collection/list-collection.d.ts +3 -0
- package/dist/internal/lib/collection/list-collection.js +2 -0
- package/dist/internal/lib/collection/tree-collection.d.ts +4 -0
- package/dist/internal/lib/collection/tree-collection.js +3 -0
- package/dist/internal/lib/collection/use-list-collection.svelte.d.ts +88 -0
- package/dist/internal/lib/collection/use-list-collection.svelte.js +94 -0
- package/dist/internal/lib/collection/use-list-selection.svelte.d.ts +92 -0
- package/dist/internal/lib/collection/use-list-selection.svelte.js +80 -0
- package/dist/internal/lib/index.d.ts +1 -0
- package/dist/internal/lib/index.js +1 -0
- package/dist/internal/utils/equal.d.ts +3 -0
- package/dist/internal/utils/equal.js +56 -0
- package/dist/internal/utils/functions.d.ts +2 -0
- package/dist/internal/utils/functions.js +4 -0
- package/dist/internal/utils/guard.d.ts +5 -0
- package/dist/internal/utils/guard.js +5 -0
- package/dist/internal/utils/tailwindcss.d.ts +3 -2
- package/dist/internal/utils/tailwindcss.js +25 -5
- package/package.json +6 -4
- package/dist/components/app-shell/app-shell.stories.svelte +0 -107
- package/dist/components/app-shell/app-shell.stories.svelte.d.ts +0 -18
- package/dist/components/badge/badge.stories.svelte +0 -81
- package/dist/components/badge/badge.stories.svelte.d.ts +0 -19
- package/dist/components/breadcrumb/breadcrumb.stories.svelte +0 -67
- package/dist/components/breadcrumb/breadcrumb.stories.svelte.d.ts +0 -4
- package/dist/components/button/button.stories.svelte +0 -106
- package/dist/components/button/button.stories.svelte.d.ts +0 -19
- package/dist/components/button-group/button-group.stories.svelte +0 -59
- package/dist/components/button-group/button-group.stories.svelte.d.ts +0 -18
- package/dist/components/checkbox/checkbox.stories.svelte +0 -52
- package/dist/components/checkbox/checkbox.stories.svelte.d.ts +0 -18
- package/dist/components/collapsible/collapsible.stories.svelte +0 -69
- package/dist/components/collapsible/collapsible.stories.svelte.d.ts +0 -18
- package/dist/components/data-table/data-table.stories.svelte +0 -327
- package/dist/components/data-table/data-table.stories.svelte.d.ts +0 -4
- package/dist/components/dialog/dialog.stories.svelte +0 -102
- package/dist/components/dialog/dialog.stories.svelte.d.ts +0 -3
- package/dist/components/field/field.stories.svelte +0 -56
- package/dist/components/field/field.stories.svelte.d.ts +0 -19
- package/dist/components/input/input.stories.svelte +0 -41
- package/dist/components/input/input.stories.svelte.d.ts +0 -19
- package/dist/components/navigation/navigation.stories.svelte +0 -99
- package/dist/components/navigation/navigation.stories.svelte.d.ts +0 -19
- package/dist/components/pagination/pagination.stories.svelte +0 -69
- package/dist/components/pagination/pagination.stories.svelte.d.ts +0 -19
- package/dist/components/popover/popover.stories.svelte +0 -135
- package/dist/components/popover/popover.stories.svelte.d.ts +0 -4
- package/dist/components/segment/segment.stories.svelte +0 -57
- package/dist/components/segment/segment.stories.svelte.d.ts +0 -19
- package/dist/components/select/select.stories.svelte +0 -263
- package/dist/components/select/select.stories.svelte.d.ts +0 -4
- package/dist/components/separator/separator.stories.svelte +0 -44
- package/dist/components/separator/separator.stories.svelte.d.ts +0 -19
- package/dist/components/skeleton/skeleton.stories.svelte +0 -129
- package/dist/components/skeleton/skeleton.stories.svelte.d.ts +0 -19
- package/dist/components/spinner/spinner.stories.svelte +0 -29
- package/dist/components/spinner/spinner.stories.svelte.d.ts +0 -19
- package/dist/components/switch/switch.stories.svelte +0 -55
- package/dist/components/switch/switch.stories.svelte.d.ts +0 -19
- package/dist/components/textarea/textarea.stories.svelte +0 -36
- package/dist/components/textarea/textarea.stories.svelte.d.ts +0 -19
- package/dist/components/toast/toast.stories.svelte +0 -96
- package/dist/components/toast/toast.stories.svelte.d.ts +0 -19
- package/dist/internal/utils/arrays.d.ts +0 -1
- package/dist/internal/utils/arrays.js +0 -30
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { buttonVariants } from './styles.js';
|
|
3
3
|
import type { ButtonProps } from './types.js';
|
|
4
|
+
import { Spinner } from '../spinner/index.js';
|
|
4
5
|
import { cn } from '../../internal/utils/common.js';
|
|
5
6
|
import { Button, useId } from 'bits-ui';
|
|
6
7
|
import { fly } from 'svelte/transition';
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
|
|
39
40
|
{#if loading}
|
|
40
41
|
<span in:fly={{ duration: 200, x: 20 }} data-slot="loading" class={variants.chevron()}>
|
|
41
|
-
|
|
42
|
+
<Spinner size={18} />
|
|
42
43
|
</span>
|
|
43
44
|
{/if}
|
|
44
45
|
|
|
@@ -52,6 +52,11 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
52
52
|
root: string;
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
|
+
fullWidth: {
|
|
56
|
+
true: {
|
|
57
|
+
root: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
55
60
|
rounded: {
|
|
56
61
|
sm: {
|
|
57
62
|
root: string;
|
|
@@ -128,6 +133,11 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
128
133
|
root: string;
|
|
129
134
|
};
|
|
130
135
|
};
|
|
136
|
+
fullWidth: {
|
|
137
|
+
true: {
|
|
138
|
+
root: string;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
131
141
|
rounded: {
|
|
132
142
|
sm: {
|
|
133
143
|
root: string;
|
|
@@ -204,6 +214,11 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
204
214
|
root: string;
|
|
205
215
|
};
|
|
206
216
|
};
|
|
217
|
+
fullWidth: {
|
|
218
|
+
true: {
|
|
219
|
+
root: string;
|
|
220
|
+
};
|
|
221
|
+
};
|
|
207
222
|
rounded: {
|
|
208
223
|
sm: {
|
|
209
224
|
root: string;
|
|
@@ -2,7 +2,7 @@ import { tv } from '../../internal/utils/tailwindcss.js';
|
|
|
2
2
|
export const buttonVariants = tv({
|
|
3
3
|
slots: {
|
|
4
4
|
root: [
|
|
5
|
-
'cgui:flex cgui:items-center cgui:justify-center cgui:gap-1
|
|
5
|
+
'cgui:flex cgui:items-center cgui:justify-center cgui:gap-1 cgui:cursor-pointer cgui:px-2 cgui:text-center cgui:overflow-hidden',
|
|
6
6
|
'cgui:transition-all cgui:duration-250 cgui:ease-in-out',
|
|
7
7
|
'cgui:select-none cgui:font-medium',
|
|
8
8
|
'cgui:disabled:cursor-not-allowed cgui:disabled:opacity-50',
|
|
@@ -49,16 +49,16 @@ export const buttonVariants = tv({
|
|
|
49
49
|
},
|
|
50
50
|
size: {
|
|
51
51
|
xs: {
|
|
52
|
-
root: 'cgui:h-7.5',
|
|
52
|
+
root: 'cgui:h-7.5 cgui:px-2 cgui:text-body',
|
|
53
53
|
},
|
|
54
54
|
sm: {
|
|
55
|
-
root: 'cgui:h-8',
|
|
55
|
+
root: 'cgui:h-8 cgui:px-2.5 cgui:text-body',
|
|
56
56
|
},
|
|
57
57
|
md: {
|
|
58
|
-
root: 'cgui:h-
|
|
58
|
+
root: 'cgui:h-9 cgui:px-3 cgui:text-body',
|
|
59
59
|
},
|
|
60
60
|
lg: {
|
|
61
|
-
root: 'cgui:h-
|
|
61
|
+
root: 'cgui:h-10.5 cgui:px-4 cgui:text-heading-2',
|
|
62
62
|
},
|
|
63
63
|
},
|
|
64
64
|
w: {
|
|
@@ -75,6 +75,11 @@ export const buttonVariants = tv({
|
|
|
75
75
|
root: '',
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
|
+
fullWidth: {
|
|
79
|
+
true: {
|
|
80
|
+
root: 'cgui:w-full',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
78
83
|
rounded: {
|
|
79
84
|
sm: {
|
|
80
85
|
root: 'cgui:rounded-sm',
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ButtonGroupRootProps } from '../types.js';
|
|
3
3
|
import { SLOT_ATTR_NAME } from '../../../internal/constants/attrs.js';
|
|
4
|
-
import { cn
|
|
4
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
5
5
|
import { box } from 'svelte-toolbelt';
|
|
6
6
|
import { ButtonGroupStylesContext, buttonGroupStyles } from '../styles.js';
|
|
7
7
|
|
|
8
|
-
const uid = $props.id();
|
|
9
8
|
let {
|
|
10
9
|
children,
|
|
11
10
|
ref = $bindable(null),
|
|
12
|
-
id = useId(uid),
|
|
13
11
|
orientation = 'horizontal',
|
|
14
12
|
class: className,
|
|
15
13
|
...restProps
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { arraysAreEqual } from '../../../internal/utils/arrays.js';
|
|
2
1
|
import { getDataDisabled } from '../../../internal/utils/attrs.js';
|
|
3
2
|
import { keyWithPrefix } from '../../../internal/utils/common.js';
|
|
3
|
+
import { isEqual } from '../../../internal/utils/equal.js';
|
|
4
4
|
import { Context, watch } from 'runed';
|
|
5
5
|
import { attachRef } from 'svelte-toolbelt';
|
|
6
6
|
const CollapsibleRootContext = new Context(keyWithPrefix('collapsible-root'));
|
|
@@ -28,7 +28,7 @@ export class CollapsibleGroupState {
|
|
|
28
28
|
newValue = [...$state.snapshot(this.opts.value.current), value];
|
|
29
29
|
}
|
|
30
30
|
this.opts.value.current = newValue;
|
|
31
|
-
if (
|
|
31
|
+
if (isEqual(this.opts.value.current, newValue))
|
|
32
32
|
return;
|
|
33
33
|
this.opts.onValueChange.current(newValue);
|
|
34
34
|
}
|
|
@@ -40,7 +40,7 @@ export class CollapsibleGroupState {
|
|
|
40
40
|
return;
|
|
41
41
|
const newValue = this.opts.value.current.filter((v) => v !== value);
|
|
42
42
|
this.opts.value.current = newValue;
|
|
43
|
-
if (
|
|
43
|
+
if (isEqual(this.opts.value.current, newValue))
|
|
44
44
|
return;
|
|
45
45
|
this.opts.onValueChange.current(newValue);
|
|
46
46
|
}
|
|
@@ -73,34 +73,34 @@ export declare const CollapsibleStylesContext: Context<ReadableBox<{
|
|
|
73
73
|
root: (slotProps?: ({
|
|
74
74
|
variant?: "default" | "clean" | undefined;
|
|
75
75
|
iconPosition?: "end" | "start" | undefined;
|
|
76
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
76
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
77
77
|
trigger: (slotProps?: ({
|
|
78
78
|
variant?: "default" | "clean" | undefined;
|
|
79
79
|
iconPosition?: "end" | "start" | undefined;
|
|
80
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
80
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
81
81
|
icon: (slotProps?: ({
|
|
82
82
|
variant?: "default" | "clean" | undefined;
|
|
83
83
|
iconPosition?: "end" | "start" | undefined;
|
|
84
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
84
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
85
85
|
content: (slotProps?: ({
|
|
86
86
|
variant?: "default" | "clean" | undefined;
|
|
87
87
|
iconPosition?: "end" | "start" | undefined;
|
|
88
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
88
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
89
89
|
} & {
|
|
90
90
|
root: (slotProps?: ({
|
|
91
91
|
variant?: "default" | "clean" | undefined;
|
|
92
92
|
iconPosition?: "end" | "start" | undefined;
|
|
93
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
93
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
94
94
|
trigger: (slotProps?: ({
|
|
95
95
|
variant?: "default" | "clean" | undefined;
|
|
96
96
|
iconPosition?: "end" | "start" | undefined;
|
|
97
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
97
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
98
98
|
icon: (slotProps?: ({
|
|
99
99
|
variant?: "default" | "clean" | undefined;
|
|
100
100
|
iconPosition?: "end" | "start" | undefined;
|
|
101
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
101
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
102
102
|
content: (slotProps?: ({
|
|
103
103
|
variant?: "default" | "clean" | undefined;
|
|
104
104
|
iconPosition?: "end" | "start" | undefined;
|
|
105
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
105
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
|
|
106
106
|
} & {}>>;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import FlexRender from './components/flex-render.svelte';
|
|
15
15
|
import { type DataTableProps, type RowData } from './types.js';
|
|
16
16
|
|
|
17
|
-
let { ref = $bindable(null), table, empty,
|
|
17
|
+
let { ref = $bindable(null), table, empty, ...restProps }: DataTableProps<TData> = $props();
|
|
18
18
|
|
|
19
19
|
let isFirstLoaded = $state(false);
|
|
20
20
|
|
|
@@ -7,9 +7,9 @@ export const usePaginationState = (opts) => {
|
|
|
7
7
|
get value() {
|
|
8
8
|
return value;
|
|
9
9
|
},
|
|
10
|
-
set value(
|
|
11
|
-
value =
|
|
12
|
-
opts?.onValueChange?.(
|
|
10
|
+
set value(v) {
|
|
11
|
+
value = v;
|
|
12
|
+
opts?.onValueChange?.(v);
|
|
13
13
|
},
|
|
14
14
|
updater: (updater) => {
|
|
15
15
|
let newPaginationState;
|
|
@@ -4,9 +4,9 @@ export const useResizeState = (opts) => {
|
|
|
4
4
|
get value() {
|
|
5
5
|
return value;
|
|
6
6
|
},
|
|
7
|
-
set value(
|
|
8
|
-
value =
|
|
9
|
-
opts?.onValueChange?.(
|
|
7
|
+
set value(v) {
|
|
8
|
+
value = v;
|
|
9
|
+
opts?.onValueChange?.(v);
|
|
10
10
|
},
|
|
11
11
|
updater: (updater) => {
|
|
12
12
|
let newColumnSizing;
|
|
@@ -4,9 +4,9 @@ export const useRowSelectionState = (opts) => {
|
|
|
4
4
|
get value() {
|
|
5
5
|
return value;
|
|
6
6
|
},
|
|
7
|
-
set value(
|
|
8
|
-
value =
|
|
9
|
-
opts?.onValueChange?.(
|
|
7
|
+
set value(v) {
|
|
8
|
+
value = v;
|
|
9
|
+
opts?.onValueChange?.(v);
|
|
10
10
|
},
|
|
11
11
|
updater: (updater) => {
|
|
12
12
|
let newRowSelection;
|
|
@@ -8,13 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
const uid = $props.id();
|
|
10
10
|
|
|
11
|
-
let {
|
|
12
|
-
children,
|
|
13
|
-
id = useId(uid),
|
|
14
|
-
ref = $bindable(null),
|
|
15
|
-
class: className,
|
|
16
|
-
...restProps
|
|
17
|
-
}: DialogOverlayProps = $props();
|
|
11
|
+
let { id = useId(uid), ref = $bindable(null), class: className, ...restProps }: DialogOverlayProps = $props();
|
|
18
12
|
|
|
19
13
|
const overlayState = DialogOverlayState.create({
|
|
20
14
|
ref: boxWith(
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { SLOT_ATTR_NAME } from '../../../internal/constants/attrs.js';
|
|
3
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
5
|
+
import { dropdownContentStyles } from '../styles.js';
|
|
6
|
+
import type { DropdownContentProps } from '../types.js';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
children,
|
|
10
|
+
ref = $bindable(null),
|
|
11
|
+
class: className,
|
|
12
|
+
sideOffset = 4,
|
|
13
|
+
variant = 'default',
|
|
14
|
+
rounded = 'default',
|
|
15
|
+
shadow = true,
|
|
16
|
+
w = 'default',
|
|
17
|
+
gap = 'default',
|
|
18
|
+
...restProps
|
|
19
|
+
}: DropdownContentProps = $props();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<DropdownMenuPrimitive.Content
|
|
23
|
+
bind:ref
|
|
24
|
+
class={cn(
|
|
25
|
+
dropdownContentStyles({
|
|
26
|
+
variant,
|
|
27
|
+
rounded,
|
|
28
|
+
shadow,
|
|
29
|
+
w,
|
|
30
|
+
gap,
|
|
31
|
+
}),
|
|
32
|
+
className
|
|
33
|
+
)}
|
|
34
|
+
{sideOffset}
|
|
35
|
+
{...restProps}
|
|
36
|
+
{...{ [SLOT_ATTR_NAME]: 'dropdown-content' }}
|
|
37
|
+
>
|
|
38
|
+
{@render children?.()}
|
|
39
|
+
</DropdownMenuPrimitive.Content>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { SLOT_ATTR_NAME } from '../../../internal/constants/attrs.js';
|
|
3
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
5
|
+
import { dropdownGroupHeadingStyles } from '../styles.js';
|
|
6
|
+
import type { DropdownGroupHeadingProps } from '../types.js';
|
|
7
|
+
|
|
8
|
+
let { ref = $bindable(null), class: className, ...restProps }: DropdownGroupHeadingProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<DropdownMenuPrimitive.GroupHeading
|
|
12
|
+
bind:ref
|
|
13
|
+
class={cn(dropdownGroupHeadingStyles(), className)}
|
|
14
|
+
{...restProps}
|
|
15
|
+
{...{ [SLOT_ATTR_NAME]: 'dropdown-group-heading' }}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { SLOT_ATTR_NAME } from '../../../internal/constants/attrs.js';
|
|
3
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
5
|
+
import { dropdownGroupStyles } from '../styles.js';
|
|
6
|
+
import type { DropdownGroupProps } from '../types.js';
|
|
7
|
+
|
|
8
|
+
let { ref = $bindable(null), class: className, ...restProps }: DropdownGroupProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<DropdownMenuPrimitive.Group
|
|
12
|
+
bind:ref
|
|
13
|
+
class={cn(dropdownGroupStyles(), className)}
|
|
14
|
+
{...restProps}
|
|
15
|
+
{...{ [SLOT_ATTR_NAME]: 'dropdown-group' }}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { SLOT_ATTR_NAME } from '../../../internal/constants/attrs.js';
|
|
3
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
5
|
+
import { dropdownItemStyles } from '../styles.js';
|
|
6
|
+
import type { DropdownItemProps } from '../types.js';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
class: className,
|
|
11
|
+
gap = 'default',
|
|
12
|
+
rounded = 'default',
|
|
13
|
+
...restProps
|
|
14
|
+
}: DropdownItemProps = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<DropdownMenuPrimitive.Item
|
|
18
|
+
bind:ref
|
|
19
|
+
class={cn(dropdownItemStyles({ gap, rounded }), className)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
{...{ [SLOT_ATTR_NAME]: 'dropdown-item' }}
|
|
22
|
+
/>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import type { DropdownPortalProps } from '../types.js';
|
|
4
|
+
|
|
5
|
+
let { children, ...restProps }: DropdownPortalProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<DropdownMenuPrimitive.Portal {...restProps}>
|
|
9
|
+
{@render children?.()}
|
|
10
|
+
</DropdownMenuPrimitive.Portal>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import type { DropdownRootProps } from '../types.js';
|
|
4
|
+
|
|
5
|
+
let { children, open = $bindable(false), ...restProps }: DropdownRootProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<DropdownMenuPrimitive.Root bind:open {...restProps}>
|
|
9
|
+
{@render children?.()}
|
|
10
|
+
</DropdownMenuPrimitive.Root>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { SLOT_ATTR_NAME } from '../../../internal/constants/attrs.js';
|
|
3
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
5
|
+
import { dropdownSeparatorStyles } from '../styles.js';
|
|
6
|
+
import type { DropdownSeparatorProps } from '../types.js';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
class: className,
|
|
11
|
+
orientation = 'horizontal',
|
|
12
|
+
...restProps
|
|
13
|
+
}: DropdownSeparatorProps = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<DropdownMenuPrimitive.Separator
|
|
17
|
+
bind:ref
|
|
18
|
+
{orientation}
|
|
19
|
+
class={cn(dropdownSeparatorStyles({ orientation }), className)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
{...{ [SLOT_ATTR_NAME]: 'dropdown-separator' }}
|
|
22
|
+
/>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { SLOT_ATTR_NAME } from '../../../internal/constants/attrs.js';
|
|
3
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
5
|
+
import { dropdownSubContentStyles } from '../styles.js';
|
|
6
|
+
import type { DropdownSubContentProps } from '../types.js';
|
|
7
|
+
|
|
8
|
+
let { ref = $bindable(null), class: className, ...restProps }: DropdownSubContentProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<DropdownMenuPrimitive.SubContent
|
|
12
|
+
bind:ref
|
|
13
|
+
class={cn(dropdownSubContentStyles(), className)}
|
|
14
|
+
{...restProps}
|
|
15
|
+
{...{ [SLOT_ATTR_NAME]: 'dropdown-sub-content' }}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Icon } from '../../icons/index.js';
|
|
3
|
+
import { SLOT_ATTR_NAME } from '../../../internal/constants/attrs.js';
|
|
4
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
5
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
6
|
+
import { dropdownSubTriggerStyles } from '../styles.js';
|
|
7
|
+
import type { DropdownSubTriggerProps } from '../types.js';
|
|
8
|
+
|
|
9
|
+
let { ref = $bindable(null), class: className, children, ...restProps }: DropdownSubTriggerProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DropdownMenuPrimitive.SubTrigger
|
|
13
|
+
bind:ref
|
|
14
|
+
class={cn(dropdownSubTriggerStyles(), className)}
|
|
15
|
+
{...restProps}
|
|
16
|
+
{...{ [SLOT_ATTR_NAME]: 'dropdown-sub-trigger' }}
|
|
17
|
+
>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
|
|
20
|
+
<Icon.ChevronSmallDown class="cgui:ms-auto" />
|
|
21
|
+
</DropdownMenuPrimitive.SubTrigger>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import type { DropdownSubProps } from '../types.js';
|
|
4
|
+
|
|
5
|
+
let { open = $bindable(false), ...restProps }: DropdownSubProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<DropdownMenuPrimitive.Sub bind:open {...restProps} />
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { SLOT_ATTR_NAME } from '../../../internal/constants/attrs.js';
|
|
3
|
+
import { cn } from '../../../internal/utils/common.js';
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
5
|
+
import { dropdownTriggerStyles } from '../styles.js';
|
|
6
|
+
import type { DropdownTriggerProps } from '../types.js';
|
|
7
|
+
|
|
8
|
+
let { ref = $bindable(null), class: className, ...restProps }: DropdownTriggerProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<DropdownMenuPrimitive.Trigger
|
|
12
|
+
bind:ref
|
|
13
|
+
class={cn(dropdownTriggerStyles(), className)}
|
|
14
|
+
{...restProps}
|
|
15
|
+
{...{ [SLOT_ATTR_NAME]: 'dropdown-trigger' }}
|
|
16
|
+
/>
|