@pnx-mixtape/mxds 0.0.28 → 0.0.30

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 (98) hide show
  1. package/dist/build/accordion.css +1 -1
  2. package/dist/build/base.css +1 -1
  3. package/dist/build/breadcrumb.css +1 -1
  4. package/dist/build/button.css +1 -1
  5. package/dist/build/callout.css +1 -1
  6. package/dist/build/card.css +1 -1
  7. package/dist/build/carousel.css +1 -1
  8. package/dist/build/chunks/{DropMenu-LnJEp-sg.js → DropMenu-BckyZaZM.js} +1 -1
  9. package/dist/build/chunks/{Popover-C4gisyxr.js → Popover-hTv4lVea.js} +2 -2
  10. package/dist/build/chunks/polyfills-QW1VbwlO.js +562 -0
  11. package/dist/build/chunks/popover-Dk48Vm_U.js +407 -0
  12. package/dist/build/constants.css +1 -1
  13. package/dist/build/container-grid.css +1 -1
  14. package/dist/build/content-block.css +1 -1
  15. package/dist/build/dialog.css +1 -1
  16. package/dist/build/drop-menu.css +1 -1
  17. package/dist/build/drop-menu.entry.js +2 -2
  18. package/dist/build/drupal.css +1 -1
  19. package/dist/build/filters.css +1 -1
  20. package/dist/build/footer.css +1 -1
  21. package/dist/build/form.css +1 -1
  22. package/dist/build/global-alert.css +1 -1
  23. package/dist/build/grid.css +1 -1
  24. package/dist/build/header.css +1 -1
  25. package/dist/build/header.entry.js +524 -379
  26. package/dist/build/hero-banner.css +1 -1
  27. package/dist/build/icon.css +1 -1
  28. package/dist/build/in-page-alert.css +1 -1
  29. package/dist/build/in-page-navigation.css +1 -1
  30. package/dist/build/in-page-navigation.entry.js +23 -11
  31. package/dist/build/link-list.css +1 -1
  32. package/dist/build/list-item.css +1 -1
  33. package/dist/build/masthead.css +1 -1
  34. package/dist/build/navigation.css +1 -1
  35. package/dist/build/page.css +1 -1
  36. package/dist/build/pagination.css +1 -1
  37. package/dist/build/popover.css +1 -1
  38. package/dist/build/popover.entry.js +1 -1
  39. package/dist/build/results-bar.css +1 -1
  40. package/dist/build/section.css +1 -1
  41. package/dist/build/side-navigation.css +1 -1
  42. package/dist/build/sidebar.css +1 -1
  43. package/dist/build/social-links.css +1 -1
  44. package/dist/build/steps.css +1 -1
  45. package/dist/build/sticky.css +1 -1
  46. package/dist/build/tabs.css +1 -1
  47. package/dist/build/tabs.entry.js +2 -2
  48. package/dist/build/tag.css +1 -1
  49. package/dist/build/utilities.css +1 -1
  50. package/dist/build/utility-list.css +1 -1
  51. package/package.json +22 -21
  52. package/src/Atom/Background/_background.css +1 -0
  53. package/src/Atom/Image/_image.css +1 -0
  54. package/src/Atom/Media/_media.css +0 -6
  55. package/src/Atom/Spacing/_mixins.css +22 -0
  56. package/src/Atom/Spacing/_spacing.css +33 -0
  57. package/src/Atom/Table/Table.stories.ts +17 -7
  58. package/src/Atom/Table/__snapshots__/Table.stories.ts.snap +16 -8
  59. package/src/Atom/Table/__snapshots__/TableResponsive.stories.ts.snap +1 -1
  60. package/src/Atom/Table/_table.css +26 -1
  61. package/src/Atom/Table/table-responsive.twig +1 -1
  62. package/src/Atom/Table/table.twig +9 -1
  63. package/src/Atom/_flow.css +1 -5
  64. package/src/Component/Card/Card.stories.ts +19 -0
  65. package/src/Component/Card/__snapshots__/Card.stories.ts.snap +40 -9
  66. package/src/Component/Card/card.css +60 -12
  67. package/src/Component/Card/card.twig +5 -2
  68. package/src/Component/Carousel/Elements/Carousel.ts +8 -3
  69. package/src/Component/Carousel/__snapshots__/Carousel.stories.ts.snap +52 -52
  70. package/src/Component/Carousel/carousel.css +14 -35
  71. package/src/Component/Carousel/carousel.twig +0 -1
  72. package/src/Component/GlobalAlert/global-alert.css +8 -4
  73. package/src/Component/InPageAlert/in-page-alert.css +1 -0
  74. package/src/Component/InPageNavigation/Elements/InPageNavigation.ts +12 -7
  75. package/src/Component/InPageNavigation/InPageNavigation.stories.ts +28 -12
  76. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +30 -49
  77. package/src/Component/InPageNavigation/in-page-navigation.css +8 -4
  78. package/src/Component/InPageNavigation/in-page-navigation.twig +9 -6
  79. package/src/Component/InPageNavigation/twig/content-example.twig +1 -1
  80. package/src/Component/InPageNavigation/twig/in-page-navigation-selector.twig +4 -0
  81. package/src/Component/ListItem/__snapshots__/ListItem.stories.ts.snap +9 -9
  82. package/src/Component/ListItem/list-item.css +14 -1
  83. package/src/Component/ListItem/list-item.twig +6 -2
  84. package/src/Component/Pagination/Pagination.stories.ts +1 -1
  85. package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +2 -2
  86. package/src/Component/ResultsBar/results-bar.css +4 -0
  87. package/src/Form/FormItem/FormItem.stories.ts +14 -0
  88. package/src/Form/FormItem/__snapshots__/FormItem.stories.ts.snap +19 -0
  89. package/src/Form/form.css +11 -3
  90. package/src/Layout/Grid/Grid.stories.ts +7 -7
  91. package/src/Layout/Grid/GridItem.stories.ts +1 -2
  92. package/src/Layout/Section/section.css +8 -0
  93. package/src/_custom-media.css +2 -0
  94. package/src/constants.css +16 -4
  95. package/src/enums.ts +1 -1
  96. package/src/tokens.js +1 -0
  97. package/dist/build/chunks/polyfills-Du4RTZDf.js +0 -511
  98. package/dist/build/chunks/popover-Bd5oQ1Ic.js +0 -407
