@lavalogic/scoria 0.37.44 → 0.37.45

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 (237) 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/ActionProps.d.ts +2 -6
  6. package/dist/Components/AlertModal.svelte +195 -183
  7. package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +702 -702
  8. package/dist/Components/Base/BaseModal.svelte +125 -125
  9. package/dist/Components/Base/ContextWrapper.svelte +72 -72
  10. package/dist/Components/Base/Pagination.svelte +198 -198
  11. package/dist/Components/Base/Snippets.svelte +36 -36
  12. package/dist/Components/BigRadioSet.svelte +38 -38
  13. package/dist/Components/Bubble.svelte +101 -101
  14. package/dist/Components/Button.svelte +209 -209
  15. package/dist/Components/ButtonProps.d.ts +2 -6
  16. package/dist/Components/Checkbox.svelte +86 -86
  17. package/dist/Components/CollapsibleCard.svelte +78 -78
  18. package/dist/Components/Contexts/ContextMenu.svelte +164 -164
  19. package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
  20. package/dist/Components/Contexts/ContextMenuOption.svelte +60 -60
  21. package/dist/Components/Contexts/Toast.svelte +83 -83
  22. package/dist/Components/Contexts/ToastContainer.svelte +65 -65
  23. package/dist/Components/Contexts/Tooltip.svelte +37 -37
  24. package/dist/Components/DataMatrixIcon.svelte +112 -112
  25. package/dist/Components/DataMatrixIconProps.d.ts +3 -13
  26. package/dist/Components/DateInput.svelte +148 -148
  27. package/dist/Components/DatePicker.svelte +300 -300
  28. package/dist/Components/DesktopModal.svelte +90 -90
  29. package/dist/Components/Dial.svelte +204 -204
  30. package/dist/Components/DialProps.d.ts +1 -18
  31. package/dist/Components/DimensionInput.svelte +170 -170
  32. package/dist/Components/DragMenu/DragMenuHolder.svelte +119 -119
  33. package/dist/Components/DragMenu/DraggableCard.svelte +77 -77
  34. package/dist/Components/FileCard.svelte +24 -24
  35. package/dist/Components/FileUpload.svelte +236 -236
  36. package/dist/Components/GridInput.svelte +196 -200
  37. package/dist/Components/GridInputSet.svelte +29 -29
  38. package/dist/Components/HorizontalTabGroup.svelte +82 -82
  39. package/dist/Components/HorizontalTabGroupButton.svelte +44 -44
  40. package/dist/Components/Icon.svelte +128 -128
  41. package/dist/Components/IconProps.d.ts +2 -7
  42. package/dist/Components/Icons.js +357 -357
  43. package/dist/Components/LoadingAnimation.svelte +29 -29
  44. package/dist/Components/LoadingModal.svelte +45 -45
  45. package/dist/Components/LoadingOverlay.svelte +25 -25
  46. package/dist/Components/LoadingOverlayProps.d.ts +3 -7
  47. package/dist/Components/Modal.svelte +258 -258
  48. package/dist/Components/ModalProps.d.ts +0 -3
  49. package/dist/Components/MultiSelect.svelte +220 -220
  50. package/dist/Components/MultiSelectCommonProps.d.ts +6 -17
  51. package/dist/Components/Nav/Nav.svelte +99 -99
  52. package/dist/Components/Nav/NavProps.d.ts +4 -11
  53. package/dist/Components/Nav/NavServiceMenuList.svelte +43 -43
  54. package/dist/Components/Nav/NavTab.svelte +62 -62
  55. package/dist/Components/Nav/ServiceMenuItem.svelte +100 -100
  56. package/dist/Components/Nav/ServicesNav.svelte +80 -80
  57. package/dist/Components/NumberInput.svelte +157 -157
  58. package/dist/Components/PageHeading.svelte +25 -25
  59. package/dist/Components/PasswordInput.svelte +88 -88
  60. package/dist/Components/Portal.svelte +36 -36
  61. package/dist/Components/ProgressBubble.svelte +107 -108
  62. package/dist/Components/ProgressBubbleProps.d.ts +3 -3
  63. package/dist/Components/QuerySelect.svelte +366 -366
  64. package/dist/Components/QuerySelectProps.d.ts +4 -14
  65. package/dist/Components/SingleSelect.svelte +250 -250
  66. package/dist/Components/SingleSelectCommonProps.d.ts +3 -19
  67. package/dist/Components/StepButton.svelte +70 -70
  68. package/dist/Components/StepForm.svelte +140 -140
  69. package/dist/Components/Switch.svelte +69 -69
  70. package/dist/Components/Table/ARCHITECTURE.md +298 -0
  71. package/dist/Components/Table/Body/QuickSearchCell.svelte +679 -694
  72. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +51 -51
  73. package/dist/Components/Table/Body/Rows/ColumnList.svelte +59 -59
  74. package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +456 -478
  75. package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +79 -79
  76. package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +185 -188
  77. package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +124 -124
  78. package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +120 -120
  79. package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +230 -230
  80. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +105 -105
  81. package/dist/Components/Table/Body/Rows/Columns/SelectColumn.d.ts +12 -9
  82. package/dist/Components/Table/Body/Rows/Columns/SelectTableCell.d.ts +5 -5
  83. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +87 -87
  84. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +126 -126
  85. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +159 -159
  86. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +246 -246
  87. package/dist/Components/Table/Body/Rows/Columns/TableDatePickerProps.d.ts +4 -4
  88. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +216 -216
  89. package/dist/Components/Table/Body/Rows/Columns/TableQueryCell.d.ts +6 -5
  90. package/dist/Components/Table/Body/Rows/Columns/TableQueryColumn.d.ts +7 -6
  91. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +252 -257
  92. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +179 -179
  93. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +221 -229
  94. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte.d.ts +11 -11
  95. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +197 -197
  96. package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +190 -190
  97. package/dist/Components/Table/Body/Rows/TableRow.svelte +290 -290
  98. package/dist/Components/Table/Body/TableBody.svelte +155 -155
  99. package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.js +2 -3
  100. package/dist/Components/Table/ColumnFactory.svelte.d.ts +9 -11
  101. package/dist/Components/Table/ColumnFactory.svelte.js +101 -118
  102. package/dist/Components/Table/ColumnKindRegistry.d.ts +112 -0
  103. package/dist/Components/Table/ColumnKindRegistry.js +63 -0
  104. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +41 -41
  105. package/dist/Components/Table/Headers/SelectAllHeader.svelte +30 -30
  106. package/dist/Components/Table/Headers/TableHead.svelte +415 -413
  107. package/dist/Components/Table/Misc/ColumnPanel.svelte +94 -94
  108. package/dist/Components/Table/Misc/ColumnPanelModal.svelte +112 -112
  109. package/dist/Components/Table/Misc/FilterInput.svelte +620 -644
  110. package/dist/Components/Table/Misc/FilterInput.svelte.d.ts +12 -12
  111. package/dist/Components/Table/Misc/FilterInputProps.d.ts +2 -2
  112. package/dist/Components/Table/Misc/FilterPanel.svelte +257 -257
  113. package/dist/Components/Table/Misc/FilterPanelModal.svelte +30 -30
  114. package/dist/Components/Table/Misc/SidePanel.svelte +35 -35
  115. package/dist/Components/Table/Misc/TableFooter.svelte +311 -311
  116. package/dist/Components/Table/Misc/TableHorizontalBar.svelte +125 -125
  117. package/dist/Components/Table/Misc/TableSidebar.svelte +157 -157
  118. package/dist/Components/Table/Misc/ToolboxPanel.svelte +100 -100
  119. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +107 -107
  120. package/dist/Components/Table/NestedTable.svelte +130 -133
  121. package/dist/Components/Table/SubApis.svelte.d.ts +1 -5
  122. package/dist/Components/Table/SubApis.svelte.js +33 -32
  123. package/dist/Components/Table/Table.svelte +692 -745
  124. package/dist/Components/Table/TableHelpers.svelte.d.ts +6 -19
  125. package/dist/Components/Table/TableHelpers.svelte.js +6 -14
  126. package/dist/Components/Table/Types/Columns/Column.d.ts +2 -2
  127. package/dist/Components/Table/Types/Columns/DateColumn.d.ts +3 -3
  128. package/dist/Components/Table/Types/Columns/DateTableCell.d.ts +7 -7
  129. package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.d.ts +7 -8
  130. package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.js +4 -5
  131. package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.d.ts +11 -14
  132. package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.js +3 -4
  133. package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.d.ts +7 -11
  134. package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.js +3 -3
  135. package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.d.ts +13 -18
  136. package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.js +4 -5
  137. package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.d.ts +5 -5
  138. package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.js +2 -2
  139. package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.d.ts +15 -12
  140. package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.js +4 -5
  141. package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.d.ts +8 -12
  142. package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.js +3 -3
  143. package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.d.ts +6 -6
  144. package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.js +3 -3
  145. package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +49 -16
  146. package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.js +27 -5
  147. package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.d.ts +7 -7
  148. package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js +4 -4
  149. package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.d.ts +5 -5
  150. package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.js +2 -2
  151. package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.d.ts +5 -5
  152. package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.js +2 -2
  153. package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.d.ts +5 -5
  154. package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.js +2 -2
  155. package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.d.ts +5 -5
  156. package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.js +2 -2
  157. package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.d.ts +11 -19
  158. package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.js +4 -8
  159. package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.d.ts +6 -7
  160. package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.js +3 -4
  161. package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.d.ts +9 -9
  162. package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.js +4 -4
  163. package/dist/Components/Table/Types/Columns/ExpandTableCell.d.ts +5 -5
  164. package/dist/Components/Table/Types/Columns/ProgressBarTableCell.d.ts +6 -6
  165. package/dist/Components/Table/Types/Columns/TableCell.d.ts +7 -6
  166. package/dist/Components/Table/Types/Context/ClipboardState.svelte.d.ts +98 -0
  167. package/dist/Components/Table/Types/Context/ClipboardState.svelte.js +290 -0
  168. package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.d.ts +17 -45
  169. package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.js +17 -45
  170. package/dist/Components/Table/Types/Context/FilteringState.svelte.d.ts +9 -20
  171. package/dist/Components/Table/Types/Context/FilteringState.svelte.js +9 -20
  172. package/dist/Components/Table/Types/Context/FocusState.svelte.d.ts +23 -42
  173. package/dist/Components/Table/Types/Context/FocusState.svelte.js +32 -59
  174. package/dist/Components/Table/Types/Context/ITable.d.ts +5 -8
  175. package/dist/Components/Table/Types/Context/PreferencesState.svelte.d.ts +29 -56
  176. package/dist/Components/Table/Types/Context/PreferencesState.svelte.js +28 -55
  177. package/dist/Components/Table/Types/Context/QueryValuesState.svelte.d.ts +50 -0
  178. package/dist/Components/Table/Types/Context/QueryValuesState.svelte.js +62 -0
  179. package/dist/Components/Table/Types/Context/SelectionState.svelte.d.ts +17 -28
  180. package/dist/Components/Table/Types/Context/SelectionState.svelte.js +17 -28
  181. package/dist/Components/Table/Types/Context/SortingState.svelte.d.ts +15 -29
  182. package/dist/Components/Table/Types/Context/SortingState.svelte.js +17 -31
  183. package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +212 -325
  184. package/dist/Components/Table/Types/Context/TableContext.svelte.js +292 -706
  185. package/dist/Components/Table/Types/Context/VirtualisationState.svelte.d.ts +62 -79
  186. package/dist/Components/Table/Types/Context/VirtualisationState.svelte.js +54 -73
  187. package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.d.ts +16 -27
  188. package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.js +16 -27
  189. package/dist/Components/Table/Types/DataRepository/IDataRepository.d.ts +12 -15
  190. package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.d.ts +15 -30
  191. package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.js +16 -28
  192. package/dist/Components/Table/Types/Header.d.ts +4 -4
  193. package/dist/Components/Table/Types/HeaderGroup.d.ts +5 -5
  194. package/dist/Components/Table/Types/Public/index.d.ts +2 -4
  195. package/dist/Components/Table/Types/Public/index.js +2 -4
  196. package/dist/Components/Table/clipboardEscape.d.ts +32 -0
  197. package/dist/Components/Table/clipboardEscape.js +45 -0
  198. package/dist/Components/Table/createTable.svelte.d.ts +8 -18
  199. package/dist/Components/Table/createTable.svelte.js +19 -47
  200. package/dist/Components/Test/TestContextConsumer.svelte +13 -13
  201. package/dist/Components/TextArea.svelte +130 -130
  202. package/dist/Components/TextInput.svelte +176 -176
  203. package/dist/Components/ThreeStateRadio.svelte +131 -131
  204. package/dist/Components/Touch/BoolCard.svelte +45 -45
  205. package/dist/Components/Touch/DateModal.svelte +209 -209
  206. package/dist/Components/Touch/EditCard.svelte +59 -59
  207. package/dist/Components/Touch/InfoCard.svelte +31 -31
  208. package/dist/Components/Touch/InfoTextCard.svelte +28 -28
  209. package/dist/Components/Touch/ModalExplanation.svelte +17 -17
  210. package/dist/Components/Touch/NumberKeyboard.svelte +225 -225
  211. package/dist/Components/Touch/NumberModal.svelte +79 -79
  212. package/dist/Components/Touch/PlusMinusCard.svelte +46 -46
  213. package/dist/Components/Touch/SelectModal.svelte +123 -123
  214. package/dist/Components/Touch/SummaryCard.svelte +93 -93
  215. package/dist/Components/Touch/TextAreaModal.svelte +95 -95
  216. package/dist/Components/Touch/TextModal.svelte +106 -106
  217. package/dist/Components/Touch/TouchCard.svelte +33 -33
  218. package/dist/Components/Touch/TouchModal.svelte +274 -274
  219. package/dist/Components/Touch/UtilityButton.svelte +109 -109
  220. package/dist/Components/VerticalTabGroup.svelte +79 -79
  221. package/dist/Components/VerticalTabGroupButton.svelte +58 -58
  222. package/dist/Contexts/ToastContext.svelte.js +3 -4
  223. package/dist/Helpers/Datamatrix.d.ts +19 -19
  224. package/dist/Helpers/Datamatrix.js +291 -291
  225. package/dist/Helpers/Helpers.svelte.d.ts +2 -4
  226. package/dist/Helpers/Helpers.svelte.js +2 -4
  227. package/dist/Helpers/dropdownPortal.d.ts +26 -41
  228. package/dist/Helpers/dropdownPortal.js +62 -116
  229. package/dist/Types/Examples/ExampleModal.svelte +35 -35
  230. package/dist/index.d.ts +0 -1
  231. package/dist/scss/_basics.scss +12 -12
  232. package/dist/scss/_colours.scss +134 -134
  233. package/dist/scss/_mixins.scss +3348 -3360
  234. package/dist/scss/_motion.scss +57 -57
  235. package/dist/scss/_sizing.scss +85 -85
  236. package/dist/scss/_transitions.scss +8 -8
  237. package/package.json +2 -1
