@websline/system-components 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/atoms/{form → actions}/button/Button.svelte +33 -11
- package/dist/components/atoms/{form → actions}/button/Button.svelte.d.ts +28 -4
- package/dist/components/atoms/actions/button/button.variants.d.ts +151 -0
- package/dist/components/atoms/actions/button/button.variants.js +143 -0
- package/dist/components/atoms/{closeButton → actions/closeButton}/CloseButton.svelte +8 -7
- package/dist/components/atoms/actions/closeButton/CloseButton.svelte.d.ts +49 -0
- package/dist/components/atoms/avatar/Avatar.svelte +4 -4
- package/dist/components/atoms/badge/Badge.svelte +44 -0
- package/dist/components/atoms/badge/Badge.svelte.d.ts +65 -0
- package/dist/components/atoms/badge/badge.variants.d.ts +85 -0
- package/dist/components/atoms/badge/badge.variants.js +59 -0
- package/dist/components/atoms/chip/Chip.svelte +52 -0
- package/dist/components/atoms/chip/Chip.svelte.d.ts +81 -0
- package/dist/components/atoms/chip/chip.variants.d.ts +61 -0
- package/dist/components/atoms/chip/chip.variants.js +118 -0
- package/dist/components/atoms/colorChip/ColorChip.svelte +33 -0
- package/dist/components/atoms/colorChip/ColorChip.svelte.d.ts +57 -0
- package/dist/components/atoms/colorChip/colorChip.variants.d.ts +40 -0
- package/dist/components/atoms/colorChip/colorChip.variants.js +27 -0
- package/dist/components/atoms/{loading → feedback}/spinner/Spinner.svelte +2 -16
- package/dist/components/atoms/feedback/spinner/spinner.variants.d.ts +19 -0
- package/dist/components/atoms/feedback/spinner/spinner.variants.js +17 -0
- package/dist/components/atoms/form/formField/FormField.svelte +2 -10
- package/dist/components/atoms/form/formField/FormField.svelte.d.ts +8 -0
- package/dist/components/atoms/form/formField/formField.variants.d.ts +13 -0
- package/dist/components/atoms/form/formField/formField.variants.js +12 -0
- package/dist/components/atoms/form/helperText/HelperText.svelte +9 -10
- package/dist/components/atoms/form/helperText/HelperText.svelte.d.ts +22 -4
- package/dist/components/atoms/form/helperText/helperText.variants.d.ts +13 -0
- package/dist/components/atoms/form/helperText/helperText.variants.js +12 -0
- package/dist/components/atoms/form/label/Label.svelte +6 -14
- package/dist/components/atoms/form/label/Label.svelte.d.ts +8 -0
- package/dist/components/atoms/form/label/label.variants.d.ts +22 -0
- package/dist/components/atoms/form/label/label.variants.js +15 -0
- package/dist/components/atoms/form/radio/Radio.svelte +58 -0
- package/dist/components/atoms/form/radio/Radio.svelte.d.ts +65 -0
- package/dist/components/atoms/form/radio/radio.variants.d.ts +22 -0
- package/dist/components/atoms/form/radio/radio.variants.js +15 -0
- package/dist/components/atoms/form/select/Select.svelte +91 -0
- package/dist/components/atoms/form/select/Select.svelte.d.ts +81 -0
- package/dist/components/atoms/form/select/select.variants.d.ts +58 -0
- package/dist/components/atoms/form/select/select.variants.js +66 -0
- package/dist/components/atoms/form/switch/Switch.svelte +57 -0
- package/dist/components/atoms/form/switch/Switch.svelte.d.ts +65 -0
- package/dist/components/atoms/form/switch/switch.variants.d.ts +22 -0
- package/dist/components/atoms/form/switch/switch.variants.js +15 -0
- package/dist/components/atoms/icon/Icon.svelte +8 -1
- package/dist/components/atoms/icon/components/Add.svelte +27 -0
- package/dist/components/atoms/icon/components/Add.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Check.svelte +27 -0
- package/dist/components/atoms/icon/components/Check.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/ChevronDown.svelte +27 -0
- package/dist/components/atoms/icon/components/ChevronDown.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/CloseSmall.svelte +27 -0
- package/dist/components/atoms/icon/components/CloseSmall.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Page.svelte +27 -0
- package/dist/components/atoms/icon/components/Page.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Redo.svelte +27 -0
- package/dist/components/atoms/icon/components/Redo.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Undo.svelte +27 -0
- package/dist/components/atoms/icon/components/Undo.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/index.d.ts +14 -0
- package/dist/components/atoms/icon/index.js +14 -0
- package/dist/components/molecules/navigationItem/NavigationItem.svelte +80 -0
- package/dist/components/molecules/navigationItem/NavigationItem.svelte.d.ts +81 -0
- package/dist/components/molecules/navigationItem/navigationItem.variants.d.ts +61 -0
- package/dist/components/molecules/navigationItem/navigationItem.variants.js +29 -0
- package/dist/components/molecules/notification/Notification.svelte +1 -1
- package/dist/components/molecules/pickers/colorSwatch/ColorSwatch.svelte +99 -0
- package/dist/components/molecules/pickers/colorSwatch/ColorSwatch.svelte.d.ts +57 -0
- package/dist/components/molecules/pickers/colorSwatch/ColorSwatchColor.svelte +13 -0
- package/dist/components/molecules/pickers/colorSwatch/ColorSwatchColor.svelte.d.ts +11 -0
- package/dist/components/molecules/pickers/colorSwatch/colorSwatch.variants.d.ts +49 -0
- package/dist/components/molecules/pickers/colorSwatch/colorSwatch.variants.js +46 -0
- package/dist/components/molecules/pickers/colorSwatch/index.d.ts +3 -0
- package/dist/components/molecules/pickers/colorSwatch/index.js +4 -0
- package/dist/components/molecules/richTextEditor/RichTextEditor.svelte +50 -21
- package/dist/components/molecules/richTextEditor/RichTextEditor.svelte.d.ts +56 -0
- package/dist/components/molecules/richTextEditor/richTextEditor.variants.js +25 -3
- package/dist/components/molecules/richTextEditor/toolbar/RichTextEditorToolbar.svelte +49 -0
- package/dist/components/molecules/richTextEditor/{RichTextEditorToolbar.svelte.d.ts → toolbar/RichTextEditorToolbar.svelte.d.ts} +2 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarBold.svelte +13 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarBold.svelte.d.ts +11 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarColor.svelte +27 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarColor.svelte.d.ts +15 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarItalic.svelte +13 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarItalic.svelte.d.ts +11 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarLink.svelte +34 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarLink.svelte.d.ts +13 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarList.svelte +13 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarList.svelte.d.ts +11 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarListOrdered.svelte +13 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarListOrdered.svelte.d.ts +11 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarRedo.svelte +13 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarRedo.svelte.d.ts +11 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarUnderline.svelte +13 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarUnderline.svelte.d.ts +11 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarUndo.svelte +13 -0
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarUndo.svelte.d.ts +11 -0
- package/dist/components/molecules/selectorCard/SelectorCard.svelte +78 -0
- package/dist/components/molecules/selectorCard/SelectorCard.svelte.d.ts +105 -0
- package/dist/components/molecules/selectorCard/selectorCard.variants.d.ts +61 -0
- package/dist/components/molecules/selectorCard/selectorCard.variants.js +32 -0
- package/dist/components/molecules/toggleGroup/ToggleGroup.svelte +1 -0
- package/dist/components/molecules/toggleGroup/ToggleGroup.svelte.d.ts +8 -0
- package/dist/components/molecules/toggleGroup/ToggleGroupItem.svelte +1 -0
- package/dist/components/molecules/toggleGroup/ToggleGroupItem.svelte.d.ts +8 -0
- package/dist/components/organisms/notificationGroup/NotificationGroup.svelte +1 -1
- package/dist/components/organisms/popover/Popover.svelte +15 -0
- package/dist/components/organisms/popover/Popover.svelte.d.ts +18 -0
- package/dist/components/organisms/popover/PopoverContent.svelte +84 -0
- package/dist/components/organisms/popover/PopoverContent.svelte.d.ts +89 -0
- package/dist/components/organisms/popover/PopoverTrigger.svelte +14 -0
- package/dist/components/{atoms/closeButton/CloseButton.svelte.d.ts → organisms/popover/PopoverTrigger.svelte.d.ts} +3 -11
- package/dist/components/organisms/popover/index.d.ts +4 -0
- package/dist/components/organisms/popover/index.js +5 -0
- package/dist/components/organisms/popover/popover.variants.d.ts +39 -0
- package/dist/components/organisms/popover/popover.variants.js +15 -0
- package/dist/index.d.ts +14 -4
- package/dist/index.js +14 -4
- package/dist/utils/colors.d.ts +9 -0
- package/dist/utils/colors.js +119 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/theme.svelte.d.ts +10 -0
- package/dist/utils/theme.svelte.js +31 -0
- package/package.json +38 -39
- package/dist/components/atoms/form/button/button.variants.d.ts +0 -58
- package/dist/components/atoms/form/button/button.variants.js +0 -82
- package/dist/components/molecules/richTextEditor/RichTextEditorToolbar.svelte +0 -5
- package/dist/components/atoms/{closeButton → actions/closeButton}/closeButton.variants.d.ts +0 -0
- package/dist/components/atoms/{closeButton → actions/closeButton}/closeButton.variants.js +0 -0
- package/dist/components/atoms/{form → actions}/iconButton/IconButton.svelte +0 -0
- package/dist/components/atoms/{form → actions}/iconButton/IconButton.svelte.d.ts +0 -0
- package/dist/components/atoms/{form → actions}/iconButton/iconButton.variants.d.ts +0 -0
- package/dist/components/atoms/{form → actions}/iconButton/iconButton.variants.js +0 -0
- package/dist/components/atoms/{loading → feedback}/spinner/Spinner.svelte.d.ts +6 -6
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function hexToRgb(hex: any): number[];
|
|
2
|
+
export function rgbToHex(r: any, g: any, b: any): string;
|
|
3
|
+
export function parseColor(input: any): any;
|
|
4
|
+
export function getLuminance([r, g, b]: [any, any, any]): number;
|
|
5
|
+
export function isLight(color: any): boolean;
|
|
6
|
+
export function isDark(color: any): boolean;
|
|
7
|
+
export function getContrastColor(color: any): "#ffffff" | "#000000";
|
|
8
|
+
export function shadeColor(color: any, percent: any): string;
|
|
9
|
+
export function shouldShowBorder(color: any, background?: string): boolean;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// Example: hexToRgb("#ff0000") -> [255, 0, 0]
|
|
2
|
+
|
|
3
|
+
const hexToRgb = (hex) => {
|
|
4
|
+
hex = hex.replace(/^#/, "");
|
|
5
|
+
if (hex.length === 3) {
|
|
6
|
+
hex = hex
|
|
7
|
+
.split("")
|
|
8
|
+
.map((x) => x + x)
|
|
9
|
+
.join("");
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const num = parseInt(hex, 16);
|
|
13
|
+
|
|
14
|
+
return [num >> 16, (num >> 8) & 255, num & 255];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// Example: rgbToHex(255, 0, 0) -> "#ff0000"
|
|
18
|
+
|
|
19
|
+
const rgbToHex = (r, g, b) => {
|
|
20
|
+
return (
|
|
21
|
+
"#" +
|
|
22
|
+
[r, g, b]
|
|
23
|
+
.map((x) => {
|
|
24
|
+
const hex = x.toString(16);
|
|
25
|
+
return hex.length === 1 ? "0" + hex : hex;
|
|
26
|
+
})
|
|
27
|
+
.join("")
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Example: parseColor("rgb(255,0,0)") -> [255,0,0]
|
|
32
|
+
|
|
33
|
+
const parseColor = (input) => {
|
|
34
|
+
if (input.startsWith("#")) {
|
|
35
|
+
return hexToRgb(input);
|
|
36
|
+
} else if (input.startsWith("rgb")) {
|
|
37
|
+
const nums = input.match(/[\d.]+/g).map(Number);
|
|
38
|
+
return nums.slice(0, 3);
|
|
39
|
+
} else {
|
|
40
|
+
throw new Error("Unsupported color format: " + input);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// Example: getLuminance([255,0,0]) -> 0.2126
|
|
45
|
+
|
|
46
|
+
const getLuminance = ([r, g, b]) => {
|
|
47
|
+
const a = [r, g, b].map((v) => {
|
|
48
|
+
v /= 255;
|
|
49
|
+
return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Example: isLight("#ffffff") -> true
|
|
56
|
+
|
|
57
|
+
const isLight = (color) => {
|
|
58
|
+
const rgb = parseColor(color);
|
|
59
|
+
|
|
60
|
+
return getLuminance(rgb) > 0.5;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Example: isDark("#000000") -> true
|
|
64
|
+
|
|
65
|
+
const isDark = (color) => {
|
|
66
|
+
return !isLight(color);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// Example: getContrastColor("#ff0000") -> "#ffffff"
|
|
70
|
+
|
|
71
|
+
const getContrastColor = (color) => {
|
|
72
|
+
const rgb = parseColor(color);
|
|
73
|
+
|
|
74
|
+
const L = getLuminance(rgb);
|
|
75
|
+
|
|
76
|
+
return L > 0.179 ? "#000000" : "#ffffff";
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// Example: shadeColor("#ff0000", -20) -> "#cc0000" (darker)
|
|
80
|
+
|
|
81
|
+
const shadeColor = (color, percent) => {
|
|
82
|
+
const rgb = parseColor(color);
|
|
83
|
+
const shaded = rgb.map((c) =>
|
|
84
|
+
Math.min(255, Math.max(0, Math.round(c + (c * percent) / 100))),
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
return rgbToHex(...shaded);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// Example: shouldShowBorder("#ffffff", "#ffffff") -> true
|
|
91
|
+
|
|
92
|
+
const shouldShowBorder = (color, background = "#ffffff") => {
|
|
93
|
+
const dist = colorDistance(color, background);
|
|
94
|
+
|
|
95
|
+
// Adjust threshold as needed
|
|
96
|
+
// maximum distance ≈ 441 (black vs. white)
|
|
97
|
+
return dist < 80;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const colorDistance = (c1, c2) => {
|
|
101
|
+
const [r1, g1, b1] = parseColor(c1);
|
|
102
|
+
const [r2, g2, b2] = parseColor(c2);
|
|
103
|
+
|
|
104
|
+
return Math.sqrt(
|
|
105
|
+
Math.pow(r1 - r2, 2) + Math.pow(g1 - g2, 2) + Math.pow(b1 - b2, 2),
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export {
|
|
110
|
+
hexToRgb,
|
|
111
|
+
rgbToHex,
|
|
112
|
+
parseColor,
|
|
113
|
+
getLuminance,
|
|
114
|
+
isLight,
|
|
115
|
+
isDark,
|
|
116
|
+
getContrastColor,
|
|
117
|
+
shadeColor,
|
|
118
|
+
shouldShowBorder,
|
|
119
|
+
};
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const backgrounds = {
|
|
2
|
+
light: "#F1F1F2",
|
|
3
|
+
dark: "#121110",
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export const theme = $state({
|
|
7
|
+
mode: undefined,
|
|
8
|
+
background: undefined,
|
|
9
|
+
backgrounds,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const setupObserver = () => {
|
|
13
|
+
const target = document.documentElement;
|
|
14
|
+
|
|
15
|
+
const update = () => {
|
|
16
|
+
const dark = target.classList.contains("dark");
|
|
17
|
+
theme.mode = dark ? "dark" : "light";
|
|
18
|
+
theme.background = dark ? backgrounds.dark : backgrounds.light;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const observer = new MutationObserver(update);
|
|
22
|
+
observer.observe(target, { attributes: true, attributeFilter: ["class"] });
|
|
23
|
+
|
|
24
|
+
update();
|
|
25
|
+
|
|
26
|
+
return () => observer.disconnect();
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
if (typeof document !== "undefined") {
|
|
30
|
+
setupObserver();
|
|
31
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@websline/system-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -26,57 +26,56 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@tiptap/core": "^3.
|
|
30
|
-
"@tiptap/extension-color": "^3.
|
|
31
|
-
"@tiptap/extension-highlight": "^3.
|
|
32
|
-
"@tiptap/extension-
|
|
33
|
-
"@tiptap/extension-
|
|
34
|
-
"@tiptap/extension-text-
|
|
35
|
-
"@tiptap/
|
|
36
|
-
"@tiptap/
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"dompurify": "^3.2.6",
|
|
29
|
+
"@tiptap/core": "^3.6.5",
|
|
30
|
+
"@tiptap/extension-color": "^3.6.5",
|
|
31
|
+
"@tiptap/extension-highlight": "^3.6.5",
|
|
32
|
+
"@tiptap/extension-placeholder": "^3.6.5",
|
|
33
|
+
"@tiptap/extension-text-align": "^3.6.5",
|
|
34
|
+
"@tiptap/extension-text-style": "^3.6.5",
|
|
35
|
+
"@tiptap/pm": "^3.6.5",
|
|
36
|
+
"@tiptap/starter-kit": "^3.6.5",
|
|
37
|
+
"bits-ui": "^2.11.4",
|
|
38
|
+
"dompurify": "^3.2.7",
|
|
40
39
|
"tailwind-merge": "3.3.1",
|
|
41
|
-
"tailwind-variants": "^3.1.
|
|
42
|
-
"uuid": "^
|
|
40
|
+
"tailwind-variants": "^3.1.1",
|
|
41
|
+
"uuid": "^13.0.0"
|
|
43
42
|
},
|
|
44
43
|
"peerDependencies": {
|
|
45
|
-
"svelte": "^5.38.
|
|
44
|
+
"svelte": "^5.38.7"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
|
-
"@eslint/compat": "^1.
|
|
49
|
-
"@eslint/js": "^9.
|
|
50
|
-
"@storybook/addon-a11y": "^9.1.
|
|
51
|
-
"@storybook/addon-docs": "^9.1.
|
|
52
|
-
"@storybook/addon-svelte-csf": "^5.0.
|
|
47
|
+
"@eslint/compat": "^1.4.0",
|
|
48
|
+
"@eslint/js": "^9.37.0",
|
|
49
|
+
"@storybook/addon-a11y": "^9.1.10",
|
|
50
|
+
"@storybook/addon-docs": "^9.1.10",
|
|
51
|
+
"@storybook/addon-svelte-csf": "^5.0.10",
|
|
53
52
|
"@storybook/manager-api": "^8.6.14",
|
|
54
|
-
"@storybook/sveltekit": "^9.1.
|
|
53
|
+
"@storybook/sveltekit": "^9.1.10",
|
|
55
54
|
"@storybook/theming": "^8.6.14",
|
|
56
|
-
"@sveltejs/adapter-auto": "^6.1.
|
|
57
|
-
"@sveltejs/kit": "^2.
|
|
58
|
-
"@sveltejs/package": "^2.5.
|
|
59
|
-
"@sveltejs/vite-plugin-svelte": "^6.1
|
|
55
|
+
"@sveltejs/adapter-auto": "^6.1.1",
|
|
56
|
+
"@sveltejs/kit": "^2.46.1",
|
|
57
|
+
"@sveltejs/package": "^2.5.4",
|
|
58
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
60
59
|
"@tailwindcss/forms": "^0.5.10",
|
|
61
|
-
"@tailwindcss/typography": "^0.5.
|
|
62
|
-
"@tailwindcss/vite": "^4.1.
|
|
63
|
-
"@types/node": "^24.
|
|
60
|
+
"@tailwindcss/typography": "^0.5.19",
|
|
61
|
+
"@tailwindcss/vite": "^4.1.14",
|
|
62
|
+
"@types/node": "^24.7.0",
|
|
64
63
|
"@vitest/browser": "^3.2.4",
|
|
65
|
-
"eslint": "^9.
|
|
64
|
+
"eslint": "^9.37.0",
|
|
66
65
|
"eslint-config-prettier": "^10.1.8",
|
|
67
|
-
"eslint-plugin-storybook": "^9.1.
|
|
68
|
-
"eslint-plugin-svelte": "^3.12.
|
|
69
|
-
"globals": "^16.
|
|
70
|
-
"playwright": "^1.
|
|
66
|
+
"eslint-plugin-storybook": "^9.1.10",
|
|
67
|
+
"eslint-plugin-svelte": "^3.12.4",
|
|
68
|
+
"globals": "^16.4.0",
|
|
69
|
+
"playwright": "^1.56.0",
|
|
71
70
|
"prettier": "^3.6.2",
|
|
72
71
|
"prettier-plugin-svelte": "^3.4.0",
|
|
73
72
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
74
|
-
"publint": "^0.3.
|
|
75
|
-
"storybook": "^9.1.
|
|
76
|
-
"svelte": "^5.
|
|
77
|
-
"tailwindcss": "^4.1.
|
|
78
|
-
"typescript": "^5.9.
|
|
79
|
-
"vite": "^7.1.
|
|
73
|
+
"publint": "^0.3.14",
|
|
74
|
+
"storybook": "^9.1.10",
|
|
75
|
+
"svelte": "^5.39.9",
|
|
76
|
+
"tailwindcss": "^4.1.14",
|
|
77
|
+
"typescript": "^5.9.3",
|
|
78
|
+
"vite": "^7.1.9",
|
|
80
79
|
"vitest": "^3.2.4",
|
|
81
80
|
"vitest-browser-svelte": "^1.1.0"
|
|
82
81
|
},
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
2
|
-
disabled: {
|
|
3
|
-
true: string;
|
|
4
|
-
};
|
|
5
|
-
fullWidth: {
|
|
6
|
-
true: string;
|
|
7
|
-
};
|
|
8
|
-
loading: {
|
|
9
|
-
true: string;
|
|
10
|
-
};
|
|
11
|
-
size: {
|
|
12
|
-
small: string;
|
|
13
|
-
medium: string;
|
|
14
|
-
large: string;
|
|
15
|
-
};
|
|
16
|
-
variant: {
|
|
17
|
-
filled: string;
|
|
18
|
-
outlined: string;
|
|
19
|
-
};
|
|
20
|
-
}, undefined, "flex items-center rounded cursor-pointer transition duration-200 select-none", {
|
|
21
|
-
disabled: {
|
|
22
|
-
true: string;
|
|
23
|
-
};
|
|
24
|
-
fullWidth: {
|
|
25
|
-
true: string;
|
|
26
|
-
};
|
|
27
|
-
loading: {
|
|
28
|
-
true: string;
|
|
29
|
-
};
|
|
30
|
-
size: {
|
|
31
|
-
small: string;
|
|
32
|
-
medium: string;
|
|
33
|
-
large: string;
|
|
34
|
-
};
|
|
35
|
-
variant: {
|
|
36
|
-
filled: string;
|
|
37
|
-
outlined: string;
|
|
38
|
-
};
|
|
39
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
40
|
-
disabled: {
|
|
41
|
-
true: string;
|
|
42
|
-
};
|
|
43
|
-
fullWidth: {
|
|
44
|
-
true: string;
|
|
45
|
-
};
|
|
46
|
-
loading: {
|
|
47
|
-
true: string;
|
|
48
|
-
};
|
|
49
|
-
size: {
|
|
50
|
-
small: string;
|
|
51
|
-
medium: string;
|
|
52
|
-
large: string;
|
|
53
|
-
};
|
|
54
|
-
variant: {
|
|
55
|
-
filled: string;
|
|
56
|
-
outlined: string;
|
|
57
|
-
};
|
|
58
|
-
}, undefined, "flex items-center rounded cursor-pointer transition duration-200 select-none", unknown, unknown, undefined>>;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { tv } from "tailwind-variants";
|
|
2
|
-
|
|
3
|
-
const buttonVariants = tv({
|
|
4
|
-
base: "flex items-center rounded cursor-pointer transition duration-200 select-none",
|
|
5
|
-
variants: {
|
|
6
|
-
disabled: {
|
|
7
|
-
true: "opacity-40 pointer-events-none",
|
|
8
|
-
},
|
|
9
|
-
fullWidth: {
|
|
10
|
-
true: "w-full justify-center",
|
|
11
|
-
},
|
|
12
|
-
loading: {
|
|
13
|
-
true: "pointer-events-none",
|
|
14
|
-
},
|
|
15
|
-
size: {
|
|
16
|
-
small: "py-1.25 px-3 gap-2 button-small",
|
|
17
|
-
medium: "py-1.5 px-3 gap-2 button-default",
|
|
18
|
-
large: "py-2.5 px-3 gap-3 button-default",
|
|
19
|
-
},
|
|
20
|
-
variant: {
|
|
21
|
-
filled: "border-transparent border-1",
|
|
22
|
-
outlined: "border-1",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
compoundVariants: [
|
|
26
|
-
{
|
|
27
|
-
color: "primary",
|
|
28
|
-
variant: "filled",
|
|
29
|
-
class:
|
|
30
|
-
"bg-blue-500 text-white hover:bg-blue-600 dark:bg-blue-400 dark:hover:bg-blue-500",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
color: "primary",
|
|
34
|
-
variant: "outlined",
|
|
35
|
-
class:
|
|
36
|
-
"text-blue-500 border-blue-500 hover:bg-blue-600 hover:border-blue-600 hover:text-white dark:text-blue-400 dark:border-blue-400 dark:hover:bg-blue-500 dark:hover:border-blue-500",
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
color: "secondary",
|
|
40
|
-
variant: "filled",
|
|
41
|
-
class:
|
|
42
|
-
"bg-neutral-900 text-white hover:bg-neutral-700 dark:bg-neutral-200 dark:text-neutral-900 dark:hover:bg-neutral-500",
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
color: "secondary",
|
|
46
|
-
variant: "outlined",
|
|
47
|
-
class:
|
|
48
|
-
"text-neutral-900 hover:bg-neutral-700 hover:text-white hover:border-neutral-700 dark:border-white dark:text-white dark:hover:bg-neutral-500 dark:hover:border-neutral-500 dark:hover:text-inherit",
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
color: "tertiary",
|
|
52
|
-
class:
|
|
53
|
-
"relative !px-0 after:content-[''] after:absolute after:left-0 after:bottom-0 after:h-[1.5px] after:w-0 after:bg-blue-500 hover:after:w-full after:transition-all after:duration-300 dark:text-white dark:after:bg-blue-400",
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
color: "success",
|
|
57
|
-
variant: "filled",
|
|
58
|
-
class:
|
|
59
|
-
"bg-green-500 text-white hover:bg-green-700 dark:bg-green-500 dark:hover:bg-green-700",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
color: "success",
|
|
63
|
-
variant: "outlined",
|
|
64
|
-
class:
|
|
65
|
-
"text-green-500 border-green-500 hover:bg-green-700 hover:border-green-700 hover:text-white dark:text-green-500 dark:border-green-500 dark:hover:bg-green-700 dark:hover:border-green-700",
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
color: "danger",
|
|
69
|
-
variant: "filled",
|
|
70
|
-
class:
|
|
71
|
-
"bg-red-500 text-white hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-700",
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
color: "danger",
|
|
75
|
-
variant: "outlined",
|
|
76
|
-
class:
|
|
77
|
-
"text-red-500 border-red-500 hover:bg-red-700 hover:border-red-700 hover:text-white dark:text-red-500 dark:border-red-500 dark:hover:bg-red-700 dark:hover:border-red-700",
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
export { buttonVariants };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -4,22 +4,22 @@ type Spinner = {
|
|
|
4
4
|
$set?(props: Partial<Props>): void;
|
|
5
5
|
};
|
|
6
6
|
declare const Spinner: import("svelte").Component<{
|
|
7
|
-
/**
|
|
8
|
-
* Spinner size
|
|
9
|
-
*/
|
|
10
|
-
size?: "small" | "medium" | "large";
|
|
11
7
|
/**
|
|
12
8
|
* Additional CSS classes to apply to the component
|
|
13
9
|
*/
|
|
14
10
|
class?: string;
|
|
15
|
-
}, {}, "">;
|
|
16
|
-
type Props = {
|
|
17
11
|
/**
|
|
18
12
|
* Spinner size
|
|
19
13
|
*/
|
|
20
14
|
size?: "small" | "medium" | "large";
|
|
15
|
+
}, {}, "">;
|
|
16
|
+
type Props = {
|
|
21
17
|
/**
|
|
22
18
|
* Additional CSS classes to apply to the component
|
|
23
19
|
*/
|
|
24
20
|
class?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Spinner size
|
|
23
|
+
*/
|
|
24
|
+
size?: "small" | "medium" | "large";
|
|
25
25
|
};
|