@pnx-mixtape/mxds 0.0.19 → 0.0.21

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 (120) hide show
  1. package/README.md +18 -6
  2. package/dist/build/accordion.entry.js +2 -2
  3. package/dist/build/accordion.entry.js.map +1 -1
  4. package/dist/build/base.css +2 -1
  5. package/dist/build/button.css +4 -4
  6. package/dist/build/card.css +6 -5
  7. package/dist/build/chunks/{Accordion-deu4CCT-.js → Accordion-O-huO4At.js} +2 -2
  8. package/dist/build/chunks/{Accordion-deu4CCT-.js.map → Accordion-O-huO4At.js.map} +1 -1
  9. package/dist/build/chunks/{disclosure-widget-WwE5XplD.js → disclosure-widget-DVpnRsTI.js} +2 -2
  10. package/dist/build/chunks/{disclosure-widget-WwE5XplD.js.map → disclosure-widget-DVpnRsTI.js.map} +1 -1
  11. package/dist/build/chunks/{drop-menu.entry-e1iZ4ERw.js → drop-menu.entry-B4TtnC50.js} +2 -2
  12. package/dist/build/chunks/{drop-menu.entry-e1iZ4ERw.js.map → drop-menu.entry-B4TtnC50.js.map} +1 -1
  13. package/dist/build/chunks/{utilities-BeWkujCZ.js → utilities-DXELy_An.js} +91 -1
  14. package/dist/build/chunks/utilities-DXELy_An.js.map +1 -0
  15. package/dist/build/constants.css +6 -4
  16. package/dist/build/dialog.css +1 -9
  17. package/dist/build/dialog.entry.js +1 -1
  18. package/dist/build/drop-menu.entry.js +1 -1
  19. package/dist/build/filters.entry.js +1 -1
  20. package/dist/build/global-alert.entry.js +1 -1
  21. package/dist/build/header.css +49 -63
  22. package/dist/build/header.entry.js +1107 -21
  23. package/dist/build/header.entry.js.map +1 -1
  24. package/dist/build/hero-banner.css +12 -6
  25. package/dist/build/in-page-navigation.entry.js +1 -1
  26. package/dist/build/navigation.entry.js +2 -2
  27. package/dist/build/page.css +2 -2
  28. package/dist/build/pagination.css +15 -21
  29. package/dist/build/steps.css +11 -11
  30. package/dist/build/sticky.entry.js +1 -1
  31. package/dist/build/tabs.entry.js +2 -2
  32. package/dist/build/utilities.css +9 -1
  33. package/package.json +18 -29
  34. package/src/Atom/Button/_buttons-styles.css +3 -3
  35. package/src/Atom/Heading/Heading.tsx +1 -1
  36. package/src/Atom/Icon/Icon.tsx +1 -1
  37. package/src/Atom/Link/Link.stories.tsx +2 -6
  38. package/src/Atom/Link/Link.tsx +9 -4
  39. package/src/Atom/Link/_links.css +1 -0
  40. package/src/Component/Accordion/Accordion.stories.tsx +39 -9
  41. package/src/Component/Accordion/Accordion.tsx +28 -50
  42. package/src/Component/Accordion/Components/AccordionContent.tsx +24 -0
  43. package/src/Component/Accordion/Components/AccordionTitle.tsx +34 -0
  44. package/src/Component/Accordion/Components/AccordionTitleIcon.tsx +22 -0
  45. package/src/Component/Accordion/__snapshots__/Accordion.stories.tsx.snap +26 -0
  46. package/src/Component/Breadcrumb/Breadcrumb.tsx +8 -2
  47. package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.tsx.snap +7 -3
  48. package/src/Component/Card/Card.stories.tsx +22 -19
  49. package/src/Component/Card/Card.tsx +6 -28
  50. package/src/Component/Card/Components/CardContent.tsx +12 -0
  51. package/src/Component/Card/Components/CardMedia.tsx +17 -0
  52. package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +9 -9
  53. package/src/Component/Card/card.css +3 -2
  54. package/src/Component/ContentBlock/Components/ContentBlockContent.tsx +14 -0
  55. package/src/Component/ContentBlock/Components/ContentBlockMedia.tsx +20 -0
  56. package/src/Component/ContentBlock/ContentBlock.stories.tsx +16 -13
  57. package/src/Component/ContentBlock/ContentBlock.tsx +5 -28
  58. package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.tsx.snap +0 -2
  59. package/src/Component/Dialog/Components/DialogCloseButton.tsx +18 -0
  60. package/src/Component/Dialog/Components/DialogContent.tsx +7 -0
  61. package/src/Component/Dialog/Dialog.stories.tsx +19 -24
  62. package/src/Component/Dialog/Dialog.tsx +31 -25
  63. package/src/Component/Dialog/__snapshots__/Dialog.stories.tsx.snap +14 -21
  64. package/src/Component/Dialog/dialog.css +0 -8
  65. package/src/Component/HeroBanner/HeroBanner.stories.ts +23 -12
  66. package/src/Component/HeroBanner/HeroBanner.stories.tsx +26 -7
  67. package/src/Component/HeroBanner/HeroBanner.tsx +2 -20
  68. package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +51 -3
  69. package/src/Component/HeroBanner/hero-banner.css +8 -4
  70. package/src/Component/HeroBanner/hero-banner.twig +2 -2
  71. package/src/Component/HeroSearch/HeroSearch.stories.ts +105 -0
  72. package/src/Component/HeroSearch/HeroSearch.stories.tsx +48 -0
  73. package/src/Component/HeroSearch/HeroSearch.tsx +32 -0
  74. package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.ts.snap +176 -0
  75. package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.tsx.snap +36 -0
  76. package/src/Component/HeroSearch/hero-search.twig +43 -0
  77. package/src/Component/InPageNavigation/InPageNavigation.stories.tsx +1 -1
  78. package/src/Component/InPageNavigation/InPageNavigation.tsx +1 -0
  79. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.tsx.snap +1 -1
  80. package/src/Component/LinkList/LinkList.stories.ts +12 -0
  81. package/src/Component/LinkList/LinkList.stories.tsx +0 -6
  82. package/src/Component/LinkList/LinkList.tsx +5 -16
  83. package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +37 -0
  84. package/src/Component/LinkList/__snapshots__/LinkList.stories.tsx.snap +9 -29
  85. package/src/Component/LinkList/link-list.twig +1 -0
  86. package/src/Component/ListItem/Components/ListItemContent.tsx +12 -0
  87. package/src/Component/ListItem/Components/ListItemMedia.tsx +20 -0
  88. package/src/Component/ListItem/ListItem.stories.tsx +22 -19
  89. package/src/Component/ListItem/ListItem.tsx +3 -32
  90. package/src/Component/ListItem/__snapshots__/ListItem.stories.tsx.snap +3 -0
  91. package/src/Component/Pagination/Components/PaginationContext.tsx +10 -4
  92. package/src/Component/Pagination/Components/PaginationItem.tsx +10 -10
  93. package/src/Component/Pagination/Pagination.tsx +6 -2
  94. package/src/Component/Pagination/__snapshots__/Pagination.stories.tsx.snap +10 -4
  95. package/src/Component/Pagination/pagination.css +13 -18
  96. package/src/Component/Steps/__snapshots__/Steps.stories.ts.snap +12 -12
  97. package/src/Component/Steps/step-item.twig +1 -1
  98. package/src/Component/Steps/steps.css +1 -2
  99. package/src/Component/Tabs/Components/TabPanel.tsx +1 -1
  100. package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +2 -0
  101. package/src/Component/Tile/Tile.stories.tsx +20 -15
  102. package/src/Component/Tile/__snapshots__/Tile.stories.tsx.snap +18 -23
  103. package/src/Layout/Header/Elements/GlobalToggle.ts +55 -21
  104. package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +14 -14
  105. package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +2 -2
  106. package/src/Layout/Header/_header.css +2 -47
  107. package/src/Layout/Header/_toggles.css +37 -1
  108. package/src/Layout/Header/header.twig +5 -5
  109. package/src/Layout/Page/Page.stories.tsx +13 -4
  110. package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +2 -2
  111. package/src/Layout/Page/page.css +1 -1
  112. package/src/Layout/Section/__snapshots__/Section.stories.tsx.snap +3 -3
  113. package/src/Layout/Section/__snapshots__/SectionGrid.stories.tsx.snap +2 -2
  114. package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.tsx.snap +3 -3
  115. package/src/Utility/utilities.css +8 -0
  116. package/src/constants.css +5 -3
  117. package/src/react.ts +30 -7
  118. package/src/tokens.js +3 -1
  119. package/dist/build/chunks/utilities-BeWkujCZ.js.map +0 -1
  120. package/src/Component/Tile/Tile.tsx +0 -53
