tera-system-ui 0.1.50 → 0.1.63

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.
Files changed (188) hide show
  1. package/dist/components/accordion/Accordion.d.ts +15 -13
  2. package/dist/components/accordion/index.d.ts +1 -0
  3. package/dist/components/avatar/Avatar.d.ts +5 -3
  4. package/dist/components/avatar/index.d.ts +1 -0
  5. package/dist/components/brand-logo/BrandLogo.d.ts +7 -4
  6. package/dist/components/brand-logo/BrandLogo.js +1 -1
  7. package/dist/components/brand-logo/index.d.ts +1 -0
  8. package/dist/components/button/Button.d.ts +58 -14
  9. package/dist/components/button/Button.js +90 -27
  10. package/dist/components/button/Button.svelte +35 -30
  11. package/dist/components/button/Button.svelte.d.ts +1 -4
  12. package/dist/components/button/index.d.ts +1 -0
  13. package/dist/components/checkbox/Checkbox.d.ts +5 -2
  14. package/dist/components/checkbox/Checkbox.svelte +15 -8
  15. package/dist/components/checkbox/index.d.ts +1 -0
  16. package/dist/components/combobox/Combobox.d.ts +5 -2
  17. package/dist/components/combobox/index.d.ts +1 -0
  18. package/dist/components/dialog/Dialog.d.ts +8 -6
  19. package/dist/components/dialog/Dialog.svelte +1 -1
  20. package/dist/components/dialog/index.d.ts +1 -0
  21. package/dist/components/dropdown-menu/DropdownMenu.d.ts +26 -8
  22. package/dist/components/dropdown-menu/index.d.ts +1 -0
  23. package/dist/components/header/Header.d.ts +6 -3
  24. package/dist/components/header/Header.svelte.d.ts +1 -1
  25. package/dist/components/header/index.d.ts +1 -0
  26. package/dist/components/input/Input.d.ts +22 -6
  27. package/dist/components/input/Input.js +19 -10
  28. package/dist/components/input/Input.svelte +42 -9
  29. package/dist/components/input/index.d.ts +1 -0
  30. package/dist/components/label/Label.d.ts +33 -3
  31. package/dist/components/label/Label.js +14 -3
  32. package/dist/components/label/Label.svelte +7 -7
  33. package/dist/components/label/Label.svelte.d.ts +2 -2
  34. package/dist/components/label/index.d.ts +1 -0
  35. package/dist/components/language-picker-button/LanguagePickerButton.d.ts +5 -2
  36. package/dist/components/language-picker-button/index.d.ts +1 -0
  37. package/dist/components/light-dark-toggle/LightDarkToggle.d.ts +5 -2
  38. package/dist/components/light-dark-toggle/index.d.ts +1 -0
  39. package/dist/components/popover/Popover.d.ts +6 -3
  40. package/dist/components/popover/Popover.js +0 -1
  41. package/dist/components/popover/index.d.ts +1 -0
  42. package/dist/components/popover-responsive/PopoverResponsive.d.ts +5 -2
  43. package/dist/components/popover-responsive/index.d.ts +1 -0
  44. package/dist/components/select/Select.d.ts +19 -5
  45. package/dist/components/select/Select.js +18 -9
  46. package/dist/components/select/Select.svelte +17 -4
  47. package/dist/components/select/Select.svelte.d.ts +1 -1
  48. package/dist/components/select/index.d.ts +1 -0
  49. package/dist/components/side-navigation/SideNavigation.d.ts +6 -3
  50. package/dist/components/side-navigation/index.d.ts +1 -1
  51. package/dist/components/slider/Slider.d.ts +7 -4
  52. package/dist/components/slider/Slider.svelte +27 -52
  53. package/dist/components/slider/index.d.ts +1 -0
  54. package/dist/components/star-rating/StarRating.d.ts +5 -2
  55. package/dist/components/star-rating/StarRating.svelte +5 -5
  56. package/dist/components/star-rating/index.d.ts +1 -0
  57. package/dist/components/switch/Switch.d.ts +6 -2
  58. package/dist/components/switch/Switch.svelte +13 -7
  59. package/dist/components/switch/index.d.ts +1 -0
  60. package/dist/components/tabs/Tabs.svelte.d.ts +23 -3
  61. package/dist/components/tabs/index.d.ts +1 -0
  62. package/dist/components/tera-ui-context/TeraUiContext.d.ts +4 -6
  63. package/dist/components/tera-ui-context/TeraUiContext.svelte +0 -2
  64. package/dist/components/tera-ui-context/index.d.ts +1 -0
  65. package/dist/components/text-area/TextArea.d.ts +22 -8
  66. package/dist/components/text-area/TextArea.js +19 -10
  67. package/dist/components/text-area/TextArea.svelte +35 -29
  68. package/dist/components/text-area/index.d.ts +1 -0
  69. package/dist/components/user-avatar-with-menu/UserAvatarWithMenu.d.ts +5 -2
  70. package/dist/components/user-avatar-with-menu/index.d.ts +1 -0
  71. package/dist/index.d.ts +24 -0
  72. package/dist/paraglide/README.md +93 -0
  73. package/dist/paraglide/messages/_index.d.ts +22 -7
  74. package/dist/paraglide/messages/_index.js +487 -8
  75. package/dist/paraglide/messages/ar.d.ts +9 -0
  76. package/dist/paraglide/messages/ar.js +31 -0
  77. package/dist/paraglide/messages/bg.d.ts +9 -0
  78. package/dist/paraglide/messages/bg.js +31 -0
  79. package/dist/paraglide/messages/bn.d.ts +9 -0
  80. package/dist/paraglide/messages/bn.js +31 -0
  81. package/dist/paraglide/messages/ca.d.ts +9 -0
  82. package/dist/paraglide/messages/ca.js +31 -0
  83. package/dist/paraglide/messages/cs.d.ts +9 -0
  84. package/dist/paraglide/messages/cs.js +31 -0
  85. package/dist/paraglide/messages/da.d.ts +9 -0
  86. package/dist/paraglide/messages/da.js +31 -0
  87. package/dist/paraglide/messages/de.d.ts +9 -0
  88. package/dist/paraglide/messages/de.js +31 -0
  89. package/dist/paraglide/messages/el.d.ts +9 -0
  90. package/dist/paraglide/messages/el.js +31 -0
  91. package/dist/paraglide/messages/en.d.ts +9 -0
  92. package/dist/paraglide/messages/en.js +31 -0
  93. package/dist/paraglide/messages/es.d.ts +9 -0
  94. package/dist/paraglide/messages/es.js +31 -0
  95. package/dist/paraglide/messages/fi.d.ts +9 -0
  96. package/dist/paraglide/messages/fi.js +31 -0
  97. package/dist/paraglide/messages/fr.d.ts +9 -0
  98. package/dist/paraglide/messages/fr.js +31 -0
  99. package/dist/paraglide/messages/he.d.ts +9 -0
  100. package/dist/paraglide/messages/he.js +31 -0
  101. package/dist/paraglide/messages/hi.d.ts +9 -0
  102. package/dist/paraglide/messages/hi.js +31 -0
  103. package/dist/paraglide/messages/hu.d.ts +9 -0
  104. package/dist/paraglide/messages/hu.js +31 -0
  105. package/dist/paraglide/messages/id.d.ts +9 -0
  106. package/dist/paraglide/messages/id.js +31 -0
  107. package/dist/paraglide/messages/it.d.ts +9 -0
  108. package/dist/paraglide/messages/it.js +31 -0
  109. package/dist/paraglide/messages/ja.d.ts +9 -0
  110. package/dist/paraglide/messages/ja.js +31 -0
  111. package/dist/paraglide/messages/ko.d.ts +9 -0
  112. package/dist/paraglide/messages/ko.js +31 -0
  113. package/dist/paraglide/messages/lt.d.ts +9 -0
  114. package/dist/paraglide/messages/lt.js +31 -0
  115. package/dist/paraglide/messages/lv.d.ts +9 -0
  116. package/dist/paraglide/messages/lv.js +31 -0
  117. package/dist/paraglide/messages/ms.d.ts +9 -0
  118. package/dist/paraglide/messages/ms.js +31 -0
  119. package/dist/paraglide/messages/nl.d.ts +9 -0
  120. package/dist/paraglide/messages/nl.js +31 -0
  121. package/dist/paraglide/messages/no.d.ts +9 -0
  122. package/dist/paraglide/messages/no.js +31 -0
  123. package/dist/paraglide/messages/pl.d.ts +9 -0
  124. package/dist/paraglide/messages/pl.js +31 -0
  125. package/dist/paraglide/messages/pt.d.ts +9 -0
  126. package/dist/paraglide/messages/pt.js +31 -0
  127. package/dist/paraglide/messages/ro.d.ts +9 -0
  128. package/dist/paraglide/messages/ro.js +31 -0
  129. package/dist/paraglide/messages/ru.d.ts +9 -0
  130. package/dist/paraglide/messages/ru.js +31 -0
  131. package/dist/paraglide/messages/sk.d.ts +9 -0
  132. package/dist/paraglide/messages/sk.js +31 -0
  133. package/dist/paraglide/messages/sl.d.ts +9 -0
  134. package/dist/paraglide/messages/sl.js +31 -0
  135. package/dist/paraglide/messages/sq.d.ts +9 -0
  136. package/dist/paraglide/messages/sq.js +31 -0
  137. package/dist/paraglide/messages/sr.d.ts +9 -0
  138. package/dist/paraglide/messages/sr.js +31 -0
  139. package/dist/paraglide/messages/sv.d.ts +9 -0
  140. package/dist/paraglide/messages/sv.js +31 -0
  141. package/dist/paraglide/messages/sw.d.ts +9 -0
  142. package/dist/paraglide/messages/sw.js +31 -0
  143. package/dist/paraglide/messages/ta.d.ts +9 -0
  144. package/dist/paraglide/messages/ta.js +31 -0
  145. package/dist/paraglide/messages/te.d.ts +9 -0
  146. package/dist/paraglide/messages/te.js +31 -0
  147. package/dist/paraglide/messages/th.d.ts +9 -0
  148. package/dist/paraglide/messages/th.js +31 -0
  149. package/dist/paraglide/messages/tl.d.ts +9 -0
  150. package/dist/paraglide/messages/tl.js +31 -0
  151. package/dist/paraglide/messages/tr.d.ts +9 -0
  152. package/dist/paraglide/messages/tr.js +31 -0
  153. package/dist/paraglide/messages/uk.d.ts +9 -0
  154. package/dist/paraglide/messages/uk.js +31 -0
  155. package/dist/paraglide/messages/vi.d.ts +9 -0
  156. package/dist/paraglide/messages/vi.js +31 -0
  157. package/dist/paraglide/messages/zh-CN.d.ts +9 -0
  158. package/dist/paraglide/messages/zh-CN.js +31 -0
  159. package/dist/paraglide/messages/zh-TW.d.ts +9 -0
  160. package/dist/paraglide/messages/zh-TW.js +31 -0
  161. package/dist/paraglide/messages.js +1 -1
  162. package/dist/paraglide/registry.js +1 -1
  163. package/dist/paraglide/runtime.d.ts +221 -45
  164. package/dist/paraglide/runtime.js +378 -65
  165. package/dist/paraglide/server.d.ts +40 -4
  166. package/dist/paraglide/server.js +83 -46
  167. package/dist/tera-i18n/projects/tera-system-ui/project.inlang/.meta.json +3 -0
  168. package/dist/tera-i18n/projects/tera-system-ui/project.inlang/README.md +103 -0
  169. package/dist/themes/tera-ui-base.css +70 -7
  170. package/dist/types/index.d.ts +25 -0
  171. package/dist/types/index.js +3 -0
  172. package/package.json +150 -36
  173. package/scripts/add-component-template.js +1 -1
  174. package/scripts/generate-ts-index.js +38 -12
  175. package/dist/paraglide/messages/text_account_settings.d.ts +0 -3
  176. package/dist/paraglide/messages/text_account_settings.js +0 -238
  177. package/dist/paraglide/messages/text_calces_documentation.d.ts +0 -3
  178. package/dist/paraglide/messages/text_calces_documentation.js +0 -238
  179. package/dist/paraglide/messages/text_calces_scientific_calculator.d.ts +0 -3
  180. package/dist/paraglide/messages/text_calces_scientific_calculator.js +0 -238
  181. package/dist/paraglide/messages/text_currency_converter.d.ts +0 -3
  182. package/dist/paraglide/messages/text_currency_converter.js +0 -238
  183. package/dist/paraglide/messages/text_logout.d.ts +0 -3
  184. package/dist/paraglide/messages/text_logout.js +0 -238
  185. package/dist/paraglide/messages/text_select_language.d.ts +0 -3
  186. package/dist/paraglide/messages/text_select_language.js +0 -238
  187. package/dist/paraglide/messages/text_unit_converter.d.ts +0 -3
  188. package/dist/paraglide/messages/text_unit_converter.js +0 -238
