@qhealth-design-system/core 1.20.2 → 1.21.0

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 (127) hide show
  1. package/.storybook/globals.js +79 -69
  2. package/.storybook/main.js +2 -0
  3. package/.storybook/preview-head.html +1 -0
  4. package/.storybook/preview.js +2 -1
  5. package/.storybook/vite-plugin-hbs.js +52 -0
  6. package/.stylelintignore +5 -0
  7. package/.stylelintrc.json +24 -0
  8. package/CHANGELOG.md +2 -0
  9. package/eslint.config.mjs +60 -0
  10. package/package.json +25 -18
  11. package/prettier.config.js +17 -0
  12. package/src/component-loader.js +10 -0
  13. package/src/components/_global/css/cta_links/component.scss +1 -1
  14. package/src/components/_global/css/link_columns/component.scss +8 -0
  15. package/src/components/_global/css/table/component.scss +6 -118
  16. package/src/components/accordion/js/global.js +12 -13
  17. package/src/components/banner/html/component.hbs +31 -3
  18. package/src/components/banner_advanced/css/component.scss +298 -2
  19. package/src/components/basic_search/html/component.hbs +4 -4
  20. package/src/components/global_alert/js/global.js +31 -47
  21. package/src/components/in_page_navigation/html/component.hbs +9 -16
  22. package/src/components/in_page_navigation/js/global.js +25 -3
  23. package/src/components/main_navigation/js/global.js +1 -39
  24. package/src/components/mega_main_navigation/js/global.js +160 -158
  25. package/src/data/current.json +0 -187
  26. package/src/helpers/Handlebars/renderEncoded.js +9 -0
  27. package/src/html/home.html +1 -6
  28. package/src/html/inner-with-nav.html +1 -3
  29. package/src/stories/AZListing/a-z_listing.stories.js +72 -0
  30. package/src/stories/Abstract/abstract.stories.js +68 -0
  31. package/src/stories/BackToTop/BackToTop.stories.js +12 -22
  32. package/src/stories/Banner/banner.stories.js +76 -0
  33. package/src/stories/Banner/bannerAdvanced.stories.js +234 -0
  34. package/src/stories/Banner/bannerBasic.stories.js +105 -0
  35. package/src/stories/Body/body.stories.js +94 -0
  36. package/src/stories/Breadcrumbs/Breadcrumbs.stories.js +16 -21
  37. package/src/stories/Button/Button.stories.js +70 -0
  38. package/src/stories/CTALink/CTALink.stories.js +83 -31
  39. package/src/stories/Callout/Callout.stories.js +25 -35
  40. package/src/stories/Cards/CardFeature.stories.js +164 -0
  41. package/src/stories/Cards/CardMultiAction.stories.js +212 -0
  42. package/src/stories/Cards/CardNoAction.stories.js +201 -0
  43. package/src/stories/Cards/CardSingleAction.stories.js +197 -0
  44. package/src/stories/Cards/Toowoomba-web.jpeg +0 -0
  45. package/src/stories/DirectionLinks/DirectionLinks.stories.js +2 -8
  46. package/src/stories/Footer/Footer.stories.js +7 -13
  47. package/src/stories/{Checkboxes → Forms/Checkboxes}/Checkboxes.stories.js +4 -9
  48. package/src/stories/{RadioButtons → Forms/RadioButtons}/RadioButtons.stories.js +5 -10
  49. package/src/stories/{SelectBox → Forms/SelectBox}/SelectBox.stories.js +5 -10
  50. package/src/stories/Forms/forms.stories.js +188 -0
  51. package/src/stories/Forms/numberInput.stories.js +68 -0
  52. package/src/stories/Forms/textInput.stories.js +147 -0
  53. package/src/stories/Forms/textarea.stories.js +145 -0
  54. package/src/stories/GlobalAlert/GlobalAlert.stories.js +135 -0
  55. package/src/stories/Header/Header.js +2 -4
  56. package/src/stories/Header/Header.stories.js +5 -8
  57. package/src/stories/Iconography/Iconography.stories.js +2 -7
  58. package/src/stories/InPageAlert/InPageAlert.stories.js +27 -31
  59. package/src/stories/InPageNavigation/InPageNavigation.stories.js +89 -0
  60. package/src/stories/Introduction.mdx +3 -36
  61. package/src/stories/LinkColumns/LinkColumns.stories.js +35 -23
  62. package/src/stories/LoadingSpinner/LoadingSpinner.stories.js +11 -25
  63. package/src/stories/MegaMainNavigation/mega_main_navigation.a11y.stories.js +138 -0
  64. package/src/stories/MegaMainNavigation/mega_main_navigation.stories.js +245 -0
  65. package/src/stories/Navbar/Navbar.js +2 -5
  66. package/src/stories/Navbar/Navbar.stories.js +2 -12
  67. package/src/stories/Pagination/Pagination.stories.js +4 -10
  68. package/src/stories/PromoPanel/PromoPanel.stories.js +8 -44
  69. package/src/stories/Table/table.stories.js +112 -0
  70. package/src/stories/Tags/Tags.stories.js +3 -8
  71. package/src/stories/VideoPlayer/VideoPlayer.stories.js +8 -20
  72. package/src/styles/imports/utilities.scss +80 -0
  73. package/src/components/banner_intermediate/css/component.scss +0 -289
  74. package/src/components/banner_intermediate/html/component.hbs +0 -196
  75. package/src/components/banner_intermediate/js/global.js +0 -6
  76. package/src/components/banner_intermediate/js/manifest.json +0 -249
  77. package/src/components/card_no_action/js/global.js +0 -6
  78. package/src/html/component-a-z_listing.html +0 -57
  79. package/src/html/component-abstract.html +0 -582
  80. package/src/html/component-banner.html +0 -581
  81. package/src/html/component-banner_advanced.html +0 -70
  82. package/src/html/component-banner_basic.html +0 -55
  83. package/src/html/component-banner_intermediate.html +0 -64
  84. package/src/html/component-body.html +0 -605
  85. package/src/html/component-breadcrumbs.html +0 -583
  86. package/src/html/component-btn.html +0 -640
  87. package/src/html/component-callout.html +0 -582
  88. package/src/html/component-card_feature.html +0 -601
  89. package/src/html/component-card_multi_action.html +0 -1227
  90. package/src/html/component-card_no_action.html +0 -395
  91. package/src/html/component-card_single_action.html +0 -602
  92. package/src/html/component-footer.html +0 -583
  93. package/src/html/component-forms.html +0 -1612
  94. package/src/html/component-global_alert.html +0 -582
  95. package/src/html/component-header.html +0 -583
  96. package/src/html/component-in_page_navigation.html +0 -605
  97. package/src/html/component-loading_spinner.html +0 -45
  98. package/src/html/component-overflow_menu.html +0 -62
  99. package/src/html/component-page_alert.html +0 -582
  100. package/src/html/component-page_footer_info.html +0 -583
  101. package/src/html/component-pagination.html +0 -583
  102. package/src/html/component-promo_panel.html +0 -46
  103. package/src/html/component-tag_list.html +0 -1027
  104. package/src/html/component-video_player.html +0 -57
  105. package/src/stories/BackToTop/BackToTop.js +0 -8
  106. package/src/stories/BackToTop/BackToTop.mdx +0 -24
  107. package/src/stories/Breadcrumbs/Breadcrumbs.mdx +0 -30
  108. package/src/stories/CTALink/CTALink.mdx +0 -36
  109. package/src/stories/Callout/Callout.mdx +0 -28
  110. package/src/stories/Checkboxes/Checkboxes.mdx +0 -42
  111. package/src/stories/DirectionLinks/DirectionLinks.mdx +0 -34
  112. package/src/stories/Footer/Footer.mdx +0 -36
  113. package/src/stories/Header/Header.mdx +0 -61
  114. package/src/stories/Iconography/Iconography.mdx +0 -23
  115. package/src/stories/InPageAlert/InPageAlert.mdx +0 -64
  116. package/src/stories/LinkColumns/LinkColumns.mdx +0 -28
  117. package/src/stories/LoadingSpinner/LoadingSpinner.mdx +0 -30
  118. package/src/stories/Navbar/Navbar.mdx +0 -37
  119. package/src/stories/Pagination/Pagination.mdx +0 -26
  120. package/src/stories/PromoPanel/PromoPanel.mdx +0 -26
  121. package/src/stories/RadioButtons/RadioButtons.mdx +0 -42
  122. package/src/stories/SelectBox/SelectBox.mdx +0 -118
  123. package/src/stories/Tags/Tags.mdx +0 -63
  124. package/src/stories/VideoPlayer/VideoPlayer.mdx +0 -26
  125. /package/src/stories/{Checkboxes → Forms/Checkboxes}/Checkboxes.js +0 -0
  126. /package/src/stories/{RadioButtons → Forms/RadioButtons}/RadioButtons.js +0 -0
  127. /package/src/stories/{SelectBox → Forms/SelectBox}/SelectBox.js +0 -0