@@ -1,19 +1,19 @@
1
- <svelte:options runes />
2
-
3
- <!--
4
- @component
5
- Visual separator for {@link ContextMenu}. Renders a thin horizontal
6
- rule. The native `<hr>` ARIA mapping is `role="separator"`, which is
7
- the correct semantic inside a `role="menu"` group, so no explicit
8
- role is set.
9
-
10
- Intended for use between groups of `ContextMenuOption` entries inside
11
- a context menu rendered via the visual host.
12
- -->
13
- <hr />
14
-
1
+ <svelte:options runes />
2
+
3
+ <!--
4
+ @component
5
+ Visual separator for {@link ContextMenu}. Renders a thin horizontal
6
+ rule. The native `<hr>` ARIA mapping is `role="separator"`, which is
7
+ the correct semantic inside a `role="menu"` group, so no explicit
8
+ role is set.
9
+
10
+ Intended for use between groups of `ContextMenuOption` entries inside
11
+ a context menu rendered via the visual host.
12
+ -->
13
+ <hr />
14
+
15
15
  <style>hr {
16
16
  border-top: solid 1px #cbd4da;
17
17
  width: 100%;
18
18
  margin: 2px 0;
19
- }</style>
19
+ }</style>
@@ -1,62 +1,62 @@
1
- <svelte:options runes />
2
-
3
- <!--
4
- @component
5
- A single row inside the {@link ContextMenu} host. Renders a
6
- `<button role="menuitem">` and assigns a roving `tabindex`: the
7
- first option (index `0`) receives focus on mount and is the only
8
- tab stop, all subsequent options carry `tabindex="-1"` so arrow-key
9
- navigation owns focus traversal within the menu.
10
-
11
- Consumers do not usually mount `ContextMenuOption` directly; the
12
- visual host iterates over `ContextMenuContext.items` and renders one
13
- option per entry.
14
- -->
15
- <script lang="ts">
16
- import { devCatch } from '../../Helpers/Helpers.svelte.js';
17
- import { tick } from 'svelte';
18
- import type { ContextMenuOptionProps } from './ContextMenuOptionProps.js';
19
-
20
- let { text = '', index, disabled = false, onclick, children }: ContextMenuOptionProps = $props();
21
-
22
- let element = $state<HTMLButtonElement | undefined>();
23
-
24
- $effect(() => {
25
- void element;
26
- // Only the first option seeds focus. The check stays inside the
27
- // effect (rather than gating registration) so Svelte's reactive
28
- // dependency on `index` is recorded.
29
- if (index === 0) {
30
- tick()
31
- .then(() => {
32
- element?.focus();
33
- })
34
- .catch(devCatch);
35
- }
36
- });
37
- </script>
38
-
39
- <button
40
- class="context-menu-item"
41
- role="menuitem"
42
- class:disabled
43
- tabindex={index === 0 ? 0 : -1}
44
- aria-disabled={disabled ? 'true' : undefined}
45
- bind:this={element}
46
- onclick={(e) => {
47
- e.stopImmediatePropagation();
48
- e.stopPropagation();
49
- e.preventDefault();
50
- void onclick?.(e);
51
- }}
52
- >
53
- {#if text}
54
- {text}
55
- {:else if children}
56
- {@render children()}
57
- {/if}
58
- </button>
59
-
1
+ <svelte:options runes />
2
+
3
+ <!--
4
+ @component
5
+ A single row inside the {@link ContextMenu} host. Renders a
6
+ `<button role="menuitem">` and assigns a roving `tabindex`: the
7
+ first option (index `0`) receives focus on mount and is the only
8
+ tab stop, all subsequent options carry `tabindex="-1"` so arrow-key
9
+ navigation owns focus traversal within the menu.
10
+
11
+ Consumers do not usually mount `ContextMenuOption` directly; the
12
+ visual host iterates over `ContextMenuContext.items` and renders one
13
+ option per entry.
14
+ -->
15
+ <script lang="ts">
16
+ import { devCatch } from '../../Helpers/Helpers.svelte.js';
17
+ import { tick } from 'svelte';
18
+ import type { ContextMenuOptionProps } from './ContextMenuOptionProps.js';
19
+
20
+ let { text = '', index, disabled = false, onclick, children }: ContextMenuOptionProps = $props();
21
+
22
+ let element = $state<HTMLButtonElement | undefined>();
23
+
24
+ $effect(() => {
25
+ void element;
26
+ // Only the first option seeds focus. The check stays inside the
27
+ // effect (rather than gating registration) so Svelte's reactive
28
+ // dependency on `index` is recorded.
29
+ if (index === 0) {
30
+ tick()
31
+ .then(() => {
32
+ element?.focus();
33
+ })
34
+ .catch(devCatch);
35
+ }
36
+ });
37
+ </script>
38
+
39
+ <button
40
+ class="context-menu-item"
41
+ role="menuitem"
42
+ class:disabled
43
+ tabindex={index === 0 ? 0 : -1}
44
+ aria-disabled={disabled ? 'true' : undefined}
45
+ bind:this={element}
46
+ onclick={(e) => {
47
+ e.stopImmediatePropagation();
48
+ e.stopPropagation();
49
+ e.preventDefault();
50
+ void onclick?.(e);
51
+ }}
52
+ >
53
+ {#if text}
54
+ {text}
55
+ {:else if children}
56
+ {@render children()}
57
+ {/if}
58
+ </button>
59
+
60
60
  <style>button {
61
61
  background-color: #ffffff;
62
62
  border: none;
@@ -85,4 +85,4 @@ button.disabled {
85
85
 
86
86
  button.disabled:hover {
87
87
  background: #ffffff;
88
- }</style>
88
+ }</style>
@@ -1,85 +1,85 @@
1
- <svelte:options runes />
2
-
3
- <!--
4
- @component
5
- Single toast rendering. Renders a horizontally-sliding pill near the
6
- bottom-right of the viewport via `ToastContainer`. The severity of the
7
- underlying toast drives both the colouring and the live-region
8
- semantics:
9
-
10
- - `Validity.Invalid` -> `role="alert"`, `aria-live="assertive"`.
11
- - All other severities -> `role="status"`, `aria-live="polite"`.
12
-
13
- The slide transition honours `prefers-reduced-motion` through the
14
- shared `usePrefersReducedMotion` helper; when the user has opted in
15
- the duration collapses to zero. The copy action is only shown when
16
- `navigator.clipboard` is present (HTTPS or `localhost`).
17
- -->
18
- <script
19
- lang="ts"
20
- module
21
- >
22
- import { ColourSet } from '../../scss/colours.js';
23
- import { Size } from '../../Types/Internal/Size.js';
24
- import { Validity } from '../../Types/Internal/Validity.js';
25
- import { slide } from 'svelte/transition';
26
- import Action from '../Action.svelte';
27
- import Icon from '../Icon.svelte';
28
- import type { ToastProps } from './ToastProps.js';
29
- </script>
30
-
31
- <script lang="ts">
32
- import { usePrefersReducedMotion } from '../../Helpers/prefersReducedMotion.svelte.js';
33
-
34
- let { toast, copy }: ToastProps = $props();
35
-
36
- const reducedMotion = usePrefersReducedMotion();
37
- const slideDuration = $derived(reducedMotion.matches ? 0 : 500);
38
- </script>
39
-
40
- <output
41
- role={toast.result == Validity.Invalid ? 'alert' : 'status'}
42
- aria-live={toast.result == Validity.Invalid ? 'assertive' : 'polite'}
43
- class:info={toast.result == Validity.Info}
44
- class:success={toast.result == Validity.Valid}
45
- class:warning={toast.result == Validity.Warning}
46
- class:error={toast.result == Validity.Invalid}
47
- transition:slide={{ axis: 'x', duration: slideDuration }}
48
- >
49
- <div>
50
- <div class="noshrink">
51
- {#if toast.copyable != false && navigator.clipboard}
52
- <Action
53
- onclick={copy}
54
- icon={{ name: 'copy' }}
55
- label="Copy to clipboard"
56
- size={Size.MediumLarge}
57
- colourSet={ColourSet.Auxiliary}
58
- />
59
- {:else}
60
- <Icon
61
- name="info"
62
- size={Size.MediumLarge}
63
- />
64
- {/if}
65
- </div>
66
- <span>{toast.message}</span>
67
- {#if toast.closeable}
68
- <div class="noshrink">
69
- <Action
70
- size={Size.MediumLarge}
71
- icon={{ name: 'cross' }}
72
- label="Dismiss"
73
- onclick={() => {
74
- toast.close?.();
75
- }}
76
- colourSet={ColourSet.Auxiliary}
77
- />
78
- </div>
79
- {/if}
80
- </div>
81
- </output>
82
-
1
+ <svelte:options runes />
2
+
3
+ <!--
4
+ @component
5
+ Single toast rendering. Renders a horizontally-sliding pill near the
6
+ bottom-right of the viewport via `ToastContainer`. The severity of the
7
+ underlying toast drives both the colouring and the live-region
8
+ semantics:
9
+
10
+ - `Validity.Invalid` -> `role="alert"`, `aria-live="assertive"`.
11
+ - All other severities -> `role="status"`, `aria-live="polite"`.
12
+
13
+ The slide transition honours `prefers-reduced-motion` through the
14
+ shared `usePrefersReducedMotion` helper; when the user has opted in
15
+ the duration collapses to zero. The copy action is only shown when
16
+ `navigator.clipboard` is present (HTTPS or `localhost`).
17
+ -->
18
+ <script
19
+ lang="ts"
20
+ module
21
+ >
22
+ import { ColourSet } from '../../scss/colours.js';
23
+ import { Size } from '../../Types/Internal/Size.js';
24
+ import { Validity } from '../../Types/Internal/Validity.js';
25
+ import { slide } from 'svelte/transition';
26
+ import Action from '../Action.svelte';
27
+ import Icon from '../Icon.svelte';
28
+ import type { ToastProps } from './ToastProps.js';
29
+ </script>
30
+
31
+ <script lang="ts">
32
+ import { usePrefersReducedMotion } from '../../Helpers/prefersReducedMotion.svelte.js';
33
+
34
+ let { toast, copy }: ToastProps = $props();
35
+
36
+ const reducedMotion = usePrefersReducedMotion();
37
+ const slideDuration = $derived(reducedMotion.matches ? 0 : 500);
38
+ </script>
39
+
40
+ <output
41
+ role={toast.result == Validity.Invalid ? 'alert' : 'status'}
42
+ aria-live={toast.result == Validity.Invalid ? 'assertive' : 'polite'}
43
+ class:info={toast.result == Validity.Info}
44
+ class:success={toast.result == Validity.Valid}
45
+ class:warning={toast.result == Validity.Warning}
46
+ class:error={toast.result == Validity.Invalid}
47
+ transition:slide={{ axis: 'x', duration: slideDuration }}
48
+ >
49
+ <div>
50
+ <div class="noshrink">
51
+ {#if toast.copyable != false && navigator.clipboard}
52
+ <Action
53
+ onclick={copy}
54
+ icon={{ name: 'copy' }}
55
+ label="Copy to clipboard"
56
+ size={Size.MediumLarge}
57
+ colourSet={ColourSet.Auxiliary}
58
+ />
59
+ {:else}
60
+ <Icon
61
+ name="info"
62
+ size={Size.MediumLarge}
63
+ />
64
+ {/if}
65
+ </div>
66
+ <span>{toast.message}</span>
67
+ {#if toast.closeable}
68
+ <div class="noshrink">
69
+ <Action
70
+ size={Size.MediumLarge}
71
+ icon={{ name: 'cross' }}
72
+ label="Dismiss"
73
+ onclick={() => {
74
+ toast.close?.();
75
+ }}
76
+ colourSet={ColourSet.Auxiliary}
77
+ />
78
+ </div>
79
+ {/if}
80
+ </div>
81
+ </output>
82
+
83
83
  <style>output {
84
84
  font-weight: 700;
85
85
  font-size: 1.125rem;
@@ -113,4 +113,4 @@ output span {
113
113
  overflow-wrap: anywhere;
114
114
  min-width: 0;
115
115
  flex: 1 1 auto;
116
- }</style>
116
+ }</style>
@@ -1,67 +1,67 @@
1
- <svelte:options runes />
2
-
3
- <!--
4
- @component
5
- Live region for the {@link ToastContext}. Iterates the context's
6
- queue and renders one `Toast` per message, providing the
7
- copy-to-clipboard callback (the container owns the clipboard logic
8
- because the toast itself only knows the message it should copy).
9
-
10
- The wrapping `<section>` carries `role="region"` plus
11
- `aria-live="polite"` so multiple toast appearances are announced as
12
- a single rolling region without interrupting the user; individual
13
- `Toast` elements override `aria-live` to `assertive` for hard errors.
14
-
15
- Mounted once at the app root by `ContextWrapper`; consumers should
16
- not render this directly.
17
- -->
18
- <script lang="ts">
19
- import { ToastContext } from '../../Contexts/ToastContext.svelte.js';
20
- import { devCatch } from '../../Helpers/Helpers.svelte.js';
21
- import { Validity } from '../../Types/Internal/Validity.js';
22
- import { getContext } from 'svelte';
23
- import Toast from './Toast.svelte';
24
-
25
- const toastContext = getContext<ToastContext>(ToastContext.identifier);
26
-
27
- function copyDataToClipboard(text: string): void {
28
- // `navigator.clipboard` is `undefined` on insecure (HTTP)
29
- // origins and in some embedded WebViews. The compile-time
30
- // type says it is always defined, hence the eslint disable;
31
- // the runtime check is the load-bearing one.
32
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
33
- if (!navigator.clipboard) {
34
- toastContext.toast({
35
- result: Validity.Invalid,
36
- message: 'Cannot Copy in an Insecure Connection',
37
- copyable: false,
38
- });
39
- return;
40
- }
41
-
42
- navigator.clipboard.writeText(text).catch(devCatch);
43
- toastContext.toast({
44
- result: Validity.Info,
45
- message: 'Message copied to clipboard',
46
- copyable: false,
47
- });
48
- }
49
- </script>
50
-
51
- <section
52
- aria-live="polite"
53
- aria-label="Notifications"
54
- >
55
- {#each toastContext.toasts as toast (toast.id)}
56
- <Toast
57
- {toast}
58
- copy={() => {
59
- copyDataToClipboard(toast.getVerbose?.() ?? toast.message);
60
- }}
61
- />
62
- {/each}
63
- </section>
64
-
1
+ <svelte:options runes />
2
+
3
+ <!--
4
+ @component
5
+ Live region for the {@link ToastContext}. Iterates the context's
6
+ queue and renders one `Toast` per message, providing the
7
+ copy-to-clipboard callback (the container owns the clipboard logic
8
+ because the toast itself only knows the message it should copy).
9
+
10
+ The wrapping `<section>` carries `role="region"` plus
11
+ `aria-live="polite"` so multiple toast appearances are announced as
12
+ a single rolling region without interrupting the user; individual
13
+ `Toast` elements override `aria-live` to `assertive` for hard errors.
14
+
15
+ Mounted once at the app root by `ContextWrapper`; consumers should
16
+ not render this directly.
17
+ -->
18
+ <script lang="ts">
19
+ import { ToastContext } from '../../Contexts/ToastContext.svelte.js';
20
+ import { devCatch } from '../../Helpers/Helpers.svelte.js';
21
+ import { Validity } from '../../Types/Internal/Validity.js';
22
+ import { getContext } from 'svelte';
23
+ import Toast from './Toast.svelte';
24
+
25
+ const toastContext = getContext<ToastContext>(ToastContext.identifier);
26
+
27
+ function copyDataToClipboard(text: string): void {
28
+ // `navigator.clipboard` is `undefined` on insecure (HTTP)
29
+ // origins and in some embedded WebViews. The compile-time
30
+ // type says it is always defined, hence the eslint disable;
31
+ // the runtime check is the load-bearing one.
32
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
33
+ if (!navigator.clipboard) {
34
+ toastContext.toast({
35
+ result: Validity.Invalid,
36
+ message: 'Cannot Copy in an Insecure Connection',
37
+ copyable: false,
38
+ });
39
+ return;
40
+ }
41
+
42
+ navigator.clipboard.writeText(text).catch(devCatch);
43
+ toastContext.toast({
44
+ result: Validity.Info,
45
+ message: 'Message copied to clipboard',
46
+ copyable: false,
47
+ });
48
+ }
49
+ </script>
50
+
51
+ <section
52
+ aria-live="polite"
53
+ aria-label="Notifications"
54
+ >
55
+ {#each toastContext.toasts as toast (toast.id)}
56
+ <Toast
57
+ {toast}
58
+ copy={() => {
59
+ copyDataToClipboard(toast.getVerbose?.() ?? toast.message);
60
+ }}
61
+ />
62
+ {/each}
63
+ </section>
64
+
65
65
  <style>section {
66
66
  user-select: none;
67
67
  gap: 0.5rem;
@@ -73,4 +73,4 @@ not render this directly.
73
73
  justify-content: flex-end;
74
74
  align-items: flex-end;
75
75
  z-index: 99999;
76
- }</style>
76
+ }</style>
@@ -1,39 +1,39 @@
1
- <svelte:options runes />
2
-
3
- <!--
4
- @component
5
- Visual host for `TooltipContext`. Renders a fixed-position tooltip at
6
- the coordinates the context exposes, with a CSS arrow that points
7
- back toward the anchored element on the configured side.
8
-
9
- The tooltip just appears and disappears; no transition is applied,
10
- which is the conservative choice for `prefers-reduced-motion`. Reads
11
- the context with `getContext` and relies on `ContextWrapper` to have
12
- set it up at the app root.
13
- -->
14
- <script lang="ts">
15
- import { TooltipContext } from '../../Contexts/TooltipContext.svelte.js';
16
- import { Side } from '../../Types/Internal/Side.js';
17
- import { getContext } from 'svelte';
18
- const tooltipContext = getContext<TooltipContext>(TooltipContext.identifier);
19
- </script>
20
-
21
- {#if tooltipContext.isShowingTooltip}
22
- <div
23
- role="tooltip"
24
- style="--y: {tooltipContext.y}px; --x: {tooltipContext.x}px;"
25
- class="tooltip-wrapper"
26
- class:top-arrow={tooltipContext.anchor === Side.Top}
27
- class:bottom-arrow={tooltipContext.anchor === Side.Bottom}
28
- class:left-arrow={tooltipContext.anchor === Side.Left}
29
- class:right-arrow={tooltipContext.anchor === Side.Right}
30
- >
31
- <div class="tooltip">
32
- {tooltipContext.text}
33
- </div>
34
- </div>
35
- {/if}
36
-
1
+ <svelte:options runes />
2
+
3
+ <!--
4
+ @component
5
+ Visual host for `TooltipContext`. Renders a fixed-position tooltip at
6
+ the coordinates the context exposes, with a CSS arrow that points
7
+ back toward the anchored element on the configured side.
8
+
9
+ The tooltip just appears and disappears; no transition is applied,
10
+ which is the conservative choice for `prefers-reduced-motion`. Reads
11
+ the context with `getContext` and relies on `ContextWrapper` to have
12
+ set it up at the app root.
13
+ -->
14
+ <script lang="ts">
15
+ import { TooltipContext } from '../../Contexts/TooltipContext.svelte.js';
16
+ import { Side } from '../../Types/Internal/Side.js';
17
+ import { getContext } from 'svelte';
18
+ const tooltipContext = getContext<TooltipContext>(TooltipContext.identifier);
19
+ </script>
20
+
21
+ {#if tooltipContext.isShowingTooltip}
22
+ <div
23
+ role="tooltip"
24
+ style="--y: {tooltipContext.y}px; --x: {tooltipContext.x}px;"
25
+ class="tooltip-wrapper"
26
+ class:top-arrow={tooltipContext.anchor === Side.Top}
27
+ class:bottom-arrow={tooltipContext.anchor === Side.Bottom}
28
+ class:left-arrow={tooltipContext.anchor === Side.Left}
29
+ class:right-arrow={tooltipContext.anchor === Side.Right}
30
+ >
31
+ <div class="tooltip">
32
+ {tooltipContext.text}
33
+ </div>
34
+ </div>
35
+ {/if}
36
+
37
37
  <style>.tooltip-wrapper {
38
38
  position: fixed;
39
39
  z-index: 99999;
@@ -121,4 +121,4 @@ set it up at the app root.
121
121
  transform: rotate(45deg);
122
122
  background-color: #3a4952;
123
123
  border: solid 2px #dae0e5;
124
- }</style>
124
+ }</style>