@pnx-mixtape/mxds 0.0.3 → 0.0.4

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 (152) hide show
  1. package/package.json +2 -2
  2. package/src/Atom/Background/__snapshots__/Backgrounds.stories.ts.snap +3 -3
  3. package/src/Atom/Button/Button.stories.ts +4 -6
  4. package/src/Atom/Button/__snapshots__/Button.stories.ts.snap +23 -11
  5. package/src/Atom/Button/__snapshots__/Button.stories.tsx.snap +2 -2
  6. package/src/Atom/Button/_buttons.css +4 -0
  7. package/src/Atom/Button/button.twig +6 -4
  8. package/src/Atom/Button/twig/story-button.twig +11 -0
  9. package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.tsx.snap +1 -1
  10. package/src/Atom/Heading/__snapshots__/Heading.stories.ts.snap +2 -2
  11. package/src/Atom/Heading/__snapshots__/Heading.stories.tsx.snap +1 -1
  12. package/src/Atom/Heading/heading.twig +19 -1
  13. package/src/Atom/Icon/__snapshots__/Icon.stories.ts.snap +3 -3
  14. package/src/Atom/Icon/__snapshots__/Icon.stories.tsx.snap +3 -3
  15. package/src/Atom/Image/__snapshots__/Image.stories.ts.snap +1 -1
  16. package/src/Atom/Link/Link.stories.ts +31 -7
  17. package/src/Atom/Link/__snapshots__/Link.stories.ts.snap +46 -6
  18. package/src/Atom/Link/__snapshots__/Link.stories.tsx.snap +3 -3
  19. package/src/Atom/Link/_links.css +23 -1
  20. package/src/Atom/Link/link.twig +8 -6
  21. package/src/Atom/Link/twig/story-link.twig +11 -0
  22. package/src/Atom/Media/Media.stories.ts +17 -1
  23. package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +17 -2
  24. package/src/Atom/Media/__snapshots__/Media.stories.tsx.snap +2 -2
  25. package/src/Atom/Media/twig/story-media.twig +11 -0
  26. package/src/Atom/NavList/__snapshots__/NavList.stories.ts.snap +1 -1
  27. package/src/Atom/Spacing/__snapshots__/Spacing.stories.ts.snap +1 -1
  28. package/src/Atom/Table/__snapshots__/Table.stories.ts.snap +4 -4
  29. package/src/Atom/Table/__snapshots__/TableResponsive.stories.ts.snap +1 -1
  30. package/src/Atom/Text/__snapshots__/Text.stories.tsx.snap +1 -1
  31. package/src/Atom/Text/__snapshots__/TextSizes.stories.ts.snap +2 -2
  32. package/src/Atom/Video/Video.stories.ts +5 -3
  33. package/src/Atom/Video/__snapshots__/Video.stories.ts.snap +3 -13
  34. package/src/Atom/Video/_video.css +5 -0
  35. package/src/Component/Accordion/__snapshots__/Accordion.stories.ts.snap +4 -4
  36. package/src/Component/Accordion/__snapshots__/Accordion.stories.tsx.snap +1 -1
  37. package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.ts.snap +1 -1
  38. package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.tsx.snap +2 -2
  39. package/src/Component/Callout/__snapshots__/Callout.stories.ts.snap +12 -0
  40. package/src/Component/Card/__snapshots__/Card.stories.ts.snap +34 -24
  41. package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +3 -3
  42. package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.ts.snap +6 -23
  43. package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.tsx.snap +1 -1
  44. package/src/Component/Dialog/__snapshots__/Dialog.stories.ts.snap +2 -2
  45. package/src/Component/Dialog/__snapshots__/Dialog.stories.tsx.snap +1 -1
  46. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +1 -1
  47. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +1 -1
  48. package/src/Component/{InPageAlert/Elements/InPageAlert.ts → GlobalAlert/Elements/ClosableAlert.ts} +21 -10
  49. package/src/Component/GlobalAlert/GlobalAlert.stories.ts +49 -0
  50. package/src/Component/GlobalAlert/GlobalAlert.stories.tsx +33 -0
  51. package/src/Component/GlobalAlert/GlobalAlert.tsx +50 -0
  52. package/src/Component/GlobalAlert/README.md +27 -0
  53. package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.ts.snap +43 -0
  54. package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.tsx.snap +48 -0
  55. package/src/Component/GlobalAlert/global-alert.css +55 -0
  56. package/src/Component/GlobalAlert/global-alert.entry.js +1 -0
  57. package/src/Component/GlobalAlert/global-alert.twig +30 -0
  58. package/src/Component/GlobalAlert/twig/story-global-alert.twig +14 -0
  59. package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +74 -0
  60. package/src/Component/HeroBanner/__snapshots__/{PageTitle.stories.tsx.snap → HeroBanner.stories.tsx.snap} +4 -4
  61. package/src/Component/InPageAlert/InPageAlert.stories.ts +20 -22
  62. package/src/Component/InPageAlert/InPageAlert.stories.tsx +5 -5
  63. package/src/Component/InPageAlert/InPageAlert.tsx +15 -41
  64. package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.ts.snap +9 -36
  65. package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.tsx.snap +56 -56
  66. package/src/Component/InPageAlert/in-page-alert.twig +13 -16
  67. package/src/Component/InPageAlert/twig/story-in-page-alert.twig +11 -0
  68. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +6 -70
  69. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.tsx.snap +1 -1
  70. package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +24 -55
  71. package/src/Component/Navigation/__snapshots__/Collapsible.stories.ts.snap +1 -1
  72. package/src/Component/Navigation/__snapshots__/Dropdown.stories.ts.snap +1 -1
  73. package/src/Component/Navigation/__snapshots__/Dropdown.stories.tsx.snap +1 -1
  74. package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +1 -1
  75. package/src/Component/Navigation/__snapshots__/Navigation.stories.tsx.snap +2 -2
  76. package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +1 -1
  77. package/src/Component/Pagination/__snapshots__/Pagination.stories.tsx.snap +1 -1
  78. package/src/Component/Sticky/__snapshots__/Sticky.stories.ts.snap +9 -82
  79. package/src/Component/Sticky/__snapshots__/Sticky.stories.tsx.snap +1 -1
  80. package/src/Component/Tabs/README.md +0 -1
  81. package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +1 -1
  82. package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +1 -1
  83. package/src/Component/Tag/__snapshots__/Tag.stories.ts.snap +3 -3
  84. package/src/Component/Tag/__snapshots__/Tag.stories.tsx.snap +1 -1
  85. package/src/Component/Tile/__snapshots__/Tile.stories.ts.snap +1 -1
  86. package/src/Component/Tile/__snapshots__/Tile.stories.tsx.snap +2 -2
  87. package/src/Layout/Footer/FooterMenu/__snapshots__/FooterMenu.stories.ts.snap +1 -1
  88. package/src/Layout/Grid/__snapshots__/Grid.stories.ts.snap +33 -90
  89. package/src/Layout/Masthead/__snapshots__/Masthead.stories.ts.snap +2 -2
  90. package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +1 -1
  91. package/src/Layout/Section/Section.stories.ts +1 -2
  92. package/src/Layout/Section/__snapshots__/Background.stories.ts.snap +59 -0
  93. package/src/Layout/Section/__snapshots__/Breakouts.stories.ts.snap +80 -0
  94. package/src/Layout/Section/__snapshots__/Flow.stories.ts.snap +91 -0
  95. package/src/Layout/Section/__snapshots__/Section.stories.ts.snap +22 -14
  96. package/src/Layout/Section/twig/section-story.twig +1 -1
  97. package/src/elements.ts +1 -1
  98. package/dist/build/accordion.css +0 -1
  99. package/dist/build/accordion.entry.js +0 -1
  100. package/dist/build/base.css +0 -1
  101. package/dist/build/breadcrumb.css +0 -1
  102. package/dist/build/button.css +0 -1
  103. package/dist/build/callout.css +0 -1
  104. package/dist/build/card.css +0 -1
  105. package/dist/build/chunks/disclosure-widget-CfhDmuvA.js +0 -1
  106. package/dist/build/chunks/keyboard-Cs0cduxq.js +0 -1
  107. package/dist/build/chunks/polyfills-DUM8gN-6.js +0 -1
  108. package/dist/build/chunks/popover-BGbvrIUp.js +0 -1
  109. package/dist/build/chunks/utilities-Bzel_okZ.js +0 -2
  110. package/dist/build/constants.css +0 -1
  111. package/dist/build/container-grid.css +0 -1
  112. package/dist/build/content-block.css +0 -1
  113. package/dist/build/dialog.css +0 -1
  114. package/dist/build/dialog.entry.js +0 -1
  115. package/dist/build/drop-menu.css +0 -1
  116. package/dist/build/drop-menu.entry.js +0 -1
  117. package/dist/build/drupal.css +0 -1
  118. package/dist/build/footer-menu.css +0 -1
  119. package/dist/build/footer.css +0 -1
  120. package/dist/build/form.css +0 -1
  121. package/dist/build/grid.css +0 -1
  122. package/dist/build/header.css +0 -1
  123. package/dist/build/header.entry.js +0 -1
  124. package/dist/build/hero-banner.css +0 -1
  125. package/dist/build/icon.css +0 -1
  126. package/dist/build/in-page-alert.css +0 -1
  127. package/dist/build/in-page-alert.entry.js +0 -1
  128. package/dist/build/in-page-navigation.css +0 -1
  129. package/dist/build/in-page-navigation.entry.js +0 -1
  130. package/dist/build/index.css +0 -1
  131. package/dist/build/link-list.css +0 -1
  132. package/dist/build/masthead.css +0 -1
  133. package/dist/build/nav-list.css +0 -1
  134. package/dist/build/navigation.css +0 -1
  135. package/dist/build/navigation.entry.js +0 -1
  136. package/dist/build/page.css +0 -1
  137. package/dist/build/pagination.css +0 -1
  138. package/dist/build/section.css +0 -1
  139. package/dist/build/sidebar.css +0 -1
  140. package/dist/build/sticky.css +0 -1
  141. package/dist/build/sticky.entry.js +0 -1
  142. package/dist/build/tabs.css +0 -1
  143. package/dist/build/tabs.entry.js +0 -1
  144. package/dist/build/tag.css +0 -1
  145. package/dist/build/tiles.css +0 -1
  146. package/dist/build/utilities.css +0 -1
  147. package/src/Component/Card/__snapshots__/CardGrid.stories.ts.snap +0 -89
  148. package/src/Component/HeroBanner/__snapshots__/PageTitle.stories.ts.snap +0 -31
  149. package/src/Component/InPageAlert/in-page-alert.entry.js +0 -1
  150. package/src/Layout/Section/__snapshots__/SectionBackground.stories.ts.snap +0 -55
  151. package/src/Layout/Section/__snapshots__/SectionsBreakouts.stories.ts.snap +0 -78
  152. package/src/Layout/Section/__snapshots__/SectionsFlowsGroups.stories.ts.snap +0 -89
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Table Flush smoke-test 1`] = `
3
+ exports[`Atom/Table Flush smoke-test 1`] = `
4
4
  <table class=" table--flush">
5
5
  <thead>
6
6
  <tr>
@@ -65,7 +65,7 @@ exports[`Base/Table Flush smoke-test 1`] = `
65
65
  </table>
