@websline/system-components 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/dist/components/atoms/{form → actions}/button/Button.svelte +33 -11
  2. package/dist/components/atoms/{form → actions}/button/Button.svelte.d.ts +28 -4
  3. package/dist/components/atoms/actions/button/button.variants.d.ts +151 -0
  4. package/dist/components/atoms/actions/button/button.variants.js +143 -0
  5. package/dist/components/atoms/{closeButton → actions/closeButton}/CloseButton.svelte +8 -7
  6. package/dist/components/atoms/actions/closeButton/CloseButton.svelte.d.ts +49 -0
  7. package/dist/components/atoms/avatar/Avatar.svelte +4 -4
  8. package/dist/components/atoms/badge/Badge.svelte +44 -0
  9. package/dist/components/atoms/badge/Badge.svelte.d.ts +65 -0
  10. package/dist/components/atoms/badge/badge.variants.d.ts +85 -0
  11. package/dist/components/atoms/badge/badge.variants.js +59 -0
  12. package/dist/components/atoms/chip/Chip.svelte +52 -0
  13. package/dist/components/atoms/chip/Chip.svelte.d.ts +81 -0
  14. package/dist/components/atoms/chip/chip.variants.d.ts +61 -0
  15. package/dist/components/atoms/chip/chip.variants.js +118 -0
  16. package/dist/components/atoms/colorChip/ColorChip.svelte +33 -0
  17. package/dist/components/atoms/colorChip/ColorChip.svelte.d.ts +57 -0
  18. package/dist/components/atoms/colorChip/colorChip.variants.d.ts +40 -0
  19. package/dist/components/atoms/colorChip/colorChip.variants.js +27 -0
  20. package/dist/components/atoms/{loading → feedback}/spinner/Spinner.svelte +2 -16
  21. package/dist/components/atoms/feedback/spinner/spinner.variants.d.ts +19 -0
  22. package/dist/components/atoms/feedback/spinner/spinner.variants.js +17 -0
  23. package/dist/components/atoms/form/formField/FormField.svelte +2 -10
  24. package/dist/components/atoms/form/formField/FormField.svelte.d.ts +8 -0
  25. package/dist/components/atoms/form/formField/formField.variants.d.ts +13 -0
  26. package/dist/components/atoms/form/formField/formField.variants.js +12 -0
  27. package/dist/components/atoms/form/helperText/HelperText.svelte +9 -10
  28. package/dist/components/atoms/form/helperText/HelperText.svelte.d.ts +22 -4
  29. package/dist/components/atoms/form/helperText/helperText.variants.d.ts +13 -0
  30. package/dist/components/atoms/form/helperText/helperText.variants.js +12 -0
  31. package/dist/components/atoms/form/label/Label.svelte +6 -14
  32. package/dist/components/atoms/form/label/Label.svelte.d.ts +8 -0
  33. package/dist/components/atoms/form/label/label.variants.d.ts +22 -0
  34. package/dist/components/atoms/form/label/label.variants.js +15 -0
  35. package/dist/components/atoms/form/radio/Radio.svelte +58 -0
  36. package/dist/components/atoms/form/radio/Radio.svelte.d.ts +65 -0
  37. package/dist/components/atoms/form/radio/radio.variants.d.ts +22 -0
  38. package/dist/components/atoms/form/radio/radio.variants.js +15 -0
  39. package/dist/components/atoms/form/select/Select.svelte +91 -0
  40. package/dist/components/atoms/form/select/Select.svelte.d.ts +81 -0
  41. package/dist/components/atoms/form/select/select.variants.d.ts +58 -0
  42. package/dist/components/atoms/form/select/select.variants.js +66 -0
  43. package/dist/components/atoms/form/switch/Switch.svelte +57 -0
  44. package/dist/components/atoms/form/switch/Switch.svelte.d.ts +65 -0
  45. package/dist/components/atoms/form/switch/switch.variants.d.ts +22 -0
  46. package/dist/components/atoms/form/switch/switch.variants.js +15 -0
  47. package/dist/components/atoms/icon/Icon.svelte +8 -1
  48. package/dist/components/atoms/icon/components/Add.svelte +27 -0
  49. package/dist/components/atoms/icon/components/Add.svelte.d.ts +41 -0
  50. package/dist/components/atoms/icon/components/Check.svelte +27 -0
  51. package/dist/components/atoms/icon/components/Check.svelte.d.ts +41 -0
  52. package/dist/components/atoms/icon/components/ChevronDown.svelte +27 -0
  53. package/dist/components/atoms/icon/components/ChevronDown.svelte.d.ts +41 -0
  54. package/dist/components/atoms/icon/components/CloseSmall.svelte +27 -0
  55. package/dist/components/atoms/icon/components/CloseSmall.svelte.d.ts +41 -0
  56. package/dist/components/atoms/icon/components/Page.svelte +27 -0
  57. package/dist/components/atoms/icon/components/Page.svelte.d.ts +41 -0
  58. package/dist/components/atoms/icon/components/Redo.svelte +27 -0
  59. package/dist/components/atoms/icon/components/Redo.svelte.d.ts +41 -0
  60. package/dist/components/atoms/icon/components/Undo.svelte +27 -0
  61. package/dist/components/atoms/icon/components/Undo.svelte.d.ts +41 -0
  62. package/dist/components/atoms/icon/index.d.ts +14 -0
  63. package/dist/components/atoms/icon/index.js +14 -0
  64. package/dist/components/molecules/navigationItem/NavigationItem.svelte +80 -0
  65. package/dist/components/molecules/navigationItem/NavigationItem.svelte.d.ts +81 -0
  66. package/dist/components/molecules/navigationItem/navigationItem.variants.d.ts +61 -0
  67. package/dist/components/molecules/navigationItem/navigationItem.variants.js +29 -0
  68. package/dist/components/molecules/notification/Notification.svelte +1 -1
  69. package/dist/components/molecules/pickers/colorSwatch/ColorSwatch.svelte +99 -0
  70. package/dist/components/molecules/pickers/colorSwatch/ColorSwatch.svelte.d.ts +57 -0
  71. package/dist/components/molecules/pickers/colorSwatch/ColorSwatchColor.svelte +13 -0
  72. package/dist/components/molecules/pickers/colorSwatch/ColorSwatchColor.svelte.d.ts +11 -0
  73. package/dist/components/molecules/pickers/colorSwatch/colorSwatch.variants.d.ts +49 -0
  74. package/dist/components/molecules/pickers/colorSwatch/colorSwatch.variants.js +46 -0
  75. package/dist/components/molecules/pickers/colorSwatch/index.d.ts +3 -0
  76. package/dist/components/molecules/pickers/colorSwatch/index.js +4 -0
  77. package/dist/components/molecules/richTextEditor/RichTextEditor.svelte +50 -21
  78. package/dist/components/molecules/richTextEditor/RichTextEditor.svelte.d.ts +56 -0
  79. package/dist/components/molecules/richTextEditor/richTextEditor.variants.js +25 -3
  80. package/dist/components/molecules/richTextEditor/toolbar/RichTextEditorToolbar.svelte +49 -0
  81. package/dist/components/molecules/richTextEditor/{RichTextEditorToolbar.svelte.d.ts → toolbar/RichTextEditorToolbar.svelte.d.ts} +2 -0
  82. package/dist/components/molecules/richTextEditor/toolbar/ToolbarBold.svelte +13 -0
  83. package/dist/components/molecules/richTextEditor/toolbar/ToolbarBold.svelte.d.ts +11 -0
  84. package/dist/components/molecules/richTextEditor/toolbar/ToolbarColor.svelte +27 -0
  85. package/dist/components/molecules/richTextEditor/toolbar/ToolbarColor.svelte.d.ts +15 -0
  86. package/dist/components/molecules/richTextEditor/toolbar/ToolbarItalic.svelte +13 -0
  87. package/dist/components/molecules/richTextEditor/toolbar/ToolbarItalic.svelte.d.ts +11 -0
  88. package/dist/components/molecules/richTextEditor/toolbar/ToolbarLink.svelte +34 -0
  89. package/dist/components/molecules/richTextEditor/toolbar/ToolbarLink.svelte.d.ts +13 -0
  90. package/dist/components/molecules/richTextEditor/toolbar/ToolbarList.svelte +13 -0
  91. package/dist/components/molecules/richTextEditor/toolbar/ToolbarList.svelte.d.ts +11 -0
  92. package/dist/components/molecules/richTextEditor/toolbar/ToolbarListOrdered.svelte +13 -0
  93. package/dist/components/molecules/richTextEditor/toolbar/ToolbarListOrdered.svelte.d.ts +11 -0
  94. package/dist/components/molecules/richTextEditor/toolbar/ToolbarRedo.svelte +13 -0
  95. package/dist/components/molecules/richTextEditor/toolbar/ToolbarRedo.svelte.d.ts +11 -0
  96. package/dist/components/molecules/richTextEditor/toolbar/ToolbarUnderline.svelte +13 -0
  97. package/dist/components/molecules/richTextEditor/toolbar/ToolbarUnderline.svelte.d.ts +11 -0
  98. package/dist/components/molecules/richTextEditor/toolbar/ToolbarUndo.svelte +13 -0
  99. package/dist/components/molecules/richTextEditor/toolbar/ToolbarUndo.svelte.d.ts +11 -0
  100. package/dist/components/molecules/selectorCard/SelectorCard.svelte +78 -0
  101. package/dist/components/molecules/selectorCard/SelectorCard.svelte.d.ts +105 -0
  102. package/dist/components/molecules/selectorCard/selectorCard.variants.d.ts +61 -0
  103. package/dist/components/molecules/selectorCard/selectorCard.variants.js +32 -0
  104. package/dist/components/molecules/toggleGroup/ToggleGroup.svelte +1 -0
  105. package/dist/components/molecules/toggleGroup/ToggleGroup.svelte.d.ts +8 -0
  106. package/dist/components/molecules/toggleGroup/ToggleGroupItem.svelte +1 -0
  107. package/dist/components/molecules/toggleGroup/ToggleGroupItem.svelte.d.ts +8 -0
  108. package/dist/components/organisms/notificationGroup/NotificationGroup.svelte +1 -1
  109. package/dist/components/organisms/popover/Popover.svelte +15 -0
  110. package/dist/components/organisms/popover/Popover.svelte.d.ts +18 -0
  111. package/dist/components/organisms/popover/PopoverContent.svelte +84 -0
  112. package/dist/components/organisms/popover/PopoverContent.svelte.d.ts +89 -0
  113. package/dist/components/organisms/popover/PopoverTrigger.svelte +14 -0
  114. package/dist/components/{atoms/closeButton/CloseButton.svelte.d.ts → organisms/popover/PopoverTrigger.svelte.d.ts} +3 -11
  115. package/dist/components/organisms/popover/index.d.ts +4 -0
  116. package/dist/components/organisms/popover/index.js +5 -0
  117. package/dist/components/organisms/popover/popover.variants.d.ts +39 -0
  118. package/dist/components/organisms/popover/popover.variants.js +15 -0
  119. package/dist/index.d.ts +14 -4
  120. package/dist/index.js +14 -4
  121. package/dist/utils/colors.d.ts +9 -0
  122. package/dist/utils/colors.js +119 -0
  123. package/dist/utils/index.d.ts +2 -0
  124. package/dist/utils/index.js +2 -0
  125. package/dist/utils/theme.svelte.d.ts +10 -0
  126. package/dist/utils/theme.svelte.js +31 -0
  127. package/package.json +30 -31
  128. package/dist/components/atoms/form/button/button.variants.d.ts +0 -58
  129. package/dist/components/atoms/form/button/button.variants.js +0 -82
  130. package/dist/components/molecules/richTextEditor/RichTextEditorToolbar.svelte +0 -5
  131. package/dist/components/atoms/{closeButton → actions/closeButton}/closeButton.variants.d.ts +0 -0
  132. package/dist/components/atoms/{closeButton → actions/closeButton}/closeButton.variants.js +0 -0
  133. package/dist/components/atoms/{form → actions}/iconButton/IconButton.svelte +0 -0
  134. package/dist/components/atoms/{form → actions}/iconButton/IconButton.svelte.d.ts +0 -0
  135. package/dist/components/atoms/{form → actions}/iconButton/iconButton.variants.d.ts +0 -0
  136. package/dist/components/atoms/{form → actions}/iconButton/iconButton.variants.js +0 -0
  137. package/dist/components/atoms/{loading → feedback}/spinner/Spinner.svelte.d.ts +6 -6
