@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
|
-
lang="ts"
|
|
5
|
-
generics="CommonDenominator"
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="CommonDenominator"
|
|
6
6
|
>import { ellipses } from "../Helpers/Helpers.svelte.js";
|
|
7
7
|
import { Colour } from "../scss/colours.js";
|
|
8
8
|
import HorizontalTabGroupButton from "./HorizontalTabGroupButton.svelte";
|
|
@@ -22,54 +22,54 @@ $effect(() => {
|
|
|
22
22
|
};
|
|
23
23
|
});
|
|
24
24
|
const filteredTabs = $derived(filterFn ? tabs.filter((t) => filterFn(t, debouncedSearch)) : tabs);
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<div
|
|
28
|
-
class="wrapper"
|
|
29
|
-
class:no-radius={noRadius}
|
|
30
|
-
class:grow
|
|
31
|
-
class:dense
|
|
32
|
-
>
|
|
33
|
-
<div class="tabs">
|
|
34
|
-
<div class="sticky">
|
|
35
|
-
{#if filterable}
|
|
36
|
-
<div class="searchbar">
|
|
37
|
-
<TextInput
|
|
38
|
-
bind:value={searchValue}
|
|
39
|
-
placeholder={searchPlaceholder ?? `Search any keyword to find matches${ellipses}`}
|
|
40
|
-
rightIcon={{ name: 'search-1', colour: Colour['$ui-blue-4'] }}
|
|
41
|
-
/>
|
|
42
|
-
{#if searchInfo}
|
|
43
|
-
<span class="search-info">
|
|
44
|
-
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
45
|
-
{@render searchInfo()}
|
|
46
|
-
</span>
|
|
47
|
-
{/if}
|
|
48
|
-
</div>
|
|
49
|
-
{/if}
|
|
50
|
-
</div>
|
|
51
|
-
{#if tabComponent}
|
|
52
|
-
{#each filteredTabs as option (option.label)}
|
|
53
|
-
{@render tabComponent(option, selected?.label === option.label)}
|
|
54
|
-
{/each}
|
|
55
|
-
{:else}
|
|
56
|
-
{#each filteredTabs as option (option.label)}
|
|
57
|
-
<HorizontalTabGroupButton
|
|
58
|
-
{option}
|
|
59
|
-
noRadius={noRadius || filterable}
|
|
60
|
-
selected={selected?.label === option.label}
|
|
61
|
-
/>
|
|
62
|
-
{/each}
|
|
63
|
-
{/if}
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<div class="content">
|
|
67
|
-
{#if selected}
|
|
68
|
-
{@render selected.content(selected.args)}
|
|
69
|
-
{/if}
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<div
|
|
28
|
+
class="wrapper"
|
|
29
|
+
class:no-radius={noRadius}
|
|
30
|
+
class:grow
|
|
31
|
+
class:dense
|
|
32
|
+
>
|
|
33
|
+
<div class="tabs">
|
|
34
|
+
<div class="sticky">
|
|
35
|
+
{#if filterable}
|
|
36
|
+
<div class="searchbar">
|
|
37
|
+
<TextInput
|
|
38
|
+
bind:value={searchValue}
|
|
39
|
+
placeholder={searchPlaceholder ?? `Search any keyword to find matches${ellipses}`}
|
|
40
|
+
rightIcon={{ name: 'search-1', colour: Colour['$ui-blue-4'] }}
|
|
41
|
+
/>
|
|
42
|
+
{#if searchInfo}
|
|
43
|
+
<span class="search-info">
|
|
44
|
+
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
45
|
+
{@render searchInfo()}
|
|
46
|
+
</span>
|
|
47
|
+
{/if}
|
|
48
|
+
</div>
|
|
49
|
+
{/if}
|
|
50
|
+
</div>
|
|
51
|
+
{#if tabComponent}
|
|
52
|
+
{#each filteredTabs as option (option.label)}
|
|
53
|
+
{@render tabComponent(option, selected?.label === option.label)}
|
|
54
|
+
{/each}
|
|
55
|
+
{:else}
|
|
56
|
+
{#each filteredTabs as option (option.label)}
|
|
57
|
+
<HorizontalTabGroupButton
|
|
58
|
+
{option}
|
|
59
|
+
noRadius={noRadius || filterable}
|
|
60
|
+
selected={selected?.label === option.label}
|
|
61
|
+
/>
|
|
62
|
+
{/each}
|
|
63
|
+
{/if}
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div class="content">
|
|
67
|
+
{#if selected}
|
|
68
|
+
{@render selected.content(selected.args)}
|
|
69
|
+
{/if}
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
73
|
<style>.searchbar {
|
|
74
74
|
display: flex;
|
|
75
75
|
flex-flow: row nowrap;
|
|
@@ -136,4 +136,4 @@ const filteredTabs = $derived(filterFn ? tabs.filter((t) => filterFn(t, debounce
|
|
|
136
136
|
flex-grow: 1;
|
|
137
137
|
overflow: visible;
|
|
138
138
|
border-radius: 0 4px 0 4px;
|
|
139
|
-
}</style>
|
|
139
|
+
}</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,32 +11,32 @@ const { option, selected, noRadius = false } = $props();
|
|
|
11
11
|
const isValid = useAsyncFlag(() => option.isValid, true);
|
|
12
12
|
const disabled = useAsyncFlag(() => option.disabled, false);
|
|
13
13
|
const visible = useAsyncFlag(() => option.visible, true);
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<button
|
|
17
|
-
class:selected
|
|
18
|
-
onclick={() => {
|
|
19
|
-
option.onclick();
|
|
20
|
-
}}
|
|
21
|
-
type="button"
|
|
22
|
-
class="tab"
|
|
23
|
-
class:invalid={!isValid.value}
|
|
24
|
-
disabled={disabled.value}
|
|
25
|
-
class:hidden={!visible.value}
|
|
26
|
-
class:no-radius={noRadius}
|
|
27
|
-
>
|
|
28
|
-
<div class="selected-marker"></div>
|
|
29
|
-
|
|
30
|
-
{option.label}
|
|
31
|
-
{#if !isValid.value}
|
|
32
|
-
<Icon
|
|
33
|
-
name="error"
|
|
34
|
-
colour={Colour['$error-border']}
|
|
35
|
-
size={Size.Small}
|
|
36
|
-
/>
|
|
37
|
-
{/if}
|
|
38
|
-
</button>
|
|
39
|
-
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<button
|
|
17
|
+
class:selected
|
|
18
|
+
onclick={() => {
|
|
19
|
+
option.onclick();
|
|
20
|
+
}}
|
|
21
|
+
type="button"
|
|
22
|
+
class="tab"
|
|
23
|
+
class:invalid={!isValid.value}
|
|
24
|
+
disabled={disabled.value}
|
|
25
|
+
class:hidden={!visible.value}
|
|
26
|
+
class:no-radius={noRadius}
|
|
27
|
+
>
|
|
28
|
+
<div class="selected-marker"></div>
|
|
29
|
+
|
|
30
|
+
{option.label}
|
|
31
|
+
{#if !isValid.value}
|
|
32
|
+
<Icon
|
|
33
|
+
name="error"
|
|
34
|
+
colour={Colour['$error-border']}
|
|
35
|
+
size={Size.Small}
|
|
36
|
+
/>
|
|
37
|
+
{/if}
|
|
38
|
+
</button>
|
|
39
|
+
|
|
40
40
|
<style>button.tab.hidden {
|
|
41
41
|
display: none !important;
|
|
42
42
|
}
|
|
@@ -94,4 +94,4 @@ const visible = useAsyncFlag(() => option.visible, true);
|
|
|
94
94
|
}
|
|
95
95
|
.tab:hover, .tab.selected:hover, .tab.invalid:hover {
|
|
96
96
|
background-color: #f4f7f9;
|
|
97
|
-
}</style>
|
|
97
|
+
}</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 { passthrough } from "../Helpers/Helpers.svelte.js";
|
|
7
7
|
import { Size } from "../Types/Internal/Size.js";
|
|
8
8
|
import { Variant } from "../Types/Internal/Variant.js";
|
|
@@ -28,8 +28,8 @@ const sizes = {
|
|
|
28
28
|
if (!Object.isFrozen(icons)) {
|
|
29
29
|
throw new Error("Icon: icons map is not frozen. Refusing to inline SVG fragments via {@html}.");
|
|
30
30
|
}
|
|
31
|
-
</script>
|
|
32
|
-
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
33
|
<script lang="ts">const { name, size = Size.Medium, label, float = false, variant, invisible, clickable = false, clickableType = "button", zindex = 1, anchorX, anchorY, left, right, top, bottom, colour, onclick, rotate, directional = false } = $props();
|
|
34
34
|
const dim = $derived(sizes[size]);
|
|
35
35
|
const displayIcon = $derived(icons[name]);
|
|
@@ -38,66 +38,66 @@ const displayIcon = $derived(icons[name]);
|
|
|
38
38
|
// per-screen case (toolbars, table cells, status indicators).
|
|
39
39
|
const styleString = $derived(`--zindex: ${zindex.toString()}; --left: ${left ?? ""}; --right: ${right ?? ""}; --top: ${top ?? ""}; --bottom: ${bottom ?? ""}; --anchorX: ${anchorX ?? ""}; --anchorY: ${anchorY ?? ""};${colour ? ` --colour: ${colour};` : ""}`);
|
|
40
40
|
const ariaLabel = $derived(label ?? name.toString());
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
{#if clickable}
|
|
44
|
-
<button
|
|
45
|
-
class="icon"
|
|
46
|
-
type={clickableType}
|
|
47
|
-
class:header-icon={variant === Variant.HeaderIcon}
|
|
48
|
-
class:fill-width={size === Size.FillWidth}
|
|
49
|
-
class:fill-height={size === Size.FillHeight}
|
|
50
|
-
style={styleString}
|
|
51
|
-
class:absolute={float}
|
|
52
|
-
{onclick}
|
|
53
|
-
class:rotate
|
|
54
|
-
class:directional
|
|
55
|
-
onkeydown={passthrough}
|
|
56
|
-
aria-label={ariaLabel}
|
|
57
|
-
>
|
|
58
|
-
{#if displayIcon}
|
|
59
|
-
<!-- SECURITY both displayIcon and its svg property have been frozen. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze -->
|
|
60
|
-
<svg
|
|
61
|
-
width={dim}
|
|
62
|
-
height={dim}
|
|
63
|
-
viewBox="0 0 {displayIcon.box} {displayIcon.box}"
|
|
64
|
-
>
|
|
65
|
-
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
66
|
-
{@html displayIcon.svg}</svg
|
|
67
|
-
>
|
|
68
|
-
{:else}
|
|
69
|
-
<span
|
|
70
|
-
aria-hidden="true"
|
|
71
|
-
class="invalid-icon"
|
|
72
|
-
></span>
|
|
73
|
-
{/if}
|
|
74
|
-
</button>
|
|
75
|
-
{:else if displayIcon}
|
|
76
|
-
<!-- SECURITY both displayIcon and its svg property have been frozen. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze -->
|
|
77
|
-
<svg
|
|
78
|
-
class="icon"
|
|
79
|
-
style={styleString}
|
|
80
|
-
class:absolute={float}
|
|
81
|
-
class:invisible
|
|
82
|
-
class:header-icon={variant === Variant.HeaderIcon}
|
|
83
|
-
class:fill-width={size === Size.FillWidth}
|
|
84
|
-
class:fill-height={size === Size.FillHeight}
|
|
85
|
-
width={dim}
|
|
86
|
-
height={dim}
|
|
87
|
-
class:rotate
|
|
88
|
-
class:directional
|
|
89
|
-
viewBox="0 0 {displayIcon.box} {displayIcon.box}"
|
|
90
|
-
>
|
|
91
|
-
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
92
|
-
{@html displayIcon.svg}</svg
|
|
93
|
-
>
|
|
94
|
-
{:else}
|
|
95
|
-
<span
|
|
96
|
-
aria-hidden="true"
|
|
97
|
-
class="invalid-icon"
|
|
98
|
-
></span>
|
|
99
|
-
{/if}
|
|
100
|
-
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
{#if clickable}
|
|
44
|
+
<button
|
|
45
|
+
class="icon"
|
|
46
|
+
type={clickableType}
|
|
47
|
+
class:header-icon={variant === Variant.HeaderIcon}
|
|
48
|
+
class:fill-width={size === Size.FillWidth}
|
|
49
|
+
class:fill-height={size === Size.FillHeight}
|
|
50
|
+
style={styleString}
|
|
51
|
+
class:absolute={float}
|
|
52
|
+
{onclick}
|
|
53
|
+
class:rotate
|
|
54
|
+
class:directional
|
|
55
|
+
onkeydown={passthrough}
|
|
56
|
+
aria-label={ariaLabel}
|
|
57
|
+
>
|
|
58
|
+
{#if displayIcon}
|
|
59
|
+
<!-- SECURITY both displayIcon and its svg property have been frozen. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze -->
|
|
60
|
+
<svg
|
|
61
|
+
width={dim}
|
|
62
|
+
height={dim}
|
|
63
|
+
viewBox="0 0 {displayIcon.box} {displayIcon.box}"
|
|
64
|
+
>
|
|
65
|
+
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
66
|
+
{@html displayIcon.svg}</svg
|
|
67
|
+
>
|
|
68
|
+
{:else}
|
|
69
|
+
<span
|
|
70
|
+
aria-hidden="true"
|
|
71
|
+
class="invalid-icon"
|
|
72
|
+
></span>
|
|
73
|
+
{/if}
|
|
74
|
+
</button>
|
|
75
|
+
{:else if displayIcon}
|
|
76
|
+
<!-- SECURITY both displayIcon and its svg property have been frozen. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze -->
|
|
77
|
+
<svg
|
|
78
|
+
class="icon"
|
|
79
|
+
style={styleString}
|
|
80
|
+
class:absolute={float}
|
|
81
|
+
class:invisible
|
|
82
|
+
class:header-icon={variant === Variant.HeaderIcon}
|
|
83
|
+
class:fill-width={size === Size.FillWidth}
|
|
84
|
+
class:fill-height={size === Size.FillHeight}
|
|
85
|
+
width={dim}
|
|
86
|
+
height={dim}
|
|
87
|
+
class:rotate
|
|
88
|
+
class:directional
|
|
89
|
+
viewBox="0 0 {displayIcon.box} {displayIcon.box}"
|
|
90
|
+
>
|
|
91
|
+
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
92
|
+
{@html displayIcon.svg}</svg
|
|
93
|
+
>
|
|
94
|
+
{:else}
|
|
95
|
+
<span
|
|
96
|
+
aria-hidden="true"
|
|
97
|
+
class="invalid-icon"
|
|
98
|
+
></span>
|
|
99
|
+
{/if}
|
|
100
|
+
|
|
101
101
|
<style>.rotate {
|
|
102
102
|
transform-origin: center;
|
|
103
103
|
}
|
|
@@ -175,4 +175,4 @@ svg:hover {
|
|
|
175
175
|
|
|
176
176
|
:global([dir='rtl']) .directional {
|
|
177
177
|
transform: scaleX(-1);
|
|
178
|
-
}</style>
|
|
178
|
+
}</style>
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
3
|
<script lang="ts">import { Size } from "../Types/Internal/Size.js";
|
|
4
4
|
import Icon from "./Icon.svelte";
|
|
5
5
|
const { children, header, iconName = "circle-information" } = $props();
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<!--
|
|
9
|
-
Small, inline informational banner on the Info (brand-blue) palette so it
|
|
10
|
-
reads as "helper text" rather than "error". An optional bold `header`
|
|
11
|
-
sits above the body; the body is a snippet so callers can inline links or
|
|
12
|
-
emphasis without the component prescribing a content shape.
|
|
13
|
-
-->
|
|
14
|
-
<div
|
|
15
|
-
class="info-alert"
|
|
16
|
-
class:has-header={header}
|
|
17
|
-
role="status"
|
|
18
|
-
>
|
|
19
|
-
<div class="icon">
|
|
20
|
-
<Icon
|
|
21
|
-
name={iconName}
|
|
22
|
-
size={Size.Medium}
|
|
23
|
-
/>
|
|
24
|
-
</div>
|
|
25
|
-
<div class="content">
|
|
26
|
-
{#if header}
|
|
27
|
-
<p class="header">{header}</p>
|
|
28
|
-
{/if}
|
|
29
|
-
<div class="body">
|
|
30
|
-
{@render children()}
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<!--
|
|
9
|
+
Small, inline informational banner on the Info (brand-blue) palette so it
|
|
10
|
+
reads as "helper text" rather than "error". An optional bold `header`
|
|
11
|
+
sits above the body; the body is a snippet so callers can inline links or
|
|
12
|
+
emphasis without the component prescribing a content shape.
|
|
13
|
+
-->
|
|
14
|
+
<div
|
|
15
|
+
class="info-alert"
|
|
16
|
+
class:has-header={header}
|
|
17
|
+
role="status"
|
|
18
|
+
>
|
|
19
|
+
<div class="icon">
|
|
20
|
+
<Icon
|
|
21
|
+
name={iconName}
|
|
22
|
+
size={Size.Medium}
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="content">
|
|
26
|
+
{#if header}
|
|
27
|
+
<p class="header">{header}</p>
|
|
28
|
+
{/if}
|
|
29
|
+
<div class="body">
|
|
30
|
+
{@render children()}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
35
|
<style>.info-alert {
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-flow: row nowrap;
|
|
@@ -76,4 +76,4 @@ const { children, header, iconName = "circle-information" } = $props();
|
|
|
76
76
|
font-size: 0.8125rem;
|
|
77
77
|
line-height: 1.4;
|
|
78
78
|
color: #647d8e;
|
|
79
|
-
}</style>
|
|
79
|
+
}</style>
|