66
66
  `;
67
67
 
68
- exports[`Base/Table Small smoke-test 1`] = `
68
+ exports[`Atom/Table Small smoke-test 1`] = `
69
69
  <table class=" table--small">
70
70
  <thead>
71
71
  <tr>
@@ -130,7 +130,7 @@ exports[`Base/Table Small smoke-test 1`] = `
130
130
  </table>
131
131
  `;
132
132
 
133
- exports[`Base/Table Table smoke-test 1`] = `
133
+ exports[`Atom/Table Table smoke-test 1`] = `
134
134
  <table class>
135
135
  <thead>
136
136
  <tr>
@@ -195,7 +195,7 @@ exports[`Base/Table Table smoke-test 1`] = `
195
195
  </table>
196
196
  `;
197
197
 
198
- exports[`Base/Table Zebra smoke-test 1`] = `
198
+ exports[`Atom/Table Zebra smoke-test 1`] = `
199
199
  <table class=" table--striped">
200
200
  <thead>
201
201
  <tr>
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Table/Responsive TableResponsive smoke-test 1`] = `
3
+ exports[`Atom/Table/Responsive TableResponsive smoke-test 1`] = `
4
4
  <div class="table--responsive">
5
5
  <table class="table">
6
6
  <thead>
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Typography/Text Text smoke-test 1`] = `
3
+ exports[`Atom/Typography/Text Text smoke-test 1`] = `
4
4
  <p class>
5
5
  Text
6
6
  </p>
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Typography/Text Sizes Example smoke-test 1`] = `
3
+ exports[`Atom/Typography/Text Sizes Example smoke-test 1`] = `
4
4
  <div class="vertical-flow">