@@ -261,97 +261,18 @@
261
261
  "asset_name": "Components &",
262
262
  "asset_short_name": "Components &",
263
263
  "children": [
264
- {
265
- "asset_url": "/component-a-z_listing.html",
266
- "asset_name": "A-z_listing",
267
- "asset_short_name": "A-z_listing",
268
- "children": []
269
- },
270
- {
271
- "asset_url": "/component-abstract.html",
272
- "asset_name": "Abstract",
273
- "asset_short_name": "Abstract",
274
- "asset_metadata_shortDescription": "",
275
- "children": []
276
- },
277
264
  {
278
265
  "asset_url": "/component-accordion.html",
279
266
  "asset_name": "Accordion",
280
267
  "asset_short_name": "Accordion",
281
268
  "children": []
282
269
  },
283
- {
284
- "asset_url": "/component-banner.html",
285
- "asset_name": "Banner",
286
- "asset_short_name": "Banner",
287
- "children": []
288
- },
289
- {
290
- "asset_url": "/component-banner_advanced.html",
291
- "asset_name": "Banner Advanced",
292
- "asset_short_name": "Banner Advanced",
293
- "children": []
294
- },
295
- {
296
- "asset_url": "/component-banner_basic.html",
297
- "asset_name": "Banner_basic",
298
- "asset_short_name": "Banner_basic",
299
- "children": []
300
- },
301
- {
302
- "asset_url": "/component-banner_intermediate.html",
303
- "asset_name": "Banner_intermediate",
304
- "asset_short_name": "Banner_intermediate",
305
- "children": []
306
- },
307
270
  {
308
271
  "asset_url": "/component-basic_search.html",
309
272
  "asset_name": "Basic_search",
310
273
  "asset_short_name": "Basic_search",
311
274
  "children": []
312
275
  },
313
- {
314
- "asset_url": "/component-body.html",
315
- "asset_name": "Body",
316
- "asset_short_name": "Body",
317
- "children": []
318
- },
319
- {
320
- "asset_url": "/component-btn.html",
321
- "asset_name": "Buttons",
322
- "asset_short_name": "Buttons",
323
- "children": []
324
- },
325
- {
326
- "asset_url": "/component-callout.html",
327
- "asset_name": "Callout",
328
- "asset_short_name": "Callout",
329
- "children": []
330
- },
331
- {
332
- "asset_url": "/component-card_feature.html",
333
- "asset_name": "Card_feature",
334
- "asset_short_name": "Card_feature",
335
- "children": []
336
- },
337
- {
338
- "asset_url": "/component-card_multi_action.html",
339
- "asset_name": "Card_multi_action",
340
- "asset_short_name": "Card_multi_action",
341
- "children": []
342
- },
343
- {
344
- "asset_url": "/component-card_no_action.html",
345
- "asset_name": "Card_no_action",
346
- "asset_short_name": "Card_no_action",
347
- "children": []
348
- },
349
- {
350
- "asset_url": "/component-card_single_action.html",
351
- "asset_name": "Card_single_action",
352
- "asset_short_name": "Card_single_action",
353
- "children": []
354
- },
355
276
  {
356
277
  "asset_url": "/component-code.html",
357
278
  "asset_name": "Code",
@@ -364,12 +285,6 @@
364
285
  "asset_short_name": "File_upload",
365
286
  "children": []
366
287
  },
367
- {
368
- "asset_url": "/component-forms.html",
369
- "asset_name": "Forms",
370
- "asset_short_name": "Forms",
371
- "children": []
372
- },
373
288
  {
374
289
  "asset_url": "/component-global-elements.html",
375
290
  "asset_name": "Global elements",
@@ -382,66 +297,18 @@
382
297
  "asset_short_name": "Horizontal Rule",
383
298
  "children": []
384
299
  },
385
- {
386
- "asset_url": "/component-in_page_navigation.html",
387
- "asset_name": "In Page Navigation",
388
- "asset_short_name": "In Page Navigation",
389
- "children": []
390
- },
391
- {
392
- "asset_url": "/component-loading_spinner.html",
393
- "asset_name": "Loading_spinner",
394
- "asset_short_name": "Loading_spinner",
395
- "children": []
396
- },
397
300
  {
398
301
  "asset_url": "/component-multi_column.html",
399
302
  "asset_name": "Multi Column",
400
303
  "asset_short_name": "Multi Column",
401
304
  "children": []
402
305
  },
403
- {
404
- "asset_url": "/component-overflow_menu.html",
405
- "asset_name": "Overflow_menu",
406
- "asset_short_name": "Overflow_menu",
407
- "children": []
408
- },
409
- {
410
- "asset_url": "/component-page_alert.html",
411
- "asset_name": "Page Alert",
412
- "asset_short_name": "Page Alert",
413
- "children": []
414
- },
415
- {
416
- "asset_url": "/component-promo_panel.html",
417
- "asset_name": "Promo_panel",
418
- "asset_short_name": "Promo_panel",
419
- "children": []
420
- },
421
- {
422
- "asset_url": "/component-search_box.html",
423
- "asset_name": "Search Box",
424
- "asset_short_name": "Search Box",
425
- "children": []
426
- },
427
306
  {
428
307
  "asset_url": "/component-tab.html",
429
308
  "asset_name": "Tab",
430
309
  "asset_short_name": "Tab",
431
310
  "children": []
432
311
  },
433
- {
434
- "asset_url": "/component-tag_list.html",
435
- "asset_name": "Tag List",
436
- "asset_short_name": "Tag List",
437
- "children": []
438
- },
439
- {
440
- "asset_url": "/component-tag_list_linked.html",
441
- "asset_name": "Tag List Linked",
442
- "asset_short_name": "Tag List Linked",
443
- "children": []
444
- },
445
312
  {
446
313
  "asset_url": "/component-toggle_tip.html",
447
314
  "asset_name": "Toggle tip",
@@ -453,12 +320,6 @@
453
320
  "asset_name": "Tool tip",
454
321
  "asset_short_name": "Tool tip",
455
322
  "children": []
456
- },
457
- {
458
- "asset_url": "/component-video_player.html",
459
- "asset_name": "Video player",
460
- "asset_short_name": "Video player",
461
- "children": []
462
323
  }
463
324
  ]
