@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.
- package/README.md +58 -58
- package/dist/Components/AccordionGroup.svelte +28 -28
- package/dist/Components/AccordionGroupButton.svelte +60 -60
- package/dist/Components/Action.svelte +48 -48
- package/dist/Components/AlertModal.svelte +102 -102
- package/dist/Components/Base/ContextWrapper.svelte +45 -45
- package/dist/Components/Base/Pagination.svelte +135 -135
- package/dist/Components/Base/Snippets.svelte +25 -25
- package/dist/Components/BigRadioSet.svelte +34 -34
- package/dist/Components/Bubble.svelte +38 -38
- package/dist/Components/Button.svelte +83 -83
- package/dist/Components/Checkbox.svelte +71 -71
- package/dist/Components/CollapsibleCard.svelte +59 -59
- package/dist/Components/CollapsibleMenuGroup.svelte +43 -43
- package/dist/Components/ConditionBuilder/ConditionBuilder.svelte +101 -101
- package/dist/Components/Contexts/ContextMenu.svelte +76 -76
- package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
- package/dist/Components/Contexts/ContextMenuOption.svelte +38 -38
- package/dist/Components/Contexts/Toast.svelte +71 -71
- package/dist/Components/Contexts/ToastContainer.svelte +34 -34
- package/dist/Components/Contexts/Tooltip.svelte +32 -32
- package/dist/Components/DataMatrixIcon.svelte +37 -37
- package/dist/Components/DateInput.svelte +80 -80
- package/dist/Components/DatePicker.svelte +86 -86
- package/dist/Components/DesktopModal.svelte +65 -65
- package/dist/Components/Dial.svelte +35 -35
- package/dist/Components/DimensionInput.svelte +95 -95
- package/dist/Components/DragMenu/DragMenuHolder.svelte +53 -53
- package/dist/Components/DragMenu/DraggableCard.svelte +49 -49
- package/dist/Components/FileCard.svelte +18 -18
- package/dist/Components/FileUpload.svelte +115 -115
- package/dist/Components/GridInput.svelte +123 -123
- package/dist/Components/GridInputSet.svelte +21 -21
- package/dist/Components/HorizontalTabGroup.svelte +54 -54
- package/dist/Components/HorizontalTabGroupButton.svelte +32 -32
- package/dist/Components/Icon.svelte +68 -68
- package/dist/Components/InfoAlert.svelte +32 -32
- package/dist/Components/LoadingAnimation.svelte +228 -227
- package/dist/Components/LoadingModal.svelte +19 -19
- package/dist/Components/LoadingOverlay.svelte +20 -20
- package/dist/Components/Modal.svelte +127 -127
- package/dist/Components/MultiSelect.svelte +126 -126
- package/dist/Components/Nav/Nav.svelte +71 -71
- package/dist/Components/Nav/NavServiceMenuList.svelte +37 -37
- package/dist/Components/Nav/NavTab.svelte +46 -46
- package/dist/Components/Nav/ServiceMenuItem.svelte +62 -62
- package/dist/Components/Nav/ServicesNav.svelte +50 -50
- package/dist/Components/NumberInput.svelte +98 -98
- package/dist/Components/OptionCards.svelte +58 -58
- package/dist/Components/PageHeading.svelte +21 -21
- package/dist/Components/PasswordInput.svelte +61 -61
- package/dist/Components/PopoverButton.svelte +53 -53
- package/dist/Components/Portal.svelte +7 -7
- package/dist/Components/ProgressBubble.svelte +42 -42
- package/dist/Components/QuerySelect.svelte +102 -102
- package/dist/Components/ResourceCalendar/ResourceCalendar.svelte +241 -241
- package/dist/Components/SidebarPanel.svelte +32 -32
- package/dist/Components/SingleSelect.svelte +122 -122
- package/dist/Components/StepButton.svelte +48 -48
- package/dist/Components/StepForm.svelte +58 -58
- package/dist/Components/Switch.svelte +43 -43
- package/dist/Components/Table/ARCHITECTURE.md +298 -298
- package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +30 -30
- package/dist/Components/Table/Body/Rows/ColumnList.svelte +24 -24
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +165 -165
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +13 -13
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +120 -120
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +81 -81
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +92 -92
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +110 -110
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +54 -54
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +35 -35
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +64 -64
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +82 -82
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +88 -88
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +90 -90
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +96 -96
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +71 -71
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +124 -124
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +91 -91
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +88 -88
- package/dist/Components/Table/Body/Rows/TableRow.svelte +127 -127
- package/dist/Components/Table/Body/TableBody.svelte +92 -92
- package/dist/Components/Table/Headers/HighlightAllHeader.svelte +25 -25
- package/dist/Components/Table/Headers/SelectAllHeader.svelte +20 -20
- package/dist/Components/Table/Headers/TableHead.svelte +175 -175
- package/dist/Components/Table/Misc/ColumnPanel.svelte +32 -32
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte +29 -29
- package/dist/Components/Table/Misc/FilterInput.svelte +326 -326
- package/dist/Components/Table/Misc/FilterPanel.svelte +79 -79
- package/dist/Components/Table/Misc/FilterPanelModal.svelte +21 -21
- package/dist/Components/Table/Misc/ShareViewModal.svelte +118 -118
- package/dist/Components/Table/Misc/SidePanel.svelte +24 -24
- package/dist/Components/Table/Misc/TableConfigurationModal.svelte +318 -318
- package/dist/Components/Table/Misc/TableFooter.svelte +201 -201
- package/dist/Components/Table/Misc/TableHorizontalBar.svelte +112 -112
- package/dist/Components/Table/Misc/TableSidebar.svelte +116 -116
- package/dist/Components/Table/Misc/TableViewDropdown.svelte +25 -25
- package/dist/Components/Table/Misc/ToolboxPanel.svelte +60 -60
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +63 -63
- package/dist/Components/Table/Misc/UpdateViewOptionsModal.svelte +101 -101
- package/dist/Components/Table/NestedTable.svelte +29 -29
- package/dist/Components/Table/Table.svelte +140 -140
- package/dist/Components/Test/TestContextConsumer.svelte +8 -8
- package/dist/Components/TextArea.svelte +92 -90
- package/dist/Components/TextInput.svelte +128 -117
- package/dist/Components/ThreeStateRadio.svelte +101 -101
- package/dist/Components/Touch/BoolCard.svelte +27 -27
- package/dist/Components/Touch/DateModal.svelte +98 -98
- package/dist/Components/Touch/EditCard.svelte +44 -44
- package/dist/Components/Touch/InfoCard.svelte +25 -25
- package/dist/Components/Touch/InfoTextCard.svelte +22 -22
- package/dist/Components/Touch/ModalExplanation.svelte +13 -13
- package/dist/Components/Touch/NumberKeyboard.svelte +81 -81
- package/dist/Components/Touch/NumberModal.svelte +49 -49
- package/dist/Components/Touch/PlusMinusCard.svelte +40 -40
- package/dist/Components/Touch/SelectModal.svelte +86 -86
- package/dist/Components/Touch/SummaryCard.svelte +74 -74
- package/dist/Components/Touch/TextAreaModal.svelte +53 -53
- package/dist/Components/Touch/TextModal.svelte +56 -56
- package/dist/Components/Touch/TouchCard.svelte +28 -28
- package/dist/Components/Touch/TouchModal.svelte +141 -141
- package/dist/Components/Touch/UtilityButton.svelte +63 -63
- package/dist/Components/VerticalTabGroup.svelte +38 -38
- package/dist/Components/VerticalTabGroupButton.svelte +46 -46
- package/dist/Helpers/Datamatrix.d.ts +19 -19
- package/dist/Helpers/Datamatrix.js +291 -291
- package/dist/Types/Examples/ExampleModal.svelte +27 -27
- package/dist/paraglide/README.md +1 -1
- package/dist/scss/_basics.scss +12 -12
- package/dist/scss/_colours.scss +140 -140
- package/dist/scss/_motion.scss +57 -57
- package/dist/scss/_sizing.scss +85 -85
- package/dist/scss/_transitions.scss +8 -8
- package/package.json +1 -1
|
@@ -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 { Colour, ColourSet } from "../scss/colours.js";
|
|
@@ -74,8 +74,8 @@ const iconColours = {
|
|
|
74
74
|
[ColourSet.Error]: Colour["$error-border"],
|
|
75
75
|
[ColourSet.Info]: Colour["$primary-blue-13"]
|
|
76
76
|
};
|
|
77
|
-
</script>
|
|
78
|
-
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
79
|
<script lang="ts">const { type = "button", variant = Variant.Default, toggled = false, iconLeft, iconTop, iconRight, iconBottom, nowrap = false, side, size = Size.Medium, label, colourSet = ColourSet.Secondary, dashed = false, disabled = false, fullWidth = false, onclick, onfocus, onblur, onkeydown: onkeydownProp, children, relative, noninteractive } = $props();
|
|
80
80
|
function onkeydown(e) {
|
|
81
81
|
passthrough(e);
|
|
@@ -99,81 +99,81 @@ $effect(() => {
|
|
|
99
99
|
tt.onmouseleave();
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
|
-
</script>
|
|
103
|
-
|
|
104
|
-
<!-- title={label} -->
|
|
105
|
-
<!-- style="--font-size: {fontSizes[
|
|
106
|
-
size
|
|
107
|
-
]};" -->
|
|
108
|
-
<button
|
|
109
|
-
onmouseenter={tt.onmouseenter}
|
|
110
|
-
onmouseleave={tt.onmouseleave}
|
|
111
|
-
class:noninteractive
|
|
112
|
-
class:relative
|
|
113
|
-
class:default={variant === Variant.Default}
|
|
114
|
-
class:card-inner={variant === Variant.CardInner}
|
|
115
|
-
class:card={variant === Variant.Card}
|
|
116
|
-
class:call-to-action={colourSet === ColourSet.CallToAction}
|
|
117
|
-
class:primary={colourSet === ColourSet.Primary}
|
|
118
|
-
class:secondary-colour={colourSet === ColourSet.Secondary}
|
|
119
|
-
class:secondary-variant={variant === Variant.Secondary}
|
|
120
|
-
class:warning={colourSet === ColourSet.Warning}
|
|
121
|
-
class:error={colourSet === ColourSet.Error}
|
|
122
|
-
class:info={colourSet === ColourSet.Info}
|
|
123
|
-
class:fill-height={size === Size.FillHeight}
|
|
124
|
-
class:fill-width={size === Size.FillWidth}
|
|
125
|
-
style="--fallback-padding-horizontal: {paddingSizesHorizontal[
|
|
126
|
-
size
|
|
127
|
-
]}; --fallback-padding-vertical: {paddingSizesVertical[size]}; --border-width: {borderSizes[
|
|
128
|
-
size
|
|
129
|
-
]};"
|
|
130
|
-
class:dashed
|
|
131
|
-
class:full-width={fullWidth}
|
|
132
|
-
class:toolbar={variant === Variant.Toolbar}
|
|
133
|
-
class:left={side === Side.Left}
|
|
134
|
-
class:right={side === Side.Right}
|
|
135
|
-
class:top={side === Side.Top}
|
|
136
|
-
class:bottom={side === Side.Bottom}
|
|
137
|
-
class:toggled
|
|
138
|
-
class:nowrap
|
|
139
|
-
{type}
|
|
140
|
-
aria-label={label}
|
|
141
|
-
{disabled}
|
|
142
|
-
onclick={(e) => {
|
|
143
|
-
tt.onclick();
|
|
144
|
-
onclick?.(e);
|
|
145
|
-
}}
|
|
146
|
-
{onfocus}
|
|
147
|
-
{onblur}
|
|
148
|
-
{onkeydown}
|
|
149
|
-
>
|
|
150
|
-
<div class="icon-container">
|
|
151
|
-
{#if iconLeft}
|
|
152
|
-
<Icon
|
|
153
|
-
{...iconLeft}
|
|
154
|
-
colour={iconColours[colourSet]}
|
|
155
|
-
size={iconLeft.size ?? size}
|
|
156
|
-
/>
|
|
157
|
-
{/if}
|
|
158
|
-
{#if iconTop}
|
|
159
|
-
<Icon {...iconTop} />
|
|
160
|
-
{/if}
|
|
161
|
-
{#if children}
|
|
162
|
-
<span>{@render children()}</span>
|
|
163
|
-
{/if}
|
|
164
|
-
{#if iconBottom}
|
|
165
|
-
<Icon {...iconBottom} />
|
|
166
|
-
{/if}
|
|
167
|
-
{#if iconRight}
|
|
168
|
-
<Icon
|
|
169
|
-
{...iconRight}
|
|
170
|
-
colour={iconColours[colourSet]}
|
|
171
|
-
size={iconRight.size ?? size}
|
|
172
|
-
/>
|
|
173
|
-
{/if}
|
|
174
|
-
</div>
|
|
175
|
-
</button>
|
|
176
|
-
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<!-- title={label} -->
|
|
105
|
+
<!-- style="--font-size: {fontSizes[
|
|
106
|
+
size
|
|
107
|
+
]};" -->
|
|
108
|
+
<button
|
|
109
|
+
onmouseenter={tt.onmouseenter}
|
|
110
|
+
onmouseleave={tt.onmouseleave}
|
|
111
|
+
class:noninteractive
|
|
112
|
+
class:relative
|
|
113
|
+
class:default={variant === Variant.Default}
|
|
114
|
+
class:card-inner={variant === Variant.CardInner}
|
|
115
|
+
class:card={variant === Variant.Card}
|
|
116
|
+
class:call-to-action={colourSet === ColourSet.CallToAction}
|
|
117
|
+
class:primary={colourSet === ColourSet.Primary}
|
|
118
|
+
class:secondary-colour={colourSet === ColourSet.Secondary}
|
|
119
|
+
class:secondary-variant={variant === Variant.Secondary}
|
|
120
|
+
class:warning={colourSet === ColourSet.Warning}
|
|
121
|
+
class:error={colourSet === ColourSet.Error}
|
|
122
|
+
class:info={colourSet === ColourSet.Info}
|
|
123
|
+
class:fill-height={size === Size.FillHeight}
|
|
124
|
+
class:fill-width={size === Size.FillWidth}
|
|
125
|
+
style="--fallback-padding-horizontal: {paddingSizesHorizontal[
|
|
126
|
+
size
|
|
127
|
+
]}; --fallback-padding-vertical: {paddingSizesVertical[size]}; --border-width: {borderSizes[
|
|
128
|
+
size
|
|
129
|
+
]};"
|
|
130
|
+
class:dashed
|
|
131
|
+
class:full-width={fullWidth}
|
|
132
|
+
class:toolbar={variant === Variant.Toolbar}
|
|
133
|
+
class:left={side === Side.Left}
|
|
134
|
+
class:right={side === Side.Right}
|
|
135
|
+
class:top={side === Side.Top}
|
|
136
|
+
class:bottom={side === Side.Bottom}
|
|
137
|
+
class:toggled
|
|
138
|
+
class:nowrap
|
|
139
|
+
{type}
|
|
140
|
+
aria-label={label}
|
|
141
|
+
{disabled}
|
|
142
|
+
onclick={(e) => {
|
|
143
|
+
tt.onclick();
|
|
144
|
+
onclick?.(e);
|
|
145
|
+
}}
|
|
146
|
+
{onfocus}
|
|
147
|
+
{onblur}
|
|
148
|
+
{onkeydown}
|
|
149
|
+
>
|
|
150
|
+
<div class="icon-container">
|
|
151
|
+
{#if iconLeft}
|
|
152
|
+
<Icon
|
|
153
|
+
{...iconLeft}
|
|
154
|
+
colour={iconColours[colourSet]}
|
|
155
|
+
size={iconLeft.size ?? size}
|
|
156
|
+
/>
|
|
157
|
+
{/if}
|
|
158
|
+
{#if iconTop}
|
|
159
|
+
<Icon {...iconTop} />
|
|
160
|
+
{/if}
|
|
161
|
+
{#if children}
|
|
162
|
+
<span>{@render children()}</span>
|
|
163
|
+
{/if}
|
|
164
|
+
{#if iconBottom}
|
|
165
|
+
<Icon {...iconBottom} />
|
|
166
|
+
{/if}
|
|
167
|
+
{#if iconRight}
|
|
168
|
+
<Icon
|
|
169
|
+
{...iconRight}
|
|
170
|
+
colour={iconColours[colourSet]}
|
|
171
|
+
size={iconRight.size ?? size}
|
|
172
|
+
/>
|
|
173
|
+
{/if}
|
|
174
|
+
</div>
|
|
175
|
+
</button>
|
|
176
|
+
|
|
177
177
|
<style>.card {
|
|
178
178
|
color: #3a4952;
|
|
179
179
|
fill: #3a4952;
|
|
@@ -487,4 +487,4 @@ button.toolbar:not([disabled]).toggled.bottom {
|
|
|
487
487
|
}
|
|
488
488
|
button.toolbar:not([disabled]).toggled svg {
|
|
489
489
|
fill: #259fc7;
|
|
490
|
-
}</style>
|
|
490
|
+
}</style>
|
|
@@ -1,77 +1,77 @@
|
|
|
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 { generateWeakId } from "../Helpers/Helpers.svelte.js";
|
|
7
7
|
import { Size } from "../Types/Internal/Size.js";
|
|
8
8
|
import Icon from "./Icon.svelte";
|
|
9
|
-
</script>
|
|
10
|
-
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
11
|
<script lang="ts">let { value = false, id = generateWeakId(), icon, size, label, disabled, onchange } = $props();
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
{#if icon}
|
|
15
|
-
<div
|
|
16
|
-
class="outer-checkbox-container"
|
|
17
|
-
class:fill-width={size === Size.FillWidth}
|
|
18
|
-
class:fill-height={size === Size.FillHeight}
|
|
19
|
-
>
|
|
20
|
-
<div
|
|
21
|
-
class="inner-checkbox-container with-icon"
|
|
22
|
-
class:disabled
|
|
23
|
-
>
|
|
24
|
-
<input
|
|
25
|
-
{id}
|
|
26
|
-
name={id}
|
|
27
|
-
class="with-icon"
|
|
28
|
-
{onchange}
|
|
29
|
-
type="checkbox"
|
|
30
|
-
{disabled}
|
|
31
|
-
checked={value}
|
|
32
|
-
/>
|
|
33
|
-
<label
|
|
34
|
-
class="icon-label"
|
|
35
|
-
for={id}
|
|
36
|
-
class:disabled
|
|
37
|
-
>
|
|
38
|
-
<Icon
|
|
39
|
-
{...icon}
|
|
40
|
-
size={icon.size ?? size ?? Size.DoubleXLarge}
|
|
41
|
-
/>
|
|
42
|
-
</label>
|
|
43
|
-
</div>
|
|
44
|
-
{#if label}
|
|
45
|
-
<label
|
|
46
|
-
class="text-label"
|
|
47
|
-
for={id}>{label}</label
|
|
48
|
-
>
|
|
49
|
-
{/if}
|
|
50
|
-
</div>
|
|
51
|
-
{:else}
|
|
52
|
-
<div
|
|
53
|
-
class="checkbox-container"
|
|
54
|
-
class:compact={size === Size.Tiny ||
|
|
55
|
-
size === Size.Small ||
|
|
56
|
-
size === Size.MediumSmall ||
|
|
57
|
-
size === Size.Medium}
|
|
58
|
-
>
|
|
59
|
-
<input
|
|
60
|
-
{id}
|
|
61
|
-
{onchange}
|
|
62
|
-
type="checkbox"
|
|
63
|
-
checked={value}
|
|
64
|
-
{disabled}
|
|
65
|
-
/>
|
|
66
|
-
{#if label}
|
|
67
|
-
<label
|
|
68
|
-
class="text-label"
|
|
69
|
-
for={id}>{label}</label
|
|
70
|
-
>
|
|
71
|
-
{/if}
|
|
72
|
-
</div>
|
|
73
|
-
{/if}
|
|
74
|
-
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
{#if icon}
|
|
15
|
+
<div
|
|
16
|
+
class="outer-checkbox-container"
|
|
17
|
+
class:fill-width={size === Size.FillWidth}
|
|
18
|
+
class:fill-height={size === Size.FillHeight}
|
|
19
|
+
>
|
|
20
|
+
<div
|
|
21
|
+
class="inner-checkbox-container with-icon"
|
|
22
|
+
class:disabled
|
|
23
|
+
>
|
|
24
|
+
<input
|
|
25
|
+
{id}
|
|
26
|
+
name={id}
|
|
27
|
+
class="with-icon"
|
|
28
|
+
{onchange}
|
|
29
|
+
type="checkbox"
|
|
30
|
+
{disabled}
|
|
31
|
+
checked={value}
|
|
32
|
+
/>
|
|
33
|
+
<label
|
|
34
|
+
class="icon-label"
|
|
35
|
+
for={id}
|
|
36
|
+
class:disabled
|
|
37
|
+
>
|
|
38
|
+
<Icon
|
|
39
|
+
{...icon}
|
|
40
|
+
size={icon.size ?? size ?? Size.DoubleXLarge}
|
|
41
|
+
/>
|
|
42
|
+
</label>
|
|
43
|
+
</div>
|
|
44
|
+
{#if label}
|
|
45
|
+
<label
|
|
46
|
+
class="text-label"
|
|
47
|
+
for={id}>{label}</label
|
|
48
|
+
>
|
|
49
|
+
{/if}
|
|
50
|
+
</div>
|
|
51
|
+
{:else}
|
|
52
|
+
<div
|
|
53
|
+
class="checkbox-container"
|
|
54
|
+
class:compact={size === Size.Tiny ||
|
|
55
|
+
size === Size.Small ||
|
|
56
|
+
size === Size.MediumSmall ||
|
|
57
|
+
size === Size.Medium}
|
|
58
|
+
>
|
|
59
|
+
<input
|
|
60
|
+
{id}
|
|
61
|
+
{onchange}
|
|
62
|
+
type="checkbox"
|
|
63
|
+
checked={value}
|
|
64
|
+
{disabled}
|
|
65
|
+
/>
|
|
66
|
+
{#if label}
|
|
67
|
+
<label
|
|
68
|
+
class="text-label"
|
|
69
|
+
for={id}>{label}</label
|
|
70
|
+
>
|
|
71
|
+
{/if}
|
|
72
|
+
</div>
|
|
73
|
+
{/if}
|
|
74
|
+
|
|
75
75
|
<style>.outer-checkbox-container {
|
|
76
76
|
box-sizing: border-box;
|
|
77
77
|
display: flex;
|
|
@@ -165,4 +165,4 @@ label {
|
|
|
165
165
|
display: block;
|
|
166
166
|
cursor: pointer;
|
|
167
167
|
position: relative;
|
|
168
|
-
}</style>
|
|
168
|
+
}</style>
|
|
@@ -1,11 +1,11 @@
|
|
|
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 { generateWeakId } from "../Helpers/Helpers.svelte.js";
|
|
7
|
-
</script>
|
|
8
|
-
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
9
|
<script lang="ts">import { loadingText } from "../Helpers/Helpers.svelte.js";
|
|
10
10
|
import { usePrefersReducedMotion } from "../Helpers/prefersReducedMotion.svelte.js";
|
|
11
11
|
import { Size } from "../Types/Internal/Size.js";
|
|
@@ -18,57 +18,57 @@ const contentId = `collapsible-card-${generateWeakId()}`;
|
|
|
18
18
|
const cardMaxHeight = $derived(maxHeight != null && maxHeight > 0 ? `${maxHeight}px` : undefined);
|
|
19
19
|
const reducedMotion = usePrefersReducedMotion();
|
|
20
20
|
const slideDuration = $derived(reducedMotion.matches ? 0 : 200);
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<div
|
|
24
|
-
class="collapsible-card"
|
|
25
|
-
style={cardMaxHeight != null ? `--card-max-height: ${cardMaxHeight};` : undefined}
|
|
26
|
-
class:is-collapsed={isCollapsed}
|
|
27
|
-
class:grow
|
|
28
|
-
>
|
|
29
|
-
<button
|
|
30
|
-
type="button"
|
|
31
|
-
class="heading"
|
|
32
|
-
class:is-collapsed={isCollapsed}
|
|
33
|
-
aria-expanded={!isCollapsed}
|
|
34
|
-
aria-controls={contentId}
|
|
35
|
-
onclick={() => {
|
|
36
|
-
isCollapsed = !isCollapsed;
|
|
37
|
-
}}
|
|
38
|
-
>
|
|
39
|
-
<div class="left">
|
|
40
|
-
<h3>{title}</h3>
|
|
41
|
-
{#if subtitle}
|
|
42
|
-
{#await subtitle}
|
|
43
|
-
<span>{loadingText()}</span>
|
|
44
|
-
{:then resolvedSubtitle}
|
|
45
|
-
<span>{resolvedSubtitle}</span>
|
|
46
|
-
{/await}
|
|
47
|
-
{/if}
|
|
48
|
-
</div>
|
|
49
|
-
<span class="indicator">
|
|
50
|
-
<Icon
|
|
51
|
-
name={isCollapsed ? 'circle-plus' : 'circle-minus'}
|
|
52
|
-
colour={Colour['$ui-blue-5']}
|
|
53
|
-
size={Size.Medium}
|
|
54
|
-
/>
|
|
55
|
-
</span>
|
|
56
|
-
</button>
|
|
57
|
-
|
|
58
|
-
{#if !isCollapsed}
|
|
59
|
-
<div
|
|
60
|
-
id={contentId}
|
|
61
|
-
class="content"
|
|
62
|
-
style="overflow: {cardMaxHeight != null ? 'auto' : 'visible'};"
|
|
63
|
-
transition:slide={{ duration: slideDuration, easing: cubicOut }}
|
|
64
|
-
>
|
|
65
|
-
{#if children}
|
|
66
|
-
{@render children()}
|
|
67
|
-
{/if}
|
|
68
|
-
</div>
|
|
69
|
-
{/if}
|
|
70
|
-
</div>
|
|
71
|
-
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<div
|
|
24
|
+
class="collapsible-card"
|
|
25
|
+
style={cardMaxHeight != null ? `--card-max-height: ${cardMaxHeight};` : undefined}
|
|
26
|
+
class:is-collapsed={isCollapsed}
|
|
27
|
+
class:grow
|
|
28
|
+
>
|
|
29
|
+
<button
|
|
30
|
+
type="button"
|
|
31
|
+
class="heading"
|
|
32
|
+
class:is-collapsed={isCollapsed}
|
|
33
|
+
aria-expanded={!isCollapsed}
|
|
34
|
+
aria-controls={contentId}
|
|
35
|
+
onclick={() => {
|
|
36
|
+
isCollapsed = !isCollapsed;
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<div class="left">
|
|
40
|
+
<h3>{title}</h3>
|
|
41
|
+
{#if subtitle}
|
|
42
|
+
{#await subtitle}
|
|
43
|
+
<span>{loadingText()}</span>
|
|
44
|
+
{:then resolvedSubtitle}
|
|
45
|
+
<span>{resolvedSubtitle}</span>
|
|
46
|
+
{/await}
|
|
47
|
+
{/if}
|
|
48
|
+
</div>
|
|
49
|
+
<span class="indicator">
|
|
50
|
+
<Icon
|
|
51
|
+
name={isCollapsed ? 'circle-plus' : 'circle-minus'}
|
|
52
|
+
colour={Colour['$ui-blue-5']}
|
|
53
|
+
size={Size.Medium}
|
|
54
|
+
/>
|
|
55
|
+
</span>
|
|
56
|
+
</button>
|
|
57
|
+
|
|
58
|
+
{#if !isCollapsed}
|
|
59
|
+
<div
|
|
60
|
+
id={contentId}
|
|
61
|
+
class="content"
|
|
62
|
+
style="overflow: {cardMaxHeight != null ? 'auto' : 'visible'};"
|
|
63
|
+
transition:slide={{ duration: slideDuration, easing: cubicOut }}
|
|
64
|
+
>
|
|
65
|
+
{#if children}
|
|
66
|
+
{@render children()}
|
|
67
|
+
{/if}
|
|
68
|
+
</div>
|
|
69
|
+
{/if}
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
72
|
<style>.collapsible-card {
|
|
73
73
|
background-color: #ffffff;
|
|
74
74
|
display: flex;
|
|
@@ -130,4 +130,4 @@ div.content {
|
|
|
130
130
|
height: max-content;
|
|
131
131
|
min-height: 0;
|
|
132
132
|
width: 100%;
|
|
133
|
-
}</style>
|
|
133
|
+
}</style>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<!--
|
|
4
|
-
@component
|
|
5
|
-
A labelled, collapsible group for a side menu: a header row (label + chevron)
|
|
6
|
-
that expands and collapses the items supplied as the default snippet. Pair
|
|
7
|
-
several of these in a menu column to build a grouped navigation tree.
|
|
8
|
-
-->
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<!--
|
|
4
|
+
@component
|
|
5
|
+
A labelled, collapsible group for a side menu: a header row (label + chevron)
|
|
6
|
+
that expands and collapses the items supplied as the default snippet. Pair
|
|
7
|
+
several of these in a menu column to build a grouped navigation tree.
|
|
8
|
+
-->
|
|
9
9
|
<script lang="ts">import { usePrefersReducedMotion } from "../Helpers/prefersReducedMotion.svelte.js";
|
|
10
10
|
import { Colour } from "../scss/colours.js";
|
|
11
11
|
import { Size } from "../Types/Internal/Size.js";
|
|
@@ -15,40 +15,40 @@ import Icon from "./Icon.svelte";
|
|
|
15
15
|
let { title, isCollapsed = $bindable(false), children } = $props();
|
|
16
16
|
const reducedMotion = usePrefersReducedMotion();
|
|
17
17
|
const slideDuration = $derived(reducedMotion.matches ? 0 : 200);
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<div class="menu-group">
|
|
21
|
-
<button
|
|
22
|
-
type="button"
|
|
23
|
-
class="group-header"
|
|
24
|
-
aria-expanded={!isCollapsed}
|
|
25
|
-
onclick={() => {
|
|
26
|
-
isCollapsed = !isCollapsed;
|
|
27
|
-
}}
|
|
28
|
-
>
|
|
29
|
-
<span class="group-title">{title}</span>
|
|
30
|
-
<span
|
|
31
|
-
class="chevron"
|
|
32
|
-
class:collapsed={isCollapsed}
|
|
33
|
-
>
|
|
34
|
-
<Icon
|
|
35
|
-
name="chevron-down"
|
|
36
|
-
size={Size.Small}
|
|
37
|
-
colour={Colour['$ui-blue-11']}
|
|
38
|
-
/>
|
|
39
|
-
</span>
|
|
40
|
-
</button>
|
|
41
|
-
|
|
42
|
-
{#if !isCollapsed}
|
|
43
|
-
<div
|
|
44
|
-
class="group-items"
|
|
45
|
-
transition:slide={{ duration: slideDuration, easing: cubicOut }}
|
|
46
|
-
>
|
|
47
|
-
{@render children()}
|
|
48
|
-
</div>
|
|
49
|
-
{/if}
|
|
50
|
-
</div>
|
|
51
|
-
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<div class="menu-group">
|
|
21
|
+
<button
|
|
22
|
+
type="button"
|
|
23
|
+
class="group-header"
|
|
24
|
+
aria-expanded={!isCollapsed}
|
|
25
|
+
onclick={() => {
|
|
26
|
+
isCollapsed = !isCollapsed;
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
<span class="group-title">{title}</span>
|
|
30
|
+
<span
|
|
31
|
+
class="chevron"
|
|
32
|
+
class:collapsed={isCollapsed}
|
|
33
|
+
>
|
|
34
|
+
<Icon
|
|
35
|
+
name="chevron-down"
|
|
36
|
+
size={Size.Small}
|
|
37
|
+
colour={Colour['$ui-blue-11']}
|
|
38
|
+
/>
|
|
39
|
+
</span>
|
|
40
|
+
</button>
|
|
41
|
+
|
|
42
|
+
{#if !isCollapsed}
|
|
43
|
+
<div
|
|
44
|
+
class="group-items"
|
|
45
|
+
transition:slide={{ duration: slideDuration, easing: cubicOut }}
|
|
46
|
+
>
|
|
47
|
+
{@render children()}
|
|
48
|
+
</div>
|
|
49
|
+
{/if}
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
52
|
<style>.menu-group {
|
|
53
53
|
border: solid 1px #cbd4da;
|
|
54
54
|
border-radius: 4px;
|
|
@@ -86,4 +86,4 @@ const slideDuration = $derived(reducedMotion.matches ? 0 : 200);
|
|
|
86
86
|
display: flex;
|
|
87
87
|
flex-flow: column nowrap;
|
|
88
88
|
border-top: solid 1px #cbd4da;
|
|
89
|
-
}</style>
|
|
89
|
+
}</style>
|