5
5
  <p class="text--embellished-headline">
6
6
  Embelished headline: Lorem ipsum dolor sit amet consectetur
@@ -56,7 +56,7 @@ exports[`Base/Typography/Text Sizes Example smoke-test 1`] = `
56
56
  </div>
57
57
  `;
58
58
 
59
- exports[`Base/Typography/Text Sizes TextSizes smoke-test 1`] = `
59
+ exports[`Atom/Typography/Text Sizes TextSizes smoke-test 1`] = `
60
60
  <p class>
61
61
  In publishing and graphic design, lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document without relying on meaningful content (also called greeking). Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.
62
62
  </p>
@@ -6,11 +6,13 @@ const meta: Meta<typeof Component> = {
6
6
  title: "Atom/Video",
7
7
  tags: ["autodocs"],
8
8
  component: Component,
9
+ args: {
10
+ src: "https://www.youtube.com/embed/NpEaa2P7qZI",
11
+ title: "Something from youtube",
12
+ },
9
13
  }
10
14
 
11
15
  export default meta
12
16
  type Story = StoryObj<typeof meta>
13
17
 
14
- export const Video: Story = {
15
- args: {},
16
- }
18
+ export const Video: Story = {}
@@ -1,21 +1,11 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Video Video smoke-test 1`] = `
4
- <p>
5
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
6
- </p>
3
+ exports[`Atom/Video Video smoke-test 1`] = `
7
4
  <figure class="video">
8
- <iframe title="Some video"
9
- width="560"
10
- height="315"
11
- src="https://www.youtube.com/embed/NpEaa2P7qZI"
12
- frameborder="0"
13
- allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
5
+ <iframe src="https://www.youtube.com/embed/NpEaa2P7qZI"
6
+ title="Something from youtube"
14
7
  allowfullscreen
15
8
  >
16
9
  </iframe>
17
10
  </figure>
18
- <p>
19
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
20
- </p>
21
11
  `;
