@softwareone/spi-sv5-library 1.1.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.
@@ -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;
@@ -2,24 +2,20 @@
2
2
  import type { Snippet } from 'svelte';
3
3
 
4
4
  interface CardProps {
5
- alignItems?: 'left' | 'center' | 'right';
6
5
  type?: 'layout' | 'highlight';
7
6
  children?: Snippet;
8
7
  }
9
8
 
10
- let { alignItems = 'left', type = 'layout', children }: CardProps = $props();
9
+ let { type = 'layout', children }: CardProps = $props();
11
10
  </script>
12
11
 
13
- <div class="card card-{type}" data-align={alignItems}>
12
+ <div class="card card-{type}">
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
19
  min-height: var(--card-min-height, auto);
24
20
  background: #fff;
25
21
  margin-bottom: 24px;
@@ -33,14 +29,4 @@
33
29
  .card-layout {
34
30
  --card-min-height: 100vh;
35
31
  }
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;
45
- }
46
32
  </style>
@@ -1,6 +1,5 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  interface CardProps {
3
- alignItems?: 'left' | 'center' | 'right';
4
3
  type?: 'layout' | 'highlight';
5
4
  children?: Snippet;
6
5
  }
@@ -77,6 +77,7 @@
77
77
 
78
78
  .feedback-detail > h1 {
79
79
  font-size: 24px;
80
+ font-weight: bold;
80
81
  }
81
82
 
82
83
  .feedback-detail .link {
@@ -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,7 @@
12
13
  error?: string | string[];
13
14
  description?: string;
14
15
  currency?: string;
16
+ disableValidationColor?: boolean;
15
17
  }
16
18
 
17
19
  let {
@@ -19,14 +21,15 @@
19
21
  type = 'text',
20
22
  value = $bindable(''),
21
23
  optional = false,
24
+ required = false,
22
25
  error,
23
26
  description,
24
27
  currency,
25
28
  id,
26
29
  disabled,
27
30
  readonly,
28
- required,
29
31
  oninput,
32
+ disableValidationColor = false,
30
33
  ...props
31
34
  }: InputProps = $props();
32
35
 
@@ -48,22 +51,11 @@
48
51
  </script>
49
52
 
50
53
  <div class="form-container">
51
- {#if label}
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
-
54
+ <Label {label} {id} {optional} {required} />
62
55
  <div
63
56
  class={[
64
57
  'form-input-wrapper',
65
- isInvalid && 'error',
66
- isValid && 'success',
58
+ !disableValidationColor && [isInvalid && 'error', isValid && 'success'],
67
59
  type === 'money' && currency && 'money-with-icon'
68
60
  ]}
69
61
  >
@@ -95,7 +87,7 @@
95
87
  type === 'password' && hasStatus && 'form-input-icon-container-password'
96
88
  ]}
97
89
  >
98
- {#if hasStatus}
90
+ {#if !disableValidationColor && hasStatus}
99
91
  <InputIcon type={isInvalid ? 'error' : 'success'} isDateInput={showDatePicker} />
100
92
  {/if}
101
93
 
@@ -127,20 +119,6 @@
127
119
  line-height: 20px;
128
120
  }
129
121
 
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
122
  .form-message {
145
123
  font-size: 12px;
146
124
  }
@@ -252,7 +230,7 @@
252
230
  right: 43px;
253
231
  top: 0;
254
232
  bottom: 0;
255
- width: 1px;
233
+ width: 0.5px;
256
234
  background-color: #6b7180;
257
235
  z-index: 1;
258
236
  }
@@ -320,7 +298,7 @@
320
298
  left: 0;
321
299
  top: -8px;
322
300
  bottom: -8px;
323
- width: 1px;
301
+ width: 0.5px;
324
302
  background-color: #6b7180;
325
303
  z-index: 1;
326
304
  }
@@ -8,6 +8,7 @@ interface InputProps extends Omit<HTMLInputAttributes, 'type' | 'value'> {
8
8
  error?: string | string[];
9
9
  description?: string;
10
10
  currency?: string;
11
+ disableValidationColor?: boolean;
11
12
  }
12
13
  declare const Input: import("svelte").Component<InputProps, {}, "value">;
13
14
  type Input = ReturnType<typeof Input>;
@@ -0,0 +1,37 @@
1
+ <script lang="ts">
2
+ interface LabelProps {
3
+ label?: string;
4
+ id?: string | null;
5
+ required?: boolean | null;
6
+ optional?: boolean;
7
+ }
8
+
9
+ let { label, id, required, optional }: LabelProps = $props();
10
+ </script>
11
+
12
+ {#if label}
13
+ <div class="form-label-container">
14
+ <label for={id}>{label}</label>
15
+ {#if required}
16
+ <span class="form-label-required">Required</span>
17
+ {:else if optional}
18
+ <span class="form-label-optional">Optional</span>
19
+ {/if}
20
+ </div>
21
+ {/if}
22
+
23
+ <style>
24
+ .form-label-container {
25
+ display: flex;
26
+ gap: 8px;
27
+ font-weight: 500;
28
+ }
29
+
30
+ .form-label-optional {
31
+ color: #6b7180;
32
+ }
33
+
34
+ .form-label-required {
35
+ color: #dc2626;
36
+ }
37
+ </style>
@@ -0,0 +1,9 @@
1
+ interface LabelProps {
2
+ label?: string;
3
+ id?: string | null;
4
+ required?: boolean | null;
5
+ optional?: boolean;
6
+ }
7
+ declare const Label: import("svelte").Component<LabelProps, {}, "">;
8
+ type Label = ReturnType<typeof Label>;
9
+ export default Label;