464
325
  },
@@ -468,36 +329,6 @@
468
329
  "asset_name": "Site templates",
469
330
  "asset_short_name": "Site templates",
470
331
  "children": [
471
- {
472
- "asset_url": "/component-banner.html",
473
- "asset_name": "Banner",
474
- "asset_short_name": "Banner",
475
- "children": []
476
- },
477
- {
478
- "asset_url": "/component-breadcrumbs.html",
479
- "asset_name": "Breadcrumbs",
480
- "asset_short_name": "Breadcrumbs",
481
- "children": []
482
- },
483
- {
484
- "asset_url": "/component-footer.html",
485
- "asset_name": "Footer",
486
- "asset_short_name": "Footer",
487
- "children": []
488
- },
489
- {
490
- "asset_url": "/component-global_alert.html",
491
- "asset_name": "Global Alert",
492
- "asset_short_name": "Global Alert",
493
- "children": []
494
- },
495
- {
496
- "asset_url": "/component-header.html",
497
- "asset_name": "Header",
498
- "asset_short_name": "Header",
499
- "children": []
500
- },
501
332
  {
502
333
  "asset_url": "/component-internal_navigation.html",
503
334
  "asset_name": "Internal Navigation",
@@ -515,24 +346,6 @@
515
346
  "asset_name": "Mega Main Navigation",
516
347
  "asset_short_name": "Mega Main Navigation",
517
348
  "children": []
518
- },
519
- {
520
- "asset_url": "/component-pagination.html",
521
- "asset_name": "Pagination",
522
- "asset_short_name": "Pagination",
523
- "children": []
524
- },
525
- {
526
- "asset_url": "/component-tags_metadata.html",
527
- "asset_name": "Tags Metadata",
528
- "asset_short_name": "Tags Metadata",
529
- "children": []
530
- },
531
- {
532
- "asset_url": "/component-prefooter.html",
533
- "asset_name": "Page Footer Info",
534
- "asset_short_name": "Page Footer Info",
535
- "children": []
536
349
  }
537
350
  ]