@@ -1,19 +1,27 @@
1
1
  import { Meta, StoryObj } from "@storybook/react-vite"
2
2
  import Component from "./HeroBanner"
3
3
  import Button from "../../Atom/Button/Button"
4
+ import Heading from "../../Atom/Heading/Heading"
4
5
  import "./hero-banner.css"
5
6
  import { ButtonModifiers, HeadingTypes } from "@pnx-mixtape/ids-shape"
7
+ import { HeadingStyles, TextStyles } from "../../enums"
8
+ import Text from "../../Atom/Text/Text"
6
9
 
7
10
  const meta: Meta<typeof Component> = {
8
11
  tags: ["autodocs"],
9
12
  component: Component,
10
13
  args: {
11
- title: "Always put your best foot forward.",
12
- subtitle:
13
- "Make the most of the opportunity by encouraging an action and keeping your copy clear and concise.",
14
- },
15
- argTypes: {
16
- headingLevel: { options: Object.values(HeadingTypes), control: "select" },
14
+ children: (
15
+ <>
16
+ <Heading as={HeadingTypes.ONE} modifier={HeadingStyles.HEADLINE}>
17
+ Always put your best foot forward.
18
+ </Heading>
19
+ <Text modifier={TextStyles.XL}>
20
+ Make the most of the opportunity by encouraging an action and keeping
21
+ your copy clear and concise.
22
+ </Text>
23
+ </>
24
+ ),
17
25
  },
18
26
  }