@@ -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?: any;
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: (value: string | string[]) => void;
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?: any;
17
+ ref?: HTMLDivElement | null;
18
+ children?: Snippet;
17
19
  }
18
- export interface AccordionTriggerProps {
19
- children?: any;
20
- ref?: HTMLButtonElement;
20
+ export interface AccordionTriggerProps extends HTMLButtonAttributes {
21
+ children?: Snippet;
22
+ ref?: HTMLButtonElement | null;
21
23
  }
22
- export interface AccordionContentProps {
23
- children?: any;
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?: any;
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?: any;
41
+ ref?: HTMLDivElement | null;
40
42
  userUid?: string;
41
43
  apiUrl?: string;
42
44
  }
@@ -1 +1,2 @@
1
1
  export { default as Avatar } from './Avatar.svelte';
2
+ export type { AvatarProps } from './Avatar';
@@ -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;
@@ -8,7 +10,7 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
8
10
  shape: {
9
11
  square: string;
10
12
  };
11
- }, undefined, "h-icon-md [&>.second-part]:fill-brand-500", {
13
+ }, undefined, "[&>.second-part]:fill-brand-500", {
12
14
  theme: {
13
15
  light: string;
14
16
  dark: string;
@@ -26,10 +28,11 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
26
28
  shape: {
27
29
  square: string;
28
30
  };
29
- }, undefined, "h-icon-md [&>.second-part]:fill-brand-500", unknown, unknown, undefined>>;
31
+ }, undefined, "[&>.second-part]:fill-brand-500", unknown, unknown, undefined>>;
30
32
  type BrandLogoVariants = VariantProps<typeof styles>;
