@communitiesuk/svelte-component-library 0.1.19-beta.3 → 0.1.19-beta.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.
Files changed (47) hide show
  1. package/README.md +7 -0
  2. package/dist/components/content/Tag.svelte +32 -0
  3. package/dist/components/content/Tag.svelte.d.ts +13 -0
  4. package/dist/components/data-vis/Histogram.svelte +302 -0
  5. package/dist/components/data-vis/Histogram.svelte.d.ts +75 -0
  6. package/dist/components/data-vis/axis/Axis.svelte +217 -34
  7. package/dist/components/data-vis/axis/Axis.svelte.d.ts +38 -30
  8. package/dist/components/data-vis/axis/Ticks.svelte +142 -78
  9. package/dist/components/data-vis/axis/Ticks.svelte.d.ts +28 -31
  10. package/dist/components/data-vis/line-chart/LineChart.svelte +51 -21
  11. package/dist/components/data-vis/line-chart/LineChart.svelte.d.ts +14 -6
  12. package/dist/components/data-vis/line-chart/ValueLabel.svelte +2 -1
  13. package/dist/components/data-vis/line-chart/ValueLabel.svelte.d.ts +2 -0
  14. package/dist/components/data-vis/position-chart/PositionChart.svelte +278 -122
  15. package/dist/components/data-vis/position-chart/PositionChart.svelte.d.ts +37 -5
  16. package/dist/components/data-vis/position-chart/PositionChartAxis.svelte +59 -48
  17. package/dist/components/data-vis/position-chart/PositionChartAxis.svelte.d.ts +4 -4
  18. package/dist/components/layout/Footer.svelte +9 -0
  19. package/dist/components/layout/Footer.svelte.d.ts +1 -0
  20. package/dist/components/layout/PhaseBanner.svelte +10 -1
  21. package/dist/components/layout/PhaseBanner.svelte.d.ts +1 -0
  22. package/dist/components/layout/ServiceNavigation.svelte +19 -1
  23. package/dist/components/layout/ServiceNavigation.svelte.d.ts +2 -0
  24. package/dist/components/ui/BasicMultiSelect.svelte +716 -0
  25. package/dist/components/ui/BasicMultiSelect.svelte.d.ts +18 -0
  26. package/dist/components/ui/Button.svelte +1 -0
  27. package/dist/components/ui/Card.svelte +48 -60
  28. package/dist/components/ui/Card.svelte.d.ts +26 -12
  29. package/dist/components/ui/CardHeader.svelte +46 -0
  30. package/dist/components/ui/CardHeader.svelte.d.ts +21 -0
  31. package/dist/components/ui/ChartExporter.svelte +142 -0
  32. package/dist/components/ui/ChartExporter.svelte.d.ts +16 -0
  33. package/dist/components/ui/CheckBox.svelte +1 -0
  34. package/dist/components/ui/Details.svelte +47 -8
  35. package/dist/components/ui/Details.svelte.d.ts +8 -10
  36. package/dist/components/ui/Masthead.svelte +44 -6
  37. package/dist/components/ui/Masthead.svelte.d.ts +6 -0
  38. package/dist/components/ui/RelatedContent.svelte +4 -1
  39. package/dist/components/ui/RelatedContent.svelte.d.ts +1 -0
  40. package/dist/components/ui/SearchAutocomplete.svelte +69 -44
  41. package/dist/components/ui/SearchAutocomplete.svelte.d.ts +1 -0
  42. package/dist/components/ui/Select.svelte +18 -7
  43. package/dist/components/ui/Tabs.svelte +192 -18
  44. package/dist/components/ui/Tabs.svelte.d.ts +1 -0
  45. package/dist/index.d.ts +5 -0
  46. package/dist/index.js +5 -0
  47. package/package.json +4 -1
@@ -1,70 +1,81 @@
1
1
  <script>
2
- let { markerRadius = undefined, barWidth = undefined } = $props();
2
+ let { textSize = "s", axisLabels = ["Left", "Right"] } = $props();
3
3
  </script>
4
4
 
5
- <div class="axis" style="--axis-padding:{markerRadius}px; width: {barWidth}">
6
- <div class="more-deprived">
7
- <svg
8
- xmlns="http://www.w3.org/2000/svg"
9
- width="11"
10
- height="16"
11
- viewBox="0 0 11 16"
12
- fill="none"
13
- >
14
- <path
15
- d="M0.292893 7.29289C-0.0976315 7.68342 -0.0976314 8.31658 0.292893 8.70711L6.65685 15.0711C7.04738 15.4616 7.68054 15.4616 8.07107 15.0711C8.46159 14.6805 8.46159 14.0474 8.07107 13.6569L2.41421 8L8.07107 2.34315C8.46159 1.95262 8.46159 1.31946 8.07107 0.928932C7.68054 0.538408 7.04738 0.538408 6.65685 0.928933L0.292893 7.29289ZM11 8L11 7L1 7L1 8L1 9L11 9L11 8Z"
16
- fill="#B1B4B6"
17
- ></path>
18
- </svg>
19
- <span style="font-family:GDS Transport">More deprived</span>
5
+ <div class="axis govuk-body-{textSize}">
6
+ <div class="left-label">
7
+ <div class="arrow-container">
8
+ <svg
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ width="18"
11
+ height="16"
12
+ viewBox="0 0 18 16"
13
+ >
14
+ <path
15
+ d="M8 1L1 8L8 15M1 8H17"
16
+ stroke="darkgrey"
17
+ stroke-width="2"
18
+ fill="none"
19
+ stroke-linecap="round"
20
+ stroke-linejoin="round"
21
+ ></path>
22
+ </svg>
23
+ </div>
24
+ <span class="axis-text">{axisLabels[0]}</span>
20
25
  </div>
