@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.
Files changed (41) hide show
  1. package/README.md +75 -19
  2. package/dist/Button/Button.svelte +12 -1
  3. package/dist/Button/Button.svelte.d.ts +1 -1
  4. package/dist/Chips/Chips.svelte +31 -34
  5. package/dist/Chips/Chips.svelte.d.ts +1 -1
  6. package/dist/ErrorPage/ErrorPage.svelte +5 -7
  7. package/dist/ErrorPage/ErrorPage.svelte.d.ts +1 -2
  8. package/dist/Form/Input/Input.svelte +7 -12
  9. package/dist/Form/Input/Input.svelte.d.ts +2 -2
  10. package/dist/Form/TextArea/TextArea.svelte +6 -4
  11. package/dist/Form/TextArea/TextArea.svelte.d.ts +2 -2
  12. package/dist/Header/Header.svelte +29 -33
  13. package/dist/Header/Header.svelte.d.ts +2 -3
  14. package/dist/Header/HeaderAccount.svelte +8 -6
  15. package/dist/Header/HeaderLoader.svelte +2 -2
  16. package/dist/Header/HeaderLogo.svelte +7 -4
  17. package/dist/Header/HeaderLogo.svelte.d.ts +14 -6
  18. package/dist/Menu/Menu.svelte +11 -11
  19. package/dist/Menu/MenuItem.svelte +7 -11
  20. package/dist/Modal/Modal.svelte +80 -27
  21. package/dist/Modal/Modal.svelte.d.ts +2 -9
  22. package/dist/Modal/ModalContent.svelte +4 -77
  23. package/dist/Modal/ModalContent.svelte.d.ts +2 -3
  24. package/dist/Modal/ModalFooter.svelte +17 -58
  25. package/dist/Modal/ModalFooter.svelte.d.ts +5 -5
  26. package/dist/Modal/ModalHeader.svelte +49 -31
  27. package/dist/Modal/ModalHeader.svelte.d.ts +5 -4
  28. package/dist/Modal/modalState.svelte.d.ts +15 -0
  29. package/dist/Modal/modalState.svelte.js +1 -0
  30. package/dist/ProgressWizard/ProgressWizard.svelte +272 -278
  31. package/dist/ProgressWizard/ProgressWizard.svelte.d.ts +11 -13
  32. package/dist/ProgressWizard/progressWizardState.svelte.d.ts +6 -0
  33. package/dist/ProgressWizard/progressWizardState.svelte.js +1 -0
  34. package/dist/Search/Search.svelte +154 -0
  35. package/dist/Search/Search.svelte.d.ts +10 -0
  36. package/dist/Toast/Toast.svelte +109 -37
  37. package/dist/Toast/toastState.svelte.d.ts +7 -3
  38. package/dist/Toast/toastState.svelte.js +13 -10
  39. package/dist/index.d.ts +5 -2
  40. package/dist/index.js +3 -2
  41. package/package.json +4 -6
@@ -1,5 +1,18 @@
1
+ export default HeaderLogo;
2
+ type HeaderLogo = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const HeaderLogo: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
1
14
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
15
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
3
16
  $$bindings?: Bindings;
4
17
  } & Exports;
5
18
  (internal: unknown, props: {
@@ -11,8 +24,3 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
24
  };
12
25
  z_$$bindings?: Bindings;
13
26
  }
