tera-system-ui 0.1.41 → 0.1.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/Accordion.d.ts +15 -13
- package/dist/components/accordion/index.d.ts +1 -0
- package/dist/components/avatar/Avatar.d.ts +5 -3
- package/dist/components/avatar/index.d.ts +1 -0
- package/dist/components/brand-logo/BrandLogo.d.ts +5 -2
- package/dist/components/brand-logo/index.d.ts +1 -0
- package/dist/components/button/Button.d.ts +58 -14
- package/dist/components/button/Button.js +90 -27
- package/dist/components/button/Button.svelte +35 -30
- package/dist/components/button/Button.svelte.d.ts +1 -4
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +5 -2
- package/dist/components/checkbox/Checkbox.svelte +15 -8
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/combobox/Combobox.d.ts +5 -2
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/dialog/Dialog.d.ts +8 -6
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/dropdown-menu/DropdownMenu.d.ts +26 -8
- package/dist/components/dropdown-menu/index.d.ts +1 -0
- package/dist/components/header/Header.d.ts +6 -3
- package/dist/components/header/Header.svelte.d.ts +1 -1
- package/dist/components/header/index.d.ts +1 -0
- package/dist/components/input/Input.d.ts +22 -6
- package/dist/components/input/Input.js +19 -10
- package/dist/components/input/Input.svelte +42 -9
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/label/Label.d.ts +33 -3
- package/dist/components/label/Label.js +14 -3
- package/dist/components/label/Label.svelte +7 -7
- package/dist/components/label/Label.svelte.d.ts +2 -2
- package/dist/components/label/index.d.ts +1 -0
- package/dist/components/language-picker-button/LanguagePickerButton.d.ts +5 -2
- package/dist/components/language-picker-button/index.d.ts +1 -0
- package/dist/components/light-dark-toggle/LightDarkToggle.d.ts +5 -2
- package/dist/components/light-dark-toggle/index.d.ts +1 -0
- package/dist/components/popover/Popover.d.ts +6 -3
- package/dist/components/popover/Popover.js +0 -1
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover-responsive/PopoverResponsive.d.ts +5 -2
- package/dist/components/popover-responsive/index.d.ts +1 -0
- package/dist/components/select/Select.d.ts +19 -5
- package/dist/components/select/Select.js +18 -9
- package/dist/components/select/Select.svelte +17 -4
- package/dist/components/select/Select.svelte.d.ts +1 -1
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/side-navigation/SideNavigation.d.ts +6 -3
- package/dist/components/side-navigation/index.d.ts +1 -1
- package/dist/components/slider/Slider.d.ts +7 -4
- package/dist/components/slider/Slider.svelte +26 -51
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/star-rating/StarRating.d.ts +5 -2
- package/dist/components/star-rating/StarRating.svelte +5 -5
- package/dist/components/star-rating/index.d.ts +1 -0
- package/dist/components/switch/Switch.d.ts +6 -2
- package/dist/components/switch/Switch.svelte +13 -7
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/tabs/Tabs.svelte.d.ts +23 -3
- package/dist/components/tabs/index.d.ts +1 -0
- package/dist/components/tera-ui-context/TeraUiContext.d.ts +4 -6
- package/dist/components/tera-ui-context/index.d.ts +1 -0
- package/dist/components/text-area/TextArea.d.ts +22 -8
- package/dist/components/text-area/TextArea.js +19 -10
- package/dist/components/text-area/TextArea.svelte +36 -30
- package/dist/components/text-area/index.d.ts +1 -0
- package/dist/components/user-avatar-with-menu/UserAvatarWithMenu.d.ts +5 -2
- package/dist/components/user-avatar-with-menu/index.d.ts +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/paraglide/README.md +93 -0
- package/dist/paraglide/messages/_index.d.ts +8 -7
- package/dist/paraglide/messages/_index.js +361 -360
- package/dist/paraglide/messages/ar.d.ts +9 -7
- package/dist/paraglide/messages/ar.js +16 -15
- package/dist/paraglide/messages/bg.d.ts +9 -7
- package/dist/paraglide/messages/bg.js +16 -15
- package/dist/paraglide/messages/bn.d.ts +9 -7
- package/dist/paraglide/messages/bn.js +16 -15
- package/dist/paraglide/messages/ca.d.ts +9 -7
- package/dist/paraglide/messages/ca.js +16 -15
- package/dist/paraglide/messages/cs.d.ts +9 -7
- package/dist/paraglide/messages/cs.js +16 -15
- package/dist/paraglide/messages/da.d.ts +9 -7
- package/dist/paraglide/messages/da.js +16 -15
- package/dist/paraglide/messages/de.d.ts +9 -7
- package/dist/paraglide/messages/de.js +16 -15
- package/dist/paraglide/messages/el.d.ts +9 -7
- package/dist/paraglide/messages/el.js +16 -15
- package/dist/paraglide/messages/en.d.ts +9 -7
- package/dist/paraglide/messages/en.js +16 -15
- package/dist/paraglide/messages/es.d.ts +9 -7
- package/dist/paraglide/messages/es.js +16 -15
- package/dist/paraglide/messages/fi.d.ts +9 -7
- package/dist/paraglide/messages/fi.js +16 -15
- package/dist/paraglide/messages/fr.d.ts +9 -7
- package/dist/paraglide/messages/fr.js +16 -15
- package/dist/paraglide/messages/he.d.ts +9 -7
- package/dist/paraglide/messages/he.js +16 -15
- package/dist/paraglide/messages/hi.d.ts +9 -7
- package/dist/paraglide/messages/hi.js +16 -15
- package/dist/paraglide/messages/hu.d.ts +9 -7
- package/dist/paraglide/messages/hu.js +16 -15
- package/dist/paraglide/messages/id.d.ts +9 -7
- package/dist/paraglide/messages/id.js +16 -15
- package/dist/paraglide/messages/it.d.ts +9 -7
- package/dist/paraglide/messages/it.js +16 -15
- package/dist/paraglide/messages/ja.d.ts +9 -7
- package/dist/paraglide/messages/ja.js +16 -15
- package/dist/paraglide/messages/ko.d.ts +9 -7
- package/dist/paraglide/messages/ko.js +16 -15
- package/dist/paraglide/messages/lt.d.ts +9 -7
- package/dist/paraglide/messages/lt.js +16 -15
- package/dist/paraglide/messages/lv.d.ts +9 -7
- package/dist/paraglide/messages/lv.js +16 -15
- package/dist/paraglide/messages/ms.d.ts +9 -7
- package/dist/paraglide/messages/ms.js +16 -15
- package/dist/paraglide/messages/nl.d.ts +9 -7
- package/dist/paraglide/messages/nl.js +16 -15
- package/dist/paraglide/messages/no.d.ts +9 -7
- package/dist/paraglide/messages/no.js +16 -15
- package/dist/paraglide/messages/pl.d.ts +9 -7
- package/dist/paraglide/messages/pl.js +16 -15
- package/dist/paraglide/messages/pt.d.ts +9 -7
- package/dist/paraglide/messages/pt.js +16 -15
- package/dist/paraglide/messages/ro.d.ts +9 -7
- package/dist/paraglide/messages/ro.js +16 -15
- package/dist/paraglide/messages/ru.d.ts +9 -7
- package/dist/paraglide/messages/ru.js +16 -15
- package/dist/paraglide/messages/sk.d.ts +9 -7
- package/dist/paraglide/messages/sk.js +16 -15
- package/dist/paraglide/messages/sl.d.ts +9 -7
- package/dist/paraglide/messages/sl.js +16 -15
- package/dist/paraglide/messages/sq.d.ts +9 -7
- package/dist/paraglide/messages/sq.js +16 -15
- package/dist/paraglide/messages/sr.d.ts +9 -7
- package/dist/paraglide/messages/sr.js +16 -15
- package/dist/paraglide/messages/sv.d.ts +9 -7
- package/dist/paraglide/messages/sv.js +16 -15
- package/dist/paraglide/messages/sw.d.ts +9 -7
- package/dist/paraglide/messages/sw.js +16 -15
- package/dist/paraglide/messages/ta.d.ts +9 -7
- package/dist/paraglide/messages/ta.js +16 -15
- package/dist/paraglide/messages/te.d.ts +9 -7
- package/dist/paraglide/messages/te.js +16 -15
- package/dist/paraglide/messages/th.d.ts +9 -7
- package/dist/paraglide/messages/th.js +16 -15
- package/dist/paraglide/messages/tl.d.ts +9 -7
- package/dist/paraglide/messages/tl.js +16 -15
- package/dist/paraglide/messages/tr.d.ts +9 -7
- package/dist/paraglide/messages/tr.js +16 -15
- package/dist/paraglide/messages/uk.d.ts +9 -7
- package/dist/paraglide/messages/uk.js +16 -15
- package/dist/paraglide/messages/vi.d.ts +9 -7
- package/dist/paraglide/messages/vi.js +16 -15
- package/dist/paraglide/messages/zh-CN.d.ts +9 -7
- package/dist/paraglide/messages/zh-CN.js +16 -15
- package/dist/paraglide/messages/zh-TW.d.ts +9 -7
- package/dist/paraglide/messages/zh-TW.js +16 -15
- package/dist/paraglide/messages.js +1 -1
- package/dist/paraglide/registry.js +1 -1
- package/dist/paraglide/runtime.d.ts +221 -45
- package/dist/paraglide/runtime.js +378 -65
- package/dist/paraglide/server.d.ts +40 -4
- package/dist/paraglide/server.js +83 -46
- package/dist/tera-i18n/projects/tera-system-ui/project.inlang/.meta.json +3 -0
- package/dist/tera-i18n/projects/tera-system-ui/project.inlang/README.md +103 -0
- package/dist/themes/tera-ui-base.css +70 -7
- package/dist/types/index.d.ts +25 -0
- package/dist/types/index.js +3 -0
- package/package.json +150 -36
- package/scripts/add-component-template.js +1 -1
- package/scripts/generate-ts-index.js +38 -12
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes, HTMLButtonAttributes } from "svelte/elements";
|
|
2
4
|
export declare const styles: import("tailwind-variants").TVReturnType<{}, undefined, "", {}, undefined, import("tailwind-variants").TVReturnType<{}, undefined, "", unknown, unknown, undefined>>;
|
|
3
5
|
type AccordionVariants = VariantProps<typeof styles>;
|
|
4
|
-
export interface AccordionProps extends AccordionVariants {
|
|
5
|
-
children?:
|
|
6
|
+
export interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onchange'>, AccordionVariants {
|
|
7
|
+
children?: Snippet;
|
|
6
8
|
class?: string;
|
|
7
9
|
type: 'multiple' | 'single';
|
|
8
10
|
value: string | string[];
|
|
9
|
-
onchange
|
|
11
|
+
onchange?: (value: string | string[]) => void;
|
|
10
12
|
controlledValue?: boolean;
|
|
11
|
-
ref?: HTMLDivElement;
|
|
13
|
+
ref?: HTMLDivElement | null;
|
|
12
14
|
}
|
|
13
|
-
export interface AccordionItemProps {
|
|
15
|
+
export interface AccordionItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
14
16
|
value: string;
|
|
15
|
-
ref?: HTMLDivElement;
|
|
16
|
-
children?:
|
|
17
|
+
ref?: HTMLDivElement | null;
|
|
18
|
+
children?: Snippet;
|
|
17
19
|
}
|
|
18
|
-
export interface AccordionTriggerProps {
|
|
19
|
-
children?:
|
|
20
|
-
ref?: HTMLButtonElement;
|
|
20
|
+
export interface AccordionTriggerProps extends HTMLButtonAttributes {
|
|
21
|
+
children?: Snippet;
|
|
22
|
+
ref?: HTMLButtonElement | null;
|
|
21
23
|
}
|
|
22
|
-
export interface AccordionContentProps {
|
|
23
|
-
children?:
|
|
24
|
-
ref?: HTMLDivElement;
|
|
24
|
+
export interface AccordionContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
25
|
+
children?: Snippet;
|
|
26
|
+
ref?: HTMLDivElement | null;
|
|
25
27
|
}
|
|
26
28
|
export {};
|
|
@@ -2,3 +2,4 @@ export { default as Accordion } from "./components/Accordion.svelte";
|
|
|
2
2
|
export { default as AccordionItem } from "./components/AccordionItem.svelte";
|
|
3
3
|
export { default as AccordionContent } from "./components/AccordionContent.svelte";
|
|
4
4
|
export { default as AccordionTrigger } from "./components/AccordionTrigger.svelte";
|
|
5
|
+
export type { AccordionProps, AccordionItemProps, AccordionContentProps, AccordionTriggerProps } from './Accordion';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
4
|
export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
3
5
|
size: {
|
|
4
6
|
sm: string;
|
|
@@ -31,12 +33,12 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
31
33
|
};
|
|
32
34
|
}, undefined, "relative rounded-full object-cover bg-primary-token-1 select-none grid place-content-center leading-none font-bold overflow-clip hover:brightness-90", unknown, unknown, undefined>>;
|
|
33
35
|
type AvatarVariants = VariantProps<typeof styles>;
|
|
34
|
-
export interface AvatarProps extends AvatarVariants {
|
|
35
|
-
children?:
|
|
36
|
+
export interface AvatarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'size'>, AvatarVariants {
|
|
37
|
+
children?: Snippet;
|
|
36
38
|
class?: string;
|
|
37
39
|
alt?: string;
|
|
38
40
|
src?: string;
|
|
39
|
-
ref?:
|
|
41
|
+
ref?: HTMLDivElement | null;
|
|
40
42
|
userUid?: string;
|
|
41
43
|
apiUrl?: string;
|
|
42
44
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
4
|
export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
3
5
|
theme: {
|
|
4
6
|
light: string;
|
|
@@ -28,8 +30,9 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
28
30
|
};
|
|
29
31
|
}, undefined, "h-icon-md [&>.second-part]:fill-brand-500", unknown, unknown, undefined>>;
|
|
30
32
|
type BrandLogoVariants = VariantProps<typeof styles>;
|
|
31
|
-
export interface BrandLogoProps extends BrandLogoVariants {
|
|
32
|
-
children?:
|
|
33
|
+
export interface BrandLogoProps extends HTMLAttributes<HTMLDivElement>, BrandLogoVariants {
|
|
34
|
+
children?: Snippet;
|
|
33
35
|
class?: string;
|
|
36
|
+
ref?: HTMLDivElement | null;
|
|
34
37
|
}
|
|
35
38
|
export {};
|
|
@@ -1,69 +1,113 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
2
4
|
export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
3
5
|
variant: {
|
|
4
6
|
primary: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
default: string;
|
|
8
|
+
dashed: string;
|
|
9
|
+
text: string;
|
|
10
|
+
link: string;
|
|
7
11
|
};
|
|
8
12
|
size: {
|
|
13
|
+
xs: string;
|
|
9
14
|
sm: string;
|
|
10
15
|
md: string;
|
|
11
16
|
lg: string;
|
|
12
17
|
};
|
|
18
|
+
shape: {
|
|
19
|
+
default: string;
|
|
20
|
+
circle: string;
|
|
21
|
+
round: string;
|
|
22
|
+
};
|
|
13
23
|
disabled: {
|
|
14
24
|
true: string;
|
|
15
25
|
};
|
|
26
|
+
loading: {
|
|
27
|
+
true: string;
|
|
28
|
+
};
|
|
16
29
|
icon: {
|
|
17
30
|
true: string;
|
|
18
31
|
};
|
|
19
|
-
|
|
32
|
+
danger: {
|
|
33
|
+
true: string;
|
|
34
|
+
};
|
|
35
|
+
block: {
|
|
20
36
|
true: string;
|
|
21
37
|
};
|
|
22
|
-
}, undefined, "relative
|
|
38
|
+
}, undefined, "btn-wave relative overflow-visible rounded-md inline-flex items-center justify-center leading-tight [&>svg]:stroke-icon transition-all duration-200 select-none outline-none font-normal cursor-pointer", {
|
|
23
39
|
variant: {
|
|
24
40
|
primary: string;
|
|
25
|
-
|
|
26
|
-
|
|
41
|
+
default: string;
|
|
42
|
+
dashed: string;
|
|
43
|
+
text: string;
|
|
44
|
+
link: string;
|
|
27
45
|
};
|
|
28
46
|
size: {
|
|
47
|
+
xs: string;
|
|
29
48
|
sm: string;
|
|
30
49
|
md: string;
|
|
31
50
|
lg: string;
|
|
32
51
|
};
|
|
52
|
+
shape: {
|
|
53
|
+
default: string;
|
|
54
|
+
circle: string;
|
|
55
|
+
round: string;
|
|
56
|
+
};
|
|
33
57
|
disabled: {
|
|
34
58
|
true: string;
|
|
35
59
|
};
|
|
60
|
+
loading: {
|
|
61
|
+
true: string;
|
|
62
|
+
};
|
|
36
63
|
icon: {
|
|
37
64
|
true: string;
|
|
38
65
|
};
|
|
39
|
-
|
|
66
|
+
danger: {
|
|
67
|
+
true: string;
|
|
68
|
+
};
|
|
69
|
+
block: {
|
|
40
70
|
true: string;
|
|
41
71
|
};
|
|
42
72
|
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
43
73
|
variant: {
|
|
44
74
|
primary: string;
|
|
45
|
-
|
|
46
|
-
|
|
75
|
+
default: string;
|
|
76
|
+
dashed: string;
|
|
77
|
+
text: string;
|
|
78
|
+
link: string;
|
|
47
79
|
};
|
|
48
80
|
size: {
|
|
81
|
+
xs: string;
|
|
49
82
|
sm: string;
|
|
50
83
|
md: string;
|
|
51
84
|
lg: string;
|
|
52
85
|
};
|
|
86
|
+
shape: {
|
|
87
|
+
default: string;
|
|
88
|
+
circle: string;
|
|
89
|
+
round: string;
|
|
90
|
+
};
|
|
53
91
|
disabled: {
|
|
54
92
|
true: string;
|
|
55
93
|
};
|
|
94
|
+
loading: {
|
|
95
|
+
true: string;
|
|
96
|
+
};
|
|
56
97
|
icon: {
|
|
57
98
|
true: string;
|
|
58
99
|
};
|
|
59
|
-
|
|
100
|
+
danger: {
|
|
101
|
+
true: string;
|
|
102
|
+
};
|
|
103
|
+
block: {
|
|
60
104
|
true: string;
|
|
61
105
|
};
|
|
62
|
-
}, undefined, "relative
|
|
106
|
+
}, undefined, "btn-wave relative overflow-visible rounded-md inline-flex items-center justify-center leading-tight [&>svg]:stroke-icon transition-all duration-200 select-none outline-none font-normal cursor-pointer", unknown, unknown, undefined>>;
|
|
63
107
|
type ButtonVariants = VariantProps<typeof styles>;
|
|
64
|
-
export interface ButtonProps extends ButtonVariants {
|
|
65
|
-
children
|
|
108
|
+
export interface ButtonProps extends Omit<HTMLButtonAttributes, 'disabled'>, ButtonVariants {
|
|
109
|
+
children?: Snippet;
|
|
66
110
|
class?: string;
|
|
67
|
-
|
|
111
|
+
ref?: HTMLButtonElement | null;
|
|
68
112
|
}
|
|
69
113
|
export {};
|
|
@@ -1,53 +1,94 @@
|
|
|
1
1
|
import { tv } from "tailwind-variants";
|
|
2
2
|
export const styles = tv({
|
|
3
|
-
base: 'relative
|
|
3
|
+
base: 'btn-wave relative overflow-visible rounded-md inline-flex items-center justify-center leading-tight [&>svg]:stroke-icon transition-all duration-200 select-none outline-none font-normal cursor-pointer',
|
|
4
4
|
variants: {
|
|
5
5
|
variant: {
|
|
6
|
-
primary: 'bg-primary-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
primary: 'bg-primary-600 text-white border border-primary-600 hover:bg-primary-500 hover:border-primary-500 active:bg-primary-700 active:border-primary-700 shadow-sm',
|
|
7
|
+
default: 'bg-neutral-token-1 text-neutral-token-13 border border-neutral-token-5 hover:text-primary-600 hover:border-primary-600 active:text-primary-700 active:border-primary-700',
|
|
8
|
+
dashed: 'bg-neutral-token-1 text-neutral-token-13 border border-dashed border-neutral-token-5 hover:text-primary-600 hover:border-primary-600 active:text-primary-700 active:border-primary-700',
|
|
9
|
+
text: 'bg-transparent text-neutral-token-13 border border-transparent hover:bg-neutral-token-3 active:bg-neutral-token-4',
|
|
10
|
+
link: 'bg-transparent text-primary-600 border border-transparent hover:text-primary-500 active:text-primary-700 px-0',
|
|
9
11
|
},
|
|
10
12
|
size: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
xs: 'h-5 px-1.5 gap-1 text-xs [&>svg]:size-3',
|
|
14
|
+
sm: 'h-6 px-2 gap-1.5 text-sm [&>svg]:size-3.5',
|
|
15
|
+
md: 'h-8 px-4 gap-2 text-sm [&>svg]:size-4',
|
|
16
|
+
lg: 'h-10 px-4 gap-2 text-base [&>svg]:size-5',
|
|
17
|
+
},
|
|
18
|
+
shape: {
|
|
19
|
+
default: '',
|
|
20
|
+
circle: 'rounded-full px-0',
|
|
21
|
+
round: 'rounded-full',
|
|
14
22
|
},
|
|
15
23
|
disabled: {
|
|
16
|
-
true: 'bg-neutral-token-3 text-neutral-token-7 border
|
|
24
|
+
true: 'bg-neutral-token-3 text-neutral-token-7 border-neutral-token-5 pointer-events-none shadow-none cursor-not-allowed',
|
|
25
|
+
},
|
|
26
|
+
loading: {
|
|
27
|
+
true: 'cursor-wait pointer-events-none opacity-65'
|
|
17
28
|
},
|
|
18
29
|
icon: {
|
|
19
|
-
true: 'px-0
|
|
30
|
+
true: 'px-0'
|
|
20
31
|
},
|
|
21
|
-
|
|
32
|
+
danger: {
|
|
22
33
|
true: ''
|
|
34
|
+
},
|
|
35
|
+
block: {
|
|
36
|
+
true: 'w-full'
|
|
23
37
|
}
|
|
24
38
|
},
|
|
25
39
|
compoundVariants: [
|
|
40
|
+
// Primary danger state
|
|
26
41
|
{
|
|
27
42
|
variant: 'primary',
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
43
|
+
danger: true,
|
|
44
|
+
disabled: false,
|
|
45
|
+
class: 'bg-error-500 border-error-500 hover:bg-error-400 hover:border-error-400 active:bg-error-600 active:border-error-600'
|
|
46
|
+
},
|
|
47
|
+
// Default danger state
|
|
48
|
+
{
|
|
49
|
+
variant: 'default',
|
|
50
|
+
danger: true,
|
|
51
|
+
disabled: false,
|
|
52
|
+
class: 'text-error-500 border-error-500 hover:text-error-400 hover:border-error-400 active:text-error-600 active:border-error-600'
|
|
53
|
+
},
|
|
54
|
+
// Dashed danger state
|
|
55
|
+
{
|
|
56
|
+
variant: 'dashed',
|
|
57
|
+
danger: true,
|
|
58
|
+
disabled: false,
|
|
59
|
+
class: 'text-error-500 border-error-500 hover:text-error-400 hover:border-error-400 active:text-error-600 active:border-error-600'
|
|
32
60
|
},
|
|
61
|
+
// Text danger state
|
|
33
62
|
{
|
|
34
|
-
variant: '
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class: 'bg-neutral-token-2 text-error-600 dark:text-error-200 border border-error-600 dark:border-error-500 hover:bg-neutral-token-3 focus:ring-error-500'
|
|
63
|
+
variant: 'text',
|
|
64
|
+
danger: true,
|
|
65
|
+
disabled: false,
|
|
66
|
+
class: 'text-error-500 hover:bg-error-50 dark:hover:bg-error-950 active:bg-error-100 dark:active:bg-error-900'
|
|
39
67
|
},
|
|
68
|
+
// Link danger state
|
|
40
69
|
{
|
|
41
|
-
variant: '
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
class: 'text-error-600 dark:text-error-100 hover:bg-neutral-token-3 focus:ring-error-400'
|
|
70
|
+
variant: 'link',
|
|
71
|
+
danger: true,
|
|
72
|
+
disabled: false,
|
|
73
|
+
class: 'text-error-500 hover:text-error-400 active:text-error-600'
|
|
46
74
|
},
|
|
75
|
+
// Text disabled state
|
|
47
76
|
{
|
|
48
|
-
variant: '
|
|
77
|
+
variant: 'text',
|
|
49
78
|
disabled: true,
|
|
50
|
-
class: '
|
|
79
|
+
class: 'bg-transparent border-transparent'
|
|
80
|
+
},
|
|
81
|
+
// Link disabled state
|
|
82
|
+
{
|
|
83
|
+
variant: 'link',
|
|
84
|
+
disabled: true,
|
|
85
|
+
class: 'bg-transparent border-transparent'
|
|
86
|
+
},
|
|
87
|
+
// Icon size variants - circle and icon-only
|
|
88
|
+
{
|
|
89
|
+
size: 'xs',
|
|
90
|
+
icon: true,
|
|
91
|
+
class: 'size-5'
|
|
51
92
|
},
|
|
52
93
|
{
|
|
53
94
|
size: 'sm',
|
|
@@ -64,9 +105,31 @@ export const styles = tv({
|
|
|
64
105
|
icon: true,
|
|
65
106
|
class: 'size-10'
|
|
66
107
|
},
|
|
108
|
+
// Circle shape sizing
|
|
109
|
+
{
|
|
110
|
+
size: 'xs',
|
|
111
|
+
shape: 'circle',
|
|
112
|
+
class: 'size-5'
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
size: 'sm',
|
|
116
|
+
shape: 'circle',
|
|
117
|
+
class: 'size-6'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
size: 'md',
|
|
121
|
+
shape: 'circle',
|
|
122
|
+
class: 'size-8'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
size: 'lg',
|
|
126
|
+
shape: 'circle',
|
|
127
|
+
class: 'size-10'
|
|
128
|
+
},
|
|
67
129
|
],
|
|
68
130
|
defaultVariants: {
|
|
69
|
-
variant: '
|
|
131
|
+
variant: 'default',
|
|
70
132
|
size: 'md',
|
|
133
|
+
shape: 'default',
|
|
71
134
|
},
|
|
72
135
|
});
|
|
@@ -2,48 +2,53 @@
|
|
|
2
2
|
import {type ButtonProps, styles} from "./Button";
|
|
3
3
|
|
|
4
4
|
let {
|
|
5
|
-
children, disabled, variant = '
|
|
5
|
+
children, disabled, variant = 'default', icon, size = 'md', shape = 'default', danger, loading, block, class: className,
|
|
6
6
|
ref = $bindable(),
|
|
7
|
+
onclick,
|
|
7
8
|
...props
|
|
8
|
-
}: ButtonProps
|
|
9
|
+
}: ButtonProps = $props();
|
|
9
10
|
|
|
10
|
-
$
|
|
11
|
-
ref.addEventListener('click', function (e) {
|
|
12
|
-
const ripple = document.createElement('span');
|
|
13
|
-
const size = Math.max(ref.clientWidth, ref.clientHeight);
|
|
14
|
-
const rect = ref.getBoundingClientRect();
|
|
15
|
-
const x = e.clientX - rect.left - size / 2;
|
|
16
|
-
const y = e.clientY - rect.top - size / 2;
|
|
11
|
+
let waveActive = $state(false);
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
// Check if user prefers reduced motion
|
|
14
|
+
const prefersReducedMotion = typeof window !== 'undefined'
|
|
15
|
+
? window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
16
|
+
: false;
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (variant === 'primary') {
|
|
25
|
-
rippleColor = 'bg-neutral-3/30';
|
|
26
|
-
}
|
|
27
|
-
ripple.style.backgroundColor = rippleColor
|
|
18
|
+
function handleClick(e) {
|
|
19
|
+
if (prefersReducedMotion || disabled || loading) return;
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
ripple.addEventListener('animationend', () => {
|
|
36
|
-
ripple.remove();
|
|
37
|
-
});
|
|
21
|
+
onclick?.(e);
|
|
22
|
+
// Trigger wave animation
|
|
23
|
+
waveActive = false;
|
|
24
|
+
// Force reflow to restart animation
|
|
25
|
+
requestAnimationFrame(() => {
|
|
26
|
+
waveActive = true;
|
|
38
27
|
});
|
|
39
|
-
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function handleAnimationEnd() {
|
|
31
|
+
waveActive = false;
|
|
32
|
+
}
|
|
40
33
|
</script>
|
|
41
34
|
|
|
42
35
|
<button
|
|
43
36
|
bind:this={ref}
|
|
44
|
-
class={styles({ disabled, variant, icon, size,
|
|
37
|
+
class={styles({ disabled: disabled || loading, variant, icon, size, shape, danger, block, className })}
|
|
38
|
+
class:wave-active={waveActive}
|
|
39
|
+
data-variant={variant}
|
|
40
|
+
data-danger={danger || undefined}
|
|
45
41
|
{...props}
|
|
46
|
-
disabled={disabled}
|
|
42
|
+
disabled={disabled || loading}
|
|
43
|
+
aria-busy={loading}
|
|
44
|
+
onclick={handleClick}
|
|
45
|
+
onanimationend={handleAnimationEnd}
|
|
47
46
|
>
|
|
47
|
+
{#if loading}
|
|
48
|
+
<svg class="animate-spin" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
49
|
+
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
50
|
+
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
51
|
+
</svg>
|
|
52
|
+
{/if}
|
|
48
53
|
{@render children?.()}
|
|
49
54
|
</button>
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { type ButtonProps } from "./Button";
|
|
2
|
-
|
|
3
|
-
ref: HTMLButtonElement;
|
|
4
|
-
};
|
|
5
|
-
declare const Button: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
2
|
+
declare const Button: import("svelte").Component<ButtonProps, {}, "ref">;
|
|
6
3
|
type Button = ReturnType<typeof Button>;
|
|
7
4
|
export default Button;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLInputAttributes } from "svelte/elements";
|
|
2
4
|
export declare const styles: import("tailwind-variants").TVReturnType<{}, undefined, "", {}, undefined, import("tailwind-variants").TVReturnType<{}, undefined, "", unknown, unknown, undefined>>;
|
|
3
5
|
type CheckboxVariants = VariantProps<typeof styles>;
|
|
4
|
-
export interface CheckboxProps extends CheckboxVariants {
|
|
5
|
-
children?:
|
|
6
|
+
export interface CheckboxProps extends Omit<HTMLInputAttributes, 'size'>, CheckboxVariants {
|
|
7
|
+
children?: Snippet;
|
|
6
8
|
class?: string;
|
|
9
|
+
ref?: HTMLInputElement | null;
|
|
7
10
|
}
|
|
8
11
|
export {};
|
|
@@ -14,14 +14,21 @@
|
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<CheckboxPrimitive.Root
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
bind:ref
|
|
18
|
+
class={cn(
|
|
19
|
+
"peer box-content size-4 shrink-0 rounded border border-neutral-token-5 bg-neutral-token-1",
|
|
20
|
+
"transition-all duration-200",
|
|
21
|
+
"hover:border-primary-500",
|
|
22
|
+
"focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_rgba(59,130,246,0.1)]",
|
|
23
|
+
"data-[state=checked]:bg-primary-600 data-[state=checked]:border-primary-600",
|
|
24
|
+
"data-[state=indeterminate]:bg-primary-600 data-[state=indeterminate]:border-primary-600",
|
|
25
|
+
"disabled:cursor-not-allowed disabled:bg-neutral-token-3 disabled:border-neutral-token-5 disabled:opacity-50",
|
|
26
|
+
"data-[disabled=true]:cursor-not-allowed data-[disabled=true]:bg-neutral-token-3 data-[disabled=true]:border-neutral-token-5 data-[disabled=true]:opacity-50",
|
|
27
|
+
className
|
|
28
|
+
)}
|
|
29
|
+
bind:checked
|
|
30
|
+
bind:indeterminate
|
|
31
|
+
{...restProps}
|
|
25
32
|
>
|
|
26
33
|
{#snippet children({ checked, indeterminate })}
|
|
27
34
|
<div class="flex size-4 items-center justify-center">
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
4
|
export declare const styles: import("tailwind-variants").TVReturnType<{}, undefined, "", {}, undefined, import("tailwind-variants").TVReturnType<{}, undefined, "", unknown, unknown, undefined>>;
|
|
3
5
|
type ComboboxVariants = VariantProps<typeof styles>;
|
|
4
|
-
export interface ComboboxProps extends ComboboxVariants {
|
|
5
|
-
children?:
|
|
6
|
+
export interface ComboboxProps extends HTMLAttributes<HTMLDivElement>, ComboboxVariants {
|
|
7
|
+
children?: Snippet;
|
|
6
8
|
class?: string;
|
|
9
|
+
ref?: HTMLDivElement | null;
|
|
7
10
|
}
|
|
8
11
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLDialogAttributes } from "svelte/elements";
|
|
2
4
|
export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
3
5
|
size: {
|
|
4
6
|
xs: {
|
|
@@ -116,14 +118,14 @@ type DialogPropsCommon = {
|
|
|
116
118
|
bodyClass?: string;
|
|
117
119
|
footerClass?: string;
|
|
118
120
|
};
|
|
119
|
-
export type DialogProps = DialogVariants & DialogPropsCommon & {
|
|
120
|
-
children?:
|
|
121
|
-
header?:
|
|
122
|
-
footer?:
|
|
121
|
+
export type DialogProps = Omit<HTMLDialogAttributes, 'open'> & DialogVariants & DialogPropsCommon & {
|
|
122
|
+
children?: Snippet;
|
|
123
|
+
header?: Snippet;
|
|
124
|
+
footer?: Snippet;
|
|
123
125
|
open?: boolean;
|
|
124
126
|
staticRender?: boolean;
|
|
125
|
-
triggerRef?: HTMLElement;
|
|
126
|
-
ref?:
|
|
127
|
+
triggerRef?: HTMLElement | null;
|
|
128
|
+
ref?: HTMLDialogElement | null;
|
|
127
129
|
};
|
|
128
130
|
export type DialogPropsAstro = DialogVariants & DialogPropsCommon & {};
|
|
129
131
|
export {};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes, HTMLButtonAttributes, HTMLAnchorAttributes } from "svelte/elements";
|
|
2
4
|
export declare const styles: import("tailwind-variants").TVReturnType<{}, undefined, "", {}, undefined, import("tailwind-variants").TVReturnType<{}, undefined, "", unknown, unknown, undefined>>;
|
|
3
5
|
type DropdownMenuVariants = VariantProps<typeof styles>;
|
|
4
|
-
export interface DropdownMenuProps extends DropdownMenuVariants {
|
|
5
|
-
children?:
|
|
6
|
+
export interface DropdownMenuProps extends HTMLAttributes<HTMLDivElement>, DropdownMenuVariants {
|
|
7
|
+
children?: Snippet;
|
|
6
8
|
class?: string;
|
|
7
|
-
triggerRef:
|
|
9
|
+
triggerRef: HTMLElement | null;
|
|
8
10
|
open?: boolean;
|
|
11
|
+
ref?: HTMLDivElement | null;
|
|
9
12
|
}
|
|
10
13
|
export type DropdownMenuContext = {
|
|
11
14
|
setOpen: (open: boolean) => void;
|
|
@@ -13,11 +16,26 @@ export type DropdownMenuContext = {
|
|
|
13
16
|
};
|
|
14
17
|
export declare function getCtx(): DropdownMenuContext;
|
|
15
18
|
export declare function setCtx(context: DropdownMenuContext): void;
|
|
16
|
-
export
|
|
17
|
-
children?:
|
|
19
|
+
export interface DropdownMenuItemProps extends Omit<HTMLButtonAttributes & HTMLAnchorAttributes, 'class'> {
|
|
20
|
+
children?: Snippet;
|
|
18
21
|
class?: string;
|
|
19
|
-
onclick?: (e:
|
|
22
|
+
onclick?: (e: MouseEvent) => void;
|
|
20
23
|
href?: string;
|
|
21
|
-
linkProps?:
|
|
22
|
-
|
|
24
|
+
linkProps?: HTMLAnchorAttributes;
|
|
25
|
+
ref?: HTMLButtonElement | HTMLAnchorElement | null;
|
|
26
|
+
}
|
|
27
|
+
export interface DropdownMenuGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
28
|
+
children?: Snippet;
|
|
29
|
+
class?: string;
|
|
30
|
+
ref?: HTMLDivElement | null;
|
|
31
|
+
}
|
|
32
|
+
export interface DropdownMenuHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
33
|
+
children?: Snippet;
|
|
34
|
+
class?: string;
|
|
35
|
+
ref?: HTMLDivElement | null;
|
|
36
|
+
}
|
|
37
|
+
export interface DropdownMenuSeparatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
38
|
+
class?: string;
|
|
39
|
+
ref?: HTMLDivElement | null;
|
|
40
|
+
}
|
|
23
41
|
export {};
|
|
@@ -3,3 +3,4 @@ export { default as DropdownMenuItem } from './components/DropdownMenuItem.svelt
|
|
|
3
3
|
export { default as DropdownMenuGroup } from './components/DropdownMenuGroup.svelte';
|
|
4
4
|
export { default as DropdownMenuHeader } from './components/DropdownMenuHeader.svelte';
|
|
5
5
|
export { default as DropdownMenuSeparator } from './components/DropdownMenuSeparator.svelte';
|
|
6
|
+
export type { DropdownMenuProps, DropdownMenuItemProps, DropdownMenuGroupProps, DropdownMenuHeaderProps, DropdownMenuSeparatorProps } from './DropdownMenu';
|