@pnx-mixtape/mxds 0.0.3 → 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.
- package/package.json +2 -2
- package/src/Atom/Background/__snapshots__/Backgrounds.stories.ts.snap +3 -3
- package/src/Atom/Button/Button.stories.ts +4 -6
- package/src/Atom/Button/__snapshots__/Button.stories.ts.snap +23 -11
- package/src/Atom/Button/__snapshots__/Button.stories.tsx.snap +2 -2
- package/src/Atom/Button/_buttons.css +4 -0
- package/src/Atom/Button/button.twig +6 -4
- package/src/Atom/Button/twig/story-button.twig +11 -0
- package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.tsx.snap +1 -1
- package/src/Atom/Heading/__snapshots__/Heading.stories.ts.snap +2 -2
- package/src/Atom/Heading/__snapshots__/Heading.stories.tsx.snap +1 -1
- package/src/Atom/Heading/heading.twig +19 -1
- package/src/Atom/Icon/__snapshots__/Icon.stories.ts.snap +3 -3
- package/src/Atom/Icon/__snapshots__/Icon.stories.tsx.snap +3 -3
- package/src/Atom/Image/__snapshots__/Image.stories.ts.snap +1 -1
- package/src/Atom/Link/Link.stories.ts +31 -7
- package/src/Atom/Link/__snapshots__/Link.stories.ts.snap +46 -6
- package/src/Atom/Link/__snapshots__/Link.stories.tsx.snap +3 -3
- package/src/Atom/Link/_links.css +23 -1
- package/src/Atom/Link/link.twig +8 -6
- package/src/Atom/Link/twig/story-link.twig +11 -0
- package/src/Atom/Media/Media.stories.ts +17 -1
- package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +17 -2
- package/src/Atom/Media/__snapshots__/Media.stories.tsx.snap +2 -2
- package/src/Atom/Media/twig/story-media.twig +11 -0
- package/src/Atom/NavList/__snapshots__/NavList.stories.ts.snap +1 -1
- package/src/Atom/Spacing/__snapshots__/Spacing.stories.ts.snap +1 -1
- package/src/Atom/Table/__snapshots__/Table.stories.ts.snap +4 -4
- package/src/Atom/Table/__snapshots__/TableResponsive.stories.ts.snap +1 -1
- package/src/Atom/Text/__snapshots__/Text.stories.tsx.snap +1 -1
- package/src/Atom/Text/__snapshots__/TextSizes.stories.ts.snap +2 -2
- package/src/Atom/Video/Video.stories.ts +5 -3
- package/src/Atom/Video/__snapshots__/Video.stories.ts.snap +3 -13
- package/src/Atom/Video/_video.css +5 -0
- package/src/Component/Accordion/__snapshots__/Accordion.stories.ts.snap +4 -4
- package/src/Component/Accordion/__snapshots__/Accordion.stories.tsx.snap +1 -1
- package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.ts.snap +1 -1
- package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.tsx.snap +2 -2
- package/src/Component/Callout/__snapshots__/Callout.stories.ts.snap +12 -0
- package/src/Component/Card/__snapshots__/Card.stories.ts.snap +34 -24
- package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +3 -3
- package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.ts.snap +6 -23
- package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.tsx.snap +1 -1
- package/src/Component/Dialog/__snapshots__/Dialog.stories.ts.snap +2 -2
- package/src/Component/Dialog/__snapshots__/Dialog.stories.tsx.snap +1 -1
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +1 -1
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +1 -1
- package/src/Component/{InPageAlert/Elements/InPageAlert.ts → GlobalAlert/Elements/ClosableAlert.ts} +21 -10
- package/src/Component/GlobalAlert/GlobalAlert.stories.ts +49 -0
- package/src/Component/GlobalAlert/GlobalAlert.stories.tsx +33 -0
- package/src/Component/GlobalAlert/GlobalAlert.tsx +50 -0
- package/src/Component/GlobalAlert/README.md +27 -0
- package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.ts.snap +43 -0
- package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.tsx.snap +48 -0
- package/src/Component/GlobalAlert/global-alert.css +55 -0
- package/src/Component/GlobalAlert/global-alert.entry.js +1 -0
- package/src/Component/GlobalAlert/global-alert.twig +30 -0
- package/src/Component/GlobalAlert/twig/story-global-alert.twig +14 -0
- package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +74 -0
- package/src/Component/HeroBanner/__snapshots__/{PageTitle.stories.tsx.snap → HeroBanner.stories.tsx.snap} +4 -4
- package/src/Component/InPageAlert/InPageAlert.stories.ts +20 -22
- package/src/Component/InPageAlert/InPageAlert.stories.tsx +5 -5
- package/src/Component/InPageAlert/InPageAlert.tsx +15 -41
- package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.ts.snap +9 -36
- package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.tsx.snap +56 -56
- package/src/Component/InPageAlert/in-page-alert.twig +13 -16
- package/src/Component/InPageAlert/twig/story-in-page-alert.twig +11 -0
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +6 -70
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.tsx.snap +1 -1
- package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +24 -55
- package/src/Component/Navigation/__snapshots__/Collapsible.stories.ts.snap +1 -1
- package/src/Component/Navigation/__snapshots__/Dropdown.stories.ts.snap +1 -1
- package/src/Component/Navigation/__snapshots__/Dropdown.stories.tsx.snap +1 -1
- package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +1 -1
- package/src/Component/Navigation/__snapshots__/Navigation.stories.tsx.snap +2 -2
- package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +1 -1
- package/src/Component/Pagination/__snapshots__/Pagination.stories.tsx.snap +1 -1
- package/src/Component/Sticky/__snapshots__/Sticky.stories.ts.snap +9 -82
- package/src/Component/Sticky/__snapshots__/Sticky.stories.tsx.snap +1 -1
- package/src/Component/Tabs/README.md +0 -1
- package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +1 -1
- package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +1 -1
- package/src/Component/Tag/__snapshots__/Tag.stories.ts.snap +3 -3
- package/src/Component/Tag/__snapshots__/Tag.stories.tsx.snap +1 -1
- package/src/Component/Tile/__snapshots__/Tile.stories.ts.snap +1 -1
- package/src/Component/Tile/__snapshots__/Tile.stories.tsx.snap +2 -2
- package/src/Layout/Footer/FooterMenu/__snapshots__/FooterMenu.stories.ts.snap +1 -1
- package/src/Layout/Grid/__snapshots__/Grid.stories.ts.snap +33 -90
- package/src/Layout/Masthead/__snapshots__/Masthead.stories.ts.snap +2 -2
- package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +1 -1
- package/src/Layout/Section/Section.stories.ts +1 -2
- package/src/Layout/Section/__snapshots__/Background.stories.ts.snap +59 -0
- package/src/Layout/Section/__snapshots__/Breakouts.stories.ts.snap +80 -0
- package/src/Layout/Section/__snapshots__/Flow.stories.ts.snap +91 -0
- package/src/Layout/Section/__snapshots__/Section.stories.ts.snap +22 -14
- package/src/Layout/Section/twig/section-story.twig +1 -1
- package/src/elements.ts +1 -1
- package/dist/build/accordion.css +0 -1
- package/dist/build/accordion.entry.js +0 -1
- package/dist/build/base.css +0 -1
- package/dist/build/breadcrumb.css +0 -1
- package/dist/build/button.css +0 -1
- package/dist/build/callout.css +0 -1
- package/dist/build/card.css +0 -1
- package/dist/build/chunks/disclosure-widget-CfhDmuvA.js +0 -1
- package/dist/build/chunks/keyboard-Cs0cduxq.js +0 -1
- package/dist/build/chunks/polyfills-DUM8gN-6.js +0 -1
- package/dist/build/chunks/popover-BGbvrIUp.js +0 -1
- package/dist/build/chunks/utilities-Bzel_okZ.js +0 -2
- package/dist/build/constants.css +0 -1
- package/dist/build/container-grid.css +0 -1
- package/dist/build/content-block.css +0 -1
- package/dist/build/dialog.css +0 -1
- package/dist/build/dialog.entry.js +0 -1
- package/dist/build/drop-menu.css +0 -1
- package/dist/build/drop-menu.entry.js +0 -1
- package/dist/build/drupal.css +0 -1
- package/dist/build/footer-menu.css +0 -1
- package/dist/build/footer.css +0 -1
- package/dist/build/form.css +0 -1
- package/dist/build/grid.css +0 -1
- package/dist/build/header.css +0 -1
- package/dist/build/header.entry.js +0 -1
- package/dist/build/hero-banner.css +0 -1
- package/dist/build/icon.css +0 -1
- package/dist/build/in-page-alert.css +0 -1
- package/dist/build/in-page-alert.entry.js +0 -1
- package/dist/build/in-page-navigation.css +0 -1
- package/dist/build/in-page-navigation.entry.js +0 -1
- package/dist/build/index.css +0 -1
- package/dist/build/link-list.css +0 -1
- package/dist/build/masthead.css +0 -1
- package/dist/build/nav-list.css +0 -1
- package/dist/build/navigation.css +0 -1
- package/dist/build/navigation.entry.js +0 -1
- package/dist/build/page.css +0 -1
- package/dist/build/pagination.css +0 -1
- package/dist/build/section.css +0 -1
- package/dist/build/sidebar.css +0 -1
- package/dist/build/sticky.css +0 -1
- package/dist/build/sticky.entry.js +0 -1
- package/dist/build/tabs.css +0 -1
- package/dist/build/tabs.entry.js +0 -1
- package/dist/build/tag.css +0 -1
- package/dist/build/tiles.css +0 -1
- package/dist/build/utilities.css +0 -1
- package/src/Component/Card/__snapshots__/CardGrid.stories.ts.snap +0 -89
- package/src/Component/HeroBanner/__snapshots__/PageTitle.stories.ts.snap +0 -31
- package/src/Component/InPageAlert/in-page-alert.entry.js +0 -1
- package/src/Layout/Section/__snapshots__/SectionBackground.stories.ts.snap +0 -55
- package/src/Layout/Section/__snapshots__/SectionsBreakouts.stories.ts.snap +0 -78
- package/src/Layout/Section/__snapshots__/SectionsFlowsGroups.stories.ts.snap +0 -89
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.
|
|
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.
|
|
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",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
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[`
|
|
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[`
|
|
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,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
|
-
"
|
|
34
|
-
"icon
|
|
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
|
-
|
|
65
|
+
iconEnd: {
|
|
67
66
|
icon: Icons.ARROW_RIGHT,
|
|
68
|
-
align: AlignmentTypes.END,
|
|
69
67
|
},
|
|
70
68
|
},
|
|
71
69
|
}
|
|
@@ -1,41 +1,53 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`Atom/Button Button smoke-test 1`] = `
|
|
4
4
|
<button class="button "
|
|
5
5
|
type="button"
|
|
6
6
|
>
|
|
7
|
-
|
|
7
|
+
<span>
|
|
8
|
+
Button
|
|
9
|
+
</span>
|
|
8
10
|
</button>
|
|
9
11
|
`;
|
|
10
12
|
|
|
11
|
-
exports[`
|
|
12
|
-
<button class="button
|
|
13
|
+
exports[`Atom/Button IconButton smoke-test 1`] = `
|
|
14
|
+
<button class="button "
|
|
13
15
|
type="button"
|
|
14
16
|
>
|
|
15
|
-
|
|
17
|
+
<span>
|
|
18
|
+
Button
|
|
19
|
+
</span>
|
|
20
|
+
<span class="icon icon--arrow-right ">
|
|
21
|
+
</span>
|
|
16
22
|
</button>
|
|
17
23
|
`;
|
|
18
24
|
|
|
19
|
-
exports[`
|
|
25
|
+
exports[`Atom/Button Link smoke-test 1`] = `
|
|
20
26
|
<a class="button "
|
|
21
27
|
href="#"
|
|
22
28
|
>
|
|
23
|
-
|
|
29
|
+
<span>
|
|
30
|
+
Button
|
|
31
|
+
</span>
|
|
24
32
|
</a>
|
|
25
33
|
`;
|
|
26
34
|
|
|
27
|
-
exports[`
|
|
35
|
+
exports[`Atom/Button Primary smoke-test 1`] = `
|
|
28
36
|
<button class="button button--dark"
|
|
29
37
|
type="button"
|
|
30
38
|
>
|
|
31
|
-
|
|
39
|
+
<span>
|
|
40
|
+
Button
|
|
41
|
+
</span>
|
|
32
42
|
</button>
|
|
33
43
|
`;
|
|
34
44
|
|
|
35
|
-
exports[`
|
|
45
|
+
exports[`Atom/Button Text smoke-test 1`] = `
|
|
36
46
|
<button class="button button--light"
|
|
37
47
|
type="button"
|
|
38
48
|
>
|
|
39
|
-
|
|
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[`
|
|
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[`
|
|
11
|
+
exports[`Atom/Button Primary smoke-test 1`] = `
|
|
12
12
|
<button class="button button--dark"
|
|
13
13
|
type="button"
|
|
14
14
|
>
|
|
@@ -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
|
-
|
|
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
|
-
{{
|
|
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,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
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
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[`
|
|
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[`
|
|
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[`
|
|
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[`
|
|
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[`
|
|
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,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 {
|
|
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
|
-
"
|
|
21
|
-
"icon
|
|
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
|
|
30
|
+
export const More: Story = {
|
|
31
31
|
args: {
|
|
32
|
-
|
|
32
|
+
more: true,
|
|
33
|
+
iconEnd: {
|
|
33
34
|
icon: Icons.ARROW_RIGHT,
|
|
34
|
-
|
|
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
|
}
|
|
@@ -1,17 +1,57 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
4
|
-
<a class="
|
|
3
|
+
exports[`Atom/Link Download smoke-test 1`] = `
|
|
4
|
+
<a class="link link--download"
|
|
5
5
|
href="#"
|
|
6
6
|
>
|
|
7
|
-
|
|
7
|
+
<span class="icon icon--download ">
|
|
8
|
+
</span>
|
|
9
|
+
<span>
|
|
10
|
+
Download (PDF 12kb)
|
|
11
|
+
</span>
|
|
8
12
|
</a>
|
|
9
13
|
`;
|
|
10
14
|
|
|
11
|
-
exports[`
|
|
12
|
-
<a class
|
|
15
|
+
exports[`Atom/Link External smoke-test 1`] = `
|
|
16
|
+
<a class="link link--external"
|
|
13
17
|
href="#"
|
|
14
18
|
>
|
|
15
|
-
|
|
19
|
+
<span>
|
|
20
|
+
Hyperlink
|
|
21
|
+
</span>
|
|
22
|
+
</a>
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
exports[`Atom/Link IconLink smoke-test 1`] = `
|
|
26
|
+
<a class="link "
|
|
27
|
+
href="#"
|
|
28
|
+
>
|
|
29
|
+
<span class="icon icon--link ">
|
|
30
|
+
</span>
|
|
31
|
+
<span>
|
|
32
|
+
Hyperlink
|
|
33
|
+
</span>
|
|
34
|
+
</a>
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
exports[`Atom/Link Link smoke-test 1`] = `
|
|
38
|
+
<a class="link "
|
|
39
|
+
href="#"
|
|
40
|
+
>
|
|
41
|
+
<span>
|
|
42
|
+
Hyperlink
|
|
43
|
+
</span>
|
|
44
|
+
</a>
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
exports[`Atom/Link More smoke-test 1`] = `
|
|
48
|
+
<a class="link link--more "
|
|
49
|
+
href="#"
|
|
50
|
+
>
|
|
51
|
+
<span>
|
|
52
|
+
Hyperlink
|
|
53
|
+
</span>
|
|
54
|
+
<span class="icon icon--arrow-right ">
|
|
55
|
+
</span>
|
|
16
56
|
</a>
|
|
17
57
|
`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`Atom/Link External smoke-test 1`] = `
|
|
4
4
|
<a href="http://example.com"
|
|
5
5
|
class="link link--external"
|
|
6
6
|
>
|
|
@@ -8,7 +8,7 @@ exports[`Base/Link External smoke-test 1`] = `
|
|
|
8
8
|
</a>
|
|
9
9
|
`;
|
|
10
10
|
|
|
11
|
-
exports[`
|
|
11
|
+
exports[`Atom/Link Link smoke-test 1`] = `
|
|
12
12
|
<a href="http://example.com"
|
|
13
13
|
class="link"
|
|
14
14
|
>
|
|
@@ -16,7 +16,7 @@ exports[`Base/Link Link smoke-test 1`] = `
|
|
|
16
16
|
</a>
|
|
17
17
|
`;
|
|
18
18
|
|
|
19
|
-
exports[`
|
|
19
|
+
exports[`Atom/Link More smoke-test 1`] = `
|
|
20
20
|
<a href="http://example.com"
|
|
21
21
|
class="link link--more"
|
|
22
22
|
>
|
package/src/Atom/Link/_links.css
CHANGED
|
@@ -33,7 +33,29 @@
|
|
|
33
33
|
|
|
34
34
|
a:where([href]).link--more {
|
|
35
35
|
font-weight: var(--font-weight-bold);
|
|
36
|
+
|
|
37
|
+
& .icon {
|
|
38
|
+
transition: transform 0.5s var(--ease);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:hover .icon {
|
|
42
|
+
transform: translateX(3px);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
a:where([href]).link--download {
|
|
47
|
+
& .icon {
|
|
48
|
+
transition: transform 0.5s var(--ease);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:hover .icon {
|
|
52
|
+
transform: translateY(3px);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
a:where([href]):has(.icon) {
|
|
36
57
|
display: inline-flex;
|
|
37
|
-
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: var(--spacing-xxs);
|
|
38
60
|
}
|
|
39
61
|
}
|
package/src/Atom/Link/link.twig
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
{% set baseClass = 'link' %}
|
|
1
2
|
{% set classes = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
icon.align ? 'icon--'~icon.align : null,
|
|
3
|
+
baseClass,
|
|
4
|
+
more ? baseClass~'--more' : null,
|
|
5
|
+
external ? baseClass~'--external' : null,
|
|
6
|
+
download ? baseClass~'--download' : null,
|
|
7
7
|
] %}
|
|
8
8
|
{% set attributes = (attributes|default(create_attribute())).addClass(classes) %}
|
|
9
9
|
|
|
10
10
|
<a{{ attributes }} href="{{ href }}"{% if current %} aria-current="page"{% endif %}>
|
|
11
|
-
{{
|
|
11
|
+
{{ iconStart }}
|
|
12
|
+
<span>{{ title }}</span>
|
|
13
|
+
{{ iconEnd }}
|
|
12
14
|
</a>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{% extends "../link.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,5 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from "@storybook/html"
|
|
2
|
-
import Component from "./media.twig"
|
|
2
|
+
import Component from "./twig/story-media.twig"
|
|
3
3
|
import "../_base.css"
|
|
4
4
|
import { Media as MediaType, MediaAlignmentTypes } from "@pnx-mixtape/ids-shape"
|
|
5
5
|
|
|
@@ -12,9 +12,14 @@ const meta: Meta<MediaType> = {
|
|
|
12
12
|
alt: "Some blurry bubble image",
|
|
13
13
|
},
|
|
14
14
|
caption: "A picsum image",
|
|
15
|
+
type: "image",
|
|
15
16
|
},
|
|
16
17
|
argTypes: {
|
|
17
18
|
align: { options: Object.values(MediaAlignmentTypes), control: "select" },
|
|
19
|
+
// @ts-expect-error The controls follow the shape
|
|
20
|
+
"item.src": { control: "text" },
|
|
21
|
+
"item.alt": { control: "text" },
|
|
22
|
+
"item.title": { control: "text" },
|
|
18
23
|
},
|
|
19
24
|
}
|
|
20
25
|
|
|
@@ -24,3 +29,14 @@ type Story = StoryObj<MediaType>
|
|
|
24
29
|
export const Media: Story = {
|
|
25
30
|
args: {},
|
|
26
31
|
}
|
|
32
|
+
|
|
33
|
+
export const Video: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
type: "video",
|
|
36
|
+
caption: "A remote video",
|
|
37
|
+
item: {
|
|
38
|
+
src: "https://www.youtube.com/embed/NpEaa2P7qZI",
|
|
39
|
+
title: "Something from youtube",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
4
|
-
<figure class="media ">
|
|
3
|
+
exports[`Atom/Media Media smoke-test 1`] = `
|
|
4
|
+
<figure class="media media--image ">
|
|
5
5
|
<picture>
|
|
6
6
|
<img src="https://picsum.photos/id/56/558/418?grayscale"
|
|
7
7
|
alt="Some blurry bubble image"
|
|
@@ -12,3 +12,18 @@ exports[`Base/Media Media smoke-test 1`] = `
|
|
|
12
12
|
</figcaption>
|
|
13
13
|
</figure>
|
|
14
14
|
`;
|
|
15
|
+
|
|
16
|
+
exports[`Atom/Media Video smoke-test 1`] = `
|
|
17
|
+
<figure class="media media--video ">
|
|
18
|
+
<figure class="video">
|
|
19
|
+
<iframe src="https://www.youtube.com/embed/NpEaa2P7qZI"
|
|
20
|
+
title="Something from youtube"
|
|
21
|
+
allowfullscreen
|
|
22
|
+
>
|
|
23
|
+
</iframe>
|
|
24
|
+
</figure>
|
|
25
|
+
<figcaption>
|
|
26
|
+
A remote video
|
|
27
|
+
</figcaption>
|
|
28
|
+
</figure>
|
|
29
|
+
`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`Atom/Image Caption smoke-test 1`] = `
|
|
4
4
|
<figure class="media--left">
|
|
5
5
|
<img alt="Example image"
|
|
6
6
|
src="https://picsum.photos/id/56/558/418?grayscale"
|
|
@@ -11,7 +11,7 @@ exports[`Base/Image Caption smoke-test 1`] = `
|
|
|
11
11
|
</figure>
|
|
12
12
|
`;
|
|
13
13
|
|
|
14
|
-
exports[`
|
|
14
|
+
exports[`Atom/Image Image smoke-test 1`] = `
|
|
15
15
|
<img alt="Example image"
|
|
16
16
|
src="https://picsum.photos/id/56/558/418?grayscale"
|
|
17
17
|
>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{% extends "../media.twig" %}
|
|
2
|
+
{% if type == "image" %}
|
|
3
|
+
{% set item %}
|
|
4
|
+
{% include "@mixtape/Atom/Image/image.twig" with { src: item.src, alt: item.alt } only %}
|
|
5
|
+
{% endset %}
|
|
6
|
+
{% endif %}
|
|
7
|
+
{% if type == "video" %}
|
|
8
|
+
{% set item %}
|
|
9
|
+
{% include "@mixtape/Atom/Video/video.twig" with { src: item.src, title: item.title } only %}
|
|
10
|
+
{% endset %}
|
|
11
|
+
{% endif %}
|