21
- <div class="less-deprived">
22
- <span style="font-family:GDS Transport">Less deprived</span>
23
- <svg
24
- xmlns="http://www.w3.org/2000/svg"
25
- width="12"
26
- height="16"
27
- viewBox="0 0 12 16"
28
- fill="none"
29
- >
30
- <path
31
- d="M11.2071 8.70711C11.5976 8.31658 11.5976 7.68342 11.2071 7.2929L4.84315 0.928933C4.45262 0.538409 3.81946 0.538408 3.42893 0.928933C3.03841 1.31946 3.03841 1.95262 3.42893 2.34315L9.08579 8L3.42893 13.6569C3.03841 14.0474 3.03841 14.6805 3.42893 15.0711C3.81946 15.4616 4.45262 15.4616 4.84314 15.0711L11.2071 8.70711ZM0.5 8L0.5 9L10.5 9L10.5 8L10.5 7L0.5 7L0.5 8Z"
32
- fill="#B1B4B6"
33
- ></path>
34
- </svg>
26
+ <div class="right-label">
27
+ <span class="axis-text">{axisLabels[1]}</span>
28
+ <div class="arrow-container">
29
+ <svg
30
+ xmlns="http://www.w3.org/2000/svg"
31
+ width="18"
32
+ height="16"
33
+ viewBox="0 0 18 16"
34
+ >
35
+ <path
36
+ d="M10 1L17 8L10 15M17 8H1"
37
+ stroke="darkgrey"
38
+ stroke-width="2"
39
+ fill="none"
40
+ stroke-linecap="round"
41
+ stroke-linejoin="round"
42
+ ></path>
43
+ </svg>
44
+ </div>
35
45
  </div>
36
46
  </div>
37
47
 
38
48
  <style>
49
+ svg {
50
+ overflow: visible;
51
+ }
52
+
39
53
  .axis {
40
54
  display: flex;
41
55
  justify-content: space-between;
42
- align-items: center;
43
- padding: 0 var(--axis-padding);
56
+ margin-bottom: 0;
44
57
  }
45
58
 
