@lavalogic/scoria 0.38.12 → 0.38.14

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 (104) hide show
  1. package/dist/Components/AccordionGroup.svelte +46 -46
  2. package/dist/Components/AccordionGroupButton.svelte +76 -76
  3. package/dist/Components/Action.svelte +136 -136
  4. package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +702 -702
  5. package/dist/Components/Base/BaseModal.svelte +125 -125
  6. package/dist/Components/Base/ContextWrapper.svelte +72 -72
  7. package/dist/Components/Base/Pagination.svelte +198 -198
  8. package/dist/Components/Base/Snippets.svelte +36 -36
  9. package/dist/Components/BigRadioSet.svelte +38 -38
  10. package/dist/Components/Bubble.svelte +101 -101
  11. package/dist/Components/Button.svelte +209 -209
  12. package/dist/Components/Checkbox.svelte +86 -86
  13. package/dist/Components/Contexts/ContextMenu.svelte +164 -164
  14. package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
  15. package/dist/Components/Contexts/ContextMenuOption.svelte +60 -60
  16. package/dist/Components/Contexts/ToastContainer.svelte +65 -65
  17. package/dist/Components/Contexts/Tooltip.svelte +37 -37
  18. package/dist/Components/DataMatrixIcon.svelte +112 -112
  19. package/dist/Components/DateInput.svelte +148 -148
  20. package/dist/Components/DatePicker.svelte +300 -300
  21. package/dist/Components/DesktopModal.svelte +90 -90
  22. package/dist/Components/Dial.svelte +204 -204
  23. package/dist/Components/DimensionInput.svelte +170 -170
  24. package/dist/Components/DragMenu/DragMenuHolder.svelte +119 -119
  25. package/dist/Components/DragMenu/DraggableCard.svelte +77 -77
  26. package/dist/Components/FileCard.svelte +24 -24
  27. package/dist/Components/FileUpload.svelte +236 -236
  28. package/dist/Components/GridInputSet.svelte +29 -29
  29. package/dist/Components/HorizontalTabGroup.svelte +82 -82
  30. package/dist/Components/HorizontalTabGroupButton.svelte +44 -44
  31. package/dist/Components/Icon.svelte +128 -128
  32. package/dist/Components/Icons.js +357 -357
  33. package/dist/Components/LoadingAnimation.svelte +29 -29
  34. package/dist/Components/LoadingModal.svelte +45 -45
  35. package/dist/Components/LoadingOverlay.svelte +25 -25
  36. package/dist/Components/Modal.svelte +258 -258
  37. package/dist/Components/MultiSelect.svelte +220 -220
  38. package/dist/Components/Nav/NavServiceMenuList.svelte +43 -43
  39. package/dist/Components/Nav/NavTab.svelte +62 -62
  40. package/dist/Components/Nav/ServicesNav.svelte +80 -80
  41. package/dist/Components/NumberInput.svelte +157 -157
  42. package/dist/Components/PageHeading.svelte +25 -25
  43. package/dist/Components/PasswordInput.svelte +88 -88
  44. package/dist/Components/Portal.svelte +36 -36
  45. package/dist/Components/QuerySelect.svelte +366 -366
  46. package/dist/Components/SingleSelect.svelte +250 -250
  47. package/dist/Components/StepButton.svelte +70 -70
  48. package/dist/Components/StepForm.svelte +140 -140
  49. package/dist/Components/Switch.svelte +69 -69
  50. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +51 -51
  51. package/dist/Components/Table/Body/Rows/ColumnList.svelte +59 -59
  52. package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +79 -79
  53. package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +120 -120
  54. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +105 -105
  55. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +87 -87
  56. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +126 -126
  57. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +159 -159
  58. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +246 -246
  59. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +216 -216
  60. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +179 -179
  61. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +197 -197
  62. package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +190 -190
  63. package/dist/Components/Table/Body/Rows/TableRow.svelte +290 -290
  64. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +41 -41
  65. package/dist/Components/Table/Headers/SelectAllHeader.svelte +30 -30
  66. package/dist/Components/Table/Misc/SidePanel.svelte +35 -35
  67. package/dist/Components/Table/Misc/ToolboxPanel.svelte +100 -100
  68. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +107 -107
  69. package/dist/Components/Table/Types/Columns/JSONTableLayout.d.ts +7 -0
  70. package/dist/Components/Table/Types/Columns/JSONTableLayout.js +6 -0
  71. package/dist/Components/Table/Types/Context/SelectionState.svelte.js +38 -29
  72. package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +5 -22
  73. package/dist/Components/Table/Types/Context/TableContext.svelte.js +52 -59
  74. package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.d.ts +7 -0
  75. package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.js +29 -11
  76. package/dist/Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.d.ts +6 -0
  77. package/dist/Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.js +23 -0
  78. package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.js +16 -0
  79. package/dist/Components/TextArea.svelte +130 -130
  80. package/dist/Components/TextInput.svelte +176 -176
  81. package/dist/Components/ThreeStateRadio.svelte +131 -131
  82. package/dist/Components/Touch/BoolCard.svelte +45 -45
  83. package/dist/Components/Touch/DateModal.svelte +209 -209
  84. package/dist/Components/Touch/EditCard.svelte +59 -59
  85. package/dist/Components/Touch/InfoCard.svelte +31 -31
  86. package/dist/Components/Touch/InfoTextCard.svelte +28 -28
  87. package/dist/Components/Touch/ModalExplanation.svelte +17 -17
  88. package/dist/Components/Touch/NumberKeyboard.svelte +225 -225
  89. package/dist/Components/Touch/NumberModal.svelte +79 -79
  90. package/dist/Components/Touch/PlusMinusCard.svelte +46 -46
  91. package/dist/Components/Touch/SummaryCard.svelte +93 -93
  92. package/dist/Components/Touch/TextAreaModal.svelte +95 -95
  93. package/dist/Components/Touch/TextModal.svelte +106 -106
  94. package/dist/Components/Touch/TouchCard.svelte +33 -33
  95. package/dist/Components/Touch/TouchModal.svelte +274 -274
  96. package/dist/Components/Touch/UtilityButton.svelte +109 -109
  97. package/dist/Components/VerticalTabGroup.svelte +79 -79
  98. package/dist/Components/VerticalTabGroupButton.svelte +58 -58
  99. package/dist/Helpers/Datamatrix.d.ts +19 -19
  100. package/dist/Helpers/Datamatrix.js +291 -291
  101. package/dist/Types/Examples/ExampleModal.svelte +35 -35
  102. package/dist/scss/_motion.scss +57 -57
  103. package/dist/scss/_sizing.scss +85 -85
  104. package/package.json +30 -30