@@ -5,6 +5,11 @@
5
5
  aspect-ratio: 16 / 9;
6
6
  block-size: 100%;
7
7
  inline-size: 100%;
8
+ border: 0;
8
9
  }
9
10
  }
11
+
12
+ .media--video {
13
+ inline-size: 100%;
14
+ }
10
15
  }
@@ -1,9 +1,9 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Components/Accordion Accordion smoke-test 1`] = `
3
+ exports[`Component/Accordion Accordion smoke-test 1`] = `
4
4
  <div class="accordions">
5
5
  <div class="accordion__title">
6
- <h2 class=" ">
6
+ <h2 class>
7
7
  Accordion group
8
8
  </h2>
9
9
  </div>
@@ -38,11 +38,11 @@ exports[`Components/Accordion Accordion smoke-test 1`] = `
38
38
  </div>
39
39
  `;
40
40
 
41
- exports[`Components/Accordion ToggleAll smoke-test 1`] = `
41
+ exports[`Component/Accordion ToggleAll smoke-test 1`] = `
42
42
  <div class="accordions">
43
43
  <mx-accordion-group>
44
44
  <div class="accordion__title">
45
- <h2 class=" ">
45
+ <h2 class>
46
46
  Accordion group
47
47
  </h2>
48
48
  <div class="accordions__toggle-all">
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Components/Accordion Accordion smoke-test 1`] = `
3
+ exports[`Component/Accordion Accordion smoke-test 1`] = `
4
4
  <div class="accordion accordion--divided"
5
5
  data-open="false"
