@lavalogic/scoria 0.40.31 → 0.40.33

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 (137) hide show
  1. package/README.md +58 -58
  2. package/dist/Components/AccordionGroup.svelte +28 -28
  3. package/dist/Components/AccordionGroupButton.svelte +60 -60
  4. package/dist/Components/Action.svelte +48 -48
  5. package/dist/Components/AlertModal.svelte +102 -102
  6. package/dist/Components/Base/ContextWrapper.svelte +45 -45
  7. package/dist/Components/Base/Pagination.svelte +135 -135
  8. package/dist/Components/Base/Snippets.svelte +25 -25
  9. package/dist/Components/BigRadioSet.svelte +34 -34
  10. package/dist/Components/Bubble.svelte +38 -38
  11. package/dist/Components/Button.svelte +83 -83
  12. package/dist/Components/Checkbox.svelte +71 -71
  13. package/dist/Components/CollapsibleCard.svelte +59 -59
  14. package/dist/Components/CollapsibleMenuGroup.svelte +43 -43
  15. package/dist/Components/ConditionBuilder/ConditionBuilder.svelte +101 -101
  16. package/dist/Components/Contexts/ContextMenu.svelte +76 -76
  17. package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
  18. package/dist/Components/Contexts/ContextMenuOption.svelte +38 -38
  19. package/dist/Components/Contexts/Toast.svelte +71 -71
  20. package/dist/Components/Contexts/ToastContainer.svelte +34 -34
  21. package/dist/Components/Contexts/Tooltip.svelte +32 -32
  22. package/dist/Components/DataMatrixIcon.svelte +37 -37
  23. package/dist/Components/DateInput.svelte +80 -80
  24. package/dist/Components/DatePicker.svelte +86 -86
  25. package/dist/Components/DesktopModal.svelte +65 -65
  26. package/dist/Components/Dial.svelte +35 -35
  27. package/dist/Components/DimensionInput.svelte +95 -95
  28. package/dist/Components/DragMenu/DragMenuHolder.svelte +53 -53
  29. package/dist/Components/DragMenu/DraggableCard.svelte +49 -49
  30. package/dist/Components/FileCard.svelte +18 -18
  31. package/dist/Components/FileUpload.svelte +115 -115
  32. package/dist/Components/GridInput.svelte +123 -123
  33. package/dist/Components/GridInputSet.svelte +21 -21
  34. package/dist/Components/HorizontalTabGroup.svelte +54 -54
  35. package/dist/Components/HorizontalTabGroupButton.svelte +32 -32
  36. package/dist/Components/Icon.svelte +68 -68
  37. package/dist/Components/Icons.d.ts +3 -3
  38. package/dist/Components/Icons.js +11 -11
  39. package/dist/Components/InfoAlert.svelte +32 -32
  40. package/dist/Components/LoadingAnimation.svelte +228 -227
  41. package/dist/Components/LoadingModal.svelte +19 -19
  42. package/dist/Components/LoadingOverlay.svelte +20 -20
  43. package/dist/Components/Modal.svelte +127 -127
  44. package/dist/Components/MultiSelect.svelte +126 -126
  45. package/dist/Components/Nav/Nav.svelte +71 -71
  46. package/dist/Components/Nav/NavServiceMenuList.svelte +37 -37
  47. package/dist/Components/Nav/NavTab.svelte +46 -46
  48. package/dist/Components/Nav/ServiceMenuItem.svelte +62 -62
  49. package/dist/Components/Nav/ServicesNav.svelte +50 -50
  50. package/dist/Components/NumberInput.svelte +98 -98
  51. package/dist/Components/OptionCards.svelte +58 -58
  52. package/dist/Components/PageHeading.svelte +21 -21
  53. package/dist/Components/PasswordInput.svelte +61 -61
  54. package/dist/Components/PopoverButton.svelte +53 -53
  55. package/dist/Components/Portal.svelte +7 -7
  56. package/dist/Components/ProgressBubble.svelte +42 -42
  57. package/dist/Components/QuerySelect.svelte +102 -102
  58. package/dist/Components/ResourceCalendar/ResourceCalendar.svelte +241 -241
  59. package/dist/Components/SidebarPanel.svelte +32 -32
  60. package/dist/Components/SingleSelect.svelte +122 -122
  61. package/dist/Components/StepButton.svelte +48 -48
  62. package/dist/Components/StepForm.svelte +58 -58
  63. package/dist/Components/Switch.svelte +43 -43
  64. package/dist/Components/Table/ARCHITECTURE.md +298 -298
  65. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +30 -30
  66. package/dist/Components/Table/Body/Rows/ColumnList.svelte +24 -24
  67. package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +165 -165
  68. package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +13 -13
  69. package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +120 -120
  70. package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +81 -81
  71. package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +92 -92
  72. package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +110 -110
  73. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +54 -54
  74. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +35 -35
  75. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +64 -64
  76. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +82 -82
  77. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +88 -88
  78. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +90 -90
  79. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +96 -96
  80. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +71 -71
  81. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +124 -124
  82. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +91 -91
  83. package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +88 -88
  84. package/dist/Components/Table/Body/Rows/TableRow.svelte +127 -127
  85. package/dist/Components/Table/Body/TableBody.svelte +92 -92
  86. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +25 -25
  87. package/dist/Components/Table/Headers/SelectAllHeader.svelte +20 -20
  88. package/dist/Components/Table/Headers/TableHead.svelte +175 -175
  89. package/dist/Components/Table/Misc/ColumnPanel.svelte +32 -32
  90. package/dist/Components/Table/Misc/ColumnPanelModal.svelte +29 -29
  91. package/dist/Components/Table/Misc/FilterInput.svelte +326 -326
  92. package/dist/Components/Table/Misc/FilterPanel.svelte +79 -79
  93. package/dist/Components/Table/Misc/FilterPanelModal.svelte +21 -21
  94. package/dist/Components/Table/Misc/ShareViewModal.svelte +118 -118
  95. package/dist/Components/Table/Misc/SidePanel.svelte +24 -24
  96. package/dist/Components/Table/Misc/TableConfigurationModal.svelte +318 -318
  97. package/dist/Components/Table/Misc/TableFooter.svelte +201 -201
  98. package/dist/Components/Table/Misc/TableHorizontalBar.svelte +112 -112
  99. package/dist/Components/Table/Misc/TableSidebar.svelte +116 -116
  100. package/dist/Components/Table/Misc/TableViewDropdown.svelte +25 -25
  101. package/dist/Components/Table/Misc/ToolboxPanel.svelte +60 -60
  102. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +63 -63
  103. package/dist/Components/Table/Misc/UpdateViewOptionsModal.svelte +101 -101
  104. package/dist/Components/Table/NestedTable.svelte +29 -29
  105. package/dist/Components/Table/Table.svelte +140 -140
  106. package/dist/Components/Test/TestContextConsumer.svelte +8 -8
  107. package/dist/Components/TextArea.svelte +92 -90
  108. package/dist/Components/TextInput.svelte +128 -117
  109. package/dist/Components/ThreeStateRadio.svelte +101 -101
  110. package/dist/Components/Touch/BoolCard.svelte +27 -27
  111. package/dist/Components/Touch/DateModal.svelte +98 -98
  112. package/dist/Components/Touch/EditCard.svelte +44 -44
  113. package/dist/Components/Touch/InfoCard.svelte +25 -25
  114. package/dist/Components/Touch/InfoTextCard.svelte +22 -22
  115. package/dist/Components/Touch/ModalExplanation.svelte +13 -13
  116. package/dist/Components/Touch/NumberKeyboard.svelte +81 -81
  117. package/dist/Components/Touch/NumberModal.svelte +49 -49
  118. package/dist/Components/Touch/PlusMinusCard.svelte +40 -40
  119. package/dist/Components/Touch/SelectModal.svelte +86 -86
  120. package/dist/Components/Touch/SummaryCard.svelte +74 -74
  121. package/dist/Components/Touch/TextAreaModal.svelte +53 -53
  122. package/dist/Components/Touch/TextModal.svelte +56 -56
  123. package/dist/Components/Touch/TouchCard.svelte +28 -28
  124. package/dist/Components/Touch/TouchModal.svelte +141 -141
  125. package/dist/Components/Touch/UtilityButton.svelte +63 -63
  126. package/dist/Components/VerticalTabGroup.svelte +38 -38
  127. package/dist/Components/VerticalTabGroupButton.svelte +46 -46
  128. package/dist/Helpers/Datamatrix.d.ts +19 -19
  129. package/dist/Helpers/Datamatrix.js +291 -291
  130. package/dist/Types/Examples/ExampleModal.svelte +27 -27
  131. package/dist/paraglide/README.md +1 -1
  132. package/dist/scss/_basics.scss +12 -12
  133. package/dist/scss/_colours.scss +140 -140
  134. package/dist/scss/_motion.scss +57 -57
  135. package/dist/scss/_sizing.scss +85 -85
  136. package/dist/scss/_transitions.scss +8 -8
  137. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- <svelte:options runes />