@@ -1,48 +1,48 @@
1
- <svelte:options runes />
2
-
3
- <script
4
- lang="ts"
5
- generics="CommonDenominator"
6
- >
7
- import AccordionGroupButton from './AccordionGroupButton.svelte';
8
-
9
- import { cubicOut } from 'svelte/easing';
10
- import { slide } from 'svelte/transition';
11
- import { usePrefersReducedMotion } from '../Helpers/prefersReducedMotion.svelte.js';
12
- import type { AccordionGroupProps } from './AccordionGroupProps.js';
13
-
14
- let {
15
- // name: _name, //FIXME why is this not implemented?
16
- tabs,
17
- selected,
18
- noRadius = false,
19
- grow = false,
20
- }: AccordionGroupProps<CommonDenominator> = $props();
21
-
22
- const reducedMotion = usePrefersReducedMotion();
23
- const slideDuration = $derived(reducedMotion.matches ? 0 : 200);
24
- </script>
25
-
26
- <div
27
- class="wrapper"
28
- class:no-radius={noRadius}
29
- class:grow
30
- >
31
- {#each tabs as option (option.label)}
32
- {@const isSelected = selected === option}
33
- <AccordionGroupButton
34
- {option}
35
- {noRadius}
36
- selected={isSelected}
37
- />
38
- {#if isSelected}
39
- <div transition:slide={{ duration: slideDuration, easing: cubicOut }}>
40
- {@render selected.content(selected.args)}
41
- </div>
42
- {/if}
43
- {/each}
44
- </div>
45
-
1
+ <svelte:options runes />
2
+
3
+ <script
4
+ lang="ts"
5
+ generics="CommonDenominator"
6
+ >
7
+ import AccordionGroupButton from './AccordionGroupButton.svelte';
8
+
9
+ import { cubicOut } from 'svelte/easing';
10
+ import { slide } from 'svelte/transition';
11
+ import { usePrefersReducedMotion } from '../Helpers/prefersReducedMotion.svelte.js';
12
+ import type { AccordionGroupProps } from './AccordionGroupProps.js';
13
+
14
+ let {
15
+ // name: _name, //FIXME why is this not implemented?
16
+ tabs,
17
+ selected,
18
+ noRadius = false,
19
+ grow = false,
20
+ }: AccordionGroupProps<CommonDenominator> = $props();
21
+
22
+ const reducedMotion = usePrefersReducedMotion();
23
+ const slideDuration = $derived(reducedMotion.matches ? 0 : 200);
24
+ </script>
25
+
26
+ <div
27
+ class="wrapper"
28
+ class:no-radius={noRadius}
29
+ class:grow
30
+ >
31
+ {#each tabs as option (option.label)}
32
+ {@const isSelected = selected === option}
33
+ <AccordionGroupButton
34
+ {option}
35
+ {noRadius}
36
+ selected={isSelected}
37
+ />
38
+ {#if isSelected}
39
+ <div transition:slide={{ duration: slideDuration, easing: cubicOut }}>
40
+ {@render selected.content(selected.args)}
41
+ </div>
42
+ {/if}
43
+ {/each}
44
+ </div>
45
+
46
46
  <style>.wrapper {
47
47
  box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.1333333333);
48
48
  border-radius: 4px;
@@ -86,4 +86,4 @@
86
86
  flex-grow: 1;
87
87
  overflow: visible;
88
88
  border-radius: 0 4px 0 4px;
89
- }</style>
89
+ }</style>
@@ -1,78 +1,78 @@
1
- <svelte:options runes />
2
-
3
- <script
4
- lang="ts"
5
- generics="Args"
6
- >
7
- import { useAsyncFlag } from '../Helpers/AsyncFlag.svelte.js';
8
- import { Colour } from '../scss/colours.js';
9
- import { Size } from '../Types/Internal/Size.js';
10
- import type { AccordionGroupButtonProps } from './AccordionGroupButtonProps.js';
11
- import Icon from './Icon.svelte';
12
-
13
- const {
14
- option,
15
- selected: isSelected,
16
- noRadius = false,
17
- }: AccordionGroupButtonProps<Args> = $props();
18
-
19
- const isValid = useAsyncFlag(() => option.isValid, true);
20
- const disabled = useAsyncFlag(() => option.disabled, false);
21
- const isVisible = useAsyncFlag(() => option.visible, true);
22
- </script>
23
-
24
- <!--
25
- Single-button row: the whole header is one interactive element, with the
26
- expand chevron rendered as decorative content of that same button. This
27
- resolves the previous a11y issue (a nested toggle inside the row read as
28
- two interactive elements). The `extras` snippet is intentionally placed
29
- OUTSIDE the button so that consumers passing interactive content into
30
- `extras` don't create nested-button markup.
31
- -->
32
- <div
33
- class="tab-wrapper"
34
- class:isSelected
35
- class:invalid={!isValid.value}
36
- class:hidden={!isVisible.value}
37
- class:no-radius={noRadius}
38
- >
39
- <button
40
- type="button"
41
- class="tab"
42
- disabled={disabled.value}
43
- aria-expanded={isSelected}
44
- aria-label={isSelected ? 'Collapse section' : 'Expand section'}
45
- onclick={() => {
46
- option.onclick();
47
- }}
48
- >
49
- {#if typeof option.label == 'string'}
50
- <span class="label">{option.label}</span>
51
- {:else}
52
- {@render option.label()}
53
- {/if}
54
- <div class="spacer"></div>
55
-
56
- {#if !isValid.value}
57
- <Icon
58
- name="error"
59
- colour={Colour['$error-border']}
60
- size={Size.Small}
61
- />
62
- {/if}
63
- <Icon
64
- name={isSelected ? 'circle-minus' : 'circle-plus'}
65
- colour={Colour['$primary-blue-13']}
66
- size={Size.Medium}
67
- />
68
- </button>
69
- {#if option.extras}
70
- <div class="extras">
71
- {@render option.extras()}
72
- </div>
73
- {/if}
74
- </div>
75
-
1
+ <svelte:options runes />
2
+
3
+ <script
4
+ lang="ts"
5
+ generics="Args"
6
+ >
7
+ import { useAsyncFlag } from '../Helpers/AsyncFlag.svelte.js';
8
+ import { Colour } from '../scss/colours.js';
9
+ import { Size } from '../Types/Internal/Size.js';
10
+ import type { AccordionGroupButtonProps } from './AccordionGroupButtonProps.js';
11
+ import Icon from './Icon.svelte';
12
+
13
+ const {
14
+ option,
15
+ selected: isSelected,
16
+ noRadius = false,
17
+ }: AccordionGroupButtonProps<Args> = $props();
18
+
19
+ const isValid = useAsyncFlag(() => option.isValid, true);
20
+ const disabled = useAsyncFlag(() => option.disabled, false);
21
+ const isVisible = useAsyncFlag(() => option.visible, true);
22
+ </script>
23
+
24
+ <!--
25
+ Single-button row: the whole header is one interactive element, with the
26
+ expand chevron rendered as decorative content of that same button. This
27
+ resolves the previous a11y issue (a nested toggle inside the row read as
28
+ two interactive elements). The `extras` snippet is intentionally placed
29
+ OUTSIDE the button so that consumers passing interactive content into
30
+ `extras` don't create nested-button markup.
31
+ -->
32
+ <div
33
+ class="tab-wrapper"
34
+ class:isSelected
35
+ class:invalid={!isValid.value}
36
+ class:hidden={!isVisible.value}
37
+ class:no-radius={noRadius}
38
+ >
39
+ <button
40
+ type="button"
41
+ class="tab"
42
+ disabled={disabled.value}
43
+ aria-expanded={isSelected}
44
+ aria-label={isSelected ? 'Collapse section' : 'Expand section'}
45
+ onclick={() => {
46
+ option.onclick();
47
+ }}
48
+ >
49
+ {#if typeof option.label == 'string'}
50
+ <span class="label">{option.label}</span>
51
+ {:else}
52
+ {@render option.label()}
53
+ {/if}
54
+ <div class="spacer"></div>
55
+
56
+ {#if !isValid.value}
57
+ <Icon
58
+ name="error"
59
+ colour={Colour['$error-border']}
60
+ size={Size.Small}
61
+ />
62
+ {/if}
63
+ <Icon
64
+ name={isSelected ? 'circle-minus' : 'circle-plus'}
65
+ colour={Colour['$primary-blue-13']}
66
+ size={Size.Medium}
67
+ />
68
+ </button>
69
+ {#if option.extras}
70
+ <div class="extras">
71
+ {@render option.extras()}
72
+ </div>
73
+ {/if}
74
+ </div>
75
+
76
76
  <style>.tab-wrapper {
77
77
  position: relative;
78
78
  background-color: #f4f7f9;
@@ -119,4 +119,4 @@
119
119
  align-items: center;
120
120
  gap: 1.5rem;
121
121
  pointer-events: auto;
122
- }</style>
122
+ }</style>
@@ -1,138 +1,138 @@
1
- <svelte:options runes />
2
-
3
- <script
4
- module
5
- lang="ts"
6
- >
7
- import { passthrough } from '../Helpers/Helpers.svelte.js';
8
- import { useTooltip } from '../Helpers/useTooltip.svelte.js';
9
- import { Shape } from '../Types/Internal/Shape.js';
10
- import { Side } from '../Types/Internal/Side.js';
11
- import { Size } from '../Types/Internal/Size.js';
12
- import { ColourSet } from '../scss/colours.js';
13
- import type { ActionProps } from './ActionProps.js';
14
- import Icon from './Icon.svelte';
15
-
16
- const paddings: Record<Shape, Record<Size, number>> = {
17
- [Shape.Rectangle]: {
18
- [Size.Tiny]: 0.125,
19
- [Size.Small]: 0.1875,
20
- [Size.MediumSmall]: 0.3125,
21
- [Size.Medium]: 0.375,
22
- [Size.MediumLarge]: 0.5,
23
- [Size.Large]: 0.625,
24
- [Size.XLarge]: 0.6875,
25
- [Size.DoubleXLarge]: 0.8125,
26
- [Size.TripleXLarge]: 0.875,
27
- [Size.FillWidth]: -1,
28
- [Size.FillHeight]: -1,
29
- },
30
- [Shape.Circle]: {
31
- [Size.Tiny]: 0.1875,
32
- [Size.Small]: 0.5,
33
- [Size.MediumSmall]: 0.875,
34
- [Size.Medium]: 1.0625,
35
- [Size.MediumLarge]: 1.375,
36
- [Size.Large]: 1.75,
37
- [Size.XLarge]: 1.9375,
38
- [Size.DoubleXLarge]: 2.25,
39
- [Size.TripleXLarge]: 2.4375,
40
- [Size.FillWidth]: -1,
41
- [Size.FillHeight]: -1,
42
- },
43
- };
44
- </script>
45
-
46
- <script lang="ts">
47
- const {
48
- icon,
49
- id,
50
- border = false,
51
- shape = Shape.Rectangle,
52
- label,
53
- colourSet = ColourSet.Secondary,
54
- size = Size.Medium,
55
- paddingSize,
56
- type = 'button',
57
- noTabIndex = false,
58
- disabled,
59
- backgroundColour,
60
- hoverBackgroundColour,
61
- 'data-type': dataType,
62
- onfocus,
63
- onblur,
64
- onclick,
65
- onkeydown: onkeydownProp,
66
- style = '',
67
- side,
68
- 'aria-expanded': ariaExpanded,
69
- 'aria-controls': ariaControls,
70
- }: ActionProps = $props();
71
-
72
- const iconSize: Size = $derived(icon.size ?? size);
73
-
74
- const pad: string = $derived.by(() => {
75
- const padSize = paddingSize ?? size;
76
- return padSize === Size.FillWidth ? '' : `${paddings[shape][padSize]}rem`;
77
- });
78
-
79
- function onkeydown(e: KeyboardEvent) {
80
- passthrough(e);
81
-
82
- if (document.activeElement === e.target) {
83
- onkeydownProp?.(e);
84
- }
85
- }
86
-
87
- // Shared tooltip lifecycle: hover handlers plus unmount-time teardown.
88
- // Action lives inside short-lived hosts (table rows, modal panels,
89
- // accordion content) so the cleanup is load-bearing - without it,
90
- // churn leaves the global tooltip painting against a node that no
91
- // longer exists.
92
- const tt = useTooltip({
93
- text: () => label,
94
- arrow: () => side ?? Side.Left,
95
- });
96
- </script>
97
-
98
- <button
99
- {id}
100
- onmouseenter={tt.onmouseenter}
101
- onmouseleave={tt.onmouseleave}
102
- tabindex={noTabIndex ? -1 : undefined}
103
- data-type={dataType}
104
- style="{pad ? `--pad: ${pad};` : ''} {backgroundColour
105
- ? `--background-colour: ${backgroundColour};`
106
- : ``} {hoverBackgroundColour
107
- ? `--hover-background-colour: ${hoverBackgroundColour};`
108
- : ``}{style}"
109
- class:border
110
- class:circular={shape === Shape.Circle}
111
- class:primary={colourSet === ColourSet.Primary}
112
- class:secondary={colourSet === ColourSet.Secondary}
113
- class:auxiliary={colourSet === ColourSet.Auxiliary}
114
- class:info={colourSet === ColourSet.Info}
115
- class:error={colourSet === ColourSet.Error}
116
- class:fill-width={size === Size.FillWidth}
117
- class:fill-height={size === Size.FillHeight}
118
- {type}
119
- {disabled}
120
- {onfocus}
121
- {onblur}
122
- {onkeydown}
123
- onclick={(e) => {
124
- tt.onclick();
125
- onclick?.(e);
126
- }}
127
- aria-label={label}
128
- aria-expanded={ariaExpanded}
129
- aria-controls={ariaControls}
130
- ><Icon
131
- {...icon}
132
- size={iconSize}
133
- /></button
134
- >
135
-
1
+ <svelte:options runes />
2
+
3
+ <script
4
+ module
5
+ lang="ts"
6
+ >
7
+ import { passthrough } from '../Helpers/Helpers.svelte.js';
8
+ import { useTooltip } from '../Helpers/useTooltip.svelte.js';
9
+ import { Shape } from '../Types/Internal/Shape.js';
10
+ import { Side } from '../Types/Internal/Side.js';
11
+ import { Size } from '../Types/Internal/Size.js';
12
+ import { ColourSet } from '../scss/colours.js';
13
+ import type { ActionProps } from './ActionProps.js';
14
+ import Icon from './Icon.svelte';
15
+
16
+ const paddings: Record<Shape, Record<Size, number>> = {
17
+ [Shape.Rectangle]: {
18
+ [Size.Tiny]: 0.125,
19
+ [Size.Small]: 0.1875,
20
+ [Size.MediumSmall]: 0.3125,
21
+ [Size.Medium]: 0.375,
22
+ [Size.MediumLarge]: 0.5,
23
+ [Size.Large]: 0.625,
24
+ [Size.XLarge]: 0.6875,
25
+ [Size.DoubleXLarge]: 0.8125,
26
+ [Size.TripleXLarge]: 0.875,
27
+ [Size.FillWidth]: -1,
28
+ [Size.FillHeight]: -1,
29
+ },
30
+ [Shape.Circle]: {
31
+ [Size.Tiny]: 0.1875,
32
+ [Size.Small]: 0.5,
33
+ [Size.MediumSmall]: 0.875,
34
+ [Size.Medium]: 1.0625,
35
+ [Size.MediumLarge]: 1.375,
36
+ [Size.Large]: 1.75,
37
+ [Size.XLarge]: 1.9375,
38
+ [Size.DoubleXLarge]: 2.25,
39
+ [Size.TripleXLarge]: 2.4375,
40
+ [Size.FillWidth]: -1,
41
+ [Size.FillHeight]: -1,
42
+ },
43
+ };
44
+ </script>
45
+
46
+ <script lang="ts">
47
+ const {
48
+ icon,
49
+ id,
50
+ border = false,
51
+ shape = Shape.Rectangle,
52
+ label,
53
+ colourSet = ColourSet.Secondary,
54
+ size = Size.Medium,
55
+ paddingSize,
56
+ type = 'button',
57
+ noTabIndex = false,
58
+ disabled,
59
+ backgroundColour,
60
+ hoverBackgroundColour,
61
+ 'data-type': dataType,
62
+ onfocus,
63
+ onblur,
64
+ onclick,
65
+ onkeydown: onkeydownProp,
66
+ style = '',
67
+ side,
68
+ 'aria-expanded': ariaExpanded,
69
+ 'aria-controls': ariaControls,
70
+ }: ActionProps = $props();
71
+
72
+ const iconSize: Size = $derived(icon.size ?? size);
73
+
74
+ const pad: string = $derived.by(() => {
75
+ const padSize = paddingSize ?? size;
76
+ return padSize === Size.FillWidth ? '' : `${paddings[shape][padSize]}rem`;
77
+ });
78
+
79
+ function onkeydown(e: KeyboardEvent) {
80
+ passthrough(e);
81
+
82
+ if (document.activeElement === e.target) {
83
+ onkeydownProp?.(e);
84
+ }
85
+ }
86
+
87
+ // Shared tooltip lifecycle: hover handlers plus unmount-time teardown.
88
+ // Action lives inside short-lived hosts (table rows, modal panels,
89
+ // accordion content) so the cleanup is load-bearing - without it,
90
+ // churn leaves the global tooltip painting against a node that no
91
+ // longer exists.
92
+ const tt = useTooltip({
93
+ text: () => label,
94
+ arrow: () => side ?? Side.Left,
95
+ });
96
+ </script>
97
+
98
+ <button
99
+ {id}
100
+ onmouseenter={tt.onmouseenter}
101
+ onmouseleave={tt.onmouseleave}
102
+ tabindex={noTabIndex ? -1 : undefined}
103
+ data-type={dataType}
104
+ style="{pad ? `--pad: ${pad};` : ''} {backgroundColour
105
+ ? `--background-colour: ${backgroundColour};`
106
+ : ``} {hoverBackgroundColour
107
+ ? `--hover-background-colour: ${hoverBackgroundColour};`
108
+ : ``}{style}"
109
+ class:border
110
+ class:circular={shape === Shape.Circle}
111
+ class:primary={colourSet === ColourSet.Primary}
112
+ class:secondary={colourSet === ColourSet.Secondary}
113
+ class:auxiliary={colourSet === ColourSet.Auxiliary}
114
+ class:info={colourSet === ColourSet.Info}
115
+ class:error={colourSet === ColourSet.Error}
116
+ class:fill-width={size === Size.FillWidth}
117
+ class:fill-height={size === Size.FillHeight}
118
+ {type}
119
+ {disabled}
120
+ {onfocus}
121
+ {onblur}
122
+ {onkeydown}
123
+ onclick={(e) => {
124
+ tt.onclick();
125
+ onclick?.(e);
126
+ }}
127
+ aria-label={label}
128
+ aria-expanded={ariaExpanded}
129
+ aria-controls={ariaControls}
130
+ ><Icon
131
+ {...icon}
132
+ size={iconSize}
133
+ /></button
134
+ >
135
+
136
136
  <style>button {
137
137
  color: #3a4952;
138
138
  fill: #3a4952;
@@ -228,4 +228,4 @@ button.circular {
228
228
  button {
229
229
  padding: var(--pad);
230
230
  cursor: pointer;
231
- }</style>
231
+ }</style>