@@ -0,0 +1,85 @@
1
+ export const badgeVariants: import("tailwind-variants").TVReturnType<{
2
+ color: {
3
+ primary: string;
4
+ secondary: string;
5
+ error: string;
6
+ };
7
+ anchor: {
8
+ top: {
9
+ base: string;
10
+ };
11
+ center: {
12
+ base: string;
13
+ };
14
+ bottom: {
15
+ base: string;
16
+ };
17
+ inline: {
18
+ wrapper: string;
19
+ base: string;
20
+ };
21
+ };
22
+ count: {
23
+ true: string;
24
+ false: string;
25
+ };
26
+ }, {
27
+ base: string;
28
+ wrapper: string;
29
+ }, undefined, {
30
+ color: {
31
+ primary: string;
32
+ secondary: string;
33
+ error: string;
34
+ };
35
+ anchor: {
36
+ top: {
37
+ base: string;
38
+ };
39
+ center: {
40
+ base: string;
41
+ };
42
+ bottom: {
43
+ base: string;
44
+ };
45
+ inline: {
46
+ wrapper: string;
47
+ base: string;
48
+ };
49
+ };
50
+ count: {
51
+ true: string;
52
+ false: string;
53
+ };
54
+ }, {
55
+ base: string;
56
+ wrapper: string;
57
+ }, import("tailwind-variants").TVReturnType<{
58
+ color: {
59
+ primary: string;
60
+ secondary: string;
61
+ error: string;
62
+ };
63
+ anchor: {
64
+ top: {
65
+ base: string;
66
+ };
67
+ center: {
68
+ base: string;
69
+ };
70
+ bottom: {
71
+ base: string;
72
+ };
73
+ inline: {
74
+ wrapper: string;
75
+ base: string;
76
+ };
77
+ };
78
+ count: {
79
+ true: string;
80
+ false: string;
81
+ };
82
+ }, {
83
+ base: string;
84
+ wrapper: string;
85
+ }, undefined, unknown, unknown, undefined>>;
@@ -0,0 +1,59 @@
1
+ import { tv } from "tailwind-variants";
2
+
3
+ const badgeVariants = tv({
4
+ slots: {
5
+ base: "inline-flex absolute items-center justify-center rounded-full select-none body-extra-small",
6
+ wrapper: "inline-flex gap-0.5 relative",
7
+ },
8
+ variants: {
9
+ color: {
10
+ primary: "bg-blue-500 text-neutral-100 dark:bg-blue-400",
11
+ secondary:
12
+ "bg-neutral-900 text-neutral-100 dark:bg-neutral-100 dark:text-neutral-900",
13
+ error: "bg-red-500 text-neutral-100 dark:bg-red-400",
14
+ },
15
+ anchor: {
16
+ top: {
17
+ base: "top-0 -translate-y-1/2",
18
+ },
19
+ center: {
20
+ base: "top-1/2 -translate-y-1/2",
21
+ },
22
+ bottom: {
23
+ base: "bottom-0 translate-y-1/2",
24
+ },
25
+ inline: {
26
+ wrapper: "items-center static",
27
+ base: "static",
28
+ },
29
+ },
30
+ count: {
31
+ true: "px-1.5 py-0.5 size-auto",
32
+ false: "size-3",
33
+ },
34
+ },
35
+ compoundVariants: [
36
+ {
37
+ align: "end",
38
+ anchor: ["top", "center", "bottom"],
39
+ class: "right-0 translate-x-1/2",
40
+ },
41
+ {
42
+ align: "start",
43
+ anchor: ["top", "center", "bottom"],
44
+ class: "left-0 -translate-x-1/2",
45
+ },
46
+ {
47
+ align: "end",
48
+ anchor: "inline",
49
+ class: "order-1",
50
+ },
51
+ {
52
+ align: "start",
53
+ anchor: "inline",
54
+ class: "-order-1",
55
+ },
56
+ ],
57
+ });
58
+
59
+ export { badgeVariants };
@@ -0,0 +1,52 @@
1
+ <script>
2
+ import { chipVariants } from "./chip.variants.js";
3
+ import { Icon } from "../../../index.js";
4
+
5
+ /**
6
+ * @typedef {Object} Props
7
+ * @property {import('svelte').Snippet} [children] Content inside the chip – can be text, HTML, or Svelte components
8
+ * @property {string} [class=""] Additional CSS classes for the chip
9
+ * @property {boolean} [clickable=false] Whether the Chip is clickable (this disables selected state)
10
+ * @property {"default" | "primary" | "error" | "success" | "warning"} [color="default"] Chip color variant
11
+ * @property {string} [icon=""] Name of the icon to display
12
+ * @property {"start" | "end"} [iconPosition="start"] Position of the icon relative to the content
13
+ * @property {boolean} [selected=false] Whether the chip is in a visually selected state
14
+ * @property {"small" | "big"} [size="small"] Size of the chip
15
+ * @property {"filled" | "outline" | "dashed"} [variant="filled"] Visual style of the chip
16
+ */
17
+
18
+ /** @type {Props} */
19
+ let {
20
+ children,
21
+ class: className,
22
+ clickable = false,
23
+ color = "default",
24
+ icon = "",
25
+ iconPosition = "start",
26
+ selected = false,
27
+ size = "small",
28
+ variant = "filled",
29
+ ...rest
30
+ } = $props();
31
+
32
+ let as = $derived(clickable ? "button" : "div");
33
+ </script>
34
+
35
+ <svelte:element
36
+ this={as}
37
+ class={chipVariants({
38
+ color,
39
+ size,
40
+ iconPosition,
41
+ variant,
42
+ selected: clickable && selected,
43
+ class: className,
44
+ })}
45
+ {...rest}>
46
+ {#if icon}
47
+ <Icon name={icon} size={14} />
48
+ {/if}
49
+ <span>
50
+ {@render children?.()}
51
+ </span>
52
+ </svelte:element>
@@ -0,0 +1,81 @@
1
+ export default Chip;
2
+ type Chip = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<Props>): void;
5
+ };
6
+ declare const Chip: import("svelte").Component<{
7
+ /**
8
+ * Content inside the chip – can be text, HTML, or Svelte components
9
+ */
10
+ children?: import("svelte").Snippet;
11
+ /**
12
+ * Additional CSS classes for the chip
13
+ */
14
+ class?: string;
15
+ /**
16
+ * Whether the Chip is clickable (this disables selected state)
17
+ */
18
+ clickable?: boolean;
19
+ /**
20
+ * Chip color variant
21
+ */
22
+ color?: "default" | "primary" | "error" | "success" | "warning";
23
+ /**
24
+ * Name of the icon to display
25
+ */
26
+ icon?: string;
27
+ /**
28
+ * Position of the icon relative to the content
29
+ */
30
+ iconPosition?: "start" | "end";
31
+ /**
32
+ * Whether the chip is in a visually selected state
33
+ */
34
+ selected?: boolean;
35
+ /**
36
+ * Size of the chip
37
+ */
38
+ size?: "small" | "big";
39
+ /**
40
+ * Visual style of the chip
41
+ */
42
+ variant?: "filled" | "outline" | "dashed";
43
+ }, {}, "">;
44
+ type Props = {
45
+ /**
46
+ * Content inside the chip – can be text, HTML, or Svelte components
47
+ */
48
+ children?: import("svelte").Snippet;
49
+ /**
50
+ * Additional CSS classes for the chip
51
+ */
52
+ class?: string;
53
+ /**
54
+ * Whether the Chip is clickable (this disables selected state)
55
+ */
56
+ clickable?: boolean;
57
+ /**
58
+ * Chip color variant
59
+ */
60
+ color?: "default" | "primary" | "error" | "success" | "warning";
61
+ /**
62
+ * Name of the icon to display
63
+ */
64
+ icon?: string;
65
+ /**
66
+ * Position of the icon relative to the content
67
+ */
68
+ iconPosition?: "start" | "end";
69
+ /**
70
+ * Whether the chip is in a visually selected state
71
+ */
72
+ selected?: boolean;
73
+ /**
74
+ * Size of the chip
75
+ */
76
+ size?: "small" | "big";
77
+ /**
78
+ * Visual style of the chip
79
+ */
80
+ variant?: "filled" | "outline" | "dashed";
81
+ };
@@ -0,0 +1,61 @@
1
+ export const chipVariants: import("tailwind-variants").TVReturnType<{
2
+ color: {
3
+ default: string;
4
+ primary: string;
5
+ error: string;
6
+ success: string;
7
+ warning: string;
8
+ };
9
+ size: {
10
+ small: string;
11
+ big: string;
12
+ };
13
+ iconPosition: {
14
+ end: string;
15
+ };
16
+ variant: {
17
+ filled: string;
18
+ outline: string;
19
+ dashed: string;
20
+ };
21
+ }, undefined, "\n inline-flex items-center align-middle rounded select-none relative border gap-1 [button]:cursor-pointer\n focus-visible:ring-1 ring-blue-500 dark:ring-blue-400 ring-offset-1 outline-0 ring-offset-transparent\n ", {
22
+ color: {
23
+ default: string;
24
+ primary: string;
25
+ error: string;
26
+ success: string;
27
+ warning: string;
28
+ };
29
+ size: {
30
+ small: string;
31
+ big: string;
32
+ };
33
+ iconPosition: {
34
+ end: string;
35
+ };
36
+ variant: {
37
+ filled: string;
38
+ outline: string;
39
+ dashed: string;
40
+ };
41
+ }, undefined, import("tailwind-variants").TVReturnType<{
42
+ color: {
43
+ default: string;
44
+ primary: string;
45
+ error: string;
46
+ success: string;
47
+ warning: string;
48
+ };
49
+ size: {
50
+ small: string;
51
+ big: string;
52
+ };
53
+ iconPosition: {
54
+ end: string;
55
+ };
56
+ variant: {
57
+ filled: string;
58
+ outline: string;
59
+ dashed: string;
60
+ };
61
+ }, undefined, "\n inline-flex items-center align-middle rounded select-none relative border gap-1 [button]:cursor-pointer\n focus-visible:ring-1 ring-blue-500 dark:ring-blue-400 ring-offset-1 outline-0 ring-offset-transparent\n ", unknown, unknown, undefined>>;
@@ -0,0 +1,118 @@
1
+ import { tv } from "tailwind-variants";
2
+
3
+ const chipVariants = tv({
4
+ base: `
5
+ inline-flex items-center align-middle rounded select-none relative border gap-1 [button]:cursor-pointer
6
+ focus-visible:ring-1 ring-blue-500 dark:ring-blue-400 ring-offset-1 outline-0 ring-offset-transparent
7
+ `,
8
+ variants: {
9
+ color: {
10
+ default:
11
+ "bg-neutral-200 text-neutral-900 dark:bg-neutral-700 dark:text-neutral-200",
12
+ primary: "bg-blue-500 text-neutral-100 dark:bg-blue-400",
13
+ error: "bg-red-500 text-neutral-100",
14
+ success: "bg-green-500 text-neutral-100",
15
+ warning: "bg-yellow-500 text-neutral-900",
16
+ },
17
+ size: {
18
+ small: "body-extra-small py-0.5 px-2 min-h-[20px]",
19
+ big: "body-small py-1.5 px-3 min-h-[28px]",
20
+ },
21
+ iconPosition: {
22
+ end: "flex-row-reverse",
23
+ },
24
+ variant: {
25
+ filled: "border-transparent",
26
+ outline: "bg-transparent dark:bg-transparent",
27
+ dashed: "bg-transparent border-dashed dark:bg-transparent",
28
+ },
29
+ },
30
+ compoundVariants: [
31
+ // Outline || Dashed
32
+ {
33
+ color: "default",
34
+ variant: ["outline", "dashed"],
35
+ class: "border-gray-300 dark:border-gray-700",
36
+ },
37
+ {
38
+ color: "primary",
39
+ variant: ["outline", "dashed"],
40
+ class:
41
+ "text-blue-500 border-blue-500 dark:text-neutral-100 dark:border-blue-400",
42
+ },
43
+ {
44
+ color: "error",
45
+ variant: ["outline", "dashed"],
46
+ class: "text-red-500",
47
+ },
48
+ {
49
+ color: "success",
50
+ variant: ["outline", "dashed"],
51
+ class: "text-green-500",
52
+ },
53
+ {
54
+ color: "warning",
55
+ variant: ["outline", "dashed"],
56
+ class: "text-neutral-900 border-yellow-500 dark:text-yellow-600",
57
+ },
58
+ // Selected
59
+ {
60
+ selected: true,
61
+ color: "default",
62
+ class: "bg-neutral-900 text-neutral-100 dark:bg-blue-400",
63
+ },
64
+ {
65
+ selected: true,
66
+ color: "primary",
67
+ class: "bg-blue-600 dark:bg-blue-500",
68
+ },
69
+ {
70
+ selected: true,
71
+ color: "error",
72
+ class: "bg-red-700 ",
73
+ },
74
+ {
75
+ selected: true,
76
+ color: "success",
77
+ class: "bg-green-700 ",
78
+ },
79
+ {
80
+ selected: true,
81
+ color: "warning",
82
+ class: "bg-yellow-600",
83
+ },
84
+ // Selected & Outline || Dashed
85
+ {
86
+ selected: true,
87
+ variant: ["outline", "dashed"],
88
+ color: "default",
89
+ class: "border-neutral-900 dark:border-blue-400",
90
+ },
91
+ {
92
+ selected: true,
93
+ variant: ["outline", "dashed"],
94
+ color: "primary",
95
+ class: "text-neutral-100 bg-blue-600 border-blue-600 dark:border-blue-500",
96
+ },
97
+ {
98
+ selected: true,
99
+ variant: ["outline", "dashed"],
100
+ color: "error",
101
+ class: "text-neutral-100 border-red-700 dark:bg-red-700",
102
+ },
103
+ {
104
+ selected: true,
105
+ variant: ["outline", "dashed"],
106
+ color: "success",
107
+ class: "text-neutral-100 border-green-700 dark:bg-green-700",
108
+ },
109
+ {
110
+ selected: true,
111
+ variant: ["outline", "dashed"],
112
+ color: "warning",
113
+ class: "border-yellow-600 dark:bg-yellow-600 dark:text-neutral-900",
114
+ },
115
+ ],
116
+ });
117
+
118
+ export { chipVariants };
@@ -0,0 +1,33 @@
1
+ <script>
2
+ import { colorChipVariants } from "./colorChip.variants.js";
3
+
4
+ /**
5
+ * @typedef {Object} Props
6
+ * @property {string} [borderColor=""] Border color value (hex, rgb, etc.)
7
+ * @property {string} [class=""] Additional CSS classes to apply to the component
8
+ * @property {boolean} [clickable=false] Whether the ColorChip is clickable
9
+ * @property {string} [color=""] Color value (hex, rgb, etc.)
10
+ * @property {"circle" | "square"} [shape="round"] ColorChip shape
11
+ * @property {"small" | "medium" | "large"} [size="medium"] ColorChip size
12
+ */
13
+
14
+ /** @type {Props} */
15
+ let {
16
+ borderColor = "",
17
+ class: className = "",
18
+ clickable = false,
19
+ color = "",
20
+ shape = "square",
21
+ size = "medium",
22
+ ...args
23
+ } = $props();
24
+
25
+ let as = $derived(clickable ? "button" : "div");
26
+ </script>
27
+
28
+ <svelte:element
29
+ this={as}
30
+ class={colorChipVariants({ class: className, clickable, shape, size })}
31
+ style="background-color: {color}; border-color: {borderColor};"
32
+ {...args}>
33
+ </svelte:element>
@@ -0,0 +1,57 @@
1
+ export default ColorChip;
2
+ type ColorChip = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<Props>): void;
5
+ };
6
+ declare const ColorChip: import("svelte").Component<{
7
+ /**
8
+ * Border color value (hex, rgb, etc.)
9
+ */
10
+ borderColor?: string;
11
+ /**
12
+ * Additional CSS classes to apply to the component
13
+ */
14
+ class?: string;
15
+ /**
16
+ * Whether the ColorChip is clickable
17
+ */
18
+ clickable?: boolean;
19
+ /**
20
+ * Color value (hex, rgb, etc.)
21
+ */
22
+ color?: string;
23
+ /**
24
+ * ColorChip shape
25
+ */
26
+ shape?: "circle" | "square";
27
+ /**
28
+ * ColorChip size
29
+ */
30
+ size?: "small" | "medium" | "large";
31
+ }, {}, "">;
32
+ type Props = {
33
+ /**
34
+ * Border color value (hex, rgb, etc.)
35
+ */
36
+ borderColor?: string;
37
+ /**
38
+ * Additional CSS classes to apply to the component
39
+ */
40
+ class?: string;
41
+ /**
42
+ * Whether the ColorChip is clickable
43
+ */
44
+ clickable?: boolean;
45
+ /**
46
+ * Color value (hex, rgb, etc.)
47
+ */
48
+ color?: string;
49
+ /**
50
+ * ColorChip shape
51
+ */
52
+ shape?: "circle" | "square";
53
+ /**
54
+ * ColorChip size
55
+ */
56
+ size?: "small" | "medium" | "large";
57
+ };
@@ -0,0 +1,40 @@
1
+ export const colorChipVariants: import("tailwind-variants").TVReturnType<{
2
+ clickable: {
3
+ true: string;
4
+ };
5
+ shape: {
6
+ circle: string;
7
+ square: string;
8
+ };
9
+ size: {
10
+ small: string;
11
+ medium: string;
12
+ large: string;
13
+ };
14
+ }, undefined, "border border-transparent", {
15
+ clickable: {
16
+ true: string;
17
+ };
18
+ shape: {
19
+ circle: string;
20
+ square: string;
21
+ };
22
+ size: {
23
+ small: string;
24
+ medium: string;
25
+ large: string;
26
+ };
27
+ }, undefined, import("tailwind-variants").TVReturnType<{
28
+ clickable: {
29
+ true: string;
30
+ };
31
+ shape: {
32
+ circle: string;
33
+ square: string;
34
+ };
35
+ size: {
36
+ small: string;
37
+ medium: string;
38
+ large: string;
39
+ };
40
+ }, undefined, "border border-transparent", unknown, unknown, undefined>>;
@@ -0,0 +1,27 @@
1
+ import { tv } from "tailwind-variants";
2
+
3
+ const colorChipVariants = tv({
4
+ base: "border border-transparent",
5
+ variants: {
6
+ clickable: {
7
+ true: `cursor-pointer
8
+ hover:brightness-90 focus:outline-none
9
+ active:brightness-75
10
+ transition duration-150 ease-in-out
11
+ hover:ring-2 focus:ring-2
12
+ hover:ring-offset-1 focus:ring-offset-1
13
+ hover:ring-blue-500 focus:ring-blue-500`,
14
+ },
15
+ shape: {
16
+ circle: "rounded-full",
17
+ square: "rounded-sm",
18
+ },
19
+ size: {
20
+ small: "h-4 w-4",
21
+ medium: "h-6 w-6",
22
+ large: "h-8 w-8",
23
+ },
24
+ },
25
+ });
26
+
27
+ export { colorChipVariants };
@@ -1,28 +1,14 @@
1
1
  <script>
