@lavalogic/scoria 0.38.11 → 0.38.12

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 (100) hide show
  1. package/README.md +58 -58
  2. package/dist/Components/AccordionGroup.svelte +46 -46
  3. package/dist/Components/AccordionGroupButton.svelte +76 -76
  4. package/dist/Components/Action.svelte +136 -136
  5. package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +702 -702
  6. package/dist/Components/Base/BaseModal.svelte +125 -125
  7. package/dist/Components/Base/ContextWrapper.svelte +72 -72
  8. package/dist/Components/Base/Pagination.svelte +198 -198
  9. package/dist/Components/Base/Snippets.svelte +36 -36
  10. package/dist/Components/BigRadioSet.svelte +38 -38
  11. package/dist/Components/Bubble.svelte +101 -101
  12. package/dist/Components/Button.svelte +209 -209
  13. package/dist/Components/Checkbox.svelte +86 -86
  14. package/dist/Components/Contexts/ContextMenu.svelte +164 -164
  15. package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
  16. package/dist/Components/Contexts/ContextMenuOption.svelte +60 -60
  17. package/dist/Components/Contexts/ToastContainer.svelte +65 -65
  18. package/dist/Components/Contexts/Tooltip.svelte +37 -37
  19. package/dist/Components/DataMatrixIcon.svelte +112 -112
  20. package/dist/Components/DateInput.svelte +148 -148
  21. package/dist/Components/DatePicker.svelte +300 -300
  22. package/dist/Components/DesktopModal.svelte +90 -90
  23. package/dist/Components/Dial.svelte +204 -204
  24. package/dist/Components/DimensionInput.svelte +170 -170
  25. package/dist/Components/DragMenu/DragMenuHolder.svelte +119 -119
  26. package/dist/Components/DragMenu/DraggableCard.svelte +77 -77
  27. package/dist/Components/FileCard.svelte +24 -24
  28. package/dist/Components/FileUpload.svelte +236 -236
  29. package/dist/Components/GridInputSet.svelte +29 -29
  30. package/dist/Components/HorizontalTabGroup.svelte +82 -82
  31. package/dist/Components/HorizontalTabGroupButton.svelte +44 -44
  32. package/dist/Components/Icon.svelte +128 -128
  33. package/dist/Components/Icons.js +357 -357
  34. package/dist/Components/LoadingAnimation.svelte +29 -29
  35. package/dist/Components/LoadingModal.svelte +45 -45
  36. package/dist/Components/LoadingOverlay.svelte +25 -25
  37. package/dist/Components/Modal.svelte +258 -258
  38. package/dist/Components/MultiSelect.svelte +220 -220
  39. package/dist/Components/Nav/NavServiceMenuList.svelte +43 -43
  40. package/dist/Components/Nav/NavTab.svelte +62 -62
  41. package/dist/Components/Nav/ServicesNav.svelte +80 -80
  42. package/dist/Components/NumberInput.svelte +157 -157
  43. package/dist/Components/PageHeading.svelte +25 -25
  44. package/dist/Components/PasswordInput.svelte +88 -88
  45. package/dist/Components/Portal.svelte +36 -36
  46. package/dist/Components/QuerySelect.svelte +366 -366
  47. package/dist/Components/SingleSelect.svelte +250 -250
  48. package/dist/Components/StepButton.svelte +70 -70
  49. package/dist/Components/StepForm.svelte +140 -140
  50. package/dist/Components/Switch.svelte +69 -69
  51. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +51 -51
  52. package/dist/Components/Table/Body/Rows/ColumnList.svelte +59 -59
  53. package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +79 -79
  54. package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +120 -120
  55. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +105 -105
  56. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +87 -87
  57. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +126 -126
  58. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +159 -159
  59. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +246 -246
  60. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +216 -216
  61. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +179 -179
  62. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +197 -197
  63. package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +190 -190
  64. package/dist/Components/Table/Body/Rows/TableRow.svelte +290 -290
  65. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +41 -41
  66. package/dist/Components/Table/Headers/SelectAllHeader.svelte +30 -30
  67. package/dist/Components/Table/Misc/FilterInput.svelte +37 -16
  68. package/dist/Components/Table/Misc/SidePanel.svelte +35 -35
  69. package/dist/Components/Table/Misc/ToolboxPanel.svelte +100 -100
  70. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +107 -107
  71. package/dist/Components/Test/TestContextConsumer.svelte +13 -13
  72. package/dist/Components/TextArea.svelte +130 -130
  73. package/dist/Components/TextInput.svelte +176 -176
  74. package/dist/Components/ThreeStateRadio.svelte +131 -131
  75. package/dist/Components/Touch/BoolCard.svelte +45 -45
  76. package/dist/Components/Touch/DateModal.svelte +209 -209
  77. package/dist/Components/Touch/EditCard.svelte +59 -59
  78. package/dist/Components/Touch/InfoCard.svelte +31 -31
  79. package/dist/Components/Touch/InfoTextCard.svelte +28 -28
  80. package/dist/Components/Touch/ModalExplanation.svelte +17 -17
  81. package/dist/Components/Touch/NumberKeyboard.svelte +225 -225
  82. package/dist/Components/Touch/NumberModal.svelte +79 -79
  83. package/dist/Components/Touch/PlusMinusCard.svelte +46 -46
  84. package/dist/Components/Touch/SummaryCard.svelte +93 -93
  85. package/dist/Components/Touch/TextAreaModal.svelte +95 -95
  86. package/dist/Components/Touch/TextModal.svelte +106 -106
  87. package/dist/Components/Touch/TouchCard.svelte +33 -33
  88. package/dist/Components/Touch/TouchModal.svelte +274 -274
  89. package/dist/Components/Touch/UtilityButton.svelte +109 -109
  90. package/dist/Components/VerticalTabGroup.svelte +79 -79
  91. package/dist/Components/VerticalTabGroupButton.svelte +58 -58
  92. package/dist/Helpers/Datamatrix.d.ts +19 -19
  93. package/dist/Helpers/Datamatrix.js +291 -291
  94. package/dist/Types/Examples/ExampleModal.svelte +35 -35
  95. package/dist/scss/_basics.scss +12 -12
  96. package/dist/scss/_colours.scss +134 -134
  97. package/dist/scss/_motion.scss +57 -57
  98. package/dist/scss/_sizing.scss +85 -85
  99. package/dist/scss/_transitions.scss +8 -8
  100. package/package.json +1 -1
