@lavalogic/scoria 0.40.13 → 0.40.15

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 (143) hide show
  1. package/README.md +58 -58
  2. package/dist/Components/AccordionGroup.svelte +35 -46
  3. package/dist/Components/AccordionGroupButton.svelte +68 -76
  4. package/dist/Components/Action.svelte +103 -135
  5. package/dist/Components/AlertModal.svelte +171 -190
  6. package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +614 -697
  7. package/dist/Components/Base/BaseModal.svelte +90 -116
  8. package/dist/Components/Base/ContextWrapper.svelte +67 -72
  9. package/dist/Components/Base/Pagination.svelte +173 -196
  10. package/dist/Components/Base/Snippets.svelte +34 -36
  11. package/dist/Components/BigRadioSet.svelte +36 -38
  12. package/dist/Components/Bubble.svelte +78 -101
  13. package/dist/Components/Button.svelte +175 -208
  14. package/dist/Components/Checkbox.svelte +75 -86
  15. package/dist/Components/CollapsibleCard.svelte +72 -87
  16. package/dist/Components/CollapsibleMenuGroup.svelte +53 -57
  17. package/dist/Components/ConditionBuilder/ConditionBuilder.svelte +39 -64
  18. package/dist/Components/Contexts/ContextMenu.svelte +141 -156
  19. package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
  20. package/dist/Components/Contexts/ContextMenuOption.svelte +53 -60
  21. package/dist/Components/Contexts/Toast.svelte +81 -86
  22. package/dist/Components/Contexts/ToastContainer.svelte +58 -62
  23. package/dist/Components/Contexts/Tooltip.svelte +36 -37
  24. package/dist/Components/DataMatrixIcon.svelte +95 -108
  25. package/dist/Components/DateInput.svelte +118 -146
  26. package/dist/Components/DatePicker.svelte +255 -294
  27. package/dist/Components/DesktopModal.svelte +70 -90
  28. package/dist/Components/Dial.svelte +167 -197
  29. package/dist/Components/DimensionInput.svelte +124 -169
  30. package/dist/Components/DragMenu/DragMenuHolder.svelte +98 -114
  31. package/dist/Components/DragMenu/DraggableCard.svelte +64 -76
  32. package/dist/Components/FileCard.svelte +21 -24
  33. package/dist/Components/FileUpload.svelte +190 -225
  34. package/dist/Components/GridInput.svelte +159 -196
  35. package/dist/Components/GridInputSet.svelte +24 -29
  36. package/dist/Components/HorizontalTabGroup.svelte +73 -89
  37. package/dist/Components/HorizontalTabGroupButton.svelte +40 -44
  38. package/dist/Components/Icon.svelte +99 -128
  39. package/dist/Components/Icons.js +357 -357
  40. package/dist/Components/InfoAlert.svelte +35 -38
  41. package/dist/Components/LoadingAnimation.svelte +691 -755
  42. package/dist/Components/LoadingModal.svelte +36 -44
  43. package/dist/Components/LoadingOverlay.svelte +22 -26
  44. package/dist/Components/Modal.svelte +204 -254
  45. package/dist/Components/MultiSelect.svelte +186 -216
  46. package/dist/Components/Nav/Nav.svelte +94 -110
  47. package/dist/Components/Nav/NavServiceMenuList.svelte +57 -61
  48. package/dist/Components/Nav/NavTab.svelte +58 -62
  49. package/dist/Components/Nav/ServiceMenuItem.svelte +103 -111
  50. package/dist/Components/Nav/ServicesNav.svelte +72 -79
  51. package/dist/Components/NumberInput.svelte +121 -155
  52. package/dist/Components/OptionCards.svelte +62 -73
  53. package/dist/Components/PageHeading.svelte +23 -25
  54. package/dist/Components/PasswordInput.svelte +69 -88
  55. package/dist/Components/PopoverButton.svelte +151 -0
  56. package/dist/Components/PopoverButton.svelte.d.ts +9 -0
  57. package/dist/Components/PopoverButtonProps.d.ts +21 -0
  58. package/dist/Components/PopoverButtonProps.js +1 -0
  59. package/dist/Components/Portal.svelte +29 -35
  60. package/dist/Components/ProgressBubble.svelte +91 -106
  61. package/dist/Components/QuerySelect.svelte +260 -346
  62. package/dist/Components/SidebarPanel.svelte +34 -36
  63. package/dist/Components/SingleSelect.svelte +196 -244
  64. package/dist/Components/StepButton.svelte +65 -70
  65. package/dist/Components/StepForm.svelte +115 -135
  66. package/dist/Components/Switch.svelte +57 -69
  67. package/dist/Components/Table/ARCHITECTURE.md +298 -298
  68. package/dist/Components/Table/Body/QuickSearchCell.svelte +578 -655
  69. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +42 -51
  70. package/dist/Components/Table/Body/Rows/ColumnList.svelte +42 -58
  71. package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +403 -442
  72. package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +51 -78
  73. package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +165 -184
  74. package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +110 -123
  75. package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +134 -160
  76. package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +190 -231
  77. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +82 -104
  78. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +52 -87
  79. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +122 -150
  80. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +132 -159
  81. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +190 -236
  82. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +173 -211
  83. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +204 -244
  84. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +140 -177
  85. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +188 -217
  86. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +173 -193
  87. package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +166 -187
  88. package/dist/Components/Table/Body/Rows/TableRow.svelte +245 -288
  89. package/dist/Components/Table/Body/TableBody.svelte +141 -154
  90. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +35 -41
  91. package/dist/Components/Table/Headers/SelectAllHeader.svelte +24 -30
  92. package/dist/Components/Table/Headers/TableHead.svelte +348 -402
  93. package/dist/Components/Table/Misc/ColumnPanel.svelte +37 -39
  94. package/dist/Components/Table/Misc/ColumnPanelModal.svelte +35 -39
  95. package/dist/Components/Table/Misc/FilterInput.svelte +556 -619
  96. package/dist/Components/Table/Misc/FilterPanel.svelte +170 -183
  97. package/dist/Components/Table/Misc/FilterPanelModal.svelte +25 -31
  98. package/dist/Components/Table/Misc/ShareViewModal.svelte +252 -281
  99. package/dist/Components/Table/Misc/SidePanel.svelte +32 -35
  100. package/dist/Components/Table/Misc/TableConfigurationModal.svelte +574 -629
  101. package/dist/Components/Table/Misc/TableFooter.svelte +326 -332
  102. package/dist/Components/Table/Misc/TableHorizontalBar.svelte +134 -140
  103. package/dist/Components/Table/Misc/TableSidebar.svelte +183 -198
  104. package/dist/Components/Table/Misc/TableViewDropdown.svelte +83 -103
  105. package/dist/Components/Table/Misc/ToolboxPanel.svelte +83 -100
  106. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +88 -107
  107. package/dist/Components/Table/Misc/UpdateViewOptionsModal.svelte +163 -190
  108. package/dist/Components/Table/NestedTable.svelte +102 -128
  109. package/dist/Components/Table/Table.svelte +531 -663
  110. package/dist/Components/Test/TestContextConsumer.svelte +11 -13
  111. package/dist/Components/TextArea.svelte +95 -130
  112. package/dist/Components/TextInput.svelte +125 -176
  113. package/dist/Components/ThreeStateRadio.svelte +111 -130
  114. package/dist/Components/Touch/BoolCard.svelte +33 -45
  115. package/dist/Components/Touch/DateModal.svelte +164 -204
  116. package/dist/Components/Touch/EditCard.svelte +48 -59
  117. package/dist/Components/Touch/InfoCard.svelte +28 -31
  118. package/dist/Components/Touch/InfoTextCard.svelte +26 -28
  119. package/dist/Components/Touch/ModalExplanation.svelte +15 -17
  120. package/dist/Components/Touch/NumberKeyboard.svelte +181 -218
  121. package/dist/Components/Touch/NumberModal.svelte +59 -79
  122. package/dist/Components/Touch/PlusMinusCard.svelte +43 -46
  123. package/dist/Components/Touch/SelectModal.svelte +111 -126
  124. package/dist/Components/Touch/SummaryCard.svelte +80 -93
  125. package/dist/Components/Touch/TextAreaModal.svelte +72 -94
  126. package/dist/Components/Touch/TextModal.svelte +77 -105
  127. package/dist/Components/Touch/TouchCard.svelte +31 -33
  128. package/dist/Components/Touch/TouchModal.svelte +214 -270
  129. package/dist/Components/Touch/UtilityButton.svelte +88 -109
  130. package/dist/Components/VerticalTabGroup.svelte +60 -78
  131. package/dist/Components/VerticalTabGroupButton.svelte +54 -58
  132. package/dist/Helpers/Datamatrix.d.ts +19 -19
  133. package/dist/Helpers/Datamatrix.js +291 -291
  134. package/dist/Types/Examples/ExampleModal.svelte +31 -35
  135. package/dist/index.d.ts +2 -0
  136. package/dist/index.js +1 -0
  137. package/dist/scss/_basics.scss +12 -12
  138. package/dist/scss/_colours.scss +134 -134
  139. package/dist/scss/_mixins.scss +3392 -3392
  140. package/dist/scss/_motion.scss +57 -57
  141. package/dist/scss/_sizing.scss +85 -85
  142. package/dist/scss/_transitions.scss +8 -8
  143. package/package.json +1 -1
