@softwareone/spi-sv5-library 0.1.3 → 1.0.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/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 +59 -119
- 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 +25 -28
- 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 +98 -0
- package/dist/ErrorPage/ErrorPage.svelte.d.ts +8 -0
- package/dist/Footer/Footer.svelte +29 -135
- package/dist/Footer/Footer.svelte.d.ts +1 -1
- package/dist/Form/Input/Input.svelte +398 -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 +258 -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 +55 -133
- package/dist/Header/Header.svelte.d.ts +2 -1
- package/dist/Header/HeaderAccount.svelte +6 -29
- 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 +153 -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 +2 -3
- package/dist/Modal/ModalContent.svelte +11 -18
- package/dist/Modal/ModalFooter.svelte +10 -14
- package/dist/Modal/ModalHeader.svelte +7 -9
- package/dist/ProgressWizard/ProgressWizard.svelte +19 -34
- 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 +7 -12
- 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 +25 -8
- package/dist/index.js +23 -9
- package/package.json +2 -1
- package/dist/Toggle/Toggle.svelte +0 -170
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
type BackgroundColor = '#472AFF' | '#25282D';
|
|
3
|
+
type TextColor = '#333840' | '#FFFFFF';
|
|
4
|
+
|
|
5
|
+
interface AvatarProps {
|
|
6
|
+
text: string;
|
|
7
|
+
backgroundColor?: BackgroundColor;
|
|
8
|
+
textColor?: TextColor;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { text, backgroundColor = '#25282D', textColor = '#FFFFFF' }: AvatarProps = $props();
|
|
12
|
+
|
|
13
|
+
const avatarSrc = (name: string): string => {
|
|
14
|
+
const defaultValue = 'SO';
|
|
15
|
+
if (!name) return defaultValue;
|
|
16
|
+
const [lastName, firstName] = name.split(' ');
|
|
17
|
+
return `${firstName[0]}${lastName[0]}`.toUpperCase();
|
|
18
|
+
};
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<svg class="avatar" width="40" height="40" viewBox="0 0 40 40">
|
|
22
|
+
<circle cx="20" cy="20" r="20" fill={backgroundColor} />
|
|
23
|
+
<text x="20" y="25" text-anchor="middle" font-size="14" font-weight="normal" fill={textColor}>
|
|
24
|
+
{avatarSrc(text)}
|
|
25
|
+
</text>
|
|
26
|
+
</svg>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.avatar {
|
|
30
|
+
min-width: 40px;
|
|
31
|
+
min-height: 40px;
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type BackgroundColor = '#472AFF' | '#25282D';
|
|
2
|
+
type TextColor = '#333840' | '#FFFFFF';
|
|
3
|
+
interface AvatarProps {
|
|
4
|
+
text: string;
|
|
5
|
+
backgroundColor?: BackgroundColor;
|
|
6
|
+
textColor?: TextColor;
|
|
7
|
+
}
|
|
8
|
+
declare const Avatar: import("svelte").Component<AvatarProps, {}, "">;
|
|
9
|
+
type Avatar = ReturnType<typeof Avatar>;
|
|
10
|
+
export default Avatar;
|
|
@@ -32,56 +32,46 @@
|
|
|
32
32
|
|
|
33
33
|
<style>
|
|
34
34
|
.breadcrumb {
|
|
35
|
-
list-style: none;
|
|
36
35
|
display: inline-flex;
|
|
37
36
|
align-items: flex-end;
|
|
38
37
|
gap: 9px;
|
|
39
38
|
margin-left: 16px;
|
|
40
39
|
padding: 8px 16px;
|
|
41
|
-
color:
|
|
42
|
-
/* regular/2 */
|
|
43
|
-
font-family: 'Haas Grotesk Display Pro', sans-serif;
|
|
40
|
+
color: #472aff;
|
|
44
41
|
font-size: 14px;
|
|
45
42
|
font-style: normal;
|
|
46
43
|
font-weight: 400;
|
|
47
|
-
line-height: 20px;
|
|
44
|
+
line-height: 20px;
|
|
48
45
|
text-decoration-line: none;
|
|
49
46
|
}
|
|
47
|
+
|
|
50
48
|
.breadcrumb li::after {
|
|
51
49
|
content: '/';
|
|
52
50
|
margin-left: 8px;
|
|
53
|
-
color:
|
|
54
|
-
/* regular/2 */
|
|
55
|
-
font-family: 'Haas Grotesk Display Pro', sans-serif;
|
|
51
|
+
color: #472aff;
|
|
56
52
|
font-size: 14px;
|
|
57
53
|
font-style: normal;
|
|
58
54
|
font-weight: 400;
|
|
59
|
-
line-height: 20px;
|
|
55
|
+
line-height: 20px;
|
|
60
56
|
}
|
|
57
|
+
|
|
61
58
|
.breadcrumb li:last-child::after {
|
|
62
59
|
content: '';
|
|
63
60
|
}
|
|
61
|
+
|
|
64
62
|
.breadcrumbActive {
|
|
65
|
-
color:
|
|
66
|
-
/* bold/4 */
|
|
67
|
-
font-family: 'Haas Grotesk Display Pro', sans-serif;
|
|
63
|
+
color: #000;
|
|
68
64
|
font-size: 18px;
|
|
69
65
|
font-style: normal;
|
|
70
66
|
font-weight: 700;
|
|
71
|
-
line-height: 20px;
|
|
72
|
-
}
|
|
73
|
-
/* Prevent the visited (purple) color */
|
|
74
|
-
.breadcrumb a {
|
|
75
|
-
color: inherit; /* Keeps the same color as the parent */
|
|
76
|
-
text-decoration: none; /* Optional: removes underline */
|
|
67
|
+
line-height: 20px;
|
|
77
68
|
}
|
|
78
69
|
|
|
79
70
|
.breadcrumb a:visited {
|
|
80
|
-
color: inherit;
|
|
71
|
+
color: inherit;
|
|
81
72
|
}
|
|
82
73
|
|
|
83
74
|
.breadcrumb a:hover {
|
|
84
|
-
text-decoration: none; /* Optional: Add an underline on hover */
|
|
85
75
|
color: #2b1999;
|
|
86
76
|
}
|
|
87
77
|
</style>
|
|
@@ -1,172 +1,112 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
variant?: 'primary' | 'danger';
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
name?: string;
|
|
8
|
-
}
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
9
4
|
|
|
10
|
-
|
|
5
|
+
type Variant = 'primary' | 'secondary' | 'outline';
|
|
6
|
+
type VariantColor = 'primary' | 'danger';
|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
interface ButtonProps extends HTMLButtonAttributes {
|
|
9
|
+
variant?: Variant;
|
|
10
|
+
variantColor?: VariantColor;
|
|
11
|
+
children: Snippet;
|
|
12
|
+
}
|
|
16
13
|
|
|
17
|
-
let
|
|
14
|
+
let { variant = 'primary', variantColor = 'primary', children, ...props }: ButtonProps = $props();
|
|
18
15
|
</script>
|
|
19
16
|
|
|
20
|
-
<button class={
|
|
17
|
+
<button class="btn btn-{variant}-{variantColor}" {...props}>
|
|
18
|
+
{@render children()}
|
|
19
|
+
</button>
|
|
21
20
|
|
|
22
21
|
<style>
|
|
23
|
-
.btn
|
|
24
|
-
.btn-secondary-primary,
|
|
25
|
-
.btn-outline-primary,
|
|
26
|
-
.btn-primary-danger,
|
|
27
|
-
.btn-secondary-danger,
|
|
28
|
-
.btn-outline-danger {
|
|
29
|
-
display: inline-flex;
|
|
22
|
+
.btn {
|
|
30
23
|
padding: 8px 16px;
|
|
31
|
-
align-items: flex-start;
|
|
32
|
-
gap: 8px;
|
|
33
24
|
border-radius: 8px;
|
|
34
25
|
border: none;
|
|
35
|
-
font-family: 'Haas Grotesk Display Pro', sans-serif;
|
|
36
26
|
font-size: 14px;
|
|
37
27
|
font-style: normal;
|
|
38
28
|
font-weight: 400;
|
|
39
|
-
line-height: 20px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.btn-primary-primary {
|
|
43
|
-
background: var(--brand-primary, #472aff);
|
|
44
|
-
color: var(--brand-white, #fff);
|
|
29
|
+
line-height: 20px;
|
|
45
30
|
}
|
|
46
31
|
|
|
47
|
-
.btn
|
|
48
|
-
.btn
|
|
49
|
-
background: var(--brand-primary, #3520bf);
|
|
32
|
+
.btn:hover:not(:disabled),
|
|
33
|
+
.btn:focus:not(:disabled) {
|
|
50
34
|
cursor: pointer;
|
|
51
35
|
}
|
|
52
36
|
|
|
53
|
-
.btn
|
|
37
|
+
.btn:focus:not(:disabled),
|
|
38
|
+
.btn:focus-visible:not(:disabled) {
|
|
54
39
|
box-shadow: 0px 0px 0px 3px #959bff;
|
|
40
|
+
outline: none;
|
|
55
41
|
}
|
|
56
42
|
|
|
57
|
-
.btn
|
|
58
|
-
background:
|
|
59
|
-
color:
|
|
43
|
+
.btn:disabled {
|
|
44
|
+
background: #e0e5e8;
|
|
45
|
+
color: #6b7180;
|
|
60
46
|
cursor: not-allowed;
|
|
61
47
|
}
|
|
62
48
|
|
|
63
|
-
.btn-
|
|
64
|
-
background:
|
|
65
|
-
color:
|
|
49
|
+
.btn-primary-primary {
|
|
50
|
+
background: #472aff;
|
|
51
|
+
color: #fff;
|
|
66
52
|
}
|
|
67
53
|
|
|
68
|
-
.btn-
|
|
69
|
-
.btn-
|
|
70
|
-
background:
|
|
71
|
-
color: var(--brand-white, #fff);
|
|
72
|
-
cursor: pointer;
|
|
54
|
+
.btn-primary-primary:hover:not(:disabled),
|
|
55
|
+
.btn-primary-primary:focus:not(:disabled) {
|
|
56
|
+
background: #3520bf;
|
|
73
57
|
}
|
|
74
58
|
|
|
75
|
-
.btn-secondary-primary
|
|
76
|
-
|
|
59
|
+
.btn-secondary-primary {
|
|
60
|
+
background: #eaecff;
|
|
61
|
+
color: #472aff;
|
|
77
62
|
}
|
|
78
63
|
|
|
79
|
-
.btn-secondary-primary:disabled
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
64
|
+
.btn-secondary-primary:hover:not(:disabled),
|
|
65
|
+
.btn-secondary-primary:focus:not(:disabled) {
|
|
66
|
+
background: #472aff;
|
|
67
|
+
color: #fff;
|
|
83
68
|
}
|
|
84
69
|
|
|
85
70
|
.btn-outline-primary {
|
|
86
|
-
border: 1px solid
|
|
87
|
-
background:
|
|
88
|
-
color:
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.btn-outline-primary:hover,
|
|
92
|
-
.btn-outline-primary:focus {
|
|
93
|
-
background: var(--brand-primary, #eaecff);
|
|
94
|
-
cursor: pointer;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.btn-outline-primary:focus {
|
|
98
|
-
box-shadow: 0px 0px 0px 3px #959bff;
|
|
71
|
+
border: 1px solid #472aff;
|
|
72
|
+
background: #fff;
|
|
73
|
+
color: #472aff;
|
|
99
74
|
}
|
|
100
75
|
|
|
101
|
-
.btn-outline-primary:disabled
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
cursor: not-allowed;
|
|
76
|
+
.btn-outline-primary:hover:not(:disabled),
|
|
77
|
+
.btn-outline-primary:focus:not(:disabled) {
|
|
78
|
+
background: #eaecff;
|
|
105
79
|
}
|
|
106
80
|
|
|
107
81
|
.btn-primary-danger {
|
|
108
|
-
background:
|
|
109
|
-
color:
|
|
82
|
+
background: #dc182c;
|
|
83
|
+
color: #fff;
|
|
110
84
|
}
|
|
111
85
|
|
|
112
|
-
.btn-primary-danger:hover,
|
|
113
|
-
.btn-primary-danger:focus {
|
|
114
|
-
background:
|
|
115
|
-
cursor: pointer;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.btn-primary-danger:focus {
|
|
119
|
-
box-shadow: 0px 0px 0px 3px #959bff;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.btn-primary-danger:disabled {
|
|
123
|
-
background: var(--brand-primary, #e0e5e8);
|
|
124
|
-
color: var(--brand-white, #6b7180);
|
|
125
|
-
cursor: not-allowed;
|
|
86
|
+
.btn-primary-danger:hover:not(:disabled),
|
|
87
|
+
.btn-primary-danger:focus:not(:disabled) {
|
|
88
|
+
background: #bb1425;
|
|
126
89
|
}
|
|
127
90
|
|
|
128
91
|
.btn-secondary-danger {
|
|
129
|
-
background:
|
|
130
|
-
color:
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.btn-secondary-danger:hover,
|
|
134
|
-
.btn-secondary-danger:focus {
|
|
135
|
-
background: var(--brand-primary, #dc182c);
|
|
136
|
-
color: var(--brand-white, #fff);
|
|
137
|
-
cursor: pointer;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.btn-secondary-danger:focus {
|
|
141
|
-
box-shadow: 0px 0px 0px 3px #959bff;
|
|
92
|
+
background: #fce8ea;
|
|
93
|
+
color: #dc182c;
|
|
142
94
|
}
|
|
143
95
|
|
|
144
|
-
.btn-secondary-danger:disabled
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
96
|
+
.btn-secondary-danger:hover:not(:disabled),
|
|
97
|
+
.btn-secondary-danger:focus:not(:disabled) {
|
|
98
|
+
background: #dc182c;
|
|
99
|
+
color: #fff;
|
|
148
100
|
}
|
|
149
101
|
|
|
150
102
|
.btn-outline-danger {
|
|
151
|
-
border: 1px solid
|
|
152
|
-
background:
|
|
153
|
-
color:
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.btn-outline-danger:hover,
|
|
157
|
-
.btn-outline-danger:focus {
|
|
158
|
-
background: var(--brand-primary, #fce8ea);
|
|
159
|
-
cursor: pointer;
|
|
103
|
+
border: 1px solid #dc182c;
|
|
104
|
+
background: #fff;
|
|
105
|
+
color: #dc182c;
|
|
160
106
|
}
|
|
161
107
|
|
|
162
|
-
.btn-outline-danger:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
.btn-outline-danger:disabled {
|
|
167
|
-
background: var(--brand-primary, #e0e5e8);
|
|
168
|
-
color: var(--brand-white, #6b7180);
|
|
169
|
-
cursor: not-allowed;
|
|
170
|
-
border: none;
|
|
108
|
+
.btn-outline-danger:hover:not(:disabled),
|
|
109
|
+
.btn-outline-danger:focus:not(:disabled) {
|
|
110
|
+
background: #fce8ea;
|
|
171
111
|
}
|
|
172
112
|
</style>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
type Variant = 'primary' | 'secondary' | 'outline';
|
|
4
|
+
type VariantColor = 'primary' | 'danger';
|
|
5
|
+
interface ButtonProps extends HTMLButtonAttributes {
|
|
6
|
+
variant?: Variant;
|
|
7
|
+
variantColor?: VariantColor;
|
|
8
|
+
children: Snippet;
|
|
7
9
|
}
|
|
8
10
|
declare const Button: import("svelte").Component<ButtonProps, {}, "">;
|
|
9
11
|
type Button = ReturnType<typeof Button>;
|
package/dist/Card/Card.svelte
CHANGED
|
@@ -3,70 +3,44 @@
|
|
|
3
3
|
|
|
4
4
|
interface CardProps {
|
|
5
5
|
alignItems?: 'left' | 'center' | 'right';
|
|
6
|
-
type?: '
|
|
6
|
+
type?: 'layout' | 'highlight';
|
|
7
7
|
children?: Snippet;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
let { alignItems, type, children }: CardProps = $props();
|
|
11
|
-
|
|
12
|
-
alignItems = alignItems ?? 'left';
|
|
13
|
-
type = type ?? 'default';
|
|
14
|
-
|
|
15
|
-
const getCardType = (type: string): string => {
|
|
16
|
-
const types: Record<string, string> = {
|
|
17
|
-
layout: 'card-layout',
|
|
18
|
-
default: 'card'
|
|
19
|
-
};
|
|
20
|
-
return types[type] || 'card'; // Default to card if type is unknown
|
|
21
|
-
};
|
|
10
|
+
let { alignItems = 'left', type = 'layout', children }: CardProps = $props();
|
|
22
11
|
</script>
|
|
23
12
|
|
|
24
|
-
<div
|
|
25
|
-
|
|
26
|
-
data-align={alignItems}
|
|
27
|
-
>
|
|
28
|
-
<div class="card-content">
|
|
29
|
-
{@render children?.()}
|
|
30
|
-
</div>
|
|
13
|
+
<div class="card card-{type}" data-align={alignItems}>
|
|
14
|
+
{@render children?.()}
|
|
31
15
|
</div>
|
|
32
16
|
|
|
33
17
|
<style>
|
|
34
|
-
.card
|
|
35
|
-
.card-layout {
|
|
18
|
+
.card {
|
|
36
19
|
display: inline-flex;
|
|
37
|
-
margin-left: 24px;
|
|
38
|
-
margin-right: 48px;
|
|
39
|
-
margin-bottom: 24px;
|
|
40
|
-
height: calc(100vh);
|
|
41
|
-
min-width: 222px;
|
|
42
|
-
min-height: 222px;
|
|
43
20
|
flex-direction: column;
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
width: 100%;
|
|
22
|
+
min-width: 222px;
|
|
23
|
+
min-height: var(--card-min-height, auto);
|
|
24
|
+
background: #fff;
|
|
25
|
+
margin-bottom: 24px;
|
|
26
|
+
padding: 24px;
|
|
27
|
+
border-radius: 16px;
|
|
46
28
|
box-shadow:
|
|
47
|
-
0px 1px 16px
|
|
48
|
-
0px 1px 3px
|
|
29
|
+
0px 1px 16px rgba(107, 113, 128, 0.1),
|
|
30
|
+
0px 1px 3px rgba(107, 113, 128, 0.2);
|
|
49
31
|
}
|
|
50
32
|
|
|
51
33
|
.card-layout {
|
|
52
|
-
height:
|
|
53
|
-
width: calc(100% - 48px);
|
|
34
|
+
--card-min-height: 100vh;
|
|
54
35
|
}
|
|
55
36
|
|
|
56
|
-
.card[data-align='left']
|
|
57
|
-
.card-layout[data-align='left'] {
|
|
37
|
+
.card[data-align='left'] {
|
|
58
38
|
align-items: flex-start;
|
|
59
39
|
}
|
|
60
|
-
.card[data-align='center']
|
|
61
|
-
.card-layout[data-align='center'] {
|
|
40
|
+
.card[data-align='center'] {
|
|
62
41
|
align-items: center;
|
|
63
42
|
}
|
|
64
|
-
.card[data-align='right']
|
|
65
|
-
.card-layout[data-align='right'] {
|
|
43
|
+
.card[data-align='right'] {
|
|
66
44
|
align-items: flex-end;
|
|
67
45
|
}
|
|
68
|
-
|
|
69
|
-
.card-content {
|
|
70
|
-
padding: 24px;
|
|
71
|
-
}
|
|
72
46
|
</style>
|
package/dist/Chips/Chips.svelte
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { ChipType } from '../index.js';
|
|
3
|
+
|
|
2
4
|
interface ChipsProps {
|
|
3
|
-
type?:
|
|
5
|
+
type?: ChipType;
|
|
4
6
|
text?: string;
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
let { type, text }: ChipsProps = $props();
|
|
8
10
|
|
|
9
|
-
type = type ||
|
|
11
|
+
type = type || ChipType.Info;
|
|
10
12
|
text = text || type.charAt(0).toUpperCase() + type.slice(1); // Default to capitalized type
|
|
11
13
|
|
|
12
14
|
let className = `chip chip-${type}`;
|
|
@@ -17,61 +19,56 @@
|
|
|
17
19
|
</div>
|
|
18
20
|
|
|
19
21
|
<style>
|
|
20
|
-
/* Base chip styles */
|
|
21
22
|
.chip {
|
|
22
23
|
display: inline-flex;
|
|
23
24
|
padding: 2px 8px;
|
|
24
25
|
align-items: center;
|
|
25
26
|
gap: 8px;
|
|
26
27
|
border-radius: 4px;
|
|
27
|
-
font-family: 'Haas Grotesk Display Pro', sans-serif;
|
|
28
28
|
font-size: 14px;
|
|
29
29
|
font-style: normal;
|
|
30
30
|
font-weight: 400;
|
|
31
|
-
line-height: 20px;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
background: var(--chip-bg, #eaecff);
|
|
35
|
-
color: var(--chip-text, #3520bf);
|
|
31
|
+
line-height: 20px;
|
|
32
|
+
background: var(--chip-bg);
|
|
33
|
+
color: var(--chip-text);
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
.chip:hover {
|
|
39
|
-
background: var(--chip-hover
|
|
37
|
+
background: var(--chip-hover);
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
.chip:focus {
|
|
43
|
-
background: var(--chip-hover
|
|
44
|
-
box-shadow: 0px 0px 0px 3px var(--chip-hover
|
|
41
|
+
background: var(--chip-hover);
|
|
42
|
+
box-shadow: 0px 0px 0px 3px var(--chip-hover);
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
/* Type-specific styles using CSS variables */
|
|
48
45
|
.chip-info {
|
|
49
|
-
--chip-bg:
|
|
50
|
-
--chip-text:
|
|
51
|
-
--chip-hover:
|
|
46
|
+
--chip-bg: #eaecff;
|
|
47
|
+
--chip-text: #3520bf;
|
|
48
|
+
--chip-hover: #959bff;
|
|
52
49
|
}
|
|
53
50
|
|
|
54
51
|
.chip-success {
|
|
55
|
-
--chip-bg:
|
|
56
|
-
--chip-text:
|
|
57
|
-
--chip-hover:
|
|
52
|
+
--chip-bg: #e6f9f2;
|
|
53
|
+
--chip-text: #00784d;
|
|
54
|
+
--chip-hover: #80e1ae;
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
.chip-warning {
|
|
61
|
-
--chip-bg:
|
|
62
|
-
--chip-text:
|
|
63
|
-
--chip-hover:
|
|
58
|
+
--chip-bg: #fdf2e9;
|
|
59
|
+
--chip-text: #a15d26;
|
|
60
|
+
--chip-hover: #f1b178;
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
.chip-error {
|
|
67
|
-
--chip-bg:
|
|
68
|
-
--chip-text:
|
|
69
|
-
--chip-hover:
|
|
64
|
+
--chip-bg: #fce8ea;
|
|
65
|
+
--chip-text: #bb1425;
|
|
66
|
+
--chip-hover: #ee8c96;
|
|
70
67
|
}
|
|
71
68
|
|
|
72
69
|
.chip-neutral {
|
|
73
|
-
--chip-bg:
|
|
74
|
-
--chip-text:
|
|
75
|
-
--chip-hover:
|
|
70
|
+
--chip-bg: #f4f6f8;
|
|
71
|
+
--chip-text: #434952;
|
|
72
|
+
--chip-hover: #e0e5e8;
|
|
76
73
|
}
|
|
77
74
|
</style>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { goto } from '$app/navigation';
|
|
3
|
+
import { page } from '$app/state';
|
|
4
|
+
|
|
5
|
+
import { StatusCodes } from 'http-status-codes';
|
|
6
|
+
|
|
7
|
+
import FeedbackIcon from '../assets/icons/feedback.svg';
|
|
8
|
+
import { Button } from '../index.js';
|
|
9
|
+
|
|
10
|
+
interface ErrorPageProps {
|
|
11
|
+
status: StatusCodes;
|
|
12
|
+
title?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let { status, title }: ErrorPageProps = $props();
|
|
16
|
+
|
|
17
|
+
const errorTitle: Record<number, string> = {
|
|
18
|
+
[StatusCodes.NOT_FOUND]: 'Page not found',
|
|
19
|
+
[StatusCodes.FORBIDDEN]: 'Access denied',
|
|
20
|
+
[StatusCodes.INTERNAL_SERVER_ERROR]: 'An unexpected error occurred'
|
|
21
|
+
};
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<section class="feedback-container">
|
|
25
|
+
<img src={FeedbackIcon} class="feedback-icon" alt="Feedback icon" />
|
|
26
|
+
|
|
27
|
+
<div class="feedback-detail">
|
|
28
|
+
<h1>{title || errorTitle[status]}</h1>
|
|
29
|
+
{#if status === StatusCodes.NOT_FOUND}
|
|
30
|
+
<div>
|
|
31
|
+
<p>We couldn’t find the page:</p>
|
|
32
|
+
<p class="link">{page.url}</p>
|
|
33
|
+
</div>
|
|
34
|
+
{/if}
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<p class="feedback-information">
|
|
38
|
+
You can get to safety by either going to our homepage, by going to the previous page or by
|
|
39
|
+
<br />
|
|
40
|
+
<span class="link">contacting our support</span>.
|
|
41
|
+
</p>
|
|
42
|
+
|
|
43
|
+
<div class="feedback-footer">
|
|
44
|
+
<Button variant="outline" onclick={() => window.history.back()}>Back</Button>
|
|
45
|
+
<Button variant="primary" onclick={() => goto(page.url.origin)}>Go home</Button>
|
|
46
|
+
</div>
|
|
47
|
+
</section>
|
|
48
|
+
|
|
49
|
+
<style>
|
|
50
|
+
.feedback-container {
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
margin-left: auto;
|
|
54
|
+
margin-right: auto;
|
|
55
|
+
width: 350px;
|
|
56
|
+
padding: 24px;
|
|
57
|
+
gap: 32px;
|
|
58
|
+
border-radius: 16px;
|
|
59
|
+
background-color: #fff;
|
|
60
|
+
box-shadow:
|
|
61
|
+
0px 1px 16px rgba(107, 113, 128, 0.1),
|
|
62
|
+
0px 1px 3px rgba(107, 113, 128, 0.2);
|
|
63
|
+
align-items: center;
|
|
64
|
+
text-align: center;
|
|
65
|
+
font-size: 14px;
|
|
66
|
+
line-height: 20px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.feedback-icon {
|
|
70
|
+
width: 100px;
|
|
71
|
+
height: 100px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.feedback-detail {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
gap: 8px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.feedback-detail > h1 {
|
|
81
|
+
font-size: 24px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.feedback-detail .link {
|
|
85
|
+
word-break: break-all;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.feedback-footer {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: row;
|
|
91
|
+
justify-content: space-between;
|
|
92
|
+
align-self: stretch;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.link {
|
|
96
|
+
color: #472aff;
|
|
97
|
+
}
|
|
98
|
+
</style>
|