2
-
1
+ <svelte:options runes />
2
+
3
3
  <script lang="ts">import { m as i18n } from "../paraglide/messages.js";
4
4
  import { cssLength } from "../Helpers/Helpers.svelte.js";
5
5
  import { InputVariant } from "../Types/Internal/InputVariant.js";
@@ -26,101 +26,101 @@ function clamp(e) {
26
26
  }
27
27
  }
28
28
  const isInvalid = $derived(showErrorColours && (required && value == null || invalid));
29
- </script>
30
-
31
- <div
32
- class="error-wrapper"
33
- class:for-modal={variant == InputVariant.Modal}
34
- class:for-table={variant == InputVariant.Table}
35
- >
36
- <label
37
- class:for-modal={variant == InputVariant.Modal}
38
- class:for-table={variant == InputVariant.Table}
39
- >
40
- {#if labelTop}
41
- <span
42
- class="top-label"
43
- class:for-default={variant === InputVariant.Default}
44
- class:invalid={isInvalid}
45
- >{labelTop}{#if optional}<i>&nbsp;- {i18n['scoria.label.optional']()}</i>{/if}</span
46
- >
47
- {#if variant === InputVariant.Default}
48
- <span
49
- aria-hidden="true"
50
- class="border"
51
- class:invalid={isInvalid}
52
- >{labelTop}{#if optional}<i>&nbsp;- {i18n['scoria.label.optional']()}</i>{/if}</span
53
- >
54
- {/if}
55
- {/if}
56
- <div
57
- class="icon-container"
58
- class:for-modal={variant == InputVariant.Modal}
59
- >
60
- {#if leftIcon}
61
- <Icon
62
- name={leftIcon.name}
63
- size={leftIcon.size ?? Size.Medium}
64
- colour={leftIcon.colour}
65
- float
66
- left={cssLength('0.75rem')}
67
- top={cssLength('50%')}
68
- anchorX={cssLength('0')}
69
- anchorY={cssLength('-50%')}
70
- clickable={!!onLeftIconClick}
71
- onclick={onLeftIconClick}
72
- />
73
- {/if}
74
- <input
75
- {id}
76
- class:invalid={isInvalid}
77
- class:for-default={variant === InputVariant.Default}
78
- data-type={dataType}
79
- class:left-pad={leftIcon != undefined}
80
- class:right-pad={rightIcon != undefined || (labelRight && variant == InputVariant.Modal)}
81
- class:for-modal={variant == InputVariant.Modal}
82
- type="number"
83
- aria-invalid={isInvalid || undefined}
84
- bind:value
85
- {onblur}
86
- {onfocus}
87
- {onkeydown}
88
- oninput={(e) => {
89
- clamp(e);
90
- oninput?.(e);
91
- }}
92
- bind:this={inputRef}
93
- {placeholder}
94
- {required}
95
- {disabled}
96
- {min}
97
- {max}
98
- step={decimal ? 0.01 : 1}
99
- />
100
- {#if rightIcon}
101
- <Icon
102
- name={rightIcon.name}
103
- size={rightIcon.size ?? Size.Medium}
104
- colour={rightIcon.colour}
105
- float
106
- right={cssLength(variant == InputVariant.Modal ? '1rem' : '0.5rem')}
107
- top={cssLength('50%')}
108
- anchorX={cssLength('0')}
109
- anchorY={cssLength('-50%')}
110
- clickable={!!onRightIconClick}
111
- onclick={onRightIconClick}
112
- />
113
- {/if}
114
- {#if labelRight}
115
- <span
116
- class="right-label inset"
117
- class:for-modal={variant == InputVariant.Modal}>{labelRight}</span
118
- >
119
- {/if}
120
- </div>
121
- </label>
122
- </div>
123
-
29
+ </script>
30
+
31
+ <div
32
+ class="error-wrapper"
33
+ class:for-modal={variant == InputVariant.Modal}
34
+ class:for-table={variant == InputVariant.Table}
35
+ >
36
+ <label
37
+ class:for-modal={variant == InputVariant.Modal}
38
+ class:for-table={variant == InputVariant.Table}
39
+ >
40
+ {#if labelTop}
41
+ <span
42
+ class="top-label"
43
+ class:for-default={variant === InputVariant.Default}
44
+ class:invalid={isInvalid}
45
+ >{labelTop}{#if optional}<i>&nbsp;- {i18n['scoria.label.optional']()}</i>{/if}</span
46
+ >
47
+ {#if variant === InputVariant.Default}
48
+ <span
49
+ aria-hidden="true"
50
+ class="border"
51
+ class:invalid={isInvalid}
52
+ >{labelTop}{#if optional}<i>&nbsp;- {i18n['scoria.label.optional']()}</i>{/if}</span
53
+ >
54
+ {/if}
55
+ {/if}
56
+ <div
57
+ class="icon-container"
58
+ class:for-modal={variant == InputVariant.Modal}
59
+ >
60
+ {#if leftIcon}
61
+ <Icon
62
+ name={leftIcon.name}
63
+ size={leftIcon.size ?? Size.Medium}
64
+ colour={leftIcon.colour}
65
+ float
66
+ left={cssLength('0.75rem')}
67
+ top={cssLength('50%')}
68
+ anchorX={cssLength('0')}
69
+ anchorY={cssLength('-50%')}
70
+ clickable={!!onLeftIconClick}
71
+ onclick={onLeftIconClick}
72
+ />
73
+ {/if}
74
+ <input
75
+ {id}
76
+ class:invalid={isInvalid}
77
+ class:for-default={variant === InputVariant.Default}
78
+ data-type={dataType}
79
+ class:left-pad={leftIcon != undefined}
80
+ class:right-pad={rightIcon != undefined || (labelRight && variant == InputVariant.Modal)}
81
+ class:for-modal={variant == InputVariant.Modal}
82
+ type="number"
83
+ aria-invalid={isInvalid || undefined}
84
+ bind:value
85
+ {onblur}
86
+ {onfocus}
87
+ {onkeydown}
88
+ oninput={(e) => {
89
+ clamp(e);
90
+ oninput?.(e);
91
+ }}
92
+ bind:this={inputRef}
93
+ {placeholder}
94
+ {required}
95
+ {disabled}
96
+ {min}
97
+ {max}
98
+ step={decimal ? 0.01 : 1}
99
+ />
100
+ {#if rightIcon}
101
+ <Icon
102
+ name={rightIcon.name}
103
+ size={rightIcon.size ?? Size.Medium}
104
+ colour={rightIcon.colour}
105
+ float
106
+ right={cssLength(variant == InputVariant.Modal ? '1rem' : '0.5rem')}
107
+ top={cssLength('50%')}
108
+ anchorX={cssLength('0')}
109
+ anchorY={cssLength('-50%')}
110
+ clickable={!!onRightIconClick}
111
+ onclick={onRightIconClick}
112
+ />
113
+ {/if}
114
+ {#if labelRight}
115
+ <span
116
+ class="right-label inset"
117
+ class:for-modal={variant == InputVariant.Modal}>{labelRight}</span
118
+ >
119
+ {/if}
120
+ </div>
121
+ </label>
122
+ </div>
123
+
124
124
  <style>input {
125
125
  box-sizing: border-box;
126
126
  height: 100%;
@@ -358,4 +358,4 @@ input::-webkit-outer-spin-button,
358
358
  input::-webkit-inner-spin-button {
359
359
  -webkit-appearance: none;
360
360
  margin: 0;
361
- }</style>
361
+ }</style>
@@ -1,64 +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"
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
16
  >import { Colour } from "../scss/colours.js";
17
17
  import { Size } from "../Types/Internal/Size.js";
18
18
  import Icon from "./Icon.svelte";
19
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
-
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
+
62
62
  <style>.option-cards {
63
63
  display: flex;
64
64
  flex-flow: row wrap;
@@ -109,4 +109,4 @@ let { name, options, selected, onchange, multiple = false, selectedValues, ontog
109
109
  .card:focus-within {
110
110
  outline: solid 2px #259fc7;
111
111
  outline-offset: 2px;
112
- }</style>
112
+ }</style>
@@ -1,25 +1,25 @@
1
- <svelte:options runes />
2
-
1
+ <svelte:options runes />
2
+
3
3
  <script lang="ts">let { children, subtitle, extras } = $props();
4
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
-
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
+
23
23
  <style>.outer {
24
24
  padding: 1.5rem;
25
25
  display: flex;
@@ -63,4 +63,4 @@ export {};
63
63
  fill: #647d8e;
64
64
  color: #647d8e;
65
65
  font-size: 0.875rem;
66
- }</style>
66
+ }</style>
@@ -1,5 +1,5 @@
1
- <svelte:options runes />
2
-
1
+ <svelte:options runes />
2
+
3
3
  <script lang="ts">import { cssLength } from "../Helpers/Helpers.svelte.js";
4
4
  import { m as i18n } from "../paraglide/messages.js";
5
5
  import { ColourSet } from "../scss/colours.js";
@@ -11,64 +11,64 @@ function toggleVisibility() {
11
11
  showInput = !showInput;
12
12
  inputRef?.focus();
13
13
  }
14
- </script>
15
-
16
- <div class="error-wrapper">
17
- <label>
18
- {#if label}
19
- <span class="for-default">{label}</span>
20
- <span
21
- aria-hidden="true"
22
- class="border">{label}</span
23
- >
24
- {/if}
25
- <div class="icon-container">
26
- {#if leftIcon}
27
- <Icon
28
- name={leftIcon.name}
29
- size={leftIcon.size ?? Size.Medium}
30
- float
31
- left={cssLength('0.75rem')}
32
- top={cssLength('50%')}
33
- anchorX={cssLength('0')}
34
- anchorY={cssLength('-50%')}
35
- />
36
- {/if}
37
- <input
38
- class="for-default"
39
- class:left-pad={leftIcon != undefined}
40
- class:right-pad={true}
41
- type={showInput ? 'text' : 'password'}
42
- {autocomplete}
43
- autocapitalize="none"
44
- autocorrect="off"
45
- spellcheck="false"
46
- data-form-type="password"
47
- bind:value
48
- bind:this={inputRef}
49
- {onblur}
50
- {onfocus}
51
- {onkeydown}
52
- {placeholder}
53
- {required}
54
- {disabled}
55
- />
56
-
57
- <div class="right-icon">
58
- <Action
59
- label={showInput
60
- ? i18n['scoria.label.hide_password']()
61
- : i18n['scoria.label.show_password']()}
62
- colourSet={showInput ? ColourSet.Secondary : ColourSet.Auxiliary}
63
- icon={{ name: showInput ? 'visibility-off' : 'visibility' }}
64
- size={Size.MediumSmall}
65
- onclick={toggleVisibility}
66
- />
67
- </div>
68
- </div>
69
- </label>
70
- </div>
71
-
14
+ </script>
15
+
16
+ <div class="error-wrapper">
17
+ <label>
18
+ {#if label}
19
+ <span class="for-default">{label}</span>
20
+ <span
21
+ aria-hidden="true"
22
+ class="border">{label}</span
23
+ >
24
+ {/if}
25
+ <div class="icon-container">
26
+ {#if leftIcon}
27
+ <Icon
28
+ name={leftIcon.name}
29
+ size={leftIcon.size ?? Size.Medium}
30
+ float
31
+ left={cssLength('0.75rem')}
32
+ top={cssLength('50%')}
33
+ anchorX={cssLength('0')}
34
+ anchorY={cssLength('-50%')}
35
+ />
36
+ {/if}
37
+ <input
38
+ class="for-default"
39
+ class:left-pad={leftIcon != undefined}
40
+ class:right-pad={true}
41
+ type={showInput ? 'text' : 'password'}
42
+ {autocomplete}
43
+ autocapitalize="none"
44
+ autocorrect="off"
45
+ spellcheck="false"
46
+ data-form-type="password"
47
+ bind:value
48
+ bind:this={inputRef}
49
+ {onblur}
50
+ {onfocus}
51
+ {onkeydown}
52
+ {placeholder}
53
+ {required}
54
+ {disabled}
55
+ />
56
+
57
+ <div class="right-icon">
58
+ <Action
59
+ label={showInput
60
+ ? i18n['scoria.label.hide_password']()
61
+ : i18n['scoria.label.show_password']()}
62
+ colourSet={showInput ? ColourSet.Secondary : ColourSet.Auxiliary}
63
+ icon={{ name: showInput ? 'visibility-off' : 'visibility' }}
64
+ size={Size.MediumSmall}
65
+ onclick={toggleVisibility}
66
+ />
67
+ </div>
68
+ </div>
69
+ </label>
70
+ </div>
71
+
72
72
  <style>input {
73
73
  box-sizing: border-box;
74
74
  height: 100%;
@@ -300,4 +300,4 @@ label.for-table input {
300
300
 
301
301
  td {
302
302
  --input-border: none;
303
- }</style>
303
+ }</style>
@@ -1,11 +1,11 @@
1
- <svelte:options runes />
2
-
3
- <!--
4
- @component
5
- An icon button that toggles a floating popover anchored beneath it, with a
6
- caret pointing back at the button. The popover holds arbitrary content (the
7
- default snippet) and closes on click-outside or Escape.
8
- -->
1
+ <svelte:options runes />
2
+
3
+ <!--
4
+ @component
5
+ An icon button that toggles a floating popover anchored beneath it, with a
6
+ caret pointing back at the button. The popover holds arbitrary content (the
7
+ default snippet) and closes on click-outside or Escape.
8
+ -->
9
9
  <script lang="ts">import { Colour } from "../scss/colours.js";
10
10
  import { Size } from "../Types/Internal/Size.js";
11
11
  import Icon from "./Icon.svelte";
@@ -24,50 +24,50 @@ function onWindowKeydown(e) {
24
24
  open = false;
25
25
  }
26
26
  }
27
- </script>
28
-
29
- <svelte:window
30
- onpointerdown={onWindowPointerDown}
31
- onkeydown={onWindowKeydown}
32
- />
33
-
34
- <div
35
- class="popover-button"
36
- bind:this={wrapper}
37
- >
38
- <button
39
- type="button"
40
- class="trigger"
41
- class:open
42
- class:borderless
43
- aria-label={label}
44
- aria-expanded={open}
45
- aria-haspopup="dialog"
46
- onclick={() => {
47
- open = !open;
48
- }}
49
- >
50
- <Icon
51
- name={icon}
52
- size={Size.Large}
53
- colour={open ? Colour['$brand-primary'] : Colour['$font-secondary']}
54
- />
55
- </button>
56
-
57
- {#if open}
58
- <div
59
- class="popover align-{align}"
60
- role="dialog"
61
- aria-label={label}
62
- >
63
- <span class="caret"></span>
64
- <div class="popover-inner">
65
- {@render children()}
66
- </div>
67
- </div>
68
- {/if}
69
- </div>
70
-
27
+ </script>
28
+
29
+ <svelte:window
30
+ onpointerdown={onWindowPointerDown}
31
+ onkeydown={onWindowKeydown}
32
+ />
33
+
34
+ <div
35
+ class="popover-button"
36
+ bind:this={wrapper}
37
+ >
38
+ <button
39
+ type="button"
40
+ class="trigger"
41
+ class:open
42
+ class:borderless
43
+ aria-label={label}
44
+ aria-expanded={open}
45
+ aria-haspopup="dialog"
46
+ onclick={() => {
47
+ open = !open;
48
+ }}
49
+ >
50
+ <Icon
51
+ name={icon}
52
+ size={Size.Large}
53
+ colour={open ? Colour['$brand-primary'] : Colour['$font-secondary']}
54
+ />
55
+ </button>
56
+
57
+ {#if open}
58
+ <div
59
+ class="popover align-{align}"
60
+ role="dialog"
61
+ aria-label={label}
62
+ >
63
+ <span class="caret"></span>
64
+ <div class="popover-inner">
65
+ {@render children()}
66
+ </div>
67
+ </div>
68
+ {/if}
69
+ </div>
70
+
71
71
  <style>.popover-button {
72
72
  position: relative;
73
73
  display: inline-flex;
@@ -148,4 +148,4 @@ function onWindowKeydown(e) {
148
148
 
149
149
  .align-end .caret {
150
150
  inset-inline-end: 1.5rem;
151
- }</style>
151
+ }</style>
@@ -1,5 +1,5 @@
1
- <svelte:options runes />
2
-
1
+ <svelte:options runes />
2
+
3
3
  <script lang="ts">import { browser } from "$app/environment";
4
4
  let { target = browser ? globalThis.document.body : undefined, children } = $props();
5
5
  let ref = $state();
@@ -23,8 +23,8 @@ $effect(() => {
23
23
  lastTarget = undefined;
24
24
  };
25
25
  });
26
- </script>
27
-
28
- <div bind:this={ref}>
29
- {@render children()}
30
- </div>
26
+ </script>
27
+
28
+ <div bind:this={ref}>
29
+ {@render children()}
30
+ </div>