46
- .less-deprived,
47
- .more-deprived {
59
+ .left-label,
60
+ .right-label {
48
61
  display: flex;
49
- align-items: center;
50
- gap: 5px;
62
+ gap: 4px;
63
+ max-width: 120px;
51
64
  }
52
65
 
53
- /* Tell the parent to act as a container */
54
- .axis {
55
- container-type: inline-size;
66
+ .right-label {
67
+ text-align: end;
56
68
  }
57
69
 
58
- /* Container query: hide the child if parent's width is less than 400px */
59
- @container (max-width: 18rem) {
60
- .less-deprived {
61
- display: none;
62
- }
70
+ .axis-text {
71
+ font-family: "GDS Transport";
72
+ line-height: 0.9;
73
+ color: #666666;
74
+ font-style: italic;
63
75
  }
64
76
 
65
- @container (max-width: 25rem) {
66
- .average {
67
- display: none;
68
- }
77
+ .arrow-container {
78
+ display: flex;
79
+ align-items: center;
69
80
  }
70
81
  </style>
@@ -4,10 +4,10 @@ type PositionChartAxis = {
4
4
  $set?(props: Partial<$$ComponentProps>): void;
5
5
  };
6
6
  declare const PositionChartAxis: import("svelte").Component<{
7
- markerRadius?: any;
8
- barWidth?: any;
7
+ textSize?: string;
8
+ axisLabels?: any[];
9
9
  }, {}, "">;
10
10
  type $$ComponentProps = {
11
- markerRadius?: any;
12
- barWidth?: any;
11
+ textSize?: string;
12
+ axisLabels?: any[];
13
13
  };
@@ -51,6 +51,7 @@
51
51
  copyrightHref = "https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/",
52
52
  rebrand = true,
53
53
  borderTopColor = "#00625E",
54
+ removeCopyrightPadding = false,
54
55
  } = $props<{
55
56
  sections?: FooterSection[];
56
57
  inlineLinks?: FooterItem[];
@@ -68,6 +69,7 @@
68
69
  copyrightHref?: string;
69
70
  rebrand?: boolean;
70
71
  borderTopColor?: string;
72
+ removeCopyrightPadding?: boolean;
71
73
  }>();
72
74
  </script>
73
75
 
@@ -218,6 +220,7 @@
218
220
  <a
219
221
  class={[
220
222
  "govuk-footer__link",
223
+ { "no-copyright-padding": removeCopyrightPadding },
221
224
  {
222
225
  "govuk-footer__copyright-logo": !copyrightLogoUrl && rebrand,
223
226
  },
@@ -234,3 +237,9 @@
234
237
  </div>
235
238
  </div>
236
239
  </footer>
240
+
241
+ <style>
242
+ .no-copyright-padding {
243
+ padding: 0;
244
+ }
245
+ </style>
@@ -27,6 +27,7 @@ type $$ComponentProps = {
27
27
  copyrightHref?: string;
28
28
  rebrand?: boolean;
29
29
  borderTopColor?: string;
30
+ removeCopyrightPadding?: boolean;
30
31
  };
31
32
  declare const Footer: import("svelte").Component<$$ComponentProps, {}, "">;
32
33
  type Footer = ReturnType<typeof Footer>;
@@ -5,15 +5,21 @@
5
5
  bannerText = "This is a new service. Help us improve it and ",
6
6
  linkText = "give your feedback by email",
7
7
  linkHref = "#",
8
+ bottomBorder = true,
8
9
  } = $props<{
9
10
  tagText?: string;
10
11
  bannerText?: string;
11
12
  linkText?: string;
12
13
  linkHref?: string;
14
+ bottomBorder?: boolean;
13
15
  }>();
14
16
  </script>
15
17
 
16
- <div class="govuk-phase-banner govuk-width-container">
18
+ <div
19
+ class="govuk-phase-banner govuk-width-container {bottomBorder
20
+ ? ''
21
+ : 'no-bottom-border'}"
22
+ >
17
23
  <p class="govuk-phase-banner__content">
18
24
  <strong class="govuk-tag govuk-phase-banner__content__tag">
19
25
  {tagText}
@@ -25,4 +31,7 @@
25
31
  </div>
26
32
 
27
33
  <style>
34
+ .no-bottom-border {
35
+ border-bottom: none;
36
+ }
28
37
  </style>
@@ -3,6 +3,7 @@ type $$ComponentProps = {
3
3
  bannerText?: string;
4
4
  linkText?: string;
5
5
  linkHref?: string;
6
+ bottomBorder?: boolean;
6
7
  };
7
8
  declare const PhaseBanner: import("svelte").Component<$$ComponentProps, {}, "">;
8
9
  type PhaseBanner = ReturnType<typeof PhaseBanner>;
@@ -17,11 +17,15 @@ Use the component with or without navigation items based on your needs. -->
17
17
  serviceUrl = "#",
18
18
  navigationItems = undefined,
19
19
  collapseOnDesktop = false,
20
+ customiseServiceNameLink = false,
21
+ serviceNameLinkStyle = "govuk-link no-underline",
20
22
  } = $props<{
21
23
  serviceName?: string;
22
24
  serviceUrl?: string;
23
25
  navigationItems?: NavigationItem[];
24
26
  collapseOnDesktop?: boolean;
27
+ customiseServiceNameLink?: boolean;
28
+ serviceNameLinkStyle?: string;
25
29
  }>();
26
30
 
27
31
  // Reactive state declarations
@@ -94,7 +98,12 @@ Use the component with or without navigation items based on your needs. -->
94
98
  <div class="govuk-width-container">
95
99
  <div class="govuk-service-navigation__container">
96
100
  <span class="govuk-service-navigation__service-name">
97
- <a href={serviceUrl} class="govuk-service-navigation__link">
101
+ <a
102
+ href={serviceUrl}
103
+ class={customiseServiceNameLink
104
+ ? serviceNameLinkStyle
105
+ : "govuk-service-navigation__link"}
106
+ >
98
107
  {serviceName}
99
108
  </a>
100
109
  </span>
@@ -145,3 +154,12 @@ Use the component with or without navigation items based on your needs. -->
145
154
  </div>
146
155
  </div>
147
156
  </section>
157
+
158
+ <style>
159
+ .no-underline {
160
+ text-decoration: none;
161
+ }
162
+ .no-underline:hover {
163
+ text-decoration: underline;
164
+ }
165
+ </style>
@@ -8,6 +8,8 @@ type $$ComponentProps = {
8
8
  serviceUrl?: string;
9
9
  navigationItems?: NavigationItem[];
10
10
  collapseOnDesktop?: boolean;
11
+ customiseServiceNameLink?: boolean;
12
+ serviceNameLinkStyle?: string;
11
13
  };
12
14
  declare const ServiceNavigation: import("svelte").Component<$$ComponentProps, {}, "">;
13
15
  type ServiceNavigation = ReturnType<typeof ServiceNavigation>;