6
6
  >
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Navigation/Breadcrumb Breadcrumb smoke-test 1`] = `
3
+ exports[`Component/Breadcrumb Breadcrumb smoke-test 1`] = `
4
4
  <nav class="nav nav--inline nav--breadcrumb ">
5
5
  <ul>
6
6
  <li>
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Navigation/Breadcrumb Breadcrumb smoke-test 1`] = `
3
+ exports[`Component/Breadcrumb Breadcrumb smoke-test 1`] = `
4
4
  <nav class="nav nav--breadcrumb nav--inline">
5
5
  <ul>
6
6
  <li>
@@ -31,7 +31,7 @@ exports[`Navigation/Breadcrumb Breadcrumb smoke-test 1`] = `
31
31
  </nav>
32
32
  `;
33
33
 
34
- exports[`Navigation/Breadcrumb NoCurrentPage smoke-test 1`] = `
34
+ exports[`Component/Breadcrumb NoCurrentPage smoke-test 1`] = `
35
35
  <nav class="nav nav--breadcrumb nav--inline">
36
36
  <ul>
37
37
  <li>
@@ -0,0 +1,12 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Component/Callout Callout smoke-test 1`] = `
4
+ <div class="callout vertical-flow">
5
+ <h2 class>
6
+ Callout heading
7
+ </h2>
8
+ <p>
9
+ Some callout content.
10
+ </p>
11
+ </div>
12
+ `;
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Components/Card Card smoke-test 1`] = `
3
+ exports[`Component/Card Card smoke-test 1`] = `
4
4
  <div class="container">
5
5
  <article class="card ">
6
6
  <figure class="card__media">
@@ -11,23 +11,25 @@ exports[`Components/Card Card smoke-test 1`] = `
11
11
  </picture>
12
12
  </figure>
13
13
  <div class="card__content vertical-flow-flex">
14
- <h3 class=" ">
14
+ <h3 class>
15
15
  Card title
16
16
  </h3>
17
17
  <div class="text--lede">
18
18
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
19
19
  </div>
20
- <a class="link--more "
20
+ <a class="link link--more "
21
21
  href="#"
22
22
  >
23
- Find out more
23
+ <span>
24
+ Find out more
25
+ </span>
24
26
  </a>
25
27
  </div>
26
28
  </article>
27
29
  </div>
28
30
  `;
29
31
 
30
- exports[`Components/Card Date smoke-test 1`] = `
32
+ exports[`Component/Card Date smoke-test 1`] = `
31
33
  <div class="container">
32
34
  <article class="card ">
33
35
  <figure class="card__media">
@@ -41,23 +43,25 @@ exports[`Components/Card Date smoke-test 1`] = `
41
43
  <div class="text--small">
42
44
  25 May 2025
43
45
  </div>
44
- <h3 class=" ">
46
+ <h3 class>
45
47
  Card title
46
48
  </h3>
47
49
  <div class="text--lede">
48
50
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
49
51
  </div>
50
- <a class="link--more "
52
+ <a class="link link--more "
51
53
  href="#"
52
54
  >
53
- Find out more
55
+ <span>
56
+ Find out more
57
+ </span>
54
58
  </a>
55
59
  </div>
56
60
  </article>
57
61
  </div>
58
62
  `;
59
63
 
60
- exports[`Components/Card Icon smoke-test 1`] = `
64
+ exports[`Component/Card Icon smoke-test 1`] = `
61
65
  <div class="container">
62
66
  <article class="card ">
63
67
  <div class="card__icon">
@@ -65,23 +69,25 @@ exports[`Components/Card Icon smoke-test 1`] = `
65
69
  </span>
66
70
  </div>
67
71
  <div class="card__content vertical-flow-flex">
68
- <h3 class=" ">
72
+ <h3 class>
69
73
  Card title
70
74
  </h3>
71
75
  <div class="text--lede">
72
76
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
73
77
  </div>
74
- <a class="link--more "
78
+ <a class="link link--more "
75
79
  href="#"
76
80
  >
77
- Find out more
81
+ <span>
82
+ Find out more
83
+ </span>
78
84
  </a>
79
85
  </div>
80
86
  </article>
81
87
  </div>
82
88
  `;
83
89
 
84
- exports[`Components/Card LinkList smoke-test 1`] = `
90
+ exports[`Component/Card LinkList smoke-test 1`] = `
85
91
  <div class="container">
86
92
  <article class="card ">
