@softwareone/spi-sv5-library 1.0.0 → 1.2.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 (60) hide show
  1. package/README.md +75 -19
  2. package/dist/Accordion/Accordion.svelte +89 -0
  3. package/dist/Accordion/Accordion.svelte.d.ts +9 -0
  4. package/dist/Button/Button.svelte +12 -1
  5. package/dist/Button/Button.svelte.d.ts +1 -1
  6. package/dist/Card/Card.svelte +2 -16
  7. package/dist/Card/Card.svelte.d.ts +0 -1
  8. package/dist/Chips/Chips.svelte +31 -34
  9. package/dist/Chips/Chips.svelte.d.ts +1 -1
  10. package/dist/ErrorPage/ErrorPage.svelte +6 -7
  11. package/dist/ErrorPage/ErrorPage.svelte.d.ts +1 -2
  12. package/dist/Form/Input/Input.svelte +16 -43
  13. package/dist/Form/Input/Input.svelte.d.ts +3 -2
  14. package/dist/Form/Label.svelte +37 -0
  15. package/dist/Form/Label.svelte.d.ts +9 -0
  16. package/dist/Form/Select/Select.svelte +457 -0
  17. package/dist/Form/Select/Select.svelte.d.ts +22 -0
  18. package/dist/Form/Select/selectState.svelte.d.ts +4 -0
  19. package/dist/Form/Select/selectState.svelte.js +1 -0
  20. package/dist/Form/TextArea/TextArea.svelte +9 -27
  21. package/dist/Form/TextArea/TextArea.svelte.d.ts +2 -2
  22. package/dist/Header/Header.svelte +29 -33
  23. package/dist/Header/Header.svelte.d.ts +2 -3
  24. package/dist/Header/HeaderAccount.svelte +8 -6
  25. package/dist/Header/HeaderLoader.svelte +2 -2
  26. package/dist/Header/HeaderLogo.svelte +7 -4
  27. package/dist/Header/HeaderLogo.svelte.d.ts +14 -6
  28. package/dist/Menu/Menu.svelte +11 -11
  29. package/dist/Menu/MenuItem.svelte +7 -11
  30. package/dist/Modal/Modal.svelte +84 -27
  31. package/dist/Modal/Modal.svelte.d.ts +2 -9
  32. package/dist/Modal/ModalContent.svelte +4 -77
  33. package/dist/Modal/ModalContent.svelte.d.ts +2 -3
  34. package/dist/Modal/ModalFooter.svelte +17 -58
  35. package/dist/Modal/ModalFooter.svelte.d.ts +5 -5
  36. package/dist/Modal/ModalHeader.svelte +49 -31
  37. package/dist/Modal/ModalHeader.svelte.d.ts +5 -4
  38. package/dist/Modal/modalState.svelte.d.ts +15 -0
  39. package/dist/Modal/modalState.svelte.js +1 -0
  40. package/dist/Notification/Notification.svelte +69 -0
  41. package/dist/Notification/Notification.svelte.d.ts +4 -0
  42. package/dist/Notification/notificationState.svelte.d.ts +9 -0
  43. package/dist/Notification/notificationState.svelte.js +1 -0
  44. package/dist/ProgressPage/ProgressPage.svelte +95 -0
  45. package/dist/ProgressPage/ProgressPage.svelte.d.ts +11 -0
  46. package/dist/ProgressWizard/ProgressWizard.svelte +271 -278
  47. package/dist/ProgressWizard/ProgressWizard.svelte.d.ts +11 -13
  48. package/dist/ProgressWizard/progressWizardState.svelte.d.ts +6 -0
  49. package/dist/ProgressWizard/progressWizardState.svelte.js +1 -0
  50. package/dist/Search/Search.svelte +161 -0
  51. package/dist/Search/Search.svelte.d.ts +10 -0
  52. package/dist/Spinner/Spinner.svelte +23 -34
  53. package/dist/Spinner/Spinner.svelte.d.ts +3 -2
  54. package/dist/Toast/Toast.svelte +109 -42
  55. package/dist/Toast/toastState.svelte.d.ts +7 -3
  56. package/dist/Toast/toastState.svelte.js +13 -10
  57. package/dist/Tooltip/Tooltip.svelte +0 -2
  58. package/dist/index.d.ts +10 -2
  59. package/dist/index.js +7 -2
  60. package/package.json +4 -6
@@ -1,47 +1,65 @@
1
1
  <script lang="ts">
2
- import { OctagonAlert } from 'lucide-svelte';
2
+ import type { ModalHeaderProps } from './modalState.svelte.js';
3
3
 