@@ -1,159 +1,125 @@
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 { NumberInputProps } from './NumberInputProps.js';
9
- let {
10
- id,
11
- value = $bindable(null),
12
- min,
13
- max,
14
- labelTop,
15
- labelRight,
16
- placeholder,
17
- required = false,
18
- variant = InputVariant.Default,
19
- decimal = false,
20
- invalid = false,
21
- showErrorColours = true,
22
- disabled,
23
- optional,
24
- leftIcon,
25
- rightIcon,
26
- onLeftIconClick,
27
- onRightIconClick,
28
-
29
- onblur,
30
- onfocus,
31
- // No default `onkeydown` - see TextInput.svelte for the rationale.
32
- // The legacy default (`passthrough`) blurred the input on every
33
- // alphanumeric keystroke and made the field unusable.
34
- onkeydown,
35
- oninput,
36
-
37
- inputRef = $bindable(),
38
- 'data-type': dataType,
39
- }: NumberInputProps = $props();
40
-
41
- function clamp(e: Event): void {
42
- const raw = (e.target as HTMLInputElement).value;
43
- if (raw === '') {
44
- if (value !== null) {
45
- value = null;
46
- }
47
- return;
48
- }
49
- const next = Number(raw);
50
- if (isNaN(next)) {
51
- return;
52
- }
53
- const lo = min ?? -Infinity;
54
- const hi = max ?? Infinity;
55
- const clamped = Math.max(lo, Math.min(hi, next));
56
- if (clamped !== value) {
57
- value = clamped;
1
+ <svelte:options runes />
2
+
3
+ <script lang="ts">import { cssLength } from "../Helpers/Helpers.svelte.js";
4
+ import { InputVariant } from "../Types/Internal/InputVariant.js";
5
+ import { Size } from "../Types/Internal/Size.js";
6
+ import Icon from "./Icon.svelte";
7
+ let { id, value = $bindable(null), min, max, labelTop, labelRight, placeholder, required = false, variant = InputVariant.Default, decimal = false, invalid = false, showErrorColours = true, disabled, optional, leftIcon, rightIcon, onLeftIconClick, onRightIconClick, onblur, onfocus, onkeydown, oninput, inputRef = $bindable(), "data-type": dataType } = $props();
8
+ function clamp(e) {
9
+ const raw = e.target.value;
10
+ if (raw === "") {
11
+ if (value !== null) {
12
+ value = null;
58
13
  }
14
+ return;
59
15
  }
60
-
61
- const isInvalid = $derived(showErrorColours && ((required && value == null) || invalid));
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
- <Icon
95
- name={leftIcon.name}
96
- size={leftIcon.size ?? Size.Medium}
97
- colour={leftIcon.colour}
98
- float
99
- left={cssLength('0.75rem')}
100
- top={cssLength('50%')}
101
- anchorX={cssLength('0')}
102
- anchorY={cssLength('-50%')}
103
- clickable={!!onLeftIconClick}
104
- onclick={onLeftIconClick}
105
- />
106
- {/if}
107
- <input
108
- {id}
109
- class:invalid={isInvalid}
110
- class:for-default={variant === InputVariant.Default}
111
- data-type={dataType}
112
- class:left-pad={leftIcon != undefined}
113
- class:right-pad={rightIcon != undefined || (labelRight && variant == InputVariant.Modal)}
114
- class:for-modal={variant == InputVariant.Modal}
115
- type="number"
116
- aria-invalid={isInvalid || undefined}
117
- bind:value
118
- {onblur}
119
- {onfocus}
120
- {onkeydown}
121
- oninput={(e) => {
122
- clamp(e);
123
- oninput?.(e);
124
- }}
125
- bind:this={inputRef}
126
- {placeholder}
127
- {required}
128
- {disabled}
129
- {min}
130
- {max}
131
- step={decimal ? 0.01 : 1}
132
- />
133
- {#if rightIcon}
134
- <Icon
135
- name={rightIcon.name}
136
- size={rightIcon.size ?? Size.Medium}
137
- colour={rightIcon.colour}
138
- float
139
- right={cssLength(variant == InputVariant.Modal ? '1rem' : '0.5rem')}
140
- top={cssLength('50%')}
141
- anchorX={cssLength('0')}
142
- anchorY={cssLength('-50%')}
143
- clickable={!!onRightIconClick}
144
- onclick={onRightIconClick}
145
- />
146
- {/if}
147
- {#if labelRight}
148
- <span
149
- class="right-label inset"
150
- class:for-modal={variant == InputVariant.Modal}>{labelRight}</span
151
- >
152
- {/if}
153
- </div>
154
- </label>
155
- </div>
156
-
16
+ const next = Number(raw);
17
+ if (isNaN(next)) {
18
+ return;
19
+ }
20
+ const lo = min ?? -Infinity;
21
+ const hi = max ?? Infinity;
22
+ const clamped = Math.max(lo, Math.min(hi, next));
23
+ if (clamped !== value) {
24
+ value = clamped;
25
+ }
26
+ }
27
+ const isInvalid = $derived(showErrorColours && (required && value == null || invalid));
28
+ </script>
29
+
30
+ <div
31
+ class="error-wrapper"
32
+ class:for-modal={variant == InputVariant.Modal}
33
+ class:for-table={variant == InputVariant.Table}
34
+ >
35
+ <label
36
+ class:for-modal={variant == InputVariant.Modal}
37
+ class:for-table={variant == InputVariant.Table}
38
+ >
39
+ {#if labelTop}
40
+ <span
41
+ class="top-label"
42
+ class:for-default={variant === InputVariant.Default}
43
+ class:invalid={isInvalid}
44
+ >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
45
+ >
46
+ {#if variant === InputVariant.Default}
47
+ <span
48
+ aria-hidden="true"
49
+ class="border"
50
+ class:invalid={isInvalid}
51
+ >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
52
+ >
53
+ {/if}
54
+ {/if}
55
+ <div
56
+ class="icon-container"
57
+ class:for-modal={variant == InputVariant.Modal}
58
+ >
59
+ {#if leftIcon}
60
+ <Icon
61
+ name={leftIcon.name}
62
+ size={leftIcon.size ?? Size.Medium}
63
+ colour={leftIcon.colour}
64
+ float
65
+ left={cssLength('0.75rem')}
66
+ top={cssLength('50%')}
67
+ anchorX={cssLength('0')}
68
+ anchorY={cssLength('-50%')}
69
+ clickable={!!onLeftIconClick}
70
+ onclick={onLeftIconClick}
71
+ />
72
+ {/if}
73
+ <input
74
+ {id}
75
+ class:invalid={isInvalid}
76
+ class:for-default={variant === InputVariant.Default}
77
+ data-type={dataType}
78
+ class:left-pad={leftIcon != undefined}
79
+ class:right-pad={rightIcon != undefined || (labelRight && variant == InputVariant.Modal)}
80
+ class:for-modal={variant == InputVariant.Modal}
81
+ type="number"
82
+ aria-invalid={isInvalid || undefined}
83
+ bind:value
84
+ {onblur}
85
+ {onfocus}
86
+ {onkeydown}
87
+ oninput={(e) => {
88
+ clamp(e);
89
+ oninput?.(e);
90
+ }}
91
+ bind:this={inputRef}
92
+ {placeholder}
93
+ {required}
94
+ {disabled}
95
+ {min}
96
+ {max}
97
+ step={decimal ? 0.01 : 1}
98
+ />
99
+ {#if rightIcon}
100
+ <Icon
101
+ name={rightIcon.name}
102
+ size={rightIcon.size ?? Size.Medium}
103
+ colour={rightIcon.colour}
104
+ float
105
+ right={cssLength(variant == InputVariant.Modal ? '1rem' : '0.5rem')}
106
+ top={cssLength('50%')}
107
+ anchorX={cssLength('0')}
108
+ anchorY={cssLength('-50%')}
109
+ clickable={!!onRightIconClick}
110
+ onclick={onRightIconClick}
111
+ />
112
+ {/if}
113
+ {#if labelRight}
114
+ <span
115
+ class="right-label inset"
116
+ class:for-modal={variant == InputVariant.Modal}>{labelRight}</span
117
+ >
118
+ {/if}
119
+ </div>
120
+ </label>
121
+ </div>
122
+
157
123
  <style>input {
158
124
  box-sizing: border-box;
159
125
  height: 100%;
@@ -393,4 +359,4 @@ input::-webkit-outer-spin-button,
393
359
  input::-webkit-inner-spin-button {
394
360
  -webkit-appearance: none;
395
361
  margin: 0;
396
- }</style>
362
+ }</style>
@@ -1,75 +1,64 @@
1
- <svelte:options runes />
2
-
3
- <!--
4
- @component
5
- A single-select group of large, clickable cards — each an optional leading
6
- icon, a label, and optional helper text. Use it instead of a `SingleSelect`
7
- when the choices benefit from a sentence of explanation (e.g. picking a
8
- report's delivery method or output format).
9
-
10
- Controlled: pass `selected` and update it in `onchange`. Accessible as a
11
- native radio group (the radio inputs are visually hidden but focusable).
12
- -->
13
- <script
14
- lang="ts"
15
- generics="T"
16
- >
17
- import { Colour } from '../scss/colours.js';
18
- import { Size } from '../Types/Internal/Size.js';
19
- import type { OptionCardsProps } from './OptionCardsProps.js';
20
- import Icon from './Icon.svelte';
21
-
22
- let {
23
- name,
24
- options,
25
- selected,
26
- onchange,
27
- multiple = false,
28
- selectedValues,
29
- ontoggle,
30
- }: OptionCardsProps<T> = $props();
31
- </script>
32
-
33
- <div
34
- class="option-cards"
35
- role={multiple ? 'group' : 'radiogroup'}
36
- >
37
- {#each options as option (option.value)}
38
- {@const isSelected = multiple
39
- ? (selectedValues?.includes(option.value) ?? false)
40
- : selected === option.value}
41
- <label
42
- class="card"
43
- class:selected={isSelected}
44
- >
45
- <input
46
- class="native"
47
- type={multiple ? 'checkbox' : 'radio'}
48
- {name}
49
- checked={isSelected}
50
- onchange={() => {
51
- if (multiple) {
52
- ontoggle?.(option.value, !isSelected);
53
- } else {
54
- void onchange?.(option.value);
55
- }
56
- }}
57
- />
58
- {#if option.icon}
59
- <Icon
60
- name={option.icon}
61
- size={Size.Large}
62
- colour={isSelected ? Colour['$brand-primary'] : Colour['$ui-blue-14']}
63
- />
64
- {/if}
65
- <span class="title">{option.label}</span>
66
- {#if option.info}
67
- <span class="info">{option.info}</span>
68
- {/if}
69
- </label>
70
- {/each}
71
- </div>
72
-
1
+ <svelte:options runes />
2
+
3
+ <!--
4
+ @component
5
+ A single-select group of large, clickable cards — each an optional leading
6
+ icon, a label, and optional helper text. Use it instead of a `SingleSelect`
7
+ when the choices benefit from a sentence of explanation (e.g. picking a
8
+ report's delivery method or output format).
9
+
10
+ Controlled: pass `selected` and update it in `onchange`. Accessible as a
11
+ native radio group (the radio inputs are visually hidden but focusable).
12
+ -->
13
+ <script
14
+ lang="ts"
15
+ generics="T"
16
+ >import { Colour } from "../scss/colours.js";
17
+ import { Size } from "../Types/Internal/Size.js";
18
+ import Icon from "./Icon.svelte";
19
+ let { name, options, selected, onchange, multiple = false, selectedValues, ontoggle } = $props();
20
+ </script>
21
+
22
+ <div
23
+ class="option-cards"
24
+ role={multiple ? 'group' : 'radiogroup'}
25
+ >
26
+ {#each options as option (option.value)}
27
+ {@const isSelected = multiple
28
+ ? (selectedValues?.includes(option.value) ?? false)
29
+ : selected === option.value}
30
+ <label
31
+ class="card"
32
+ class:selected={isSelected}
33
+ >
34
+ <input
35
+ class="native"
36
+ type={multiple ? 'checkbox' : 'radio'}
37
+ {name}
38
+ checked={isSelected}
39
+ onchange={() => {
40
+ if (multiple) {
41
+ ontoggle?.(option.value, !isSelected);
42
+ } else {
43
+ void onchange?.(option.value);
44
+ }
45
+ }}
46
+ />
47
+ {#if option.icon}
48
+ <Icon
49
+ name={option.icon}
50
+ size={Size.Large}
51
+ colour={isSelected ? Colour['$brand-primary'] : Colour['$ui-blue-14']}
52
+ />
53
+ {/if}
54
+ <span class="title">{option.label}</span>
55
+ {#if option.info}
56
+ <span class="info">{option.info}</span>
57
+ {/if}
58
+ </label>
59
+ {/each}
60
+ </div>
61
+
73
62
  <style>.option-cards {
74
63
  display: flex;
75
64
  flex-flow: row wrap;
@@ -120,4 +109,4 @@ native radio group (the radio inputs are visually hidden but focusable).
120
109
  .card:focus-within {
121
110
  outline: solid 2px #259fc7;
122
111
  outline-offset: 2px;
123
- }</style>
112
+ }</style>
@@ -1,27 +1,25 @@
1
- <svelte:options runes />
2
-
3
- <script lang="ts">
4
- import type { PageHeadingProps } from './PageHeadingProps.js';
5
-
6
- let { children, subtitle, extras }: PageHeadingProps = $props();
7
- </script>
8
-
9
- <div class="outer">
10
- <div class="column">
11
- <h1>{@render children()}</h1>
12
- <div class="one-line">
13
- {#if subtitle}
14
- {@render subtitle()}
15
- {/if}
16
- </div>
17
- </div>
18
- {#if extras}
19
- <div class="buttons">
20
- {@render extras()}
21
- </div>
22
- {/if}
23
- </div>
24
-
1
+ <svelte:options runes />
2
+
3
+ <script lang="ts">let { children, subtitle, extras } = $props();
4
+ export {};
5
+ </script>
6
+
7
+ <div class="outer">
8
+ <div class="column">
9
+ <h1>{@render children()}</h1>
10
+ <div class="one-line">
11
+ {#if subtitle}
12
+ {@render subtitle()}
13
+ {/if}
14
+ </div>
15
+ </div>
16
+ {#if extras}
17
+ <div class="buttons">
18
+ {@render extras()}
19
+ </div>
20
+ {/if}
21
+ </div>
22
+
25
23
  <style>.outer {
26
24
  padding: 1.5rem;
27
25
  display: flex;
@@ -65,4 +63,4 @@
65
63
  fill: #647d8e;
66
64
  color: #647d8e;
67
65
  font-size: 0.875rem;
68
- }</style>
66
+ }</style>
@@ -1,90 +1,71 @@
1
- <svelte:options runes />
2
-
3
- <script lang="ts">
4
- import { cssLength } from '../Helpers/Helpers.svelte.js';
5
- import { ColourSet } from '../scss/colours.js';
6
- import { Size } from '../Types/Internal/Size.js';
7
- import Action from './Action.svelte';
8
- import Icon from './Icon.svelte';
9
- import type { PasswordInputProps } from './PasswordInputProps.js';
10
- let {
11
- value = $bindable(''),
12
- label = undefined,
13
- placeholder = undefined,
14
- required = false,
15
- disabled = undefined,
16
- showInput = $bindable(false),
17
- leftIcon = undefined,
18
- inputRef = $bindable(),
19
- autocomplete = 'current-password',
20
- onblur,
21
- onfocus,
22
- // No default `onkeydown` - see TextInput.svelte for the rationale.
23
- // The legacy default (`passthrough`) blurred the input on every
24
- // alphanumeric keystroke and made the field unusable.
25
- onkeydown,
26
- }: PasswordInputProps = $props();
27
-
28
- function toggleVisibility(): void {
29
- showInput = !showInput;
30
- inputRef?.focus();
31
- }
32
- </script>
33
-
34
- <div class="error-wrapper">
35
- <label>
36
- {#if label}
37
- <span class="for-default">{label}</span>
38
- <span
39
- aria-hidden="true"
40
- class="border">{label}</span
41
- >
42
- {/if}
43
- <div class="icon-container">
44
- {#if leftIcon}
45
- <Icon
46
- name={leftIcon.name}
47
- size={leftIcon.size ?? Size.Medium}
48
- float
49
- left={cssLength('0.75rem')}
50
- top={cssLength('50%')}
51
- anchorX={cssLength('0')}
52
- anchorY={cssLength('-50%')}
53
- />
54
- {/if}
55
- <input
56
- class="for-default"
57
- class:left-pad={leftIcon != undefined}
58
- class:right-pad={true}
59
- type={showInput ? 'text' : 'password'}
60
- {autocomplete}
61
- autocapitalize="none"
62
- autocorrect="off"
63
- spellcheck="false"
64
- data-form-type="password"
65
- bind:value
66
- bind:this={inputRef}
67
- {onblur}
68
- {onfocus}
69
- {onkeydown}
70
- {placeholder}
71
- {required}
72
- {disabled}
73
- />
74
-
75
- <div class="right-icon">
76
- <Action
77
- label={showInput ? 'Hide password' : 'Show password'}
78
- colourSet={showInput ? ColourSet.Secondary : ColourSet.Auxiliary}
79
- icon={{ name: showInput ? 'visibility-off' : 'visibility' }}
80
- size={Size.MediumSmall}
81
- onclick={toggleVisibility}
82
- />
83
- </div>
84
- </div>
85
- </label>
86
- </div>
87
-
1
+ <svelte:options runes />
2
+
3
+ <script lang="ts">import { cssLength } from "../Helpers/Helpers.svelte.js";
4
+ import { ColourSet } from "../scss/colours.js";
5
+ import { Size } from "../Types/Internal/Size.js";
6
+ import Action from "./Action.svelte";
7
+ import Icon from "./Icon.svelte";
8
+ let { value = $bindable(""), label = undefined, placeholder = undefined, required = false, disabled = undefined, showInput = $bindable(false), leftIcon = undefined, inputRef = $bindable(), autocomplete = "current-password", onblur, onfocus, onkeydown } = $props();
9
+ function toggleVisibility() {
10
+ showInput = !showInput;
11
+ inputRef?.focus();
12
+ }
13
+ </script>
14
+
15
+ <div class="error-wrapper">
16
+ <label>
17
+ {#if label}
18
+ <span class="for-default">{label}</span>
19
+ <span
20
+ aria-hidden="true"
21
+ class="border">{label}</span
22
+ >
23
+ {/if}
24
+ <div class="icon-container">
25
+ {#if leftIcon}
26
+ <Icon
27
+ name={leftIcon.name}
28
+ size={leftIcon.size ?? Size.Medium}
29
+ float
30
+ left={cssLength('0.75rem')}
31
+ top={cssLength('50%')}
32
+ anchorX={cssLength('0')}
33
+ anchorY={cssLength('-50%')}
34
+ />
35
+ {/if}
36
+ <input
37
+ class="for-default"
38
+ class:left-pad={leftIcon != undefined}
39
+ class:right-pad={true}
40
+ type={showInput ? 'text' : 'password'}
41
+ {autocomplete}
42
+ autocapitalize="none"
43
+ autocorrect="off"
44
+ spellcheck="false"
45
+ data-form-type="password"
46
+ bind:value
47
+ bind:this={inputRef}
48
+ {onblur}
49
+ {onfocus}
50
+ {onkeydown}
51
+ {placeholder}
52
+ {required}
53
+ {disabled}
54
+ />
55
+
56
+ <div class="right-icon">
57
+ <Action
58
+ label={showInput ? 'Hide password' : 'Show password'}
59
+ colourSet={showInput ? ColourSet.Secondary : ColourSet.Auxiliary}
60
+ icon={{ name: showInput ? 'visibility-off' : 'visibility' }}
61
+ size={Size.MediumSmall}
62
+ onclick={toggleVisibility}
63
+ />
64
+ </div>
65
+ </div>
66
+ </label>
67
+ </div>
68
+
88
69
  <style>input {
89
70
  box-sizing: border-box;
90
71
  height: 100%;
@@ -318,4 +299,4 @@ label.for-table input {
318
299
 
319
300
  td {
320
301
  --input-border: none;
321
- }</style>
302
+ }</style>