@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,235 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Pill from "./Pill.svelte";
|
|
3
|
+
import DividerLine from "./DividerLine.svelte";
|
|
4
|
+
import { propPillLookup } from "../config.js";
|
|
5
|
+
import {
|
|
6
|
+
Accordion,
|
|
7
|
+
AccordionItem,
|
|
8
|
+
Tabs,
|
|
9
|
+
TabItem,
|
|
10
|
+
Select,
|
|
11
|
+
Label,
|
|
12
|
+
} from "flowbite-svelte";
|
|
13
|
+
import InputForParameter from "./InputForParameter.svelte";
|
|
14
|
+
|
|
15
|
+
import { innerWidth } from "svelte/reactivity/window";
|
|
16
|
+
|
|
17
|
+
let {
|
|
18
|
+
details,
|
|
19
|
+
parametersSourceArray,
|
|
20
|
+
parametersVisibleArray,
|
|
21
|
+
parametersValuesArray = $bindable(),
|
|
22
|
+
numberOfPropColumnsOnDesktop = 3,
|
|
23
|
+
} = $props();
|
|
24
|
+
|
|
25
|
+
let parameterCategories = $derived(
|
|
26
|
+
[...new Set(parametersSourceArray.map((el) => el.category))].map((el) => ({
|
|
27
|
+
name: el,
|
|
28
|
+
value: el,
|
|
29
|
+
})),
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
let reactiveNumberOfPropColumns = $derived(
|
|
33
|
+
innerWidth.current >= 1024
|
|
34
|
+
? numberOfPropColumnsOnDesktop
|
|
35
|
+
: innerWidth.current >= 768
|
|
36
|
+
? Math.min(numberOfPropColumnsOnDesktop, 2)
|
|
37
|
+
: 1,
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
let parametersSectionWidth = $state();
|
|
41
|
+
let tabWidthsArray = $state([]);
|
|
42
|
+
let tabsWrapping = $derived(
|
|
43
|
+
parametersSectionWidth <=
|
|
44
|
+
tabWidthsArray.reduce((acc, curr) => acc + (curr || 0), 0),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
$inspect(
|
|
48
|
+
parametersSectionWidth,
|
|
49
|
+
tabWidthsArray.reduce((acc, curr) => acc + (curr || 0), 0),
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
$inspect(tabsWrapping);
|
|
53
|
+
|
|
54
|
+
let selectedCategory = $state(parameterCategories[0].value);
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<div data-role="parameters-section" class="mx-auto px-5">
|
|
58
|
+
<div bind:clientWidth={parametersSectionWidth}>
|
|
59
|
+
<h5 id="parameters" class="mb-6 underline underline-offset-4">Parameters</h5>
|
|
60
|
+
<div class="flex flex-row gap-8">
|
|
61
|
+
<div class="flex flex-row gap-8 pr-4">
|
|
62
|
+
<p class="m-0 p-0 font-bold">Key</p>
|
|
63
|
+
<div class="flex flex-row gap-4 mb-2">
|
|
64
|
+
<div class="flex flex-row gap-2 flex-1">
|
|
65
|
+
<Pill
|
|
66
|
+
size={propPillLookup[true].size}
|
|
67
|
+
textContent={propPillLookup[true].text}
|
|
68
|
+
bgColor={propPillLookup[true].bgColor}
|
|
69
|
+
textColor={propPillLookup[true].textColor}
|
|
70
|
+
borderRadius="15px"
|
|
71
|
+
padding={propPillLookup[true].padding}
|
|
72
|
+
tailwindClass={"self-start"}
|
|
73
|
+
></Pill>
|
|
74
|
+
<p
|
|
75
|
+
class="m-0 p-0 text-sm"
|
|
76
|
+
style="color: {propPillLookup[true].bgColor}"
|
|
77
|
+
>
|
|
78
|
+
{"Parameters with this label are props which are passed directly to the <" +
|
|
79
|
+
details.name +
|
|
80
|
+
"> component."}
|
|
81
|
+
</p>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="flex flex-row gap-2 flex-1">
|
|
84
|
+
<Pill
|
|
85
|
+
size={propPillLookup["bindable"].size}
|
|
86
|
+
textContent={propPillLookup["bindable"].text}
|
|
87
|
+
bgColor={propPillLookup["bindable"].bgColor}
|
|
88
|
+
textColor={propPillLookup["bindable"].textColor}
|
|
89
|
+
borderRadius="15px"
|
|
90
|
+
padding={propPillLookup["bindable"].padding}
|
|
91
|
+
tailwindClass={"self-start"}
|
|
92
|
+
></Pill>
|
|
93
|
+
<p
|
|
94
|
+
class="m-0 p-0 text-sm"
|
|
95
|
+
style="color: {propPillLookup['bindable'].bgColor}"
|
|
96
|
+
>
|
|
97
|
+
{"Parameters with this label are bindable props which are accessible outside the <" +
|
|
98
|
+
details.name +
|
|
99
|
+
"> component but updated within it."}
|
|
100
|
+
</p>
|
|
101
|
+
</div>
|
|
102
|
+
<div class="flex flex-row gap-2 flex-1">
|
|
103
|
+
<Pill
|
|
104
|
+
size={propPillLookup[false].size}
|
|
105
|
+
textContent={propPillLookup[false].text}
|
|
106
|
+
bgColor={propPillLookup[false].bgColor}
|
|
107
|
+
textColor={propPillLookup[false].textColor}
|
|
108
|
+
borderRadius="15px"
|
|
109
|
+
padding={propPillLookup[false].padding}
|
|
110
|
+
tailwindClass={"self-start"}
|
|
111
|
+
></Pill>
|
|
112
|
+
<p
|
|
113
|
+
class="m-0 p-0 text-sm"
|
|
114
|
+
style="color: {propPillLookup[false].bgColor}"
|
|
115
|
+
>
|
|
116
|
+
{"Parameters with this label are used in the calculation of a prop which is passed to the <" +
|
|
117
|
+
details.name +
|
|
118
|
+
"> component."}
|
|
119
|
+
</p>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
<!-- <DividerLine margin="5px 0px 15px 0px"></DividerLine> -->
|
|
125
|
+
<div class="mb-6" data-role="parameters-container">
|
|
126
|
+
{#if true}
|
|
127
|
+
<Tabs
|
|
128
|
+
tabStyle="underline"
|
|
129
|
+
defaultClass="flex flex-row flex-wrap gap-2 m-0 p-0"
|
|
130
|
+
>
|
|
131
|
+
{#each parameterCategories as category, i}
|
|
132
|
+
{@const visibleParametersForCategory = parametersSourceArray.filter(
|
|
133
|
+
(el) =>
|
|
134
|
+
el.category === category.name &&
|
|
135
|
+
(el.inputType || "label" in el) &&
|
|
136
|
+
parametersVisibleArray[el.index],
|
|
137
|
+
)}
|
|
138
|
+
<div bind:clientWidth={tabWidthsArray[i]}>
|
|
139
|
+
<TabItem
|
|
140
|
+
open={selectedCategory === category.name}
|
|
141
|
+
title={category.name}
|
|
142
|
+
defaultClass="text-lg "
|
|
143
|
+
>
|
|
144
|
+
<div class="flex flex-col">
|
|
145
|
+
{#each visibleParametersForCategory as parameter, i}
|
|
146
|
+
<div>
|
|
147
|
+
<InputForParameter
|
|
148
|
+
source={parameter}
|
|
149
|
+
bind:value={parametersValuesArray[parameter.index]}
|
|
150
|
+
></InputForParameter>
|
|
151
|
+
{#if i < visibleParametersForCategory.length - 1}
|
|
152
|
+
<DividerLine margin="15px 0px 15px 0px"></DividerLine>
|
|
153
|
+
{/if}
|
|
154
|
+
</div>
|
|
155
|
+
{/each}
|
|
156
|
+
</div>
|
|
157
|
+
</TabItem>
|
|
158
|
+
</div>
|
|
159
|
+
{/each}
|
|
160
|
+
</Tabs>
|
|
161
|
+
{:else}
|
|
162
|
+
<Label>
|
|
163
|
+
Select an option
|
|
164
|
+
<Select
|
|
165
|
+
class="mt-2"
|
|
166
|
+
items={parameterCategories}
|
|
167
|
+
bind:value={selectedCategory}
|
|
168
|
+
/>
|
|
169
|
+
</Label>{/if}
|
|
170
|
+
<!-- {#each [...Array(reactiveNumberOfPropColumns).keys()] as columnNumb}
|
|
171
|
+
<div data-role="parameters-container-column" class="min-w-60">
|
|
172
|
+
{#each parameterCategories as category, i}
|
|
173
|
+
{#if i % reactiveNumberOfPropColumns === columnNumb}
|
|
174
|
+
{@const visibleParametersForCategory =
|
|
175
|
+
parametersSourceArray.filter(
|
|
176
|
+
(el) =>
|
|
177
|
+
el.category === category &&
|
|
178
|
+
(el.inputType || "label" in el) &&
|
|
179
|
+
parametersVisibleArray[el.index],
|
|
180
|
+
)}
|
|
181
|
+
|
|
182
|
+
<div
|
|
183
|
+
data-role="parameters-category-group"
|
|
184
|
+
class="px-4 pt-0 pb-4 rounded-xl bg-gray-200 bg-opacity-25"
|
|
185
|
+
>
|
|
186
|
+
<Accordion flush>
|
|
187
|
+
<AccordionItem>
|
|
188
|
+
<span class="text-2xl text-black" slot="header"
|
|
189
|
+
>{category}</span
|
|
190
|
+
>
|
|
191
|
+
<div class="flex flex-col">
|
|
192
|
+
{#each visibleParametersForCategory as parameter, i}
|
|
193
|
+
<div>
|
|
194
|
+
<InputForParameter
|
|
195
|
+
source={parameter}
|
|
196
|
+
bind:value={parametersValuesArray[parameter.index]}
|
|
197
|
+
></InputForParameter>
|
|
198
|
+
{#if i < visibleParametersForCategory.length - 1}
|
|
199
|
+
<DividerLine margin="15px 0px 15px 0px"
|
|
200
|
+
></DividerLine>
|
|
201
|
+
{/if}
|
|
202
|
+
</div>
|
|
203
|
+
{/each}
|
|
204
|
+
</div>
|
|
205
|
+
</AccordionItem>
|
|
206
|
+
</Accordion>
|
|
207
|
+
</div>
|
|
208
|
+
{/if}
|
|
209
|
+
{/each}
|
|
210
|
+
</div>
|
|
211
|
+
{/each} -->
|
|
212
|
+
</div>
|
|
213
|
+
<DividerLine margin="15px 0px 15px 0px"></DividerLine>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<style>
|
|
218
|
+
[data-role="parameters-section"] {
|
|
219
|
+
max-width: 1024px;
|
|
220
|
+
}
|
|
221
|
+
/*[data-role="parameters-container"] {
|
|
222
|
+
display: flex;
|
|
223
|
+
gap: 10px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
[data-role="parameters-container-column"] {
|
|
227
|
+
flex: 1;
|
|
228
|
+
display: flex;
|
|
229
|
+
flex-direction: column;
|
|
230
|
+
gap: 10px;
|
|
231
|
+
}
|
|
232
|
+
[data-role="parameters-category-group"] {
|
|
233
|
+
border: 1px solid #e5e7eb;
|
|
234
|
+
}*/
|
|
235
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default ParametersSection;
|
|
2
|
+
type ParametersSection = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const ParametersSection: import("svelte").Component<{
|
|
7
|
+
details: any;
|
|
8
|
+
parametersSourceArray: any;
|
|
9
|
+
parametersVisibleArray: any;
|
|
10
|
+
parametersValuesArray?: any;
|
|
11
|
+
numberOfPropColumnsOnDesktop?: number;
|
|
12
|
+
}, {}, "parametersValuesArray">;
|
|
13
|
+
type $$ComponentProps = {
|
|
14
|
+
details: any;
|
|
15
|
+
parametersSourceArray: any;
|
|
16
|
+
parametersVisibleArray: any;
|
|
17
|
+
parametersValuesArray?: any;
|
|
18
|
+
numberOfPropColumnsOnDesktop?: number;
|
|
19
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { Toast } from "flowbite-svelte";
|
|
3
|
+
import { CheckCircleSolid, CloseCircleSolid } from "flowbite-svelte-icons";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
parametersParsingErrorsArray,
|
|
7
|
+
parametersParsingErrorsObject,
|
|
8
|
+
onCloseFunction,
|
|
9
|
+
} = $props();
|
|
10
|
+
|
|
11
|
+
/*() =>
|
|
12
|
+
parametersParsingErrorsArray.filter((el) => el != key)*/
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{#key parametersParsingErrorsArray}
|
|
16
|
+
<div class="fixed bottom-0 right-0 mr-5 mb-5 z-[3]">
|
|
17
|
+
{#each Object.keys(parametersParsingErrorsObject) as key}
|
|
18
|
+
{#if parametersParsingErrorsObject[key]}
|
|
19
|
+
<Toast
|
|
20
|
+
divClass="w-100 p-4 text-gray-500 bg-white shadow gap-5"
|
|
21
|
+
color="red"
|
|
22
|
+
dismissable={true}
|
|
23
|
+
on:close={() =>
|
|
24
|
+
parametersParsingErrorsArray.filter((el) => el != key)}
|
|
25
|
+
>
|
|
26
|
+
<svelte:fragment slot="icon">
|
|
27
|
+
<CloseCircleSolid class="w-5 h-5" />
|
|
28
|
+
<span class="sr-only">Error icon</span>
|
|
29
|
+
</svelte:fragment>
|
|
30
|
+
|
|
31
|
+
Error: The <code>{key}</code> prop is not a valid JSON object.</Toast
|
|
32
|
+
>
|
|
33
|
+
{:else}
|
|
34
|
+
<Toast
|
|
35
|
+
divClass="w-100 p-4 text-gray-500 bg-white shadow gap-5"
|
|
36
|
+
color="green"
|
|
37
|
+
dismissable={true}
|
|
38
|
+
on:close={onCloseFunction(key)}
|
|
39
|
+
>
|
|
40
|
+
<svelte:fragment slot="icon">
|
|
41
|
+
<CheckCircleSolid class="w-5 h-5" />
|
|
42
|
+
<span class="sr-only">Check icon</span>
|
|
43
|
+
</svelte:fragment>
|
|
44
|
+
|
|
45
|
+
Resolved: The <code>{key}</code> prop is valid JSON.</Toast
|
|
46
|
+
>
|
|
47
|
+
{/if}
|
|
48
|
+
{/each}
|
|
49
|
+
</div>
|
|
50
|
+
{/key}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default ParsingErrorToastsContainer;
|
|
2
|
+
type ParsingErrorToastsContainer = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const ParsingErrorToastsContainer: import("svelte").Component<{
|
|
7
|
+
parametersParsingErrorsArray: any;
|
|
8
|
+
parametersParsingErrorsObject: any;
|
|
9
|
+
onCloseFunction: any;
|
|
10
|
+
}, {}, "">;
|
|
11
|
+
type $$ComponentProps = {
|
|
12
|
+
parametersParsingErrorsArray: any;
|
|
13
|
+
parametersParsingErrorsObject: any;
|
|
14
|
+
onCloseFunction: any;
|
|
15
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { Tooltip } from "flowbite-svelte";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
textContent,
|
|
6
|
+
size = "medium",
|
|
7
|
+
bgColor,
|
|
8
|
+
textColor,
|
|
9
|
+
borderRadius = "5px",
|
|
10
|
+
tooltipText = false,
|
|
11
|
+
padding = null,
|
|
12
|
+
tailwindClass = "",
|
|
13
|
+
} = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<div
|
|
17
|
+
class="pill-container {tailwindClass}"
|
|
18
|
+
data-role="pill-container-{size}"
|
|
19
|
+
style="color: {textColor}; background-color: {bgColor}; border-radius: {borderRadius}; padding: {padding ??
|
|
20
|
+
null};"
|
|
21
|
+
>
|
|
22
|
+
{textContent}
|
|
23
|
+
</div>
|
|
24
|
+
{#if tooltipText}
|
|
25
|
+
<Tooltip placement="bottom" color="light">{tooltipText}</Tooltip>
|
|
26
|
+
{/if}
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.pill-container {
|
|
30
|
+
display: inline;
|
|
31
|
+
}
|
|
32
|
+
[data-role="pill-container-xs"] {
|
|
33
|
+
padding: 0.2rem 0.4rem;
|
|
34
|
+
font-size: 0.9rem;
|
|
35
|
+
line-height: 0.9rem;
|
|
36
|
+
}
|
|
37
|
+
[data-role="pill-container-sm"] {
|
|
38
|
+
padding: 0.3rem 0.4rem;
|
|
39
|
+
font-size: 1.1rem;
|
|
40
|
+
line-height: 1.1rem;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[data-role="pill-container-md"] {
|
|
44
|
+
padding: 0.35rem 0.5rem;
|
|
45
|
+
font-size: 1.35rem;
|
|
46
|
+
line-height: 1.35rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[data-role="pill-container-lg"] {
|
|
50
|
+
padding: 0.6rem;
|
|
51
|
+
font-size: 1.6rem;
|
|
52
|
+
line-height: 1.6rem;
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default Pill;
|
|
2
|
+
type Pill = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Pill: import("svelte").Component<{
|
|
7
|
+
textContent: any;
|
|
8
|
+
size?: string;
|
|
9
|
+
bgColor: any;
|
|
10
|
+
textColor: any;
|
|
11
|
+
borderRadius?: string;
|
|
12
|
+
tooltipText?: boolean;
|
|
13
|
+
padding?: any;
|
|
14
|
+
tailwindClass?: string;
|
|
15
|
+
}, {}, "">;
|
|
16
|
+
type $$ComponentProps = {
|
|
17
|
+
textContent: any;
|
|
18
|
+
size?: string;
|
|
19
|
+
bgColor: any;
|
|
20
|
+
textColor: any;
|
|
21
|
+
borderRadius?: string;
|
|
22
|
+
tooltipText?: boolean;
|
|
23
|
+
padding?: any;
|
|
24
|
+
tailwindClass?: string;
|
|
25
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import DividerLine from "./DividerLine.svelte";
|
|
4
|
+
|
|
5
|
+
import { textStringConversion } from "../utils/text-string-conversion/textStringConversion.js";
|
|
6
|
+
|
|
7
|
+
let { homepage, details } = $props();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
{#snippet pageDescription()}
|
|
11
|
+
<dd>
|
|
12
|
+
{#each details.description as paragraph}
|
|
13
|
+
{#if paragraph.markdown}
|
|
14
|
+
<p>{@html paragraph.content}</p>
|
|
15
|
+
{:else}
|
|
16
|
+
<p>{paragraph.content}</p>
|
|
17
|
+
{/if}
|
|
18
|
+
{/each}
|
|
19
|
+
</dd>
|
|
20
|
+
{/snippet}
|
|
21
|
+
|
|
22
|
+
{#snippet linkedNameOfPlaygroundPage(folder, name)}{/snippet}
|
|
23
|
+
|
|
24
|
+
<div
|
|
25
|
+
data-role="details-container"
|
|
26
|
+
class="{homepage ? '' : 'g-top-level-container'} flex flex-col gap-6 {homepage
|
|
27
|
+
? 'bg-teal-500 bg-opacity-10 p-5 rounded-lg'
|
|
28
|
+
: ''}"
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
data-role="name-and-desc-container"
|
|
32
|
+
class="flex flex-row items-start gap-4"
|
|
33
|
+
>
|
|
34
|
+
{#if homepage}
|
|
35
|
+
<a
|
|
36
|
+
class="underline underline-offset-4"
|
|
37
|
+
style={homepage ? "width: 450px" : ""}
|
|
38
|
+
href="/playground/{textStringConversion(details.name, 'kebab')}"
|
|
39
|
+
>
|
|
40
|
+
<h8>{details.name}</h8>
|
|
41
|
+
</a>
|
|
42
|
+
<div>
|
|
43
|
+
{@render pageDescription()}
|
|
44
|
+
</div>
|
|
45
|
+
{:else}
|
|
46
|
+
<h4>{details.name}</h4>
|
|
47
|
+
{/if}
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
{#if !homepage}
|
|
51
|
+
<DividerLine margin="0.2rem 0rem"></DividerLine>
|
|
52
|
+
|
|
53
|
+
<dl data-role="details-grid-container" class="grid gap-y-4">
|
|
54
|
+
{#if details.description?.length > 0}
|
|
55
|
+
{#if !homepage}
|
|
56
|
+
<dt>Description:</dt>
|
|
57
|
+
{@render pageDescription()}
|
|
58
|
+
{/if}
|
|
59
|
+
{/if}
|
|
60
|
+
</dl>
|
|
61
|
+
|
|
62
|
+
{#if !homepage && details.steps?.length > 0}
|
|
63
|
+
<DividerLine margin="0.2rem 0rem"></DividerLine>
|
|
64
|
+
|
|
65
|
+
<div class="flex flex-col gap-2 m-0">
|
|
66
|
+
<h7 class="font-bold">Steps:</h7>
|
|
67
|
+
<ul class="grid gap-y-2">
|
|
68
|
+
{#each details.steps as step, i}
|
|
69
|
+
<li class={step.complete ? "text-green-700" : ""}>
|
|
70
|
+
<span>{i + 1}.</span>
|
|
71
|
+
{#if step.markdown}
|
|
72
|
+
<span class={step.complete ? "line-through" : ""}
|
|
73
|
+
>{@html step.label}</span
|
|
74
|
+
>
|
|
75
|
+
{:else}
|
|
76
|
+
<span class={step.complete ? "line-through" : ""}
|
|
77
|
+
>{step.label}</span
|
|
78
|
+
>
|
|
79
|
+
{/if}
|
|
80
|
+
</li>
|
|
81
|
+
{/each}
|
|
82
|
+
</ul>
|
|
83
|
+
</div>
|
|
84
|
+
{/if}
|
|
85
|
+
{/if}
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<style>
|
|
89
|
+
[data-role="details-grid-container"] {
|
|
90
|
+
grid-template-columns: 180px auto;
|
|
91
|
+
}
|
|
92
|
+
dd p:first-of-type {
|
|
93
|
+
margin-top: 0;
|
|
94
|
+
}
|
|
95
|
+
dd p:last-of-type {
|
|
96
|
+
margin-bottom: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
ul {
|
|
100
|
+
grid-template-columns: 40px auto;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
li {
|
|
104
|
+
display: contents;
|
|
105
|
+
}
|
|
106
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default PlaygroundDetails;
|
|
2
|
+
type PlaygroundDetails = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const PlaygroundDetails: import("svelte").Component<{
|
|
7
|
+
homepage: any;
|
|
8
|
+
details: any;
|
|
9
|
+
}, {}, "">;
|
|
10
|
+
type $$ComponentProps = {
|
|
11
|
+
homepage: any;
|
|
12
|
+
details: any;
|
|
13
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defaultScreenWidthBreakpoints } from '../config.js';
|
|
3
|
+
import { Radio } from 'flowbite-svelte';
|
|
4
|
+
let { demoScreenWidth = $bindable() } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<ul
|
|
8
|
+
class="my-4 mx-0 items-center w-full rounded-lg border border-gray-200 sm:flex dark:bg-gray-800 dark:border-gray-600 divide-x rtl:divide-x-reverse divide-gray-200 dark:divide-gray-600"
|
|
9
|
+
style="min-width: 800px;"
|
|
10
|
+
>
|
|
11
|
+
{#each Object.keys(defaultScreenWidthBreakpoints) as screenSizeOption}
|
|
12
|
+
<li class="w-full">
|
|
13
|
+
<Radio
|
|
14
|
+
bind:group={demoScreenWidth}
|
|
15
|
+
name="hor-list"
|
|
16
|
+
class="p-4 text-base"
|
|
17
|
+
value={defaultScreenWidthBreakpoints[screenSizeOption]}
|
|
18
|
+
>{screenSizeOption} ({defaultScreenWidthBreakpoints[
|
|
19
|
+
screenSizeOption
|
|
20
|
+
]}px)</Radio
|
|
21
|
+
>
|
|
22
|
+
</li>
|
|
23
|
+
{/each}
|
|
24
|
+
</ul>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default ScreenSizeRadio;
|
|
2
|
+
type ScreenSizeRadio = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const ScreenSizeRadio: import("svelte").Component<{
|
|
7
|
+
demoScreenWidth?: any;
|
|
8
|
+
}, {}, "demoScreenWidth">;
|
|
9
|
+
type $$ComponentProps = {
|
|
10
|
+
demoScreenWidth?: any;
|
|
11
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defaultScreenWidthBreakpoints } from "../config.js";
|
|
3
|
+
import { Radio } from "flowbite-svelte";
|
|
4
|
+
let { demoScreenWidth = $bindable() } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<ul
|
|
8
|
+
class="m-0 p-0 items-center w-full rounded-lg flex flex-col divide-x rtl:divide-x-reverse divide-gray-200"
|
|
9
|
+
>
|
|
10
|
+
{#each Object.keys(defaultScreenWidthBreakpoints) as screenSizeOption}
|
|
11
|
+
<li class="w-full">
|
|
12
|
+
<Radio
|
|
13
|
+
bind:group={demoScreenWidth}
|
|
14
|
+
name="hor-list"
|
|
15
|
+
class="px-4 py-3 text-base text-[#6b7280]"
|
|
16
|
+
value={defaultScreenWidthBreakpoints[screenSizeOption]}
|
|
17
|
+
>{screenSizeOption} ({defaultScreenWidthBreakpoints[
|
|
18
|
+
screenSizeOption
|
|
19
|
+
]}px)</Radio
|
|
20
|
+
>
|
|
21
|
+
</li>
|
|
22
|
+
{/each}
|
|
23
|
+
</ul>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default ScreenSizeRadioUpdated;
|
|
2
|
+
type ScreenSizeRadioUpdated = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const ScreenSizeRadioUpdated: import("svelte").Component<{
|
|
7
|
+
demoScreenWidth?: any;
|
|
8
|
+
}, {}, "demoScreenWidth">;
|
|
9
|
+
type $$ComponentProps = {
|
|
10
|
+
demoScreenWidth?: any;
|
|
11
|
+
};
|