@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.
Files changed (55) hide show
  1. package/dist/Avatar/Avatar.svelte +33 -0
  2. package/dist/Avatar/Avatar.svelte.d.ts +10 -0
  3. package/dist/Breadcrumbs/Breadcrumbs.svelte +10 -20
  4. package/dist/Button/Button.svelte +59 -119
  5. package/dist/Button/Button.svelte.d.ts +8 -6
  6. package/dist/Card/Card.svelte +18 -44
  7. package/dist/Card/Card.svelte.d.ts +1 -1
  8. package/dist/Chips/Chips.svelte +25 -28
  9. package/dist/Chips/Chips.svelte.d.ts +2 -1
  10. package/dist/Chips/chipsState.svelte.d.ts +7 -0
  11. package/dist/Chips/chipsState.svelte.js +8 -0
  12. package/dist/ErrorPage/ErrorPage.svelte +98 -0
  13. package/dist/ErrorPage/ErrorPage.svelte.d.ts +8 -0
  14. package/dist/Footer/Footer.svelte +29 -135
  15. package/dist/Footer/Footer.svelte.d.ts +1 -1
  16. package/dist/Form/Input/Input.svelte +398 -0
  17. package/dist/Form/Input/Input.svelte.d.ts +14 -0
  18. package/dist/Form/Input/InputIcon.svelte +97 -0
  19. package/dist/Form/Input/InputIcon.svelte.d.ts +9 -0
  20. package/dist/Form/TextArea/TextArea.svelte +258 -0
  21. package/dist/Form/TextArea/TextArea.svelte.d.ts +13 -0
  22. package/dist/Form/Toggle/Toggle.svelte +120 -0
  23. package/dist/{Toggle → Form/Toggle}/Toggle.svelte.d.ts +4 -3
  24. package/dist/Header/Header.svelte +55 -133
  25. package/dist/Header/Header.svelte.d.ts +2 -1
  26. package/dist/Header/HeaderAccount.svelte +6 -29
  27. package/dist/HighlightPanel/HighlightPanel.svelte +125 -0
  28. package/dist/HighlightPanel/HighlightPanel.svelte.d.ts +10 -0
  29. package/dist/HighlightPanel/highlightPanelState.svelte.d.ts +35 -0
  30. package/dist/HighlightPanel/highlightPanelState.svelte.js +13 -0
  31. package/dist/Menu/Menu.svelte +158 -0
  32. package/dist/Menu/Menu.svelte.d.ts +8 -0
  33. package/dist/Menu/MenuItem.svelte +153 -0
  34. package/dist/Menu/MenuItem.svelte.d.ts +11 -0
  35. package/dist/Menu/Sidebar.svelte +228 -0
  36. package/dist/Menu/Sidebar.svelte.d.ts +11 -0
  37. package/dist/Menu/SidebarState.svelte.d.ts +6 -0
  38. package/dist/Menu/SidebarState.svelte.js +1 -0
  39. package/dist/Modal/Modal.svelte +2 -3
  40. package/dist/Modal/ModalContent.svelte +11 -18
  41. package/dist/Modal/ModalFooter.svelte +10 -14
  42. package/dist/Modal/ModalHeader.svelte +7 -9
  43. package/dist/ProgressWizard/ProgressWizard.svelte +19 -34
  44. package/dist/Tabs/Tabs.svelte +111 -0
  45. package/dist/Tabs/Tabs.svelte.d.ts +8 -0
  46. package/dist/Tabs/tabsState.svelte.d.ts +7 -0
  47. package/dist/Tabs/tabsState.svelte.js +1 -0
  48. package/dist/Toast/Toast.svelte +7 -12
  49. package/dist/Tooltip/Tooltip.svelte +168 -0
  50. package/dist/Tooltip/Tooltip.svelte.d.ts +13 -0
  51. package/dist/assets/icons/feedback.svg +5 -0
  52. package/dist/index.d.ts +25 -8
  53. package/dist/index.js +23 -9
  54. package/package.json +2 -1
  55. 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: var(--brand-primary, #472aff);
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; /* 142.857% */
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: var(--brand-primary, #472aff);
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; /* 142.857% */
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: var(--brand-type, #000);
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; /* 144.444% */
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; /* Ensures visited links don't change color */
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
- interface ButtonProps {
3
- type?: 'primary' | 'secondary' | 'outline';
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
- let { type, variant, disabled, onClick, name }: ButtonProps = $props();
5
+ type Variant = 'primary' | 'secondary' | 'outline';
6
+ type VariantColor = 'primary' | 'danger';
11
7
 
12
- type = type || 'primary';
13
- variant = variant || 'primary';
14
- disabled = disabled || false;
15
- name = name || 'Button';
8
+ interface ButtonProps extends HTMLButtonAttributes {
9
+ variant?: Variant;
10
+ variantColor?: VariantColor;
11
+ children: Snippet;
12
+ }
16
13
 
17
- let className = `btn-${type}-${variant}`;
14
+ let { variant = 'primary', variantColor = 'primary', children, ...props }: ButtonProps = $props();
18
15
  </script>
19
16
 
20
- <button class={className} {disabled} onclick={onClick}>{name}</button>
17
+ <button class="btn btn-{variant}-{variantColor}" {...props}>
18
+ {@render children()}
19
+ </button>
21
20
 
22
21
  <style>
23
- .btn-primary-primary,
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; /* 142.857% */
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-primary-primary:hover,
48
- .btn-primary-primary:focus {
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-primary-primary:focus {
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-primary-primary:disabled {
58
- background: var(--brand-primary, #e0e5e8);
59
- color: var(--brand-white, #6b7180);
43
+ .btn:disabled {
44
+ background: #e0e5e8;
45
+ color: #6b7180;
60
46
  cursor: not-allowed;
61
47
  }
62
48
 
63
- .btn-secondary-primary {
64
- background: var(--brand-primary, #eaecff);
65
- color: var(--brand-white, #472aff);
49
+ .btn-primary-primary {
50
+ background: #472aff;
51
+ color: #fff;
66
52
  }
67
53
 
68
- .btn-secondary-primary:hover,
69
- .btn-secondary-primary:focus {
70
- background: var(--brand-primary, #472aff);
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:focus {
76
- box-shadow: 0px 0px 0px 3px #959bff;
59
+ .btn-secondary-primary {
60
+ background: #eaecff;
61
+ color: #472aff;
77
62
  }
78
63
 
79
- .btn-secondary-primary:disabled {
80
- background: var(--brand-primary, #e0e5e8);
81
- color: var(--brand-white, #6b7180);
82
- cursor: not-allowed;
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 var(--brand-primary, #472aff);
87
- background: var(--brand-primary, #fff);
88
- color: var(--brand-primary, #472aff);
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
- background: var(--brand-primary, #e0e5e8);
103
- color: var(--brand-white, #6b7180);
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: var(--brand-primary, #dc182c);
109
- color: var(--brand-white, #fff);
82
+ background: #dc182c;
83
+ color: #fff;
110
84
  }
111
85
 
112
- .btn-primary-danger:hover,
113
- .btn-primary-danger:focus {
114
- background: var(--brand-primary, #bb1425);
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: var(--brand-primary, #fce8ea);
130
- color: var(--brand-white, #dc182c);
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
- background: var(--brand-primary, #e0e5e8);
146
- color: var(--brand-white, #6b7180);
147
- cursor: not-allowed;
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 var(--brand-primary, #dc182c);
152
- background: var(--brand-primary, #fff);
153
- color: var(--brand-primary, #dc182c);
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:focus {
163
- box-shadow: 0px 0px 0px 3px #959bff;
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
- interface ButtonProps {
2
- type?: 'primary' | 'secondary' | 'outline';
3
- variant?: 'primary' | 'danger';
4
- disabled?: boolean;
5
- onClick?: () => void;
6
- name?: string;
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>;
@@ -3,70 +3,44 @@
3
3
 
4
4
  interface CardProps {
5
5
  alignItems?: 'left' | 'center' | 'right';
6
- type?: 'default' | 'layout';
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
- class={getCardType(type)}
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
- background: var(--brand-white, #fff);
45
- border-radius: var(--Card-radius, 24px);
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 0px rgba(107, 113, 128, 0.1),
48
- 0px 1px 3px 0px rgba(107, 113, 128, 0.2);
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: calc(100vh);
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>
@@ -1,7 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  interface CardProps {
3
3
  alignItems?: 'left' | 'center' | 'right';
4
- type?: 'default' | 'layout';
4
+ type?: 'layout' | 'highlight';
5
5
  children?: Snippet;
6
6
  }
7
7
  declare const Card: import("svelte").Component<CardProps, {}, "">;
@@ -1,12 +1,14 @@
1
1
  <script lang="ts">
2
+ import { ChipType } from '../index.js';
3
+
2
4
  interface ChipsProps {
3
- type?: 'info' | 'success' | 'warning' | 'error' | 'neutral';
5
+ type?: ChipType;
4
6
  text?: string;
5
7
  }
6
8
 
7
9
  let { type, text }: ChipsProps = $props();
8
10
 
9
- type = type || 'info';
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; /* 142.857% */
32
-
33
- /* Default colors (can be overridden by specific types) */
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, #959bff);
37
+ background: var(--chip-hover);
40
38
  }
41
39
 
42
40
  .chip:focus {
43
- background: var(--chip-hover, #959bff);
44
- box-shadow: 0px 0px 0px 3px var(--chip-hover, #959bff);
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: var(--alerts-info-1, #eaecff);
50
- --chip-text: var(--alerts-info-3, #3520bf);
51
- --chip-hover: var(--alerts-info-2, #959bff);
46
+ --chip-bg: #eaecff;
47
+ --chip-text: #3520bf;
48
+ --chip-hover: #959bff;
52
49
  }
53
50
 
54
51
  .chip-success {
55
- --chip-bg: var(--alerts-success-1, #e6f9f2);
56
- --chip-text: var(--alerts-success-3, #00784d);
57
- --chip-hover: var(--alerts-success-2, #80e1ae);
52
+ --chip-bg: #e6f9f2;
53
+ --chip-text: #00784d;
54
+ --chip-hover: #80e1ae;
58
55
  }
59
56
 
60
57
  .chip-warning {
61
- --chip-bg: var(--alerts-warning-1, #fdf2e9);
62
- --chip-text: var(--alerts-warning-3, #a15d26);
63
- --chip-hover: var(--alerts-warning-2, #f1b178);
58
+ --chip-bg: #fdf2e9;
59
+ --chip-text: #a15d26;
60
+ --chip-hover: #f1b178;
64
61
  }
65
62
 
66
63
  .chip-error {
67
- --chip-bg: var(--alerts-error-1, #fce8ea);
68
- --chip-text: var(--alerts-error-3, #bb1425);
69
- --chip-hover: var(--alerts-error-2, #ee8c96);
64
+ --chip-bg: #fce8ea;
65
+ --chip-text: #bb1425;
66
+ --chip-hover: #ee8c96;
70
67
  }
71
68
 
72
69
  .chip-neutral {
73
- --chip-bg: var(--alerts-neutral-1, #f4f6f8);
74
- --chip-text: var(--alerts-neutral-3, #434952);
75
- --chip-hover: var(--alerts-neutral-2, #e0e5e8);
70
+ --chip-bg: #f4f6f8;
71
+ --chip-text: #434952;
72
+ --chip-hover: #e0e5e8;
76
73
  }
77
74
  </style>
@@ -1,5 +1,6 @@
1
+ import { ChipType } from '../index.js';
1
2
  interface ChipsProps {
2
- type?: 'info' | 'success' | 'warning' | 'error' | 'neutral';
3
+ type?: ChipType;
3
4
  text?: string;
4
5
  }
5
6
  declare const Chips: import("svelte").Component<ChipsProps, {}, "">;
@@ -0,0 +1,7 @@
1
+ export declare enum ChipType {
2
+ Info = "info",
3
+ Success = "success",
4
+ Warning = "warning",
5
+ Error = "error",
6
+ Neutral = "neutral"
7
+ }
@@ -0,0 +1,8 @@
1
+ export var ChipType;
2
+ (function (ChipType) {
3
+ ChipType["Info"] = "info";
4
+ ChipType["Success"] = "success";
5
+ ChipType["Warning"] = "warning";
6
+ ChipType["Error"] = "error";
7
+ ChipType["Neutral"] = "neutral";
8
+ })(ChipType || (ChipType = {}));
@@ -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>