@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
package/README.md CHANGED
@@ -19,7 +19,7 @@ It's like our greatest hits.
19
19
  ## Installation
20
20
 
21
21
  ```
22
- npm install @pnx-mixtape/mxds/ --save
22
+ npm install @pnx-mixtape/mxds --save
23
23
  ```
24
24
 
25
25
  ## Usage
@@ -35,10 +35,10 @@ Dependencies:
35
35
  Add the [tokens](https://github.com/previousnext/mixtape/blob/master/packages/constants/src/tokens.js)
36
36
  and override the values or just copy/paste from Mixtape and update;
37
37
 
38
- _eg. project-tokens.js_
38
+ _eg. project-tokens.mjs_
39
39
 
40
40
  ```js
41
- const tokens = require("@pnx-mixtape/mxds/c/src/tokens")
41
+ import tokens from "@pnx-mixtape/mxds/tokens"
42
42
 
43
43
  // Override existing ones;
44
44
  tokens.colour.brand.primary = "rgb(0, 92, 250)"
@@ -46,7 +46,7 @@ tokens.colour.brand.primary = "rgb(0, 92, 250)"
46
46
  //Add new ones;
47
47
  tokens.newThing = "somethingNew"
48
48
 
49
- module.exports = tokens
49
+ export default tokens
50
50
  ```
51
51
 
52
52
  The [custom properties](https://github.com/previousnext/mixtape/blob/master/packages/constants/src/_constants.css)
@@ -57,7 +57,7 @@ This file should be included in the browser.
57
57
  _eg. project-constants.css_
58
58
 
59
59
  ```css
60
- @import "@pnx-mixtape/mxds/constants.css";
60
+ @import "@pnx-mixtape/mxds/src/constants.css";
61
61
 
62
62
  :root {
63
63
  --my-colour-primary: rgb(0, 92, 250);
@@ -72,7 +72,7 @@ so there is no need to worry about duplication.
72
72
  _eg. project-breakpoints.css_
73
73
 
74
74
  ```css
75
- @import "@pnx-mixtape/mxds/_custom-media.css";
75
+ @import "@pnx-mixtape/mxds/src/_custom-media.css";
76
76
 
77
77
  @custom-media --my-breakpoint (width >= "200px");
78
78
  ```
@@ -83,7 +83,7 @@ _eg. buttons.css_
83
83
 
84
84
  ```css
85
85
  @import "../project-breakpoints.css";
86
- @import "@pnx-mixtape/mxds/button.css";
86
+ @import "@pnx-mixtape/mxds/src/Atom/Button/button.css";
87
87
  ```
88
88
 
89
89
  Or partially imported;
@@ -92,8 +92,8 @@ _eg. buttons.css_
92
92
 
93
93
  ```css
94
94
  @import "../project-breakpoints.css";
95
- @import "@pnx-mixtape/mxds/src/Atom/_buttons.css";
96
- @import "@pnx-mixtape/mxds/src/Atom/_buttons-styles.css";
95
+ @import "@pnx-mixtape/mxds/src/Atom/Button/_buttons.css";
96
+ @import "@pnx-mixtape/mxds/src/Atom/Button/_buttons-styles.css";
97
97
 
98
98
  .button--primary {
99
99
  --border-radius: 0;
@@ -125,13 +125,13 @@ custom property before a mixtape fallback, you can set it in you project. eg.
125
125
  #### Cascade layers
126
126
 
127
127
  [@layers](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer) are used in Mixtape to ensure ease in overriding CSS on a project
128
- level. If you are importing `@pnx-mixtape/mxds/Atom/base` CSS then the layers are included.
128
+ level. If you are importing `@pnx-mixtape/mxds/src/Atom/base.css` CSS then the layers are included.
129
129
 
130
130
  If you are only partially importing the base CSS files, then you'll need to manually
131
131
  include the layers at the start of your CSS;
132
132
 
133
133
  ```css
134
- @layer defaults, layout, elements, components, utilities;
134
+ @layer design-system.defaults, design-system.atoms, design-system.layout, design-system.components, design-system.utilities;
135
135
  ```
136
136
 
137
137
  Any CSS not wrapped in a layer will have higher specificity to Mixtape's CSS.
@@ -149,13 +149,13 @@ setup to run through a bundler like Rollup).
149
149
  _eg. project-init.entry.js_
150
150
 
151
151
  ```js
152
- import "@pnx-mixtape/mxds/"
152
+ import "@pnx-mixtape/mxds/src/Component/Accordion/Elements/Accordion"
153
153
  ```
154
154
 
155
155
  To customise this javascript we recommend importing and then extending the Class;
156
156
 
157
157
  ```js
158
- import Accordion from "@pnx-mixtape/mxds/"
158
+ import Accordion from "@pnx-mixtape/mxds/src/Component/Accordion/Elements/Accordion"
159
159
 
160
160
  class FancyAccordion extends Accordion {
161
161
  constructor(element) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnx-mixtape/mxds",
3
3
  "description": "The Mixtape Design System",
4
- "version": "0.0.2",
4
+ "version": "0.0.4",
5
5
  "scripts": {
6
6
  "dev": "concurrently -k -n \"VITE,STORYBOOK\" -c \"#636cff,#ff4785\" \"npm run dev-vite\" \"npm run dev-storybook\"",
7
7
  "build": "concurrently -n \"VITE,STORYBOOK\" -c \"#636cff,#ff4785\" \"npm run build-vite\" \"npm run build-storybook\"",
@@ -32,7 +32,7 @@
32
32
  "dependencies": {
33
33
  "@floating-ui/dom": "^1.6.5",
34
34
  "@oddbird/popover-polyfill": "^0.4.3",
35
- "@pnx-mixtape/ids-shape": "^0.0.7",
35
+ "@pnx-mixtape/ids-shape": "^0.0.8",
36
36
  "classnames": "^2.5.1",
37
37
  "js-cookie": "^3.0.5",
38
38
  "react": "^18.3.1",
@@ -125,7 +125,8 @@
125
125
  "exports": {
126
126
  ".": "./src/elements.ts",
127
127
  "./react": "./src/react.ts",
128
- "./*.css": "./dist/*.css",
129
- "./tokens": "./src/tokens.js"
128
+ "./tokens": "./src/tokens.js",
129
+ "./dist/*": "./dist/build/*",
130
+ "./src/*": "./src/*"
130
131
  }
131
132
  }
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Backgrounds Alt smoke-test 1`] = `
3
+ exports[`Atom/Backgrounds Alt smoke-test 1`] = `
4
4
  <div class="spacing--m rich-text vertical-flow background--alt">
5
5
  <blockquote>
6
6
  <p>
@@ -33,7 +33,7 @@ exports[`Base/Backgrounds Alt smoke-test 1`] = `
33
33
  </div>
34
34
  `;
35
35
 
36
- exports[`Base/Backgrounds Backgrounds smoke-test 1`] = `
36
+ exports[`Atom/Backgrounds Backgrounds smoke-test 1`] = `
37
37
  <div class="spacing--m rich-text vertical-flow ">
38
38
  <blockquote>
39
39
  <p>
@@ -66,7 +66,7 @@ exports[`Base/Backgrounds Backgrounds smoke-test 1`] = `
66
66
  </div>
67
67
  `;
68
68
 
69
- exports[`Base/Backgrounds Reverse smoke-test 1`] = `
69
+ exports[`Atom/Backgrounds Reverse smoke-test 1`] = `
70
70
  <div class="spacing--m rich-text vertical-flow background--reverse">
71
71
  <blockquote>
72
72
  <p>
@@ -1,28 +1,7 @@
1
- /**
2
- * Colors
3
- *
4
- * Colors are defined in the constants package. View the [Constants package](https://github.com/previousnext/mixtape/tree/master/packages/constants) on github.
5
- *
6
- * Markup: colors.twig
7
- *
8
- * Style guide: base.colors
9
- */
10
-
11
1
  /**
12
2
  * Backgrounds
13
- *
14
- * Colors are defined in the constants package. View the [Constants package](https://github.com/previousnext/mixtape/tree/master/packages/constants) on github.
15
- *
16
- * .background--alt - Alternative
17
- * .background--reverse - Reverse
18
- *
19
- * Default: false
20
- *
21
- * Markup: backgrounds.twig
22
- *
23
- * Style guide: base.colors.backgrounds
24
3
  */
25
- @layer defaults {
4
+ @layer design-system.atoms {
26
5
  :where([class*="background--"]) {
27
6
  background-color: var(--background, var(--colour-background));
28
7
  color: var(--foreground, var(--colour-foreground));
@@ -1,4 +1,4 @@
1
- @layer defaults {
1
+ @layer design-system.defaults {
2
2
  blockquote {
3
3
  padding-inline-start: var(--line-gap, var(--gap));
4
4
  border-inline-start: var(--line-width, 6px) solid
@@ -1,8 +1,7 @@
1
1
  import { Meta, StoryObj } from "@storybook/html"
2
- import Component from "./button.twig"
2
+ import Component from "./twig/story-button.twig"
3
3
  import "./button.css"
4
4
  import {
5
- AlignmentTypes,
6
5
  Button as ButtonType,
7
6
  ButtonModifiers,
8
7
  ButtonTypes,
@@ -30,8 +29,8 @@ const meta: Meta<ButtonType> = {
30
29
  href: { control: "text" },
31
30
  disabled: { control: "boolean" },
32
31
  // @ts-expect-error The controls follow the shape
33
- "icon.icon": { options: Object.values(Icons), control: "select" },
34
- "icon.align": { options: Object.values(AlignmentTypes), control: "select" },
32
+ "iconStart.icon": { options: Object.values(Icons), control: "select" },
33
+ "iconEnd.icon": { options: Object.values(Icons), control: "select" },
35
34
  iconOnly: { control: "boolean" },
36
35
  },
37
36
  }
@@ -63,9 +62,8 @@ export const Link: Story = {
63
62
 
64
63
  export const IconButton: Story = {
65
64
  args: {
66
- icon: {
65
+ iconEnd: {
67
66
  icon: Icons.ARROW_RIGHT,
68
- align: AlignmentTypes.END,
69
67
  },
70
68
  },
71
69
  }
@@ -6,13 +6,13 @@
6
6
 
7
7
  For everything;
8
8
 
9
- `@import '@pnx-mixtape/mxds/button.css';`
9
+ `@import '@pnx-mixtape/mxds/src/Atom/Button/button.css';`
10
10
 
11
11
  For specifics;
12
12
 
13
13
  ```css
14
- @import "@pnx-mixtape/mxds/src/Atom/_buttons.css";
15
- @import "@pnx-mixtape/mxds/src/Atom/_buttons-styles.css";
14
+ @import "@pnx-mixtape/mxds/src/Atom/Button/_buttons.css";
15
+ @import "@pnx-mixtape/mxds/src/Atom/Button/_buttons-styles.css";
16
16
 
17
17
  .button--primary {
18
18
  --border-radius: 0;
@@ -1,41 +1,53 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Button Button smoke-test 1`] = `
3
+ exports[`Atom/Button Button smoke-test 1`] = `
4
4
  <button class="button "
5
5
  type="button"
6
6
  >
7
- Button
7
+ <span>
8
+ Button
9
+ </span>
8
10
  </button>
9
11
  `;
10
12
 
11
- exports[`Base/Button IconButton smoke-test 1`] = `
12
- <button class="button icon icon--arrow-right icon--end"
13
+ exports[`Atom/Button IconButton smoke-test 1`] = `
14
+ <button class="button "
13
15
  type="button"
14
16
  >
15
- Button
17
+ <span>
18
+ Button
19
+ </span>
20
+ <span class="icon icon--arrow-right ">
21
+ </span>
16
22
  </button>
17
23
  `;
18
24
 
19
- exports[`Base/Button Link smoke-test 1`] = `
25
+ exports[`Atom/Button Link smoke-test 1`] = `
20
26
  <a class="button "
21
27
  href="#"
22
28
  >
23
- Button
29
+ <span>
30
+ Button
31
+ </span>
24
32
  </a>
25
33
  `;
26
34
 
27
- exports[`Base/Button Primary smoke-test 1`] = `
35
+ exports[`Atom/Button Primary smoke-test 1`] = `
28
36
  <button class="button button--dark"
29
37
  type="button"
30
38
  >
31
- Button
39
+ <span>
40
+ Button
41
+ </span>
32
42
  </button>
33
43
  `;
34
44
 
35
- exports[`Base/Button Text smoke-test 1`] = `
45
+ exports[`Atom/Button Text smoke-test 1`] = `
36
46
  <button class="button button--light"
37
47
  type="button"
38
48
  >
39
- Button
49
+ <span>
50
+ Button
51
+ </span>
40
52
  </button>
41
53
  `;
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Button Button smoke-test 1`] = `
3
+ exports[`Atom/Button Button smoke-test 1`] = `
4
4
  <button class="button"
5
5
  type="button"
6
6
  >
@@ -8,7 +8,7 @@ exports[`Base/Button Button smoke-test 1`] = `
8
8
  </button>
9
9
  `;
10
10
 
11
- exports[`Base/Button Primary smoke-test 1`] = `
11
+ exports[`Atom/Button Primary smoke-test 1`] = `
12
12
  <button class="button button--dark"
13
13
  type="button"
14
14
  >
@@ -2,7 +2,7 @@
2
2
  * Buttons
3
3
  */
4
4
 
5
- @layer elements {
5
+ @layer design-system.atoms {
6
6
  .button--dark {
7
7
  --button-line-colour: var(--colour-primary);
8
8
  --background: var(--colour-primary);
@@ -2,7 +2,7 @@
2
2
  * Buttons
3
3
  */
4
4
 
5
- @layer elements {
5
+ @layer design-system.atoms {
6
6
  .button {
7
7
  --outline-offset: 1px;
8
8
  --outline-width: 4px;
@@ -67,5 +67,9 @@
67
67
  block-size: 100%;
68
68
  mask-size: var(--spacing-s);
69
69
  }
70
+
71
+ &:has(.icon) {
72
+ place-content: center;
73
+ }
70
74
  }
71
75
  }
@@ -1,9 +1,7 @@
1
1
  {% set baseClass = 'button' %}
2
2
  {% set classes = [
3
3
  baseClass,
4
- icon ? "icon icon--"~icon.icon : null,
5
4
  iconOnly ? baseClass~"--icon-only" : null,
6
- icon.align ? "icon--"~icon.align : null
7
5
  ] %}
8
6
  {% for modifier in modifiers %}
9
7
  {% set classes = classes|merge([baseClass~"--"~modifier]) %}
@@ -12,12 +10,16 @@
12
10
 
13
11
  {% if href %}
14
12
  <a{{ attributes}} href="{{ href }}">
15
- {{ title }}
13
+ {{ iconStart }}
14
+ <span{% if iconOnly %} class="sr-only"{% endif %}>{{ title }}</span>
15
+ {{ iconEnd }}
16
16
  </a>
17
17
  {% elseif as == 'input' %}
18
18
  <input{{ attributes}} type="button" value="{{ title }}"{% if disabled %} disabled{% endif %}>
19
19
  {% else %}
20
20
  <button{{ attributes}} type="{{ as|default("button") }}"{% if disabled %} disabled{% endif %}>
21
- {{ title }}
21
+ {{ iconStart }}
22
+ <span{% if iconOnly %} class="sr-only"{% endif %}>{{ title }}</span>
23
+ {{ iconEnd }}
22
24
  </button>
23
25
  {% endif %}
@@ -0,0 +1,11 @@
1
+ {% extends "../button.twig" %}
2
+ {% if iconStart %}
3
+ {% set iconStart %}
4
+ {% include '@mixtape/Atom/Icon/icon.twig' with { icon: iconStart.icon } only %}
5
+ {% endset %}
6
+ {% endif %}
7
+ {% if iconEnd %}
8
+ {% set iconEnd %}
9
+ {% include '@mixtape/Atom/Icon/icon.twig' with { icon: iconEnd.icon } only %}
10
+ {% endset %}
11
+ {% endif %}
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Definition List DefinitionList smoke-test 1`] = `
3
+ exports[`Atom/Definition List DefinitionList smoke-test 1`] = `
4
4
  <dl>
5
5
  <div>
6
6
  <dt>
@@ -1,7 +1,7 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Typography/Headings Headings smoke-test 1`] = `
4
- <h2 class=" ">
3
+ exports[`Atom/Heading Headings smoke-test 1`] = `
4
+ <h2 class>
5
5
  Heading
6
6
  </h2>
7
7
  `;
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Typography/Heading Heading smoke-test 1`] = `
3
+ exports[`Atom/Typography/Heading Heading smoke-test 1`] = `
4
4
  <h2 class
5
5
  id="heading"
6
6
  >
@@ -1,4 +1,4 @@
1
- @layer defaults {
1
+ @layer design-system.defaults {
2
2
  :is(
3
3
  .headline,
4
4
  h1,
@@ -1,7 +1,25 @@
1
+ {% set style = null %}
2
+ {% for modifier in modifiers %}
3
+ {% if modifier == "h1" %}
4
+ {% set style = 'xxl' %}
5
+ {% endif %}
6
+ {% if modifier == "h2" %}
7
+ {% set style = 'xl' %}
8
+ {% endif %}
9
+ {% if modifier == "h3" %}
10
+ {% set style = 'l' %}
11
+ {% endif %}
12
+ {% if modifier == "h4" %}
13
+ {% set style = 'm' %}
14
+ {% endif %}
15
+ {% if modifier == "h5" %}
16
+ {% set style = 's' %}
17
+ {% endif %}
18
+ {% endfor %}
1
19
  {% set classes = [
2
- modifier ? modifier : null,
3
20
  excluded ? 'is-excluded' : null,
4
21
  srOnly ? 'sr-only' : null,
22
+ style ? 'heading--'~style : null,
5
23
  ] %}
6
24
  {% set attributes = (attributes|default(create_attribute())).addClass(classes) %}
7
25
 
@@ -4,4 +4,4 @@
4
4
 
5
5
  **CSS**
6
6
 
7
- `@import '@pnx-mixtape/mxds/icon.css';`
7
+ `@import '@pnx-mixtape/mxds/src/Atom/icon/icon.css';`
@@ -1,17 +1,17 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Icon Alignment smoke-test 1`] = `
3
+ exports[`Atom/Icon Alignment smoke-test 1`] = `
4
4
  <span class="icon icon--arrow-left icon--end ">
5
5
  Message with icon
6
6
  </span>
7
7
  `;
8
8
 
9
- exports[`Base/Icon Icon smoke-test 1`] = `
9
+ exports[`Atom/Icon Icon smoke-test 1`] = `
10
10
  <span class="icon icon--arrow-right ">
11
11
  </span>
12
12
  `;
13
13
 
14
- exports[`Base/Icon WithText smoke-test 1`] = `
14
+ exports[`Atom/Icon WithText smoke-test 1`] = `
15
15
  <span class="icon icon--arrow-right ">
16
16
  Message with icon
17
17
  </span>
@@ -1,17 +1,17 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Icon Alignment smoke-test 1`] = `
3
+ exports[`Atom/Icon Alignment smoke-test 1`] = `
4
4
  <span class="icon icon--arrow-left icon--end">
5
5
  Message with icon
6
6
  </span>
7
7
  `;
8
8
 
9
- exports[`Base/Icon Icon smoke-test 1`] = `
9
+ exports[`Atom/Icon Icon smoke-test 1`] = `
10
10
  <span class="icon icon--arrow-right">
11
11
  </span>
12
12
  `;
13
13
 
14
- exports[`Base/Icon WithText smoke-test 1`] = `
14
+ exports[`Atom/Icon WithText smoke-test 1`] = `
15
15
  <span class="icon icon--arrow-right">
16
16
  Message with icon
17
17
  </span>
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Icon - Extended
5
5
  */
6
- @layer elements {
6
+ @layer design-system.atoms {
7
7
  @mixin icon attachment;
8
8
  @mixin icon blockquote;
9
9
  @mixin icon building;
@@ -4,7 +4,7 @@
4
4
  * Icon
5
5
  */
6
6
 
7
- @layer elements {
7
+ @layer design-system.atoms {
8
8
  .icon {
9
9
  display: inline-flex;
10
10
  align-items: center;
@@ -74,7 +74,7 @@
74
74
  * Icon - Colours
75
75
  */
76
76
 
77
- @layer elements {
77
+ @layer design-system.atoms {
78
78
  .icon--color-info::before {
79
79
  color: var(--colour-info-foreground);
80
80
  }
@@ -104,7 +104,7 @@
104
104
  * Icon - alignment
105
105
  */
106
106
 
107
- @layer elements {
107
+ @layer design-system.atoms {
108
108
  .icon.icon--end::before {
109
109
  order: 2;
110
110
  }
@@ -114,7 +114,7 @@
114
114
  * Icon - rotate
115
115
  */
116
116
 
117
- @layer elements {
117
+ @layer design-system.atoms {
118
118
  .icon.icon--rotate-90::before {
119
119
  rotate: 90deg;
120
120
  }
@@ -132,7 +132,7 @@
132
132
  * Icon - size
133
133
  */
134
134
 
135
- @layer elements {
135
+ @layer design-system.atoms {
136
136
  .icon.icon--size-sm::before {
137
137
  --icon-size: var(--spacing-s);
138
138
  }
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Base/Image Image smoke-test 1`] = `
3
+ exports[`Atom/Image Image smoke-test 1`] = `
4
4
  <picture>
5
5
  <img src="https://picsum.photos/id/56/558/418?grayscale"
6
6
  alt="A picsum image"
@@ -1,4 +1,4 @@
1
- @layer defaults {
1
+ @layer design-system.defaults {
2
2
  figure {
3
3
  margin: 0;
4
4
  display: table;
@@ -1,7 +1,7 @@
1
1
  import { Meta, StoryObj } from "@storybook/html"
2
- import Component from "./link.twig"
2
+ import Component from "./twig/story-link.twig"
3
3
  import "../_base.css"
4
- import { AlignmentTypes, Link as LinkType } from "@pnx-mixtape/ids-shape"
4
+ import { Link as LinkType } from "@pnx-mixtape/ids-shape"
5
5
  import { Icons } from "../../enums"
6
6
 
7
7
  const meta: Meta<LinkType> = {
@@ -17,8 +17,8 @@ const meta: Meta<LinkType> = {
17
17
  download: { control: "boolean" },
18
18
  current: { control: "boolean" },
19
19
  // @ts-expect-error The controls follow the shape
20
- "icon.icon": { options: Object.values(Icons), control: "select" },
21
- "icon.align": { options: Object.values(AlignmentTypes), control: "select" },
20
+ "iconStart.icon": { options: Object.values(Icons), control: "select" },
21
+ "iconEnd.icon": { options: Object.values(Icons), control: "select" },
22
22
  },
23
23
  }
24
24
 
@@ -27,11 +27,35 @@ type Story = StoryObj<LinkType>
27
27
 
28
28
  export const Link: Story = {}
29
29
 
30
- export const IconLink: Story = {
30
+ export const More: Story = {
31
31
  args: {
32
- icon: {
32
+ more: true,
33
+ iconEnd: {
33
34
  icon: Icons.ARROW_RIGHT,
34
- align: AlignmentTypes.END,
35
+ },
36
+ },
37
+ }
38
+
39
+ export const External: Story = {
40
+ args: {
41
+ external: true,
42
+ },
43
+ }
44
+
45
+ export const Download: Story = {
46
+ args: {
47
+ download: true,
48
+ title: "Download (PDF 12kb)",
49
+ iconStart: {
50
+ icon: Icons.DOWNLOAD,
51
+ },
52
+ },
53
+ }
54
+
55
+ export const IconLink: Story = {
56
+ args: {
57
+ iconStart: {
58
+ icon: Icons.LINK,
35
59
  },
36
60
  },
37
61
  }