@pnx-mixtape/mxds 0.0.2 → 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 (265) hide show
  1. package/README.md +13 -13
  2. package/package.json +5 -4
  3. package/src/Atom/Background/__snapshots__/Backgrounds.stories.ts.snap +3 -3
  4. package/src/Atom/Background/_background.css +1 -22
  5. package/src/Atom/Blockquote/_blockquote.css +1 -1
  6. package/src/Atom/Button/Button.stories.ts +4 -6
  7. package/src/Atom/Button/README.md +3 -3
  8. package/src/Atom/Button/__snapshots__/Button.stories.ts.snap +23 -11
  9. package/src/Atom/Button/__snapshots__/Button.stories.tsx.snap +2 -2
  10. package/src/Atom/Button/_buttons-styles.css +1 -1
  11. package/src/Atom/Button/_buttons.css +5 -1
  12. package/src/Atom/Button/button.twig +6 -4
  13. package/src/Atom/Button/twig/story-button.twig +11 -0
  14. package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.tsx.snap +1 -1
  15. package/src/Atom/Heading/__snapshots__/Heading.stories.ts.snap +2 -2
  16. package/src/Atom/Heading/__snapshots__/Heading.stories.tsx.snap +1 -1
  17. package/src/Atom/Heading/_headings.css +1 -1
  18. package/src/Atom/Heading/heading.twig +19 -1
  19. package/src/Atom/Icon/README.md +1 -1
  20. package/src/Atom/Icon/__snapshots__/Icon.stories.ts.snap +3 -3
  21. package/src/Atom/Icon/__snapshots__/Icon.stories.tsx.snap +3 -3
  22. package/src/Atom/Icon/_extended-set.css +1 -1
  23. package/src/Atom/Icon/_icon.css +5 -5
  24. package/src/Atom/Image/__snapshots__/Image.stories.ts.snap +1 -1
  25. package/src/Atom/Image/_image.css +1 -1
  26. package/src/Atom/Link/Link.stories.ts +31 -7
  27. package/src/Atom/Link/__snapshots__/Link.stories.ts.snap +46 -6
  28. package/src/Atom/Link/__snapshots__/Link.stories.tsx.snap +3 -3
  29. package/src/Atom/Link/_links.css +24 -2
  30. package/src/Atom/Link/link.twig +8 -6
  31. package/src/Atom/Link/twig/story-link.twig +11 -0
  32. package/src/Atom/Media/Media.stories.ts +17 -1
  33. package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +17 -2
  34. package/src/Atom/Media/__snapshots__/Media.stories.tsx.snap +2 -2
  35. package/src/Atom/Media/_media.css +1 -1
  36. package/src/Atom/Media/media.twig +1 -5
  37. package/src/Atom/Media/twig/story-media.twig +11 -0
  38. package/src/Atom/NavList/__snapshots__/NavList.stories.ts.snap +1 -1
  39. package/src/Atom/NavList/nav-list.css +1 -1
  40. package/src/Atom/README.md +1 -1
  41. package/src/Atom/Spacing/__snapshots__/Spacing.stories.ts.snap +1 -1
  42. package/src/Atom/Spacing/_spacing.css +1 -1
  43. package/src/Atom/Table/__snapshots__/Table.stories.ts.snap +4 -4
  44. package/src/Atom/Table/__snapshots__/TableResponsive.stories.ts.snap +1 -1
  45. package/src/Atom/Table/_table.css +1 -1
  46. package/src/Atom/Text/__snapshots__/Text.stories.tsx.snap +1 -1
  47. package/src/Atom/Text/__snapshots__/TextSizes.stories.ts.snap +2 -2
  48. package/src/Atom/Text/_text-align.css +1 -1
  49. package/src/Atom/Text/_text-sizes.css +1 -1
  50. package/src/Atom/Video/Video.stories.ts +5 -3
  51. package/src/Atom/Video/__snapshots__/Video.stories.ts.snap +3 -13
  52. package/src/Atom/Video/_video.css +6 -1
  53. package/src/Atom/Video/video.twig +10 -4
  54. package/src/Atom/_animated.css +1 -1
  55. package/src/Atom/_flow-legacy.css +1 -1
  56. package/src/Atom/_flow.css +1 -1
  57. package/src/Atom/_generic.css +1 -1
  58. package/src/Atom/_hr.css +1 -1
  59. package/src/Atom/base.css +2 -2
  60. package/src/Component/Accordion/README.md +7 -17
  61. package/src/Component/Accordion/__snapshots__/Accordion.stories.ts.snap +4 -4
  62. package/src/Component/Accordion/__snapshots__/Accordion.stories.tsx.snap +1 -1
  63. package/src/Component/Accordion/accordion.css +2 -2
  64. package/src/Component/Accordion/accordion.entry.js +2 -0
  65. package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.ts.snap +1 -1
  66. package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.tsx.snap +2 -2
  67. package/src/Component/Breadcrumb/breadcrumb.css +1 -1
  68. package/src/Component/Callout/__snapshots__/Callout.stories.ts.snap +12 -0
  69. package/src/Component/Callout/callout.css +1 -1
  70. package/src/Component/Card/README.md +7 -13
  71. package/src/Component/Card/__snapshots__/Card.stories.ts.snap +34 -24
  72. package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +3 -3
  73. package/src/Component/Card/card.css +3 -3
  74. package/src/Component/ContentBlock/README.md +7 -13
  75. package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.ts.snap +6 -23
  76. package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.tsx.snap +1 -1
  77. package/src/Component/ContentBlock/content-block.css +2 -2
  78. package/src/Component/Dialog/README.md +15 -49
  79. package/src/Component/Dialog/__snapshots__/Dialog.stories.ts.snap +2 -2
  80. package/src/Component/Dialog/__snapshots__/Dialog.stories.tsx.snap +1 -1
  81. package/src/Component/Dialog/dialog.css +3 -3
  82. package/src/Component/Dialog/dialog.entry.js +1 -0
  83. package/src/Component/DropMenu/README.md +19 -4
  84. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +1 -1
  85. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +1 -1
  86. package/src/Component/DropMenu/drop-menu.css +1 -1
  87. package/src/Component/DropMenu/drop-menu.entry.js +1 -0
  88. package/src/Component/{InPageAlert/Elements/InPageAlert.ts → GlobalAlert/Elements/ClosableAlert.ts} +21 -10
  89. package/src/Component/GlobalAlert/GlobalAlert.stories.ts +49 -0
  90. package/src/Component/GlobalAlert/GlobalAlert.stories.tsx +33 -0
  91. package/src/Component/GlobalAlert/GlobalAlert.tsx +50 -0
  92. package/src/Component/GlobalAlert/README.md +27 -0
  93. package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.ts.snap +43 -0
  94. package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.tsx.snap +48 -0
  95. package/src/Component/GlobalAlert/global-alert.css +55 -0
  96. package/src/Component/GlobalAlert/global-alert.entry.js +1 -0
  97. package/src/Component/GlobalAlert/global-alert.twig +30 -0
  98. package/src/Component/GlobalAlert/twig/story-global-alert.twig +14 -0
  99. package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +74 -0
  100. package/src/Component/HeroBanner/__snapshots__/{PageTitle.stories.tsx.snap → HeroBanner.stories.tsx.snap} +4 -4
  101. package/src/Component/HeroBanner/hero-banner.css +1 -1
  102. package/src/Component/HeroBanner/hero-banner.twig +1 -0
  103. package/src/Component/InPageAlert/InPageAlert.stories.ts +20 -22
  104. package/src/Component/InPageAlert/InPageAlert.stories.tsx +5 -5
  105. package/src/Component/InPageAlert/InPageAlert.tsx +15 -41
  106. package/src/Component/InPageAlert/README.md +4 -4
  107. package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.ts.snap +9 -36
  108. package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.tsx.snap +56 -56
  109. package/src/Component/InPageAlert/in-page-alert.css +2 -2
  110. package/src/Component/InPageAlert/in-page-alert.twig +13 -16
  111. package/src/Component/InPageAlert/twig/story-in-page-alert.twig +11 -0
  112. package/src/Component/InPageNavigation/README.md +10 -15
  113. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +6 -70
  114. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.tsx.snap +1 -1
  115. package/src/Component/InPageNavigation/in-page-navigation.css +2 -2
  116. package/src/Component/InPageNavigation/in-page-navigation.entry.js +1 -0
  117. package/src/Component/LinkList/README.md +3 -3
  118. package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +24 -55
  119. package/src/Component/LinkList/link-list.css +1 -1
  120. package/src/Component/Navigation/README.md +16 -7
  121. package/src/Component/Navigation/__snapshots__/Collapsible.stories.ts.snap +1 -1
  122. package/src/Component/Navigation/__snapshots__/Dropdown.stories.ts.snap +1 -1
  123. package/src/Component/Navigation/__snapshots__/Dropdown.stories.tsx.snap +1 -1
  124. package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +1 -1
  125. package/src/Component/Navigation/__snapshots__/Navigation.stories.tsx.snap +2 -2
  126. package/src/Component/Navigation/_navigation-collapsible.css +1 -1
  127. package/src/Component/Navigation/_navigation-dropdown.css +1 -1
  128. package/src/Component/Navigation/_navigation-mega.css +1 -1
  129. package/src/Component/Navigation/_navigation.css +1 -1
  130. package/src/Component/Navigation/navigation.entry.js +1 -0
  131. package/src/Component/Pagination/README.md +3 -3
  132. package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +1 -1
  133. package/src/Component/Pagination/__snapshots__/Pagination.stories.tsx.snap +1 -1
  134. package/src/Component/Pagination/pagination.css +1 -1
  135. package/src/Component/Sticky/README.md +12 -5
  136. package/src/Component/Sticky/__snapshots__/Sticky.stories.ts.snap +9 -82
  137. package/src/Component/Sticky/__snapshots__/Sticky.stories.tsx.snap +1 -1
  138. package/src/Component/Sticky/sticky.css +2 -2
  139. package/src/Component/Sticky/sticky.entry.js +1 -0
  140. package/src/Component/Tabs/README.md +11 -4
  141. package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +1 -1
  142. package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +1 -1
  143. package/src/Component/Tabs/tabs.css +2 -2
  144. package/src/Component/Tabs/tabs.entry.js +1 -0
  145. package/src/Component/Tag/README.md +2 -2
  146. package/src/Component/Tag/__snapshots__/Tag.stories.ts.snap +3 -3
  147. package/src/Component/Tag/__snapshots__/Tag.stories.tsx.snap +1 -1
  148. package/src/Component/Tag/tag.css +1 -1
  149. package/src/Component/Tile/__snapshots__/Tile.stories.ts.snap +1 -1
  150. package/src/Component/Tile/__snapshots__/Tile.stories.tsx.snap +2 -2
  151. package/src/Component/Tile/tiles.css +1 -1
  152. package/src/Form/README.md +2 -2
  153. package/src/Form/form.css +12 -12
  154. package/src/Layout/Footer/FooterMenu/__snapshots__/FooterMenu.stories.ts.snap +1 -1
  155. package/src/Layout/Footer/FooterMenu/footer-menu.css +1 -1
  156. package/src/Layout/Footer/footer.css +1 -1
  157. package/src/Layout/Grid/__snapshots__/Grid.stories.ts.snap +33 -90
  158. package/src/Layout/Grid/container-grid.css +2 -2
  159. package/src/Layout/Grid/grid.css +2 -2
  160. package/src/Layout/Header/_header.css +1 -1
  161. package/src/Layout/Header/_toggles.css +1 -1
  162. package/src/Layout/Header/header.entry.js +1 -0
  163. package/src/Layout/Masthead/__snapshots__/Masthead.stories.ts.snap +2 -2
  164. package/src/Layout/Masthead/masthead.css +5 -5
  165. package/src/Layout/Masthead/masthead.twig +2 -2
  166. package/src/Layout/Page/README.md +2 -2
  167. package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +1 -1
  168. package/src/Layout/Page/page.css +2 -2
  169. package/src/Layout/README.md +3 -2
  170. package/src/Layout/Section/Section.stories.ts +1 -2
  171. package/src/Layout/Section/__snapshots__/Background.stories.ts.snap +59 -0
  172. package/src/Layout/Section/__snapshots__/Breakouts.stories.ts.snap +80 -0
  173. package/src/Layout/Section/__snapshots__/Flow.stories.ts.snap +91 -0
  174. package/src/Layout/Section/__snapshots__/Section.stories.ts.snap +22 -14
  175. package/src/Layout/Section/section.css +4 -4
  176. package/src/Layout/Section/twig/section-story.twig +1 -1
  177. package/src/Layout/Sidebar/sidebar.css +1 -1
  178. package/src/Utility/Drupal/README.md +1 -1
  179. package/src/Utility/README.md +1 -1
  180. package/src/Utility/_layout-utils.css +1 -1
  181. package/src/Utility/utilities.css +3 -3
  182. package/src/elements.ts +1 -1
  183. package/dist/build/Accordion.js +0 -61
  184. package/dist/build/Accordion.js.map +0 -1
  185. package/dist/build/AccordionDiv.js +0 -62
  186. package/dist/build/AccordionDiv.js.map +0 -1
  187. package/dist/build/AccordionGroup.js +0 -85
  188. package/dist/build/AccordionGroup.js.map +0 -1
  189. package/dist/build/AccordionMobile.js +0 -31
  190. package/dist/build/AccordionMobile.js.map +0 -1
  191. package/dist/build/Dialog.js +0 -116
  192. package/dist/build/Dialog.js.map +0 -1
  193. package/dist/build/DropMenu.js +0 -132
  194. package/dist/build/DropMenu.js.map +0 -1
  195. package/dist/build/GlobalToggle.js +0 -103
  196. package/dist/build/GlobalToggle.js.map +0 -1
  197. package/dist/build/InPageAlert.js +0 -61
  198. package/dist/build/InPageAlert.js.map +0 -1
  199. package/dist/build/InPageNavigation.js +0 -92
  200. package/dist/build/InPageNavigation.js.map +0 -1
  201. package/dist/build/Navigation.js +0 -126
  202. package/dist/build/Navigation.js.map +0 -1
  203. package/dist/build/Sticky.js +0 -63
  204. package/dist/build/Sticky.js.map +0 -1
  205. package/dist/build/Tabs.js +0 -164
  206. package/dist/build/Tabs.js.map +0 -1
  207. package/dist/build/accordion.css +0 -108
  208. package/dist/build/base.css +0 -1000
  209. package/dist/build/breadcrumb.css +0 -47
  210. package/dist/build/breakpoint-loader.js +0 -52
  211. package/dist/build/breakpoint-loader.js.map +0 -1
  212. package/dist/build/button.css +0 -126
  213. package/dist/build/callout.css +0 -11
  214. package/dist/build/card.css +0 -135
  215. package/dist/build/chunks/js.cookie-CiMiGxWx.js +0 -101
  216. package/dist/build/chunks/js.cookie-CiMiGxWx.js.map +0 -1
  217. package/dist/build/chunks/polyfills-CJ5uTmUJ.js +0 -749
  218. package/dist/build/chunks/polyfills-CJ5uTmUJ.js.map +0 -1
  219. package/dist/build/chunks/popover-wbPSyFRj.js +0 -654
  220. package/dist/build/chunks/popover-wbPSyFRj.js.map +0 -1
  221. package/dist/build/chunks/utilities-BIk0P2KX.js +0 -61
  222. package/dist/build/chunks/utilities-BIk0P2KX.js.map +0 -1
  223. package/dist/build/constants.css +0 -120
  224. package/dist/build/container-grid.css +0 -207
  225. package/dist/build/content-block.css +0 -23
  226. package/dist/build/cookie-compliance.js +0 -122
  227. package/dist/build/cookie-compliance.js.map +0 -1
  228. package/dist/build/dialog.css +0 -98
  229. package/dist/build/disclosure-widget.js +0 -124
  230. package/dist/build/disclosure-widget.js.map +0 -1
  231. package/dist/build/drop-menu.css +0 -78
  232. package/dist/build/drupal.css +0 -74
  233. package/dist/build/footer-menu.css +0 -32
  234. package/dist/build/footer.css +0 -61
  235. package/dist/build/form.css +0 -589
  236. package/dist/build/grid.css +0 -200
  237. package/dist/build/header.css +0 -131
  238. package/dist/build/hero-banner.css +0 -62
  239. package/dist/build/icon.css +0 -399
  240. package/dist/build/in-page-alert.css +0 -94
  241. package/dist/build/in-page-navigation.css +0 -17
  242. package/dist/build/index.css +0 -4980
  243. package/dist/build/io-loader.js +0 -44
  244. package/dist/build/io-loader.js.map +0 -1
  245. package/dist/build/keyboard.js +0 -101
  246. package/dist/build/keyboard.js.map +0 -1
  247. package/dist/build/link-list.css +0 -72
  248. package/dist/build/masthead.css +0 -39
  249. package/dist/build/nav-list.css +0 -29
  250. package/dist/build/navigation.css +0 -371
  251. package/dist/build/page.css +0 -184
  252. package/dist/build/pagination.css +0 -123
  253. package/dist/build/section.css +0 -160
  254. package/dist/build/sidebar.css +0 -105
  255. package/dist/build/sticky.css +0 -47
  256. package/dist/build/tabs.css +0 -106
  257. package/dist/build/tag.css +0 -67
  258. package/dist/build/tiles.css +0 -61
  259. package/dist/build/utilities.css +0 -175
  260. package/src/Component/Card/__snapshots__/CardGrid.stories.ts.snap +0 -89
  261. package/src/Component/HeroBanner/__snapshots__/PageTitle.stories.ts.snap +0 -31
  262. package/src/Layout/Section/__snapshots__/SectionBackground.stories.ts.snap +0 -55
  263. package/src/Layout/Section/__snapshots__/SectionsBreakouts.stories.ts.snap +0 -78
  264. package/src/Layout/Section/__snapshots__/SectionsFlowsGroups.stories.ts.snap +0 -89
  265. package/src/index.css +0 -27