31
- export interface BrandLogoProps extends BrandLogoVariants {
32
- children?: any;
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,6 +1,6 @@
1
1
  import { tv } from "tailwind-variants";
2
2
  export const styles = tv({
3
- base: 'h-icon-md [&>.second-part]:fill-brand-500',
3
+ base: '[&>.second-part]:fill-brand-500',
4
4
  variants: {
5
5
  theme: {
6
6
  light: '',
@@ -1 +1,2 @@
1
1
  export { default as BrandLogo } from './BrandLogo.svelte';
2
+ export type { BrandLogoProps } from './BrandLogo';
@@ -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
- secondary: string;
6
- ghost: string;
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
- dangerous: {
32
+ danger: {
33
+ true: string;
34
+ };
35
+ block: {
20
36
  true: string;
21
37
  };
22
- }, undefined, "relative font-medium overflow-clip rounded inline-flex items-center justify-center !leading-[0.1rem] [&>svg]:stroke-icon duration-element-react select-none focus-visible:ring-2 outline-none", {
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
- secondary: string;
26
- ghost: string;
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
- dangerous: {
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
- secondary: string;
46
- ghost: string;
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
- dangerous: {
100
+ danger: {
101
+ true: string;
102
+ };
103
+ block: {
60
104
  true: string;
61
105
  };
62
- }, undefined, "relative font-medium overflow-clip rounded inline-flex items-center justify-center !leading-[0.1rem] [&>svg]:stroke-icon duration-element-react select-none focus-visible:ring-2 outline-none", unknown, unknown, undefined>>;
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: any;
108
+ export interface ButtonProps extends Omit<HTMLButtonAttributes, 'disabled'>, ButtonVariants {
109
+ children?: Snippet;
66
110
  class?: string;
67
- onclick?: any;
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 font-medium overflow-clip rounded inline-flex items-center justify-center !leading-[0.1rem] [&>svg]:stroke-icon duration-element-react select-none focus-visible:ring-2 outline-none',
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-700 text-neutral-1 border border-primary-700 hover:bg-primary-800 focus:ring-primary-token-9 [&:after]:bg-black',
7
- secondary: 'bg-neutral-token-4 text-neutral-token-13 border-neutral-token-4 border hover:bg-neutral-token-5 focus:ring-neutral-token-7',
8
- ghost: 'text-neutral-token-13 hover:bg-neutral-token-3 focus:ring-neutral-token-7',
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
- sm: 'h-6 px-2 gap-1 text-sm [&>svg]:size-icon-xs',
12
- md: 'h-8 px-3 gap-1.5 [&>svg]:size-icon-sm',
13
- lg: 'h-10 px-3 gap-1.5 [&>svg]:size-icon-md',
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 border-neutral-token-3 pointer-events-none',
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
- dangerous: {
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
- dangerous: true,
29
- // @ts-ignore
30
- disabled: [false, undefined],
31
- class: 'bg-error-700 text-neutral-1 border border-error-700 hover:bg-error-800 focus:ring-error-400'
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: 'secondary',
35
- dangerous: true,
36
- // @ts-ignore
37
- disabled: [false, undefined],
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: 'ghost',
42
- dangerous: true,
43
- // @ts-ignore
44
- disabled: [false, undefined],
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: 'ghost',
77
+ variant: 'text',
49
78
  disabled: true,
50
- class: 'border-transparent bg-transparent'
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: 'primary',
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 = 'primary', icon, size, dangerous, class: className,
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 & {ref: HTMLButtonElement} = $props();
9
+ }: ButtonProps = $props();
9
10
 
10
- $effect(() => {
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
- ripple.style.width = ripple.style.height = `${size}px`;
19
- ripple.style.left = `${x}px`;
20
- ripple.style.top = `${y}px`;
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
- // Set ripple color based on data attribute
23
- let rippleColor = 'bg-neutral-token-8/30';
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
- ripple.classList.add('ripple');
31
- ripple.classList.add(rippleColor);
32
- ref.appendChild(ripple);
33
-
34
- // Remove the ripple after animation completes
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, dangerous, className })}
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
- type $$ComponentProps = ButtonProps & {
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 +1,2 @@
1
1
  export { default as Button } from './Button.svelte';
2
+ export type { ButtonProps } from './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?: any;
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
- bind:ref
18
- class={cn(
19
- "border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=indeterminate]:bg-primary data-[state=checked]:text-primary-foreground peer box-content size-4 shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",
20
- className
21
- )}
22
- bind:checked
23
- bind:indeterminate
24
- {...restProps}
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 +1,2 @@
1
1
  export { default as Checkbox } from './Checkbox.svelte';
2
+ export type { CheckboxProps } from './Checkbox';
@@ -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?: any;
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 +1,2 @@
1
1
  export { default as Combobox } from './Combobox.svelte';
2
+ export type { ComboboxProps } from './Combobox';
@@ -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?: any;
121
- header?: any;
122
- footer?: any;
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?: any;
127
+ triggerRef?: HTMLElement | null;
128
+ ref?: HTMLDialogElement | null;
127
129
  };
128
130
  export type DialogPropsAstro = DialogVariants & DialogPropsCommon & {};
129
131
  export {};
@@ -85,7 +85,7 @@
85
85
  <button class=""></button>
86
86
  {#if (closeButton)}
87
87
  <form method="dialog">
88
- <Button class="absolute right-1 top-1 [&>svg]:opacity-45 [&>svg]:hover:opacity-90 z-10" icon
88
+ <Button class="!absolute right-1 top-1 [&>svg]:opacity-45 [&>svg]:hover:opacity-90 z-10" icon
89
89
  variant="ghost"
90
90
  size="md">
91
91
  <IconX/>
@@ -1 +1,2 @@
1
1
  export { default as Dialog } from './Dialog.svelte';
2
+ export type { DialogProps, DialogPropsAstro } from './Dialog';