@websline/system-components 1.2.4 → 1.2.5
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/actions/button/button.variants.js +1 -1
- package/dist/components/atoms/actions/closeButton/closeButton.variants.js +1 -1
- package/dist/components/atoms/actions/iconButton/iconButton.variants.js +1 -1
- package/dist/components/atoms/avatar/avatar.variants.js +1 -1
- package/dist/components/atoms/badge/badge.variants.js +1 -1
- package/dist/components/atoms/checkbox/checkbox.variants.js +1 -1
- package/dist/components/atoms/chip/chip.variants.js +1 -1
- package/dist/components/atoms/colorChip/ColorChip.svelte +3 -1
- package/dist/components/atoms/colorChip/ColorChip.svelte.d.ts +8 -0
- package/dist/components/atoms/colorChip/colorChip.variants.d.ts +9 -0
- package/dist/components/atoms/colorChip/colorChip.variants.js +4 -1
- package/dist/components/atoms/feedback/progressBar/progressBar.variants.js +1 -1
- package/dist/components/atoms/feedback/spinner/spinner.variants.js +1 -1
- package/dist/components/atoms/helperText/helperText.variants.js +1 -1
- package/dist/components/atoms/input/input.variants.d.ts +0 -43
- package/dist/components/atoms/input/input.variants.js +2 -47
- package/dist/components/atoms/label/label.variants.js +1 -1
- package/dist/components/atoms/radio/radio.variants.js +1 -1
- package/dist/components/atoms/select/select.variants.js +1 -2
- package/dist/components/atoms/switch/switch.variants.js +1 -1
- package/dist/components/atoms/textarea/textarea.variants.js +1 -2
- package/dist/components/atoms/utils/xScroll/xScroll.variants.js +1 -1
- package/dist/components/molecules/comboBox/comboBox.variants.js +1 -2
- package/dist/components/molecules/formActions/formActions.variants.js +1 -1
- package/dist/components/molecules/formField/formField.variants.js +1 -1
- package/dist/components/molecules/formLayout/formLayout.variants.js +1 -1
- package/dist/components/molecules/notification/notification.variants.js +1 -1
- package/dist/components/molecules/pickers/colorSwatch/colorSwatch.variants.js +1 -1
- package/dist/components/molecules/richTextEditor/RichTextEditor.svelte.d.ts +2 -2
- package/dist/components/molecules/richTextEditor/richTextEditor.variants.js +1 -1
- package/dist/components/molecules/selectorCard/SelectorCard.svelte +1 -3
- package/dist/components/molecules/selectorCard/selectorCard.variants.js +4 -4
- package/dist/components/molecules/tagSelector/tagSelector.variants.js +1 -2
- package/dist/components/molecules/toggleGroup/toggleGroup.variants.js +1 -1
- package/dist/components/molecules/toggleGroup/toggleGroupItem.variants.js +1 -1
- package/dist/components/organisms/dialog/dialog.variants.js +1 -1
- package/dist/components/organisms/modal/modal.variants.js +1 -1
- package/dist/components/organisms/notificationGroup/notificationGroup.variants.js +1 -1
- package/dist/components/organisms/popover/popover.variants.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/utils/tailwind.d.ts +72 -0
- package/dist/utils/tailwind.js +80 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tv } from "tailwind
|
|
1
|
+
import { tv } from "../../../utils/tailwind.js";
|
|
2
2
|
|
|
3
3
|
const checkboxVariants = tv({
|
|
4
4
|
base: "size-4 cursor-pointer rounded border border-current bg-transparent bg-none text-neutral-900 ring-0 ring-transparent ring-offset-transparent outline-transparent duration-300 after:block after:size-full checked:bg-none checked:after:bg-current focus:outline-1 focus:outline-offset-1 focus:outline-blue-300 dark:text-white",
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @typedef {Object} Props
|
|
6
|
+
* @property {boolean} [active=false] Whether the ColorChip is active
|
|
6
7
|
* @property {string} [borderColor=""] Border color value (hex, rgb, etc.)
|
|
7
8
|
* @property {string} [class=""] Additional CSS classes to apply to the component
|
|
8
9
|
* @property {boolean} [clickable=false] Whether the ColorChip is clickable
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
|
|
14
15
|
/** @type {Props} */
|
|
15
16
|
let {
|
|
17
|
+
active = false,
|
|
16
18
|
borderColor = "",
|
|
17
19
|
class: className = "",
|
|
18
20
|
clickable = false,
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
|
|
28
30
|
<svelte:element
|
|
29
31
|
this={as}
|
|
30
|
-
class={colorChipVariants({ class: className, clickable, shape, size })}
|
|
32
|
+
class={colorChipVariants({ active, class: className, clickable, shape, size })}
|
|
31
33
|
style="background-color: {color}; border-color: {borderColor};"
|
|
32
34
|
{...rest}>
|
|
33
35
|
</svelte:element>
|
|
@@ -4,6 +4,10 @@ type ColorChip = {
|
|
|
4
4
|
$set?(props: Partial<Props>): void;
|
|
5
5
|
};
|
|
6
6
|
declare const ColorChip: import("svelte").Component<{
|
|
7
|
+
/**
|
|
8
|
+
* Whether the ColorChip is active
|
|
9
|
+
*/
|
|
10
|
+
active?: boolean;
|
|
7
11
|
/**
|
|
8
12
|
* Border color value (hex, rgb, etc.)
|
|
9
13
|
*/
|
|
@@ -30,6 +34,10 @@ declare const ColorChip: import("svelte").Component<{
|
|
|
30
34
|
size?: "small" | "medium" | "large";
|
|
31
35
|
}, {}, "">;
|
|
32
36
|
type Props = {
|
|
37
|
+
/**
|
|
38
|
+
* Whether the ColorChip is active
|
|
39
|
+
*/
|
|
40
|
+
active?: boolean;
|
|
33
41
|
/**
|
|
34
42
|
* Border color value (hex, rgb, etc.)
|
|
35
43
|
*/
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export const colorChipVariants: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
active: {
|
|
3
|
+
true: string;
|
|
4
|
+
};
|
|
2
5
|
clickable: {
|
|
3
6
|
true: string[];
|
|
4
7
|
};
|
|
@@ -12,6 +15,9 @@ export const colorChipVariants: import("tailwind-variants").TVReturnType<{
|
|
|
12
15
|
large: string;
|
|
13
16
|
};
|
|
14
17
|
}, undefined, "border border-transparent", {
|
|
18
|
+
active: {
|
|
19
|
+
true: string;
|
|
20
|
+
};
|
|
15
21
|
clickable: {
|
|
16
22
|
true: string[];
|
|
17
23
|
};
|
|
@@ -25,6 +31,9 @@ export const colorChipVariants: import("tailwind-variants").TVReturnType<{
|
|
|
25
31
|
large: string;
|
|
26
32
|
};
|
|
27
33
|
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
34
|
+
active: {
|
|
35
|
+
true: string;
|
|
36
|
+
};
|
|
28
37
|
clickable: {
|
|
29
38
|
true: string[];
|
|
30
39
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { tv } from "tailwind
|
|
1
|
+
import { tv } from "../../../utils/tailwind.js";
|
|
2
2
|
|
|
3
3
|
const colorChipVariants = tv({
|
|
4
4
|
base: "border border-transparent",
|
|
5
5
|
variants: {
|
|
6
|
+
active: {
|
|
7
|
+
true: "ring-2 ring-blue-500 ring-offset-1",
|
|
8
|
+
},
|
|
6
9
|
clickable: {
|
|
7
10
|
true: [
|
|
8
11
|
"cursor-pointer",
|
|
@@ -1,46 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @property {boolean} [defaultValue] Use this variant if the element doesn't support the placeholder selector
|
|
3
|
-
*/
|
|
4
|
-
export const inputBaseVariant: import("tailwind-variants").TVReturnType<{
|
|
5
|
-
disabled: {
|
|
6
|
-
true: {
|
|
7
|
-
base: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
error: {
|
|
11
|
-
true: {
|
|
12
|
-
base: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
}, {
|
|
16
|
-
base: string[];
|
|
17
|
-
}, undefined, {
|
|
18
|
-
disabled: {
|
|
19
|
-
true: {
|
|
20
|
-
base: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
error: {
|
|
24
|
-
true: {
|
|
25
|
-
base: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
}, {
|
|
29
|
-
base: string[];
|
|
30
|
-
}, import("tailwind-variants").TVReturnType<{
|
|
31
|
-
disabled: {
|
|
32
|
-
true: {
|
|
33
|
-
base: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
error: {
|
|
37
|
-
true: {
|
|
38
|
-
base: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
}, {
|
|
42
|
-
base: string[];
|
|
43
|
-
}, undefined, unknown, unknown, undefined>>;
|
|
44
1
|
export const inputVariants: import("tailwind-variants").TVReturnType<{
|
|
45
2
|
[key: string]: {
|
|
46
3
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
@@ -1,49 +1,4 @@
|
|
|
1
|
-
import { tv } from "tailwind
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @property {boolean} [defaultValue] Use this variant if the element doesn't support the placeholder selector
|
|
5
|
-
*/
|
|
6
|
-
const inputBaseVariant = tv({
|
|
7
|
-
slots: {
|
|
8
|
-
base: [
|
|
9
|
-
"w-full rounded-lg px-4 body-small",
|
|
10
|
-
"text-neutral-900 placeholder-neutral-500 dark:text-neutral-200",
|
|
11
|
-
"bg-white dark:bg-neutral-800",
|
|
12
|
-
"outline-transparent transition-[border,color,outline] duration-300",
|
|
13
|
-
"border border-neutral-300 dark:border-neutral-700",
|
|
14
|
-
],
|
|
15
|
-
},
|
|
16
|
-
variants: {
|
|
17
|
-
disabled: {
|
|
18
|
-
true: { base: "cursor-not-allowed opacity-40" },
|
|
19
|
-
},
|
|
20
|
-
error: {
|
|
21
|
-
true: {
|
|
22
|
-
base: "border-current text-red-500 ring ring-current dark:border-current dark:text-red-500",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
compoundVariants: [
|
|
27
|
-
{
|
|
28
|
-
disabled: false,
|
|
29
|
-
error: false,
|
|
30
|
-
class: {
|
|
31
|
-
base: [
|
|
32
|
-
"focus-within:ring-1 hover:ring-1",
|
|
33
|
-
"focus-within:border-blue-500 focus-within:ring-blue-500 hover:border-blue-500 hover:ring-blue-500",
|
|
34
|
-
"dark:focus-within:border-blue-400 dark:focus-within:ring-blue-400 dark:hover:border-blue-400 dark:hover:ring-blue-400",
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
defaultValue: true,
|
|
40
|
-
error: false,
|
|
41
|
-
class: {
|
|
42
|
-
base: "text-neutral-500 dark:text-neutral-500",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
});
|
|
1
|
+
import { inputBaseVariant, tv } from "../../../utils/tailwind.js";
|
|
47
2
|
|
|
48
3
|
const inputVariants = tv({
|
|
49
4
|
extend: inputBaseVariant,
|
|
@@ -57,4 +12,4 @@ const inputVariants = tv({
|
|
|
57
12
|
},
|
|
58
13
|
});
|
|
59
14
|
|
|
60
|
-
export {
|
|
15
|
+
export { inputVariants };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tv } from "tailwind
|
|
1
|
+
import { tv } from "../../../utils/tailwind.js";
|
|
2
2
|
|
|
3
3
|
const radioVariants = tv({
|
|
4
4
|
base: "m-0.5 h-4 w-4 cursor-pointer appearance-none rounded-full border-0 bg-transparent ring-0 inset-ring-1 ring-transparent inset-ring-neutral-300 ring-offset-transparent outline-transparent duration-300 checked:bg-none focus:outline-1 focus:outline-offset-1 focus:outline-blue-300 dark:inset-ring-neutral-600",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tv } from "tailwind
|
|
1
|
+
import { tv } from "../../../utils/tailwind.js";
|
|
2
2
|
|
|
3
3
|
const switchVariants = tv({
|
|
4
4
|
base: "relative h-4 w-7 cursor-pointer appearance-none rounded-full border-0 bg-neutral-300 ring-inherit ring-offset-transparent outline-transparent transition-[outline] after:absolute after:top-0 after:left-0 after:m-0.25 after:h-3.5 after:w-3.5 after:translate-x-0 after:rounded-full after:bg-neutral-200 after:shadow-toggle after:transition-transform after:duration-300 checked:bg-none focus:outline-1 focus:outline-offset-1 focus:outline-blue-500 dark:bg-neutral-300 dark:after:bg-neutral-300 dark:focus:outline-blue-300",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default RichTextEditor;
|
|
2
2
|
type RichTextEditor = SvelteComponent<{
|
|
3
|
+
content?: string;
|
|
3
4
|
size?: string;
|
|
4
5
|
placeholder?: string;
|
|
5
|
-
content?: string;
|
|
6
6
|
toolbarConfig?: {
|
|
7
7
|
bold: {
|
|
8
8
|
enabled: boolean;
|
|
@@ -40,9 +40,9 @@ type RichTextEditor = SvelteComponent<{
|
|
|
40
40
|
$$bindings?: string;
|
|
41
41
|
};
|
|
42
42
|
declare const RichTextEditor: $$__sveltets_2_IsomorphicComponent<{
|
|
43
|
+
content?: string;
|
|
43
44
|
size?: string;
|
|
44
45
|
placeholder?: string;
|
|
45
|
-
content?: string;
|
|
46
46
|
toolbarConfig?: {
|
|
47
47
|
bold: {
|
|
48
48
|
enabled: boolean;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { tv } from "tailwind
|
|
1
|
+
import { tv } from "../../../utils/tailwind.js";
|
|
2
2
|
|
|
3
3
|
const selectorCardVariants = tv({
|
|
4
4
|
slots: {
|
|
5
5
|
base: "flex cursor-pointer gap-3 rounded-lg border border-neutral-300 bg-white px-4 py-3 dark:border-neutral-700 dark:bg-neutral-800",
|
|
6
|
-
content: "",
|
|
7
|
-
helperText: "ui-caption-helper text-neutral-500",
|
|
6
|
+
content: "mr-1 w-full leading-0",
|
|
7
|
+
helperText: "mt-0.5 ui-caption-helper text-neutral-500",
|
|
8
8
|
input: "shrink-0",
|
|
9
9
|
label:
|
|
10
|
-
"mb-0.5 cursor-[inherit]
|
|
10
|
+
"mb-0.5 cursor-[inherit] font-medium text-neutral-900 dark:text-neutral-200",
|
|
11
11
|
},
|
|
12
12
|
variants: {
|
|
13
13
|
disabled: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as utils from "./utils/index.js";
|
|
2
|
+
export { twMergeConfig } from "./utils/tailwind.js";
|
|
2
3
|
export { default as Avatar } from "./components/atoms/avatar/Avatar.svelte";
|
|
3
4
|
export { default as Badge } from "./components/atoms/badge/Badge.svelte";
|
|
4
5
|
export { default as Button } from "./components/atoms/actions/button/Button.svelte";
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @property {boolean} [defaultValue] Use this variant if the element doesn't support the placeholder selector
|
|
3
|
+
*/
|
|
4
|
+
export const inputBaseVariant: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
disabled: {
|
|
6
|
+
true: {
|
|
7
|
+
base: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
error: {
|
|
11
|
+
true: {
|
|
12
|
+
base: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}, {
|
|
16
|
+
base: string[];
|
|
17
|
+
}, undefined, {
|
|
18
|
+
disabled: {
|
|
19
|
+
true: {
|
|
20
|
+
base: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
error: {
|
|
24
|
+
true: {
|
|
25
|
+
base: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}, {
|
|
29
|
+
base: string[];
|
|
30
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
31
|
+
disabled: {
|
|
32
|
+
true: {
|
|
33
|
+
base: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
error: {
|
|
37
|
+
true: {
|
|
38
|
+
base: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}, {
|
|
42
|
+
base: string[];
|
|
43
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
44
|
+
export const tv: import("tailwind-variants").TV;
|
|
45
|
+
export namespace twMergeConfig {
|
|
46
|
+
let classGroups: {
|
|
47
|
+
"wl-typo": ({
|
|
48
|
+
display: ((classPart: any) => classPart is string)[];
|
|
49
|
+
heading?: undefined;
|
|
50
|
+
body?: undefined;
|
|
51
|
+
ui?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
heading: ((classPart: any) => classPart is string)[];
|
|
54
|
+
display?: undefined;
|
|
55
|
+
body?: undefined;
|
|
56
|
+
ui?: undefined;
|
|
57
|
+
} | {
|
|
58
|
+
body: ((classPart: any) => classPart is string)[];
|
|
59
|
+
display?: undefined;
|
|
60
|
+
heading?: undefined;
|
|
61
|
+
ui?: undefined;
|
|
62
|
+
} | {
|
|
63
|
+
ui: ((classPart: any) => classPart is string)[];
|
|
64
|
+
display?: undefined;
|
|
65
|
+
heading?: undefined;
|
|
66
|
+
body?: undefined;
|
|
67
|
+
})[];
|
|
68
|
+
};
|
|
69
|
+
let conflictingClassGroups: {
|
|
70
|
+
"wl-typo": string[];
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { createTV } from "tailwind-variants";
|
|
2
|
+
|
|
3
|
+
const isArbitraryClass = (classPart) => typeof classPart === "string";
|
|
4
|
+
const fontSizeClassGroups = [
|
|
5
|
+
{ display: [isArbitraryClass] },
|
|
6
|
+
{ heading: [isArbitraryClass] },
|
|
7
|
+
{ body: [isArbitraryClass] },
|
|
8
|
+
{ ui: [isArbitraryClass] },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
const mixedTypoClassGroup = "wl-typo";
|
|
12
|
+
const twMergeConfig = {
|
|
13
|
+
// improve merging, see https://github.com/dcastil/tailwind-merge/blob/v2.2.2/docs/configuration.md
|
|
14
|
+
classGroups: {
|
|
15
|
+
// combine custom typo into a class group
|
|
16
|
+
[mixedTypoClassGroup]: fontSizeClassGroups,
|
|
17
|
+
},
|
|
18
|
+
conflictingClassGroups: {
|
|
19
|
+
// define which properties the given group overwrite only when placed after
|
|
20
|
+
[mixedTypoClassGroup]: [
|
|
21
|
+
"letter-spacing",
|
|
22
|
+
"line-height",
|
|
23
|
+
"font-size",
|
|
24
|
+
"font-weight",
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// common Tailwind Variants utility with custom config
|
|
30
|
+
const tv = createTV({
|
|
31
|
+
twMerge: true,
|
|
32
|
+
twMergeConfig,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @property {boolean} [defaultValue] Use this variant if the element doesn't support the placeholder selector
|
|
37
|
+
*/
|
|
38
|
+
const inputBaseVariant = tv({
|
|
39
|
+
slots: {
|
|
40
|
+
base: [
|
|
41
|
+
"w-full rounded-lg px-4 body-small",
|
|
42
|
+
"text-neutral-900 placeholder-neutral-500 dark:text-neutral-200",
|
|
43
|
+
"bg-white dark:bg-neutral-800",
|
|
44
|
+
"outline-transparent transition-[border,color,outline] duration-300",
|
|
45
|
+
"border border-neutral-300 dark:border-neutral-700",
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
variants: {
|
|
49
|
+
disabled: {
|
|
50
|
+
true: { base: "cursor-not-allowed opacity-40" },
|
|
51
|
+
},
|
|
52
|
+
error: {
|
|
53
|
+
true: {
|
|
54
|
+
base: "border-current text-red-500 ring ring-current dark:border-current dark:text-red-500",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
compoundVariants: [
|
|
59
|
+
{
|
|
60
|
+
disabled: false,
|
|
61
|
+
error: false,
|
|
62
|
+
class: {
|
|
63
|
+
base: [
|
|
64
|
+
"focus-within:ring-1 hover:ring-1",
|
|
65
|
+
"focus-within:border-blue-500 focus-within:ring-blue-500 hover:border-blue-500 hover:ring-blue-500",
|
|
66
|
+
"dark:focus-within:border-blue-400 dark:focus-within:ring-blue-400 dark:hover:border-blue-400 dark:hover:ring-blue-400",
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
defaultValue: true,
|
|
72
|
+
error: false,
|
|
73
|
+
class: {
|
|
74
|
+
base: "text-neutral-500 dark:text-neutral-500",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export { inputBaseVariant, tv, twMergeConfig };
|