@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,260 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLTextareaAttributes } from 'svelte/elements';
|
|
3
|
+
|
|
4
|
+
interface TextAreaProps extends Omit<HTMLTextareaAttributes, 'value'> {
|
|
5
|
+
label?: string;
|
|
6
|
+
value?: string | null;
|
|
7
|
+
optional?: boolean;
|
|
8
|
+
error?: string | string[];
|
|
9
|
+
description?: string;
|
|
10
|
+
maximumCharactersAllowed?: number;
|
|
11
|
+
resize?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
label,
|
|
16
|
+
value = $bindable(''),
|
|
17
|
+
optional = false,
|
|
18
|
+
error,
|
|
19
|
+
description,
|
|
20
|
+
maximumCharactersAllowed,
|
|
21
|
+
resize = false,
|
|
22
|
+
id,
|
|
23
|
+
...props
|
|
24
|
+
}: TextAreaProps = $props();
|
|
25
|
+
|
|
26
|
+
const componentId = $props.id();
|
|
27
|
+
const textareaId = id || componentId;
|
|
28
|
+
|
|
29
|
+
const currentTextLength = $derived(value?.trim().length ?? 0);
|
|
30
|
+
const isOverLimit = $derived(
|
|
31
|
+
maximumCharactersAllowed ? currentTextLength > maximumCharactersAllowed : false
|
|
32
|
+
);
|
|
33
|
+
const errorMessage = $derived(isOverLimit ? 'Character limit exceeded' : error);
|
|
34
|
+
const isInvalid = $derived(!!errorMessage);
|
|
35
|
+
const isValid = $derived(!isInvalid && (!!value || optional));
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<div class="form-container">
|
|
39
|
+
{#if label}
|
|
40
|
+
<div class="form-label-container">
|
|
41
|
+
<label for={textareaId}>{label}</label>
|
|
42
|
+
{#if props.required}
|
|
43
|
+
<span class="form-label-required">Required</span>
|
|
44
|
+
{:else if optional}
|
|
45
|
+
<span class="form-label-optional">Optional</span>
|
|
46
|
+
{/if}
|
|
47
|
+
</div>
|
|
48
|
+
{/if}
|
|
49
|
+
|
|
50
|
+
<div class={['form-textarea-wrapper', isInvalid && 'error', isValid && 'success']}>
|
|
51
|
+
<textarea
|
|
52
|
+
{...props}
|
|
53
|
+
id={textareaId}
|
|
54
|
+
bind:value
|
|
55
|
+
class={[
|
|
56
|
+
'form-textarea',
|
|
57
|
+
props.disabled && 'form-textarea-disabled',
|
|
58
|
+
props.readonly && 'form-textarea-readonly',
|
|
59
|
+
!resize && 'form-textarea-no-resize'
|
|
60
|
+
]}
|
|
61
|
+
aria-invalid={isInvalid}
|
|
62
|
+
></textarea>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
{#if !!(maximumCharactersAllowed || error || description)}
|
|
66
|
+
<div class="form-footer">
|
|
67
|
+
<div class="form-messages">
|
|
68
|
+
{#if description}
|
|
69
|
+
<p class="form-message form-message-description">
|
|
70
|
+
{description}
|
|
71
|
+
</p>
|
|
72
|
+
{/if}
|
|
73
|
+
{#if errorMessage}
|
|
74
|
+
<p class="form-message form-message-error">
|
|
75
|
+
{Array.isArray(errorMessage) ? errorMessage[0] : errorMessage}
|
|
76
|
+
</p>
|
|
77
|
+
{/if}
|
|
78
|
+
</div>
|
|
79
|
+
{#if maximumCharactersAllowed}
|
|
80
|
+
<div class={['form-character-count', isOverLimit && 'error']}>
|
|
81
|
+
{currentTextLength} / {maximumCharactersAllowed}
|
|
82
|
+
</div>
|
|
83
|
+
{/if}
|
|
84
|
+
</div>
|
|
85
|
+
{/if}
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<style>
|
|
89
|
+
.form-container {
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
gap: 8px;
|
|
93
|
+
font-size: 14px;
|
|
94
|
+
line-height: 20px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.form-label-container {
|
|
98
|
+
display: flex;
|
|
99
|
+
gap: 8px;
|
|
100
|
+
font-weight: 500;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.form-label-optional {
|
|
104
|
+
color: #6b7180;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.form-label-required {
|
|
108
|
+
color: #dc2626;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.form-message {
|
|
112
|
+
font-size: 12px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.form-textarea-wrapper {
|
|
116
|
+
position: relative;
|
|
117
|
+
display: flex;
|
|
118
|
+
width: 100%;
|
|
119
|
+
border-radius: 8px;
|
|
120
|
+
border: 1px solid #6b7180;
|
|
121
|
+
background: #fff;
|
|
122
|
+
transition: all 0.2s ease-in-out;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.form-textarea-wrapper:hover:not(:has(.form-textarea:disabled)):not(
|
|
127
|
+
:has(.form-textarea:read-only)
|
|
128
|
+
),
|
|
129
|
+
.form-textarea-wrapper:focus-within {
|
|
130
|
+
border-color: #472aff;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.form-textarea-wrapper:focus-within {
|
|
134
|
+
box-shadow: 0px 0px 0px 3px rgba(149, 155, 255, 0.3);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.form-textarea {
|
|
138
|
+
font-size: 14px;
|
|
139
|
+
line-height: 20px;
|
|
140
|
+
display: flex;
|
|
141
|
+
width: 100%;
|
|
142
|
+
min-height: 80px;
|
|
143
|
+
padding: 8px 16px;
|
|
144
|
+
border: none;
|
|
145
|
+
border-radius: 8px;
|
|
146
|
+
color: #000;
|
|
147
|
+
transition: all 0.2s ease-in-out;
|
|
148
|
+
font-family: inherit;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.form-textarea:focus {
|
|
152
|
+
outline: none;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.form-textarea-disabled {
|
|
156
|
+
background-color: #f3f4f6;
|
|
157
|
+
border-color: #d1d5db;
|
|
158
|
+
color: #6b7180;
|
|
159
|
+
cursor: not-allowed;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.form-textarea-readonly {
|
|
163
|
+
background-color: #f9fafb;
|
|
164
|
+
border-color: #d1d5db;
|
|
165
|
+
cursor: default;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.form-textarea-no-resize {
|
|
169
|
+
resize: none;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.form-textarea::placeholder,
|
|
173
|
+
.form-textarea:disabled::placeholder {
|
|
174
|
+
color: #6b7180;
|
|
175
|
+
opacity: 1;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.form-footer {
|
|
179
|
+
display: flex;
|
|
180
|
+
justify-content: space-between;
|
|
181
|
+
align-items: flex-start;
|
|
182
|
+
gap: 8px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.form-messages {
|
|
186
|
+
display: flex;
|
|
187
|
+
flex-direction: column;
|
|
188
|
+
gap: 4px;
|
|
189
|
+
flex: 1;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.form-message-error {
|
|
193
|
+
color: #dc2626;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.form-message-description {
|
|
197
|
+
color: #6b7180;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.form-character-count {
|
|
201
|
+
font-size: 12px;
|
|
202
|
+
color: #6b7180;
|
|
203
|
+
white-space: nowrap;
|
|
204
|
+
flex-shrink: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.form-character-count.error {
|
|
208
|
+
color: #dc2626;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.form-textarea-wrapper.error,
|
|
212
|
+
.form-textarea-wrapper.error:hover:not(:has(.form-textarea:disabled)):not(
|
|
213
|
+
:has(.form-textarea:read-only)
|
|
214
|
+
),
|
|
215
|
+
.form-textarea-wrapper.error:focus-within {
|
|
216
|
+
border-color: #dc2626;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.form-textarea-wrapper.error:focus-within {
|
|
220
|
+
box-shadow: 0px 0px 0px 3px rgba(220, 38, 38, 0.2);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.form-textarea-wrapper.success {
|
|
224
|
+
border-color: #008556;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.form-textarea-wrapper.success:hover:not(:has(.form-textarea:disabled)):not(
|
|
228
|
+
:has(.form-textarea:read-only)
|
|
229
|
+
),
|
|
230
|
+
.form-textarea-wrapper.success:focus-within {
|
|
231
|
+
border-color: #10b981;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.form-textarea-wrapper.success:focus-within {
|
|
235
|
+
box-shadow: 0px 0px 0px 3px rgba(16, 185, 129, 0.15);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.form-textarea-wrapper:has(.form-textarea:disabled),
|
|
239
|
+
.form-textarea-wrapper:has(.form-textarea:read-only) {
|
|
240
|
+
border-color: #d1d5db !important;
|
|
241
|
+
box-shadow: none !important;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
@media (prefers-contrast: high) {
|
|
245
|
+
.form-textarea {
|
|
246
|
+
border-width: 2px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.form-textarea:focus {
|
|
250
|
+
outline: 2px solid;
|
|
251
|
+
outline-offset: 2px;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
@media (prefers-reduced-motion: reduce) {
|
|
256
|
+
.form-textarea {
|
|
257
|
+
transition: none;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HTMLTextareaAttributes } from 'svelte/elements';
|
|
2
|
+
interface TextAreaProps extends Omit<HTMLTextareaAttributes, 'value'> {
|
|
3
|
+
label?: string;
|
|
4
|
+
value?: string | null;
|
|
5
|
+
optional?: boolean;
|
|
6
|
+
error?: string | string[];
|
|
7
|
+
description?: string;
|
|
8
|
+
maximumCharactersAllowed?: number;
|
|
9
|
+
resize?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const TextArea: import("svelte").Component<TextAreaProps, {}, "value">;
|
|
12
|
+
type TextArea = ReturnType<typeof TextArea>;
|
|
13
|
+
export default TextArea;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface ToggleProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onchange?: (event: Event) => void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { id = '', checked = $bindable(false), disabled = false, onchange }: ToggleProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<label class="toggle-container">
|
|
13
|
+
<input
|
|
14
|
+
type="checkbox"
|
|
15
|
+
class="toggle-input"
|
|
16
|
+
bind:checked
|
|
17
|
+
{disabled}
|
|
18
|
+
{id}
|
|
19
|
+
{onchange}
|
|
20
|
+
role="switch"
|
|
21
|
+
/>
|
|
22
|
+
<div class={['toggle-slider', checked && 'checked', disabled && 'disabled']}>
|
|
23
|
+
<span class="material-icons-outlined toggle-icon">
|
|
24
|
+
{#if checked}
|
|
25
|
+
done
|
|
26
|
+
{:else}
|
|
27
|
+
close
|
|
28
|
+
{/if}
|
|
29
|
+
</span>
|
|
30
|
+
</div>
|
|
31
|
+
</label>
|
|
32
|
+
|
|
33
|
+
<style>
|
|
34
|
+
.toggle-container {
|
|
35
|
+
position: relative;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.toggle-input {
|
|
39
|
+
position: absolute;
|
|
40
|
+
opacity: 0;
|
|
41
|
+
width: 0;
|
|
42
|
+
height: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.toggle-slider {
|
|
46
|
+
display: flex;
|
|
47
|
+
width: 40px;
|
|
48
|
+
padding: 2px;
|
|
49
|
+
align-items: center;
|
|
50
|
+
border-radius: 12px;
|
|
51
|
+
border: 2px solid #6b7180;
|
|
52
|
+
background: #fff;
|
|
53
|
+
transition: all 0.3s ease;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.toggle-slider.checked {
|
|
58
|
+
justify-content: flex-end;
|
|
59
|
+
border: 2px solid #472aff;
|
|
60
|
+
background: #472aff;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.toggle-slider.disabled {
|
|
64
|
+
cursor: not-allowed;
|
|
65
|
+
border: 2px solid #6b7180;
|
|
66
|
+
background: #e0e5e8;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.toggle-slider.disabled.checked {
|
|
70
|
+
border: 2px solid #6b7180;
|
|
71
|
+
background: #6b7180;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.toggle-icon {
|
|
75
|
+
display: flex;
|
|
76
|
+
font-size: 12px;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
border-radius: 16px;
|
|
81
|
+
border: 2px solid #6b7180;
|
|
82
|
+
background: #6b7180;
|
|
83
|
+
color: #fff;
|
|
84
|
+
transition: all 0.3s ease;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.toggle-slider.checked .toggle-icon {
|
|
89
|
+
border: 2px solid #fff;
|
|
90
|
+
background: #fff;
|
|
91
|
+
color: #472aff;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.toggle-slider.disabled .toggle-icon {
|
|
95
|
+
cursor: not-allowed;
|
|
96
|
+
border: 2px solid #6b7180;
|
|
97
|
+
background: #6b7180;
|
|
98
|
+
color: #fff;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.toggle-slider.disabled.checked .toggle-icon {
|
|
102
|
+
border: 2px solid #fff;
|
|
103
|
+
background: #fff;
|
|
104
|
+
color: #6b7180;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.toggle-container:hover .toggle-slider:not(.disabled).checked {
|
|
108
|
+
background: #3520bf;
|
|
109
|
+
border: 2px solid #3520bf;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.toggle-container:hover .toggle-slider:not(.disabled):not(.checked) {
|
|
113
|
+
border: 2px solid #434952;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.toggle-container:hover .toggle-slider:not(.disabled):not(.checked) .toggle-icon {
|
|
117
|
+
border: 2px solid #434952;
|
|
118
|
+
background: #434952;
|
|
119
|
+
}
|
|
120
|
+
</style>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
interface ToggleProps {
|
|
2
|
-
|
|
2
|
+
id?: string;
|
|
3
|
+
checked?: boolean;
|
|
3
4
|
disabled?: boolean;
|
|
4
|
-
|
|
5
|
+
onchange?: (event: Event) => void;
|
|
5
6
|
}
|
|
6
|
-
declare const Toggle: import("svelte").Component<ToggleProps, {}, "">;
|
|
7
|
+
declare const Toggle: import("svelte").Component<ToggleProps, {}, "checked">;
|
|
7
8
|
type Toggle = ReturnType<typeof Toggle>;
|
|
8
9
|
export default Toggle;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
3
4
|
import HeaderAccount from './HeaderAccount.svelte';
|
|
4
5
|
import HeaderLoader from './HeaderLoader.svelte';
|
|
6
|
+
import HeaderLogo from './HeaderLogo.svelte';
|
|
5
7
|
|
|
6
8
|
interface HeaderProps {
|
|
7
9
|
title?: string;
|
|
8
10
|
homeUrl?: string;
|
|
9
|
-
disableMenuButton?: boolean;
|
|
10
|
-
menuButton?: () => void;
|
|
11
11
|
hideAccount?: boolean;
|
|
12
12
|
hideHelp?: boolean;
|
|
13
13
|
hideNotification?: boolean;
|
|
@@ -15,165 +15,83 @@
|
|
|
15
15
|
userName?: string;
|
|
16
16
|
profileUrl?: string;
|
|
17
17
|
hideLoader?: boolean;
|
|
18
|
+
menu?: Snippet;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
let {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
}
|
|
21
|
+
let {
|
|
22
|
+
title = 'Default Title',
|
|
23
|
+
homeUrl = '/',
|
|
24
|
+
hideAccount,
|
|
25
|
+
hideHelp,
|
|
26
|
+
hideNotification,
|
|
27
|
+
accountName = 'Company Name',
|
|
28
|
+
userName = 'User Name',
|
|
29
|
+
profileUrl = '/profile',
|
|
30
|
+
hideLoader,
|
|
31
|
+
menu
|
|
32
|
+
}: HeaderProps = $props();
|
|
34
33
|
</script>
|
|
35
34
|
|
|
36
35
|
<div class="header-container">
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</a>
|
|
55
|
-
</div>
|
|
56
|
-
<div class="header-title">
|
|
57
|
-
{title}
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
<div class="header-right">
|
|
61
|
-
{#if !hideHelp}
|
|
62
|
-
<button class="header-btn" aria-labelledby="help-button">
|
|
63
|
-
<svg
|
|
64
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
65
|
-
height="24px"
|
|
66
|
-
viewBox="0 -960 960 960"
|
|
67
|
-
width="24px"
|
|
68
|
-
fill="#6b7180"
|
|
69
|
-
><path
|
|
70
|
-
d="M478-240q21 0 35.5-14.5T528-290q0-21-14.5-35.5T478-340q-21 0-35.5 14.5T428-290q0 21 14.5 35.5T478-240Zm-36-154h74q0-33 7.5-52t42.5-52q26-26 41-49.5t15-56.5q0-56-41-86t-97-30q-57 0-92.5 30T342-618l66 26q5-18 22.5-39t53.5-21q32 0 48 17.5t16 38.5q0 20-12 37.5T506-526q-44 39-54 59t-10 73Zm38 314q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"
|
|
71
|
-
/></svg
|
|
72
|
-
>
|
|
36
|
+
<nav class="header-section">
|
|
37
|
+
{#if !hideLoader}
|
|
38
|
+
<HeaderLoader />
|
|
39
|
+
{/if}
|
|
40
|
+
{@render menu?.()}
|
|
41
|
+
<a href={homeUrl} title="Home">
|
|
42
|
+
<HeaderLogo />
|
|
43
|
+
</a>
|
|
44
|
+
<h2 class="header-title">
|
|
45
|
+
{title}
|
|
46
|
+
</h2>
|
|
47
|
+
</nav>
|
|
48
|
+
|
|
49
|
+
<nav class="header-section">
|
|
50
|
+
{#if !hideHelp}
|
|
51
|
+
<button class="header-btn material-icons-outlined" aria-labelledby="help-button">
|
|
52
|
+
help_outline
|
|
73
53
|
</button>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<button class="header-btn" aria-labelledby="
|
|
77
|
-
|
|
78
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
79
|
-
height="24px"
|
|
80
|
-
viewBox="0 -960 960 960"
|
|
81
|
-
width="24px"
|
|
82
|
-
fill="#6b7180"
|
|
83
|
-
><path
|
|
84
|
-
d="M160-200v-80h80v-280q0-83 50-147.5T420-792v-28q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820v28q80 20 130 84.5T720-560v280h80v80H160Zm320-300Zm0 420q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80ZM320-280h320v-280q0-66-47-113t-113-47q-66 0-113 47t-47 113v280Z"
|
|
85
|
-
/></svg
|
|
86
|
-
>
|
|
54
|
+
{/if}
|
|
55
|
+
{#if !hideNotification}
|
|
56
|
+
<button class="header-btn material-icons-outlined" aria-labelledby="notifications-button">
|
|
57
|
+
notifications
|
|
87
58
|
</button>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{/if}
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
59
|
+
{/if}
|
|
60
|
+
{#if !hideAccount}
|
|
61
|
+
<a href={profileUrl} title="Profile">
|
|
62
|
+
<HeaderAccount {accountName} {userName} />
|
|
63
|
+
</a>
|
|
64
|
+
{/if}
|
|
65
|
+
</nav>
|
|
98
66
|
</div>
|
|
99
67
|
|
|
100
|
-
{#if !hideLoader}
|
|
101
|
-
<HeaderLoader />
|
|
102
|
-
{/if}
|
|
103
|
-
|
|
104
68
|
<style>
|
|
105
69
|
.header-container {
|
|
106
70
|
display: flex;
|
|
107
|
-
|
|
108
|
-
align-items: flex-start;
|
|
109
|
-
flex: 1 0 0;
|
|
110
|
-
}
|
|
111
|
-
.header {
|
|
112
|
-
display: flex;
|
|
113
|
-
height: 80px;
|
|
114
|
-
padding: 0px 24px;
|
|
71
|
+
gap: 24px;
|
|
115
72
|
justify-content: space-between;
|
|
116
73
|
align-items: center;
|
|
117
|
-
|
|
118
|
-
border-bottom: 3px solid #aeb1b9;
|
|
119
|
-
background: #fff;
|
|
120
|
-
}
|
|
121
|
-
.header-left {
|
|
122
|
-
display: flex;
|
|
123
|
-
height: 41px;
|
|
124
|
-
align-items: center;
|
|
125
|
-
gap: 32px;
|
|
126
|
-
}
|
|
127
|
-
.header-right {
|
|
128
|
-
display: flex;
|
|
129
|
-
max-width: 350px;
|
|
130
|
-
padding: 8px 24px;
|
|
131
|
-
align-items: center;
|
|
132
|
-
gap: 16px;
|
|
133
|
-
border-radius: 8px;
|
|
74
|
+
padding: 0px 24px;
|
|
134
75
|
background: #fff;
|
|
135
|
-
|
|
76
|
+
height: 80px;
|
|
77
|
+
border-bottom: 3px solid #aeb1b9;
|
|
136
78
|
}
|
|
137
|
-
|
|
79
|
+
|
|
80
|
+
.header-section {
|
|
138
81
|
display: flex;
|
|
139
|
-
justify-content: center;
|
|
140
82
|
align-items: center;
|
|
141
|
-
gap:
|
|
142
|
-
border: none;
|
|
143
|
-
background-color: transparent;
|
|
144
|
-
color: #6b7180;
|
|
145
|
-
}
|
|
146
|
-
.header-logo {
|
|
147
|
-
width: 65px;
|
|
148
|
-
height: 22.941px;
|
|
149
|
-
flex-shrink: 0;
|
|
150
|
-
fill: #000;
|
|
83
|
+
gap: 24px;
|
|
151
84
|
}
|
|
85
|
+
|
|
152
86
|
.header-title {
|
|
153
87
|
color: #000;
|
|
154
|
-
|
|
155
|
-
/* medium/6 */
|
|
156
|
-
font-family: 'Haas Grotesk Display Pro', sans-serif;
|
|
157
88
|
font-size: 24px;
|
|
158
|
-
font-
|
|
159
|
-
font-weight: 500;
|
|
160
|
-
line-height: normal;
|
|
89
|
+
font-weight: 600;
|
|
161
90
|
}
|
|
91
|
+
|
|
162
92
|
.header-btn {
|
|
163
|
-
text-align: left;
|
|
164
93
|
border: none;
|
|
165
94
|
background: transparent;
|
|
166
95
|
color: #6b7180;
|
|
167
|
-
text-decoration: none;
|
|
168
|
-
}
|
|
169
|
-
.header-btn:hover {
|
|
170
|
-
cursor: pointer;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.cursor-default {
|
|
174
|
-
cursor: default;
|
|
175
|
-
}
|
|
176
|
-
.cursor-pointer {
|
|
177
|
-
cursor: pointer;
|
|
178
96
|
}
|
|
179
97
|
</style>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
1
2
|
interface HeaderProps {
|
|
2
3
|
title?: string;
|
|
3
4
|
homeUrl?: string;
|
|
4
|
-
disableMenuButton?: boolean;
|
|
5
|
-
menuButton?: () => void;
|
|
6
5
|
hideAccount?: boolean;
|
|
7
6
|
hideHelp?: boolean;
|
|
8
7
|
hideNotification?: boolean;
|
|
@@ -10,6 +9,7 @@ interface HeaderProps {
|
|
|
10
9
|
userName?: string;
|
|
11
10
|
profileUrl?: string;
|
|
12
11
|
hideLoader?: boolean;
|
|
12
|
+
menu?: Snippet;
|
|
13
13
|
}
|
|
14
14
|
declare const Header: import("svelte").Component<HeaderProps, {}, "">;
|
|
15
15
|
type Header = ReturnType<typeof Header>;
|