@lavalogic/scoria 0.40.32 → 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 (135) 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/InfoAlert.svelte +32 -32
  38. package/dist/Components/LoadingAnimation.svelte +228 -227
  39. package/dist/Components/LoadingModal.svelte +19 -19
  40. package/dist/Components/LoadingOverlay.svelte +20 -20
  41. package/dist/Components/Modal.svelte +127 -127
  42. package/dist/Components/MultiSelect.svelte +126 -126
  43. package/dist/Components/Nav/Nav.svelte +71 -71
  44. package/dist/Components/Nav/NavServiceMenuList.svelte +37 -37
  45. package/dist/Components/Nav/NavTab.svelte +46 -46
  46. package/dist/Components/Nav/ServiceMenuItem.svelte +62 -62
  47. package/dist/Components/Nav/ServicesNav.svelte +50 -50
  48. package/dist/Components/NumberInput.svelte +98 -98
  49. package/dist/Components/OptionCards.svelte +58 -58
  50. package/dist/Components/PageHeading.svelte +21 -21
  51. package/dist/Components/PasswordInput.svelte +61 -61
  52. package/dist/Components/PopoverButton.svelte +53 -53
  53. package/dist/Components/Portal.svelte +7 -7
  54. package/dist/Components/ProgressBubble.svelte +42 -42
  55. package/dist/Components/QuerySelect.svelte +102 -102
  56. package/dist/Components/ResourceCalendar/ResourceCalendar.svelte +241 -241
  57. package/dist/Components/SidebarPanel.svelte +32 -32
  58. package/dist/Components/SingleSelect.svelte +122 -122
  59. package/dist/Components/StepButton.svelte +48 -48
  60. package/dist/Components/StepForm.svelte +58 -58
  61. package/dist/Components/Switch.svelte +43 -43
  62. package/dist/Components/Table/ARCHITECTURE.md +298 -298
  63. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +30 -30
  64. package/dist/Components/Table/Body/Rows/ColumnList.svelte +24 -24
  65. package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +165 -165
  66. package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +13 -13
  67. package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +120 -120
  68. package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +81 -81
  69. package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +92 -92
  70. package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +110 -110
  71. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +54 -54
  72. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +35 -35
  73. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +64 -64
  74. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +82 -82
  75. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +88 -88
  76. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +90 -90
  77. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +96 -96
  78. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +71 -71
  79. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +124 -124
  80. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +91 -91
  81. package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +88 -88
  82. package/dist/Components/Table/Body/Rows/TableRow.svelte +127 -127
  83. package/dist/Components/Table/Body/TableBody.svelte +92 -92
  84. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +25 -25
  85. package/dist/Components/Table/Headers/SelectAllHeader.svelte +20 -20
  86. package/dist/Components/Table/Headers/TableHead.svelte +175 -175
  87. package/dist/Components/Table/Misc/ColumnPanel.svelte +32 -32
  88. package/dist/Components/Table/Misc/ColumnPanelModal.svelte +29 -29
  89. package/dist/Components/Table/Misc/FilterInput.svelte +326 -326
  90. package/dist/Components/Table/Misc/FilterPanel.svelte +79 -79
  91. package/dist/Components/Table/Misc/FilterPanelModal.svelte +21 -21
  92. package/dist/Components/Table/Misc/ShareViewModal.svelte +118 -118
  93. package/dist/Components/Table/Misc/SidePanel.svelte +24 -24
  94. package/dist/Components/Table/Misc/TableConfigurationModal.svelte +318 -318
  95. package/dist/Components/Table/Misc/TableFooter.svelte +201 -201
  96. package/dist/Components/Table/Misc/TableHorizontalBar.svelte +112 -112
  97. package/dist/Components/Table/Misc/TableSidebar.svelte +116 -116
  98. package/dist/Components/Table/Misc/TableViewDropdown.svelte +25 -25
  99. package/dist/Components/Table/Misc/ToolboxPanel.svelte +60 -60
  100. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +63 -63
  101. package/dist/Components/Table/Misc/UpdateViewOptionsModal.svelte +101 -101
  102. package/dist/Components/Table/NestedTable.svelte +29 -29
  103. package/dist/Components/Table/Table.svelte +140 -140
  104. package/dist/Components/Test/TestContextConsumer.svelte +8 -8
  105. package/dist/Components/TextArea.svelte +92 -90
  106. package/dist/Components/TextInput.svelte +128 -117
  107. package/dist/Components/ThreeStateRadio.svelte +101 -101
  108. package/dist/Components/Touch/BoolCard.svelte +27 -27
  109. package/dist/Components/Touch/DateModal.svelte +98 -98
  110. package/dist/Components/Touch/EditCard.svelte +44 -44
  111. package/dist/Components/Touch/InfoCard.svelte +25 -25
  112. package/dist/Components/Touch/InfoTextCard.svelte +22 -22
  113. package/dist/Components/Touch/ModalExplanation.svelte +13 -13
  114. package/dist/Components/Touch/NumberKeyboard.svelte +81 -81
  115. package/dist/Components/Touch/NumberModal.svelte +49 -49
  116. package/dist/Components/Touch/PlusMinusCard.svelte +40 -40
  117. package/dist/Components/Touch/SelectModal.svelte +86 -86
  118. package/dist/Components/Touch/SummaryCard.svelte +74 -74
  119. package/dist/Components/Touch/TextAreaModal.svelte +53 -53
  120. package/dist/Components/Touch/TextModal.svelte +56 -56
  121. package/dist/Components/Touch/TouchCard.svelte +28 -28
  122. package/dist/Components/Touch/TouchModal.svelte +141 -141
  123. package/dist/Components/Touch/UtilityButton.svelte +63 -63
  124. package/dist/Components/VerticalTabGroup.svelte +38 -38
  125. package/dist/Components/VerticalTabGroupButton.svelte +46 -46
  126. package/dist/Helpers/Datamatrix.d.ts +19 -19
  127. package/dist/Helpers/Datamatrix.js +291 -291
  128. package/dist/Types/Examples/ExampleModal.svelte +27 -27
  129. package/dist/paraglide/README.md +1 -1
  130. package/dist/scss/_basics.scss +12 -12
  131. package/dist/scss/_colours.scss +140 -140
  132. package/dist/scss/_motion.scss +57 -57
  133. package/dist/scss/_sizing.scss +85 -85
  134. package/dist/scss/_transitions.scss +8 -8
  135. package/package.json +1 -1
