@communitiesuk/svelte-component-library 0.1.17
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 +188 -0
- package/dist/assets/css/govuk-frontend.min.css +2 -0
- package/dist/assets/css/govuk-frontend.min.css.map +1 -0
- package/dist/assets/fonts/bold-affa96571d-v2.woff +0 -0
- package/dist/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
- package/dist/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
- package/dist/assets/fonts/light-f591b13f7d-v2.woff +0 -0
- package/dist/assets/govuk_publishing_components/images/icon-autocomplete-search-suggestion.svg +4 -0
- package/dist/assets/govuk_publishing_components/images/icon-close.svg +1 -0
- package/dist/assets/images/favicon.ico +0 -0
- package/dist/assets/images/favicon.svg +1 -0
- package/dist/assets/images/govuk-crest-2x.png +0 -0
- package/dist/assets/images/govuk-crest.png +0 -0
- package/dist/assets/images/govuk-crest.svg +1 -0
- package/dist/assets/images/govuk-icon-180.png +0 -0
- package/dist/assets/images/govuk-icon-192.png +0 -0
- package/dist/assets/images/govuk-icon-512.png +0 -0
- package/dist/assets/images/govuk-icon-mask.svg +1 -0
- package/dist/assets/images/govuk-opengraph-image.png +0 -0
- package/dist/assets/images/homepage-illustration.svg +1 -0
- package/dist/assets/images/homepage.svg +44 -0
- package/dist/assets/images/masthead-illustration.svg +123 -0
- package/dist/assets/images/oflog_crest_black.png +0 -0
- package/dist/assets/images/oflog_crest_white.png +0 -0
- package/dist/assets/images/undraw_approved-wireframe_odf4.svg +1 -0
- package/dist/assets/images/undraw_collaborators_rgw4.svg +1 -0
- package/dist/assets/images/undraw_content-creator_vuqg.svg +1 -0
- package/dist/assets/images/undraw_online-media_opxh.svg +1 -0
- package/dist/assets/images/undraw_pull-request_zlsu.svg +1 -0
- package/dist/assets/images/undraw_reviewed-docs_g0cg.svg +1 -0
- package/dist/components/FilterPanel/codeBlocks.d.ts +3 -0
- package/dist/components/FilterPanel/codeBlocks.js +418 -0
- package/dist/components/content/InsetText.svelte +21 -0
- package/dist/components/content/InsetText.svelte.d.ts +7 -0
- package/dist/components/content/WarningText.svelte +27 -0
- package/dist/components/content/WarningText.svelte.d.ts +8 -0
- package/dist/components/data-vis/axis/Axis.svelte +51 -0
- package/dist/components/data-vis/axis/Axis.svelte.d.ts +33 -0
- package/dist/components/data-vis/axis/Ticks.svelte +113 -0
- package/dist/components/data-vis/axis/Ticks.svelte.d.ts +33 -0
- package/dist/components/data-vis/line-chart/Line.svelte +150 -0
- package/dist/components/data-vis/line-chart/Line.svelte.d.ts +85 -0
- package/dist/components/data-vis/line-chart/LineChart.svelte +249 -0
- package/dist/components/data-vis/line-chart/LineChart.svelte.d.ts +73 -0
- package/dist/components/data-vis/line-chart/Lines.svelte +138 -0
- package/dist/components/data-vis/line-chart/Lines.svelte.d.ts +57 -0
- package/dist/components/data-vis/line-chart/Marker.svelte +61 -0
- package/dist/components/data-vis/line-chart/Marker.svelte.d.ts +37 -0
- package/dist/components/data-vis/line-chart/SeriesLabel.svelte +67 -0
- package/dist/components/data-vis/line-chart/SeriesLabel.svelte.d.ts +43 -0
- package/dist/components/data-vis/line-chart/ValueLabel.svelte +50 -0
- package/dist/components/data-vis/line-chart/ValueLabel.svelte.d.ts +25 -0
- package/dist/components/data-vis/map/Map.svelte +392 -0
- package/dist/components/data-vis/map/Map.svelte.d.ts +47 -0
- package/dist/components/data-vis/map/MapLegend.svelte +41 -0
- package/dist/components/data-vis/map/MapLegend.svelte.d.ts +15 -0
- package/dist/components/data-vis/map/NonStandardControls.svelte +42 -0
- package/dist/components/data-vis/map/NonStandardControls.svelte.d.ts +13 -0
- package/dist/components/data-vis/map/Tooltip.svelte +41 -0
- package/dist/components/data-vis/map/Tooltip.svelte.d.ts +19 -0
- package/dist/components/data-vis/map/colorbrewer.d.ts +337 -0
- package/dist/components/data-vis/map/colorbrewer.js +1523 -0
- package/dist/components/data-vis/map/colors.d.ts +13 -0
- package/dist/components/data-vis/map/colors.js +65 -0
- package/dist/components/data-vis/map/dataJoin.d.ts +2 -0
- package/dist/components/data-vis/map/dataJoin.js +27 -0
- package/dist/components/data-vis/map/fullTopo.json +1 -0
- package/dist/components/data-vis/map/jenks.d.ts +1 -0
- package/dist/components/data-vis/map/jenks.js +51 -0
- package/dist/components/data-vis/map/lad2023.json +1 -0
- package/dist/components/data-vis/map/mapUtils.d.ts +5 -0
- package/dist/components/data-vis/map/mapUtils.js +86 -0
- package/dist/components/data-vis/map/topo.json +1 -0
- package/dist/components/data-vis/table/Table.svelte +247 -0
- package/dist/components/data-vis/table/Table.svelte.d.ts +19 -0
- package/dist/components/layout/Breadcrumbs.svelte +191 -0
- package/dist/components/layout/Breadcrumbs.svelte.d.ts +24 -0
- package/dist/components/layout/Footer.svelte +171 -0
- package/dist/components/layout/Footer.svelte.d.ts +30 -0
- package/dist/components/layout/Header.svelte +43 -0
- package/dist/components/layout/Header.svelte.d.ts +7 -0
- package/dist/components/layout/InternalHeader.svelte +628 -0
- package/dist/components/layout/InternalHeader.svelte.d.ts +15 -0
- package/dist/components/layout/PhaseBanner.svelte +28 -0
- package/dist/components/layout/PhaseBanner.svelte.d.ts +9 -0
- package/dist/components/layout/ServiceNavigation.svelte +143 -0
- package/dist/components/layout/ServiceNavigation.svelte.d.ts +13 -0
- package/dist/components/layout/SideNavigation.svelte +345 -0
- package/dist/components/layout/SideNavigation.svelte.d.ts +25 -0
- package/dist/components/layout/service-navigation-nested-mobile/HeaderNav.svelte +91 -0
- package/dist/components/layout/service-navigation-nested-mobile/HeaderNav.svelte.d.ts +15 -0
- package/dist/components/layout/service-navigation-nested-mobile/MobileNav.svelte +233 -0
- package/dist/components/layout/service-navigation-nested-mobile/MobileNav.svelte.d.ts +27 -0
- package/dist/components/layout/service-navigation-nested-mobile/ServiceNavigationNestedMobile.svelte +70 -0
- package/dist/components/layout/service-navigation-nested-mobile/ServiceNavigationNestedMobile.svelte.d.ts +11 -0
- package/dist/components/layout/service-navigation-nested-mobile/SideNav.svelte +276 -0
- package/dist/components/layout/service-navigation-nested-mobile/SideNav.svelte.d.ts +22 -0
- package/dist/components/ui/Accordion.svelte +244 -0
- package/dist/components/ui/Accordion.svelte.d.ts +23 -0
- package/dist/components/ui/Breadcrumbs.svelte +198 -0
- package/dist/components/ui/Breadcrumbs.svelte.d.ts +24 -0
- package/dist/components/ui/Button.svelte +96 -0
- package/dist/components/ui/Button.svelte.d.ts +17 -0
- package/dist/components/ui/CheckBox.svelte +198 -0
- package/dist/components/ui/CheckBox.svelte.d.ts +27 -0
- package/dist/components/ui/ContentsList.svelte +1117 -0
- package/dist/components/ui/ContentsList.svelte.d.ts +25 -0
- package/dist/components/ui/DateInput.svelte +255 -0
- package/dist/components/ui/DateInput.svelte.d.ts +59 -0
- package/dist/components/ui/Details.svelte +12 -0
- package/dist/components/ui/Details.svelte.d.ts +13 -0
- package/dist/components/ui/FilterPanel.svelte +588 -0
- package/dist/components/ui/FilterPanel.svelte.d.ts +74 -0
- package/dist/components/ui/Footer.svelte +171 -0
- package/dist/components/ui/Footer.svelte.d.ts +30 -0
- package/dist/components/ui/Header.svelte +43 -0
- package/dist/components/ui/Header.svelte.d.ts +7 -0
- package/dist/components/ui/Masthead.svelte +267 -0
- package/dist/components/ui/Masthead.svelte.d.ts +12 -0
- package/dist/components/ui/NavigationExample.svelte +117 -0
- package/dist/components/ui/NavigationExample.svelte.d.ts +3 -0
- package/dist/components/ui/NotificationBanner.svelte +93 -0
- package/dist/components/ui/NotificationBanner.svelte.d.ts +15 -0
- package/dist/components/ui/Radios.svelte +176 -0
- package/dist/components/ui/Radios.svelte.d.ts +28 -0
- package/dist/components/ui/RelatedContent.svelte +596 -0
- package/dist/components/ui/RelatedContent.svelte.d.ts +29 -0
- package/dist/components/ui/Search.svelte +499 -0
- package/dist/components/ui/Search.svelte.d.ts +32 -0
- package/dist/components/ui/SearchAutocomplete.svelte +655 -0
- package/dist/components/ui/SearchAutocomplete.svelte.d.ts +37 -0
- package/dist/components/ui/Select.svelte +116 -0
- package/dist/components/ui/Select.svelte.d.ts +22 -0
- package/dist/components/ui/ServiceNavigation.svelte +143 -0
- package/dist/components/ui/ServiceNavigation.svelte.d.ts +13 -0
- package/dist/components/ui/SideNavigation.svelte +346 -0
- package/dist/components/ui/SideNavigation.svelte.d.ts +25 -0
- package/dist/components/ui/Tabs.svelte +306 -0
- package/dist/components/ui/Tabs.svelte.d.ts +18 -0
- package/dist/components/ui/WhatsNew.svelte +155 -0
- package/dist/components/ui/WhatsNew.svelte.d.ts +29 -0
- package/dist/config.d.ts +51 -0
- package/dist/config.js +44 -0
- package/dist/icons/DoubleChevronButton.svelte +62 -0
- package/dist/icons/DoubleChevronButton.svelte.d.ts +13 -0
- package/dist/icons/IconSearch.svelte +42 -0
- package/dist/icons/IconSearch.svelte.d.ts +6 -0
- package/dist/icons/SingleChevronButtonWithLabel.svelte +132 -0
- package/dist/icons/SingleChevronButtonWithLabel.svelte.d.ts +19 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +45 -0
- package/dist/main.css +1 -0
- package/dist/package-wrapping/BaseInformation.svelte +82 -0
- package/dist/package-wrapping/BaseInformation.svelte.d.ts +15 -0
- package/dist/package-wrapping/BaseNameAndStatus.svelte +108 -0
- package/dist/package-wrapping/BaseNameAndStatus.svelte.d.ts +10 -0
- package/dist/package-wrapping/CodeBlock.svelte +62 -0
- package/dist/package-wrapping/CodeBlock.svelte.d.ts +12 -0
- package/dist/package-wrapping/ComponentDemo.svelte +114 -0
- package/dist/package-wrapping/ComponentDemo.svelte.d.ts +25 -0
- package/dist/package-wrapping/ComponentDemoTEMP.svelte +305 -0
- package/dist/package-wrapping/ComponentDemoTEMP.svelte.d.ts +21 -0
- package/dist/package-wrapping/ComponentDetails.svelte +123 -0
- package/dist/package-wrapping/ComponentDetails.svelte.d.ts +13 -0
- package/dist/package-wrapping/DividerLine.svelte +21 -0
- package/dist/package-wrapping/DividerLine.svelte.d.ts +17 -0
- package/dist/package-wrapping/InputForParameter.svelte +205 -0
- package/dist/package-wrapping/InputForParameter.svelte.d.ts +13 -0
- package/dist/package-wrapping/InputForParameterUpdated.svelte +222 -0
- package/dist/package-wrapping/InputForParameterUpdated.svelte.d.ts +17 -0
- package/dist/package-wrapping/InputForParameterUpdatedTEMP.svelte +203 -0
- package/dist/package-wrapping/InputForParameterUpdatedTEMP.svelte.d.ts +17 -0
- package/dist/package-wrapping/ListOfComponentStatuses.svelte +19 -0
- package/dist/package-wrapping/ListOfComponentStatuses.svelte.d.ts +11 -0
- package/dist/package-wrapping/OverlayAndComponentContainer.svelte +426 -0
- package/dist/package-wrapping/OverlayAndComponentContainer.svelte.d.ts +33 -0
- package/dist/package-wrapping/ParametersSection.svelte +235 -0
- package/dist/package-wrapping/ParametersSection.svelte.d.ts +19 -0
- package/dist/package-wrapping/ParsingErrorToastsContainer.svelte +50 -0
- package/dist/package-wrapping/ParsingErrorToastsContainer.svelte.d.ts +15 -0
- package/dist/package-wrapping/Pill.svelte +54 -0
- package/dist/package-wrapping/Pill.svelte.d.ts +25 -0
- package/dist/package-wrapping/PlaygroundDetails.svelte +106 -0
- package/dist/package-wrapping/PlaygroundDetails.svelte.d.ts +13 -0
- package/dist/package-wrapping/ScreenSizeRadio.svelte +24 -0
- package/dist/package-wrapping/ScreenSizeRadio.svelte.d.ts +11 -0
- package/dist/package-wrapping/ScreenSizeRadioUpdated.svelte +23 -0
- package/dist/package-wrapping/ScreenSizeRadioUpdated.svelte.d.ts +11 -0
- package/dist/package-wrapping/SidebarContainer.svelte +103 -0
- package/dist/package-wrapping/SidebarContainer.svelte.d.ts +23 -0
- package/dist/package-wrapping/WrapperDetailsUpdate.svelte +40 -0
- package/dist/package-wrapping/WrapperDetailsUpdate.svelte.d.ts +15 -0
- package/dist/package-wrapping/templates/Template.svelte +100 -0
- package/dist/package-wrapping/templates/Template.svelte.d.ts +25 -0
- package/dist/templates/ComponentPageTemplate.svelte +1 -0
- package/dist/templates/ComponentPageTemplate.svelte.d.ts +26 -0
- package/dist/utils/data-transformations/convertCSV.d.ts +2 -0
- package/dist/utils/data-transformations/convertCSV.js +22 -0
- package/dist/utils/data-transformations/getValueFromParametersArray.d.ts +1 -0
- package/dist/utils/data-transformations/getValueFromParametersArray.js +9 -0
- package/dist/utils/layoutNavHelpers.d.ts +70 -0
- package/dist/utils/layoutNavHelpers.js +129 -0
- package/dist/utils/package-wrapping-specific/addIndexAndInitialValue.d.ts +1 -0
- package/dist/utils/package-wrapping-specific/addIndexAndInitialValue.js +21 -0
- package/dist/utils/package-wrapping-specific/createBindableParametersValuesArray.d.ts +1 -0
- package/dist/utils/package-wrapping-specific/createBindableParametersValuesArray.js +12 -0
- package/dist/utils/package-wrapping-specific/createParametersObject.d.ts +1 -0
- package/dist/utils/package-wrapping-specific/createParametersObject.js +29 -0
- package/dist/utils/package-wrapping-specific/defineDefaultEventHandler.d.ts +1 -0
- package/dist/utils/package-wrapping-specific/defineDefaultEventHandler.js +14 -0
- package/dist/utils/package-wrapping-specific/trackVisibleParameters.d.ts +1 -0
- package/dist/utils/package-wrapping-specific/trackVisibleParameters.js +29 -0
- package/dist/utils/syntax-highlighting/shikiHighlight.d.ts +7 -0
- package/dist/utils/syntax-highlighting/shikiHighlight.js +76 -0
- package/dist/utils/text-string-conversion/textStringConversion.d.ts +9 -0
- package/dist/utils/text-string-conversion/textStringConversion.js +86 -0
- package/package.json +113 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import SidebarContainer from "./SidebarContainer.svelte";
|
|
3
|
+
import OverlayAndComponentContainer from "./OverlayAndComponentContainer.svelte";
|
|
4
|
+
import { Tooltip, Button } from "flowbite-svelte";
|
|
5
|
+
|
|
6
|
+
/* incoming props from wrapper page --------------------------- */
|
|
7
|
+
let {
|
|
8
|
+
Component,
|
|
9
|
+
demoScreenWidth = $bindable(),
|
|
10
|
+
parametersSourceArray,
|
|
11
|
+
statedParametersValuesArray = $bindable(),
|
|
12
|
+
derivedParametersValuesArray,
|
|
13
|
+
parametersVisibleArray,
|
|
14
|
+
parametersParsingErrorsObject,
|
|
15
|
+
copyParametersToClipboardObject,
|
|
16
|
+
} = $props();
|
|
17
|
+
|
|
18
|
+
/* derive categories for the sidebar / overlay ---------------- */
|
|
19
|
+
let parameterCategories = $derived(
|
|
20
|
+
[
|
|
21
|
+
...new Set(
|
|
22
|
+
parametersSourceArray
|
|
23
|
+
.filter((_, i) => parametersVisibleArray[i])
|
|
24
|
+
.map((el) => el.category),
|
|
25
|
+
),
|
|
26
|
+
].map((name) => ({ name, value: name })),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
let categoriesOverlayOpenArray = $state(parameterCategories.map(() => false));
|
|
30
|
+
let selectedCategory = $derived(
|
|
31
|
+
categoriesOverlayOpenArray.findIndex((v) => v),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
/* UI state ---------------------------------------------------- */
|
|
35
|
+
let sideBarOpen = $state(true);
|
|
36
|
+
let overlayOpen = $state(false);
|
|
37
|
+
let componentOpacity = $state(0.1);
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<!-- ===== COMPONENT DEMO ======================================= -->
|
|
41
|
+
<div data-role="component-demo-container" class="flex flex-col gap-2">
|
|
42
|
+
<!-- header with copy button -->
|
|
43
|
+
<div class="flex flex-row justify-between mb-6 mt-12">
|
|
44
|
+
<h5 id="component-demo" class="underline underline-offset-4">
|
|
45
|
+
Component Demo
|
|
46
|
+
</h5>
|
|
47
|
+
|
|
48
|
+
<div>
|
|
49
|
+
<Button
|
|
50
|
+
onclick={() =>
|
|
51
|
+
navigator.clipboard.writeText(
|
|
52
|
+
JSON.stringify(copyParametersToClipboardObject, null, 2),
|
|
53
|
+
)}
|
|
54
|
+
color="alternative"
|
|
55
|
+
id="copy-props-btn"
|
|
56
|
+
class="m-0 p-1.5 border-none"
|
|
57
|
+
>
|
|
58
|
+
<!-- simple copy icon -->
|
|
59
|
+
<svg width="25" height="30">
|
|
60
|
+
{#each [{ x: 8, stroke: "#6b7280", strokeWidth: "1.5" }, { x: 1, stroke: "white", strokeWidth: "3" }, { x: 1, stroke: "#6b7280", strokeWidth: "1.5" }] as rect}
|
|
61
|
+
<rect
|
|
62
|
+
x={rect.x}
|
|
63
|
+
y={rect.x === 8 ? 2 : 8}
|
|
64
|
+
width="16"
|
|
65
|
+
height="20"
|
|
66
|
+
rx="2"
|
|
67
|
+
stroke={rect.stroke}
|
|
68
|
+
stroke-width={rect.strokeWidth}
|
|
69
|
+
fill="white"
|
|
70
|
+
></rect>
|
|
71
|
+
{/each}
|
|
72
|
+
</svg>
|
|
73
|
+
</Button>
|
|
74
|
+
<Tooltip trigger="click" triggeredBy="#copy-props-btn">
|
|
75
|
+
Props copied to clipboard
|
|
76
|
+
</Tooltip>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<!-- sidebar + component stack -->
|
|
81
|
+
<!-- sidebar -->
|
|
82
|
+
<div class="w-full">
|
|
83
|
+
<SidebarContainer
|
|
84
|
+
bind:demoScreenWidth
|
|
85
|
+
{parameterCategories}
|
|
86
|
+
bind:categoriesOverlayOpenArray
|
|
87
|
+
{selectedCategory}
|
|
88
|
+
bind:sideBarOpen
|
|
89
|
+
bind:overlayOpen
|
|
90
|
+
bind:componentOpacity
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<!-- component & overlay -->
|
|
95
|
+
<div class="flex-1 min-w-0">
|
|
96
|
+
<OverlayAndComponentContainer
|
|
97
|
+
{Component}
|
|
98
|
+
{demoScreenWidth}
|
|
99
|
+
{parametersSourceArray}
|
|
100
|
+
bind:statedParametersValuesArray
|
|
101
|
+
{derivedParametersValuesArray}
|
|
102
|
+
{parametersVisibleArray}
|
|
103
|
+
{parametersParsingErrorsObject}
|
|
104
|
+
{parameterCategories}
|
|
105
|
+
bind:categoriesOverlayOpenArray
|
|
106
|
+
{selectedCategory}
|
|
107
|
+
bind:overlayOpen
|
|
108
|
+
{componentOpacity}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<style>
|
|
114
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default ComponentDemo;
|
|
2
|
+
type ComponentDemo = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const ComponentDemo: import("svelte").Component<{
|
|
7
|
+
Component: any;
|
|
8
|
+
demoScreenWidth?: any;
|
|
9
|
+
parametersSourceArray: any;
|
|
10
|
+
statedParametersValuesArray?: any;
|
|
11
|
+
derivedParametersValuesArray: any;
|
|
12
|
+
parametersVisibleArray: any;
|
|
13
|
+
parametersParsingErrorsObject: any;
|
|
14
|
+
copyParametersToClipboardObject: any;
|
|
15
|
+
}, {}, "demoScreenWidth" | "statedParametersValuesArray">;
|
|
16
|
+
type $$ComponentProps = {
|
|
17
|
+
Component: any;
|
|
18
|
+
demoScreenWidth?: any;
|
|
19
|
+
parametersSourceArray: any;
|
|
20
|
+
statedParametersValuesArray?: any;
|
|
21
|
+
derivedParametersValuesArray: any;
|
|
22
|
+
parametersVisibleArray: any;
|
|
23
|
+
parametersParsingErrorsObject: any;
|
|
24
|
+
copyParametersToClipboardObject: any;
|
|
25
|
+
};
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import DividerLine from "./DividerLine.svelte";
|
|
3
|
+
import DoubleChevronButton from "../icons/DoubleChevronButton.svelte";
|
|
4
|
+
import SingleChevronButtonWithLabel from "../icons/SingleChevronButtonWithLabel.svelte";
|
|
5
|
+
import { Tabs, TabItem, Range, Label } from "flowbite-svelte";
|
|
6
|
+
import InputForParameterUpdated from "./InputForParameterUpdated.svelte";
|
|
7
|
+
import ScreenSizeRadioUpdated from "./ScreenSizeRadioUpdated.svelte";
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
Component,
|
|
11
|
+
parametersSourceArray,
|
|
12
|
+
parametersVisibleArray,
|
|
13
|
+
bindingsParametersValuesArray,
|
|
14
|
+
parametersValuesArray = $bindable(),
|
|
15
|
+
demoScreenWidth = $bindable(),
|
|
16
|
+
} = $props();
|
|
17
|
+
|
|
18
|
+
let parameterCategories = $derived(
|
|
19
|
+
[...new Set(parametersSourceArray.map((el) => el.category))].map((el) => ({
|
|
20
|
+
name: el,
|
|
21
|
+
value: el,
|
|
22
|
+
})),
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
let categoriesOverlayOpenArray = $state([]);
|
|
26
|
+
|
|
27
|
+
$effect(() => {
|
|
28
|
+
categoriesOverlayOpenArray = parameterCategories.map((el) => false);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
let selectedCategory = $derived(
|
|
32
|
+
categoriesOverlayOpenArray.findIndex((el) => el),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
let sideBarOpen = $state(true);
|
|
36
|
+
let overlayOpen = $state(false);
|
|
37
|
+
|
|
38
|
+
let componentOpacity = $state(0.1);
|
|
39
|
+
|
|
40
|
+
let componentWidth = $state();
|
|
41
|
+
let componentHeight = $state();
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<div
|
|
45
|
+
data-role="component-demo-container"
|
|
46
|
+
class="flex flew-row xl:justify-center xl:mx-0 justify-start mx-5"
|
|
47
|
+
>
|
|
48
|
+
<div class="w-[1378px]">
|
|
49
|
+
<h5 class="mb-6 mt-12 underline underline-offset-4">Component Demo</h5>
|
|
50
|
+
<div class="flex flex-row gap-2">
|
|
51
|
+
<div>
|
|
52
|
+
{#if sideBarOpen}
|
|
53
|
+
<div data-role="sidebar-container" class="px-1 pt-0 pb-2">
|
|
54
|
+
<Tabs tabStyle="underline">
|
|
55
|
+
<div
|
|
56
|
+
class="flex flex-row justify-between items-center w-full pr-1"
|
|
57
|
+
>
|
|
58
|
+
<div class="flex flex-row gap-2">
|
|
59
|
+
<TabItem
|
|
60
|
+
open={true}
|
|
61
|
+
title={"Parameters"}
|
|
62
|
+
defaultClass="text-lg"
|
|
63
|
+
>
|
|
64
|
+
<div class="flex flex-col gap-0 m-0 p-0">
|
|
65
|
+
{#each parameterCategories as category, index}
|
|
66
|
+
<button>
|
|
67
|
+
<div
|
|
68
|
+
class="flex flex-row gap-0 justify-start items-center"
|
|
69
|
+
>
|
|
70
|
+
<SingleChevronButtonWithLabel
|
|
71
|
+
text={category.name}
|
|
72
|
+
{index}
|
|
73
|
+
bind:openArray={categoriesOverlayOpenArray}
|
|
74
|
+
bind:overlayOpen
|
|
75
|
+
open={categoriesOverlayOpenArray[index] &&
|
|
76
|
+
overlayOpen}
|
|
77
|
+
></SingleChevronButtonWithLabel>
|
|
78
|
+
</div>
|
|
79
|
+
</button>
|
|
80
|
+
{/each}
|
|
81
|
+
</div>
|
|
82
|
+
</TabItem>
|
|
83
|
+
<TabItem
|
|
84
|
+
open={false}
|
|
85
|
+
title={"Container width"}
|
|
86
|
+
defaultClass="text-lg"
|
|
87
|
+
><ScreenSizeRadioUpdated bind:demoScreenWidth
|
|
88
|
+
></ScreenSizeRadioUpdated>
|
|
89
|
+
</TabItem>
|
|
90
|
+
</div>
|
|
91
|
+
<DoubleChevronButton
|
|
92
|
+
bind:open={sideBarOpen}
|
|
93
|
+
onClickFunction={() => {
|
|
94
|
+
sideBarOpen = !sideBarOpen;
|
|
95
|
+
}}
|
|
96
|
+
></DoubleChevronButton>
|
|
97
|
+
</div>
|
|
98
|
+
</Tabs>
|
|
99
|
+
{#if overlayOpen && selectedCategory > -1}
|
|
100
|
+
<DividerLine margin="10px 0px"></DividerLine>
|
|
101
|
+
<div class="ml-2 mr-4 flex flex-row gap-4 items-center">
|
|
102
|
+
<Label class="text-lg text-[#6b7280]">Component opacity:</Label>
|
|
103
|
+
<div class="grow">
|
|
104
|
+
<Range
|
|
105
|
+
class="orange-500"
|
|
106
|
+
id="range1"
|
|
107
|
+
bind:value={componentOpacity}
|
|
108
|
+
min="0"
|
|
109
|
+
max="0.5"
|
|
110
|
+
step="0.1"
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
{/if}
|
|
115
|
+
</div>
|
|
116
|
+
{:else}
|
|
117
|
+
<div class="mt-2 inline-block">
|
|
118
|
+
<div
|
|
119
|
+
data-role="sidebar-floating-button"
|
|
120
|
+
class="flex flex-row items-center justify-center p-2"
|
|
121
|
+
>
|
|
122
|
+
<DoubleChevronButton
|
|
123
|
+
bind:open={sideBarOpen}
|
|
124
|
+
onClickFunction={() => {
|
|
125
|
+
sideBarOpen = !sideBarOpen;
|
|
126
|
+
}}
|
|
127
|
+
></DoubleChevronButton>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
{/if}
|
|
131
|
+
</div>
|
|
132
|
+
<div data-role="component-and-overlay-container">
|
|
133
|
+
{#if overlayOpen && selectedCategory > -1}
|
|
134
|
+
<div
|
|
135
|
+
data-role="overlay-container"
|
|
136
|
+
class="absolute z-[2] p-0 m-0 overflow-scroll"
|
|
137
|
+
style="width: {componentWidth +
|
|
138
|
+
2}px; min-width: 768px; height: {componentHeight}px;"
|
|
139
|
+
>
|
|
140
|
+
<div class="p-5 flex flex-row justify-between bg-white">
|
|
141
|
+
<h6 class="underline underline-offset-4">
|
|
142
|
+
{parameterCategories.find((el, i) => i === selectedCategory)
|
|
143
|
+
.name}
|
|
144
|
+
</h6>
|
|
145
|
+
<DoubleChevronButton
|
|
146
|
+
bind:open={overlayOpen}
|
|
147
|
+
onClickFunction={() => {
|
|
148
|
+
overlayOpen = !overlayOpen;
|
|
149
|
+
if (!overlayOpen) {
|
|
150
|
+
categoriesOverlayOpenArray = categoriesOverlayOpenArray.map(
|
|
151
|
+
(el) => false,
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
}}
|
|
155
|
+
></DoubleChevronButton>
|
|
156
|
+
</div>
|
|
157
|
+
<DividerLine></DividerLine>
|
|
158
|
+
<div data-role="grid-container" class="m-2 p-5 text-base">
|
|
159
|
+
<div data-role="item" class="font-bold">Parameter</div>
|
|
160
|
+
<div data-role="item" class="font-bold">Value</div>
|
|
161
|
+
<div data-role="item" class="font-bold">Description</div>
|
|
162
|
+
{#each parametersSourceArray as parameter}
|
|
163
|
+
{#if parameter.category === parameterCategories[selectedCategory]?.name && parametersVisibleArray[parameter.index]}
|
|
164
|
+
<div class="col-span-full">
|
|
165
|
+
<DividerLine></DividerLine>
|
|
166
|
+
</div>
|
|
167
|
+
<div
|
|
168
|
+
data-role="item"
|
|
169
|
+
data-width={demoScreenWidth < 1024
|
|
170
|
+
? "col1Sm"
|
|
171
|
+
: demoScreenWidth < 1280
|
|
172
|
+
? "col1Md"
|
|
173
|
+
: "col1Lg"}
|
|
174
|
+
class="m-1 hyphens-auto break-words"
|
|
175
|
+
>
|
|
176
|
+
{parameter.name}
|
|
177
|
+
</div>
|
|
178
|
+
<div
|
|
179
|
+
data-role="item"
|
|
180
|
+
data-width={demoScreenWidth < 1024
|
|
181
|
+
? "col2Sm"
|
|
182
|
+
: demoScreenWidth < 1280
|
|
183
|
+
? "col2Md"
|
|
184
|
+
: "col2Lg"}
|
|
185
|
+
>
|
|
186
|
+
<InputForParameterUpdated
|
|
187
|
+
{parameter}
|
|
188
|
+
bind:value={parametersValuesArray[parameter.index]}
|
|
189
|
+
boundedValue={bindingsParametersValuesArray[
|
|
190
|
+
parameter.index
|
|
191
|
+
]}
|
|
192
|
+
{demoScreenWidth}
|
|
193
|
+
></InputForParameterUpdated>
|
|
194
|
+
</div>
|
|
195
|
+
<div data-role="item" class="m-1 hyphens-auto break-words">
|
|
196
|
+
{#if typeof parameter.description === "string"}
|
|
197
|
+
{parameter.description}
|
|
198
|
+
{:else if typeof parameter.description === "object"}
|
|
199
|
+
{#each parameter.description.arr as line}
|
|
200
|
+
<p>
|
|
201
|
+
{#if parameter.description.markdown}
|
|
202
|
+
{@html line}
|
|
203
|
+
{:else}
|
|
204
|
+
{line}
|
|
205
|
+
{/if}
|
|
206
|
+
</p>
|
|
207
|
+
{/each}
|
|
208
|
+
{:else if typeof parameter.description === "function"}
|
|
209
|
+
{@render parameter.description()}
|
|
210
|
+
{:else}
|
|
211
|
+
-
|
|
212
|
+
{/if}
|
|
213
|
+
</div>
|
|
214
|
+
{/if}
|
|
215
|
+
{/each}
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
{/if}
|
|
219
|
+
<div
|
|
220
|
+
data-role="component-container-centered"
|
|
221
|
+
class="px-0 py-5 rounded-md {overlayOpen
|
|
222
|
+
? ''
|
|
223
|
+
: 'border border-solid border-[#d1d5db]}'}"
|
|
224
|
+
style="width: {demoScreenWidth}px;"
|
|
225
|
+
>
|
|
226
|
+
<div
|
|
227
|
+
class="z-[1]"
|
|
228
|
+
style="z-index: 1; min-height: 600px; opacity: {overlayOpen
|
|
229
|
+
? componentOpacity
|
|
230
|
+
: 1};"
|
|
231
|
+
bind:clientWidth={componentWidth}
|
|
232
|
+
bind:clientHeight={componentHeight}
|
|
233
|
+
>
|
|
234
|
+
{@render Component()}
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
<style>
|
|
243
|
+
[data-role="sidebar-container"] {
|
|
244
|
+
width: 346px;
|
|
245
|
+
border: solid #d1d5db 1px;
|
|
246
|
+
border-radius: 5px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
[data-role="sidebar-floating-button"] {
|
|
250
|
+
border: solid #d1d5db 1px;
|
|
251
|
+
border-radius: 5px;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
[data-role="component-and-overlay-container"] {
|
|
255
|
+
display: inline-block;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
[data-role="overlay-container"] {
|
|
259
|
+
border: solid #d1d5db 1px;
|
|
260
|
+
border-radius: 5px;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
[data-role="grid-container"] {
|
|
264
|
+
display: grid;
|
|
265
|
+
grid-template-columns: auto auto 1fr;
|
|
266
|
+
gap: 20px;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
[data-role="item"] {
|
|
270
|
+
color: #6b7280;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
[data-role="item"] p:first-of-type {
|
|
274
|
+
margin-top: 0px;
|
|
275
|
+
padding-top: 0px;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
[data-role="item"] p:last-of-type {
|
|
279
|
+
margin-bottom: 0px;
|
|
280
|
+
padding-bottom: 0px;
|
|
281
|
+
}
|
|
282
|
+
[data-width="col1Sm"] {
|
|
283
|
+
max-width: 125px;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
[data-width="col1Md"] {
|
|
287
|
+
max-width: 175px;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
[data-width="col1Lg"] {
|
|
291
|
+
max-width: 225px;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
[data-width="col2Sm"] {
|
|
295
|
+
max-width: 350px;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
[data-width="col2Md"] {
|
|
299
|
+
max-width: 450px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
[data-width="col2Lg"] {
|
|
303
|
+
max-width: 550px;
|
|
304
|
+
}
|
|
305
|
+
</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default ComponentDemoTemp;
|
|
2
|
+
type ComponentDemoTemp = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const ComponentDemoTemp: import("svelte").Component<{
|
|
7
|
+
Component: any;
|
|
8
|
+
parametersSourceArray: any;
|
|
9
|
+
parametersVisibleArray: any;
|
|
10
|
+
bindingsParametersValuesArray: any;
|
|
11
|
+
parametersValuesArray?: any;
|
|
12
|
+
demoScreenWidth?: any;
|
|
13
|
+
}, {}, "demoScreenWidth" | "parametersValuesArray">;
|
|
14
|
+
type $$ComponentProps = {
|
|
15
|
+
Component: any;
|
|
16
|
+
parametersSourceArray: any;
|
|
17
|
+
parametersVisibleArray: any;
|
|
18
|
+
bindingsParametersValuesArray: any;
|
|
19
|
+
parametersValuesArray?: any;
|
|
20
|
+
demoScreenWidth?: any;
|
|
21
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import Pill from "./Pill.svelte";
|
|
4
|
+
import DividerLine from "./DividerLine.svelte";
|
|
5
|
+
|
|
6
|
+
import { componentStausLookup } from "../config.js";
|
|
7
|
+
import { textStringConversion } from "../utils/text-string-conversion/textStringConversion.js";
|
|
8
|
+
|
|
9
|
+
let { homepage, details } = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
{#snippet linkedNameOfComponent(folder, name, isLinkToChildComponent = true)}
|
|
13
|
+
<a
|
|
14
|
+
class="underline underline-offset-4"
|
|
15
|
+
href="/components/{folder}/{textStringConversion(name, 'kebab')}"
|
|
16
|
+
>
|
|
17
|
+
{#if isLinkToChildComponent}
|
|
18
|
+
<p class="m-0">{name}</p>
|
|
19
|
+
{:else}
|
|
20
|
+
<h6>{name}</h6>
|
|
21
|
+
{/if}
|
|
22
|
+
</a>
|
|
23
|
+
{/snippet}
|
|
24
|
+
|
|
25
|
+
<div
|
|
26
|
+
data-role="details-container"
|
|
27
|
+
class="{homepage ? '' : 'g-top-level-container'} flex flex-col gap-6 {homepage
|
|
28
|
+
? 'bg-slate-100 p-5 rounded-lg'
|
|
29
|
+
: ''}"
|
|
30
|
+
>
|
|
31
|
+
<div
|
|
32
|
+
data-role="name-and-pill-container"
|
|
33
|
+
class="flex flex-row items-center gap-4"
|
|
34
|
+
>
|
|
35
|
+
{#if homepage}
|
|
36
|
+
{@render linkedNameOfComponent(details.folder, details.name, false)}
|
|
37
|
+
{:else}
|
|
38
|
+
<h2>{details.name}</h2>
|
|
39
|
+
{/if}
|
|
40
|
+
{#if details.status}
|
|
41
|
+
<Pill
|
|
42
|
+
size={homepage ? "small" : "medium"}
|
|
43
|
+
textContent={textStringConversion(details.status, "title-first-word")}
|
|
44
|
+
bgColor={"black"}
|
|
45
|
+
textColor={"white"}
|
|
46
|
+
></Pill>
|
|
47
|
+
{/if}
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<DividerLine margin="0.2rem 0rem"></DividerLine>
|
|
51
|
+
|
|
52
|
+
<dl data-role="details-grid-container" class="grid gap-y-4">
|
|
53
|
+
{#each ["description", "context"] as detail}
|
|
54
|
+
{@const detailData = details[detail]}
|
|
55
|
+
{#if detailData?.length > 0}
|
|
56
|
+
<dt id={detail}>{textStringConversion(detail, "title-first-word")}:</dt>
|
|
57
|
+
<dd>
|
|
58
|
+
{#each detailData as paragraph}
|
|
59
|
+
{#if paragraph.markdown}
|
|
60
|
+
<p>{@html paragraph.content}</p>
|
|
61
|
+
{:else}
|
|
62
|
+
<p>{paragraph.content}</p>
|
|
63
|
+
{/if}
|
|
64
|
+
{/each}
|
|
65
|
+
</dd>
|
|
66
|
+
{/if}
|
|
67
|
+
{/each}
|
|
68
|
+
|
|
69
|
+
{#if details.childComponents?.length > 0}
|
|
70
|
+
<div class="col-span-2">
|
|
71
|
+
<DividerLine margin="0.6rem 0rem"></DividerLine>
|
|
72
|
+
</div>
|
|
73
|
+
<dt>Child components:</dt>
|
|
74
|
+
<dd class="flex flex-row flex-wrap gap-4">
|
|
75
|
+
{#each details.childComponents as childComponent}
|
|
76
|
+
{@render linkedNameOfComponent(
|
|
77
|
+
childComponent.folder,
|
|
78
|
+
childComponent.name,
|
|
79
|
+
)}
|
|
80
|
+
{/each}
|
|
81
|
+
</dd>
|
|
82
|
+
{/if}
|
|
83
|
+
|
|
84
|
+
{#if !homepage}
|
|
85
|
+
{#if details.requirements?.length > 0}
|
|
86
|
+
<div class="col-span-2">
|
|
87
|
+
<DividerLine margin="0.6rem 0rem"></DividerLine>
|
|
88
|
+
</div>
|
|
89
|
+
<dt>Requirements:</dt>
|
|
90
|
+
<ul class="flex flex-col gap-4">
|
|
91
|
+
{#each details.requirements as requirement, i}
|
|
92
|
+
<li
|
|
93
|
+
class="flex flex-col gap-4 {requirement.fulfilled
|
|
94
|
+
? 'text-green-700 line-through'
|
|
95
|
+
: ''}"
|
|
96
|
+
>
|
|
97
|
+
<dt class="font-bold">{requirement.label}</dt>
|
|
98
|
+
<dd>{requirement.description}</dd>
|
|
99
|
+
{#if i != details.requirements.length - 1}
|
|
100
|
+
<DividerLine margin="0.2rem 0rem"></DividerLine>
|
|
101
|
+
{/if}
|
|
102
|
+
</li>
|
|
103
|
+
{/each}
|
|
104
|
+
</ul>
|
|
105
|
+
{/if}
|
|
106
|
+
<div class="col-span-2">
|
|
107
|
+
<DividerLine margin="0.6rem 0rem"></DividerLine>
|
|
108
|
+
</div>
|
|
109
|
+
{/if}
|
|
110
|
+
</dl>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<style>
|
|
114
|
+
[data-role="details-grid-container"] {
|
|
115
|
+
grid-template-columns: 180px auto;
|
|
116
|
+
}
|
|
117
|
+
dd p:first-of-type {
|
|
118
|
+
margin-top: 0;
|
|
119
|
+
}
|
|
120
|
+
dd p:last-of-type {
|
|
121
|
+
margin-bottom: 0;
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default ComponentDetails;
|
|
2
|
+
type ComponentDetails = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const ComponentDetails: import("svelte").Component<{
|
|
7
|
+
homepage: any;
|
|
8
|
+
details: any;
|
|
9
|
+
}, {}, "">;
|
|
10
|
+
type $$ComponentProps = {
|
|
11
|
+
homepage: any;
|
|
12
|
+
details: any;
|
|
13
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
let {
|
|
3
|
+
directionIsVertical = false,
|
|
4
|
+
color = '#cbd5e1',
|
|
5
|
+
margin = '0px',
|
|
6
|
+
thickness = '1px',
|
|
7
|
+
} = $props();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
{#if directionIsVertical}
|
|
11
|
+
<div
|
|
12
|
+
data-role="divider-line-vertical"
|
|
13
|
+
class="self-stretch"
|
|
14
|
+
style="margin: {margin}; border-left: {thickness} solid {color};"
|
|
15
|
+
></div>
|
|
16
|
+
{:else}
|
|
17
|
+
<hr
|
|
18
|
+
data-role="divider-line-horizontal"
|
|
19
|
+
style="margin: {margin}; border-top: {thickness} solid {color}"
|
|
20
|
+
/>
|
|
21
|
+
{/if}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default DividerLine;
|
|
2
|
+
type DividerLine = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const DividerLine: import("svelte").Component<{
|
|
7
|
+
directionIsVertical?: boolean;
|
|
8
|
+
color?: string;
|
|
9
|
+
margin?: string;
|
|
10
|
+
thickness?: string;
|
|
11
|
+
}, {}, "">;
|
|
12
|
+
type $$ComponentProps = {
|
|
13
|
+
directionIsVertical?: boolean;
|
|
14
|
+
color?: string;
|
|
15
|
+
margin?: string;
|
|
16
|
+
thickness?: string;
|
|
17
|
+
};
|