87
93
  <figure class="card__media">
@@ -92,7 +98,7 @@ exports[`Components/Card LinkList smoke-test 1`] = `
92
98
  </picture>
93
99
  </figure>
94
100
  <div class="card__content vertical-flow-flex">
95
- <h3 class=" ">
101
+ <h3 class>
96
102
  Card title
97
103
  </h3>
98
104
  <div class="text--lede">
@@ -126,27 +132,29 @@ exports[`Components/Card LinkList smoke-test 1`] = `
126
132
  </div>
127
133
  `;
128
134
 
129
- exports[`Components/Card NoImage smoke-test 1`] = `
135
+ exports[`Component/Card NoImage smoke-test 1`] = `
130
136
  <div class="container">
131
137
  <article class="card ">
132
138
  <div class="card__content vertical-flow-flex">
133
- <h3 class=" ">
139
+ <h3 class>
134
140
  Card title
135
141
  </h3>
136
142
  <div class="text--lede">
137
143
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
138
144
  </div>
139
- <a class="link--more "
145
+ <a class="link link--more "
140
146
  href="#"
141
147
  >
142
- Find out more
148
+ <span>
149
+ Find out more
150
+ </span>
143
151
  </a>
144
152
  </div>
145
153
  </article>
146
154
  </div>
147
155
  `;
148
156
 
149
- exports[`Components/Card Tags smoke-test 1`] = `
157
+ exports[`Component/Card Tags smoke-test 1`] = `
150
158
  <div class="container">
151
159
  <article class="card ">
152
160
  <figure class="card__media">
@@ -157,28 +165,30 @@ exports[`Components/Card Tags smoke-test 1`] = `
157
165
  </picture>
158
166
  </figure>
159
167
  <div class="card__content vertical-flow-flex">
160
- <h3 class=" ">
168
+ <h3 class>
161
169
  Card title
162
170
  </h3>
163
171
  <ul class="tags">
164
172
  <li>
165
173
  <span class="tag">
166
- hello
174
+ Music
167
175
  </span>
168
176
  </li>
169
177
  <li>
170
178
  <span class="tag">
171
- news
179
+ News
172
180
  </span>
173
181
  </li>
174
182
  </ul>
175
183
  <div class="text--lede">
176
184
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
177
185
  </div>
178
- <a class="link--more "
186
+ <a class="link link--more "
179
187
  href="#"
180
188
  >
181
- Find out more
189
+ <span>
190
+ Find out more
191
+ </span>
182
192
  </a>
183
193
  </div>
184
194
  </article>
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Components/Card Card smoke-test 1`] = `
3
+ exports[`Component/Card Card smoke-test 1`] = `
4
4
  <div class="container">
5
5
  <article class="card">
6
6
  <figure class="card__media stack">
@@ -29,7 +29,7 @@ exports[`Components/Card Card smoke-test 1`] = `
29
29
  </div>
30
30
  `;
31
31
 
32
- exports[`Components/Card Linked smoke-test 1`] = `
32
+ exports[`Component/Card Linked smoke-test 1`] = `
33
33
  <div class="container">
34
34
  <article class="card card--clickable">
35
35
  <figure class="card__media stack">
@@ -58,7 +58,7 @@ exports[`Components/Card Linked smoke-test 1`] = `
58
58
  </div>
59
59
  `;
60
60
 
61
- exports[`Components/Card Right smoke-test 1`] = `
61
+ exports[`Component/Card Right smoke-test 1`] = `
62
62
  <div class="container">
63
63
  <article class="card card--right">
64
64
  <figure class="card__media stack">