package/README.md CHANGED
@@ -1,58 +1,58 @@
1
- # Svelte library
2
-
3
- Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).
4
-
5
- Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).
6
-
7
- ## Creating a project
8
-
9
- If you're seeing this, you've probably already done this step. Congrats!
10
-
11
- ```sh
12
- # create a new project in the current directory
13
- npx sv create
14
-
15
- # create a new project in my-app
16
- npx sv create my-app
17
- ```
18
-
19
- ## Developing
20
-
21
- Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
22
-
23
- ```sh
24
- npm run dev
25
-
26
- # or start the server and open the app in a new browser tab
27
- npm run dev -- --open
28
- ```
29
-
30
- Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
31
-
32
- ## Building
33
-
34
- To build your library:
35
-
36
- ```sh
37
- npm pack
38
- ```
39
-
40
- To create a production version of your showcase app:
41
-
42
- ```sh
43
- npm run build
44
- ```
45
-
46
- You can preview the production build with `npm run preview`.
47
-
48
- > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
49
-
50
- ## Publishing
51
-
52
- Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
53
-
54
- To publish your library to [npm](https://www.npmjs.com):
55
-
56
- ```sh
57
- npm publish
58
- ```
1
+ # Svelte library
2
+
3
+ Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).
4
+
5
+ Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).
6
+
7
+ ## Creating a project
8
+
9
+ If you're seeing this, you've probably already done this step. Congrats!
10
+
11
+ ```sh
12
+ # create a new project in the current directory
13
+ npx sv create
14
+
15
+ # create a new project in my-app
16
+ npx sv create my-app
17
+ ```
18
+
19
+ ## Developing
20
+
21
+ Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
22
+
23
+ ```sh
24
+ npm run dev
25
+
26
+ # or start the server and open the app in a new browser tab
27
+ npm run dev -- --open
28
+ ```
29
+
30
+ Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
31
+
32
+ ## Building
33
+
34
+ To build your library:
35
+
36
+ ```sh
37
+ npm pack
38
+ ```
39
+
40
+ To create a production version of your showcase app:
41
+
42
+ ```sh
43
+ npm run build
44
+ ```
45
+
46
+ You can preview the production build with `npm run preview`.
47
+
48
+ > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
49
+
50
+ ## Publishing
51
+
52
+ Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
53
+
54
+ To publish your library to [npm](https://www.npmjs.com):
55
+
56
+ ```sh
57
+ npm publish
58
+ ```
@@ -1,8 +1,8 @@
1
- <svelte:options runes />
2
-
3
- <script
4
- lang="ts"
5
- generics="CommonDenominator"
1
+ <svelte:options runes />
2
+
3
+ <script
4
+ lang="ts"
5
+ generics="CommonDenominator"
6
6
  >import AccordionGroupButton from "./AccordionGroupButton.svelte";
7
7
  import { cubicOut } from "svelte/easing";
8
8
  import { slide } from "svelte/transition";
@@ -10,28 +10,28 @@ import { usePrefersReducedMotion } from "../Helpers/prefersReducedMotion.svelte.
10
10
  let { tabs, selected, noRadius = false, grow = false } = $props();
11
11
  const reducedMotion = usePrefersReducedMotion();
12
12
  const slideDuration = $derived(reducedMotion.matches ? 0 : 200);
13
- </script>
14
-
15
- <div
16
- class="wrapper"
17
- class:no-radius={noRadius}
18
- class:grow
19
- >
20
- {#each tabs as option (option.label)}
21
- {@const isSelected = selected === option}
22
- <AccordionGroupButton
23
- {option}
24
- {noRadius}
25
- selected={isSelected}
26
- />
27
- {#if isSelected}
28
- <div transition:slide={{ duration: slideDuration, easing: cubicOut }}>
29
- {@render selected.content(selected.args)}
30
- </div>
31
- {/if}
32
- {/each}
33
- </div>
34
-
13
+ </script>
14
+
15
+ <div
16
+ class="wrapper"
17
+ class:no-radius={noRadius}
18
+ class:grow
19
+ >
20
+ {#each tabs as option (option.label)}
21
+ {@const isSelected = selected === option}
22
+ <AccordionGroupButton
23
+ {option}
24
+ {noRadius}
25
+ selected={isSelected}
26
+ />
27
+ {#if isSelected}
28
+ <div transition:slide={{ duration: slideDuration, easing: cubicOut }}>
29
+ {@render selected.content(selected.args)}
30
+ </div>
31
+ {/if}
32
+ {/each}
33
+ </div>
34
+
35
35
  <style>.wrapper {
36
36
  box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.1333333333);
37
37
  border-radius: 4px;
@@ -75,4 +75,4 @@ const slideDuration = $derived(reducedMotion.matches ? 0 : 200);
75
75
  flex-grow: 1;
76
76
  overflow: visible;
77
77
  border-radius: 0 4px 0 4px;
78
- }</style>
78
+ }</style>
@@ -1,8 +1,8 @@
1
- <svelte:options runes />
2
-
3
- <script
4
- lang="ts"
5
- generics="Args"
1
+ <svelte:options runes />
2
+
3
+ <script
4
+ lang="ts"
5
+ generics="Args"
6
6
  >import { useAsyncFlag } from "../Helpers/AsyncFlag.svelte.js";
7
7
  import { Colour } from "../scss/colours.js";
8
8
  import { Size } from "../Types/Internal/Size.js";
@@ -11,60 +11,60 @@ const { option, selected: isSelected, noRadius = false } = $props();
11
11
  const isValid = useAsyncFlag(() => option.isValid, true);
12
12
  const disabled = useAsyncFlag(() => option.disabled, false);
13
13
  const isVisible = useAsyncFlag(() => option.visible, true);
14
- </script>
15
-
16
- <!--
17
- Single-button row: the whole header is one interactive element, with the
18
- expand chevron rendered as decorative content of that same button. This
19
- resolves the previous a11y issue (a nested toggle inside the row read as
20
- two interactive elements). The `extras` snippet is intentionally placed
21
- OUTSIDE the button so that consumers passing interactive content into
22
- `extras` don't create nested-button markup.
23
- -->
24
- <div
25
- class="tab-wrapper"
26
- class:isSelected
27
- class:invalid={!isValid.value}
28
- class:hidden={!isVisible.value}
29
- class:no-radius={noRadius}
30
- >
31
- <button
32
- type="button"
33
- class="tab"
34
- disabled={disabled.value}
35
- aria-expanded={isSelected}
36
- aria-label={isSelected ? 'Collapse section' : 'Expand section'}
37
- onclick={() => {
38
- option.onclick();
39
- }}
40
- >
41
- {#if typeof option.label == 'string'}
42
- <span class="label">{option.label}</span>
43
- {:else}
44
- {@render option.label()}
45
- {/if}
46
- <div class="spacer"></div>
47
-
48
- {#if !isValid.value}
49
- <Icon
50
- name="error"
51
- colour={Colour['$error-border']}
52
- size={Size.Small}
53
- />
54
- {/if}
55
- <Icon
56
- name={isSelected ? 'circle-minus' : 'circle-plus'}
57
- colour={Colour['$primary-blue-13']}
58
- size={Size.Medium}
59
- />
60
- </button>
61
- {#if option.extras}
62
- <div class="extras">
63
- {@render option.extras()}
64
- </div>
65
- {/if}
66
- </div>
67
-
14
+ </script>
15
+
16
+ <!--
17
+ Single-button row: the whole header is one interactive element, with the
18
+ expand chevron rendered as decorative content of that same button. This
19
+ resolves the previous a11y issue (a nested toggle inside the row read as
20
+ two interactive elements). The `extras` snippet is intentionally placed
21
+ OUTSIDE the button so that consumers passing interactive content into
22
+ `extras` don't create nested-button markup.
23
+ -->
24
+ <div
25
+ class="tab-wrapper"
26
+ class:isSelected
27
+ class:invalid={!isValid.value}
28
+ class:hidden={!isVisible.value}
29
+ class:no-radius={noRadius}
30
+ >
31
+ <button
32
+ type="button"
33
+ class="tab"
34
+ disabled={disabled.value}
35
+ aria-expanded={isSelected}
36
+ aria-label={isSelected ? 'Collapse section' : 'Expand section'}
37
+ onclick={() => {
38
+ option.onclick();
39
+ }}
40
+ >
41
+ {#if typeof option.label == 'string'}
42
+ <span class="label">{option.label}</span>
43
+ {:else}
44
+ {@render option.label()}
45
+ {/if}
46
+ <div class="spacer"></div>
47
+
48
+ {#if !isValid.value}
49
+ <Icon
50
+ name="error"
51
+ colour={Colour['$error-border']}
52
+ size={Size.Small}
53
+ />
54
+ {/if}
55
+ <Icon
56
+ name={isSelected ? 'circle-minus' : 'circle-plus'}
57
+ colour={Colour['$primary-blue-13']}
58
+ size={Size.Medium}
59
+ />
60
+ </button>
61
+ {#if option.extras}
62
+ <div class="extras">
63
+ {@render option.extras()}
64
+ </div>
65
+ {/if}
66
+ </div>
67
+
68
68
  <style>.tab-wrapper {
69
69
  position: relative;
70
70
  background-color: #f4f7f9;
@@ -111,4 +111,4 @@ const isVisible = useAsyncFlag(() => option.visible, true);
111
111
  align-items: center;
112
112
  gap: 1.5rem;
113
113
  pointer-events: auto;
114
- }</style>
114
+ }</style>
@@ -1,8 +1,8 @@
1
- <svelte:options runes />
2
-
3
- <script
4
- module
5
- lang="ts"
1
+ <svelte:options runes />
2
+
3
+ <script
4
+ module
5
+ lang="ts"
6
6
  >import { passthrough } from "../Helpers/Helpers.svelte.js";
7
7
  import { useTooltip } from "../Helpers/useTooltip.svelte.js";
8
8
  import { Shape } from "../Types/Internal/Shape.js";
@@ -38,8 +38,8 @@ const paddings = {
38
38
  [Size.FillHeight]: -1
39
39
  }
40
40
  };
41
- </script>
42
-
41
+ </script>
42
+
43
43
  <script lang="ts">const { icon, id, border = false, shape = Shape.Rectangle, label, colourSet = ColourSet.Secondary, size = Size.Medium, paddingSize, type = "button", noTabIndex = false, disabled, backgroundColour, hoverBackgroundColour, "data-type": dataType, onfocus, onblur, onclick, onkeydown: onkeydownProp, style = "", side, "aria-expanded": ariaExpanded, "aria-controls": ariaControls } = $props();
44
44
  const iconSize = $derived(icon.size ?? size);
45
45
  const pad = $derived.by(() => {
@@ -61,46 +61,46 @@ const tt = useTooltip({
61
61
  text: () => label,
62
62
  arrow: () => side ?? Side.Left
63
63
  });
64
- </script>
65
-
66
- <button
67
- {id}
68
- onmouseenter={tt.onmouseenter}
69
- onmouseleave={tt.onmouseleave}
70
- tabindex={noTabIndex ? -1 : undefined}
71
- data-type={dataType}
72
- style="{pad ? `--pad: ${pad};` : ''} {backgroundColour
73
- ? `--background-colour: ${backgroundColour};`
74
- : ``} {hoverBackgroundColour
75
- ? `--hover-background-colour: ${hoverBackgroundColour};`
76
- : ``}{style}"
77
- class:border
78
- class:circular={shape === Shape.Circle}
79
- class:primary={colourSet === ColourSet.Primary}
80
- class:secondary={colourSet === ColourSet.Secondary}
81
- class:auxiliary={colourSet === ColourSet.Auxiliary}
82
- class:info={colourSet === ColourSet.Info}
83
- class:error={colourSet === ColourSet.Error}
84
- class:fill-width={size === Size.FillWidth}
85
- class:fill-height={size === Size.FillHeight}
86
- {type}
87
- {disabled}
88
- {onfocus}
89
- {onblur}
90
- {onkeydown}
91
- onclick={(e) => {
92
- tt.onclick();
93
- onclick?.(e);
94
- }}
95
- aria-label={label}
96
- aria-expanded={ariaExpanded}
97
- aria-controls={ariaControls}
98
- ><Icon
99
- {...icon}
100
- size={iconSize}
101
- /></button
102
- >
103
-
64
+ </script>
65
+
66
+ <button
67
+ {id}
68
+ onmouseenter={tt.onmouseenter}
69
+ onmouseleave={tt.onmouseleave}
70
+ tabindex={noTabIndex ? -1 : undefined}
71
+ data-type={dataType}
72
+ style="{pad ? `--pad: ${pad};` : ''} {backgroundColour
73
+ ? `--background-colour: ${backgroundColour};`
74
+ : ``} {hoverBackgroundColour
75
+ ? `--hover-background-colour: ${hoverBackgroundColour};`
76
+ : ``}{style}"
77
+ class:border
78
+ class:circular={shape === Shape.Circle}
79
+ class:primary={colourSet === ColourSet.Primary}
80
+ class:secondary={colourSet === ColourSet.Secondary}
81
+ class:auxiliary={colourSet === ColourSet.Auxiliary}
82
+ class:info={colourSet === ColourSet.Info}
83
+ class:error={colourSet === ColourSet.Error}
84
+ class:fill-width={size === Size.FillWidth}
85
+ class:fill-height={size === Size.FillHeight}
86
+ {type}
87
+ {disabled}
88
+ {onfocus}
89
+ {onblur}
90
+ {onkeydown}
91
+ onclick={(e) => {
92
+ tt.onclick();
93
+ onclick?.(e);
94
+ }}
95
+ aria-label={label}
96
+ aria-expanded={ariaExpanded}
97
+ aria-controls={ariaControls}
98
+ ><Icon
99
+ {...icon}
100
+ size={iconSize}
101
+ /></button
102
+ >
103
+
104
104
  <style>button {
105
105
  color: #3a4952;
106
106
  fill: #3a4952;
@@ -196,4 +196,4 @@ button.circular {
196
196
  button {
197
197
  padding: var(--pad);
198
198
  cursor: pointer;
199
- }</style>
199
+ }</style>
@@ -1,8 +1,8 @@
1
- <svelte:options runes />
2
-
3
- <script
4
- lang="ts"
5
- module
1
+ <svelte:options runes />
2
+
3
+ <script
4
+ lang="ts"
5
+ module
6
6
  >import { m as i18n } from "../paraglide/messages.js";
7
7
  import { browser } from "$app/environment";
8
8
  import { DATAMatrix } from "../Helpers/Datamatrix.js";
@@ -24,8 +24,8 @@ const AlertShortcuts = Object.freeze({
24
24
  const yesIcon = browser ? DATAMatrix(AlertShortcuts.yes) : undefined;
25
25
  const noIcon = browser ? DATAMatrix(AlertShortcuts.no) : undefined;
26
26
  const otherIcon = browser ? DATAMatrix(AlertShortcuts.other) : undefined;
27
- </script>
28
-
27
+ </script>
28
+
29
29
  <script lang="ts">import { AlertContext } from "../Contexts/AlertContext.svelte.js";
30
30
  import { ToastContext } from "../Contexts/ToastContext.svelte.js";
31
31
  import { UntypedInputContext } from "../Contexts/UntypedInputContext.svelte.js";
@@ -80,100 +80,100 @@ onMount(() => {
80
80
  }
81
81
  });
82
82
  });
83
- </script>
84
-
85
- <dialog
86
- bind:this={dialog}
87
- aria-modal="true"
88
- aria-labelledby="alert-modal-heading"
89
- aria-describedby="alert-modal-body"
90
- onclose={() => {
91
- // Only auto-fire `onNo` if a "No" action was actually configured.
92
- // Closing an alert (with no `noLabel`) should resolve cleanly without
93
- // pretending the user rejected it.
94
- if (alertContext.noLabel != null) {
95
- alertContext.onNo();
96
- } else {
97
- alertContext.onYes();
98
- }
99
- }}
100
- onclick={(e) => {
101
- if (e.target === dialog) {
102
- if (!alertContext.mandatory) {
103
- dialog.close();
104
- }
105
- }
106
- }}
107
- >
108
- <div class="modal-root">
109
- <h3
110
- id="alert-modal-heading"
111
- class="modal-heading"
112
- >
113
- {alertContext.header}
114
- </h3>
115
-
116
- <div
117
- id="alert-modal-body"
118
- class="modal-main pre-line"
119
- >
120
- <ModalExplanation>{alertContext.body}</ModalExplanation>
121
- </div>
122
-
123
- {#if alertContext.footer}
124
- <span>{alertContext.footer}</span>
125
- {/if}
126
-
127
- <div class="modal-footer actions">
128
- <div class="button-barcode-set">
129
- {#if yesIcon}
130
- <DataMatrixIcon
131
- title={alertContext.yesLabel}
132
- icon={{ kind: 'svg', svg: yesIcon }}
133
- />
134
- {/if}
135
- <button
136
- type="submit"
137
- onkeydown={passthrough}
138
- onclick={alertContext.onYes}>{alertContext.yesLabel}</button
139
- >
140
- </div>
141
-
142
- {#if alertContext.otherLabel}
143
- <div class="button-barcode-set">
144
- {#if otherIcon}
145
- <DataMatrixIcon
146
- title={alertContext.otherLabel}
147
- icon={{ kind: 'svg', svg: otherIcon }}
148
- />
149
- {/if}
150
- <button
151
- type="button"
152
- onkeydown={passthrough}
153
- onclick={alertContext.onOther}>{alertContext.otherLabel}</button
154
- >
155
- </div>
156
- {/if}
157
-
158
- {#if alertContext.noLabel}
159
- <div class="button-barcode-set">
160
- {#if noIcon}
161
- <DataMatrixIcon
162
- title={alertContext.noLabel}
163
- icon={{ kind: 'svg', svg: noIcon }}
164
- />
165
- {/if}
166
- <button
167
- type="button"
168
- onkeydown={passthrough}
169
- onclick={alertContext.onNo}>{alertContext.noLabel}</button
170
- >
171
- </div>
172
- {/if}
173
- </div>
174
- </div>
175
- </dialog>
176
-
83
+ </script>
84
+
85
+ <dialog
86
+ bind:this={dialog}
87
+ aria-modal="true"
88
+ aria-labelledby="alert-modal-heading"
89
+ aria-describedby="alert-modal-body"
90
+ onclose={() => {
91
+ // Only auto-fire `onNo` if a "No" action was actually configured.
92
+ // Closing an alert (with no `noLabel`) should resolve cleanly without
93
+ // pretending the user rejected it.
94
+ if (alertContext.noLabel != null) {
95
+ alertContext.onNo();
96
+ } else {
97
+ alertContext.onYes();
98
+ }
99
+ }}
100
+ onclick={(e) => {
101
+ if (e.target === dialog) {
102
+ if (!alertContext.mandatory) {
103
+ dialog.close();
104
+ }
105
+ }
106
+ }}
107
+ >
108
+ <div class="modal-root">
109
+ <h3
110
+ id="alert-modal-heading"
111
+ class="modal-heading"
112
+ >
113
+ {alertContext.header}
114
+ </h3>
115
+
116
+ <div
117
+ id="alert-modal-body"
118
+ class="modal-main pre-line"
119
+ >
120
+ <ModalExplanation>{alertContext.body}</ModalExplanation>
121
+ </div>
122
+
123
+ {#if alertContext.footer}
124
+ <span>{alertContext.footer}</span>
125
+ {/if}
126
+
127
+ <div class="modal-footer actions">
128
+ <div class="button-barcode-set">
129
+ {#if yesIcon}
130
+ <DataMatrixIcon
131
+ title={alertContext.yesLabel}
132
+ icon={{ kind: 'svg', svg: yesIcon }}
133
+ />
134
+ {/if}
135
+ <button
136
+ type="submit"
137
+ onkeydown={passthrough}
138
+ onclick={alertContext.onYes}>{alertContext.yesLabel}</button
139
+ >
140
+ </div>
141
+
142
+ {#if alertContext.otherLabel}
143
+ <div class="button-barcode-set">
144
+ {#if otherIcon}
145
+ <DataMatrixIcon
146
+ title={alertContext.otherLabel}
147
+ icon={{ kind: 'svg', svg: otherIcon }}
148
+ />
149
+ {/if}
150
+ <button
151
+ type="button"
152
+ onkeydown={passthrough}
153
+ onclick={alertContext.onOther}>{alertContext.otherLabel}</button
154
+ >
155
+ </div>
156
+ {/if}
157
+
158
+ {#if alertContext.noLabel}
159
+ <div class="button-barcode-set">
160
+ {#if noIcon}
161
+ <DataMatrixIcon
162
+ title={alertContext.noLabel}
163
+ icon={{ kind: 'svg', svg: noIcon }}
164
+ />
165
+ {/if}
166
+ <button
167
+ type="button"
168
+ onkeydown={passthrough}
169
+ onclick={alertContext.onNo}>{alertContext.noLabel}</button
170
+ >
171
+ </div>
172
+ {/if}
173
+ </div>
174
+ </div>
175
+ </dialog>
176
+
177
177
  <style>dialog {
178
178
  overflow: clip;
179
179
  background-color: #e9ecf1;
@@ -450,4 +450,4 @@ div.button-barcode-set {
450
450
  display: flex;
451
451
  flex-flow: row nowrap;
452
452
  gap: 1.5rem;
453
- }</style>
453
+ }</style>