@softwareone/spi-sv5-library 1.1.0 → 1.3.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/Accordion/Accordion.svelte +89 -0
- package/dist/Accordion/Accordion.svelte.d.ts +9 -0
- package/dist/Card/Card.svelte +5 -21
- package/dist/Card/Card.svelte.d.ts +1 -2
- package/dist/ErrorPage/ErrorPage.svelte +1 -0
- package/dist/Form/Input/Input.svelte +11 -31
- package/dist/Form/Input/Input.svelte.d.ts +2 -0
- package/dist/Form/Label.svelte +52 -0
- package/dist/Form/Label.svelte.d.ts +10 -0
- package/dist/Form/Select/Select.svelte +459 -0
- package/dist/Form/Select/Select.svelte.d.ts +23 -0
- package/dist/Form/Select/selectState.svelte.d.ts +4 -0
- package/dist/Form/Select/selectState.svelte.js +1 -0
- package/dist/Form/TextArea/TextArea.svelte +5 -24
- package/dist/Form/TextArea/TextArea.svelte.d.ts +1 -0
- package/dist/HighlightPanel/HighlightPanel.svelte +4 -0
- package/dist/Home/Home.svelte +116 -0
- package/dist/Home/Home.svelte.d.ts +8 -0
- package/dist/Home/homeState.svelte.d.ts +4 -0
- package/dist/Home/homeState.svelte.js +1 -0
- package/dist/Modal/Modal.svelte +46 -47
- package/dist/Modal/modalState.svelte.d.ts +1 -1
- package/dist/Notification/Notification.svelte +69 -0
- package/dist/Notification/Notification.svelte.d.ts +4 -0
- package/dist/Notification/notificationState.svelte.d.ts +9 -0
- package/dist/Notification/notificationState.svelte.js +1 -0
- package/dist/ProgressPage/ProgressPage.svelte +95 -0
- package/dist/ProgressPage/ProgressPage.svelte.d.ts +11 -0
- package/dist/ProgressWizard/ProgressWizard.svelte +1 -2
- package/dist/Search/Search.svelte +12 -5
- package/dist/Spinner/Spinner.svelte +23 -34
- package/dist/Spinner/Spinner.svelte.d.ts +3 -2
- package/dist/Tabs/Tabs.svelte +3 -0
- package/dist/Toast/Toast.svelte +0 -5
- package/dist/Tooltip/Tooltip.svelte +0 -2
- package/dist/index.d.ts +8 -1
- package/dist/index.js +6 -1
- package/package.json +1 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface AccordionProps {
|
|
5
|
+
title: string;
|
|
6
|
+
disableBorder?: boolean;
|
|
7
|
+
content: Snippet;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { title, disableBorder = false, content }: AccordionProps = $props();
|
|
11
|
+
|
|
12
|
+
let isOpen = $state(false);
|
|
13
|
+
|
|
14
|
+
const toggleAccordion = () => {
|
|
15
|
+
isOpen = !isOpen;
|
|
16
|
+
};
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<aside class="accordion-container" class:border={!disableBorder}>
|
|
20
|
+
<div class="accordion-content">
|
|
21
|
+
<section class="header" class:is-open={isOpen}>
|
|
22
|
+
<button class="button" onclick={toggleAccordion}>
|
|
23
|
+
<span class="material-icons-outlined icon-span">
|
|
24
|
+
{isOpen ? 'keyboard_arrow_down' : 'keyboard_arrow_right'}
|
|
25
|
+
</span>
|
|
26
|
+
</button>
|
|
27
|
+
|
|
28
|
+
<h2 class="header-title">{title}</h2>
|
|
29
|
+
</section>
|
|
30
|
+
|
|
31
|
+
{#if isOpen}
|
|
32
|
+
{@render content()}
|
|
33
|
+
{/if}
|
|
34
|
+
</div>
|
|
35
|
+
</aside>
|
|
36
|
+
|
|
37
|
+
<style>
|
|
38
|
+
.accordion-container {
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
padding: 32px;
|
|
42
|
+
display: flex;
|
|
43
|
+
|
|
44
|
+
--border-color: #e0e5e8;
|
|
45
|
+
--color: #472aff;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.accordion-content {
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
flex: 1 1 0;
|
|
51
|
+
gap: 4px;
|
|
52
|
+
display: flex;
|
|
53
|
+
font-size: 14px;
|
|
54
|
+
line-height: 20px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.is-open {
|
|
58
|
+
padding-bottom: 10px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.header {
|
|
62
|
+
gap: 16px;
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.header-title {
|
|
67
|
+
font-weight: 600;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.border {
|
|
71
|
+
border: 1px solid var(--border-color);
|
|
72
|
+
border-radius: 8px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.button {
|
|
76
|
+
background: transparent;
|
|
77
|
+
border: none;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
border-radius: 50%;
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.icon-span {
|
|
86
|
+
color: var(--color);
|
|
87
|
+
font-size: 20px;
|
|
88
|
+
}
|
|
89
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface AccordionProps {
|
|
3
|
+
title: string;
|
|
4
|
+
disableBorder?: boolean;
|
|
5
|
+
content: Snippet;
|
|
6
|
+
}
|
|
7
|
+
declare const Accordion: import("svelte").Component<AccordionProps, {}, "">;
|
|
8
|
+
type Accordion = ReturnType<typeof Accordion>;
|
|
9
|
+
export default Accordion;
|
package/dist/Card/Card.svelte
CHANGED
|
@@ -2,45 +2,29 @@
|
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
|
|
4
4
|
interface CardProps {
|
|
5
|
-
alignItems?: 'left' | 'center' | 'right';
|
|
6
|
-
type?: 'layout' | 'highlight';
|
|
7
5
|
children?: Snippet;
|
|
6
|
+
disablePadding?: boolean;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
|
-
let {
|
|
9
|
+
let { children, disablePadding = false }: CardProps = $props();
|
|
11
10
|
</script>
|
|
12
11
|
|
|
13
|
-
<div class="card
|
|
12
|
+
<div class="card" class:padding={!disablePadding}>
|
|
14
13
|
{@render children?.()}
|
|
15
14
|
</div>
|
|
16
15
|
|
|
17
16
|
<style>
|
|
18
17
|
.card {
|
|
19
|
-
display: inline-flex;
|
|
20
|
-
flex-direction: column;
|
|
21
18
|
width: 100%;
|
|
22
|
-
min-width: 222px;
|
|
23
|
-
min-height: var(--card-min-height, auto);
|
|
24
19
|
background: #fff;
|
|
25
20
|
margin-bottom: 24px;
|
|
26
|
-
padding: 24px;
|
|
27
21
|
border-radius: 16px;
|
|
28
22
|
box-shadow:
|
|
29
23
|
0px 1px 16px rgba(107, 113, 128, 0.1),
|
|
30
24
|
0px 1px 3px rgba(107, 113, 128, 0.2);
|
|
31
25
|
}
|
|
32
26
|
|
|
33
|
-
.
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.card[data-align='left'] {
|
|
38
|
-
align-items: flex-start;
|
|
39
|
-
}
|
|
40
|
-
.card[data-align='center'] {
|
|
41
|
-
align-items: center;
|
|
42
|
-
}
|
|
43
|
-
.card[data-align='right'] {
|
|
44
|
-
align-items: flex-end;
|
|
27
|
+
.padding {
|
|
28
|
+
padding: 24px;
|
|
45
29
|
}
|
|
46
30
|
</style>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
interface CardProps {
|
|
3
|
-
alignItems?: 'left' | 'center' | 'right';
|
|
4
|
-
type?: 'layout' | 'highlight';
|
|
5
3
|
children?: Snippet;
|
|
4
|
+
disablePadding?: boolean;
|
|
6
5
|
}
|
|
7
6
|
declare const Card: import("svelte").Component<CardProps, {}, "">;
|
|
8
7
|
type Card = ReturnType<typeof Card>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
3
|
import InputIcon from './InputIcon.svelte';
|
|
4
|
+
import Label from '../Label.svelte';
|
|
4
5
|
|
|
5
6
|
type InputType = 'text' | 'password' | 'number' | 'date' | 'money';
|
|
6
7
|
|
|
@@ -12,6 +13,8 @@
|
|
|
12
13
|
error?: string | string[];
|
|
13
14
|
description?: string;
|
|
14
15
|
currency?: string;
|
|
16
|
+
disableValidationColor?: boolean;
|
|
17
|
+
infoTooltip?: string;
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
let {
|
|
@@ -19,14 +22,16 @@
|
|
|
19
22
|
type = 'text',
|
|
20
23
|
value = $bindable(''),
|
|
21
24
|
optional = false,
|
|
25
|
+
required = false,
|
|
22
26
|
error,
|
|
23
27
|
description,
|
|
24
28
|
currency,
|
|
25
29
|
id,
|
|
26
30
|
disabled,
|
|
27
31
|
readonly,
|
|
28
|
-
required,
|
|
29
32
|
oninput,
|
|
33
|
+
disableValidationColor = false,
|
|
34
|
+
infoTooltip,
|
|
30
35
|
...props
|
|
31
36
|
}: InputProps = $props();
|
|
32
37
|
|
|
@@ -48,22 +53,11 @@
|
|
|
48
53
|
</script>
|
|
49
54
|
|
|
50
55
|
<div class="form-container">
|
|
51
|
-
{
|
|
52
|
-
<div class="form-label-container">
|
|
53
|
-
<label for={inputId}>{label}</label>
|
|
54
|
-
{#if required}
|
|
55
|
-
<span class="form-label-required">Required</span>
|
|
56
|
-
{:else if optional}
|
|
57
|
-
<span class="form-label-optional">Optional</span>
|
|
58
|
-
{/if}
|
|
59
|
-
</div>
|
|
60
|
-
{/if}
|
|
61
|
-
|
|
56
|
+
<Label {label} {id} {optional} {required} {infoTooltip} />
|
|
62
57
|
<div
|
|
63
58
|
class={[
|
|
64
59
|
'form-input-wrapper',
|
|
65
|
-
isInvalid && 'error',
|
|
66
|
-
isValid && 'success',
|
|
60
|
+
!disableValidationColor && [isInvalid && 'error', isValid && 'success'],
|
|
67
61
|
type === 'money' && currency && 'money-with-icon'
|
|
68
62
|
]}
|
|
69
63
|
>
|
|
@@ -95,7 +89,7 @@
|
|
|
95
89
|
type === 'password' && hasStatus && 'form-input-icon-container-password'
|
|
96
90
|
]}
|
|
97
91
|
>
|
|
98
|
-
{#if hasStatus}
|
|
92
|
+
{#if !disableValidationColor && hasStatus}
|
|
99
93
|
<InputIcon type={isInvalid ? 'error' : 'success'} isDateInput={showDatePicker} />
|
|
100
94
|
{/if}
|
|
101
95
|
|
|
@@ -127,20 +121,6 @@
|
|
|
127
121
|
line-height: 20px;
|
|
128
122
|
}
|
|
129
123
|
|
|
130
|
-
.form-label-container {
|
|
131
|
-
display: flex;
|
|
132
|
-
gap: 8px;
|
|
133
|
-
font-weight: 500;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.form-label-optional {
|
|
137
|
-
color: #6b7180;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.form-label-required {
|
|
141
|
-
color: #dc2626;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
124
|
.form-message {
|
|
145
125
|
font-size: 12px;
|
|
146
126
|
}
|
|
@@ -252,7 +232,7 @@
|
|
|
252
232
|
right: 43px;
|
|
253
233
|
top: 0;
|
|
254
234
|
bottom: 0;
|
|
255
|
-
width:
|
|
235
|
+
width: 0.5px;
|
|
256
236
|
background-color: #6b7180;
|
|
257
237
|
z-index: 1;
|
|
258
238
|
}
|
|
@@ -320,7 +300,7 @@
|
|
|
320
300
|
left: 0;
|
|
321
301
|
top: -8px;
|
|
322
302
|
bottom: -8px;
|
|
323
|
-
width:
|
|
303
|
+
width: 0.5px;
|
|
324
304
|
background-color: #6b7180;
|
|
325
305
|
z-index: 1;
|
|
326
306
|
}
|
|
@@ -8,6 +8,8 @@ interface InputProps extends Omit<HTMLInputAttributes, 'type' | 'value'> {
|
|
|
8
8
|
error?: string | string[];
|
|
9
9
|
description?: string;
|
|
10
10
|
currency?: string;
|
|
11
|
+
disableValidationColor?: boolean;
|
|
12
|
+
infoTooltip?: string;
|
|
11
13
|
}
|
|
12
14
|
declare const Input: import("svelte").Component<InputProps, {}, "value">;
|
|
13
15
|
type Input = ReturnType<typeof Input>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Tooltip } from '../index.js';
|
|
3
|
+
|
|
4
|
+
interface LabelProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
id?: string | null;
|
|
7
|
+
required?: boolean | null;
|
|
8
|
+
optional?: boolean;
|
|
9
|
+
infoTooltip?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let { label, id, required, optional, infoTooltip }: LabelProps = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{#if label}
|
|
16
|
+
<div class="form-label-container">
|
|
17
|
+
<label for={id}>{label}</label>
|
|
18
|
+
{#if required}
|
|
19
|
+
<span class="form-label-required">Required</span>
|
|
20
|
+
{:else if optional}
|
|
21
|
+
<span class="form-label-optional">Optional</span>
|
|
22
|
+
{/if}
|
|
23
|
+
{#if infoTooltip}
|
|
24
|
+
<Tooltip content={infoTooltip} width="sm">
|
|
25
|
+
{#snippet children()}
|
|
26
|
+
<span class="material-icons-outlined">info</span>
|
|
27
|
+
{/snippet}
|
|
28
|
+
</Tooltip>
|
|
29
|
+
{/if}
|
|
30
|
+
</div>
|
|
31
|
+
{/if}
|
|
32
|
+
|
|
33
|
+
<style>
|
|
34
|
+
.form-label-container {
|
|
35
|
+
display: flex;
|
|
36
|
+
gap: 8px;
|
|
37
|
+
font-weight: 500;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.form-label-optional {
|
|
41
|
+
color: #6b7180;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.form-label-required {
|
|
45
|
+
color: #dc2626;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.material-icons-outlined {
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
vertical-align: middle;
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface LabelProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
id?: string | null;
|
|
4
|
+
required?: boolean | null;
|
|
5
|
+
optional?: boolean;
|
|
6
|
+
infoTooltip?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Label: import("svelte").Component<LabelProps, {}, "">;
|
|
9
|
+
type Label = ReturnType<typeof Label>;
|
|
10
|
+
export default Label;
|