@@ -1,26 +1,9 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Components/ContentBlock ContentBlock smoke-test 1`] = `
4
- <section class="section section--l section--narrow">
5
- <div class="content-block vertical-flow-flex">
6
- <h2>
7
- Submit your documents in less than 5 minutes. Seriously.
8
- </h2>
9
- <p class="text--m">
10
- Please make sure you have your account details ready.
11
- </p>
12
- <div class="content-block__actions flex">
13
- <a href="#"
14
- class="button button--large button--primary"
15
- >
16
- Let's get started
17
- </a>
18
- <a href="#"
19
- class="button button--large button--text"
20
- >
21
- Find out more
22
- </a>
23
- </div>
24
- </div>
25
- </section>
3
+ exports[`Component/ContentBlock ContentBlock smoke-test 1`] = `
4
+ "
5
+ &lt; class="section "&gt;
6
+
7
+
8
+ "
26
9
  `;
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Components/ContentBlock ContentBlock smoke-test 1`] = `
3
+ exports[`Component/ContentBlock ContentBlock smoke-test 1`] = `
4
4
  <div class="content-block vertical-flow-flex">
5
5
  <h2 class
6
6
  id="submit-your-documents"
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Components/Dialog Dialog smoke-test 1`] = `
3
+ exports[`Component/Dialog Dialog smoke-test 1`] = `
4
4
  <p>
5
5
  <a href="#dialog-df"
6
6
  class="button is-excluded"
@@ -42,7 +42,7 @@ exports[`Components/Dialog Dialog smoke-test 1`] = `
42
42
  </mx-dialog>
43
43
  `;
44
44
 
45
- exports[`Components/Dialog Fullscreen smoke-test 1`] = `
45
+ exports[`Component/Dialog Fullscreen smoke-test 1`] = `
46
46
  <p>
47
47
  <a href="#dialog-df"
48
48
  class="button is-excluded"
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Components/Dialog Dialog smoke-test 1`] = `
3
+ exports[`Component/Dialog Dialog smoke-test 1`] = `
4
4
  <dialog class="dialog"
5
5
  open
6
6
  >
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Components/DropMenu DropMenu smoke-test 1`] = `
3
+ exports[`Component/DropMenu DropMenu smoke-test 1`] = `
4
4
  <mx-dropmenu closeonclick>
5
5
  <button id="unique-0"
