@softwareone/spi-sv5-library 1.0.0 → 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/Button/Button.svelte +12 -1
- package/dist/Button/Button.svelte.d.ts +1 -1
- package/dist/Chips/Chips.svelte +31 -34
- package/dist/Chips/Chips.svelte.d.ts +1 -1
- package/dist/ErrorPage/ErrorPage.svelte +5 -7
- package/dist/ErrorPage/ErrorPage.svelte.d.ts +1 -2
- package/dist/Form/Input/Input.svelte +7 -12
- package/dist/Form/Input/Input.svelte.d.ts +2 -2
- package/dist/Form/TextArea/TextArea.svelte +6 -4
- package/dist/Form/TextArea/TextArea.svelte.d.ts +2 -2
- package/dist/Header/Header.svelte +29 -33
- package/dist/Header/Header.svelte.d.ts +2 -3
- package/dist/Header/HeaderAccount.svelte +8 -6
- 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/Menu/Menu.svelte +11 -11
- package/dist/Menu/MenuItem.svelte +7 -11
- package/dist/Modal/Modal.svelte +80 -27
- package/dist/Modal/Modal.svelte.d.ts +2 -9
- package/dist/Modal/ModalContent.svelte +4 -77
- package/dist/Modal/ModalContent.svelte.d.ts +2 -3
- package/dist/Modal/ModalFooter.svelte +17 -58
- package/dist/Modal/ModalFooter.svelte.d.ts +5 -5
- package/dist/Modal/ModalHeader.svelte +49 -31
- 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 +272 -278
- 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/Toast/Toast.svelte +109 -37
- package/dist/Toast/toastState.svelte.d.ts +7 -3
- package/dist/Toast/toastState.svelte.js +13 -10
- package/dist/index.d.ts +5 -2
- package/dist/index.js +3 -2
- package/package.json +4 -6
package/README.md
CHANGED
|
@@ -15,32 +15,88 @@ npm install @softwareone/swo-spi-svelte5-library
|
|
|
15
15
|
Import the components you need into your Svelte application:
|
|
16
16
|
|
|
17
17
|
```javascript
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
import {
|
|
19
|
+
Avatar,
|
|
20
|
+
Breadcrumbs,
|
|
21
|
+
Button,
|
|
22
|
+
Card,
|
|
23
|
+
Chips,
|
|
24
|
+
ErrorPage,
|
|
25
|
+
Footer,
|
|
26
|
+
Header,
|
|
27
|
+
HeaderAccount,
|
|
28
|
+
HeaderLoader,
|
|
29
|
+
HeaderLogo,
|
|
30
|
+
HighlightPanel,
|
|
31
|
+
Input,
|
|
32
|
+
Menu,
|
|
33
|
+
Modal,
|
|
34
|
+
ProgressWizard,
|
|
35
|
+
Sidebar,
|
|
36
|
+
Tabs,
|
|
37
|
+
TextArea,
|
|
38
|
+
Toaster,
|
|
39
|
+
Toggle,
|
|
40
|
+
Tooltip
|
|
41
|
+
} from '@softwareone/swo-spi-svelte5-library';
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Import the types you need into your Svelte application:
|
|
45
|
+
|
|
46
|
+
```javascript
|
|
47
|
+
import {
|
|
48
|
+
type BreadcrumbsNameMap,
|
|
49
|
+
type HighlightPanelColumn,
|
|
50
|
+
type MenuItem,
|
|
51
|
+
type ModalProps,
|
|
52
|
+
type ProgressWizardStep,
|
|
53
|
+
type Tab,
|
|
54
|
+
type Toast
|
|
55
|
+
} from '@softwareone/swo-spi-svelte5-library';
|
|
33
56
|
```
|
|
34
57
|
|
|
35
58
|
# List of components
|
|
36
59
|
|
|
60
|
+
- Avatar
|
|
61
|
+
- Breadcrumbs
|
|
37
62
|
- Button
|
|
63
|
+
- Card
|
|
64
|
+
- Chips
|
|
65
|
+
- ErrorPage
|
|
66
|
+
- Footer
|
|
67
|
+
- Form
|
|
68
|
+
- Input
|
|
69
|
+
- TextArea
|
|
70
|
+
- Toggle
|
|
71
|
+
- Header (including a loader)
|
|
72
|
+
- HeaderAccount
|
|
73
|
+
- HeaderLoader
|
|
74
|
+
- HeaderLogo
|
|
75
|
+
- HighlightPanel
|
|
76
|
+
- Menu
|
|
77
|
+
- Sidebar
|
|
38
78
|
- Modal
|
|
79
|
+
- ProgressWizard
|
|
39
80
|
- Spinner
|
|
81
|
+
- Tabs
|
|
40
82
|
- Toaster
|
|
41
|
-
-
|
|
42
|
-
|
|
83
|
+
- Tooltip
|
|
84
|
+
|
|
85
|
+
# List of types per component
|
|
86
|
+
|
|
43
87
|
- Breadcrumbs
|
|
88
|
+
- BreadcrumbsNameMap
|
|
44
89
|
- Chips
|
|
45
|
-
-
|
|
46
|
-
-
|
|
90
|
+
- ChipType
|
|
91
|
+
- HighlightPanel
|
|
92
|
+
- ColumnType
|
|
93
|
+
- HighlightPanelColumn
|
|
94
|
+
- ImageType
|
|
95
|
+
- Menu
|
|
96
|
+
- MenuItem
|
|
97
|
+
- Modal
|
|
98
|
+
- ModalProps
|
|
99
|
+
- ProgressWizard
|
|
100
|
+
- ProgressWizardStep
|
|
101
|
+
- Tab
|
|
102
|
+
- Toast
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
4
4
|
|
|
5
|
-
type Variant = 'primary' | 'secondary' | 'outline';
|
|
5
|
+
type Variant = 'primary' | 'secondary' | 'outline' | 'outline-none';
|
|
6
6
|
type VariantColor = 'primary' | 'danger';
|
|
7
7
|
|
|
8
8
|
interface ButtonProps extends HTMLButtonAttributes {
|
|
@@ -78,6 +78,17 @@
|
|
|
78
78
|
background: #eaecff;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
.btn-outline-none-primary {
|
|
82
|
+
border: none;
|
|
83
|
+
background: #fff;
|
|
84
|
+
color: #472aff;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.btn-outline-none-primary:hover:not(:disabled),
|
|
88
|
+
.btn-outline-none-primary:focus:not(:disabled) {
|
|
89
|
+
background: #e0e5e8;
|
|
90
|
+
}
|
|
91
|
+
|
|
81
92
|
.btn-primary-danger {
|
|
82
93
|
background: #dc182c;
|
|
83
94
|
color: #fff;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
-
type Variant = 'primary' | 'secondary' | 'outline';
|
|
3
|
+
type Variant = 'primary' | 'secondary' | 'outline' | 'outline-none';
|
|
4
4
|
type VariantColor = 'primary' | 'danger';
|
|
5
5
|
interface ButtonProps extends HTMLButtonAttributes {
|
|
6
6
|
variant?: Variant;
|
package/dist/Chips/Chips.svelte
CHANGED
|
@@ -1,74 +1,71 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { ChipType } from '
|
|
2
|
+
import { ChipType } from './chipsState.svelte.js';
|
|
3
3
|
|
|
4
4
|
interface ChipsProps {
|
|
5
5
|
type?: ChipType;
|
|
6
6
|
text?: string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
let { type, text }: ChipsProps =
|
|
10
|
-
|
|
11
|
-
type = type || ChipType.Info;
|
|
12
|
-
text = text || type.charAt(0).toUpperCase() + type.slice(1); // Default to capitalized type
|
|
13
|
-
|
|
14
|
-
let className = `chip chip-${type}`;
|
|
9
|
+
let { type = ChipType.Info, text = type.charAt(0).toUpperCase() + type.slice(1) }: ChipsProps =
|
|
10
|
+
$props();
|
|
15
11
|
</script>
|
|
16
12
|
|
|
17
|
-
<div class={
|
|
13
|
+
<div class="chip {type}">
|
|
18
14
|
{text}
|
|
19
15
|
</div>
|
|
20
16
|
|
|
21
17
|
<style>
|
|
22
18
|
.chip {
|
|
23
|
-
display: inline-
|
|
24
|
-
padding: 2px 8px;
|
|
25
|
-
align-items: center;
|
|
26
|
-
gap: 8px;
|
|
27
|
-
border-radius: 4px;
|
|
19
|
+
display: inline-block;
|
|
28
20
|
font-size: 14px;
|
|
29
|
-
font-
|
|
30
|
-
font-weight: 400;
|
|
21
|
+
font-weight: 500;
|
|
31
22
|
line-height: 20px;
|
|
32
23
|
background: var(--chip-bg);
|
|
33
24
|
color: var(--chip-text);
|
|
25
|
+
padding: 2px 8px;
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
cursor: default;
|
|
34
28
|
}
|
|
35
29
|
|
|
36
30
|
.chip:hover {
|
|
37
|
-
background: var(--chip-hover);
|
|
31
|
+
background: var(--chip-bg-hover);
|
|
38
32
|
}
|
|
39
33
|
|
|
40
34
|
.chip:focus {
|
|
41
|
-
|
|
42
|
-
box-shadow: 0px 0px 0px 3px var(--chip-hover);
|
|
35
|
+
box-shadow: 0px 0px 0px 3px #959bff;
|
|
43
36
|
}
|
|
44
|
-
|
|
45
|
-
.chip-info {
|
|
46
|
-
--chip-bg: #eaecff;
|
|
37
|
+
.chip.info {
|
|
47
38
|
--chip-text: #3520bf;
|
|
48
|
-
--chip-
|
|
39
|
+
--chip-bg: #eaecff;
|
|
40
|
+
--chip-text-hover: #2b1999;
|
|
41
|
+
--chip-bg-hover: #959bff;
|
|
49
42
|
}
|
|
50
43
|
|
|
51
|
-
.chip
|
|
52
|
-
--chip-bg: #e6f9f2;
|
|
44
|
+
.chip.success {
|
|
53
45
|
--chip-text: #00784d;
|
|
54
|
-
--chip-
|
|
46
|
+
--chip-bg: #e6f9f2;
|
|
47
|
+
--chip-text-hover: #005838;
|
|
48
|
+
--chip-bg-hover: #80e1ae;
|
|
55
49
|
}
|
|
56
50
|
|
|
57
|
-
.chip
|
|
58
|
-
--chip-bg: #fdf2e9;
|
|
51
|
+
.chip.warning {
|
|
59
52
|
--chip-text: #a15d26;
|
|
60
|
-
--chip-
|
|
53
|
+
--chip-bg: #fdf2e9;
|
|
54
|
+
--chip-text-hover: #733f11;
|
|
55
|
+
--chip-bg-hover: #f1b178;
|
|
61
56
|
}
|
|
62
57
|
|
|
63
|
-
.chip
|
|
64
|
-
--chip-bg: #fce8ea;
|
|
58
|
+
.chip.error {
|
|
65
59
|
--chip-text: #bb1425;
|
|
66
|
-
--chip-
|
|
60
|
+
--chip-bg: #fce8ea;
|
|
61
|
+
--chip-text-hover: #8f101d;
|
|
62
|
+
--chip-bg-hover: #ee8c96;
|
|
67
63
|
}
|
|
68
64
|
|
|
69
|
-
.chip
|
|
70
|
-
--chip-bg: #f4f6f8;
|
|
65
|
+
.chip.neutral {
|
|
71
66
|
--chip-text: #434952;
|
|
72
|
-
--chip-
|
|
67
|
+
--chip-bg: #f4f6f8;
|
|
68
|
+
--chip-text-hover: #25282d;
|
|
69
|
+
--chip-bg-hover: #e0e5e8;
|
|
73
70
|
}
|
|
74
71
|
</style>
|
|
@@ -2,22 +2,20 @@
|
|
|
2
2
|
import { goto } from '$app/navigation';
|
|
3
3
|
import { page } from '$app/state';
|
|
4
4
|
|
|
5
|
-
import { StatusCodes } from 'http-status-codes';
|
|
6
|
-
|
|
7
5
|
import FeedbackIcon from '../assets/icons/feedback.svg';
|
|
8
6
|
import { Button } from '../index.js';
|
|
9
7
|
|
|
10
8
|
interface ErrorPageProps {
|
|
11
|
-
status:
|
|
9
|
+
status: number;
|
|
12
10
|
title?: string;
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
let { status, title }: ErrorPageProps = $props();
|
|
16
14
|
|
|
17
15
|
const errorTitle: Record<number, string> = {
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
16
|
+
[404]: 'Page not found',
|
|
17
|
+
[403]: 'Access denied',
|
|
18
|
+
[500]: 'An unexpected error occurred'
|
|
21
19
|
};
|
|
22
20
|
</script>
|
|
23
21
|
|
|
@@ -26,7 +24,7 @@
|
|
|
26
24
|
|
|
27
25
|
<div class="feedback-detail">
|
|
28
26
|
<h1>{title || errorTitle[status]}</h1>
|
|
29
|
-
{#if status ===
|
|
27
|
+
{#if status === 404}
|
|
30
28
|
<div>
|
|
31
29
|
<p>We couldn’t find the page:</p>
|
|
32
30
|
<p class="link">{page.url}</p>
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
interface InputProps extends Omit<HTMLInputAttributes, 'type' | 'value'> {
|
|
8
8
|
label?: string;
|
|
9
9
|
type?: InputType;
|
|
10
|
-
value?: string | number;
|
|
10
|
+
value?: string | number | null;
|
|
11
11
|
optional?: boolean;
|
|
12
|
-
error?: string;
|
|
12
|
+
error?: string | string[];
|
|
13
13
|
description?: string;
|
|
14
14
|
currency?: string;
|
|
15
15
|
}
|
|
@@ -45,12 +45,6 @@
|
|
|
45
45
|
money: 'number',
|
|
46
46
|
password: isPasswordVisible ? 'text' : 'password'
|
|
47
47
|
});
|
|
48
|
-
|
|
49
|
-
const handleInput = (event: Event): void => {
|
|
50
|
-
const target = event.target as HTMLInputElement;
|
|
51
|
-
value = type === 'number' || type === 'money' ? target.valueAsNumber : target.value;
|
|
52
|
-
oninput?.(event as Event & { currentTarget: EventTarget & HTMLInputElement });
|
|
53
|
-
};
|
|
54
48
|
</script>
|
|
55
49
|
|
|
56
50
|
<div class="form-container">
|
|
@@ -74,10 +68,10 @@
|
|
|
74
68
|
]}
|
|
75
69
|
>
|
|
76
70
|
<input
|
|
71
|
+
bind:value
|
|
77
72
|
{...props}
|
|
78
73
|
id={inputId}
|
|
79
74
|
type={transformationType[type] ?? type}
|
|
80
|
-
{value}
|
|
81
75
|
{disabled}
|
|
82
76
|
{readonly}
|
|
83
77
|
class={[
|
|
@@ -88,7 +82,6 @@
|
|
|
88
82
|
showDatePicker && 'form-input-date'
|
|
89
83
|
]}
|
|
90
84
|
aria-invalid={isInvalid}
|
|
91
|
-
oninput={handleInput}
|
|
92
85
|
/>
|
|
93
86
|
|
|
94
87
|
{#if type === 'money' && currency}
|
|
@@ -120,7 +113,7 @@
|
|
|
120
113
|
{/if}
|
|
121
114
|
{#if isInvalid}
|
|
122
115
|
<p class="form-message form-message-error">
|
|
123
|
-
{error}
|
|
116
|
+
{Array.isArray(error) ? error[0] : error}
|
|
124
117
|
</p>
|
|
125
118
|
{/if}
|
|
126
119
|
</div>
|
|
@@ -351,7 +344,9 @@
|
|
|
351
344
|
border-color: #008556;
|
|
352
345
|
}
|
|
353
346
|
|
|
354
|
-
.form-input-wrapper.success:hover:not(:has(.form-input:disabled)):not(
|
|
347
|
+
.form-input-wrapper.success:hover:not(:has(.form-input:disabled)):not(
|
|
348
|
+
:has(.form-input:read-only)
|
|
349
|
+
),
|
|
355
350
|
.form-input-wrapper.success:focus-within {
|
|
356
351
|
border-color: #10b981;
|
|
357
352
|
}
|
|
@@ -3,9 +3,9 @@ type InputType = 'text' | 'password' | 'number' | 'date' | 'money';
|
|
|
3
3
|
interface InputProps extends Omit<HTMLInputAttributes, 'type' | 'value'> {
|
|
4
4
|
label?: string;
|
|
5
5
|
type?: InputType;
|
|
6
|
-
value?: string | number;
|
|
6
|
+
value?: string | number | null;
|
|
7
7
|
optional?: boolean;
|
|
8
|
-
error?: string;
|
|
8
|
+
error?: string | string[];
|
|
9
9
|
description?: string;
|
|
10
10
|
currency?: string;
|
|
11
11
|
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
interface TextAreaProps extends Omit<HTMLTextareaAttributes, 'value'> {
|
|
5
5
|
label?: string;
|
|
6
|
-
value?: string;
|
|
6
|
+
value?: string | null;
|
|
7
7
|
optional?: boolean;
|
|
8
|
-
error?: string;
|
|
8
|
+
error?: string | string[];
|
|
9
9
|
description?: string;
|
|
10
10
|
maximumCharactersAllowed?: number;
|
|
11
11
|
resize?: boolean;
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
{/if}
|
|
73
73
|
{#if errorMessage}
|
|
74
74
|
<p class="form-message form-message-error">
|
|
75
|
-
{errorMessage}
|
|
75
|
+
{Array.isArray(errorMessage) ? errorMessage[0] : errorMessage}
|
|
76
76
|
</p>
|
|
77
77
|
{/if}
|
|
78
78
|
</div>
|
|
@@ -224,7 +224,9 @@
|
|
|
224
224
|
border-color: #008556;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
.form-textarea-wrapper.success:hover:not(:has(.form-textarea:disabled)):not(
|
|
227
|
+
.form-textarea-wrapper.success:hover:not(:has(.form-textarea:disabled)):not(
|
|
228
|
+
:has(.form-textarea:read-only)
|
|
229
|
+
),
|
|
228
230
|
.form-textarea-wrapper.success:focus-within {
|
|
229
231
|
border-color: #10b981;
|
|
230
232
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { HTMLTextareaAttributes } from 'svelte/elements';
|
|
2
2
|
interface TextAreaProps extends Omit<HTMLTextareaAttributes, 'value'> {
|
|
3
3
|
label?: string;
|
|
4
|
-
value?: string;
|
|
4
|
+
value?: string | null;
|
|
5
5
|
optional?: boolean;
|
|
6
|
-
error?: string;
|
|
6
|
+
error?: string | string[];
|
|
7
7
|
description?: string;
|
|
8
8
|
maximumCharactersAllowed?: number;
|
|
9
9
|
resize?: boolean;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
import HeaderAccount from './HeaderAccount.svelte';
|
|
5
|
+
import HeaderLoader from './HeaderLoader.svelte';
|
|
6
|
+
import HeaderLogo from './HeaderLogo.svelte';
|
|
3
7
|
|
|
4
8
|
interface HeaderProps {
|
|
5
9
|
title?: string;
|
|
6
10
|
homeUrl?: string;
|
|
7
|
-
disableMenuButton?: boolean;
|
|
8
11
|
hideAccount?: boolean;
|
|
9
12
|
hideHelp?: boolean;
|
|
10
13
|
hideNotification?: boolean;
|
|
@@ -12,13 +15,12 @@
|
|
|
12
15
|
userName?: string;
|
|
13
16
|
profileUrl?: string;
|
|
14
17
|
hideLoader?: boolean;
|
|
15
|
-
|
|
18
|
+
menu?: Snippet;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
let {
|
|
19
22
|
title = 'Default Title',
|
|
20
23
|
homeUrl = '/',
|
|
21
|
-
disableMenuButton,
|
|
22
24
|
hideAccount,
|
|
23
25
|
hideHelp,
|
|
24
26
|
hideNotification,
|
|
@@ -26,47 +28,47 @@
|
|
|
26
28
|
userName = 'User Name',
|
|
27
29
|
profileUrl = '/profile',
|
|
28
30
|
hideLoader,
|
|
29
|
-
|
|
31
|
+
menu
|
|
30
32
|
}: HeaderProps = $props();
|
|
31
33
|
</script>
|
|
32
34
|
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
<div class="header-container">
|
|
36
|
+
<nav class="header-section">
|
|
37
|
+
{#if !hideLoader}
|
|
38
|
+
<HeaderLoader />
|
|
39
|
+
{/if}
|
|
40
|
+
{@render menu?.()}
|
|
41
|
+
<a href={homeUrl} title="Home">
|
|
37
42
|
<HeaderLogo />
|
|
38
43
|
</a>
|
|
39
|
-
<
|
|
44
|
+
<h2 class="header-title">
|
|
40
45
|
{title}
|
|
41
|
-
</
|
|
42
|
-
</
|
|
46
|
+
</h2>
|
|
47
|
+
</nav>
|
|
43
48
|
|
|
44
|
-
<
|
|
49
|
+
<nav class="header-section">
|
|
45
50
|
{#if !hideHelp}
|
|
46
|
-
<button class="header-btn" aria-labelledby="help-button">
|
|
47
|
-
|
|
51
|
+
<button class="header-btn material-icons-outlined" aria-labelledby="help-button">
|
|
52
|
+
help_outline
|
|
48
53
|
</button>
|
|
49
54
|
{/if}
|
|
50
55
|
{#if !hideNotification}
|
|
51
|
-
<button class="header-btn" aria-labelledby="notifications-button">
|
|
52
|
-
|
|
56
|
+
<button class="header-btn material-icons-outlined" aria-labelledby="notifications-button">
|
|
57
|
+
notifications
|
|
53
58
|
</button>
|
|
54
59
|
{/if}
|
|
55
60
|
{#if !hideAccount}
|
|
56
|
-
<a href={profileUrl}>
|
|
61
|
+
<a href={profileUrl} title="Profile">
|
|
57
62
|
<HeaderAccount {accountName} {userName} />
|
|
58
63
|
</a>
|
|
59
64
|
{/if}
|
|
60
|
-
</
|
|
61
|
-
</
|
|
62
|
-
|
|
63
|
-
{#if !hideLoader}
|
|
64
|
-
<HeaderLoader />
|
|
65
|
-
{/if}
|
|
65
|
+
</nav>
|
|
66
|
+
</div>
|
|
66
67
|
|
|
67
68
|
<style>
|
|
68
|
-
.header {
|
|
69
|
+
.header-container {
|
|
69
70
|
display: flex;
|
|
71
|
+
gap: 24px;
|
|
70
72
|
justify-content: space-between;
|
|
71
73
|
align-items: center;
|
|
72
74
|
padding: 0px 24px;
|
|
@@ -78,24 +80,18 @@
|
|
|
78
80
|
.header-section {
|
|
79
81
|
display: flex;
|
|
80
82
|
align-items: center;
|
|
81
|
-
gap:
|
|
83
|
+
gap: 24px;
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
.header-title {
|
|
85
87
|
color: #000;
|
|
86
88
|
font-size: 24px;
|
|
89
|
+
font-weight: 600;
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
.header-btn {
|
|
90
93
|
border: none;
|
|
91
94
|
background: transparent;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.icon-span {
|
|
95
95
|
color: #6b7180;
|
|
96
|
-
font-size: 24px;
|
|
97
|
-
font-weight: 400;
|
|
98
|
-
line-height: 20px;
|
|
99
|
-
word-wrap: break-word;
|
|
100
96
|
}
|
|
101
97
|
</style>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
2
|
interface HeaderProps {
|
|
3
3
|
title?: string;
|
|
4
4
|
homeUrl?: string;
|
|
5
|
-
disableMenuButton?: boolean;
|
|
6
5
|
hideAccount?: boolean;
|
|
7
6
|
hideHelp?: boolean;
|
|
8
7
|
hideNotification?: boolean;
|
|
@@ -10,7 +9,7 @@ interface HeaderProps {
|
|
|
10
9
|
userName?: string;
|
|
11
10
|
profileUrl?: string;
|
|
12
11
|
hideLoader?: boolean;
|
|
13
|
-
|
|
12
|
+
menu?: Snippet;
|
|
14
13
|
}
|
|
15
14
|
declare const Header: import("svelte").Component<HeaderProps, {}, "">;
|
|
16
15
|
type Header = ReturnType<typeof Header>;
|
|
@@ -6,17 +6,14 @@
|
|
|
6
6
|
userName?: string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
let { accountName, userName }: HeaderAccountProps = $props();
|
|
10
|
-
|
|
11
|
-
accountName = accountName || 'SoftwareOne';
|
|
12
|
-
userName = userName || 'John Doe';
|
|
9
|
+
let { accountName = 'SoftwareOne', userName = 'John Doe' }: HeaderAccountProps = $props();
|
|
13
10
|
</script>
|
|
14
11
|
|
|
15
12
|
<div class="account-container">
|
|
16
13
|
<div class="account-avatar">
|
|
17
14
|
<Avatar text={userName} />
|
|
18
15
|
</div>
|
|
19
|
-
<div class="account">
|
|
16
|
+
<div class="account-info">
|
|
20
17
|
<div class="account-name">{accountName}</div>
|
|
21
18
|
<div class="account-more">
|
|
22
19
|
<div class="account-more-name">Operations | {userName}</div>
|
|
@@ -33,6 +30,7 @@
|
|
|
33
30
|
border-radius: 8px;
|
|
34
31
|
background: #fff;
|
|
35
32
|
}
|
|
33
|
+
|
|
36
34
|
.account-avatar {
|
|
37
35
|
display: flex;
|
|
38
36
|
width: 48px;
|
|
@@ -40,11 +38,13 @@
|
|
|
40
38
|
justify-content: center;
|
|
41
39
|
align-items: center;
|
|
42
40
|
}
|
|
43
|
-
|
|
41
|
+
|
|
42
|
+
.account-info {
|
|
44
43
|
display: flex;
|
|
45
44
|
flex-direction: column;
|
|
46
45
|
align-items: flex-start;
|
|
47
46
|
}
|
|
47
|
+
|
|
48
48
|
.account-name {
|
|
49
49
|
display: -webkit-box;
|
|
50
50
|
-webkit-box-orient: vertical;
|
|
@@ -60,11 +60,13 @@
|
|
|
60
60
|
font-weight: 500;
|
|
61
61
|
line-height: 20px;
|
|
62
62
|
}
|
|
63
|
+
|
|
63
64
|
.account-more {
|
|
64
65
|
display: flex;
|
|
65
66
|
align-items: center;
|
|
66
67
|
color: #6b7180;
|
|
67
68
|
}
|
|
69
|
+
|
|
68
70
|
.account-more-name {
|
|
69
71
|
display: -webkit-box;
|
|
70
72
|
width: auto;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
</script>
|
|
3
|
-
|
|
4
1
|
<svg xmlns="http://www.w3.org/2000/svg" width="65" height="24" viewBox="0 0 65 24" fill="none">
|
|
5
2
|
<path
|
|
6
3
|
d="M22.6371 14.1927C21.6122 19.5775 16.8887 23.4706 11.4225 23.4706C5.12455 23.4706 0 18.3245 0 12C0 5.66061 5.12455 0.529419 11.4225 0.529419C16.9036 0.529419 21.6122 4.42256 22.6371 9.80732V1.17082H29.1282V3.82591C30.9404 1.54372 32.9604 0.529419 35.649 0.529419C40.3725 0.529419 43.2987 3.96015 43.2987 9.509V9.91173C44.1899 4.2734 48.5866 0.529419 54.3499 0.529419C60.6776 0.529419 65 5.31753 65 12.2983V13.7452H49.6115C50.072 16.9075 51.9138 18.7123 54.6766 18.7123C56.6967 18.7123 58.1524 17.7726 58.598 16.1616H64.7029C63.8414 20.547 59.8012 23.4706 54.5875 23.4706C48.7351 23.4706 44.2047 19.7117 43.2987 14.1032V22.8292H36.7036V10.1951C36.7036 7.48039 35.3668 5.97385 32.9753 5.97385C30.7324 5.97385 29.247 7.64447 29.247 10.1951V22.8292H22.6371V14.1927ZM58.5535 9.56866C58.1376 6.74949 56.5334 5.10871 54.2162 5.10871C51.8841 5.10871 50.2502 6.71966 49.7155 9.56866H58.5535Z"
|
|
@@ -10,4 +7,10 @@
|
|
|
10
7
|
d="M0.88623 12.3732H1.7069C1.75786 12.6506 1.91609 12.7718 2.23792 12.7718C2.50612 12.7718 2.68312 12.6344 2.68312 12.4244C2.68312 12.2708 2.56512 12.1712 2.32911 12.1308L2.00996 12.0769C1.27779 11.953 0.958643 11.681 0.958643 11.1801C0.958643 10.6495 1.47357 10.2752 2.20306 10.2752C2.93791 10.2752 3.37774 10.5741 3.47697 11.1451H2.66435C2.6268 10.9215 2.4632 10.8003 2.19769 10.8003C1.94827 10.8003 1.76322 10.9458 1.76322 11.1424C1.76322 11.2878 1.87854 11.3686 2.14674 11.4171L2.49271 11.479C3.20073 11.6056 3.51184 11.8884 3.51184 12.4055C3.51184 12.963 3.00495 13.3373 2.24865 13.3373C1.43871 13.3373 0.942551 12.9872 0.88623 12.3732ZM3.64862 11.8157C3.64862 10.9242 4.29228 10.2752 5.18 10.2752C6.06235 10.2752 6.68456 10.9 6.68456 11.7914C6.68456 12.6937 6.04894 13.3373 5.15854 13.3373C4.26814 13.3373 3.64862 12.7125 3.64862 11.8157ZM5.81562 11.7968C5.81562 11.2609 5.56351 10.9215 5.16391 10.9215C4.76966 10.9215 4.51756 11.2663 4.51756 11.8022C4.51756 12.3516 4.7643 12.691 5.16391 12.691C5.5662 12.691 5.81562 12.3462 5.81562 11.7968ZM6.63897 10.364H7.11099V10.084C7.11099 9.43758 7.406 9.1521 8.06844 9.1521C8.17839 9.1521 8.31249 9.16287 8.38758 9.17634V9.7877C8.33931 9.785 8.33931 9.785 8.28031 9.785C8.03893 9.785 7.95848 9.85503 7.95848 10.0705V10.364H8.79524V9.46182H9.64005V10.364H10.9596L11.2653 11.7376C11.3082 11.9342 11.3511 12.1443 11.386 12.3409C11.4289 12.1362 11.4798 11.9315 11.5308 11.7403L11.8875 10.3856H12.5794L12.9415 11.7403C12.9844 11.9073 13.0354 12.1227 13.0783 12.3058C13.1292 12.0284 13.1561 11.8938 13.1909 11.7403L13.4967 10.364H14.3307L13.5154 13.2485H12.7028L12.2174 11.4009L11.7427 13.2485H10.9059L10.273 10.9673H9.64005V12.2816C9.64005 12.5294 9.72855 12.6129 9.98601 12.6129C10.0611 12.6129 10.1013 12.6102 10.1764 12.5967V13.2215C10.0343 13.2485 9.87337 13.2673 9.74464 13.2673C9.06343 13.2673 8.79524 13.0142 8.79524 12.3705V10.9673H7.95848V13.2485H7.11099V10.9673H6.63897V10.364ZM14.1725 12.5051C14.1725 11.9827 14.5104 11.7187 15.3767 11.5706C15.8433 11.4925 16.0123 11.3848 16.0123 11.1639C16.0123 10.9431 15.8487 10.8084 15.5778 10.8084C15.2909 10.8084 15.1273 10.9404 15.1085 11.1909H14.3281C14.3897 10.5984 14.8323 10.2752 15.5859 10.2752C16.4173 10.2752 16.8276 10.6765 16.8276 11.4925V12.6371C16.8276 12.9926 16.8464 13.095 16.9403 13.2485H16.1249C16.0847 13.1515 16.0579 13.0411 16.0472 12.893C15.8246 13.1865 15.5376 13.3212 15.1407 13.3212C14.5399 13.3212 14.1725 13.0115 14.1725 12.5051ZM15.5376 12.0069C15.1353 12.0877 14.9851 12.2008 14.9851 12.4244C14.9851 12.6506 15.13 12.7799 15.3874 12.7799C15.7763 12.7799 16.015 12.5321 16.015 12.1362V11.8669C15.8916 11.9261 15.7897 11.9557 15.5376 12.0069ZM17.2487 10.364H18.0881V10.8057C18.2705 10.4745 18.5092 10.3156 18.831 10.3156C18.8686 10.3156 18.9463 10.3236 19.0107 10.3371V11.0427C18.9571 11.0293 18.9007 11.0239 18.7827 11.0239C18.3697 11.0239 18.1042 11.2905 18.1042 11.7053V13.2485H17.2487V10.364ZM18.9839 11.8157C18.9839 10.8973 19.5846 10.2752 20.4724 10.2752C21.3172 10.2752 21.8857 10.9108 21.8857 11.8615V12.0096H19.8341C19.8904 12.489 20.1371 12.761 20.5153 12.761C20.7995 12.761 20.9846 12.6263 21.0463 12.3813H21.8455C21.7302 12.9549 21.1938 13.3373 20.5045 13.3373C19.6007 13.3373 18.9839 12.7206 18.9839 11.8157ZM21.0436 11.506C20.99 11.067 20.7861 10.8327 20.4563 10.8327C20.1264 10.8327 19.9199 11.0643 19.8501 11.506H21.0436Z"
|
|
11
8
|
fill="white"
|
|
12
9
|
/>
|
|
13
|
-
</svg>
|
|
10
|
+
</svg>
|
|
11
|
+
|
|
12
|
+
<style>
|
|
13
|
+
svg {
|
|
14
|
+
display: block;
|
|
15
|
+
}
|
|
16
|
+
</style>
|