19
27
 
@@ -25,6 +33,17 @@ export const HeroBanner: Story = {}
25
33
  export const Hero: Story = {
26
34
  args: {
27
35
  hero: true,
28
- children: <Button modifiers={[ButtonModifiers.DARK]}>Button</Button>,
36
+ children: (
37
+ <>
38
+ <Heading as={HeadingTypes.ONE} modifier={HeadingStyles.HEADLINE}>
39
+ Always put your best foot forward.
40
+ </Heading>
41
+ <Text modifier={TextStyles.XL}>
42
+ Make the most of the opportunity by encouraging an action and keeping
43
+ your copy clear and concise.
44
+ </Text>
45
+ <Button modifiers={[ButtonModifiers.DARK]}>Button</Button>
46
+ </>
47
+ ),
29
48
  },
30
49
  }
@@ -1,31 +1,17 @@
1
- import {
2
- ComponentPropsWithoutRef,
3
- JSX,
4
- PropsWithChildren,
5
- ReactNode,
6
- } from "react"
1
+ import { ComponentPropsWithoutRef, JSX, PropsWithChildren } from "react"
7
2
  import classNames from "classnames"
8
3
  import Section from "../../Layout/Section/Section"
9
- import Heading from "../../Atom/Heading/Heading"
10
- import Text from "../../Atom/Text/Text"
11
- import { HeadingStyles, SectionStyles, TextStyles } from "../../enums"
12
- import { HeadingTypes } from "@pnx-mixtape/ids-shape"
4
+ import { SectionStyles } from "../../enums"
13
5
 
14
6
  type HeroBannerProps = PropsWithChildren &
15
7
  ComponentPropsWithoutRef<"div"> & {
16
- title: string | ReactNode
17
- subtitle?: string
18
8
  hero?: boolean
19
9
  center?: boolean
20
- headingLevel?: HeadingTypes
21
10
  }
22
11
  // @todo expand to have new features