14
- declare const HeaderLogo: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
- [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
17
- type HeaderLogo = InstanceType<typeof HeaderLogo>;
18
- export default HeaderLogo;
@@ -2,8 +2,8 @@
2
2
  import { goto } from '$app/navigation';
3
3
  import { page } from '$app/state';
4
4
 
5
- import type { MenuItem } from './SidebarState.svelte';
6
5
  import MainMenuItem from './MenuItem.svelte';
6
+ import type { MenuItem } from './SidebarState.svelte';
7
7
 
8
8
  interface MenuProps {
9
9
  disableMenuButton?: boolean;
@@ -38,7 +38,7 @@
38
38
 
39
39
  const onClickMenuItem = (menuItem: MenuItem) => {
40
40
  onHandleMenu();
41
- goto(String(menuItem.url));
41
+ goto(menuItem.url);
42
42
  };
43
43
 
44
44
  const onHandleMenu = () => {
@@ -82,7 +82,10 @@
82
82
 
83
83
  <style>
84
84
  .menu-button {
85
- border-radius: 0.375rem;
85
+ display: flex;
86
+ justify-content: center;
87
+ align-items: center;
88
+ border-radius: 50%;
86
89
  background: white;
87
90
  z-index: 40;
88
91
  cursor: pointer;
@@ -91,16 +94,13 @@
91
94
  height: 40px;
92
95
  }
93
96
 
94
- .icon-span {
95
- color: #25282d;
96
- font-size: 24px;
97
- font-weight: 400;
98
- line-height: 20px;
99
- word-wrap: break-word;
97
+ .menu-button:hover {
98
+ background: #e0e5e8;
100
99
  }
101
100
 
102
- .menu-button:hover {
103
- background-color: #f3f4f6;
101
+ .icon-span {
102
+ font-size: 32px;
103
+ color: #6b7180;
104
104
  }
105
105
 
106
106
  .menu-principal {
@@ -46,13 +46,8 @@
46
46
  transition: background-color 0.2s ease;
47
47
  }
48
48
 
49
- .item-name {
50
- height: 20px;
51
- justify-content: center;
52
- display: flex;
53
- flex-direction: column;
54
- }
55
49
  .item-name-span {
50
+ text-align: left;
56
51
  color: black;
57
52
  font-size: 14px;
58
53
  font-weight: 400;
@@ -60,10 +55,6 @@
60
55
  word-wrap: break-word;
61
56
  }
62
57
 
63
- .icon {
64
- text-align: center;
65
- }
66
-
67
58
  .icon-span {
68
59
  padding: 8px;
69
60
  color: black;
@@ -78,6 +69,7 @@
78
69
  .expanded {
79
70
  width: 188px;
80
71
  }
72
+
81
73
  .expanded:hover:not(.active-expanded) {
82
74
  background-color: #f4f6f8;
83
75
  }
@@ -94,13 +86,16 @@
94
86
  position: relative;
95
87
  width: 100%;
96
88
  }
89
+
97
90
  .collapsed .icon-span:hover {
98
91
  background-color: #f4f6f8;
99
92
  }
93
+
100
94
  .active-collapsed .icon-span {
101
95
  background-color: #eaecff;
102
96
  color: #472aff;
103
97
  }
98
+
104
99
  .active-collapsed .icon-span:hover {
105
100
  background-color: #eaecff;
106
101
  cursor: default;
@@ -129,6 +124,7 @@
129
124
  box-shadow: none;
130
125
  background-color: transparent;
131
126
  }
127
+
132
128
  .item.collapsed:focus-visible .icon-span,
133
129
  .item.expanded:focus-visible {
134
130
  box-shadow: 0 0 0 2px #472aff;
@@ -141,10 +137,10 @@
141
137
  }
142
138
 
143
139
  @media (max-width: 768px) {
144
- .item-name,
145
140
  .item-name-span {
146
141
  display: none;
147
142
  }
143
+
148
144
  .item {
149
145
  width: 100%;
150
146
  justify-content: center;
@@ -1,45 +1,98 @@
1
1
  <script lang="ts">
2
+ import { scale } from 'svelte/transition';
3
+
2
4
  import ModalContent from './ModalContent.svelte';
3
5
  import ModalFooter from './ModalFooter.svelte';
4
6
  import ModalHeader from './ModalHeader.svelte';
5
-
6
- interface ModalProps {
7
- headerTitle?: string;
8
- contentTitle?: string;
9
- contentMessage?: string;
10
- contentCodeMessage?: string;
11
- cancelButton?: () => void;
12
- okButton?: () => void;
13
- }
7
+ import type { ModalProps } from './modalState.svelte.js';
14
8
 
15
9
  let {
16
- headerTitle,
17
- contentTitle,
18
- contentMessage,
19
- contentCodeMessage,
20
- cancelButton,
21
- okButton
10
+ showModal = $bindable(false),
11
+ title,
12
+ width = 'md',
13
+ errorIcon,
14
+ onclose = () => {},
15
+ children,
16
+ footer
22
17
  }: ModalProps = $props();
18
+
19
+ let dialog = $state<HTMLDialogElement>();
20
+
21
+ $effect(() => {
22
+ showModal ? dialog?.showModal() : dialog?.close();
23
+ });
24
+
25
+ const onHandleClose = () => {
26
+ showModal = false;
27
+ onclose();
28
+ };
23
29
  </script>
24
30
 
25
- <div class="modal">
26
- <ModalHeader {headerTitle} />
27
- <ModalContent {contentTitle} {contentMessage} {contentCodeMessage} />
28
- <ModalFooter {cancelButton} {okButton} />
29
- </div>
31
+ <dialog
32
+ bind:this={dialog}
33
+ onclose={onHandleClose}
34
+ class="modal {width}"
35
+ transition:scale={{
36
+ duration: 150,
37
+ start: 0.95
38
+ }}
39
+ >
40
+ <ModalHeader {title} {errorIcon} onclose={onHandleClose} />
41
+ <ModalContent content={children} />
42
+ <ModalFooter {footer} onclose={onHandleClose} />
43
+ </dialog>
30
44
 
31
45
  <style>
32
- .modal {
33
- display: inline-flex;
34
- min-width: 500px;
35
- min-height: 250px;
36
- flex-direction: column;
37
- align-items: flex-start;
46
+ dialog {
47
+ align-self: center;
38
48
  border-radius: 16px;
39
- background: #fff;
49
+ background-color: #ffffff;
50
+ border: none;
51
+ margin: auto;
40
52
  box-shadow:
41
53
  0px 1px 10px 0px rgba(51, 56, 64, 0.12),
42
54
  0px 2px 4px -1px rgba(51, 56, 64, 0.2),
43
55
  0px 4px 5px 0px rgba(51, 56, 64, 0.14);
44
56
  }
57
+
58
+ dialog:focus-visible {
59
+ outline: none;
60
+ }
61
+
62
+ dialog::backdrop {
63
+ background: #e0e5e880;
64
+ }
65
+
66
+ dialog::-webkit-scrollbar {
67
+ width: 10px;
68
+ }
69
+
70
+ dialog::-webkit-scrollbar-thumb {
71
+ background: #888;
72
+ border-radius: 10px;
73
+ }
74
+
75
+ dialog::-webkit-scrollbar-thumb:hover {
76
+ background: #555;
77
+ }
78
+
79
+ .modal {
80
+ width: var(--modal-width);
81
+ }
82
+
83
+ .modal.md {
84
+ --modal-width: 600px;
85
+ }
86
+
87
+ .modal.lg {
88
+ --modal-width: 800px;
89
+ }
90
+
91
+ .modal.xl {
92
+ --modal-width: 1000px;
93
+ }
94
+
95
+ :global(html:has(dialog.modal[open])) {
96
+ overflow: hidden;
97
+ }
45
98
  </style>
@@ -1,11 +1,4 @@
1
- interface ModalProps {
2
- headerTitle?: string;
3
- contentTitle?: string;
4
- contentMessage?: string;
5
- contentCodeMessage?: string;
6
- cancelButton?: () => void;
7
- okButton?: () => void;
8
- }
9
- declare const Modal: import("svelte").Component<ModalProps, {}, "">;
1
+ import type { ModalProps } from './modalState.svelte.js';
2
+ declare const Modal: import("svelte").Component<ModalProps, {}, "showModal">;
10
3
  type Modal = ReturnType<typeof Modal>;
11
4
  export default Modal;
@@ -1,46 +1,15 @@
1
1
  <script lang="ts">
2
- import { Copy, Check } from 'lucide-svelte'
2
+ import type { Snippet } from 'svelte';
3
3
 
4
4
  interface ModalContentProps {
5
- contentTitle?: string;
6
- contentMessage?: string;
7
- contentCodeMessage?: string;
5
+ content?: Snippet;
8
6
  }
9
7
 
10
- let { contentTitle, contentMessage, contentCodeMessage }: ModalContentProps = $props();
11
-
12
- let copyCodeContent = $state(contentCodeMessage);
13
- let copyCodeState = $state(false);
14
-
15
- function copyCode() {
16
- navigator.clipboard.writeText(copyCodeContent);
17
- copyCodeState = true;
18
- }
19
-
20
- contentTitle = contentTitle || 'Error title';
21
- contentMessage =
22
- contentMessage ||
23
- 'The text displayed here serves as a placeholder for the error modal content.';
24
- contentCodeMessage =
25
- contentCodeMessage ||
26
- `Placeholder error code:# Handle specific error: invalid value error_message = f"Error: Invalid value - {ve}" return {'error': error_message, 'error_code': 400}`;
8
+ let { content }: ModalContentProps = $props();
27
9
  </script>
28
10
 
29
11
  <div class="modal-content">
30
- <div class="modal-content-title">{contentTitle}</div>
31
- <div class="modal-content-message">{contentMessage}</div>
32
- <div class="modal-content-code-content">
33
- <div class="modal-content-code-content-message">
34
- {contentCodeMessage}
35
- </div>
36
- {#if copyCodeState === false}
37
- <button class="modal-content-code-content-vector" aria-label="copy" onclick={copyCode}>
38
- <Copy size="20"/>
39
- </button>
40
- {:else}
41
- <Check size="20" color="#472aff" />
42
- {/if}
43
- </div>
12
+ {@render content?.()}
44
13
  </div>
45
14
 
46
15
  <style>
@@ -54,46 +23,4 @@
54
23
  background: #fff;
55
24
  border-top: 1px solid #aeb1b9;
56
25
  }
57
- .modal-content-title {
58
- align-self: stretch;
59
- color: #000;
60
- font-size: 14px;
61
- font-style: normal;
62
- font-weight: 600;
63
- line-height: 20px;
64
- }
65
- .modal-content-message {
66
- align-self: stretch;
67
- color: #000;
68
- font-size: 14px;
69
- font-style: normal;
70
- font-weight: 400;
71
- line-height: 20px;
72
- }
73
- .modal-content-code-content {
74
- display: flex;
75
- padding: 13px 14px 13px 28px;
76
- align-items: flex-start;
77
- gap: 20px;
78
- border-radius: 4px;
79
- background: #f4f6f8;
80
- }
81
- .modal-content-code-content-message {
82
- width: 368px;
83
- color: #6b7180;
84
- font-size: 12px;
85
- font-style: normal;
86
- font-weight: 400;
87
- line-height: normal;
88
- }
89
- .modal-content-code-content-vector {
90
- width: 17px;
91
- height: 20px;
92
- fill: #000;
93
- border: none;
94
- background: transparent;
95
- }
96
- .modal-content-code-content-vector:hover {
97
- cursor: pointer;
98
- }
99
26
  </style>
@@ -1,7 +1,6 @@
1
+ import type { Snippet } from 'svelte';
1
2
  interface ModalContentProps {
2
- contentTitle?: string;
3
- contentMessage?: string;
4
- contentCodeMessage?: string;
3
+ content?: Snippet;
5
4
  }
6
5
  declare const ModalContent: import("svelte").Component<ModalContentProps, {}, "">;
7
6
  type ModalContent = ReturnType<typeof ModalContent>;
@@ -1,72 +1,31 @@
1
1
  <script lang="ts">
2
+ import Button from '../Button/Button.svelte';
3
+ import type { ModalFooterProps } from './modalState.svelte.js';
2
4
 
3
- interface ModalFooterProps {
4
- cancelButton?: () => void;
5
- okButton?: () => void;
6
- }
7
-
8
- let { cancelButton, okButton }: ModalFooterProps = $props();
9
-
10
- cancelButton =
11
- cancelButton ||
12
- function () {
13
- console.log('cancelButton');
14
- };
15
- okButton =
16
- okButton ||
17
- function () {
18
- console.log('okButton');
19
- };
5
+ let { footer, onclose }: ModalFooterProps & { onclose: VoidFunction } = $props();
20
6
  </script>
21
7
 
22
- <div class="modal-footer">
23
- <button class="modal-footer-text-button" onclick={cancelButton}>Cancel</button>
24
- <button class="modal-footer-primary-button" onclick={okButton}>Ok</button>
25
- </div>
8
+ {#if footer}
9
+ <footer class="modal-footer">
10
+ <Button variant="outline-none" onclick={onclose}>Cancel</Button>
11
+ <div class="button-section">
12
+ {@render footer()}
13
+ </div>
14
+ </footer>
15
+ {/if}
26
16
 
27
17
  <style>
28
- .modal-footer {
18
+ .modal-footer,
19
+ .button-section {
29
20
  display: flex;
21
+ gap: 16px;
22
+ }
23
+ .modal-footer {
24
+ width: 100%;
30
25
  padding: 24px;
31
26
  justify-content: space-between;
32
- align-items: flex-start;
33
- align-self: stretch;
34
27
  border-radius: 0px 0px 16px 16px;
35
28
  border-top: 1px solid #aeb1b9;
36
29
  background: #fff;
37
30
  }
38
- .modal-footer-text-button {
39
- display: inline-flex;
40
- padding: 8px;
41
- align-items: flex-start;
42
- gap: 8px;
43
- border-radius: 8px;
44
- border: none;
45
- background: #fff;
46
- color: #472aff;
47
- font-size: 14px;
48
- font-style: normal;
49
- font-weight: 400;
50
- line-height: 20px;
51
- }
52
- .modal-footer-text-button:hover {
53
- cursor: pointer;
54
- }
55
- .modal-footer-primary-button {
56
- display: flex;
57
- padding: 8px 16px;
58
- align-items: flex-start;
59
- gap: 8px;
60
- border-radius: 8px;
61
- border: none;
62
- background: #472aff;
63
- color: #fff;
64
- font-size: 14px;
65
- font-style: normal;
66
- font-weight: 400;
67
- line-height: 20px;
68
- }
69
- .modal-footer-primary-button:hover {
70
- cursor: pointer;
71
- }
72
31
  </style>
@@ -1,7 +1,7 @@
1
- interface ModalFooterProps {
2
- cancelButton?: () => void;
3
- okButton?: () => void;
4
- }
5
- declare const ModalFooter: import("svelte").Component<ModalFooterProps, {}, "">;
1
+ import type { ModalFooterProps } from './modalState.svelte.js';
2
+ type $$ComponentProps = ModalFooterProps & {
3
+ onclose: VoidFunction;
4
+ };
5
+ declare const ModalFooter: import("svelte").Component<$$ComponentProps, {}, "">;
6
6
  type ModalFooter = ReturnType<typeof ModalFooter>;
7
7
  export default ModalFooter;
@@ -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 = 'md' | 'lg' | 'xl';
@@ -0,0 +1 @@
1
+ export {};