@@ -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>
@@ -2,7 +2,7 @@
2
2
  * Breadcrumb Navigation
3
3
  */
4
4
 
5
- @layer components {
5
+ @layer design-system.components {
6
6
  .nav--breadcrumb {
7
7
  --nav-font-size: var(--font-size-s);
8
8
 
@@ -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,4 +1,4 @@
1
- @layer components {
1
+ @layer design-system.components {
2
2
  .callout {
3
3
  padding-inline-start: var(--line-gap, var(--gap));
4
4
  border-inline-start: var(--line-width, 6px) solid
@@ -4,18 +4,12 @@
4
4
 
5
5
  **CSS**
6
6
 
7
- `@import @pnx-mixtape/mxds/card.css';`
7
+ `@import @pnx-mixtape/mxds/src/Component/Card/card.css';`
8
8
 
9
- **HTML**
9
+ **Twig**
10
10
 
11
- ```html
12
- <div class="card">
13
- <figure class="card__media">
14
- <img src="https://via.placeholder.com/788x556" alt="Descriptive text" />
15
- </figure>
16
- <div class="card__content">
17
- <h3>Title</h3>
18
- <p>Body content</p>
19
- </div>
20
- </div>
21
- ```
11
+ You can setup a twig namespace in your project if you wish to use the twig files directly.
12
+
13
+ - Eg: `{% extends '@mixtape/Component/Card/card.twig' %}`
14
+
15
+ Alternatively copy/paste the file for more control.
@@ -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">
@@ -2,7 +2,7 @@
2
2
  * Content Card
3
3
  */
4
4
 
5
- @layer components {
5
+ @layer design-system.components {
6
6
  .card {
7
7
  display: grid;
8
8
  grid-template: "media" auto "content" 1fr / 1fr;
@@ -82,7 +82,7 @@
82
82
  * Content Card Grid
83
83
  */
84
84
 
85
- @layer components {
85
+ @layer design-system.components {
86
86
  .grid:has(> *:nth-child(2):last-child) > :is(.card, .container:has(.card)) {
87
87
  inline-size: 100%;
88
88
  max-inline-size: var(--max-card-width, 37ch);
@@ -94,7 +94,7 @@
94
94
  * Content Card Linked
95
95
  */
96
96
 
97
- @layer components {
97
+ @layer design-system.components {
98
98
  a[href].card {
99
99
  &:hover {
100
100
  color: inherit;
@@ -4,18 +4,12 @@
4
4
 
5
5
  **CSS**
6
6
 
7
- `@import '@pnx-mixtape/mxds/content-block.css';`
7
+ `@import '@pnx-mixtape/mxds/src/Component/ContentBlock/content-block.css';`
8
8
 
9
- **HTML**
9
+ **Twig**
10
10
 
11
- ```html
12
- <div class="content-block">
13
- <h2>Title</h2>
14
- <p>Body content</p>
15
- <div class="content-block__actions">
16
- <a href="#" class="button button--large button--primary"
17
- >Let's get started</a
18
- >
19
- </div>
20
- </div>
21
- ```
11
+ You can setup a twig namespace in your project if you wish to use the twig files directly.
12
+
13
+ - Eg: `{% extends '@mixtape/Component/ContentBlock/content-block.twig' %}`
14
+
15
+ Alternatively copy/paste the file for more control.
@@ -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"
@@ -2,7 +2,7 @@
2
2
  * Content block
3
3
  */
4
4
 
5
- @layer components {
5
+ @layer design-system.components {
6
6
  .content-block {
7
7
  inline-size: 100%;
8
8
  margin-inline: auto;
@@ -14,7 +14,7 @@
14
14
  }
15
15
  }
16
16
 
17
- @layer utilities {
17
+ @layer design-system.utilities {
18
18
  .vertical-flow-flex.content-block {
19
19
  align-items: center;
20
20
  }
@@ -4,60 +4,26 @@
4
4
 
5
5
  **CSS**
6
6
 
7
- `@import '@pnx-mixtape/mxds/dialog.css';`
7
+ `@import '@pnx-mixtape/mxds/src/Component/Dialog/dialog.css';`
8
8
 
9
- **Web Components**
9
+ **Twig**
10
10
 
11
- Web Components are self defined, simply import the desired feature. These do not use the Shadow DOM. External CSS applies.
11
+ You can setup a twig namespace in your project if you wish to use the twig files directly.
12
12
 
13
- - DialogBase import: `import '@pnx-mixtape/mxds/dialog/DialogBase';` and be sure to include `<mx-dialog>` around the `<dialog />` tag.
13
+ - Eg: `{% extends '@mixtape/Component/Dialog/dialog.twig' %}`
14
+
15
+ Alternatively copy/paste the file for more control.
16
+
17
+ **JS Custom Element**
18
+
19
+ Custom Elements are self defined, simply import the desired feature.
20
+ These do not use the Shadow DOM and are not typical Web Components.
21
+ External CSS applies.
22
+ No Polyfills or frameworks are required.
23
+
24
+ - Dialog import: `import '@pnx-mixtape/mxds/src/Component/Dialog/Elements/Dialog';` and be sure to include `<mx-dialog>` around the `<dialog />` tag.
14
25
  - The triggering element should either have `aria-controls="[id]"` or `href="#[id]"` where the ID matches the dialog (required).
15
26
  - Use the `[data-modal]` attribute to trigger `HTMLDialogElement.showModal()` on open. When omitted `HTMLDialogElement.show()` is used.
16
27
  - Add `[data-close]` to any button that should call `HTMLDialogElement.close()`
17
28
 
18
- ```html
19
- <button aria-controls="example-dialog" class="button button--primary">
20
- Dialog trigger
21
- </button>
22
- <mx-dialog id="example-dialog" data-modal>
23
- <dialog class="dialog">
24
- <button
25
- autofocus
26
- class="button button--icon-only icon icon--close"
27
- data-close
28
- >
29
- Close dialog
30
- </button>
31
- <div class="dialog__content">
32
- <h2>Title</h2>
33
- <p>Body content.</p>
34
- </div>
35
- </dialog>
36
- </mx-dialog>
37
- ```
38
-
39
29
  See twig files for all HTML examples.
40
-
41
- **Vanilla JS (to be deprecated)**
42
-
43
- - ES6 import: `import Dialog from '@pnx-mixtape/mxds/dialog';`
44
- - Script tag: `<script src="dist/dialog.js" type="text/javascript"></script>`
45
-
46
- **HTML**
47
-
48
- ```html
49
- <button
50
- data-dialog
51
- aria-controls="example-dialog"
52
- class="button button--primary"
53
- >
54
- Dialog trigger
55
- </button>
56
-
57
- <dialog class="dialog" id="example-dialog">
58
- <div class="dialog__content">
59
- <h2>Title</h2>
60
- <p>Body content.</p>
61
- </div>
62
- </dialog>
63
- ```
@@ -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
  >
@@ -2,13 +2,13 @@
2
2
  * Dialog
3
3
  */
4
4
 
5
- @layer defaults {
5
+ @layer design-system.defaults {
6
6
  mx-dialog {
7
7
  display: block;
8
8
  }
9
9
  }
10
10
 
11
- @layer components {
11
+ @layer design-system.components {
12
12
  .dialog {
13
13
  max-inline-size: var(--container-max-width);
14
14
  max-block-size: 90vh;
@@ -54,7 +54,7 @@
54
54
  * Dialog fullscreen.
55
55
  */
56
56
 
57
- @layer components {
57
+ @layer design-system.components {
58
58
  .dialog--fullscreen {
59
59
  box-shadow: none;
60
60
  border: 0;
@@ -0,0 +1 @@
1
+ import "./Elements/Dialog"
@@ -1,11 +1,26 @@
1
1
  # Drop Menu
2
2
 
3
- Documentation and examples: [drop-menu](https://mixtape.pnx.io/drop-menu)
4
-
5
3
  ### How to use
6
4
 
7
5
  **CSS**
8
6
 
9
- `@import '@pnx-mixtape/mxds/drop-menu.css';`
7
+ `@import '@pnx-mixtape/mxds/src/Component/DropMenu/drop-menu.css';`
8
+
9
+ **Twig**
10
+
11
+ You can setup a twig namespace in your project if you wish to use the twig files directly.
12
+
13
+ - Eg: `{% extends '@mixtape/Component/DropMenu/drop-menu.twig' %}`
14
+
15
+ Alternatively copy/paste the file for more control.
16
+
17
+ **JS Custom Element**
18
+
19
+ Custom Elements are self defined, simply import the desired feature.
20
+ These do not use the Shadow DOM and are not typical Web Components.
21
+ External CSS applies.
22
+ No Polyfills or frameworks are required.
23
+
24
+ - Dialog import: `import '@pnx-mixtape/mxds/src/Component/DropMenu/Elements/DropMenu';` and be sure to include `<mx-dropmenu>` around the content.
10
25
 
11
- **@todo JS**
26
+ See twig files for all HTML examples.
@@ -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"
@@ -6,7 +6,7 @@
6
6
  * **Experimental** Using new CSS Anchoring and Popover API's, requires JS polyfill.
7
7
  */
8
8
 
9
- @layer elements {
9
+ @layer design-system.components {
10
10
  .drop-menu__trigger {
11
11
  anchor-name: --drop-menu;
12
12
 
@@ -0,0 +1 @@
1
+ import "./Elements/DropMenu"
@@ -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
  }