6
6
  class="drop-menu__trigger button icon icon--chevron-down icon--end"
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Components/DropMenu DropMenu smoke-test 1`] = `
3
+ exports[`Component/DropMenu DropMenu smoke-test 1`] = `
4
4
  <button id="unique-0"
5
5
  type="button"
6
6
  class="button icon icon--chevron-down icon--end drop-menu__trigger"
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @file InPageAlerts
2
+ * @file GlobalAlerts
3
3
  *
4
- * When a InPageAlert is closed the id is written to local storage.
5
- * This is checked as the page is re-rendered, if a InPageAlert with the same ID is
4
+ * When a GlobalAlert is closed the id is written to local storage.
5
+ * This is checked as the page is re-rendered, if a GlobalAlert with the same ID is
6
6
  * created it will be removed from the dom.
7
7
  */
8
8
 
9
9
  import { makeAnchor, createElement } from "../../../Utility/utilities"
10
10
 
11
- export default class InPageAlert extends HTMLElement {
11
+ export default class GlobalAlert extends HTMLElement {
12
12
  internals_: ElementInternals
13
13
  controller: AbortController
14
14
 
@@ -19,6 +19,7 @@ export default class InPageAlert extends HTMLElement {
19
19
  }
20
20
 
21
21
  connectedCallback(): void {
22
+ if (!this.container) return
22
23
  this.id = this.id || this.generatedId()
23
24
  if (this.localStorage) {
24
25
  this.controller.abort()
@@ -41,8 +42,8 @@ export default class InPageAlert extends HTMLElement {
41
42
  this.controller.abort()
42
43
  this.remove()
43
44
  this.localStorage = "true"
44
- const newEvent: CustomEvent<{ id: string; target: InPageAlert }> =
45
- new CustomEvent("InPageAlert-close", {
45
+ const newEvent: CustomEvent<{ id: string; target: GlobalAlert }> =
46
+ new CustomEvent("GlobalAlert-close", {
46
47
  bubbles: true,
47
48
  cancelable: true,
48
49
  detail: {
@@ -61,13 +62,23 @@ export default class InPageAlert extends HTMLElement {
61
62
  localStorage.setItem(this.id, value)
62
63
  }
63
64
 
65
+ get container(): HTMLElement {
66
+ const element: HTMLElement = this.querySelector("[data-container]")
67
+ if (!element) {
68
+ throw new Error(
69
+ `${this.localName} must contain a [data-container] element.`,
70
+ )
71
+ }
72
+ return element
73
+ }
74
+
64
75
  get close(): HTMLButtonElement {
65
76
  let closeBtn: HTMLButtonElement = this.querySelector(".icon--close")
66
77
  if (!closeBtn) {
67
78
  closeBtn = createElement(
68
- `<button class="icon icon--close" aria-controls="${this.id}" aria-label="Close InPageAlert" type="button"></button>`,
79
+ `<button class="icon icon--close" aria-controls="${this.id}" aria-label="Close GlobalAlert" type="button"></button>`,
69
80
  ) as HTMLButtonElement
70
- this.appendChild(closeBtn)
81
+ this.container.appendChild(closeBtn)
71
82
  }
72
83
  return closeBtn
73
84
  }
@@ -78,10 +89,10 @@ export default class InPageAlert extends HTMLElement {
78
89
  }
79
90
  }
80
91
 
81
- customElements.define("mx-closable-alert", InPageAlert)
92
+ customElements.define("mx-closable-alert", GlobalAlert)
82
93
 
83
94
  declare global {
84
95
  interface HTMLElementTagNameMap {
85
- "mx-closable-alert": InPageAlert
96
+ "mx-closable-alert": GlobalAlert
86
97
  }
87
98
  }
@@ -0,0 +1,49 @@
1
+ import { Meta, StoryObj } from "@storybook/html"
2
+ import Component from "./twig/story-global-alert.twig"
3
+ import "./global-alert.css"
4
+ import "./Elements/ClosableAlert"
5
+ import {
6
+ GlobalAlert as GlobalAlertType,
7
+ GlobalAlertTypes,
8
+ HeadingTypes,
9
+ } from "@pnx-mixtape/ids-shape"
10
+
11
+ const meta: Meta<GlobalAlertType> = {
12
+ tags: ["autodocs"],
13
+ component: Component,
14
+ argTypes: {
15
+ type: { options: Object.values(GlobalAlertTypes), control: "radio" },
16
+ id: {
17
+ control: "text",
18
+ description: "Set an id to get stable localStorage entry.",
19
+ },
20
+ dismissible: { control: "boolean" },
21
+ // @ts-expect-error The controls follow the shape
22
+ "title.title": { control: "text" },
23
+ "title.as": { options: Object.values(HeadingTypes), control: "select" },
24
+ "link.href": { control: "text" },
25
+ "link.title": { control: "text" },
26
+ },
27
+ args: {
28
+ title: {
29
+ title: "In page alert",
30
+ as: HeadingTypes.TWO,
31
+ modifiers: [HeadingTypes.FOUR],
32
+ },
33
+ content: "Something happened that requires your attention",
34
+ type: GlobalAlertTypes.LIGHT,
35
+ dismissible: true,
36
+ },
37
+ }
38
+
39
+ export default meta
40
+ type Story = StoryObj<GlobalAlertType>
41
+
42
+ export const GlobalAlert: Story = {}
43
+
44
+ export const Critical: Story = {
45
+ args: {
46
+ dismissible: false,
47
+ type: GlobalAlertTypes.CRITICAL,
48
+ },
49
+ }
@@ -0,0 +1,33 @@
1
+ import { Meta, StoryObj } from "@storybook/react"
2
+ import Component from "./GlobalAlert"
3
+ import "./global-alert.css"
4
+ import { GlobalAlertTypes } from "@pnx-mixtape/ids-shape"
5
+
6
+ const meta: Meta<typeof Component> = {
7
+ tags: ["autodocs"],
8
+ component: Component,
9
+ args: {
10
+ children: (
11
+ <p>
12
+ <b>Something happened.</b> And if you&apos;d like to know what,{" "}
13
+ <a href="#">Click here</a>.
14
+ </p>
15
+ ),
16
+ dismissible: true,
17
+ },
18
+ argTypes: {
19
+ type: { options: Object.values(GlobalAlertTypes), control: "radio" },
20
+ },
21
+ }
22
+
23
+ export default meta
24
+ type Story = StoryObj<typeof meta>
25
+
26
+ export const GlobalAlert: Story = {}
27
+
28
+ export const Critical: Story = {
29
+ args: {
30
+ type: GlobalAlertTypes.CRITICAL,
31
+ dismissible: false,
32
+ },
33
+ }