538
351
  },
@@ -0,0 +1,9 @@
1
+ module.exports = function (string) {
2
+ if (!string) return "";
3
+
4
+ return string
5
+ .replace(/<[^>]*>/g, "")
6
+ .replace(/&/g, "&amp;")
7
+ .replace(/</g, "&lt;")
8
+ .replace(/>/g, "&gt;");
9
+ };
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
  <!--[if lt IE 8]>
3
3
  <html class="no-js lt-ie8 lt-ie9" lang="en">
4
4
  <![endif]-->
@@ -1860,11 +1860,6 @@
1860
1860
  "component":require('../components/banner_advanced/js/manifest.json').component,
1861
1861
  "site":require('/src/data/site.json'),
1862
1862
  "current":require('/src/data/current.json')
1863
- })} -->
1864
- <!-- {require('../components/banner_intermediate/html/component.hbs')({
1865
- "component":require('../components/banner_intermediate/js/manifest.json').component,
1866
- "site":require('/src/data/site.json'),
1867
- "current":require('/src/data/current.json')
1868
1863
  })} -->
1869
1864
  <!-- {require('../components/banner_basic/html/component.hbs')({
1870
1865
  "component":require('../components/banner_basic/js/manifest.json').component,
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
  <!--[if lt IE 8]>
3
3
  <html class="no-js lt-ie8 lt-ie9" lang="en">
4
4
  <![endif]-->
@@ -554,8 +554,6 @@
554
554
  ${require('../components/left_hand_navigation/html/component.hbs')({ "site":require('/src/data/site.json'), "current":require('/src/data/current.json') })}
555
555
 
556
556
  <div class="qld__body--left-nav">
557
- ${require('../components/banner_intermediate/html/component.hbs')({ "component":require('../components/banner_intermediate/js/manifest.json').component, "site":require('/src/data/site.json'),
558
- "current":require('/src/data/current.json'), "content":"Lorem Ipsum" })}
559
557
  <section class="qld__body qld__body--breadcrumb">
560
558
  <div class="container-fluid">
561
559
  <!-- {require('../components/breadcrumbs/html/component.hbs')({
@@ -0,0 +1,72 @@
1
+ import Template from "../../components/a-z_listing/html/component.hbs";
2
+ import { storyParams } from "../../../.storybook/globals";
3
+
4
+ function render({ letterHeading, children }) {
5
+ return Template({
6
+ component: {
7
+ data: {
8
+ metadata: {
9
+ letter_heading: { value: letterHeading },
10
+ },
11
+ },
12
+ children,
13
+ },
14
+ });
15
+ }
16
+
17
+ const parameters = storyParams("aZListing");
18
+
19
+ const meta = {
20
+ title: "3. Components/A-Z Listing",
21
+ render,
22
+ argTypes: {
23
+ letterHeading: {
24
+ name: "heading_level",
25
+ control: {
26
+ type: "radio",
27
+ labels: { h2: "H2", h3: "H3", h4: "H4", h5: "H5", span: "span" },
28
+ },
29
+ options: ["h2", "h3", "h4", "h5", "span"],
30
+ table: { defaultValue: { summary: "h2" } },
31
+ },
32
+ },
33
+ args: {
34
+ letterHeading: "h2",
35
+ children: [
36
+ { assetid: "1", name: "Accordion" },
37
+ { assetid: "2", name: "Alerts (in-page)" },
38
+ { assetid: "3", name: "Breadcrumbs" },
39
+ { assetid: "4", name: "Button" },
40
+ { assetid: "5", name: "Callout" },
41
+ { assetid: "6", name: "Card" },
42
+ { assetid: "7", name: "Footer" },
43
+ { assetid: "8", name: "Header" },
44
+ { assetid: "9", name: "In-page navigation" },
45
+ { assetid: "10", name: "Pagination" },
46
+ { assetid: "11", name: "Tabs" },
47
+ { assetid: "12", name: "Tags" },
48
+ { assetid: "13", name: "Video player" },
49
+ ],
50
+ },
51
+ parameters: {
52
+ ...parameters,
53
+ docs: {
54
+ ...parameters.docs,
55
+ description: {
56
+ component:
57
+ "The A-Z listing component groups a set of links alphabetically by their first letter, " +
58
+ "displaying each group under a letter heading so users can scan and find content quickly.\n" +
59
+ "\n" +
60
+ "It is typically used for index or directory pages where a long list of items benefits from being " +
61
+ "broken into alphabetical sections.",
62
+ },
63
+ },
64
+ },
65
+ };
66
+ export default meta;
67
+
68
+ export const Default = {};
69
+
70
+ export const Empty = {
71
+ args: { children: [] },
72
+ };
@@ -0,0 +1,68 @@
1
+ import Template from "../../components/abstract/html/component.hbs";
2
+ import { dummyText, storyParams } from "../../../.storybook/globals";
3
+ import { expect } from "storybook/test";
4
+
5
+ function render({ id, content }) {
6
+ return Template({
7
+ component: {
8
+ data: {
9
+ assetid: "123",
10
+ metadata: {
11
+ id_field: { value: id },
12
+ content: { value: content },
13
+ },
14
+ },
15
+ },
16
+ });
17
+ }
18
+
19
+ const parameters = storyParams("abstract");
20
+
21
+ const meta = {
22
+ title: "3. Components/Abstract",
23
+ render,
24
+ argTypes: {
25
+ id: {
26
+ name: "id_field",
27
+ description: "Optional anchor ID applied to the wrapping section. Falls back to abstract-{assetid} when empty.",
28
+ control: { type: "text" },
29
+ },
30
+ content: {
31
+ description: "Rich-text (WYSIWYG) content displayed inside the abstract.",
32
+ control: { type: "text" },
33
+ },
34
+ },
35
+ args: {
36
+ id: "abstract-000",
37
+ content: dummyText,
38
+ },
39
+ parameters: {
40
+ ...parameters,
41
+ docs: {
42
+ ...parameters.docs,
43
+ description: {
44
+ component:
45
+ "The Abstract component displays a short summary or introductory passage of rich-text content, " +
46
+ "giving users a quick overview of a page before they read the full content.\n" +
47
+ "\n" +
48
+ "The content is authored as WYSIWYG markup and sits inside a styled `qld__body` section. The" +
49
+ " wrapping section can be given an anchor `id` so it can be linked to directly; when none is " +
50
+ "supplied it falls back to `abstract-{assetid}`.",
51
+ },
52
+ },
53
+ },
54
+ };
55
+ export default meta;
56
+
57
+ export const Default = {};
58
+
59
+ export const Empty = {
60
+ args: {
61
+ id: undefined,
62
+ content: undefined,
63
+ },
64
+ play: async ({ canvasElement }) => {
65
+ const section = canvasElement.querySelector(".qld__abstract--wrapper");
66
+ await expect(section).toHaveAttribute("id", "abstract-123");
67
+ },
68
+ };
@@ -1,28 +1,18 @@
1
- import { BackToTop } from "./BackToTop";
2
- import { figmaLinks } from "../../../.storybook/globals";
3
-
4
- const backtotopArgs = {
5
- text: "Back to top",
6
- };
1
+ import { storyParams } from "../../../.storybook/globals";
7
2
 
8
3
  export default {
9
- title: "3. Components/BackToTop",
10
- render: (args) => BackToTop(args), // calls the function
11
- argTypes: {
12
- text: { control: "text", description: "Back to top" },
13
- },
4
+ title: "3. Components/Back to Top",
5
+ render: ({ text }) => `
6
+ <div class="qld__widgets__back_to_top">
7
+ <a href="#content" class="qld__direction-link qld__direction-link--up" aria-label="Back to top">
8
+ ${text}
9
+ </a>
10
+ </div>
11
+ `,
14
12
  args: {
15
- ...backtotopArgs,
16
- },
17
- parameters: {
18
- design: {
19
- type: "figma",
20
- url: figmaLinks.backToTop.design,
21
- },
13
+ text: "Back to top",
22
14
  },
15
+ parameters: storyParams("backToTop"),
23
16
  };
24
17
 
25
- // Named story
26
- export const Default = {
27
- args: { ...backtotopArgs },
28
- };
18
+ export const Default = {};
@@ -0,0 +1,76 @@
1
+ import Template from "../../components/banner/html/component.hbs";
2
+ import { storyParams } from "../../../.storybook/globals";
3
+
4
+ const mockLineage = [
5
+ { asset_url: "#", asset_short_name: "Home", asset_type_code: "page", asset_is_site_asset: "1" },
6
+ { asset_url: "#", asset_short_name: "Section", asset_type_code: "page", asset_is_site_asset: "0" },
7
+ { asset_url: "#", asset_short_name: "Current page", asset_type_code: "page", asset_is_site_asset: "0" },
8
+ ];
9
+
10
+ function render(args) {
11
+ const { pageTitle, bannerColour, showBreadcrumbs } = args;
12
+ return Template({
13
+ site: {
14
+ metadata: {
15
+ ...args.site.metadata,
16
+ defaultBannerColour: { value: bannerColour },
17
+ },
18
+ },
19
+ current: {
20
+ data: {
21
+ name: pageTitle,
22
+ metadata: {
23
+ displayBreadcrumbs: { value: showBreadcrumbs ? "true" : "false" },
24
+ },
25
+ },
26
+ lineage: showBreadcrumbs ? mockLineage : [],
27
+ },
28
+ metadata: {
29
+ breadcrumbs_display: { value: showBreadcrumbs ? "yes" : "" },
30
+ background_colour: { value: bannerColour },
31
+ },
32
+ });
33
+ }
34
+
35
+ const meta = {
36
+ title: "3. Components/Banner",
37
+ render,
38
+ argTypes: {
39
+ pageTitle: {
40
+ description: "The page title displayed in the banner.",
41
+ control: { type: "text" },
42
+ },
43
+ bannerColour: {
44
+ description: "Background colour theme of the banner.",
45
+ control: {
46
+ type: "select",
47
+ labels: {
48
+ "": "White (default)",
49
+ light: "Light",
50
+ alternate: "Alternate",
51
+ dark: "Dark",
52
+ "dark-alternate": "Dark Alternate",
53
+ },
54
+ },
55
+ options: ["", "light", "alternate", "dark", "dark-alternate"],
56
+ },
57
+ showBreadcrumbs: {
58
+ description: "Display breadcrumb navigation in the banner.",
59
+ control: { type: "boolean" },
60
+ },
61
+ },
62
+ args: {
63
+ pageTitle: "Default Banner",
64
+ bannerColour: "alternate",
65
+ showBreadcrumbs: true,
66
+ },
67
+ parameters: storyParams("banner"),
68
+ };
69
+
70
+ export default meta;
71
+
72
+ export const Default = {};
73
+
74
+ export const WithoutBreadcrumbs = {
75
+ args: { showBreadcrumbs: false },
76
+ };