@softwareone/spi-sv5-library 0.1.3 → 1.1.0
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/README.md +75 -19
- package/dist/Avatar/Avatar.svelte +33 -0
- package/dist/Avatar/Avatar.svelte.d.ts +10 -0
- package/dist/Breadcrumbs/Breadcrumbs.svelte +10 -20
- package/dist/Button/Button.svelte +66 -115
- package/dist/Button/Button.svelte.d.ts +8 -6
- package/dist/Card/Card.svelte +18 -44
- package/dist/Card/Card.svelte.d.ts +1 -1
- package/dist/Chips/Chips.svelte +40 -46
- package/dist/Chips/Chips.svelte.d.ts +2 -1
- package/dist/Chips/chipsState.svelte.d.ts +7 -0
- package/dist/Chips/chipsState.svelte.js +8 -0
- package/dist/ErrorPage/ErrorPage.svelte +96 -0
- package/dist/ErrorPage/ErrorPage.svelte.d.ts +7 -0
- package/dist/Footer/Footer.svelte +29 -135
- package/dist/Footer/Footer.svelte.d.ts +1 -1
- package/dist/Form/Input/Input.svelte +393 -0
- package/dist/Form/Input/Input.svelte.d.ts +14 -0
- package/dist/Form/Input/InputIcon.svelte +97 -0
- package/dist/Form/Input/InputIcon.svelte.d.ts +9 -0
- package/dist/Form/TextArea/TextArea.svelte +260 -0
- package/dist/Form/TextArea/TextArea.svelte.d.ts +13 -0
- package/dist/Form/Toggle/Toggle.svelte +120 -0
- package/dist/{Toggle → Form/Toggle}/Toggle.svelte.d.ts +4 -3
- package/dist/Header/Header.svelte +54 -136
- package/dist/Header/Header.svelte.d.ts +2 -2
- package/dist/Header/HeaderAccount.svelte +14 -35
- package/dist/Header/HeaderLoader.svelte +2 -2
- package/dist/Header/HeaderLogo.svelte +7 -4
- package/dist/Header/HeaderLogo.svelte.d.ts +14 -6
- package/dist/HighlightPanel/HighlightPanel.svelte +125 -0
- package/dist/HighlightPanel/HighlightPanel.svelte.d.ts +10 -0
- package/dist/HighlightPanel/highlightPanelState.svelte.d.ts +35 -0
- package/dist/HighlightPanel/highlightPanelState.svelte.js +13 -0
- package/dist/Menu/Menu.svelte +158 -0
- package/dist/Menu/Menu.svelte.d.ts +8 -0
- package/dist/Menu/MenuItem.svelte +149 -0
- package/dist/Menu/MenuItem.svelte.d.ts +11 -0
- package/dist/Menu/Sidebar.svelte +228 -0
- package/dist/Menu/Sidebar.svelte.d.ts +11 -0
- package/dist/Menu/SidebarState.svelte.d.ts +6 -0
- package/dist/Menu/SidebarState.svelte.js +1 -0
- package/dist/Modal/Modal.svelte +81 -29
- package/dist/Modal/Modal.svelte.d.ts +2 -9
- package/dist/Modal/ModalContent.svelte +8 -88
- package/dist/Modal/ModalContent.svelte.d.ts +2 -3
- package/dist/Modal/ModalFooter.svelte +21 -66
- package/dist/Modal/ModalFooter.svelte.d.ts +5 -5
- package/dist/Modal/ModalHeader.svelte +50 -34
- package/dist/Modal/ModalHeader.svelte.d.ts +5 -4
- package/dist/Modal/modalState.svelte.d.ts +15 -0
- package/dist/Modal/modalState.svelte.js +1 -0
- package/dist/ProgressWizard/ProgressWizard.svelte +273 -294
- package/dist/ProgressWizard/ProgressWizard.svelte.d.ts +11 -13
- package/dist/ProgressWizard/progressWizardState.svelte.d.ts +6 -0
- package/dist/ProgressWizard/progressWizardState.svelte.js +1 -0
- package/dist/Search/Search.svelte +154 -0
- package/dist/Search/Search.svelte.d.ts +10 -0
- package/dist/Tabs/Tabs.svelte +111 -0
- package/dist/Tabs/Tabs.svelte.d.ts +8 -0
- package/dist/Tabs/tabsState.svelte.d.ts +7 -0
- package/dist/Tabs/tabsState.svelte.js +1 -0
- package/dist/Toast/Toast.svelte +116 -49
- package/dist/Toast/toastState.svelte.d.ts +7 -3
- package/dist/Toast/toastState.svelte.js +13 -10
- package/dist/Tooltip/Tooltip.svelte +168 -0
- package/dist/Tooltip/Tooltip.svelte.d.ts +13 -0
- package/dist/assets/icons/feedback.svg +5 -0
- package/dist/index.d.ts +28 -8
- package/dist/index.js +24 -9
- package/package.json +4 -5
- package/dist/Toggle/Toggle.svelte +0 -170
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { fade } from 'svelte/transition';
|
|
3
|
+
import type { MenuItem } from './SidebarState.svelte';
|
|
4
|
+
import MenuItemSidebar from './MenuItem.svelte';
|
|
5
|
+
|
|
6
|
+
interface sidebarProps {
|
|
7
|
+
categoryTitle: string;
|
|
8
|
+
menuItems: MenuItem[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { sidebarItems }: { sidebarItems: sidebarProps[] } = $props();
|
|
12
|
+
let isCollapsed: boolean = $state(false);
|
|
13
|
+
let selectedItem: MenuItem | null = $state(null);
|
|
14
|
+
|
|
15
|
+
const toggleSidebar = () => {
|
|
16
|
+
isCollapsed = !isCollapsed;
|
|
17
|
+
};
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<aside
|
|
21
|
+
class={['side-menu', isCollapsed ? 'collapsed' : 'expanded']}
|
|
22
|
+
transition:fade|global={{ delay: 50, duration: 200 }}
|
|
23
|
+
>
|
|
24
|
+
<section class="menu-content">
|
|
25
|
+
<header class="header">
|
|
26
|
+
<section class="menu-header">
|
|
27
|
+
<div class="menu-title" class:hidden={isCollapsed}>
|
|
28
|
+
<div class="menu">
|
|
29
|
+
<h2 class="menu-span">Menu</h2>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="category-items">
|
|
33
|
+
<button class="button" onclick={toggleSidebar}>
|
|
34
|
+
<span class="material-icons-outlined icon-span">
|
|
35
|
+
{isCollapsed ? 'menu' : 'menu_open'}
|
|
36
|
+
</span>
|
|
37
|
+
</button>
|
|
38
|
+
</div>
|
|
39
|
+
</section>
|
|
40
|
+
</header>
|
|
41
|
+
|
|
42
|
+
<section class="content">
|
|
43
|
+
{#if sidebarItems.length > 0}
|
|
44
|
+
{#each sidebarItems as element}
|
|
45
|
+
<section class="category-content">
|
|
46
|
+
<h2 class="category-span" class:hidden={isCollapsed}>{element.categoryTitle}</h2>
|
|
47
|
+
<menu class="category-items-details">
|
|
48
|
+
{#if element.menuItems}
|
|
49
|
+
{#each element.menuItems as menuItem}
|
|
50
|
+
<MenuItemSidebar
|
|
51
|
+
item={menuItem}
|
|
52
|
+
{isCollapsed}
|
|
53
|
+
activeItem={selectedItem?.text === menuItem.text}
|
|
54
|
+
onClick={() => (selectedItem = menuItem)}
|
|
55
|
+
/>
|
|
56
|
+
{/each}
|
|
57
|
+
{/if}
|
|
58
|
+
</menu>
|
|
59
|
+
</section>
|
|
60
|
+
{/each}
|
|
61
|
+
{/if}
|
|
62
|
+
</section>
|
|
63
|
+
</section>
|
|
64
|
+
</aside>
|
|
65
|
+
|
|
66
|
+
<style>
|
|
67
|
+
.side-menu {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
transition: width 0.3s ease;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.menu-content {
|
|
73
|
+
width: 100%;
|
|
74
|
+
height: 100%;
|
|
75
|
+
padding: 16px;
|
|
76
|
+
background: white;
|
|
77
|
+
border-right: 1px #e0e5e8 solid;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
justify-content: flex-start;
|
|
80
|
+
align-items: center;
|
|
81
|
+
gap: 32px;
|
|
82
|
+
display: flex;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.header {
|
|
86
|
+
align-self: stretch;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
gap: 16px;
|
|
89
|
+
display: flex;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.menu-header {
|
|
93
|
+
padding-bottom: 8px;
|
|
94
|
+
border-bottom: 1px #e0e5e8 solid;
|
|
95
|
+
gap: 10px;
|
|
96
|
+
display: inline-flex;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.menu-title {
|
|
100
|
+
flex: 1 1 0;
|
|
101
|
+
padding-top: 8px;
|
|
102
|
+
padding-bottom: 8px;
|
|
103
|
+
display: flex;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.menu {
|
|
107
|
+
justify-content: center;
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.menu-span {
|
|
113
|
+
color: black;
|
|
114
|
+
font-size: 14px;
|
|
115
|
+
font-weight: 600;
|
|
116
|
+
line-height: 20px;
|
|
117
|
+
word-wrap: break-word;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.category-items {
|
|
121
|
+
padding: 8px;
|
|
122
|
+
gap: 8px;
|
|
123
|
+
display: flex;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.content {
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
gap: 24px;
|
|
129
|
+
display: flex;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.category-content {
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
gap: 8px;
|
|
135
|
+
display: flex;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.category-span {
|
|
139
|
+
color: #6b7180;
|
|
140
|
+
font-size: 12px;
|
|
141
|
+
font-weight: 400;
|
|
142
|
+
word-wrap: break-word;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.category-items-details {
|
|
146
|
+
flex-direction: column;
|
|
147
|
+
justify-content: flex-start;
|
|
148
|
+
align-items: flex-start;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
button:focus-visible {
|
|
152
|
+
box-shadow: 0 0 0 2px #472aff;
|
|
153
|
+
background-color: #eaecff;
|
|
154
|
+
outline: none;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.icon-span {
|
|
158
|
+
color: #25282d;
|
|
159
|
+
font-size: 20px;
|
|
160
|
+
font-weight: 400;
|
|
161
|
+
line-height: 20px;
|
|
162
|
+
word-wrap: break-word;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.expanded {
|
|
166
|
+
width: 220px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.collapsed {
|
|
170
|
+
width: 68px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.hidden {
|
|
174
|
+
display: none;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.collapsed .header {
|
|
178
|
+
align-items: center;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.collapsed .menu-content {
|
|
182
|
+
padding: 8px;
|
|
183
|
+
}
|
|
184
|
+
.collapsed .content {
|
|
185
|
+
padding: 8px;
|
|
186
|
+
}
|
|
187
|
+
.collapsed .menu-header {
|
|
188
|
+
align-items: center;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.collapsed .menu-header {
|
|
192
|
+
justify-content: flex-start;
|
|
193
|
+
align-items: center;
|
|
194
|
+
padding: 8px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.button {
|
|
198
|
+
background: transparent;
|
|
199
|
+
border: none;
|
|
200
|
+
cursor: pointer;
|
|
201
|
+
border-radius: 50%;
|
|
202
|
+
width: 36px;
|
|
203
|
+
height: 36px;
|
|
204
|
+
display: flex;
|
|
205
|
+
align-items: center;
|
|
206
|
+
justify-content: center;
|
|
207
|
+
transition: background-color 0.2s ease;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.button:hover {
|
|
211
|
+
background-color: #f4f6f8;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@media (max-width: 768px) {
|
|
215
|
+
.side-menu {
|
|
216
|
+
width: 68px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.header {
|
|
220
|
+
align-items: center;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.menu-title,
|
|
224
|
+
.category-span {
|
|
225
|
+
display: none;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MenuItem } from './SidebarState.svelte';
|
|
2
|
+
interface sidebarProps {
|
|
3
|
+
categoryTitle: string;
|
|
4
|
+
menuItems: MenuItem[];
|
|
5
|
+
}
|
|
6
|
+
type $$ComponentProps = {
|
|
7
|
+
sidebarItems: sidebarProps[];
|
|
8
|
+
};
|
|
9
|
+
declare const Sidebar: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type Sidebar = ReturnType<typeof Sidebar>;
|
|
11
|
+
export default Sidebar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/Modal/Modal.svelte
CHANGED
|
@@ -1,46 +1,98 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { scale } from 'svelte/transition';
|
|
3
|
+
|
|
2
4
|
import ModalContent from './ModalContent.svelte';
|
|
3
5
|
import ModalFooter from './ModalFooter.svelte';
|
|
4
6
|
import ModalHeader from './ModalHeader.svelte';
|
|
5
|
-
|
|
6
|
-
interface ModalProps {
|
|
7
|
-
headerTitle?: string;
|
|
8
|
-
contentTitle?: string;
|
|
9
|
-
contentMessage?: string;
|
|
10
|
-
contentCodeMessage?: string;
|
|
11
|
-
cancelButton?: () => void;
|
|
12
|
-
okButton?: () => void;
|
|
13
|
-
}
|
|
7
|
+
import type { ModalProps } from './modalState.svelte.js';
|
|
14
8
|
|
|
15
9
|
let {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
showModal = $bindable(false),
|
|
11
|
+
title,
|
|
12
|
+
width = 'md',
|
|
13
|
+
errorIcon,
|
|
14
|
+
onclose = () => {},
|
|
15
|
+
children,
|
|
16
|
+
footer
|
|
22
17
|
}: ModalProps = $props();
|
|
18
|
+
|
|
19
|
+
let dialog = $state<HTMLDialogElement>();
|
|
20
|
+
|
|
21
|
+
$effect(() => {
|
|
22
|
+
showModal ? dialog?.showModal() : dialog?.close();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const onHandleClose = () => {
|
|
26
|
+
showModal = false;
|
|
27
|
+
onclose();
|
|
28
|
+
};
|
|
23
29
|
</script>
|
|
24
30
|
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
<dialog
|
|
32
|
+
bind:this={dialog}
|
|
33
|
+
onclose={onHandleClose}
|
|
34
|
+
class="modal {width}"
|
|
35
|
+
transition:scale={{
|
|
36
|
+
duration: 150,
|
|
37
|
+
start: 0.95
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<ModalHeader {title} {errorIcon} onclose={onHandleClose} />
|
|
41
|
+
<ModalContent content={children} />
|
|
42
|
+
<ModalFooter {footer} onclose={onHandleClose} />
|
|
43
|
+
</dialog>
|
|
30
44
|
|
|
31
45
|
<style>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
border-radius: var(--Card-radius, 16px);
|
|
39
|
-
background: var(--brand-white, #fff);
|
|
40
|
-
/* shadow/card-hover */
|
|
46
|
+
dialog {
|
|
47
|
+
align-self: center;
|
|
48
|
+
border-radius: 16px;
|
|
49
|
+
background-color: #ffffff;
|
|
50
|
+
border: none;
|
|
51
|
+
margin: auto;
|
|
41
52
|
box-shadow:
|
|
42
53
|
0px 1px 10px 0px rgba(51, 56, 64, 0.12),
|
|
43
54
|
0px 2px 4px -1px rgba(51, 56, 64, 0.2),
|
|
44
55
|
0px 4px 5px 0px rgba(51, 56, 64, 0.14);
|
|
45
56
|
}
|
|
57
|
+
|
|
58
|
+
dialog:focus-visible {
|
|
59
|
+
outline: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
dialog::backdrop {
|
|
63
|
+
background: #e0e5e880;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
dialog::-webkit-scrollbar {
|
|
67
|
+
width: 10px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
dialog::-webkit-scrollbar-thumb {
|
|
71
|
+
background: #888;
|
|
72
|
+
border-radius: 10px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
dialog::-webkit-scrollbar-thumb:hover {
|
|
76
|
+
background: #555;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.modal {
|
|
80
|
+
width: var(--modal-width);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.modal.md {
|
|
84
|
+
--modal-width: 600px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.modal.lg {
|
|
88
|
+
--modal-width: 800px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.modal.xl {
|
|
92
|
+
--modal-width: 1000px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:global(html:has(dialog.modal[open])) {
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
}
|
|
46
98
|
</style>
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
contentTitle?: string;
|
|
4
|
-
contentMessage?: string;
|
|
5
|
-
contentCodeMessage?: string;
|
|
6
|
-
cancelButton?: () => void;
|
|
7
|
-
okButton?: () => void;
|
|
8
|
-
}
|
|
9
|
-
declare const Modal: import("svelte").Component<ModalProps, {}, "">;
|
|
1
|
+
import type { ModalProps } from './modalState.svelte.js';
|
|
2
|
+
declare const Modal: import("svelte").Component<ModalProps, {}, "showModal">;
|
|
10
3
|
type Modal = ReturnType<typeof Modal>;
|
|
11
4
|
export default Modal;
|
|
@@ -1,106 +1,26 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
3
|
|
|
4
4
|
interface ModalContentProps {
|
|
5
|
-
|
|
6
|
-
contentMessage?: string;
|
|
7
|
-
contentCodeMessage?: string;
|
|
5
|
+
content?: Snippet;
|
|
8
6
|
}
|
|
9
7
|
|
|
10
|
-
let {
|
|
11
|
-
|
|
12
|
-
let copyCodeContent = $state(contentCodeMessage);
|
|
13
|
-
let copyCodeState = $state(false);
|
|
14
|
-
|
|
15
|
-
function copyCode() {
|
|
16
|
-
navigator.clipboard.writeText(copyCodeContent);
|
|
17
|
-
copyCodeState = true;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
contentTitle = contentTitle || 'Error title';
|
|
21
|
-
contentMessage =
|
|
22
|
-
contentMessage ||
|
|
23
|
-
'The text displayed here serves as a placeholder for the error modal content.';
|
|
24
|
-
contentCodeMessage =
|
|
25
|
-
contentCodeMessage ||
|
|
26
|
-
`Placeholder error code:# Handle specific error: invalid value error_message = f"Error: Invalid value - {ve}" return {'error': error_message, 'error_code': 400}`;
|
|
8
|
+
let { content }: ModalContentProps = $props();
|
|
27
9
|
</script>
|
|
28
10
|
|
|
29
11
|
<div class="modal-content">
|
|
30
|
-
|
|
31
|
-
<div class="modal-content-message">{contentMessage}</div>
|
|
32
|
-
<div class="modal-content-code-content">
|
|
33
|
-
<div class="modal-content-code-content-message">
|
|
34
|
-
{contentCodeMessage}
|
|
35
|
-
</div>
|
|
36
|
-
{#if copyCodeState === false}
|
|
37
|
-
<button class="modal-content-code-content-vector" aria-label="copy" onclick={copyCode}>
|
|
38
|
-
<Copy size="20"/>
|
|
39
|
-
</button>
|
|
40
|
-
{:else}
|
|
41
|
-
<Check size="20" color="#472aff" />
|
|
42
|
-
{/if}
|
|
43
|
-
</div>
|
|
12
|
+
{@render content?.()}
|
|
44
13
|
</div>
|
|
45
14
|
|
|
46
15
|
<style>
|
|
47
16
|
.modal-content {
|
|
48
17
|
display: flex;
|
|
49
|
-
padding:
|
|
18
|
+
padding: 24px;
|
|
50
19
|
flex-direction: column;
|
|
51
20
|
align-items: flex-start;
|
|
52
|
-
gap:
|
|
53
|
-
align-self: stretch;
|
|
54
|
-
background: var(--brand-white, #fff);
|
|
55
|
-
border-top: 1px solid var(--gray-3, #aeb1b9);
|
|
56
|
-
}
|
|
57
|
-
.modal-content-title {
|
|
58
|
-
align-self: stretch;
|
|
59
|
-
color: var(--brand-type, #000);
|
|
60
|
-
/* bold/2 */
|
|
61
|
-
font-family: 'Haas Grotesk Display Pro', sans-serif;
|
|
62
|
-
font-size: 14px;
|
|
63
|
-
font-style: normal;
|
|
64
|
-
font-weight: 600; /* changed from 700 to 600 since we use Haas Grotesk Display Pro */
|
|
65
|
-
line-height: 20px; /* 142.857% */
|
|
66
|
-
}
|
|
67
|
-
.modal-content-message {
|
|
21
|
+
gap: 24px;
|
|
68
22
|
align-self: stretch;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
font-family: 'Haas Grotesk Display Pro', sans-serif;
|
|
72
|
-
font-size: 14px;
|
|
73
|
-
font-style: normal;
|
|
74
|
-
font-weight: 400;
|
|
75
|
-
line-height: 20px; /* 142.857% */
|
|
76
|
-
}
|
|
77
|
-
.modal-content-code-content {
|
|
78
|
-
display: flex;
|
|
79
|
-
padding: 13px 14px 13px 28px;
|
|
80
|
-
align-items: flex-start;
|
|
81
|
-
gap: 20px;
|
|
82
|
-
border-radius: 4px;
|
|
83
|
-
background: var(--gray-1, #f4f6f8);
|
|
84
|
-
}
|
|
85
|
-
.modal-content-code-content-message {
|
|
86
|
-
width: 368px;
|
|
87
|
-
color: var(--gray-4, #6b7180);
|
|
88
|
-
|
|
89
|
-
/* regular/1 */
|
|
90
|
-
font-family: 'Haas Grotesk Display Pro', sans-serif;
|
|
91
|
-
font-size: 12px;
|
|
92
|
-
font-style: normal;
|
|
93
|
-
font-weight: 400;
|
|
94
|
-
line-height: normal;
|
|
95
|
-
}
|
|
96
|
-
.modal-content-code-content-vector {
|
|
97
|
-
width: 17px;
|
|
98
|
-
height: 20px;
|
|
99
|
-
fill: #000;
|
|
100
|
-
border: none;
|
|
101
|
-
background: transparent;
|
|
102
|
-
}
|
|
103
|
-
.modal-content-code-content-vector:hover {
|
|
104
|
-
cursor: pointer;
|
|
23
|
+
background: #fff;
|
|
24
|
+
border-top: 1px solid #aeb1b9;
|
|
105
25
|
}
|
|
106
26
|
</style>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
1
2
|
interface ModalContentProps {
|
|
2
|
-
|
|
3
|
-
contentMessage?: string;
|
|
4
|
-
contentCodeMessage?: string;
|
|
3
|
+
content?: Snippet;
|
|
5
4
|
}
|
|
6
5
|
declare const ModalContent: import("svelte").Component<ModalContentProps, {}, "">;
|
|
7
6
|
type ModalContent = ReturnType<typeof ModalContent>;
|
|
@@ -1,76 +1,31 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import Button from '../Button/Button.svelte';
|
|
3
|
+
import type { ModalFooterProps } from './modalState.svelte.js';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
cancelButton?: () => void;
|
|
5
|
-
okButton?: () => void;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
let { cancelButton, okButton }: ModalFooterProps = $props();
|
|
9
|
-
|
|
10
|
-
cancelButton =
|
|
11
|
-
cancelButton ||
|
|
12
|
-
function () {
|
|
13
|
-
console.log('cancelButton');
|
|
14
|
-
};
|
|
15
|
-
okButton =
|
|
16
|
-
okButton ||
|
|
17
|
-
function () {
|
|
18
|
-
console.log('okButton');
|
|
19
|
-
};
|
|
5
|
+
let { footer, onclose }: ModalFooterProps & { onclose: VoidFunction } = $props();
|
|
20
6
|
</script>
|
|
21
7
|
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
{#if footer}
|
|
9
|
+
<footer class="modal-footer">
|
|
10
|
+
<Button variant="outline-none" onclick={onclose}>Cancel</Button>
|
|
11
|
+
<div class="button-section">
|
|
12
|
+
{@render footer()}
|
|
13
|
+
</div>
|
|
14
|
+
</footer>
|
|
15
|
+
{/if}
|
|
26
16
|
|
|
27
17
|
<style>
|
|
28
|
-
.modal-footer
|
|
29
|
-
|
|
30
|
-
padding: var(--Card-padding, 24px);
|
|
31
|
-
justify-content: space-between;
|
|
32
|
-
align-items: flex-start;
|
|
33
|
-
align-self: stretch;
|
|
34
|
-
border-radius: 0px 0px var(--Card-radius, 16px) var(--Card-radius, 16px);
|
|
35
|
-
border-top: 1px solid var(--gray-3, #aeb1b9);
|
|
36
|
-
background: var(--brand-white, #fff);
|
|
37
|
-
}
|
|
38
|
-
.modal-footer-text-button {
|
|
39
|
-
display: inline-flex;
|
|
40
|
-
padding: 8px;
|
|
41
|
-
align-items: flex-start;
|
|
42
|
-
gap: 8px;
|
|
43
|
-
border-radius: 8px;
|
|
44
|
-
border: none;
|
|
45
|
-
background: var(--brand-white, #fff);
|
|
46
|
-
color: var(--brand-primary, #472aff);
|
|
47
|
-
/* regular/2 */
|
|
48
|
-
font-family: 'Haas Grotesk Display Pro', sans-serif;
|
|
49
|
-
font-size: 14px;
|
|
50
|
-
font-style: normal;
|
|
51
|
-
font-weight: 400;
|
|
52
|
-
line-height: 20px; /* 142.857% */
|
|
53
|
-
}
|
|
54
|
-
.modal-footer-text-button:hover {
|
|
55
|
-
cursor: pointer;
|
|
56
|
-
}
|
|
57
|
-
.modal-footer-primary-button {
|
|
18
|
+
.modal-footer,
|
|
19
|
+
.button-section {
|
|
58
20
|
display: flex;
|
|
59
|
-
|
|
60
|
-
align-items: flex-start;
|
|
61
|
-
gap: 8px;
|
|
62
|
-
border-radius: 8px;
|
|
63
|
-
border: none;
|
|
64
|
-
background: var(--brand-primary, #472aff);
|
|
65
|
-
color: var(--brand-primary, #fff);
|
|
66
|
-
/* regular/2 */
|
|
67
|
-
font-family: 'Haas Grotesk Display Pro', sans-serif;
|
|
68
|
-
font-size: 14px;
|
|
69
|
-
font-style: normal;
|
|
70
|
-
font-weight: 400;
|
|
71
|
-
line-height: 20px; /* 142.857% */
|
|
21
|
+
gap: 16px;
|
|
72
22
|
}
|
|
73
|
-
.modal-footer
|
|
74
|
-
|
|
23
|
+
.modal-footer {
|
|
24
|
+
width: 100%;
|
|
25
|
+
padding: 24px;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
border-radius: 0px 0px 16px 16px;
|
|
28
|
+
border-top: 1px solid #aeb1b9;
|
|
29
|
+
background: #fff;
|
|
75
30
|
}
|
|
76
31
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
declare const ModalFooter: import("svelte").Component
|
|
1
|
+
import type { ModalFooterProps } from './modalState.svelte.js';
|
|
2
|
+
type $$ComponentProps = ModalFooterProps & {
|
|
3
|
+
onclose: VoidFunction;
|
|
4
|
+
};
|
|
5
|
+
declare const ModalFooter: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
6
|
type ModalFooter = ReturnType<typeof ModalFooter>;
|
|
7
7
|
export default ModalFooter;
|