@@ -4,63 +4,42 @@
4
4
 
5
5
  @layer design-system.components.carousel {
6
6
  .mx-carousel {
7
- display: block;
7
+ display: grid;
8
+ gap: var(--vertical-gap, var(--gap));
8
9
  }
9
10
 
10
11
  .mx-carousel__scrollable {
11
12
  list-style: none;
12
- display: flex;
13
- block-size: var(--block-size, auto);
13
+ padding-inline: 0;
14
+ scroll-padding-inline: var(--outline-size, 2px);
15
+ display: grid;
16
+ gap: var(--horizontal-gap, var(--gap));
17
+ grid-auto-flow: column;
18
+ grid-auto-columns: minmax(var(--inline-size, 25ch), 1fr);
14
19
  overflow: auto hidden;
15
20
  scroll-snap-type: x mandatory;
16
21
  -webkit-overflow-scrolling: touch;
17
22
  scroll-behavior: smooth;
18
- scrollbar-color: var(--colour-foreground) var(--colour-background);
19
-
20
- &::-webkit-scrollbar {
21
- block-size: 1rem;
22
- }
23
-
24
- &::-webkit-scrollbar-track {
25
- background-color: var(--colour-background);
26
- }
27
-
28
- &::-webkit-scrollbar-thumb {
29
- background-color: var(--colour-foreground);
30
- background-image: linear-gradient(
31
- var(--colour-background) 0,
32
- var(--colour-background) 0.25rem,
33
- var(--colour-foreground) 0.25rem,
34
- var(--colour-foreground) 0.75rem,
35
- var(--colour-background) 0.75rem
36
- );
37
- }
23
+ scrollbar-color: var(--scrollbar-color, var(--line-colour, var(--colour-border)) transparent);
24
+ scrollbar-width: thin;
38
25
 
39
26
  & > li {
40
- flex: 0 0 var(--inline-size, 25ch);
41
- display: flex;
27
+ display: grid;
42
28
  scroll-snap-align: start;
29
+ scroll-snap-stop: always;
43
30
 
44
31
  &[inert] {
45
32
  opacity: 0.3;
46
33
  }
47
34
 
48
- & + li {
49
- margin-inline-start: var(--gap);
50
- }
51
-
52
35
  & .mx-container {
53
36
  inline-size: 100%;
54
- display: flex;
37
+ display: grid;
55
38
  }
56
39
  }
57
40
 
58
- &:not(:first-child) {
59
- padding-block-start: var(--gap);
60
- }
61
-
62
41
  &.overflowing:not(.no-bar) {
63
- padding-block-end: var(--gap);
42
+ padding-block-end: var(--scrollbar-gap, var(--gap));
64
43
  }
65
44
 
66
45
  &.no-bar {
@@ -1,6 +1,5 @@
1
1
  {% set classes = [
2
2
  'mx-carousel',
3
- 'mx-vertical-flow'
4
3
  ] %}
5
4
  {% set attributes = (attributes ?? create_attribute()).addClass(classes) %}
6
5
 
@@ -10,8 +10,9 @@
10
10
 
11
11
  @layer design-system.components {
12
12
  .mx-global-alert {
13
- background-color: var(--background, var(--colour-primary-light));
14
- color: var(--foreground, var(--colour-foreground));
13
+ background-color: var(--alert-background, var(--colour-primary-light));
14
+ color: var(--alert-foreground, var(--colour-foreground));
15
+ color-scheme: var(--alert-scheme, light);
15
16
 
16
17
  & .mx-global-alert__inner {
17
18
  display: grid;
@@ -34,8 +35,11 @@
34
35
  }
35
36
 
36
37
  &.mx-global-alert--critical {
37
- --foreground: var(--colour-error);
38
- --background: color-mix(in oklch, var(--colour-error), white 95%);
38
+ --alert-foreground: var(--critical-alert-foreground, var(--colour-error));
39
+ --alert-background: var(
40
+ --critical-alert-background,
41
+ color-mix(in oklch, var(--colour-error), white 95%)
42
+ );
39
43
  }
40
44
 
41
45
  & .mx-icon--close {
@@ -17,6 +17,7 @@
17
17
  border: 1px solid;
18
18
  background-color: var(--background, var(--colour-background-alt));
19
19
  color: var(--foreground, var(--colour-foreground));
20
+ color-scheme: var(--alert-scheme, light);
20
21
  border-radius: var(--border-radius);
21
22
 
22
23
  &:has(.mx-icon--close) {
@@ -18,18 +18,19 @@ export default class InPageNavigation extends HTMLElement {
18
18
  super()
19
19
  this.internals_ = this.attachInternals()
20
20
  this.controller = new AbortController()
21
- this.headingLevels = this.dataset?.headings || "h2"
21
+ this.headingLevels = this.dataset?.levels || "h2"
22
22
  this.title = this.dataset?.title || "On this page"
23
23
  this.items = []
24
24
  }
25
25
 
26
26
  connectedCallback(): void {
27
27
  if (!this.menu || !this.headings) return
28
- const headingElement: HTMLHeadingElement = createElement(
29
- `<h2 class="${this.titleClass}">${this.title}</h2>`,
30
- ) as HTMLHeadingElement
31
- this.nav.insertBefore(headingElement, this.menu)
32
28
  if (!this.links.length) {
29
+ // Build heading.
30
+ const headingElement: HTMLHeadingElement = createElement(
31
+ `<h2 class="${this.titleClass}">${this.title}</h2>`,
32
+ ) as HTMLHeadingElement
33
+ this.nav.insertBefore(headingElement, this.menu)
33
34
  // Build links if not provided.
34
35
  this.headings.forEach((heading: HTMLHeadingElement) => {
35
36
  const listItem: HTMLLIElement = this.generateListItem(heading)
@@ -84,7 +85,7 @@ export default class InPageNavigation extends HTMLElement {
84
85
  if (!this.nav) {
85
86
  throw new Error(`${this.localName} must contain a <nav> element.`)
86
87
  }
87
- if (this.items.length === 0 && this.headings.length === 0) {
88
+ if (this.items?.length === 0 && this.headings?.length === 0) {
88
89
  return null
89
90
  }
90
91
  const list = document.createElement("ul")
@@ -103,7 +104,11 @@ export default class InPageNavigation extends HTMLElement {
103
104
  `${this.localName} must have a [data-content] attribute that contains the content selector.`,
104
105
  )
105
106
  }
106
- return this.closest(selector) || this.parentElement.querySelector(selector)
107
+ return (
108
+ this.closest(selector) ||
109
+ this.parentElement.querySelector(selector) ||
110
+ document.querySelector(selector)
111
+ )
107
112
  }
108
113
 
109
114
  get headings(): NodeListOf<HTMLHeadingElement> | undefined {
@@ -1,5 +1,6 @@
1
1
  import { Meta, StoryObj } from "@storybook/html-vite"
2
2
  import Component from "./twig/in-page-navigation-story.twig"
3
+ import Other from "./twig/in-page-navigation-selector.twig"
3
4
  import "./in-page-navigation.css"
4
5
  import "./Elements/InPageNavigation"
5
6
  import { HeadingTypes, InPageNavigation as InPageNavigationType } from "@pnx-mixtape/ids-shape"
@@ -49,27 +50,32 @@ const meta: Meta<InPageNavigationType> = {
49
50
  ],
50
51
  },
51
52
  argTypes: {
52
- levels: {
53
- description:
54
- "If no `items` are provided, the javascript can build the items from the headings. This chooses the headings to include. eg; `h2,h3`",
55
- options: Object.values(HeadingTypes),
56
- control: "multi-select",
57
- table: {
58
- type: { summary: "enum" },
59
- defaultValue: { summary: HeadingTypes.TWO },
60
- },
61
- },
62
53
  title: {
63
- description: "Optional [Heading](/?path=/docs/atom-heading--docs) component.",
54
+ description:
55
+ "[Heading](/?path=/docs/atom-heading--docs) component. If not provided, the javascript will generate one with the default content.",
64
56
  control: "text",
65
57
  table: {
66
58
  type: { summary: "Heading" },
59
+ defaultValue: { summary: "On this page" },
60
+ subcategory: "Provided content",
67
61
  },
68
62
  },
69
63
  items: {
70
64
  description: "A list of [Link](/?path=/docs/atom-link--docs) objects to use for the menu.",
71
65
  table: {
72
66
  type: { summary: "Link[]" },
67
+ subcategory: "Provided content",
68
+ },
69
+ },
70
+ levels: {
71
+ description:
72
+ "If no `items` are provided, the javascript can build the items from the headings. This chooses the headings to include. eg; `h2,h3`",
73
+ options: Object.values(HeadingTypes),
74
+ control: "multi-select",
75
+ table: {
76
+ type: { summary: "enum" },
77
+ defaultValue: { summary: HeadingTypes.TWO },
78
+ subcategory: "Javascript options",
73
79
  },
74
80
  },
75
81
  },
@@ -81,7 +87,7 @@ type Story = StoryObj<InPageNavigationType>
81
87
  export const InPageNavigation: Story = {}
82
88
 
83
89
  /**
84
- * When the `items` are empty, the Javascript builds them.
90
+ * When the `items` are empty, the Javascript builds the list and heading.
85
91
  */
86
92
  export const GeneratedItems: Story = {
87
93
  args: {
@@ -108,3 +114,13 @@ export const NoHeadings: Story = {
108
114
  levels: [HeadingTypes.FOUR],
109
115
  },
110
116
  }
117
+
118
+ /**
119
+ * Generated items from anywhere in the page: page content contains headings, but not within the container element.
120
+ */
121
+ export const OtherContainer: Story = {
122
+ args: {
123
+ items: [],
124
+ },
125
+ render: args => Other(args),
126
+ }
@@ -1,11 +1,9 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
3
  exports[`Generated Items 1`] = `
4
- "<mx-in-page-navigation data-content=".js-content" data-headings="" data-title="On this page">
5
- <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow">
6
- <h2 class="is-excluded mx-heading--m">On this page</h2><ul><li class="mx-in-page-navigation__level--h2"><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li></ul></nav>
7
- </mx-in-page-navigation>
8
- <div class="js-content mx-rich-text mx-vertical-flow mx-section--l">
4
+ "<mx-in-page-navigation data-content=".js-content" data-levels="" data-title="On this page">
5
+ <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li class="mx-in-page-navigation__level--h2"><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li></ul></nav></mx-in-page-navigation>
6
+ <div class="js-content mx-rich-text mx-vertical-flow">
9
7
  <h2 id="section-1">Section 1</h2>
10
8
  <p>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. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
11
9
  <h2 id="section-2">Section 2</h2>
@@ -19,40 +17,9 @@ exports[`Generated Items 1`] = `
19
17
  `;
20
18
 
21
19
  exports[`In Page Navigation 1`] = `
22
- "<mx-in-page-navigation data-content=".js-content" data-headings="" data-title="On this page">
23
- <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow">
24
- <h2 class="is-excluded mx-heading--m">On this page</h2><ul>
25
- <li>
26
- <a href="#section-1">
27
-
28
- <span class="mx-icon mx-icon--chevron-right"></span>
29
-
30
- <span>Section 1</span>
31
-
32
- </a>
33
- </li>
34
- <li>
35
- <a href="#section-2">
36
-
37
- <span class="mx-icon mx-icon--chevron-right"></span>
38
-
39
- <span>Section 2</span>
40
-
41
- </a>
42
- </li>
43
- <li>
44
- <a href="#section-3">
45
-
46
- <span class="mx-icon mx-icon--chevron-right"></span>
47
-
48
- <span>Section 3</span>
49
-
50
- </a>
51
- </li>
52
- </ul>
53
- </nav>
54
- </mx-in-page-navigation>
55
- <div class="js-content mx-rich-text mx-vertical-flow mx-section--l">
20
+ "<mx-in-page-navigation data-content=".js-content" data-levels="" data-title="On this page">
21
+ <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li></ul></nav></mx-in-page-navigation>
22
+ <div class="js-content mx-rich-text mx-vertical-flow">
56
23
  <h2 id="section-1">Section 1</h2>
57
24
  <p>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. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
58
25
  <h2 id="section-2">Section 2</h2>
@@ -66,11 +33,9 @@ exports[`In Page Navigation 1`] = `
66
33
  `;
67
34
 
68
35
  exports[`Nested 1`] = `
69
- "<mx-in-page-navigation data-content=".js-content" data-headings="h2,h3" data-title="On this page">
70
- <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow">
71
- <h2 class="is-excluded mx-heading--m">On this page</h2><ul><li class="mx-in-page-navigation__level--h2"><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li class="mx-in-page-navigation__level--h3"><a href="#test-level-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Test level 3</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li></ul></nav>
72
- </mx-in-page-navigation>
73
- <div class="js-content mx-rich-text mx-vertical-flow mx-section--l">
36
+ "<mx-in-page-navigation data-content=".js-content" data-levels="h2,h3" data-title="On this page">
37
+ <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li class="mx-in-page-navigation__level--h2"><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li class="mx-in-page-navigation__level--h3"><a href="#test-level-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Test level 3</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li></ul></nav></mx-in-page-navigation>
38
+ <div class="js-content mx-rich-text mx-vertical-flow">
74
39
  <h2 id="section-1">Section 1</h2>
75
40
  <p>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. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
76
41
  <h2 id="section-2">Section 2</h2>
@@ -84,11 +49,27 @@ exports[`Nested 1`] = `
84
49
  `;
85
50
 
86
51
  exports[`No Headings 1`] = `
87
- "<mx-in-page-navigation data-content=".js-content" data-headings="h4" data-title="On this page">
88
- <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow">
89
- </nav>
90
- </mx-in-page-navigation>
91
- <div class="js-content mx-rich-text mx-vertical-flow mx-section--l">
52
+ "<mx-in-page-navigation data-content=".js-content" data-levels="h4" data-title="On this page">
53
+ <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"></nav></mx-in-page-navigation>
54
+ <div class="js-content mx-rich-text mx-vertical-flow">
55
+ <h2 id="section-1">Section 1</h2>
56
+ <p>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. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
57
+ <h2 id="section-2">Section 2</h2>
58
+ <p>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. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
59
+ <h3 id="test-level-3">Test level 3</h3>
60
+ <p>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. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
61
+ <h2 id="section-3">Section 3</h2>
62
+ <p>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. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
63
+ </div>
64
+ "
65
+ `;
66
+
67
+ exports[`Other Container 1`] = `
68
+ "<div class="mx-background--box mx-section--m mx-margin--bottom-m">
69
+ <mx-in-page-navigation data-content=".js-content" data-levels="" data-title="On this page">
70
+ <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li class="mx-in-page-navigation__level--h2"><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li></ul></nav></mx-in-page-navigation>
71
+ </div>
72
+ <div class="js-content mx-rich-text mx-vertical-flow">
92
73
  <h2 id="section-1">Section 1</h2>
93
74
  <p>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. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
94
75
  <h2 id="section-2">Section 2</h2>
@@ -5,6 +5,14 @@
5
5
  @layer design-system.defaults {
6
6
  mx-in-page-navigation {
7
7
  display: block;
8
+
9
+ &:where(:has(ul, ol):not(:only-child)) {
10
+ margin-block-end: var(--flow-gap, var(--gap));
11
+ }
12
+
13
+ &:has(.mx-nav:empty) {
14
+ display: none;
15
+ }
8
16
  }
9
17
  }
10
18
 
@@ -13,10 +21,6 @@
13
21
  --link-colour: var(--colour-link);
14
22
  --nav-underline: underline;
15
23
 
16
- &:has(ul, ol) {
17
- margin-block-end: var(--flow-gap, var(--gap));
18
- }
19
-
20
24
  & .mx-in-page-navigation__level--h3 {
21
25
  padding-inline-start: var(--indent, var(--spacing-s));
22
26
  }
@@ -5,14 +5,17 @@
5
5
  'mx-vertical-flow'
6
6
  ] %}
7
7
  {% set attributes = (attributes ?? create_attribute()).addClass(classes) %}
8
- <mx-in-page-navigation data-content=".js-content" data-headings="{{ levels|join(",") }}" data-title="{{ title|striptags|trim }}">
8
+ <mx-in-page-navigation data-content=".js-content" data-levels="{{ levels|join(",") }}" data-title="{{ title|striptags|trim }}">
9
+ {% apply spaceless %}
9
10
  <nav{{ attributes }}>
10
11
  {% if items %}
11
- <ul>
12
- {% for item in items %}
13
- <li>{{ item }}</li>
14
- {% endfor %}
15
- </ul>
12
+ {{ title }}
13
+ <ul>
14
+ {% for item in items %}
15
+ <li>{{ item }}</li>
16
+ {% endfor %}
17
+ </ul>
16
18
  {% endif %}
17
19
  </nav>
20
+ {% endapply %}
18
21
  </mx-in-page-navigation>
@@ -1,4 +1,4 @@
1
- <div class="js-content mx-rich-text mx-vertical-flow mx-section--l">
1
+ <div class="js-content mx-rich-text mx-vertical-flow">
2
2
  <h2 id="section-1">Section 1</h2>
3
3
  <p>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. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
4
4
  <h2 id="section-2">Section 2</h2>
@@ -0,0 +1,4 @@
1
+ <div class="mx-background--box mx-section--m mx-margin--bottom-m">
2
+ {% include "../in-page-navigation.twig" with { title: title, levels: levels } %}
3
+ </div>
4
+ {% include "./content-example.twig" %}
@@ -5,7 +5,7 @@ exports[`Block Link 1`] = `
5
5
  <div class="mx-container">
6
6
  <article class="mx-card mx-list-item mx-card--block">
7
7
  <div class="mx-card__content mx-vertical-flow">
8
- <div class="mx-heading--m">
8
+ <div class="mx-heading--l">
9
9
 
10
10
  <a href="#">
11
11
 
@@ -25,11 +25,11 @@ exports[`Block Link 1`] = `
25
25
  exports[`Image Reverse 1`] = `
26
26
  "
27
27
  <div class="mx-container">
28
- <article class="mx-card mx-list-item mx-card--reversed">
28
+ <article class="mx-card mx-list-item mx-card--collapse mx-card--reversed">
29
29
  <div class="mx-card__content mx-vertical-flow">
30
30
  <strong class="mx-text--s">Publication</strong>
31
31
  <div class="mx-text--s">25 May 2025</div>
32
- <div class="mx-heading--m">
32
+ <div class="mx-heading--l">
33
33
 
34
34
  <a href="#">
35
35
 
@@ -57,7 +57,7 @@ exports[`List Item 1`] = `
57
57
  <div class="mx-container">
58
58
  <article class="mx-card mx-list-item">
59
59
  <div class="mx-card__content mx-vertical-flow">
60
- <div class="mx-heading--m">
60
+ <div class="mx-heading--l">
61
61
 
62
62
  <a href="#">
63
63
 
@@ -77,11 +77,11 @@ exports[`List Item 1`] = `
77
77
  exports[`With Image 1`] = `
78
78
  "
79
79
  <div class="mx-container">
80
- <article class="mx-card mx-list-item">
80
+ <article class="mx-card mx-list-item mx-card--collapse">
81
81
  <div class="mx-card__content mx-vertical-flow">
82
82
  <strong class="mx-text--s">Publication</strong>
83
83
  <div class="mx-text--s">25 May 2025</div>
84
- <div class="mx-heading--m">
84
+ <div class="mx-heading--l">
85
85
 
86
86
  <a href="#">
87
87
 
@@ -111,7 +111,7 @@ exports[`With Info 1`] = `
111
111
  <div class="mx-card__content mx-vertical-flow">
112
112
  <strong class="mx-text--s">Publication</strong>
113
113
  <div class="mx-text--s">25 May 2025</div>
114
- <div class="mx-heading--m">
114
+ <div class="mx-heading--l">
115
115
 
116
116
  <a href="#">
117
117
 
@@ -134,7 +134,7 @@ exports[`With Tags 1`] = `
134
134
  <article class="mx-card mx-list-item">
135
135
  <div class="mx-card__content mx-vertical-flow">
136
136
  <strong class="mx-text--s">Resource</strong>
137
- <div class="mx-heading--m">
137
+ <div class="mx-heading--l">
138
138
 
139
139
  <a href="#">
140
140
 
@@ -165,7 +165,7 @@ exports[`With Url 1`] = `
165
165
  <div class="mx-container">
166
166
  <article class="mx-card mx-list-item">
167
167
  <div class="mx-card__content mx-vertical-flow">
168
- <div class="mx-heading--m">
168
+ <div class="mx-heading--l">
169
169
 
170
170
  <a href="#">
171
171
 
@@ -15,9 +15,22 @@
15
15
  --flow-gap: 0;
16
16
  }
17
17
  }
18
+
19
+ &.mx-card--block {
20
+ & .mx-heading--l a {
21
+ color: inherit;
22
+ text-decoration-line: none;
23
+ }
24
+
25
+ &:hover .mx-heading--l a {
26
+ color: var(--link-colour, var(--colour-link));
27
+ }
28
+ }
18
29
  }
30
+ }
19
31
 
20
- :is(.mx-list-item, .mx-container:has(> .mx-list-item)) {
32
+ :is(.mx-list-item, .mx-container:has(> .mx-list-item)) {
33
+ @media (--collapse-card-up) {
21
34
  &:where(:not(:first-child)) {
22
35
  border-block-start: var(--line-width, 1px) solid var(--line-colour, var(--colour-border));
23
36
  padding-block-start: var(--gap);
@@ -1,5 +1,9 @@
1
1
  {% set baseClass = 'mx-card' %}
2
- {% set classes = [baseClass, 'mx-list-item'] %}
2
+ {% set classes = [
3
+ baseClass,
4
+ 'mx-list-item',
5
+ image is not empty ? baseClass~"--collapse" : null,
6
+ ] %}
3
7
  {% for modifier in modifiers %}
4
8
  {% set classes = classes|merge([baseClass~"--"~modifier]) %}
5
9
  {% endfor %}
@@ -14,7 +18,7 @@
14
18
  {% if info is not empty and infoBefore %}
15
19
  <div class="mx-text--s">{{ info }}</div>
16
20
  {% endif %}
17
- <div class="mx-heading--m">
21
+ <div class="mx-heading--l">
18
22
  {{ link }}
19
23
  </div>
20
24
  {% if info is not empty and not infoBefore %}
@@ -30,13 +30,13 @@ const meta: Meta<PaginationType> = {
30
30
  link: Link({
31
31
  href: "#",
32
32
  title: "1",
33
- current: true,
34
33
  }),
35
34
  }),
36
35
  PaginationItem({
37
36
  link: Link({
38
37
  href: "#",
39
38
  title: "2",
39
+ current: true,
40
40
  }),
41
41
  }),
42
42
  PaginationItem({
@@ -16,7 +16,7 @@ exports[`Pagination 1`] = `
16
16
  </li>
17
17
  <li class="mx-pagination__item">
18
18
 
19
- <a href="#" aria-current="page">
19
+ <a href="#">
20
20
 
21
21
  <span>1</span>
22
22
 
@@ -26,7 +26,7 @@ exports[`Pagination 1`] = `
26
26
 
27
27
  <li class="mx-pagination__item">
28
28
 
29
- <a href="#">
29
+ <a href="#" aria-current="page">
30
30
 
31
31
  <span>2</span>
32
32
 
@@ -5,6 +5,10 @@
5
5
  gap: var(--spacing-s);
6
6
  justify-content: space-between;
7
7
  align-items: center;
8
+
9
+ &:not(:last-child) {
10
+ margin-block-end: var(--spacing-m);
11
+ }
8
12
  }
9
13
 
10
14
  .mx-results-bar__sort {
@@ -81,6 +81,20 @@ export const Error: Story = {
81
81
  },
82
82
  }
83
83
 
84
+ export const Required: Story = {
85
+ args: {
86
+ fields: TextInput({
87
+ id: "form-item",
88
+ type: InputTypeTypes.TEXT,
89
+ name: "example-form-item",
90
+ placeholder: "eg. Funk, Soul, Blues..",
91
+ hasDescription: true,
92
+ value: "Musicals",
93
+ required: true,
94
+ }),
95
+ },
96
+ }
97
+
84
98
  export const Fieldset: Story = {
85
99
  args: {
86
100
  as: "fieldset",
@@ -75,6 +75,25 @@ exports[`Form Item 1`] = `
75
75
  </div>
76
76
 
77
77
 
78
+ </div>
79
+ "
80
+ `;
81
+
82
+ exports[`Required 1`] = `
83
+ "
84
+ <div class="mx-form-item">
85
+
86
+ <label class="mx-label" for="form-item">What's your favourite music?</label>
87
+
88
+
89
+
90
+ <input class="mx-input__text" id="form-item" name="unique-0" type="text" value="Musicals" placeholder="eg. Funk, Soul, Blues.." aria-describedby="unique-0" required="">
91
+
92
+ <div class="mx-description" id="unique-0" role="tooltip">
93
+ Help text that provides additional information about the field.
94
+ </div>
95
+
96
+
78
97
  </div>
79
98
  "
80
99
  `;