@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.
- package/README.md +18 -6
- package/dist/build/accordion.entry.js +2 -2
- package/dist/build/accordion.entry.js.map +1 -1
- package/dist/build/base.css +2 -1
- package/dist/build/button.css +4 -4
- package/dist/build/card.css +6 -5
- package/dist/build/chunks/{Accordion-deu4CCT-.js → Accordion-O-huO4At.js} +2 -2
- package/dist/build/chunks/{Accordion-deu4CCT-.js.map → Accordion-O-huO4At.js.map} +1 -1
- package/dist/build/chunks/{disclosure-widget-WwE5XplD.js → disclosure-widget-DVpnRsTI.js} +2 -2
- package/dist/build/chunks/{disclosure-widget-WwE5XplD.js.map → disclosure-widget-DVpnRsTI.js.map} +1 -1
- package/dist/build/chunks/{drop-menu.entry-e1iZ4ERw.js → drop-menu.entry-B4TtnC50.js} +2 -2
- package/dist/build/chunks/{drop-menu.entry-e1iZ4ERw.js.map → drop-menu.entry-B4TtnC50.js.map} +1 -1
- package/dist/build/chunks/{utilities-BeWkujCZ.js → utilities-DXELy_An.js} +91 -1
- package/dist/build/chunks/utilities-DXELy_An.js.map +1 -0
- package/dist/build/constants.css +6 -4
- package/dist/build/dialog.css +1 -9
- package/dist/build/dialog.entry.js +1 -1
- package/dist/build/drop-menu.entry.js +1 -1
- package/dist/build/filters.entry.js +1 -1
- package/dist/build/global-alert.entry.js +1 -1
- package/dist/build/header.css +49 -63
- package/dist/build/header.entry.js +1107 -21
- package/dist/build/header.entry.js.map +1 -1
- package/dist/build/hero-banner.css +12 -6
- package/dist/build/in-page-navigation.entry.js +1 -1
- package/dist/build/navigation.entry.js +2 -2
- package/dist/build/page.css +2 -2
- package/dist/build/pagination.css +15 -21
- package/dist/build/steps.css +11 -11
- package/dist/build/sticky.entry.js +1 -1
- package/dist/build/tabs.entry.js +2 -2
- package/dist/build/utilities.css +9 -1
- package/package.json +18 -29
- package/src/Atom/Button/_buttons-styles.css +3 -3
- package/src/Atom/Heading/Heading.tsx +1 -1
- package/src/Atom/Icon/Icon.tsx +1 -1
- package/src/Atom/Link/Link.stories.tsx +2 -6
- package/src/Atom/Link/Link.tsx +9 -4
- package/src/Atom/Link/_links.css +1 -0
- package/src/Component/Accordion/Accordion.stories.tsx +39 -9
- package/src/Component/Accordion/Accordion.tsx +28 -50
- package/src/Component/Accordion/Components/AccordionContent.tsx +24 -0
- package/src/Component/Accordion/Components/AccordionTitle.tsx +34 -0
- package/src/Component/Accordion/Components/AccordionTitleIcon.tsx +22 -0
- package/src/Component/Accordion/__snapshots__/Accordion.stories.tsx.snap +26 -0
- package/src/Component/Breadcrumb/Breadcrumb.tsx +8 -2
- package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.tsx.snap +7 -3
- package/src/Component/Card/Card.stories.tsx +22 -19
- package/src/Component/Card/Card.tsx +6 -28
- package/src/Component/Card/Components/CardContent.tsx +12 -0
- package/src/Component/Card/Components/CardMedia.tsx +17 -0
- package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +9 -9
- package/src/Component/Card/card.css +3 -2
- package/src/Component/ContentBlock/Components/ContentBlockContent.tsx +14 -0
- package/src/Component/ContentBlock/Components/ContentBlockMedia.tsx +20 -0
- package/src/Component/ContentBlock/ContentBlock.stories.tsx +16 -13
- package/src/Component/ContentBlock/ContentBlock.tsx +5 -28
- package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.tsx.snap +0 -2
- package/src/Component/Dialog/Components/DialogCloseButton.tsx +18 -0
- package/src/Component/Dialog/Components/DialogContent.tsx +7 -0
- package/src/Component/Dialog/Dialog.stories.tsx +19 -24
- package/src/Component/Dialog/Dialog.tsx +31 -25
- package/src/Component/Dialog/__snapshots__/Dialog.stories.tsx.snap +14 -21
- package/src/Component/Dialog/dialog.css +0 -8
- package/src/Component/HeroBanner/HeroBanner.stories.ts +23 -12
- package/src/Component/HeroBanner/HeroBanner.stories.tsx +26 -7
- package/src/Component/HeroBanner/HeroBanner.tsx +2 -20
- package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +51 -3
- package/src/Component/HeroBanner/hero-banner.css +8 -4
- package/src/Component/HeroBanner/hero-banner.twig +2 -2
- package/src/Component/HeroSearch/HeroSearch.stories.ts +105 -0
- package/src/Component/HeroSearch/HeroSearch.stories.tsx +48 -0
- package/src/Component/HeroSearch/HeroSearch.tsx +32 -0
- package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.ts.snap +176 -0
- package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.tsx.snap +36 -0
- package/src/Component/HeroSearch/hero-search.twig +43 -0
- package/src/Component/InPageNavigation/InPageNavigation.stories.tsx +1 -1
- package/src/Component/InPageNavigation/InPageNavigation.tsx +1 -0
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.tsx.snap +1 -1
- package/src/Component/LinkList/LinkList.stories.ts +12 -0
- package/src/Component/LinkList/LinkList.stories.tsx +0 -6
- package/src/Component/LinkList/LinkList.tsx +5 -16
- package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +37 -0
- package/src/Component/LinkList/__snapshots__/LinkList.stories.tsx.snap +9 -29
- package/src/Component/LinkList/link-list.twig +1 -0
- package/src/Component/ListItem/Components/ListItemContent.tsx +12 -0
- package/src/Component/ListItem/Components/ListItemMedia.tsx +20 -0
- package/src/Component/ListItem/ListItem.stories.tsx +22 -19
- package/src/Component/ListItem/ListItem.tsx +3 -32
- package/src/Component/ListItem/__snapshots__/ListItem.stories.tsx.snap +3 -0
- package/src/Component/Pagination/Components/PaginationContext.tsx +10 -4
- package/src/Component/Pagination/Components/PaginationItem.tsx +10 -10
- package/src/Component/Pagination/Pagination.tsx +6 -2
- package/src/Component/Pagination/__snapshots__/Pagination.stories.tsx.snap +10 -4
- package/src/Component/Pagination/pagination.css +13 -18
- package/src/Component/Steps/__snapshots__/Steps.stories.ts.snap +12 -12
- package/src/Component/Steps/step-item.twig +1 -1
- package/src/Component/Steps/steps.css +1 -2
- package/src/Component/Tabs/Components/TabPanel.tsx +1 -1
- package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +2 -0
- package/src/Component/Tile/Tile.stories.tsx +20 -15
- package/src/Component/Tile/__snapshots__/Tile.stories.tsx.snap +18 -23
- package/src/Layout/Header/Elements/GlobalToggle.ts +55 -21
- package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +14 -14
- package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +2 -2
- package/src/Layout/Header/_header.css +2 -47
- package/src/Layout/Header/_toggles.css +37 -1
- package/src/Layout/Header/header.twig +5 -5
- package/src/Layout/Page/Page.stories.tsx +13 -4
- package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +2 -2
- package/src/Layout/Page/page.css +1 -1
- package/src/Layout/Section/__snapshots__/Section.stories.tsx.snap +3 -3
- package/src/Layout/Section/__snapshots__/SectionGrid.stories.tsx.snap +2 -2
- package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.tsx.snap +3 -3
- package/src/Utility/utilities.css +8 -0
- package/src/constants.css +5 -3
- package/src/react.ts +30 -7
- package/src/tokens.js +3 -1
- package/dist/build/chunks/utilities-BeWkujCZ.js.map +0 -1
- 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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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:
|
|
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
|
|
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
|
-
*
|
|
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,
|
|
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-
|
|
41
|
+
align-self: var(--hero-align, center);
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
.mx-hero-banner__aside {
|
|
41
|
-
align-
|
|
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
|