@@ -1,132 +1,132 @@
1
- <svelte:options runes />
2
-
3
- <script lang="ts">
4
- import { cssLength } from '../Helpers/Helpers.svelte.js';
5
- import { InputVariant } from '../Types/Internal/InputVariant.js';
6
- import { Size } from '../Types/Internal/Size.js';
7
- import Icon from './Icon.svelte';
8
- import type { TextAreaProps } from './TextAreaProps.js';
9
-
10
- let {
11
- value = $bindable(''),
12
- labelTop,
13
- labelRight,
14
- placeholder,
15
- maxWidth = false,
16
- required = false,
17
- variant = InputVariant.Default,
18
- selectNone = false,
19
- noresize = false,
20
- uppercase = false,
21
- disabled,
22
- invalid = false,
23
- showErrorColours = true,
24
- optional = false,
25
- leftIcon,
26
- rightIcon,
27
- onLeftIconClick,
28
- onRightIconClick,
29
- rows = 4,
30
-
31
- textAreaRef = $bindable(),
32
- autocomplete,
33
- spellcheck,
34
- onblur,
35
- onfocus,
36
- // No default `onkeydown` - see TextInput.svelte for the rationale.
37
- // The legacy default (`passthrough`) blurred the textarea on every
38
- // alphanumeric keystroke and made the field unusable.
39
- onkeydown,
40
- oninput,
41
- }: TextAreaProps = $props();
42
-
43
- const isInvalid = $derived(showErrorColours && ((required && value.trim() === '') || invalid));
44
- </script>
45
-
46
- <label
47
- class:for-modal={variant === InputVariant.Modal}
48
- class:max-width={maxWidth}
49
- >
50
- {#if labelTop && variant !== InputVariant.Modal}
51
- <span
52
- class="top-label"
53
- class:for-default={variant === InputVariant.Default}
54
- class:invalid={isInvalid}
55
- >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
56
- >
57
- {#if variant === InputVariant.Default}
58
- <span
59
- aria-hidden="true"
60
- class="border"
61
- class:invalid={isInvalid}
62
- >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
63
- >
64
- {/if}
65
- {/if}
66
- <div
67
- class="icon-container"
68
- class:for-modal={variant == InputVariant.Modal}
69
- >
70
- {#if leftIcon}
71
- <Icon
72
- name={leftIcon.name}
73
- size={leftIcon.size ?? Size.Medium}
74
- colour={leftIcon.colour}
75
- float
76
- left={cssLength('0.75rem')}
77
- top={cssLength('50%')}
78
- anchorX={cssLength('0')}
79
- anchorY={cssLength('-50%')}
80
- clickable={!!onLeftIconClick}
81
- onclick={onLeftIconClick}
82
- />
83
- {/if}
84
- <textarea
85
- class:noresize
86
- class:uppercase
87
- class:invalid={isInvalid}
88
- class:select-none={selectNone}
89
- class:left-pad={leftIcon != undefined}
90
- class:right-pad={rightIcon != undefined}
91
- class:for-modal={variant == InputVariant.Modal}
92
- class:max-width={maxWidth}
93
- autocomplete={autocomplete ?? 'off'}
94
- spellcheck={spellcheck ?? true}
95
- aria-invalid={isInvalid || undefined}
96
- bind:value
97
- {onblur}
98
- {onfocus}
99
- {onkeydown}
100
- {oninput}
101
- {rows}
102
- bind:this={textAreaRef}
103
- {placeholder}
104
- {required}
105
- {disabled}
106
- ></textarea>
107
- {#if rightIcon}
108
- <Icon
109
- name={rightIcon.name}
110
- size={rightIcon.size ?? Size.Medium}
111
- colour={rightIcon.colour}
112
- float
113
- right={cssLength(variant == InputVariant.Modal ? '1rem' : '0.5rem')}
114
- top={cssLength('50%')}
115
- anchorX={cssLength('0')}
116
- anchorY={cssLength('-50%')}
117
- clickable={!!onRightIconClick}
118
- onclick={onRightIconClick}
119
- />
120
- {/if}
121
- {#if labelRight}
122
- <span
123
- class="right-label"
124
- class:for-modal={variant == InputVariant.Modal}>{labelRight}</span
125
- >
126
- {/if}
127
- </div>
128
- </label>
129
-
1
+ <svelte:options runes />
2
+
3
+ <script lang="ts">
4
+ import { cssLength } from '../Helpers/Helpers.svelte.js';
5
+ import { InputVariant } from '../Types/Internal/InputVariant.js';
6
+ import { Size } from '../Types/Internal/Size.js';
7
+ import Icon from './Icon.svelte';
8
+ import type { TextAreaProps } from './TextAreaProps.js';
9
+
10
+ let {
11
+ value = $bindable(''),
12
+ labelTop,
13
+ labelRight,
14
+ placeholder,
15
+ maxWidth = false,
16
+ required = false,
17
+ variant = InputVariant.Default,
18
+ selectNone = false,
19
+ noresize = false,
20
+ uppercase = false,
21
+ disabled,
22
+ invalid = false,
23
+ showErrorColours = true,
24
+ optional = false,
25
+ leftIcon,
26
+ rightIcon,
27
+ onLeftIconClick,
28
+ onRightIconClick,
29
+ rows = 4,
30
+
31
+ textAreaRef = $bindable(),
32
+ autocomplete,
33
+ spellcheck,
34
+ onblur,
35
+ onfocus,
36
+ // No default `onkeydown` - see TextInput.svelte for the rationale.
37
+ // The legacy default (`passthrough`) blurred the textarea on every
38
+ // alphanumeric keystroke and made the field unusable.
39
+ onkeydown,
40
+ oninput,
41
+ }: TextAreaProps = $props();
42
+
43
+ const isInvalid = $derived(showErrorColours && ((required && value.trim() === '') || invalid));
44
+ </script>
45
+
46
+ <label
47
+ class:for-modal={variant === InputVariant.Modal}
48
+ class:max-width={maxWidth}
49
+ >
50
+ {#if labelTop && variant !== InputVariant.Modal}
51
+ <span
52
+ class="top-label"
53
+ class:for-default={variant === InputVariant.Default}
54
+ class:invalid={isInvalid}
55
+ >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
56
+ >
57
+ {#if variant === InputVariant.Default}
58
+ <span
59
+ aria-hidden="true"
60
+ class="border"
61
+ class:invalid={isInvalid}
62
+ >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
63
+ >
64
+ {/if}
65
+ {/if}
66
+ <div
67
+ class="icon-container"
68
+ class:for-modal={variant == InputVariant.Modal}
69
+ >
70
+ {#if leftIcon}
71
+ <Icon
72
+ name={leftIcon.name}
73
+ size={leftIcon.size ?? Size.Medium}
74
+ colour={leftIcon.colour}
75
+ float
76
+ left={cssLength('0.75rem')}
77
+ top={cssLength('50%')}
78
+ anchorX={cssLength('0')}
79
+ anchorY={cssLength('-50%')}
80
+ clickable={!!onLeftIconClick}
81
+ onclick={onLeftIconClick}
82
+ />
83
+ {/if}
84
+ <textarea
85
+ class:noresize
86
+ class:uppercase
87
+ class:invalid={isInvalid}
88
+ class:select-none={selectNone}
89
+ class:left-pad={leftIcon != undefined}
90
+ class:right-pad={rightIcon != undefined}
91
+ class:for-modal={variant == InputVariant.Modal}
92
+ class:max-width={maxWidth}
93
+ autocomplete={autocomplete ?? 'off'}
94
+ spellcheck={spellcheck ?? true}
95
+ aria-invalid={isInvalid || undefined}
96
+ bind:value
97
+ {onblur}
98
+ {onfocus}
99
+ {onkeydown}
100
+ {oninput}
101
+ {rows}
102
+ bind:this={textAreaRef}
103
+ {placeholder}
104
+ {required}
105
+ {disabled}
106
+ ></textarea>
107
+ {#if rightIcon}
108
+ <Icon
109
+ name={rightIcon.name}
110
+ size={rightIcon.size ?? Size.Medium}
111
+ colour={rightIcon.colour}
112
+ float
113
+ right={cssLength(variant == InputVariant.Modal ? '1rem' : '0.5rem')}
114
+ top={cssLength('50%')}
115
+ anchorX={cssLength('0')}
116
+ anchorY={cssLength('-50%')}
117
+ clickable={!!onRightIconClick}
118
+ onclick={onRightIconClick}
119
+ />
120
+ {/if}
121
+ {#if labelRight}
122
+ <span
123
+ class="right-label"
124
+ class:for-modal={variant == InputVariant.Modal}>{labelRight}</span
125
+ >
126
+ {/if}
127
+ </div>
128
+ </label>
129
+
130
130
  <style>textarea {
131
131
  box-sizing: border-box;
132
132
  height: 100%;
@@ -340,4 +340,4 @@ span.border.invalid {
340
340
  .textarea-error-wrapper.for-modal {
341
341
  position: relative;
342
342
  height: 100%;
343
- }</style>
343
+ }</style>
@@ -1,178 +1,178 @@
1
- <svelte:options runes />
2
-
3
- <script lang="ts">
4
- import { cssLength, isValidEmailAddress } from '../Helpers/Helpers.svelte.js';
5
- import { Colour, ColourSet } from '../scss/colours.js';
6
- import { InputVariant } from '../Types/Internal/InputVariant.js';
7
- import { Size } from '../Types/Internal/Size.js';
8
- import Action from './Action.svelte';
9
- import Icon from './Icon.svelte';
10
- import type { TextInputProps } from './TextInputProps.js';
11
- let {
12
- id,
13
- value = $bindable(''),
14
- labelTop,
15
- optional,
16
- labelRight,
17
- placeholder,
18
- required = false,
19
- variant = InputVariant.Default,
20
- selectNone = false,
21
- uppercase = false,
22
- disabled = false,
23
- invalid = false,
24
- showErrorColours = true,
25
- rightIconDisabled = false,
26
- leftIcon,
27
- rightIcon,
28
- type,
29
- onLeftIconClick,
30
- onRightIconClick,
31
- inputRef = $bindable(),
32
- 'data-type': dataType,
33
- autocomplete,
34
- spellcheck,
35
- onblur,
36
- onfocus,
37
- // No default `onkeydown`. The legacy default was `passthrough`,
38
- // a helper that BLURS the target on every alphanumeric key (it is
39
- // a barcode-scanner aid intended for buttons - note the
40
- // `as HTMLButtonElement` cast inside it). Applied to a text input
41
- // it makes the field unusable: each keystroke blurs the input
42
- // before the value can update, so users see nothing as they type.
43
- // Inputs should accept keystrokes by default; consumers that want
44
- // the barcode-blur behaviour explicitly pass
45
- // `onkeydown={passthrough}` (preferably renamed to
46
- // `blurOnAlphanumeric` in a future patch).
47
- onkeydown,
48
- oninput,
49
- }: TextInputProps = $props();
50
-
51
- const isInvalid = $derived(
52
- showErrorColours &&
53
- !disabled &&
54
- ((required &&
55
- (!value?.trim() ||
56
- (type == 'email' &&
57
- value.length >= 3 &&
58
- value.includes('@') &&
59
- !isValidEmailAddress(value)))) ||
60
- invalid)
61
- );
62
- </script>
63
-
64
- <div
65
- class="error-wrapper"
66
- class:for-modal={variant == InputVariant.Modal}
67
- class:for-table={variant == InputVariant.Table}
68
- >
69
- <label
70
- class:for-modal={variant == InputVariant.Modal}
71
- class:for-table={variant == InputVariant.Table}
72
- >
73
- {#if labelTop}
74
- <span
75
- class="top-label"
76
- class:for-default={variant === InputVariant.Default}
77
- class:invalid={isInvalid}
78
- >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
79
- >
80
- {#if variant === InputVariant.Default}
81
- <span
82
- aria-hidden="true"
83
- class="border"
84
- class:invalid={isInvalid}
85
- >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
86
- >
87
- {/if}
88
- {/if}
89
- <div
90
- class="icon-container"
91
- class:for-modal={variant == InputVariant.Modal}
92
- >
93
- {#if leftIcon}
94
- {#if onLeftIconClick}
95
- <div class="left-icon">
96
- <Action
97
- noTabIndex
98
- colourSet={ColourSet.Auxiliary}
99
- icon={leftIcon}
100
- size={Size.Medium}
101
- onclick={onLeftIconClick}
102
- />
103
- </div>
104
- {:else}
105
- <Icon
106
- name={leftIcon.name}
107
- size={leftIcon.size ?? Size.Medium}
108
- colour={leftIcon.colour}
109
- float
110
- left={cssLength('0.75rem')}
111
- top={cssLength('50%')}
112
- anchorX={cssLength('0')}
113
- anchorY={cssLength('-50%')}
114
- />
115
- {/if}
116
- {/if}
117
- <input
118
- {id}
119
- class:for-default={variant === InputVariant.Default}
120
- class:uppercase
121
- class:invalid={isInvalid}
122
- class:select-none={selectNone}
123
- class:left-pad={leftIcon != undefined}
124
- class:right-pad={rightIcon != undefined}
125
- class:for-modal={variant == InputVariant.Modal}
126
- data-type={dataType}
127
- type={type ?? 'text'}
128
- autocomplete={autocomplete ?? (type === 'email' ? 'email' : 'off')}
129
- spellcheck={spellcheck ?? false}
130
- aria-invalid={isInvalid || undefined}
131
- bind:value
132
- {onblur}
133
- {onfocus}
134
- {onkeydown}
135
- {oninput}
136
- bind:this={inputRef}
137
- {placeholder}
138
- {required}
139
- {disabled}
140
- />
141
- {#if rightIcon}
142
- <div class="right-icon">
143
- {#if onRightIconClick}
144
- <Action
145
- noTabIndex
146
- colourSet={ColourSet.Auxiliary}
147
- disabled={rightIconDisabled}
148
- icon={rightIcon}
149
- size={Size.Medium}
150
- onclick={onRightIconClick}
151
- />
152
- {:else}
153
- <Icon
154
- name={rightIcon.name}
155
- size={rightIcon.size ?? Size.Medium}
156
- colour={rightIcon.colour ?? Colour['$font-disabled']}
157
- float
158
- right={cssLength(variant == InputVariant.Modal ? '1rem' : '0.5rem')}
159
- top={cssLength('50%')}
160
- anchorX={cssLength('0')}
161
- anchorY={cssLength('-50%')}
162
- />
163
- {/if}
164
- </div>
165
- {/if}
166
- {#if labelRight}
167
- <span
168
- class="right-label"
169
- class:for-modal={variant == InputVariant.Modal}>{labelRight}</span
170
- >
171
- {/if}
172
- </div>
173
- </label>
174
- </div>
175
-
1
+ <svelte:options runes />
2
+
3
+ <script lang="ts">
4
+ import { cssLength, isValidEmailAddress } from '../Helpers/Helpers.svelte.js';
5
+ import { Colour, ColourSet } from '../scss/colours.js';
6
+ import { InputVariant } from '../Types/Internal/InputVariant.js';
7
+ import { Size } from '../Types/Internal/Size.js';
8
+ import Action from './Action.svelte';
9
+ import Icon from './Icon.svelte';
10
+ import type { TextInputProps } from './TextInputProps.js';
11
+ let {
12
+ id,
13
+ value = $bindable(''),
14
+ labelTop,
15
+ optional,
16
+ labelRight,
17
+ placeholder,
18
+ required = false,
19
+ variant = InputVariant.Default,
20
+ selectNone = false,
21
+ uppercase = false,
22
+ disabled = false,
23
+ invalid = false,
24
+ showErrorColours = true,
25
+ rightIconDisabled = false,
26
+ leftIcon,
27
+ rightIcon,
28
+ type,
29
+ onLeftIconClick,
30
+ onRightIconClick,
31
+ inputRef = $bindable(),
32
+ 'data-type': dataType,
33
+ autocomplete,
34
+ spellcheck,
35
+ onblur,
36
+ onfocus,
37
+ // No default `onkeydown`. The legacy default was `passthrough`,
38
+ // a helper that BLURS the target on every alphanumeric key (it is
39
+ // a barcode-scanner aid intended for buttons - note the
40
+ // `as HTMLButtonElement` cast inside it). Applied to a text input
41
+ // it makes the field unusable: each keystroke blurs the input
42
+ // before the value can update, so users see nothing as they type.
43
+ // Inputs should accept keystrokes by default; consumers that want
44
+ // the barcode-blur behaviour explicitly pass
45
+ // `onkeydown={passthrough}` (preferably renamed to
46
+ // `blurOnAlphanumeric` in a future patch).
47
+ onkeydown,
48
+ oninput,
49
+ }: TextInputProps = $props();
50
+
51
+ const isInvalid = $derived(
52
+ showErrorColours &&
53
+ !disabled &&
54
+ ((required &&
55
+ (!value?.trim() ||
56
+ (type == 'email' &&
57
+ value.length >= 3 &&
58
+ value.includes('@') &&
59
+ !isValidEmailAddress(value)))) ||
60
+ invalid)
61
+ );
62
+ </script>
63
+
64
+ <div
65
+ class="error-wrapper"
66
+ class:for-modal={variant == InputVariant.Modal}
67
+ class:for-table={variant == InputVariant.Table}
68
+ >
69
+ <label
70
+ class:for-modal={variant == InputVariant.Modal}
71
+ class:for-table={variant == InputVariant.Table}
72
+ >
73
+ {#if labelTop}
74
+ <span
75
+ class="top-label"
76
+ class:for-default={variant === InputVariant.Default}
77
+ class:invalid={isInvalid}
78
+ >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
79
+ >
80
+ {#if variant === InputVariant.Default}
81
+ <span
82
+ aria-hidden="true"
83
+ class="border"
84
+ class:invalid={isInvalid}
85
+ >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
86
+ >
87
+ {/if}
88
+ {/if}
89
+ <div
90
+ class="icon-container"
91
+ class:for-modal={variant == InputVariant.Modal}
92
+ >
93
+ {#if leftIcon}
94
+ {#if onLeftIconClick}
95
+ <div class="left-icon">
96
+ <Action
97
+ noTabIndex
98
+ colourSet={ColourSet.Auxiliary}
99
+ icon={leftIcon}
100
+ size={Size.Medium}
101
+ onclick={onLeftIconClick}
102
+ />
103
+ </div>
104
+ {:else}
105
+ <Icon
106
+ name={leftIcon.name}
107
+ size={leftIcon.size ?? Size.Medium}
108
+ colour={leftIcon.colour}
109
+ float
110
+ left={cssLength('0.75rem')}
111
+ top={cssLength('50%')}
112
+ anchorX={cssLength('0')}
113
+ anchorY={cssLength('-50%')}
114
+ />
115
+ {/if}
116
+ {/if}
117
+ <input
118
+ {id}
119
+ class:for-default={variant === InputVariant.Default}
120
+ class:uppercase
121
+ class:invalid={isInvalid}
122
+ class:select-none={selectNone}
123
+ class:left-pad={leftIcon != undefined}
124
+ class:right-pad={rightIcon != undefined}
125
+ class:for-modal={variant == InputVariant.Modal}
126
+ data-type={dataType}
127
+ type={type ?? 'text'}
128
+ autocomplete={autocomplete ?? (type === 'email' ? 'email' : 'off')}
129
+ spellcheck={spellcheck ?? false}
130
+ aria-invalid={isInvalid || undefined}
131
+ bind:value
132
+ {onblur}
133
+ {onfocus}
134
+ {onkeydown}
135
+ {oninput}
136
+ bind:this={inputRef}
137
+ {placeholder}
138
+ {required}
139
+ {disabled}
140
+ />
141
+ {#if rightIcon}
142
+ <div class="right-icon">
143
+ {#if onRightIconClick}
144
+ <Action
145
+ noTabIndex
146
+ colourSet={ColourSet.Auxiliary}
147
+ disabled={rightIconDisabled}
148
+ icon={rightIcon}
149
+ size={Size.Medium}
150
+ onclick={onRightIconClick}
151
+ />
152
+ {:else}
153
+ <Icon
154
+ name={rightIcon.name}
155
+ size={rightIcon.size ?? Size.Medium}
156
+ colour={rightIcon.colour ?? Colour['$font-disabled']}
157
+ float
158
+ right={cssLength(variant == InputVariant.Modal ? '1rem' : '0.5rem')}
159
+ top={cssLength('50%')}
160
+ anchorX={cssLength('0')}
161
+ anchorY={cssLength('-50%')}
162
+ />
163
+ {/if}
164
+ </div>
165
+ {/if}
166
+ {#if labelRight}
167
+ <span
168
+ class="right-label"
169
+ class:for-modal={variant == InputVariant.Modal}>{labelRight}</span
170
+ >
171
+ {/if}
172
+ </div>
173
+ </label>
174
+ </div>
175
+
176
176
  <style>input {
177
177
  box-sizing: border-box;
178
178
  height: 100%;
@@ -406,4 +406,4 @@ label.for-table input {
406
406
 
407
407
  td {
408
408
  --input-border: none;
409
- }</style>
409
+ }</style>