2
- import { tv } from "tailwind-variants";
2
+ import { spinnerVariants } from "./spinner.variants.js";
3
3
 
4
4
  /**
5
5
  * @typedef {Object} Props
6
- * @property {"small" | "medium" | "large"} [size="medium"] Spinner size
7
6
  * @property {string} [class=""] Additional CSS classes to apply to the component
7
+ * @property {"small" | "medium" | "large"} [size="medium"] Spinner size
8
8
  */
9
9
 
10
10
  /** @type {Props} */
11
11
  let { class: className = "", size = "medium" } = $props();
12
-
13
- const spinnerVariants = tv({
14
- base: "inline-flex animate-[spin_0.7s_linear_infinite]",
15
- variants: {
16
- size: {
17
- small: "h-4 w-4",
18
- medium: "h-6 w-6",
19
- large: "h-8 w-8",
20
- },
21
- },
22
- defaultVariants: {
23
- size: "medium",
24
- },
25
- });
26
12
  </script>
27
13
 
28
14
  <svg
@@ -0,0 +1,19 @@
1
+ export const spinnerVariants: import("tailwind-variants").TVReturnType<{
2
+ size: {
3
+ small: string;
4
+ medium: string;
5
+ large: string;
6
+ };
7
+ }, undefined, "inline-flex animate-[spin_0.7s_linear_infinite]", {
8
+ size: {
9
+ small: string;
10
+ medium: string;
11
+ large: string;
12
+ };
13
+ }, undefined, import("tailwind-variants").TVReturnType<{
14
+ size: {
15
+ small: string;
16
+ medium: string;
17
+ large: string;
18
+ };
19
+ }, undefined, "inline-flex animate-[spin_0.7s_linear_infinite]", unknown, unknown, undefined>>;
@@ -0,0 +1,17 @@
1
+ import { tv } from "tailwind-variants";
2
+
3
+ const spinnerVariants = tv({
4
+ base: "inline-flex animate-[spin_0.7s_linear_infinite]",
5
+ variants: {
6
+ size: {
7
+ small: "h-4 w-4",
8
+ medium: "h-6 w-6",
9
+ large: "h-8 w-8",
10
+ },
11
+ },
12
+ defaultVariants: {
13
+ size: "medium",
14
+ },
15
+ });
16
+
17
+ export { spinnerVariants };