@casinogate/ui 2.0.1 → 2.0.3
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 +330 -0
- package/dist/atomic/icons/calendar.svelte +13 -0
- package/dist/atomic/icons/calendar.svelte.d.ts +3 -0
- package/dist/atomic/icons/exports.d.ts +1 -0
- package/dist/atomic/icons/exports.js +1 -0
- package/dist/composed/calendar/api/format-caption.d.ts +5 -0
- package/dist/composed/calendar/api/format-caption.js +13 -0
- package/dist/composed/calendar/api/index.d.ts +1 -0
- package/dist/composed/calendar/api/index.js +1 -0
- package/dist/composed/calendar/index.d.ts +2 -0
- package/dist/composed/calendar/index.js +1 -0
- package/dist/composed/calendar/root/calendar.root.svelte +91 -0
- package/dist/composed/calendar/root/calendar.root.svelte.d.ts +4 -0
- package/dist/composed/calendar/root/index.d.ts +1 -0
- package/dist/composed/calendar/root/index.js +1 -0
- package/dist/composed/calendar/types.d.ts +32 -0
- package/dist/composed/calendar/types.js +1 -0
- package/dist/composed/combobox/creatable/combobox.creatable.svelte +1 -1
- package/dist/composed/combobox/types.d.ts +12 -12
- package/dist/composed/date-picker/index.d.ts +2 -0
- package/dist/composed/date-picker/index.js +1 -0
- package/dist/composed/date-picker/root/date-picker.root.svelte +144 -0
- package/dist/composed/date-picker/root/date-picker.root.svelte.d.ts +4 -0
- package/dist/composed/date-picker/root/index.d.ts +1 -0
- package/dist/composed/date-picker/root/index.js +1 -0
- package/dist/composed/date-picker/types.d.ts +45 -0
- package/dist/composed/date-picker/types.js +1 -0
- package/dist/composed/index.d.ts +2 -0
- package/dist/composed/index.js +2 -0
- package/dist/internal/utils/tailwindcss.d.ts +1 -1
- package/dist/primitives/calendar/components/calendar.body.svelte +20 -0
- package/dist/primitives/calendar/components/calendar.body.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.cell.svelte +10 -0
- package/dist/primitives/calendar/components/calendar.cell.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.day.svelte +10 -0
- package/dist/primitives/calendar/components/calendar.day.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.grid-body.svelte +10 -0
- package/dist/primitives/calendar/components/calendar.grid-body.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.grid-head.svelte +10 -0
- package/dist/primitives/calendar/components/calendar.grid-head.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.grid-row.svelte +10 -0
- package/dist/primitives/calendar/components/calendar.grid-row.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.grid.svelte +10 -0
- package/dist/primitives/calendar/components/calendar.grid.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.head-cell.svelte +10 -0
- package/dist/primitives/calendar/components/calendar.head-cell.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.header.svelte +10 -0
- package/dist/primitives/calendar/components/calendar.header.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.heading.svelte +10 -0
- package/dist/primitives/calendar/components/calendar.heading.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.month-select.svelte +37 -0
- package/dist/primitives/calendar/components/calendar.month-select.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.next-button.svelte +26 -0
- package/dist/primitives/calendar/components/calendar.next-button.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.prev-button.svelte +26 -0
- package/dist/primitives/calendar/components/calendar.prev-button.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.root.svelte +35 -0
- package/dist/primitives/calendar/components/calendar.root.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/calendar.year-select.svelte +37 -0
- package/dist/primitives/calendar/components/calendar.year-select.svelte.d.ts +4 -0
- package/dist/primitives/calendar/components/index.d.ts +15 -0
- package/dist/primitives/calendar/components/index.js +15 -0
- package/dist/primitives/calendar/index.d.ts +2 -0
- package/dist/primitives/calendar/index.js +2 -0
- package/dist/primitives/calendar/styles.d.ts +59 -0
- package/dist/primitives/calendar/styles.js +72 -0
- package/dist/primitives/calendar/types.d.ts +30 -0
- package/dist/primitives/calendar/types.js +1 -0
- package/dist/primitives/combobox/components/combobox.item.svelte +10 -24
- package/dist/primitives/combobox/components/combobox.root.svelte +1 -16
- package/dist/primitives/combobox/components/combobox.svelte.d.ts +1 -1
- package/dist/primitives/combobox/types.d.ts +7 -35
- package/dist/primitives/date-picker/components/date-picker.calendar.svelte +10 -0
- package/dist/primitives/date-picker/components/date-picker.calendar.svelte.d.ts +4 -0
- package/dist/primitives/date-picker/components/date-picker.content.svelte +28 -0
- package/dist/primitives/date-picker/components/date-picker.content.svelte.d.ts +4 -0
- package/dist/primitives/date-picker/components/date-picker.input.svelte +28 -0
- package/dist/primitives/date-picker/components/date-picker.input.svelte.d.ts +4 -0
- package/dist/primitives/date-picker/components/date-picker.portal.svelte +10 -0
- package/dist/primitives/date-picker/components/date-picker.portal.svelte.d.ts +3 -0
- package/dist/primitives/date-picker/components/date-picker.root.svelte +21 -0
- package/dist/primitives/date-picker/components/date-picker.root.svelte.d.ts +4 -0
- package/dist/primitives/date-picker/components/date-picker.segment.svelte +10 -0
- package/dist/primitives/date-picker/components/date-picker.segment.svelte.d.ts +4 -0
- package/dist/primitives/date-picker/components/date-picker.trigger.svelte +61 -0
- package/dist/primitives/date-picker/components/date-picker.trigger.svelte.d.ts +4 -0
- package/dist/primitives/date-picker/components/index.d.ts +7 -0
- package/dist/primitives/date-picker/components/index.js +7 -0
- package/dist/primitives/date-picker/index.d.ts +2 -0
- package/dist/primitives/date-picker/index.js +2 -0
- package/dist/primitives/date-picker/styles.d.ts +171 -0
- package/dist/primitives/date-picker/styles.js +143 -0
- package/dist/primitives/date-picker/types.d.ts +14 -0
- package/dist/primitives/date-picker/types.js +1 -0
- package/dist/primitives/select/styles.js +3 -0
- package/package.json +2 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Icon } from '../../../atomic/icons/index.js';
|
|
3
|
+
import { boolAttr } from '../../../internal/utils/attrs.js';
|
|
4
|
+
import { cn } from '../../../internal/utils/tailwindcss.js';
|
|
5
|
+
import { DatePicker as Primitive } from 'bits-ui';
|
|
6
|
+
import { datePickerTriggerVariants } from '../styles.js';
|
|
7
|
+
import type { DatePickerTriggerProps } from '../types.js';
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
ref = $bindable(null),
|
|
11
|
+
class: className,
|
|
12
|
+
child: childSnippet,
|
|
13
|
+
children,
|
|
14
|
+
hasChevron = true,
|
|
15
|
+
size = 'md',
|
|
16
|
+
variant = 'primary',
|
|
17
|
+
rounded = 'sm',
|
|
18
|
+
fullWidth = true,
|
|
19
|
+
...restProps
|
|
20
|
+
}: DatePickerTriggerProps = $props();
|
|
21
|
+
|
|
22
|
+
const attrs = $derived({
|
|
23
|
+
'data-slot': 'trigger',
|
|
24
|
+
'data-has-chevron': boolAttr(hasChevron),
|
|
25
|
+
class: cn(
|
|
26
|
+
datePickerTriggerVariants({
|
|
27
|
+
size,
|
|
28
|
+
variant,
|
|
29
|
+
rounded,
|
|
30
|
+
fullWidth,
|
|
31
|
+
hasChevron,
|
|
32
|
+
}),
|
|
33
|
+
className
|
|
34
|
+
),
|
|
35
|
+
...restProps,
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<Primitive.Trigger bind:ref {...attrs}>
|
|
40
|
+
{#snippet child({ props })}
|
|
41
|
+
{#if childSnippet}
|
|
42
|
+
{@render childSnippet({ props })}
|
|
43
|
+
{:else}
|
|
44
|
+
<button {...props}>
|
|
45
|
+
{@render children?.()}
|
|
46
|
+
|
|
47
|
+
{#if hasChevron}
|
|
48
|
+
<span
|
|
49
|
+
data-slot="chevron"
|
|
50
|
+
class={cn(
|
|
51
|
+
'cgui:absolute cgui:top-1/2 cgui:-translate-y-1/2 cgui:right-2',
|
|
52
|
+
'cgui:ms-auto cgui:text-fg-regular'
|
|
53
|
+
)}
|
|
54
|
+
>
|
|
55
|
+
<Icon.Calendar width={18} height={18} />
|
|
56
|
+
</span>
|
|
57
|
+
{/if}
|
|
58
|
+
</button>
|
|
59
|
+
{/if}
|
|
60
|
+
{/snippet}
|
|
61
|
+
</Primitive.Trigger>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Calendar } from './date-picker.calendar.svelte';
|
|
2
|
+
export { default as Content } from './date-picker.content.svelte';
|
|
3
|
+
export { default as Input } from './date-picker.input.svelte';
|
|
4
|
+
export { default as Portal } from './date-picker.portal.svelte';
|
|
5
|
+
export { default as Root } from './date-picker.root.svelte';
|
|
6
|
+
export { default as Segment } from './date-picker.segment.svelte';
|
|
7
|
+
export { default as Trigger } from './date-picker.trigger.svelte';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Calendar } from './date-picker.calendar.svelte';
|
|
2
|
+
export { default as Content } from './date-picker.content.svelte';
|
|
3
|
+
export { default as Input } from './date-picker.input.svelte';
|
|
4
|
+
export { default as Portal } from './date-picker.portal.svelte';
|
|
5
|
+
export { default as Root } from './date-picker.root.svelte';
|
|
6
|
+
export { default as Segment } from './date-picker.segment.svelte';
|
|
7
|
+
export { default as Trigger } from './date-picker.trigger.svelte';
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { type VariantProps } from '../../internal/utils/tailwindcss.js';
|
|
2
|
+
import { Context } from 'runed';
|
|
3
|
+
import type { ReadableBoxedValues } from 'svelte-toolbelt';
|
|
4
|
+
type DatePickerRounded = 'none' | 'xs' | 'sm' | 'md' | 'lg';
|
|
5
|
+
export declare const datePickerTriggerVariants: import("tailwind-variants").TVReturnType<{
|
|
6
|
+
variant: {
|
|
7
|
+
primary: string[];
|
|
8
|
+
outline: string[];
|
|
9
|
+
clear: never[];
|
|
10
|
+
};
|
|
11
|
+
size: {
|
|
12
|
+
sm: string[];
|
|
13
|
+
md: string[];
|
|
14
|
+
lg: string[];
|
|
15
|
+
};
|
|
16
|
+
rounded: {
|
|
17
|
+
sm: string[];
|
|
18
|
+
md: string[];
|
|
19
|
+
lg: string[];
|
|
20
|
+
};
|
|
21
|
+
hasChevron: {
|
|
22
|
+
true: string[];
|
|
23
|
+
};
|
|
24
|
+
fullWidth: {
|
|
25
|
+
true: string[];
|
|
26
|
+
};
|
|
27
|
+
}, undefined, string[], {
|
|
28
|
+
variant: {
|
|
29
|
+
primary: string[];
|
|
30
|
+
outline: string[];
|
|
31
|
+
clear: never[];
|
|
32
|
+
};
|
|
33
|
+
size: {
|
|
34
|
+
sm: string[];
|
|
35
|
+
md: string[];
|
|
36
|
+
lg: string[];
|
|
37
|
+
};
|
|
38
|
+
rounded: {
|
|
39
|
+
sm: string[];
|
|
40
|
+
md: string[];
|
|
41
|
+
lg: string[];
|
|
42
|
+
};
|
|
43
|
+
hasChevron: {
|
|
44
|
+
true: string[];
|
|
45
|
+
};
|
|
46
|
+
fullWidth: {
|
|
47
|
+
true: string[];
|
|
48
|
+
};
|
|
49
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
50
|
+
variant: {
|
|
51
|
+
primary: string[];
|
|
52
|
+
outline: string[];
|
|
53
|
+
clear: never[];
|
|
54
|
+
};
|
|
55
|
+
size: {
|
|
56
|
+
sm: string[];
|
|
57
|
+
md: string[];
|
|
58
|
+
lg: string[];
|
|
59
|
+
};
|
|
60
|
+
rounded: {
|
|
61
|
+
sm: string[];
|
|
62
|
+
md: string[];
|
|
63
|
+
lg: string[];
|
|
64
|
+
};
|
|
65
|
+
hasChevron: {
|
|
66
|
+
true: string[];
|
|
67
|
+
};
|
|
68
|
+
fullWidth: {
|
|
69
|
+
true: string[];
|
|
70
|
+
};
|
|
71
|
+
}, undefined, string[], unknown, unknown, undefined>>;
|
|
72
|
+
export declare const datePickerContentVariants: import("tailwind-variants").TVReturnType<{
|
|
73
|
+
rounded: {
|
|
74
|
+
none: never[];
|
|
75
|
+
xs: string[];
|
|
76
|
+
sm: string[];
|
|
77
|
+
md: string[];
|
|
78
|
+
lg: string[];
|
|
79
|
+
};
|
|
80
|
+
}, undefined, string[], {
|
|
81
|
+
rounded: {
|
|
82
|
+
none: never[];
|
|
83
|
+
xs: string[];
|
|
84
|
+
sm: string[];
|
|
85
|
+
md: string[];
|
|
86
|
+
lg: string[];
|
|
87
|
+
};
|
|
88
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
89
|
+
rounded: {
|
|
90
|
+
none: never[];
|
|
91
|
+
xs: string[];
|
|
92
|
+
sm: string[];
|
|
93
|
+
md: string[];
|
|
94
|
+
lg: string[];
|
|
95
|
+
};
|
|
96
|
+
}, undefined, string[], unknown, unknown, undefined>>;
|
|
97
|
+
export declare const datePickerCalendarVariants: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
98
|
+
export declare const datePickerInputVariants: import("tailwind-variants").TVReturnType<{
|
|
99
|
+
variant: {
|
|
100
|
+
primary: string[];
|
|
101
|
+
outline: string[];
|
|
102
|
+
clear: never[];
|
|
103
|
+
};
|
|
104
|
+
size: {
|
|
105
|
+
sm: string[];
|
|
106
|
+
md: string[];
|
|
107
|
+
lg: string[];
|
|
108
|
+
};
|
|
109
|
+
rounded: {
|
|
110
|
+
none: never[];
|
|
111
|
+
sm: string[];
|
|
112
|
+
md: string[];
|
|
113
|
+
lg: string[];
|
|
114
|
+
};
|
|
115
|
+
fullWidth: {
|
|
116
|
+
true: string[];
|
|
117
|
+
};
|
|
118
|
+
}, undefined, string[], {
|
|
119
|
+
variant: {
|
|
120
|
+
primary: string[];
|
|
121
|
+
outline: string[];
|
|
122
|
+
clear: never[];
|
|
123
|
+
};
|
|
124
|
+
size: {
|
|
125
|
+
sm: string[];
|
|
126
|
+
md: string[];
|
|
127
|
+
lg: string[];
|
|
128
|
+
};
|
|
129
|
+
rounded: {
|
|
130
|
+
none: never[];
|
|
131
|
+
sm: string[];
|
|
132
|
+
md: string[];
|
|
133
|
+
lg: string[];
|
|
134
|
+
};
|
|
135
|
+
fullWidth: {
|
|
136
|
+
true: string[];
|
|
137
|
+
};
|
|
138
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
139
|
+
variant: {
|
|
140
|
+
primary: string[];
|
|
141
|
+
outline: string[];
|
|
142
|
+
clear: never[];
|
|
143
|
+
};
|
|
144
|
+
size: {
|
|
145
|
+
sm: string[];
|
|
146
|
+
md: string[];
|
|
147
|
+
lg: string[];
|
|
148
|
+
};
|
|
149
|
+
rounded: {
|
|
150
|
+
none: never[];
|
|
151
|
+
sm: string[];
|
|
152
|
+
md: string[];
|
|
153
|
+
lg: string[];
|
|
154
|
+
};
|
|
155
|
+
fullWidth: {
|
|
156
|
+
true: string[];
|
|
157
|
+
};
|
|
158
|
+
}, undefined, string[], unknown, unknown, undefined>>;
|
|
159
|
+
export declare const datePickerSegmentVariants: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
160
|
+
export type DatePickerTriggerVariants = Omit<VariantProps<typeof datePickerTriggerVariants>, 'hasChevron'>;
|
|
161
|
+
export type DatePickerContentVariants = VariantProps<typeof datePickerContentVariants>;
|
|
162
|
+
export type DatePickerCalendarVariants = VariantProps<typeof datePickerCalendarVariants>;
|
|
163
|
+
export type DatePickerInputVariants = VariantProps<typeof datePickerInputVariants>;
|
|
164
|
+
export type DatePickerSegmentVariants = VariantProps<typeof datePickerSegmentVariants>;
|
|
165
|
+
export type { DatePickerRounded };
|
|
166
|
+
export type DatePickerRootContextValue = ReadableBoxedValues<{
|
|
167
|
+
rounded: DatePickerRounded;
|
|
168
|
+
}>;
|
|
169
|
+
export declare const DatePickerRootStylesContext: Context<ReadableBoxedValues<{
|
|
170
|
+
rounded: DatePickerRounded;
|
|
171
|
+
}>>;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { keyWithPrefix } from '../../internal/utils/common.js';
|
|
2
|
+
import { tv } from '../../internal/utils/tailwindcss.js';
|
|
3
|
+
import { Context } from 'runed';
|
|
4
|
+
export const datePickerTriggerVariants = tv({
|
|
5
|
+
base: [
|
|
6
|
+
'cgui:group/date-picker-trigger',
|
|
7
|
+
'cgui:relative cgui:inline-flex cgui:items-center cgui:gap-1',
|
|
8
|
+
'cgui:text-body',
|
|
9
|
+
'cgui:transition-all cgui:duration-250 cgui:ease-in-out',
|
|
10
|
+
'cgui:[&_svg]:shrink-0 cgui:[&_svg]:pointer-events-none cgui:[&_svg]:text-icon-regular cgui:[&_svg:not([class*="size-"])]:size-4',
|
|
11
|
+
'cgui:has-[data-slot=chevron]:pr-3',
|
|
12
|
+
'cgui:[[data-slot=date-picker-input]_&]:bg-transparent!',
|
|
13
|
+
'cgui:[[data-slot=date-picker-input]_&]:w-auto!',
|
|
14
|
+
'cgui:[[data-slot=date-picker-input]_&]:border-0!',
|
|
15
|
+
'cgui:[[data-slot=date-picker-input]_&]:shadow-none!',
|
|
16
|
+
'cgui:[[data-slot=date-picker-input]_&]:min-h-0!',
|
|
17
|
+
'cgui:[[data-slot=date-picker-input]_&]:pl-4 cgui:[[data-slot=date-picker-input]_&]:pr-0 cgui:[[data-slot=date-picker-input]_&]:py-0!',
|
|
18
|
+
'cgui:[[data-slot=date-picker-input]_&]:rounded-none!',
|
|
19
|
+
'cgui:[[data-slot=date-picker-input]_&]:ms-auto!',
|
|
20
|
+
'cgui:[[data-slot=date-picker-input]_&]:text-fg-regular',
|
|
21
|
+
'cgui:[[data-slot=date-picker-input]_&]:hover:text-fg-dark',
|
|
22
|
+
'cgui:[[data-slot=date-picker-input]_&]:cursor-pointer',
|
|
23
|
+
'cgui:[[data-slot=date-picker-input]_&_[data-slot=chevron]]:relative!',
|
|
24
|
+
'cgui:[[data-slot=date-picker-input]_&_[data-slot=chevron]]:top-auto!',
|
|
25
|
+
'cgui:[[data-slot=date-picker-input]_&_[data-slot=chevron]]:right-auto!',
|
|
26
|
+
'cgui:[[data-slot=date-picker-input]_&_[data-slot=chevron]]:translate-y-0!',
|
|
27
|
+
],
|
|
28
|
+
variants: {
|
|
29
|
+
variant: {
|
|
30
|
+
primary: [
|
|
31
|
+
'cgui:bg-surface-lightest cgui:border cgui:border-stroke-default',
|
|
32
|
+
'cgui:data-[placeholder]:text-fg-regular/70 cgui:text-fg-dark',
|
|
33
|
+
],
|
|
34
|
+
outline: [
|
|
35
|
+
'cgui:data-[placeholder]:text-fg-regular cgui:text-fg-dark',
|
|
36
|
+
'cgui:border-b cgui:border-b-stroke-default',
|
|
37
|
+
'cgui:rounded-none',
|
|
38
|
+
],
|
|
39
|
+
clear: [],
|
|
40
|
+
},
|
|
41
|
+
size: {
|
|
42
|
+
sm: ['cgui:min-h-7.5', 'cgui:px-2.5 cgui:py-1.5', 'cgui:data-[has-chevron]:pr-8'],
|
|
43
|
+
md: ['cgui:min-h-9', 'cgui:px-3 cgui:py-2', 'cgui:data-[has-chevron]:pr-10'],
|
|
44
|
+
lg: ['cgui:min-h-11', 'cgui:text-heading-2', 'cgui:px-4 cgui:py-2.5', 'cgui:data-[has-chevron]:pr-14'],
|
|
45
|
+
},
|
|
46
|
+
rounded: {
|
|
47
|
+
sm: ['cgui:rounded-sm'],
|
|
48
|
+
md: ['cgui:rounded-md'],
|
|
49
|
+
lg: ['cgui:rounded-lg'],
|
|
50
|
+
},
|
|
51
|
+
hasChevron: {
|
|
52
|
+
true: [''],
|
|
53
|
+
},
|
|
54
|
+
fullWidth: {
|
|
55
|
+
true: ['cgui:w-full'],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
defaultVariants: {
|
|
59
|
+
variant: 'primary',
|
|
60
|
+
size: 'md',
|
|
61
|
+
rounded: 'sm',
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
export const datePickerContentVariants = tv({
|
|
65
|
+
base: [
|
|
66
|
+
'cgui:z-(--cg-ui-z-index-popover)',
|
|
67
|
+
'cgui:bg-surface-white cgui:shadow-popover cgui:p-4',
|
|
68
|
+
'cgui:origin-(--bits-popover-content-transform-origin) cgui:outline-hidden',
|
|
69
|
+
'cgui:data-[state=open]:animate-in cgui:data-[state=closed]:animate-out cgui:data-[state=closed]:fade-out-0 cgui:data-[state=open]:fade-in-0 cgui:data-[state=closed]:zoom-out-95 cgui:data-[state=open]:zoom-in-95',
|
|
70
|
+
'cgui:data-[side=bottom]:slide-in-from-top-2 cgui:data-[side=left]:slide-in-from-end-2 cgui:data-[side=right]:slide-in-from-start-2 cgui:data-[side=top]:slide-in-from-bottom-2',
|
|
71
|
+
],
|
|
72
|
+
variants: {
|
|
73
|
+
rounded: {
|
|
74
|
+
none: [],
|
|
75
|
+
xs: ['cgui:rounded-xs'],
|
|
76
|
+
sm: ['cgui:rounded-sm'],
|
|
77
|
+
md: ['cgui:rounded-md'],
|
|
78
|
+
lg: ['cgui:rounded-lg'],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
defaultVariants: {
|
|
82
|
+
rounded: 'md',
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
export const datePickerCalendarVariants = tv({
|
|
86
|
+
base: ['cgui:flex cgui:flex-col'],
|
|
87
|
+
});
|
|
88
|
+
export const datePickerInputVariants = tv({
|
|
89
|
+
base: [
|
|
90
|
+
'cgui:group/date-picker-input',
|
|
91
|
+
'cgui:relative cgui:inline-flex cgui:items-center cgui:gap-0.5 cgui:w-full',
|
|
92
|
+
'cgui:text-body',
|
|
93
|
+
'cgui:transition-all cgui:duration-250 cgui:ease-in-out',
|
|
94
|
+
'cgui:data-invalid:border-stroke-error cgui:data-invalid:ring-stroke-error',
|
|
95
|
+
'cgui:data-disabled:opacity-50 cgui:data-disabled:cursor-not-allowed',
|
|
96
|
+
],
|
|
97
|
+
variants: {
|
|
98
|
+
variant: {
|
|
99
|
+
primary: [
|
|
100
|
+
'cgui:bg-surface-lightest cgui:border cgui:border-stroke-default cgui:text-fg-dark',
|
|
101
|
+
'cgui:focus-within:border-stroke-focus cgui:focus-within:ring-1 cgui:focus-within:ring-stroke-focus',
|
|
102
|
+
],
|
|
103
|
+
outline: [
|
|
104
|
+
'cgui:border-b cgui:border-b-stroke-default cgui:text-fg-dark cgui:rounded-none',
|
|
105
|
+
'cgui:focus-within:border-b-stroke-focus',
|
|
106
|
+
],
|
|
107
|
+
clear: [],
|
|
108
|
+
},
|
|
109
|
+
size: {
|
|
110
|
+
sm: ['cgui:min-h-7.5 cgui:px-2.5 cgui:py-1.5'],
|
|
111
|
+
md: ['cgui:min-h-9 cgui:px-3 cgui:py-2'],
|
|
112
|
+
lg: ['cgui:min-h-11 cgui:text-heading-2 cgui:px-4 cgui:py-2.5'],
|
|
113
|
+
},
|
|
114
|
+
rounded: {
|
|
115
|
+
none: [],
|
|
116
|
+
sm: ['cgui:rounded-sm'],
|
|
117
|
+
md: ['cgui:rounded-md'],
|
|
118
|
+
lg: ['cgui:rounded-lg'],
|
|
119
|
+
},
|
|
120
|
+
fullWidth: {
|
|
121
|
+
true: ['cgui:w-full'],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
defaultVariants: {
|
|
125
|
+
variant: 'primary',
|
|
126
|
+
size: 'md',
|
|
127
|
+
rounded: 'sm',
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
export const datePickerSegmentVariants = tv({
|
|
131
|
+
base: [
|
|
132
|
+
'cgui:inline-flex cgui:items-center cgui:justify-center',
|
|
133
|
+
'cgui:rounded-xs cgui:px-0.5',
|
|
134
|
+
'cgui:outline-none',
|
|
135
|
+
'cgui:transition-colors cgui:duration-150 cgui:ease-in-out',
|
|
136
|
+
'cgui:focus:bg-surface-primary cgui:focus:text-fg-white',
|
|
137
|
+
'cgui:data-invalid:text-fg-error',
|
|
138
|
+
'cgui:data-disabled:text-fg-semilight/40 cgui:data-disabled:pointer-events-none',
|
|
139
|
+
'cgui:data-[segment=literal]:text-fg-semilight cgui:data-[segment=literal]:pointer-events-none',
|
|
140
|
+
'cgui:data-[placeholder]:text-fg-regular/60',
|
|
141
|
+
],
|
|
142
|
+
});
|
|
143
|
+
export const DatePickerRootStylesContext = new Context(keyWithPrefix('date-picker-root-styles'));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DatePicker as Primitive } from 'bits-ui';
|
|
2
|
+
import type { DatePickerCalendarVariants, DatePickerContentVariants, DatePickerInputVariants, DatePickerSegmentVariants, DatePickerTriggerVariants } from './styles.js';
|
|
3
|
+
import type { WithVariants } from '../../internal/utils/tailwindcss.js';
|
|
4
|
+
export type DatePickerRootProps = WithVariants<Primitive.RootProps & {
|
|
5
|
+
children?: Primitive.RootProps['children'];
|
|
6
|
+
}, DatePickerContentVariants>;
|
|
7
|
+
export type DatePickerTriggerProps = Primitive.TriggerProps & DatePickerTriggerVariants & {
|
|
8
|
+
hasChevron?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type DatePickerContentProps = WithVariants<Primitive.ContentProps, DatePickerContentVariants>;
|
|
11
|
+
export type DatePickerPortalProps = Primitive.PortalProps;
|
|
12
|
+
export type DatePickerCalendarProps = WithVariants<Primitive.CalendarProps, DatePickerCalendarVariants>;
|
|
13
|
+
export type DatePickerInputProps = WithVariants<Primitive.InputProps, DatePickerInputVariants>;
|
|
14
|
+
export type DatePickerSegmentProps = WithVariants<Primitive.SegmentProps, DatePickerSegmentVariants>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,6 +7,9 @@ export const selectTriggerStyles = tv({
|
|
|
7
7
|
'cgui:transition-all cgui:duration-250 cgui:ease-in-out',
|
|
8
8
|
'cgui:[&_svg]:shrink-0 cgui:[&_svg]:pointer-events-none cgui:[&_svg]:text-icon-regular cgui:[&_svg:not([class*="size-"])]:size-4',
|
|
9
9
|
'cgui:has-[data-slot=chevron]:pr-3',
|
|
10
|
+
'cgui:focus-visible:ring-stroke-primary/50 cgui:outline-none cgui:focus-visible:ring-2 cgui:bg-clip-padding',
|
|
11
|
+
'cgui:focus:ring-stroke-default cgui:focus-visible:border-stroke-focus',
|
|
12
|
+
'cgui:aria-invalid:ring-stroke-error cgui:aria-invalid:border-stroke-error',
|
|
10
13
|
],
|
|
11
14
|
variants: {
|
|
12
15
|
variant: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@casinogate/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"svelte": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -492,6 +492,7 @@
|
|
|
492
492
|
"node": ">=22.14.0"
|
|
493
493
|
},
|
|
494
494
|
"dependencies": {
|
|
495
|
+
"@internationalized/date": "^3.10.0",
|
|
495
496
|
"@tanstack/table-core": "^8.21.3",
|
|
496
497
|
"@zag-js/collection": "^1.30.0",
|
|
497
498
|
"bits-ui": "2.16.3",
|