mertani-web-toolkit 0.1.20 → 0.1.22
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 +101 -30
- package/dist/components/Button/Button.svelte.d.ts +12 -8
- package/dist/components/Button/button.css +116 -30
- package/dist/components/Header/Header.svelte +45 -45
- package/dist/components/Header/header.css +32 -32
- package/dist/components/Icon/Icon.svelte +72 -0
- package/dist/components/Icon/Icon.svelte.d.ts +10 -0
- package/dist/icons/ChevronDown.svelte +3 -10
- package/dist/icons/ChevronDown.svelte.d.ts +0 -2
- package/dist/icons/GearTwo.svelte +16 -8
- package/dist/icons/GearTwo.svelte.d.ts +25 -6
- package/dist/icons/Logout.svelte +15 -3
- package/dist/icons/User.svelte +19 -10
- package/dist/icons/Window.svelte +2 -6
- package/dist/icons/Window.svelte.d.ts +24 -15
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/layouts/IMS/IMSLayout1/IMSLayout1.svelte +11 -4
- package/dist/layouts/IMS/IMSLayout1/components/ImsHeader.svelte +10 -13
- package/dist/layouts/IMS/IMSLayout1/components/ImsHeader.svelte.d.ts +4 -2
- package/dist/layouts/IMS/IMSLayout1/components/ImsSidebar.svelte +263 -132
- package/dist/layouts/IMS/IMSLayout1/components/ImsSidebar.svelte.d.ts +7 -2
- package/dist/layouts/IMS/IMSLayout1/types/IImsLayout.d.ts +25 -17
- package/dist/mocks/IMS/index.d.ts +16 -14
- package/dist/mocks/IMS/index.js +23 -33
- package/dist/types/Icon.d.ts +2 -0
- package/dist/types/Icon.js +1 -0
- package/package.json +1 -1
|
@@ -1,30 +1,101 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import './button.css';
|
|
3
|
+
import { Icon } from '../../index.js';
|
|
4
|
+
import type { TIconName } from '../../types/Icon.ts';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
size?: 'small' | 'medium' | 'large';
|
|
8
|
+
variant?: 'primary' | 'secondary' | 'outline';
|
|
9
|
+
label?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
backgroundColor?: string;
|
|
13
|
+
borderColor?: string;
|
|
14
|
+
textColor?: string;
|
|
15
|
+
iconLeft?: TIconName;
|
|
16
|
+
iconRight?: TIconName;
|
|
17
|
+
class?: string;
|
|
18
|
+
style?: string;
|
|
19
|
+
onclick?: () => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
size = 'medium',
|
|
24
|
+
variant = 'primary',
|
|
25
|
+
label = 'Button',
|
|
26
|
+
disabled = false,
|
|
27
|
+
isLoading = false,
|
|
28
|
+
backgroundColor = '',
|
|
29
|
+
borderColor = '',
|
|
30
|
+
textColor = '',
|
|
31
|
+
iconLeft,
|
|
32
|
+
iconRight,
|
|
33
|
+
class: className = '',
|
|
34
|
+
style: customStyle = '',
|
|
35
|
+
...props
|
|
36
|
+
}: Props = $props();
|
|
37
|
+
|
|
38
|
+
let mode = $derived(
|
|
39
|
+
variant === 'primary'
|
|
40
|
+
? 'storybook-button--primary'
|
|
41
|
+
: variant === 'secondary'
|
|
42
|
+
? 'storybook-button--secondary'
|
|
43
|
+
: 'storybook-button--outline'
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
// Ukuran icon berdasarkan size button
|
|
47
|
+
const iconSize = $derived(() => {
|
|
48
|
+
switch (size) {
|
|
49
|
+
case 'small':
|
|
50
|
+
return 16;
|
|
51
|
+
case 'large':
|
|
52
|
+
return 18;
|
|
53
|
+
default:
|
|
54
|
+
return 18;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// Gabungkan classes
|
|
59
|
+
const buttonClasses = $derived(() => {
|
|
60
|
+
const classes = ['storybook-button', `storybook-button--${size}`, mode];
|
|
61
|
+
if (isLoading) classes.push('storybook-button--loading');
|
|
62
|
+
if (className) classes.push(className);
|
|
63
|
+
return classes.filter(Boolean).join(' ');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// Gabungkan styles
|
|
67
|
+
const buttonStyles = $derived(() => {
|
|
68
|
+
const styles: string[] = [];
|
|
69
|
+
if (backgroundColor) styles.push(`--background-color: ${backgroundColor};`);
|
|
70
|
+
if (borderColor) styles.push(`--border-color: ${borderColor};`);
|
|
71
|
+
if (textColor) styles.push(`--text-color: ${textColor};`);
|
|
72
|
+
if (customStyle) styles.push(customStyle);
|
|
73
|
+
return styles.join(' ');
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Button disabled jika disabled atau loading
|
|
77
|
+
const isButtonDisabled = $derived(disabled || isLoading);
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<button
|
|
81
|
+
type="button"
|
|
82
|
+
disabled={isButtonDisabled}
|
|
83
|
+
class={buttonClasses()}
|
|
84
|
+
style={buttonStyles()}
|
|
85
|
+
{...props}
|
|
86
|
+
>
|
|
87
|
+
{#if isLoading}
|
|
88
|
+
<span class="storybook-button__spinner"></span>
|
|
89
|
+
{/if}
|
|
90
|
+
{#if iconLeft && !isLoading}
|
|
91
|
+
<span class="storybook-button__icon storybook-button__icon--left">
|
|
92
|
+
<Icon name={iconLeft} width={iconSize()} height={iconSize()} color="currentColor" />
|
|
93
|
+
</span>
|
|
94
|
+
{/if}
|
|
95
|
+
<span class="storybook-button__label">{label}</span>
|
|
96
|
+
{#if iconRight && !isLoading}
|
|
97
|
+
<span class="storybook-button__icon storybook-button__icon--right">
|
|
98
|
+
<Icon name={iconRight} width={iconSize()} height={iconSize()} color="currentColor" />
|
|
99
|
+
</span>
|
|
100
|
+
{/if}
|
|
101
|
+
</button>
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import './button.css';
|
|
2
|
+
import type { TIconName } from '../../types/Icon.ts';
|
|
2
3
|
interface Props {
|
|
3
|
-
/** Is this the principal call to action on the page? */
|
|
4
|
-
primary?: boolean;
|
|
5
|
-
/** What background color to use */
|
|
6
|
-
backgroundColor?: string;
|
|
7
|
-
/** How large should the button be? */
|
|
8
4
|
size?: 'small' | 'medium' | 'large';
|
|
9
|
-
|
|
10
|
-
label
|
|
11
|
-
|
|
5
|
+
variant?: 'primary' | 'secondary' | 'outline';
|
|
6
|
+
label?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
backgroundColor?: string;
|
|
10
|
+
borderColor?: string;
|
|
11
|
+
textColor?: string;
|
|
12
|
+
iconLeft?: TIconName;
|
|
13
|
+
iconRight?: TIconName;
|
|
14
|
+
class?: string;
|
|
15
|
+
style?: string;
|
|
12
16
|
onclick?: () => void;
|
|
13
17
|
}
|
|
14
18
|
declare const Button: import("svelte").Component<Props, {}, "">;
|
|
@@ -1,30 +1,116 @@
|
|
|
1
|
-
.storybook-button {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
.storybook-button--
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
.storybook-button {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
border: 0;
|
|
8
|
+
font-weight: 500;
|
|
9
|
+
line-height: 1;
|
|
10
|
+
font-family: 'Inter', sans-serif;
|
|
11
|
+
}
|
|
12
|
+
.storybook-button:hover {
|
|
13
|
+
opacity: 0.8;
|
|
14
|
+
}
|
|
15
|
+
.storybook-button:active {
|
|
16
|
+
opacity: 0.6;
|
|
17
|
+
}
|
|
18
|
+
.storybook-button--primary {
|
|
19
|
+
background-color: var(--background-color, #f79b09);
|
|
20
|
+
border: 1px solid var(--border-color, var(--background-color, #f79b09));
|
|
21
|
+
color: var(--text-color, white);
|
|
22
|
+
}
|
|
23
|
+
.storybook-button--primary:disabled {
|
|
24
|
+
background-color: #ced4da;
|
|
25
|
+
border: 1px solid #ced4da;
|
|
26
|
+
color: #3f4047;
|
|
27
|
+
cursor: not-allowed;
|
|
28
|
+
}
|
|
29
|
+
.storybook-button--secondary {
|
|
30
|
+
border: 1px solid #ced4da;
|
|
31
|
+
background-color: transparent;
|
|
32
|
+
color: var(--text-color, #3f4047);
|
|
33
|
+
}
|
|
34
|
+
.storybook-button--secondary:disabled {
|
|
35
|
+
border: 1px solid #a3a6b7;
|
|
36
|
+
color: #a3a6b7;
|
|
37
|
+
cursor: not-allowed;
|
|
38
|
+
}
|
|
39
|
+
.storybook-button--outline {
|
|
40
|
+
border: 1px solid var(--border-color, #f79b09);
|
|
41
|
+
background-color: transparent;
|
|
42
|
+
color: var(--text-color, #f79b09);
|
|
43
|
+
}
|
|
44
|
+
.storybook-button--outline:disabled {
|
|
45
|
+
border: 1px solid #a3a6b7;
|
|
46
|
+
color: #a3a6b7;
|
|
47
|
+
cursor: not-allowed;
|
|
48
|
+
}
|
|
49
|
+
.storybook-button--small {
|
|
50
|
+
padding: 6px 12px;
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
border-radius: 6px;
|
|
53
|
+
}
|
|
54
|
+
.storybook-button--medium {
|
|
55
|
+
padding: 8px 16px;
|
|
56
|
+
font-size: 16px;
|
|
57
|
+
border-radius: 8px;
|
|
58
|
+
}
|
|
59
|
+
.storybook-button--large {
|
|
60
|
+
padding: 10px 24px;
|
|
61
|
+
font-size: 18px;
|
|
62
|
+
border-radius: 8px;
|
|
63
|
+
}
|
|
64
|
+
.storybook-button--disabled {
|
|
65
|
+
background-color: #ced4da;
|
|
66
|
+
cursor: not-allowed;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.storybook-button__icon {
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.storybook-button__label {
|
|
77
|
+
display: inline-block;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.storybook-button--loading {
|
|
81
|
+
cursor: wait;
|
|
82
|
+
position: relative;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.storybook-button--loading .storybook-button__label {
|
|
86
|
+
opacity: 0.7;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.storybook-button__spinner {
|
|
90
|
+
display: inline-block;
|
|
91
|
+
width: 14px;
|
|
92
|
+
height: 14px;
|
|
93
|
+
border: 2px solid currentColor;
|
|
94
|
+
border-right-color: transparent;
|
|
95
|
+
border-radius: 50%;
|
|
96
|
+
animation: storybook-button-spin 0.6s linear infinite;
|
|
97
|
+
flex-shrink: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@keyframes storybook-button-spin {
|
|
101
|
+
to {
|
|
102
|
+
transform: rotate(360deg);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.storybook-button--small .storybook-button__spinner {
|
|
107
|
+
width: 12px;
|
|
108
|
+
height: 12px;
|
|
109
|
+
border-width: 1.5px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.storybook-button--large .storybook-button__spinner {
|
|
113
|
+
width: 16px;
|
|
114
|
+
height: 16px;
|
|
115
|
+
border-width: 2.5px;
|
|
116
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Button from '../Button/Button.svelte';
|
|
3
|
-
import './header.css';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
user?: { name: string };
|
|
7
|
-
onLogin?: () => void;
|
|
8
|
-
onLogout?: () => void;
|
|
9
|
-
onCreateAccount?: () => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const { user, onLogin, onLogout, onCreateAccount }: Props = $props();
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<header>
|
|
16
|
-
<div class="storybook-header">
|
|
17
|
-
<div>
|
|
18
|
-
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
19
|
-
<g fill="none" fill-rule="evenodd">
|
|
20
|
-
<path
|
|
21
|
-
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
|
|
22
|
-
fill="#FFF"
|
|
23
|
-
/>
|
|
24
|
-
<path
|
|
25
|
-
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
|
|
26
|
-
fill="#555AB9"
|
|
27
|
-
/>
|
|
28
|
-
<path d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z" fill="#91BAF8" />
|
|
29
|
-
</g>
|
|
30
|
-
</svg>
|
|
31
|
-
<h1>Acme</h1>
|
|
32
|
-
</div>
|
|
33
|
-
<div>
|
|
34
|
-
{#if user}
|
|
35
|
-
<span class="welcome">
|
|
36
|
-
Welcome, <b>{user.name}</b>!
|
|
37
|
-
</span>
|
|
38
|
-
<Button size="small" onclick={onLogout} label="Log out" />
|
|
39
|
-
{:else}
|
|
40
|
-
<Button size="small" onclick={onLogin} label="Log in" />
|
|
41
|
-
<Button primary size="small" onclick={onCreateAccount} label="Sign up" />
|
|
42
|
-
{/if}
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</header>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button from '../Button/Button.svelte';
|
|
3
|
+
import './header.css';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
user?: { name: string };
|
|
7
|
+
onLogin?: () => void;
|
|
8
|
+
onLogout?: () => void;
|
|
9
|
+
onCreateAccount?: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { user, onLogin, onLogout, onCreateAccount }: Props = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<header>
|
|
16
|
+
<div class="storybook-header">
|
|
17
|
+
<div>
|
|
18
|
+
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
19
|
+
<g fill="none" fill-rule="evenodd">
|
|
20
|
+
<path
|
|
21
|
+
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
|
|
22
|
+
fill="#FFF"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
|
|
26
|
+
fill="#555AB9"
|
|
27
|
+
/>
|
|
28
|
+
<path d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z" fill="#91BAF8" />
|
|
29
|
+
</g>
|
|
30
|
+
</svg>
|
|
31
|
+
<h1>Acme</h1>
|
|
32
|
+
</div>
|
|
33
|
+
<div>
|
|
34
|
+
{#if user}
|
|
35
|
+
<span class="welcome">
|
|
36
|
+
Welcome, <b>{user.name}</b>!
|
|
37
|
+
</span>
|
|
38
|
+
<Button size="small" onclick={onLogout} label="Log out" />
|
|
39
|
+
{:else}
|
|
40
|
+
<Button size="small" onclick={onLogin} label="Log in" />
|
|
41
|
+
<Button primary size="small" onclick={onCreateAccount} label="Sign up" />
|
|
42
|
+
{/if}
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</header>
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
.storybook-header {
|
|
2
|
-
display: flex;
|
|
3
|
-
justify-content: space-between;
|
|
4
|
-
align-items: center;
|
|
5
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
6
|
-
padding: 15px 20px;
|
|
7
|
-
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.storybook-header svg {
|
|
11
|
-
display: inline-block;
|
|
12
|
-
vertical-align: top;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.storybook-header h1 {
|
|
16
|
-
display: inline-block;
|
|
17
|
-
vertical-align: top;
|
|
18
|
-
margin: 6px 0 6px 10px;
|
|
19
|
-
font-weight: 700;
|
|
20
|
-
font-size: 20px;
|
|
21
|
-
line-height: 1;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.storybook-header button + button {
|
|
25
|
-
margin-left: 10px;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.storybook-header .welcome {
|
|
29
|
-
margin-right: 10px;
|
|
30
|
-
color: #333;
|
|
31
|
-
font-size: 14px;
|
|
32
|
-
}
|
|
1
|
+
.storybook-header {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
align-items: center;
|
|
5
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
6
|
+
padding: 15px 20px;
|
|
7
|
+
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.storybook-header svg {
|
|
11
|
+
display: inline-block;
|
|
12
|
+
vertical-align: top;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.storybook-header h1 {
|
|
16
|
+
display: inline-block;
|
|
17
|
+
vertical-align: top;
|
|
18
|
+
margin: 6px 0 6px 10px;
|
|
19
|
+
font-weight: 700;
|
|
20
|
+
font-size: 20px;
|
|
21
|
+
line-height: 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.storybook-header button + button {
|
|
25
|
+
margin-left: 10px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.storybook-header .welcome {
|
|
29
|
+
margin-right: 10px;
|
|
30
|
+
color: #333;
|
|
31
|
+
font-size: 14px;
|
|
32
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ChevronDown from '../../icons/ChevronDown.svelte';
|
|
3
|
+
import GearTwo from '../../icons/GearTwo.svelte';
|
|
4
|
+
import Logout from '../../icons/Logout.svelte';
|
|
5
|
+
import User from '../../icons/User.svelte';
|
|
6
|
+
import Window from '../../icons/Window.svelte';
|
|
7
|
+
import type { TIconName } from '../../types/Icon.ts';
|
|
8
|
+
|
|
9
|
+
interface IconProps {
|
|
10
|
+
name: TIconName;
|
|
11
|
+
width?: number | string;
|
|
12
|
+
height?: number | string;
|
|
13
|
+
color?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const { name, width, height, color }: IconProps = $props();
|
|
17
|
+
|
|
18
|
+
const iconMap = {
|
|
19
|
+
ChevronDown,
|
|
20
|
+
GearTwo,
|
|
21
|
+
Logout,
|
|
22
|
+
User,
|
|
23
|
+
Window
|
|
24
|
+
} as const;
|
|
25
|
+
|
|
26
|
+
const IconComponent = $derived(iconMap[name as keyof typeof iconMap]);
|
|
27
|
+
|
|
28
|
+
const iconStyle = $derived(() => {
|
|
29
|
+
const styles: string[] = [];
|
|
30
|
+
if (width !== undefined)
|
|
31
|
+
styles.push(`width: ${typeof width === 'number' ? width + 'px' : width}`);
|
|
32
|
+
if (height !== undefined)
|
|
33
|
+
styles.push(`height: ${typeof height === 'number' ? height + 'px' : height}`);
|
|
34
|
+
if (color !== undefined) styles.push(`color: ${color}`);
|
|
35
|
+
|
|
36
|
+
return styles.join('; ');
|
|
37
|
+
});
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
{#if IconComponent}
|
|
41
|
+
{@const Component = IconComponent as any}
|
|
42
|
+
<div class="icon-wrapper" style={iconStyle()}>
|
|
43
|
+
<Component />
|
|
44
|
+
</div>
|
|
45
|
+
{:else}
|
|
46
|
+
<span class="icon-error">Icon "{name}" tidak ditemukan</span>
|
|
47
|
+
{/if}
|
|
48
|
+
|
|
49
|
+
<style>
|
|
50
|
+
.icon-wrapper {
|
|
51
|
+
display: inline-flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.icon-wrapper :global(svg) {
|
|
57
|
+
width: inherit;
|
|
58
|
+
height: inherit;
|
|
59
|
+
color: inherit;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.icon-wrapper :global(path),
|
|
63
|
+
.icon-wrapper :global(g path) {
|
|
64
|
+
fill: currentColor !important;
|
|
65
|
+
stroke: currentColor !important;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.icon-error {
|
|
69
|
+
color: red;
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TIconName } from '../../types/Icon.ts';
|
|
2
|
+
interface IconProps {
|
|
3
|
+
name: TIconName;
|
|
4
|
+
width?: number | string;
|
|
5
|
+
height?: number | string;
|
|
6
|
+
color?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Icon: import("svelte").Component<IconProps, {}, "">;
|
|
9
|
+
type Icon = ReturnType<typeof Icon>;
|
|
10
|
+
export default Icon;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
1
|
<script lang="ts">
|
|
3
2
|
type PresetDirection = 'down' | 'up' | 'left' | 'right';
|
|
4
3
|
|
|
5
|
-
const {
|
|
6
|
-
width = 12,
|
|
7
|
-
height = 8,
|
|
8
|
-
direction = 'down'
|
|
9
|
-
} = $props<{
|
|
10
|
-
width?: number | string;
|
|
11
|
-
height?: number | string;
|
|
4
|
+
const { direction = 'down' } = $props<{
|
|
12
5
|
direction?: PresetDirection | number | string;
|
|
13
6
|
}>();
|
|
14
7
|
|
|
@@ -44,8 +37,8 @@
|
|
|
44
37
|
|
|
45
38
|
<svg
|
|
46
39
|
xmlns="http://www.w3.org/2000/svg"
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
width="12"
|
|
41
|
+
height="8"
|
|
49
42
|
viewBox="0 0 12 8"
|
|
50
43
|
fill="currentColor"
|
|
51
44
|
style={`transform: ${transform}; transform-origin: center; transition: transform 0.2s ease;`}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
type PresetDirection = 'down' | 'up' | 'left' | 'right';
|
|
2
2
|
type $$ComponentProps = {
|
|
3
|
-
width?: number | string;
|
|
4
|
-
height?: number | string;
|
|
5
3
|
direction?: PresetDirection | number | string;
|
|
6
4
|
};
|
|
7
5
|
declare const ChevronDown: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<svg
|
|
2
|
+
width="16"
|
|
3
|
+
height="17"
|
|
4
|
+
viewBox="0 0 16 17"
|
|
5
|
+
fill="currentColor"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
>
|
|
6
8
|
<g clip-path="url(#clip0_6267_47931)">
|
|
7
|
-
<rect
|
|
9
|
+
<rect
|
|
10
|
+
width="16"
|
|
11
|
+
height="16"
|
|
12
|
+
transform="translate(0 0.5)"
|
|
13
|
+
fill="currentColor"
|
|
14
|
+
fill-opacity="0.01"
|
|
15
|
+
/>
|
|
8
16
|
<path
|
|
9
17
|
d="M11.4194 1.5C11.5956 1.50006 11.7689 1.54723 11.9213 1.63574C12.0736 1.7242 12.2001 1.85099 12.2875 2.00391L15.7162 8.00391C15.8025 8.15491 15.848 8.3261 15.8481 8.5C15.8481 8.67397 15.8025 8.84503 15.7162 8.99609L12.2875 14.9961C12.2001 15.1491 12.0738 15.2767 11.9213 15.3652C11.7689 15.4537 11.5956 15.4999 11.4194 15.5H4.57953C4.40331 15.4999 4.22997 15.4537 4.07758 15.3652C3.92519 15.2767 3.79877 15.1491 3.71136 14.9961L0.28363 8.99609C0.197374 8.84505 0.151794 8.67394 0.151794 8.5C0.15183 8.3261 0.197373 8.15491 0.28363 8.00391L3.71136 2.00391C3.79872 1.85101 3.92533 1.72422 4.07758 1.63574C4.22997 1.54725 4.40331 1.50008 4.57953 1.5H11.4194ZM4.57953 2.5L1.15179 8.5L4.57953 14.5H11.4194L14.8481 8.5L11.4194 2.5H4.57953ZM7.6264 5.07422C8.08711 5.01559 8.55481 5.04987 9.00238 5.17383C9.45007 5.29785 9.86888 5.50944 10.2338 5.79688C10.5988 6.0844 10.9029 6.44234 11.1284 6.84863C11.5851 7.65204 11.7055 8.60324 11.4633 9.49512C11.2212 10.387 10.6367 11.1473 9.83636 11.6094C9.03607 12.0714 8.08526 12.198 7.19183 11.9619C6.29844 11.7257 5.53526 11.1458 5.06781 10.3486C4.82861 9.95028 4.67052 9.50771 4.60394 9.04785C4.5374 8.58808 4.56376 8.11968 4.68011 7.66992C4.7965 7.22008 5.0014 6.7976 5.28265 6.42773C5.56383 6.05806 5.91561 5.74791 6.31781 5.51562C6.72019 5.28326 7.16547 5.13294 7.6264 5.07422ZM8.73871 6.19336C8.10166 6.02041 7.42195 6.10738 6.84808 6.43359C6.56147 6.59655 6.30985 6.81463 6.10785 7.0752C5.90593 7.33569 5.75673 7.63311 5.67035 7.95117C5.58397 8.26934 5.56145 8.60178 5.60394 8.92871C5.64644 9.25566 5.75354 9.57092 5.9184 9.85645C6.08325 10.142 6.30298 10.3925 6.56488 10.5928C6.82672 10.7929 7.12613 10.9392 7.44476 11.0234C7.76338 11.1076 8.09579 11.1277 8.4223 11.083C8.74882 11.0383 9.06377 10.9304 9.34808 10.7637C9.91754 10.4298 10.3317 9.88331 10.5004 9.24512C10.669 8.60701 10.5785 7.92804 10.2485 7.35645C9.91843 6.7848 9.37571 6.36637 8.73871 6.19336Z"
|
|
10
|
-
fill=
|
|
18
|
+
fill="currentColor"
|
|
11
19
|
/>
|
|
12
20
|
</g>
|
|
13
21
|
<defs>
|
|
14
22
|
<clipPath id="clip0_6267_47931">
|
|
15
|
-
<rect width="16" height="16" fill="
|
|
23
|
+
<rect width="16" height="16" fill="currentColor" transform="translate(0 0.5)" />
|
|
16
24
|
</clipPath>
|
|
17
25
|
</defs>
|
|
18
26
|
</svg>
|
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
declare const GearTwo: import("svelte").Component<{
|
|
2
|
-
width?: number;
|
|
3
|
-
height?: number;
|
|
4
|
-
color?: string;
|
|
5
|
-
}, {}, "">;
|
|
6
|
-
type GearTwo = ReturnType<typeof GearTwo>;
|
|
7
1
|
export default GearTwo;
|
|
2
|
+
type GearTwo = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const GearTwo: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
package/dist/icons/Logout.svelte
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<svg
|
|
2
|
+
width="16"
|
|
3
|
+
height="16"
|
|
4
|
+
viewBox="0 0 16 16"
|
|
5
|
+
fill="currentColor"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
>
|
|
8
|
+
<path
|
|
9
|
+
d="M6 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V3.33333C2 2.97971 2.14048 2.64057 2.39052 2.39052C2.64057 2.14048 2.97971 2 3.33333 2H6M10.6667 11.3333L14 8M14 8L10.6667 4.66667M14 8H6"
|
|
10
|
+
stroke="currentColor"
|
|
11
|
+
stroke-width="1.5"
|
|
12
|
+
stroke-linecap="round"
|
|
13
|
+
stroke-linejoin="round"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|