23
12
  const HeroBanner = ({
24
- title,
25
13
  hero = false,
26
14
  center = false,
27
- headingLevel = HeadingTypes.ONE,
28
- subtitle,
29
15
  children,
30
16
  className,
31
17
  ...props
@@ -38,10 +24,6 @@ const HeroBanner = ({
38
24
  })}
39
25
  {...props}
40
26
  >
41
- <Heading as={headingLevel} modifier={HeadingStyles.HEADLINE}>
42
- {title}
43
- </Heading>
44
- {subtitle && <Text modifier={TextStyles.XL}>{subtitle}</Text>}
45
27
  {children}
46
28
  </div>
47
29
  </Section>
@@ -5,7 +5,33 @@ exports[`Component/HeroBanner HeroBanner smoke-test 1`] = `
5
5
  <div class="mx-page default">
6
6
  <div class="mx-hero-banner ">
7
7
  <div class="mx-hero-banner__inner">
8
- <div class="mx-hero-banner__content mx-vertical-flow mx-section--xl">
8
+ <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
9
+ <h1>
10
+ Hero banner title
11
+ </h1>
12
+ <p class="mx-text--lede">
13
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
14
+ </p>
15
+ </div>
16
+ <div class="mx-hero-banner__aside mx-hero-banner__aside-image">
17
+ <picture>
18
+ <img src="https://picsum.photos/id/56/558/418?grayscale"
19
+ alt="Blurry bubbles"
20
+ >
21
+ </picture>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ `;
28
+
29
+ exports[`Component/HeroBanner Highlight smoke-test 1`] = `
30
+ <div class="mx-page default">
31
+ <div class="mx-page default">
32
+ <div class="mx-hero-banner mx-hero-banner--hero mx-background--primary">
33
+ <div class="mx-hero-banner__inner">
34
+ <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
9
35
  <h1>
10
36
  Hero banner title
11
37
  </h1>
@@ -38,7 +64,7 @@ exports[`Component/HeroBanner WithLinkList smoke-test 1`] = `
38
64
  <div class="mx-page default">
39
65
  <div class="mx-hero-banner ">
40
66
  <div class="mx-hero-banner__inner">
41
- <div class="mx-hero-banner__content mx-vertical-flow mx-section--xl">
67
+ <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
42
68
  <h1>
43
69
  Hero banner title
44
70
  </h1>
@@ -46,7 +72,10 @@ exports[`Component/HeroBanner WithLinkList smoke-test 1`] = `
46
72
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
47
73
  </p>
48
74
  </div>
49
- <div class="mx-hero-banner__aside">
75
+ <div class="mx-hero-banner__aside mx-section--xl">
76
+ <h2 class=" mx-heading--m">
77
+ Popular links
78
+ </h2>
50
79
  <ul class="mx-link-list">
51
80
  <li>
52
81
  <a href="#">
@@ -82,3 +111,22 @@ exports[`Component/HeroBanner WithLinkList smoke-test 1`] = `
82
111
  </div>
83
112
  </div>
84
113
  `;
114
+
115
+ exports[`Component/HeroBanner WithoutImage smoke-test 1`] = `
116
+ <div class="mx-page default">
117
+ <div class="mx-page default">
118
+ <div class="mx-hero-banner ">
119
+ <div class="mx-hero-banner__inner">
120
+ <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
121
+ <h1>
122
+ Hero banner title
123
+ </h1>
124
+ <p class="mx-text--lede">
125
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
126
+ </p>
127
+ </div>
128
+ </div>
129
+ </div>
130
+ </div>
131
+ </div>
132
+ `;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Page Title
2
+ * Hero Banner
3
3
  */
4
4
 
5
5
  @layer design-system.components {
@@ -8,7 +8,7 @@
8
8
  z-index: 1;
9
9
 
10
10
  &.mx-hero-banner--hero {
11
- min-block-size: var(--hero-height, 400px);
11
+ min-block-size: var(--hero-height, 600px);
12
12
  place-content: center;
13
13
  }
14
14
 
@@ -31,14 +31,18 @@
31
31
  grid-template-areas: "content aside";
32
32
  grid-template-columns: var(--hero-columns, 50% 50%);
33
33
  }
34
+
35
+ &:where(:has(.mx-hero-banner__aside)) .mx-hero-banner__content {
36
+ padding-inline-end: var(--gap-xl);
37
+ }
34
38
  }
35
39
 
36
40
  .mx-hero-banner__content {
37
- align-content: center;
41
+ align-self: var(--hero-align, center);
38
42
  }
39
43
 
40
44
  .mx-hero-banner__aside {
41
- align-content: center;
45
+ align-self: var(--hero-align, center);
42
46
 
43
47
  &.mx-hero-banner__aside-image {
44
48
  overflow: hidden;
@@ -20,7 +20,7 @@
20
20
 
21
21
  <div{{ attributes }}>
22
22
  <div class="mx-hero-banner__inner">
23
- <div class="mx-hero-banner__content mx-vertical-flow mx-section--xl">
23
+ <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
24
24
  {{ title }}
25
25
  {% if subtitle is not empty %}
26
26
  <p class="mx-text--lede">{{ subtitle }}</p>
@@ -29,7 +29,7 @@
29
29
  {{ link }}
30
30
  </div>
31
31
  {% if linkList is not empty %}
32
- <div class="mx-hero-banner__aside">
32
+ <div class="mx-hero-banner__aside mx-section--xl">
33
33
  {{ linkList }}
34
34
  </div>
35
35
  {% elseif image is not empty %}
@@ -0,0 +1,105 @@
1
+ import { Meta, StoryObj } from "@storybook/html-vite"
2
+ import { Page } from "../../../.storybook/decorators"
3
+ import Component from "./hero-search.twig"
4
+ import "../HeroBanner/hero-banner.css"
5
+ import {
6
+ HeroBannerModifier,
7
+ HeadingTypes,
8
+ HeroSearch as HeroSearchType,
9
+ } from "@pnx-mixtape/ids-shape"
10
+ import { Icons } from "../../enums"
11
+
12
+ // Deps.
13
+ import Heading from "../../Atom/Heading/heading.twig"
14
+ import Link from "../../Atom/Link/link.twig"
15
+ import LinkList from "../LinkList/link-list.twig"
16
+ import Icon from "../../Atom/Icon/icon.twig"
17
+ import SearchForm from "../../Form/Search/search-form.twig"
18
+ // css
19
+ import "../LinkList/link-list.css"
20
+
21
+ const meta: Meta<HeroSearchType> = {
22
+ tags: ["autodocs", "ids-mvp"],
23
+ component: Component,
24
+ args: {
25
+ subtitle:
26
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
27
+ title: Heading({
28
+ title: "Hero banner title",
29
+ as: HeadingTypes.ONE,
30
+ }),
31
+ search: SearchForm({
32
+ action: "#search",
33
+ id: "search-keyword",
34
+ }),
35
+ },
36
+ argTypes: {
37
+ modifiers: {
38
+ options: Object.values(HeroBannerModifier),
39
+ control: "multi-select",
40
+ },
41
+ },
42
+ decorators: [Page],
43
+ }
44
+
45
+ export default meta
46
+ type Story = StoryObj<HeroSearchType>
47
+
48
+ export const HeroBanner: Story = {}
49
+
50
+ export const Highlight: Story = {
51
+ args: {
52
+ highlight: true,
53
+ modifiers: [HeroBannerModifier.LIGHT],
54
+ },
55
+ }
56
+
57
+ export const WithLinkList: Story = {
58
+ args: {
59
+ link: null,
60
+ linkList: LinkList({
61
+ title: Heading({
62
+ title: "Popular searches",
63
+ as: HeadingTypes.TWO,
64
+ modifiers: [HeadingTypes.FOUR],
65
+ }),
66
+ items: [
67
+ Link({
68
+ title: "Link one",
69
+ href: "#",
70
+ iconEnd: Icon({
71
+ icon: Icons.CHEVRON_RIGHT,
72
+ }),
73
+ }),
74
+ Link({
75
+ title: "Link two",
76
+ href: "#",
77
+ iconEnd: Icon({
78
+ icon: Icons.CHEVRON_RIGHT,
79
+ }),
80
+ }),
81
+ Link({
82
+ title: "Link three",
83
+ href: "#",
84
+ iconEnd: Icon({
85
+ icon: Icons.CHEVRON_RIGHT,
86
+ }),
87
+ }),
88
+ Link({
89
+ title: "Link four",
90
+ href: "#",
91
+ iconEnd: Icon({
92
+ icon: Icons.CHEVRON_RIGHT,
93
+ }),
94
+ }),
95
+ Link({
96
+ title: "Link five",
97
+ href: "#",
98
+ iconEnd: Icon({
99
+ icon: Icons.CHEVRON_RIGHT,
100
+ }),
101
+ }),
102
+ ],
103
+ }),
104
+ },
105
+ }
@@ -0,0 +1,48 @@
1
+ import { Meta, StoryObj } from "@storybook/react-vite"
2
+ import Component from "./HeroSearch"
3
+ import Button from "../../Atom/Button/Button"
4
+ import { ButtonModifiers, HeadingTypes } from "@pnx-mixtape/ids-shape"
5
+ import Heading from "../../Atom/Heading/Heading"
6
+ import { HeadingStyles, TextStyles } from "../../enums"
7
+ import Text from "../../Atom/Text/Text"
8
+
9
+ const meta: Meta<typeof Component> = {
10
+ tags: ["autodocs"],
11
+ component: Component,
12
+ args: {
13
+ children: (
14
+ <>
15
+ <Heading as={HeadingTypes.ONE} modifier={HeadingStyles.HEADLINE}>
16
+ Always put your best foot forward.
17
+ </Heading>
18
+ <Text modifier={TextStyles.XL}>
19
+ Make the most of the opportunity by encouraging an action and keeping
20
+ your copy clear and concise.
21
+ </Text>
22
+ </>
23
+ ),
24
+ },
25
+ }
26
+
27
+ export default meta
28
+ type Story = StoryObj<typeof meta>
29
+
30
+ export const HeroSearch: Story = {}
31
+
32
+ export const Hero: Story = {
33
+ args: {
34
+ hero: true,
35
+ children: (
36
+ <>
37
+ <Heading as={HeadingTypes.ONE} modifier={HeadingStyles.HEADLINE}>
38
+ Always put your best foot forward.
39
+ </Heading>
40
+ <Text modifier={TextStyles.XL}>
41
+ Make the most of the opportunity by encouraging an action and keeping
42
+ your copy clear and concise.
43
+ </Text>
44
+ <Button modifiers={[ButtonModifiers.DARK]}>Button</Button>
45
+ </>
46
+ ),
47
+ },
48
+ }
@@ -0,0 +1,32 @@
1
+ import { ComponentPropsWithoutRef, JSX, PropsWithChildren } from "react"
2
+ import classNames from "classnames"
3
+ import Section from "../../Layout/Section/Section"
4
+ import { SectionStyles } from "../../enums"
5
+
6
+ type HeroBannerProps = PropsWithChildren &
7
+ ComponentPropsWithoutRef<"div"> & {
8
+ hero?: boolean
9
+ center?: boolean
10
+ }
11
+ // @todo expand to have new features
12
+ const HeroSearch = ({
13
+ hero = false,
14
+ center = false,
15
+ children,
16
+ className,
17
+ ...props
18
+ }: HeroBannerProps): JSX.Element => (
19
+ <Section sizes={SectionStyles.XL} className={className} containing>
20
+ <div
21
+ className={classNames("mx-hero-banner", "mx-vertical-flow", {
22
+ "mx-hero-banner--hero": hero,
23
+ "mx-text--center": center,
24
+ })}
25
+ {...props}
26
+ >
27
+ {children}
28
+ </div>
29
+ </Section>
30
+ )
31
+
32
+ export default HeroSearch
@@ -0,0 +1,176 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Component/HeroSearch HeroBanner smoke-test 1`] = `
4
+ <div class="mx-page default">
5
+ <div class="mx-page default">
6
+ <div class="mx-hero-banner mx-hero-search ">
7
+ <div class="mx-hero-banner__inner">
8
+ <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
9
+ <h1>
10
+ Hero banner title
11
+ </h1>
12
+ <p class="mx-text--lede">
13
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
14
+ </p>
15
+ <form class="mx-form mx-form--inline-button"
16
+ role="search"
17
+ action="#search"
18
+ >
19
+ <input class="mx-input__text "
20
+ id="search-keyword"
21
+ name="search-form"
22
+ type="search"
23
+ value
24
+ aria-label="Search by keywords"
25
+ placeholder="Keywords..."
26
+ >
27
+ <button class="mx-button mx-button--icon-only"
28
+ type="submit"
29
+ >
30
+ <span class="mx-icon mx-icon--search">
31
+ </span>
32
+ <span class="sr-only">
33
+ Search
34
+ </span>
35
+ </button>
36
+ </form>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ `;
43
+
44
+ exports[`Component/HeroSearch Highlight smoke-test 1`] = `
45
+ <div class="mx-page default">
46
+ <div class="mx-page default">
47
+ <div class="mx-hero-banner mx-hero-search mx-hero-banner--hero mx-background--primary">
48
+ <div class="mx-hero-banner__inner">
49
+ <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
50
+ <h1>
51
+ Hero banner title
52
+ </h1>
53
+ <p class="mx-text--lede">
54
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
55
+ </p>
56
+ <form class="mx-form mx-form--inline-button"
57
+ role="search"
58
+ action="#search"
59
+ >
60
+ <input class="mx-input__text "
61
+ id="search-keyword"
62
+ name="search-form"
63
+ type="search"
64
+ value
65
+ aria-label="Search by keywords"
66
+ placeholder="Keywords..."
67
+ >
68
+ <button class="mx-button mx-button--icon-only"
69
+ type="submit"
70
+ >
71
+ <span class="mx-icon mx-icon--search">
72
+ </span>
73
+ <span class="sr-only">
74
+ Search
75
+ </span>
76
+ </button>
77
+ </form>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ `;
84
+
85
+ exports[`Component/HeroSearch WithLinkList smoke-test 1`] = `
86
+ <div class="mx-page default">
87
+ <div class="mx-page default">
88
+ <div class="mx-hero-banner mx-hero-search ">
89
+ <div class="mx-hero-banner__inner">
90
+ <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
91
+ <h1>
92
+ Hero banner title
93
+ </h1>
94
+ <p class="mx-text--lede">
95
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
96
+ </p>
97
+ <form class="mx-form mx-form--inline-button"
98
+ role="search"
99
+ action="#search"
100
+ >
101
+ <input class="mx-input__text "
102
+ id="search-keyword"
103
+ name="search-form"
104
+ type="search"
105
+ value
106
+ aria-label="Search by keywords"
107
+ placeholder="Keywords..."
108
+ >
109
+ <button class="mx-button mx-button--icon-only"
110
+ type="submit"
111
+ >
112
+ <span class="mx-icon mx-icon--search">
113
+ </span>
114
+ <span class="sr-only">
115
+ Search
116
+ </span>
117
+ </button>
118
+ </form>
119
+ </div>
120
+ <div class="mx-hero-banner__aside mx-section--xl">
121
+ <h2 class=" mx-heading--m">
122
+ Popular searches
123
+ </h2>
124
+ <ul class="mx-link-list">
125
+ <li>
126
+ <a href="#">
127
+ <span>
128
+ Link one
129
+ </span>
130
+ <span class="mx-icon mx-icon--chevron-right ">
131
+ </span>
132
+ </a>
133
+ </li>
134
+ <li>
135
+ <a href="#">
136
+ <span>
137
+ Link two
138
+ </span>
139
+ <span class="mx-icon mx-icon--chevron-right ">
140
+ </span>
141
+ </a>
142
+ </li>
143
+ <li>
144
+ <a href="#">
145
+ <span>
146
+ Link three
147
+ </span>
148
+ <span class="mx-icon mx-icon--chevron-right ">
149
+ </span>
150
+ </a>
151
+ </li>
152
+ <li>
153
+ <a href="#">
154
+ <span>
155
+ Link four
156
+ </span>
157
+ <span class="mx-icon mx-icon--chevron-right ">
158
+ </span>
159
+ </a>
160
+ </li>
161
+ <li>
162
+ <a href="#">
163
+ <span>
164
+ Link five
165
+ </span>
166
+ <span class="mx-icon mx-icon--chevron-right ">
167
+ </span>
168
+ </a>
169
+ </li>
170
+ </ul>
171
+ </div>
172
+ </div>
173
+ </div>
174
+ </div>
175
+ </div>
176
+ `;
@@ -0,0 +1,36 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Component/HeroSearch Hero smoke-test 1`] = `
4
+ <div class="mx-page mx-section--xl">
5
+ <div class="mx-hero-banner mx-vertical-flow mx-hero-banner--hero">
6
+ <h1 class="mx-headline"
7
+ id="always-put-your-best-"
8
+ >
9
+ Always put your best foot forward.
10
+ </h1>
11
+ <p class="mx-text--xl">
12
+ Make the most of the opportunity by encouraging an action and keeping your copy clear and concise.
13
+ </p>
14
+ <button class="mx-button mx-button--dark"
15
+ type="button"
16
+ >
17
+ Button
18
+ </button>
19
+ </div>
20
+ </div>
21
+ `;
22
+
23
+ exports[`Component/HeroSearch HeroSearch smoke-test 1`] = `
24
+ <div class="mx-page mx-section--xl">
25
+ <div class="mx-hero-banner mx-vertical-flow">
26
+ <h1 class="mx-headline"
27
+ id="always-put-your-best-"
28
+ >
29
+ Always put your best foot forward.
30
+ </h1>
31
+ <p class="mx-text--xl">
32
+ Make the most of the opportunity by encouraging an action and keeping your copy clear and concise.
33
+ </p>
34
+ </div>
35
+ </div>
36
+ `;
@@ -0,0 +1,43 @@
1
+ {% set baseClass = 'mx-hero-banner' %}
2
+ {% set background = null %}
3
+ {% for modifier in modifiers %}
4
+ {% if modifier == "dark" %}
5
+ {% set background = 'mx-background--reverse' %}
6
+ {% endif %}
7
+ {% if modifier == "off-white" %}
8
+ {% set background = 'mx-background--alt' %}
9
+ {% endif %}
10
+ {% if modifier == "light" %}
11
+ {% set background = 'mx-background--primary' %}
12
+ {% endif %}
13
+ {% endfor %}
14
+ {% set classes = [
15
+ baseClass,
16
+ 'mx-hero-search',
17
+ highlight ? baseClass~'--hero' : null,
18
+ background ? background : null,
19
+ ] %}
20
+ {% set attributes = (attributes ?? create_attribute()).addClass(classes) %}
21
+
22
+ <div{{ attributes }}>
23
+ <div class="mx-hero-banner__inner">
24
+ <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
25
+ {{ title }}
26
+ {% if subtitle is not empty %}
27
+ <p class="mx-text--lede">{{ subtitle }}</p>
28
+ {% endif %}
29
+ {{ content }}
30
+ {{ link }}
31
+ {{ search }}
32
+ </div>
33
+ {% if linkList is not empty %}
34
+ <div class="mx-hero-banner__aside mx-section--xl">
35
+ {{ linkList }}
36
+ </div>
37
+ {% elseif image is not empty %}
38
+ <div class="mx-hero-banner__aside mx-hero-banner__aside-image">
39
+ {{ image }}
40
+ </div>
41
+ {% endif %}
42
+ </div>
43
+ </div>
@@ -11,7 +11,7 @@ const meta: Meta<typeof Component> = {
11
11
  component: Component,
12
12
  render: () => (
13
13
  <Sidebar before sidebar={<Component />}>
14
- <div className="vertical-flow">
14
+ <div className="mx-vertical-flow">
15
15
  <Heading level={HeadingLevels.TWO}>Section 1</Heading>
16
16
  <Text>
17
17
  In publishing and graphic design, lorem ipsum is a placeholder text