@hyvor/design 0.0.37 → 0.0.39
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/Button/Button.svelte.d.ts +1 -1
- package/dist/components/IconButton/IconButton.svelte +46 -4
- package/dist/components/IconButton/IconButton.svelte.d.ts +1 -1
- package/dist/components/IconMessage/IconMessage.svelte +74 -0
- package/dist/components/IconMessage/IconMessage.svelte.d.ts +27 -0
- package/dist/components/Loader/LoadButton.svelte +44 -0
- package/dist/components/Loader/LoadButton.svelte.d.ts +44 -0
- package/dist/components/SplitControl/SplitControl.svelte +9 -4
- package/dist/components/SplitControl/SplitControl.svelte.d.ts +1 -0
- package/dist/components/TabNav/TabNav.svelte +8 -2
- package/dist/components/Tooltip/Tooltip.svelte +7 -4
- package/dist/components/Tooltip/Tooltip.svelte.d.ts +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ declare const __propDef: {
|
|
|
6
6
|
size?: "small" | "medium" | "large" | "x-small" | undefined;
|
|
7
7
|
color?: "input" | "accent" | "gray" | "green" | "red" | "blue" | "orange" | undefined;
|
|
8
8
|
block?: boolean | undefined;
|
|
9
|
-
variant?: "fill" | "
|
|
9
|
+
variant?: "fill" | "fill-light" | "outline" | "outline-fill" | "invisible" | undefined;
|
|
10
10
|
align?: "start" | "center" | undefined;
|
|
11
11
|
button?: HTMLButtonElement | HTMLAnchorElement | undefined;
|
|
12
12
|
};
|
|
@@ -64,29 +64,65 @@ size = (typeof size === "number" ? size : sizes[size]) + "px";
|
|
|
64
64
|
.button.fill.accent {
|
|
65
65
|
background-color: var(--accent);
|
|
66
66
|
color: var(--accent-text);
|
|
67
|
+
transition: 0.2s box-shadow;
|
|
67
68
|
--local-hover-shadow-color: var(--accent-light);
|
|
68
69
|
}
|
|
69
70
|
.button.fill.gray {
|
|
71
|
+
background-color: var(--gray-dark);
|
|
72
|
+
color: var(--text-white);
|
|
73
|
+
transition: 0.2s box-shadow;
|
|
74
|
+
--local-hover-shadow-color: var(--gray-light);
|
|
75
|
+
}
|
|
76
|
+
.button.fill.green {
|
|
77
|
+
background-color: var(--green-dark);
|
|
78
|
+
color: var(--text-white);
|
|
79
|
+
transition: 0.2s box-shadow;
|
|
80
|
+
--local-hover-shadow-color: var(--green-light);
|
|
81
|
+
}
|
|
82
|
+
.button.fill.red {
|
|
83
|
+
background-color: var(--red-dark);
|
|
84
|
+
color: var(--text-white);
|
|
85
|
+
transition: 0.2s box-shadow;
|
|
86
|
+
--local-hover-shadow-color: var(--red-light);
|
|
87
|
+
}
|
|
88
|
+
.button.fill.blue {
|
|
89
|
+
background-color: var(--blue-dark);
|
|
90
|
+
color: var(--text-white);
|
|
91
|
+
transition: 0.2s box-shadow;
|
|
92
|
+
--local-hover-shadow-color: var(--blue-light);
|
|
93
|
+
}
|
|
94
|
+
.button.fill.orange {
|
|
95
|
+
background-color: var(--orange-dark);
|
|
96
|
+
color: var(--text-white);
|
|
97
|
+
transition: 0.2s box-shadow;
|
|
98
|
+
--local-hover-shadow-color: var(--orange-light);
|
|
99
|
+
}
|
|
100
|
+
.button.fill-light.accent {
|
|
101
|
+
background-color: var(--accent);
|
|
102
|
+
color: var(--accent-text);
|
|
103
|
+
--local-hover-shadow-color: var(--accent-light);
|
|
104
|
+
}
|
|
105
|
+
.button.fill-light.gray {
|
|
70
106
|
background-color: var(--gray-light);
|
|
71
107
|
color: var(--gray-dark);
|
|
72
108
|
--local-hover-shadow-color: color-mix(in srgb, var(--gray-light) 40%, transparent);
|
|
73
109
|
}
|
|
74
|
-
.button.fill.green {
|
|
110
|
+
.button.fill-light.green {
|
|
75
111
|
background-color: var(--green-light);
|
|
76
112
|
color: var(--green-dark);
|
|
77
113
|
--local-hover-shadow-color: color-mix(in srgb, var(--green-light) 40%, transparent);
|
|
78
114
|
}
|
|
79
|
-
.button.fill.red {
|
|
115
|
+
.button.fill-light.red {
|
|
80
116
|
background-color: var(--red-light);
|
|
81
117
|
color: var(--red-dark);
|
|
82
118
|
--local-hover-shadow-color: color-mix(in srgb, var(--red-light) 40%, transparent);
|
|
83
119
|
}
|
|
84
|
-
.button.fill.blue {
|
|
120
|
+
.button.fill-light.blue {
|
|
85
121
|
background-color: var(--blue-light);
|
|
86
122
|
color: var(--blue-dark);
|
|
87
123
|
--local-hover-shadow-color: color-mix(in srgb, var(--blue-light) 40%, transparent);
|
|
88
124
|
}
|
|
89
|
-
.button.fill.orange {
|
|
125
|
+
.button.fill-light.orange {
|
|
90
126
|
background-color: var(--orange-light);
|
|
91
127
|
color: var(--orange-dark);
|
|
92
128
|
--local-hover-shadow-color: color-mix(in srgb, var(--orange-light) 40%, transparent);
|
|
@@ -201,4 +237,10 @@ size = (typeof size === "number" ? size : sizes[size]) + "px";
|
|
|
201
237
|
background-color: var(--orange-light);
|
|
202
238
|
box-shadow: none !important;
|
|
203
239
|
color: var(--orange-dark);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.button[disabled] {
|
|
243
|
+
cursor: not-allowed;
|
|
244
|
+
opacity: 0.2;
|
|
245
|
+
box-shadow: none !important;
|
|
204
246
|
}</style>
|
|
@@ -4,7 +4,7 @@ declare const __propDef: {
|
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
size?: number | "small" | "medium" | "large" | undefined;
|
|
6
6
|
color?: "accent" | "gray" | "green" | "red" | "blue" | "orange" | undefined;
|
|
7
|
-
variant?: "fill" | "outline" | "outline-fill" | "invisible" | undefined;
|
|
7
|
+
variant?: "fill" | "fill-light" | "outline" | "outline-fill" | "invisible" | undefined;
|
|
8
8
|
as?: "button" | "a" | undefined;
|
|
9
9
|
};
|
|
10
10
|
events: {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script>import { IconBug, IconInbox, IconPatchExclamation } from "@hyvor/icons";
|
|
2
|
+
export let icon = null;
|
|
3
|
+
export let message = null;
|
|
4
|
+
export let iconSize = 100;
|
|
5
|
+
export let padding = 0;
|
|
6
|
+
export let empty = false;
|
|
7
|
+
export let error = false;
|
|
8
|
+
export let iconColor = null;
|
|
9
|
+
if (empty) {
|
|
10
|
+
message = message || "No results found";
|
|
11
|
+
icon = IconInbox;
|
|
12
|
+
}
|
|
13
|
+
if (error) {
|
|
14
|
+
message = message || "Something went wrong";
|
|
15
|
+
icon = IconPatchExclamation;
|
|
16
|
+
iconColor = iconColor || "var(--red)";
|
|
17
|
+
}
|
|
18
|
+
iconColor = iconColor || "var(--gray-dark)";
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div
|
|
22
|
+
class="icon-message"
|
|
23
|
+
style:padding={padding + 'px'}
|
|
24
|
+
>
|
|
25
|
+
|
|
26
|
+
<div
|
|
27
|
+
class="icon"
|
|
28
|
+
style:color={iconColor}
|
|
29
|
+
style:font-size={iconSize + 'px'}
|
|
30
|
+
{...$$restProps}
|
|
31
|
+
>
|
|
32
|
+
{#if $$slots.icon}
|
|
33
|
+
<slot name="icon" />
|
|
34
|
+
{:else if icon}
|
|
35
|
+
<svelte:component this={icon} size={iconSize + 'px' } />
|
|
36
|
+
{/if}
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<p class="message">
|
|
40
|
+
{#if $$slots.message}
|
|
41
|
+
<slot name="message" />
|
|
42
|
+
{:else if message}
|
|
43
|
+
{message}
|
|
44
|
+
{/if}
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<style>
|
|
50
|
+
|
|
51
|
+
.icon-message {
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 100%;
|
|
54
|
+
flex: 1;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
position: relative;
|
|
59
|
+
flex-direction: column; /* Change to column direction */
|
|
60
|
+
text-align: center;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.message {
|
|
64
|
+
/* Add message styles here */
|
|
65
|
+
color: var(--text-light);
|
|
66
|
+
margin-top: -10px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.icon {
|
|
70
|
+
font-size: 100px;/* Add icon styles here */
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ComponentType } from 'svelte';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
icon?: ComponentType | null | undefined;
|
|
7
|
+
message?: string | null | undefined;
|
|
8
|
+
iconSize?: number | undefined;
|
|
9
|
+
padding?: number | undefined;
|
|
10
|
+
empty?: boolean | undefined;
|
|
11
|
+
error?: boolean | undefined;
|
|
12
|
+
iconColor?: string | null | undefined;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {
|
|
18
|
+
icon: {};
|
|
19
|
+
message: {};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type IconMessageProps = typeof __propDef.props;
|
|
23
|
+
export type IconMessageEvents = typeof __propDef.events;
|
|
24
|
+
export type IconMessageSlots = typeof __propDef.slots;
|
|
25
|
+
export default class IconMessage extends SvelteComponent<IconMessageProps, IconMessageEvents, IconMessageSlots> {
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script>import Button from "../Button/Button.svelte";
|
|
2
|
+
import Loader from "./Loader.svelte";
|
|
3
|
+
export let text;
|
|
4
|
+
export let show;
|
|
5
|
+
export let loading;
|
|
6
|
+
export let height = 50;
|
|
7
|
+
export let divProps = {};
|
|
8
|
+
export let loaderProps = {};
|
|
9
|
+
export let buttonProps = {};
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
{#if show}
|
|
13
|
+
|
|
14
|
+
<div
|
|
15
|
+
class="load-button"
|
|
16
|
+
style:height="{height}px"
|
|
17
|
+
{...divProps}
|
|
18
|
+
>
|
|
19
|
+
|
|
20
|
+
{#if loading}
|
|
21
|
+
<Loader {...loaderProps} />
|
|
22
|
+
{:else}
|
|
23
|
+
|
|
24
|
+
<Button
|
|
25
|
+
size="small"
|
|
26
|
+
on:click
|
|
27
|
+
{...buttonProps}
|
|
28
|
+
>
|
|
29
|
+
{text}
|
|
30
|
+
</Button>
|
|
31
|
+
|
|
32
|
+
{/if}
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
{/if}
|
|
37
|
+
|
|
38
|
+
<style>
|
|
39
|
+
.load-button {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
text: string;
|
|
5
|
+
show: boolean;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
height?: number | undefined;
|
|
8
|
+
divProps?: Record<string, any> | undefined;
|
|
9
|
+
loaderProps?: {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
block?: boolean | undefined;
|
|
12
|
+
full?: boolean | undefined;
|
|
13
|
+
padding?: number | "none" | "small" | "medium" | "large" | undefined;
|
|
14
|
+
size?: number | "small" | "medium" | "large" | undefined;
|
|
15
|
+
state?: "none" | "error" | "success" | "loading" | undefined;
|
|
16
|
+
duration?: number | null | undefined;
|
|
17
|
+
color?: string | undefined;
|
|
18
|
+
colorTrack?: string | undefined;
|
|
19
|
+
invert?: boolean | undefined;
|
|
20
|
+
} | undefined;
|
|
21
|
+
buttonProps?: {
|
|
22
|
+
[x: string]: any;
|
|
23
|
+
as?: "button" | "a" | undefined;
|
|
24
|
+
size?: "small" | "medium" | "large" | "x-small" | undefined;
|
|
25
|
+
color?: "input" | "accent" | "gray" | "green" | "red" | "blue" | "orange" | undefined;
|
|
26
|
+
block?: boolean | undefined;
|
|
27
|
+
variant?: "fill" | "fill-light" | "outline" | "outline-fill" | "invisible" | undefined;
|
|
28
|
+
align?: "start" | "center" | undefined;
|
|
29
|
+
button?: HTMLButtonElement | HTMLAnchorElement | undefined;
|
|
30
|
+
} | undefined;
|
|
31
|
+
};
|
|
32
|
+
events: {
|
|
33
|
+
click: MouseEvent;
|
|
34
|
+
} & {
|
|
35
|
+
[evt: string]: CustomEvent<any>;
|
|
36
|
+
};
|
|
37
|
+
slots: {};
|
|
38
|
+
};
|
|
39
|
+
export type LoadButtonProps = typeof __propDef.props;
|
|
40
|
+
export type LoadButtonEvents = typeof __propDef.events;
|
|
41
|
+
export type LoadButtonSlots = typeof __propDef.slots;
|
|
42
|
+
export default class LoadButton extends SvelteComponent<LoadButtonProps, LoadButtonEvents, LoadButtonSlots> {
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
import Label from "../FormControl/Label.svelte";
|
|
3
3
|
export let label = "";
|
|
4
4
|
export let caption = "";
|
|
5
|
+
export let flex = [1, 2];
|
|
5
6
|
</script>
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
<div class="split-control" class:has-nested={$$slots.nested}>
|
|
9
10
|
|
|
10
|
-
<div
|
|
11
|
+
<div
|
|
12
|
+
class="left"
|
|
13
|
+
style:flex={flex[0]}
|
|
14
|
+
>
|
|
11
15
|
|
|
12
16
|
<div class="label-wrap">
|
|
13
17
|
{#if $$slots.label}
|
|
@@ -29,7 +33,10 @@ export let caption = "";
|
|
|
29
33
|
</div>
|
|
30
34
|
|
|
31
35
|
{#if $$slots.default}
|
|
32
|
-
<div
|
|
36
|
+
<div
|
|
37
|
+
class="right"
|
|
38
|
+
style:flex={flex[1]}
|
|
39
|
+
>
|
|
33
40
|
<slot></slot>
|
|
34
41
|
</div>
|
|
35
42
|
{/if}
|
|
@@ -62,12 +69,10 @@ export let caption = "";
|
|
|
62
69
|
|
|
63
70
|
.left {
|
|
64
71
|
padding: 15px;
|
|
65
|
-
flex: 1;
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
.right {
|
|
69
75
|
padding: 15px;
|
|
70
|
-
flex: 3;
|
|
71
76
|
min-width: 0;
|
|
72
77
|
}
|
|
73
78
|
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
<script>import { setContext } from "svelte";
|
|
1
|
+
<script>import { onMount, setContext } from "svelte";
|
|
2
2
|
import { writable } from "svelte/store";
|
|
3
3
|
export let active;
|
|
4
4
|
const activeStore = writable(active);
|
|
5
5
|
setContext("tab-nav-active", activeStore);
|
|
6
6
|
$:
|
|
7
|
-
active
|
|
7
|
+
active, activeStore.set(active);
|
|
8
|
+
onMount(() => {
|
|
9
|
+
const unsubscribe = activeStore.subscribe((value) => {
|
|
10
|
+
active = value;
|
|
11
|
+
});
|
|
12
|
+
return unsubscribe;
|
|
13
|
+
});
|
|
8
14
|
</script>
|
|
9
15
|
|
|
10
16
|
<div
|
|
@@ -4,6 +4,7 @@ export let position = "top";
|
|
|
4
4
|
export let color = "black";
|
|
5
5
|
export let show = false;
|
|
6
6
|
export let maxWidth = 300;
|
|
7
|
+
export let disabled = false;
|
|
7
8
|
let wrap;
|
|
8
9
|
let tooltip;
|
|
9
10
|
function positionTooltip() {
|
|
@@ -28,9 +29,11 @@ function positionTooltip() {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
async function handleMouseEnter() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
if (!disabled) {
|
|
33
|
+
show = true;
|
|
34
|
+
await tick();
|
|
35
|
+
positionTooltip();
|
|
36
|
+
}
|
|
34
37
|
}
|
|
35
38
|
function handleMouseLeave() {
|
|
36
39
|
show = false;
|
|
@@ -61,7 +64,7 @@ onMount(() => {
|
|
|
61
64
|
>
|
|
62
65
|
<slot />
|
|
63
66
|
|
|
64
|
-
{#if show}
|
|
67
|
+
{#if !disabled && show}
|
|
65
68
|
<div
|
|
66
69
|
class="tooltip {position}"
|
|
67
70
|
style:max-width={maxWidth + 'px'}
|
|
@@ -22,6 +22,7 @@ export { default as Validation } from './FormControl/Validation.svelte';
|
|
|
22
22
|
export { default as IconButton } from './IconButton/IconButton.svelte';
|
|
23
23
|
export { default as Link } from './Link/Link.svelte';
|
|
24
24
|
export { default as Loader } from './Loader/Loader.svelte';
|
|
25
|
+
export { default as LoadButton } from './Loader/LoadButton.svelte';
|
|
25
26
|
export { default as Modal } from './Modal/Modal.svelte';
|
|
26
27
|
export { confirm } from './Modal/confirm.js';
|
|
27
28
|
export { default as NavLink } from './NavLink/NavLink.svelte';
|
|
@@ -38,3 +39,4 @@ export { default as Text } from './Text/Text.svelte';
|
|
|
38
39
|
export { default as TextInput } from './TextInput/TextInput.svelte';
|
|
39
40
|
export { default as toast } from './Toast/toast.js';
|
|
40
41
|
export { default as Tooltip } from './Tooltip/Tooltip.svelte';
|
|
42
|
+
export { default as IconMessage } from './IconMessage/IconMessage.svelte';
|
package/dist/components/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export { default as Validation } from './FormControl/Validation.svelte';
|
|
|
22
22
|
export { default as IconButton } from './IconButton/IconButton.svelte';
|
|
23
23
|
export { default as Link } from './Link/Link.svelte';
|
|
24
24
|
export { default as Loader } from './Loader/Loader.svelte';
|
|
25
|
+
export { default as LoadButton } from './Loader/LoadButton.svelte';
|
|
25
26
|
export { default as Modal } from './Modal/Modal.svelte';
|
|
26
27
|
export { confirm } from './Modal/confirm.js';
|
|
27
28
|
export { default as NavLink } from './NavLink/NavLink.svelte';
|
|
@@ -38,3 +39,4 @@ export { default as Text } from './Text/Text.svelte';
|
|
|
38
39
|
export { default as TextInput } from './TextInput/TextInput.svelte';
|
|
39
40
|
export { default as toast } from './Toast/toast.js';
|
|
40
41
|
export { default as Tooltip } from './Tooltip/Tooltip.svelte';
|
|
42
|
+
export { default as IconMessage } from './IconMessage/IconMessage.svelte';
|