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,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?: any;
6
+ export interface DropdownMenuProps extends HTMLAttributes<HTMLDivElement>, DropdownMenuVariants {
7
+ children?: Snippet;
6
8
  class?: string;
7
- triggerRef: any;
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 type DropdownMenuItemProps = {
17
- children?: any;
19
+ export interface DropdownMenuItemProps extends Omit<HTMLButtonAttributes & HTMLAnchorAttributes, 'class'> {
20
+ children?: Snippet;
18
21
  class?: string;
19
- onclick?: (e: any) => void;
22
+ onclick?: (e: MouseEvent) => void;
20
23
  href?: string;
21
- linkProps?: any;
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';
@@ -1,8 +1,11 @@
1
1
  import { type VariantProps } from "tailwind-variants";
2
- export declare const styles: import("tailwind-variants").TVReturnType<{}, undefined, "", {}, undefined, import("tailwind-variants").TVReturnType<{}, undefined, "", unknown, unknown, undefined>>;
2
+ import type { Snippet } from "svelte";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+ export declare const styles: import("tailwind-variants", { with: { "resolution-mode": "import" } }).TVReturnType<{}, undefined, "", {}, undefined, import("tailwind-variants", { with: { "resolution-mode": "import" } }).TVReturnType<{}, undefined, "", unknown, unknown, undefined>>;
3
5
  type HeaderVariants = VariantProps<typeof styles>;
4
- export interface HeaderProps extends HeaderVariants {
5
- children: any;
6
+ export interface HeaderProps extends HTMLAttributes<HTMLElement>, HeaderVariants {
7
+ children?: Snippet;
6
8
  onHamburgerClick?: () => void;
9
+ ref?: HTMLElement | null;
7
10
  }
8
11
  export {};
@@ -1,5 +1,5 @@
1
1
  import { type HeaderProps } from "./Header";
2
2
  import './header.scss';
3
- declare const Header: import("svelte").Component<HeaderProps, {}, "">;
3
+ declare const Header: import("svelte", { with: { "resolution-mode": "import" } }).Component<HeaderProps, {}, "">;
4
4
  type Header = ReturnType<typeof Header>;
5
5
  export default Header;
@@ -1 +1,2 @@
1
1
  export { default as Header } from './Header.svelte';
2
+ export type { HeaderProps } from './Header';
@@ -1,4 +1,6 @@
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<{
3
5
  variant: {
4
6
  outlined: string;
@@ -14,7 +16,11 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
14
16
  md: string;
15
17
  lg: string;
16
18
  };
17
- }, undefined, "relative w-full inline-flex items-center justify-center rounded outline-none transition-all duration-element-react ring-primary-token-5/50", {
19
+ status: {
20
+ error: string;
21
+ warning: string;
22
+ };
23
+ }, undefined, "w-full inline-flex items-center justify-center rounded-md outline-none font-normal text-neutral-token-13 placeholder:text-neutral-token-7", {
18
24
  variant: {
19
25
  outlined: string;
20
26
  filled: string;
@@ -29,6 +35,10 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
29
35
  md: string;
30
36
  lg: string;
31
37
  };
38
+ status: {
39
+ error: string;
40
+ warning: string;
41
+ };
32
42
  }, undefined, import("tailwind-variants").TVReturnType<{
33
43
  variant: {
34
44
  outlined: string;
@@ -44,13 +54,19 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
44
54
  md: string;
45
55
  lg: string;
46
56
  };
47
- }, undefined, "relative w-full inline-flex items-center justify-center rounded outline-none transition-all duration-element-react ring-primary-token-5/50", unknown, unknown, undefined>>;
57
+ status: {
58
+ error: string;
59
+ warning: string;
60
+ };
61
+ }, undefined, "w-full inline-flex items-center justify-center rounded-md outline-none font-normal text-neutral-token-13 placeholder:text-neutral-token-7", unknown, unknown, undefined>>;
48
62
  type InputVariants = VariantProps<typeof styles>;
49
- export interface InputProps extends InputVariants {
50
- children?: any;
63
+ export interface InputProps extends Omit<HTMLInputAttributes, 'disabled' | 'size' | 'value' | 'prefix'>, InputVariants {
64
+ children?: Snippet;
51
65
  class?: string;
52
66
  value?: string;
53
- ref?: HTMLInputElement;
54
- prefix?: any;
67
+ ref?: HTMLInputElement | null;
68
+ prefix?: Snippet;
69
+ suffix?: Snippet;
70
+ allowClear?: boolean;
55
71
  }
56
72
  export {};
@@ -1,32 +1,41 @@
1
1
  import { tv } from "tailwind-variants";
2
2
  export const styles = tv({
3
- base: 'relative w-full inline-flex items-center justify-center rounded outline-none transition-all duration-element-react ring-primary-token-5/50',
3
+ base: 'w-full inline-flex items-center justify-center rounded-md outline-none font-normal text-neutral-token-13 placeholder:text-neutral-token-7',
4
4
  variants: {
5
5
  variant: {
6
- outlined: 'border border-neutral-token-5 bg-neutral-token-1 focus:border-primary-token-6 hover:border-primary-token-5 focus-visible:ring-2',
7
- filled: 'bg-input border border-neutral-token-4 focus:bg-neutral-token-1 focus:border-primary-token-6 hover:bg-neutral-token-5 focus-visible:ring-2',
8
- borderless: 'bg-neutral-token-1 border-0',
6
+ outlined: 'border border-neutral-token-5 bg-neutral-token-1 hover:border-primary-500 focus:border-primary-600 focus:shadow-[0_0_0_2px_rgba(59,130,246,0.1)] transition-all duration-200',
7
+ filled: 'bg-neutral-token-3 border border-transparent hover:bg-neutral-token-4 focus:bg-neutral-token-1 focus:border-primary-600 focus:shadow-[0_0_0_2px_rgba(59,130,246,0.1)] transition-all duration-200',
8
+ borderless: 'bg-transparent border-0 hover:bg-neutral-token-2 focus:bg-neutral-token-2 transition-all duration-200',
9
9
  },
10
10
  disabled: {
11
- true: 'cursor-not-allowed opacity-70 text-neutral-token-10',
11
+ true: 'cursor-not-allowed bg-neutral-token-3 text-neutral-token-7 border-neutral-token-5',
12
12
  false: 'cursor-text',
13
13
  },
14
14
  size: {
15
- sm: 'h-6 px-2 text-sm',
16
- md: 'h-8 px-3 text-base',
17
- lg: 'h-10 px-3 text-lg',
15
+ sm: 'h-6 px-3 text-sm',
16
+ md: 'h-8 px-3 text-sm',
17
+ lg: 'h-10 px-3 text-base',
18
+ },
19
+ status: {
20
+ error: 'border-error-500 hover:border-error-400 focus:border-error-500 focus:shadow-[0_0_0_2px_rgba(239,68,68,0.1)]',
21
+ warning: 'border-warning-500 hover:border-warning-400 focus:border-warning-500 focus:shadow-[0_0_0_2px_rgba(249,115,22,0.1)]',
18
22
  },
19
23
  },
20
24
  compoundVariants: [
21
25
  {
22
26
  variant: 'outlined',
23
27
  disabled: true,
24
- class: 'hover:border-border'
28
+ class: 'hover:border-neutral-token-5'
25
29
  },
26
30
  {
27
31
  variant: 'filled',
28
32
  disabled: true,
29
- class: 'hover:bg-input'
33
+ class: 'hover:bg-neutral-token-3'
34
+ },
35
+ {
36
+ variant: 'borderless',
37
+ disabled: true,
38
+ class: 'hover:bg-transparent'
30
39
  }
31
40
  ],
32
41
  defaultVariants: {
@@ -1,25 +1,58 @@
1
1
  <script lang="ts">
2
2
  import {type InputProps, styles} from "./Input";
3
+ import {IconX} from "../icons";
3
4
 
4
5
  let {
5
6
  children,
6
7
  class: className,
7
8
  value = $bindable(),
8
9
  ref = $bindable(),
9
- size,
10
+ size = 'md',
10
11
  disabled,
11
12
  variant = 'outlined',
12
13
  prefix,
14
+ suffix,
15
+ allowClear,
16
+ status,
13
17
  ...props
14
18
  }: InputProps = $props();
15
19
 
20
+ function clearInput() {
21
+ value = '';
22
+ ref?.focus();
23
+ }
16
24
  </script>
17
25
 
18
- <input
19
- type="text"
20
- bind:this={ref}
21
- class={styles({ variant, disabled , size, className})}
22
- {disabled}
23
- {...props}
24
- bind:value
25
- />
26
+ <div class="relative inline-flex w-full">
27
+ {#if prefix}
28
+ <span class="absolute left-3 top-1/2 -translate-y-1/2 text-neutral-token-7 pointer-events-none">
29
+ {@render prefix()}
30
+ </span>
31
+ {/if}
32
+
33
+ <input
34
+ type="text"
35
+ bind:this={ref}
36
+ class={styles({ variant, disabled , size, status, className })}
37
+ class:pl-9={prefix}
38
+ class:pr-9={allowClear && value || suffix}
39
+ {disabled}
40
+ {...props}
41
+ bind:value
42
+ />
43
+
44
+ {#if allowClear && value && !disabled}
45
+ <button
46
+ type="button"
47
+ onclick={clearInput}
48
+ class="absolute right-3 top-1/2 -translate-y-1/2 text-neutral-token-7 hover:text-neutral-token-10 transition-colors"
49
+ tabindex="-1"
50
+ >
51
+ <IconX class="size-3.5"/>
52
+ </button>
53
+ {:else if suffix}
54
+ <span class="absolute right-3 top-1/2 -translate-y-1/2 text-neutral-token-7 pointer-events-none">
55
+ {@render suffix()}
56
+ </span>
57
+ {/if}
58
+ </div>
@@ -1 +1,2 @@
1
1
  export { default as Input } from './Input.svelte';
2
+ export type { InputProps } from './Input';
@@ -1,8 +1,38 @@
1
1
  import { type VariantProps } from "tailwind-variants";
2
- export declare const styles: import("tailwind-variants").TVReturnType<{}, undefined, "", {}, undefined, import("tailwind-variants").TVReturnType<{}, undefined, "", unknown, unknown, undefined>>;
2
+ import type { Snippet } from "svelte";
3
+ import type { HTMLLabelAttributes } from "svelte/elements";
4
+ export declare const styles: import("tailwind-variants").TVReturnType<{
5
+ size: {
6
+ sm: string;
7
+ md: string;
8
+ lg: string;
9
+ };
10
+ required: {
11
+ true: string;
12
+ };
13
+ }, undefined, "text-sm font-medium text-neutral-token-13 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50", {
14
+ size: {
15
+ sm: string;
16
+ md: string;
17
+ lg: string;
18
+ };
19
+ required: {
20
+ true: string;
21
+ };
22
+ }, undefined, import("tailwind-variants").TVReturnType<{
23
+ size: {
24
+ sm: string;
25
+ md: string;
26
+ lg: string;
27
+ };
28
+ required: {
29
+ true: string;
30
+ };
31
+ }, undefined, "text-sm font-medium text-neutral-token-13 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50", unknown, unknown, undefined>>;
3
32
  type LabelVariants = VariantProps<typeof styles>;
4
- export interface LabelProps extends LabelVariants {
5
- children?: any;
33
+ export interface LabelProps extends HTMLLabelAttributes, LabelVariants {
34
+ children?: Snippet;
6
35
  class?: string;
36
+ ref?: HTMLLabelElement | null;
7
37
  }
8
38
  export {};
@@ -1,7 +1,18 @@
1
1
  import { tv } from "tailwind-variants";
2
2
  export const styles = tv({
3
- base: '',
4
- variants: {},
3
+ base: 'text-sm font-medium text-neutral-token-13 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
4
+ variants: {
5
+ size: {
6
+ sm: 'text-xs',
7
+ md: 'text-sm',
8
+ lg: 'text-base',
9
+ },
10
+ required: {
11
+ true: "after:content-['*'] after:ml-0.5 after:text-error-500",
12
+ },
13
+ },
5
14
  compoundVariants: [],
6
- defaultVariants: {},
15
+ defaultVariants: {
16
+ size: 'md',
17
+ },
7
18
  });
@@ -1,19 +1,19 @@
1
1
  <script lang="ts">
2
2
  import { Label as LabelPrimitive } from "bits-ui";
3
3
  import { cn } from "../../utils";
4
+ import { type LabelProps, styles } from "./Label";
4
5
 
5
6
  let {
6
7
  ref = $bindable(null),
7
8
  class: className,
9
+ size = 'md',
10
+ required,
8
11
  ...restProps
9
- }: LabelPrimitive.RootProps = $props();
12
+ }: LabelProps = $props();
10
13
  </script>
11
14
 
12
15
  <LabelPrimitive.Root
13
- bind:ref
14
- class={cn(
15
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
16
- className
17
- )}
18
- {...restProps}
16
+ bind:ref
17
+ class={cn(styles({ size, required }), className)}
18
+ {...restProps}
19
19
  />
@@ -1,4 +1,4 @@
1
- import { Label as LabelPrimitive } from "bits-ui";
2
- declare const Label: import("svelte").Component<LabelPrimitive.RootProps, {}, "ref">;
1
+ import { type LabelProps } from "./Label";
2
+ declare const Label: import("svelte").Component<LabelProps, {}, "ref">;
3
3
  type Label = ReturnType<typeof Label>;
4
4
  export default Label;
@@ -1 +1,2 @@
1
1
  export { default as Label } from './Label.svelte';
2
+ export type { LabelProps } from './Label';
@@ -1,12 +1,15 @@
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<{}, undefined, "", {}, undefined, import("tailwind-variants").TVReturnType<{}, undefined, "", unknown, unknown, undefined>>;
3
5
  type LanguagePickerButtonVariants = VariantProps<typeof styles>;
4
- export interface LanguagePickerButtonProps extends LanguagePickerButtonVariants {
5
- children?: any;
6
+ export interface LanguagePickerButtonProps extends HTMLButtonAttributes, LanguagePickerButtonVariants {
7
+ children?: Snippet;
6
8
  class?: string;
7
9
  language?: string;
8
10
  supportLanguages?: string[];
9
11
  basePath?: string;
10
12
  open?: boolean;
13
+ ref?: HTMLButtonElement | null;
11
14
  }
12
15
  export {};
@@ -1 +1,2 @@
1
1
  export { default as LanguagePickerButton } from './LanguagePickerButton.svelte';
2
+ export type { LanguagePickerButtonProps } from './LanguagePickerButton';
@@ -1,8 +1,11 @@
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<{}, undefined, "", {}, undefined, import("tailwind-variants").TVReturnType<{}, undefined, "", unknown, unknown, undefined>>;
3
5
  type LightDarkToggleVariants = VariantProps<typeof styles>;
4
- export interface LightDarkToggleProps extends LightDarkToggleVariants {
5
- children?: any;
6
+ export interface LightDarkToggleProps extends HTMLButtonAttributes, LightDarkToggleVariants {
7
+ children?: Snippet;
6
8
  class?: string;
9
+ ref?: HTMLButtonElement | null;
7
10
  }
8
11
  export {};
@@ -1 +1,2 @@
1
1
  export { default as LightDarkToggle } from './LightDarkToggle.svelte';
2
+ export type { LightDarkToggleProps } from './LightDarkToggle';
@@ -1,15 +1,18 @@
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 PopoverVariants = VariantProps<typeof styles>;
4
- export interface PopoverProps extends PopoverVariants {
5
- children?: any;
6
+ export interface PopoverProps extends HTMLAttributes<HTMLDivElement>, PopoverVariants {
7
+ children?: Snippet;
6
8
  class?: string;
7
- triggerRef: any;
9
+ triggerRef: HTMLElement | null;
8
10
  offset?: number;
9
11
  padding?: number;
10
12
  open?: boolean;
11
13
  focusTriggerAfterClose?: boolean;
12
14
  flip?: boolean;
13
15
  autoTrigger?: boolean;
16
+ ref?: HTMLDivElement | null;
14
17
  }
15
18
  export {};
@@ -1,5 +1,4 @@
1
1
  import { tv } from "tailwind-variants";
2
- import { shift } from "@floating-ui/dom";
3
2
  export const styles = tv({
4
3
  base: '',
5
4
  variants: {},
@@ -1 +1,2 @@
1
1
  export { default as Popover } from './Popover.svelte';
2
+ export type { PopoverProps } from './Popover';
@@ -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 PopoverResponsiveVariants = VariantProps<typeof styles>;
4
- export interface PopoverResponsiveProps extends PopoverResponsiveVariants {
5
- children?: any;
6
+ export interface PopoverResponsiveProps extends HTMLAttributes<HTMLDivElement>, PopoverResponsiveVariants {
7
+ children?: Snippet;
6
8
  class?: string;
9
+ ref?: HTMLDivElement | null;
7
10
  }
8
11
  export {};
@@ -1 +1,2 @@
1
1
  export { default as PopoverResponsive } from './PopoverResponsive.svelte';
2
+ export type { PopoverResponsiveProps } from './PopoverResponsive';
@@ -1,4 +1,6 @@
1
1
  import { type VariantProps } from "tailwind-variants";
2
+ import type { Snippet } from "svelte";
3
+ import type { HTMLSelectAttributes } from "svelte/elements";
2
4
  export declare const styles: import("tailwind-variants").TVReturnType<{
3
5
  variant: {
4
6
  outlined: string;
@@ -14,7 +16,11 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
14
16
  md: string;
15
17
  lg: string;
16
18
  };
17
- }, undefined, "relative w-full inline-flex items-center justify-center rounded outline-none transition-all duration-element-react ring-primary-token-5/50", {
19
+ status: {
20
+ error: string;
21
+ warning: string;
22
+ };
23
+ }, undefined, "w-full inline-flex items-center justify-center rounded-md outline-none font-normal text-neutral-token-13 appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27currentColor%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpolyline points=%276 9 12 15 18 9%27/%3E%3C/svg%3E)] bg-[length:16px] bg-[right_0.75rem_center] bg-no-repeat", {
18
24
  variant: {
19
25
  outlined: string;
20
26
  filled: string;
@@ -29,6 +35,10 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
29
35
  md: string;
30
36
  lg: string;
31
37
  };
38
+ status: {
39
+ error: string;
40
+ warning: string;
41
+ };
32
42
  }, undefined, import("tailwind-variants").TVReturnType<{
33
43
  variant: {
34
44
  outlined: string;
@@ -44,12 +54,16 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
44
54
  md: string;
45
55
  lg: string;
46
56
  };
47
- }, undefined, "relative w-full inline-flex items-center justify-center rounded outline-none transition-all duration-element-react ring-primary-token-5/50", unknown, unknown, undefined>>;
57
+ status: {
58
+ error: string;
59
+ warning: string;
60
+ };
61
+ }, undefined, "w-full inline-flex items-center justify-center rounded-md outline-none font-normal text-neutral-token-13 appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27currentColor%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpolyline points=%276 9 12 15 18 9%27/%3E%3C/svg%3E)] bg-[length:16px] bg-[right_0.75rem_center] bg-no-repeat", unknown, unknown, undefined>>;
48
62
  type SelectVariants = VariantProps<typeof styles>;
49
- export interface SelectProps extends SelectVariants {
50
- children?: any;
63
+ export interface SelectProps extends Omit<HTMLSelectAttributes, 'disabled' | 'size' | 'value'>, SelectVariants {
64
+ children?: Snippet;
51
65
  class?: string;
52
66
  value?: string;
53
- ref?: HTMLInputElement;
67
+ ref?: HTMLSelectElement | null;
54
68
  }
55
69
  export {};
@@ -1,20 +1,24 @@
1
1
  import { tv } from "tailwind-variants";
2
2
  export const styles = tv({
3
- base: 'relative w-full inline-flex items-center justify-center rounded outline-none transition-all duration-element-react ring-primary-token-5/50',
3
+ base: 'w-full inline-flex items-center justify-center rounded-md outline-none font-normal text-neutral-token-13 appearance-none bg-[url(\'data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27currentColor%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpolyline points=%276 9 12 15 18 9%27/%3E%3C/svg%3E)] bg-[length:16px] bg-[right_0.75rem_center] bg-no-repeat',
4
4
  variants: {
5
5
  variant: {
6
- outlined: 'border border-neutral-token-5 bg-neutral-token-1 focus:border-primary-token-6 hover:border-primary-token-5 focus-visible:ring-2',
7
- filled: 'bg-neutral-token-4 border border-neutral-token-4 focus:bg-neutral-token-1 focus:border-primary-token-6 hover:bg-neutral-token-4 focus-visible:ring-2',
8
- borderless: 'bg-neutral-token-1 border-0',
6
+ outlined: 'border border-neutral-token-5 bg-neutral-token-1 hover:border-primary-500 focus:border-primary-600 focus:shadow-[0_0_0_2px_rgba(59,130,246,0.1)] transition-all duration-200',
7
+ filled: 'bg-neutral-token-3 border border-transparent hover:bg-neutral-token-4 focus:bg-neutral-token-1 focus:border-primary-600 focus:shadow-[0_0_0_2px_rgba(59,130,246,0.1)] transition-all duration-200',
8
+ borderless: 'bg-transparent border-0 hover:bg-neutral-token-2 focus:bg-neutral-token-2 transition-all duration-200',
9
9
  },
10
10
  disabled: {
11
- true: 'cursor-not-allowed opacity-70 text-neutral-token-10',
12
- false: 'cursor-text',
11
+ true: 'cursor-not-allowed bg-neutral-token-3 text-neutral-token-7 border-neutral-token-5',
12
+ false: 'cursor-pointer',
13
13
  },
14
14
  size: {
15
- sm: 'h-6 px-2 text-sm',
16
- md: 'h-8 px-3 text-base',
17
- lg: 'h-10 px-3 text-lg',
15
+ sm: 'h-6 px-3 pr-8 text-sm',
16
+ md: 'h-8 px-3 pr-8 text-sm',
17
+ lg: 'h-10 px-3 pr-10 text-base',
18
+ },
19
+ status: {
20
+ error: 'border-error-500 hover:border-error-400 focus:border-error-500 focus:shadow-[0_0_0_2px_rgba(239,68,68,0.1)]',
21
+ warning: 'border-warning-500 hover:border-warning-400 focus:border-warning-500 focus:shadow-[0_0_0_2px_rgba(249,115,22,0.1)]',
18
22
  },
19
23
  },
20
24
  compoundVariants: [
@@ -27,6 +31,11 @@ export const styles = tv({
27
31
  variant: 'filled',
28
32
  disabled: true,
29
33
  class: 'hover:bg-neutral-token-3'
34
+ },
35
+ {
36
+ variant: 'borderless',
37
+ disabled: true,
38
+ class: 'hover:bg-transparent'
30
39
  }
31
40
  ],
32
41
  defaultVariants: {
@@ -3,13 +3,26 @@
3
3
 
4
4
  import {type SelectProps, styles} from "./Select";
5
5
 
6
- let {children, variant, disabled, size, class: className, value = $bindable(), ...props}: SelectProps = $props();
6
+ let {
7
+ children,
8
+ variant = 'outlined',
9
+ disabled,
10
+ size = 'md',
11
+ status,
12
+ class: className,
13
+ value = $bindable(),
14
+ ref = $bindable(),
15
+ ...props
16
+ }: SelectProps = $props();
7
17
 
8
18
  </script>
9
19
 
10
- <select {...props}
11
- bind:value
12
- class={"tera-select pr-3" + styles({ variant, disabled , size, className: className})}
20
+ <select
21
+ bind:this={ref}
22
+ bind:value
23
+ class={styles({ variant, disabled, size, status, className })}
24
+ {disabled}
25
+ {...props}
13
26
  >
14
27
  {@render children?.()}
15
28
  </select>
@@ -1,5 +1,5 @@
1
1
  import './select.scss';
2
2
  import { type SelectProps } from "./Select";
3
- declare const Select: import("svelte").Component<SelectProps, {}, "value">;
3
+ declare const Select: import("svelte").Component<SelectProps, {}, "value" | "ref">;
4
4
  type Select = ReturnType<typeof Select>;
5
5
  export default Select;
@@ -1 +1,2 @@
1
1
  export { default as Select } from './Select.svelte';
2
+ export type { SelectProps } from './Select';
@@ -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<{}, undefined, "", {}, undefined, import("tailwind-variants").TVReturnType<{}, undefined, "", unknown, unknown, undefined>>;
3
5
  type SideNavigationVariants = VariantProps<typeof styles>;
4
6
  export type SideNavigationItem = {
@@ -7,13 +9,14 @@ export type SideNavigationItem = {
7
9
  icon?: any;
8
10
  title: string;
9
11
  };
10
- export interface SideNavigationProps extends SideNavigationVariants {
11
- children?: any;
12
+ export interface SideNavigationProps extends HTMLAttributes<HTMLElement>, SideNavigationVariants {
13
+ children?: Snippet;
12
14
  class?: string;
13
15
  sideNavHref?: string;
14
16
  language?: string;
15
17
  items?: SideNavigationItem[];
16
- bottomChildren?: any;
18
+ bottomChildren?: Snippet;
19
+ ref?: HTMLElement | null;
17
20
  }
18
21
  export declare const SCREEN_BREAK_POINTS: {
19
22
  sm: number;
@@ -1,4 +1,4 @@
1
1
  export { default as SideNavigation } from './SideNavigation.svelte';
2
2
  export { default as SideNavigationLayout } from './SideNavigationLayout.svelte';
3
3
  export { toggleSideNavigation } from './SideNavigation';
4
- export type { SideNavigationItem } from "./SideNavigation";
4
+ export type { SideNavigationItem, SideNavigationProps } from "./SideNavigation";