4
- interface ModalHeaderProps {
5
- headerTitle?: string;
6
- }
7
-
8
- let { headerTitle }: ModalHeaderProps = $props();
9
-
10
- headerTitle = headerTitle || 'Modal title';
11
-
4
+ let {
5
+ title = '',
6
+ errorIcon = false,
7
+ onclose
8
+ }: ModalHeaderProps & { onclose: VoidFunction } = $props();
12
9
  </script>
13
10
 
14
- <div class="modal-header">
15
- <div class="modal-header-icon">
16
- <OctagonAlert size="32"/>
17
- </div>
18
- <div class="modal-header-title">{headerTitle}</div>
19
- </div>
11
+ <header class="modal-header">
12
+ <div class="modal-header-title">
13
+ {#if errorIcon}
14
+ <span class="icon error material-icons-outlined">report</span>
15
+ {/if}
16
+ <h2>{title}</h2>
17
+ </div>
18
+ <button type="button" class="close-button material-icons-outlined" onclick={onclose}>close</button
19
+ >
20
+ </header>
20
21
 
21
22
  <style>
22
- .modal-header {
23
+ .modal-header,
24
+ .modal-header-title {
23
25
  display: flex;
24
- padding: 24px;
25
- align-items: center;
26
+ justify-content: space-between;
26
27
  gap: 16px;
28
+ }
29
+ .modal-header {
30
+ padding: 24px;
27
31
  align-self: stretch;
28
- border-radius: 16px 16px 0px 0px;
29
- background: #fff;
30
32
  }
31
- .modal-header-icon {
32
- color: #dc182c;
33
+
34
+ .modal-header-title > .icon {
35
+ color: var(--color-icon);
33
36
  font-size: 32px;
34
- font-style: normal;
35
- font-weight: 400;
36
- line-height: normal;
37
37
  }
38
+
38
39
  .modal-header-title {
39
- flex: 1 0 0;
40
- color: #000;
41
- /* medium/4 */
40
+ align-items: center;
41
+ }
42
+
43
+ .modal-header-title h2 {
42
44
  font-size: 18px;
43
- font-style: normal;
44
- font-weight: 500;
45
- line-height: 26px;
45
+ font-weight: 600;
46
+ }
47
+
48
+ .modal-header > .close-button {
49
+ background: none;
50
+ border: none;
51
+ }
52
+
53
+ .modal-header > .close-button:hover {
54
+ cursor: pointer;
55
+ color: #434952;
56
+ }
57
+
58
+ .modal-header > .close-button:focus {
59
+ outline: none;
60
+ }
61
+
62
+ .icon.error {
63
+ --color-icon: #dc182c;
46
64
  }
47
65
  </style>
@@ -1,6 +1,7 @@
1
- interface ModalHeaderProps {
2
- headerTitle?: string;
3
- }
4
- declare const ModalHeader: import("svelte").Component<ModalHeaderProps, {}, "">;
1
+ import type { ModalHeaderProps } from './modalState.svelte.js';
2
+ type $$ComponentProps = ModalHeaderProps & {
3
+ onclose: VoidFunction;
4
+ };
5
+ declare const ModalHeader: import("svelte").Component<$$ComponentProps, {}, "">;
5
6
  type ModalHeader = ReturnType<typeof ModalHeader>;
6
7
  export default ModalHeader;
@@ -0,0 +1,15 @@
1
+ import type { Snippet } from 'svelte';
2
+ export interface ModalProps extends ModalHeaderProps, ModalFooterProps {
3
+ showModal?: boolean;
4
+ width?: WidthModal;
5
+ children?: Snippet;
6
+ onclose?: VoidFunction;
7
+ }
8
+ export interface ModalHeaderProps {
9
+ title?: string;
10
+ errorIcon?: boolean;
11
+ }
12
+ export interface ModalFooterProps {
13
+ footer?: Snippet;
14
+ }
15
+ export type WidthModal = 'xs' | 'md' | 'lg' | 'xl';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,69 @@
1
+ <script lang="ts">
2
+ import type { NotificationProps } from './notificationState.svelte';
3
+
4
+ let { title, disableBorder = false, content, type }: NotificationProps = $props();
5
+ </script>
6
+
7
+ <aside class="notification-container" class:border={!disableBorder}>
8
+ <span class="status-indicator {type}"></span>
9
+ <div class="notification-content">
10
+ {#if title}
11
+ <span class="title">{title}</span>
12
+ {/if}
13
+ {@render content()}
14
+ </div>
15
+ </aside>
16
+
17
+ <style>
18
+ .notification-container {
19
+ width: 100%;
20
+ height: 100%;
21
+ padding: 16px;
22
+ gap: 16px;
23
+ display: flex;
24
+ }
25
+
26
+ .border {
27
+ border: 1px solid #e0e5e8;
28
+ border-radius: 8px;
29
+ }
30
+
31
+ .status-indicator {
32
+ width: 8px;
33
+ border-radius: 4px;
34
+ background-color: var(--toast-bg);
35
+ }
36
+
37
+ .notification-content {
38
+ flex-direction: column;
39
+ flex: 1 1 0;
40
+ gap: 4px;
41
+ display: flex;
42
+ font-size: 14px;
43
+ line-height: 20px;
44
+ }
45
+
46
+ .title {
47
+ font-weight: 700;
48
+ }
49
+
50
+ .status-indicator.info {
51
+ --toast-bg: #472aff;
52
+ }
53
+
54
+ .status-indicator.warning {
55
+ --toast-bg: #e87d1e;
56
+ }
57
+
58
+ .status-indicator.danger {
59
+ --toast-bg: #dc182c;
60
+ }
61
+
62
+ .status-indicator.neutral {
63
+ --toast-bg: #6b7180;
64
+ }
65
+
66
+ .status-indicator.success {
67
+ --toast-bg: #008556;
68
+ }
69
+ </style>
@@ -0,0 +1,4 @@
1
+ import type { NotificationProps } from './notificationState.svelte';
2
+ declare const Notification: import("svelte").Component<NotificationProps, {}, "">;
3
+ type Notification = ReturnType<typeof Notification>;
4
+ export default Notification;
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ type NotificationType = 'info' | 'success' | 'warning' | 'danger' | 'neutral';
3
+ export interface NotificationProps {
4
+ title?: string;
5
+ type: NotificationType;
6
+ disableBorder?: boolean;
7
+ content: Snippet;
8
+ }
9
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,95 @@
1
+ <script lang="ts">
2
+ import { Button } from '../index.js';
3
+
4
+ type ProgressPageProps = {
5
+ iconName: string;
6
+ title: string;
7
+ description?: string;
8
+ documentationUrl?: string;
9
+ onclick?: VoidFunction;
10
+ buttonText?: string;
11
+ };
12
+
13
+ let {
14
+ iconName,
15
+ title,
16
+ description = '',
17
+ documentationUrl = '',
18
+ onclick,
19
+ buttonText = 'Save'
20
+ }: ProgressPageProps = $props();
21
+ </script>
22
+
23
+ <article class="progress-page">
24
+ <span class="material-icons-outlined progress-icon">{iconName}</span>
25
+ <div class="progress-content">
26
+ <p class="progress-title">{title}</p>
27
+ {#if description}
28
+ <p class="progress-description">{description}</p>
29
+ {/if}
30
+ {#if documentationUrl}
31
+ <p class="progress-documentation">
32
+ To see more details check
33
+ <a rel="noreferrer" class="progress-link" href={documentationUrl} target="_blank">
34
+ our documentation.
35
+ </a>
36
+ </p>
37
+ {/if}
38
+ </div>
39
+
40
+ {#if onclick}
41
+ <Button {onclick}>{buttonText}</Button>
42
+ {/if}
43
+ </article>
44
+
45
+ <style>
46
+ .progress-page {
47
+ display: flex;
48
+ flex-direction: column;
49
+ align-items: center;
50
+ padding: 24px;
51
+ max-width: 350px;
52
+ gap: 24px;
53
+ }
54
+
55
+ .progress-icon {
56
+ color: #472aff;
57
+ font-size: 32px;
58
+ }
59
+
60
+ .progress-content {
61
+ display: flex;
62
+ flex-direction: column;
63
+ text-align: center;
64
+ gap: 8px;
65
+ }
66
+
67
+ .progress-title {
68
+ font-size: 18px;
69
+ font-weight: 700;
70
+ color: #000;
71
+ line-height: 1.4;
72
+ }
73
+
74
+ .progress-description,
75
+ .progress-documentation {
76
+ font-size: 14px;
77
+ color: #000;
78
+ line-height: 1.4;
79
+ }
80
+
81
+ .progress-link {
82
+ color: #472aff;
83
+ text-decoration: none;
84
+ }
85
+
86
+ .progress-link:hover {
87
+ text-decoration: underline;
88
+ }
89
+
90
+ .progress-link:focus {
91
+ outline: 2px solid #472aff;
92
+ outline-offset: 2px;
93
+ border-radius: 2px;
94
+ }
95
+ </style>
@@ -0,0 +1,11 @@
1
+ type ProgressPageProps = {
2
+ iconName: string;
3
+ title: string;
4
+ description?: string;
5
+ documentationUrl?: string;
6
+ onclick?: VoidFunction;
7
+ buttonText?: string;
8
+ };
9
+ declare const ProgressPage: import("svelte").Component<ProgressPageProps, {}, "">;
10
+ type ProgressPage = ReturnType<typeof ProgressPage>;
11
+ export default ProgressPage;