@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
|
@@ -5,7 +5,9 @@ import "./link-list.css"
|
|
|
5
5
|
// Deps.
|
|
6
6
|
import Link from "../../Atom/Link/link.twig"
|
|
7
7
|
import Icon from "../../Atom/Icon/icon.twig"
|
|
8
|
+
import Heading from "../../Atom/Heading/heading.twig"
|
|
8
9
|
import { Icons } from "../../enums"
|
|
10
|
+
import { HeadingTypes } from "@pnx-mixtape/ids-shape"
|
|
9
11
|
|
|
10
12
|
const meta: Meta<typeof Component> = {
|
|
11
13
|
tags: ["autodocs", "ids-mvp"],
|
|
@@ -41,3 +43,13 @@ export default meta
|
|
|
41
43
|
type Story = StoryObj<typeof meta>
|
|
42
44
|
|
|
43
45
|
export const LinkList: Story = {}
|
|
46
|
+
|
|
47
|
+
export const WithTitle: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
title: Heading({
|
|
50
|
+
title: "Popular links",
|
|
51
|
+
as: HeadingTypes.TWO,
|
|
52
|
+
modifiers: [HeadingTypes.FOUR],
|
|
53
|
+
}),
|
|
54
|
+
},
|
|
55
|
+
}
|
|
@@ -3,21 +3,9 @@ import classNames from "classnames"
|
|
|
3
3
|
import Link from "../../Atom/Link/Link"
|
|
4
4
|
import { Icons } from "../../enums"
|
|
5
5
|
|
|
6
|
-
type LinkListProps = PropsWithChildren & {
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
// @todo no divided
|
|
10
|
-
const LinkList = ({
|
|
11
|
-
divided = false,
|
|
12
|
-
children,
|
|
13
|
-
}: LinkListProps): JSX.Element => (
|
|
14
|
-
<ul
|
|
15
|
-
className={classNames("mx-link-list", {
|
|
16
|
-
"mx-link-list--divided": divided,
|
|
17
|
-
})}
|
|
18
|
-
>
|
|
19
|
-
{children}
|
|
20
|
-
</ul>
|
|
6
|
+
type LinkListProps = PropsWithChildren & {}
|
|
7
|
+
const LinkList = ({ children }: LinkListProps): JSX.Element => (
|
|
8
|
+
<ul className={classNames("mx-link-list")}>{children}</ul>
|
|
21
9
|
)
|
|
22
10
|
|
|
23
11
|
type LinkListItemProps = PropsWithChildren & {
|
|
@@ -33,8 +21,9 @@ const LinkListItem = ({
|
|
|
33
21
|
className,
|
|
34
22
|
}: LinkListItemProps): JSX.Element => (
|
|
35
23
|
<li className={className}>
|
|
36
|
-
<Link
|
|
24
|
+
<Link to={to}>
|
|
37
25
|
{children}
|
|
26
|
+
<span className={classNames("mx-icon", `mx-icon--${icon}`)} />
|
|
38
27
|
</Link>
|
|
39
28
|
</li>
|
|
40
29
|
)
|
|
@@ -33,3 +33,40 @@ exports[`Component/LinkList LinkList smoke-test 1`] = `
|
|
|
33
33
|
</ul>
|
|
34
34
|
</div>
|
|
35
35
|
`;
|
|
36
|
+
|
|
37
|
+
exports[`Component/LinkList WithTitle smoke-test 1`] = `
|
|
38
|
+
<div class="mx-page default">
|
|
39
|
+
<h2 class=" mx-heading--m">
|
|
40
|
+
Popular links
|
|
41
|
+
</h2>
|
|
42
|
+
<ul class="mx-link-list">
|
|
43
|
+
<li>
|
|
44
|
+
<a href="#">
|
|
45
|
+
<span>
|
|
46
|
+
Music
|
|
47
|
+
</span>
|
|
48
|
+
<span class="mx-icon mx-icon--chevron-right ">
|
|
49
|
+
</span>
|
|
50
|
+
</a>
|
|
51
|
+
</li>
|
|
52
|
+
<li>
|
|
53
|
+
<a href="#">
|
|
54
|
+
<span>
|
|
55
|
+
Performances
|
|
56
|
+
</span>
|
|
57
|
+
<span class="mx-icon mx-icon--chevron-right ">
|
|
58
|
+
</span>
|
|
59
|
+
</a>
|
|
60
|
+
</li>
|
|
61
|
+
<li>
|
|
62
|
+
<a href="#">
|
|
63
|
+
<span>
|
|
64
|
+
Get involved
|
|
65
|
+
</span>
|
|
66
|
+
<span class="mx-icon mx-icon--chevron-right ">
|
|
67
|
+
</span>
|
|
68
|
+
</a>
|
|
69
|
+
</li>
|
|
70
|
+
</ul>
|
|
71
|
+
</div>
|
|
72
|
+
`;
|
|
@@ -1,52 +1,32 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`Navigation/Link List Divided smoke-test 1`] = `
|
|
4
|
-
<ul class="mx-link-list mx-link-list--divided">
|
|
5
|
-
<li>
|
|
6
|
-
<a href="#1"
|
|
7
|
-
class="mx-icon mx-icon--chevron-right"
|
|
8
|
-
>
|
|
9
|
-
Page link #1
|
|
10
|
-
</a>
|
|
11
|
-
</li>
|
|
12
|
-
<li>
|
|
13
|
-
<a href="#2"
|
|
14
|
-
class="mx-icon mx-icon--chevron-right"
|
|
15
|
-
>
|
|
16
|
-
Page link #2
|
|
17
|
-
</a>
|
|
18
|
-
</li>
|
|
19
|
-
<li>
|
|
20
|
-
<a href="#3"
|
|
21
|
-
class="mx-icon mx-icon--chevron-right"
|
|
22
|
-
>
|
|
23
|
-
Page link #3
|
|
24
|
-
</a>
|
|
25
|
-
</li>
|
|
26
|
-
</ul>
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
3
|
exports[`Navigation/Link List LinkList smoke-test 1`] = `
|
|
30
4
|
<ul class="mx-link-list">
|
|
31
5
|
<li>
|
|
32
6
|
<a href="#1"
|
|
33
|
-
class="mx-
|
|
7
|
+
class="mx-link"
|
|
34
8
|
>
|
|
35
9
|
Page link #1
|
|
10
|
+
<span class="mx-icon mx-icon--chevron-right">
|
|
11
|
+
</span>
|
|
36
12
|
</a>
|
|
37
13
|
</li>
|
|
38
14
|
<li>
|
|
39
15
|
<a href="#2"
|
|
40
|
-
class="mx-
|
|
16
|
+
class="mx-link"
|
|
41
17
|
>
|
|
42
18
|
Page link #2
|
|
19
|
+
<span class="mx-icon mx-icon--chevron-right">
|
|
20
|
+
</span>
|
|
43
21
|
</a>
|
|
44
22
|
</li>
|
|
45
23
|
<li>
|
|
46
24
|
<a href="#3"
|
|
47
|
-
class="mx-
|
|
25
|
+
class="mx-link"
|
|
48
26
|
>
|
|
49
27
|
Page link #3
|
|
28
|
+
<span class="mx-icon mx-icon--chevron-right">
|
|
29
|
+
</span>
|
|
50
30
|
</a>
|
|
51
31
|
</li>
|
|
52
32
|
</ul>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX, PropsWithChildren } from "react"
|
|
2
|
+
import classNames from "classnames"
|
|
3
|
+
|
|
4
|
+
const ListItemContent = ({ children }: PropsWithChildren): JSX.Element => {
|
|
5
|
+
return (
|
|
6
|
+
<div className={classNames("mx-list-item__content", "mx-vertical-flow")}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default ListItemContent
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JSX, PropsWithChildren } from "react"
|
|
2
|
+
import classNames from "classnames"
|
|
3
|
+
|
|
4
|
+
type CardProps = PropsWithChildren & {
|
|
5
|
+
skeleton?: boolean
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const ListItemMedia = ({
|
|
9
|
+
children,
|
|
10
|
+
skeleton = false,
|
|
11
|
+
}: CardProps): JSX.Element => {
|
|
12
|
+
return (
|
|
13
|
+
<figure className={classNames("mx-list-item__media", "stack")}>
|
|
14
|
+
{skeleton && <div className="mx-skeleton mx-skeleton--bg"></div>}
|
|
15
|
+
{children}
|
|
16
|
+
</figure>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default ListItemMedia
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { Meta, StoryObj } from "@storybook/react-vite"
|
|
2
2
|
import Component from "./ListItem"
|
|
3
|
+
import ListItemContent from "./Components/ListItemContent"
|
|
4
|
+
import Text from "../../Atom/Text/Text"
|
|
5
|
+
import Link from "../../Atom/Link/Link"
|
|
6
|
+
import { TextStyles, TextTags } from "../../enums"
|
|
3
7
|
|
|
4
8
|
const meta: Meta<typeof Component> = {
|
|
5
9
|
title: "Elements/ListItem",
|
|
6
10
|
component: Component,
|
|
7
|
-
argTypes: {
|
|
8
|
-
children: {
|
|
9
|
-
table: {
|
|
10
|
-
disable: true,
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
11
|
args: {
|
|
15
|
-
title: "Teaser title",
|
|
16
|
-
to: "http://example.com",
|
|
17
|
-
info: "18 May 2040",
|
|
18
12
|
children: (
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
<ListItemContent>
|
|
14
|
+
<Text modifier={TextStyles.S} tag={TextTags.STRONG}>
|
|
15
|
+
label
|
|
16
|
+
</Text>
|
|
17
|
+
<div className="mx-heading--m">
|
|
18
|
+
<Link to="http://example.com">Teaser title</Link>
|
|
19
|
+
</div>
|
|
20
|
+
<Text modifier={TextStyles.S}>18 May 2040</Text>
|
|
21
|
+
<p>
|
|
22
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
23
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
|
|
24
|
+
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
25
|
+
aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
26
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
27
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
|
28
|
+
culpa qui officia deserunt mollit anim id est laborum.
|
|
29
|
+
</p>
|
|
30
|
+
</ListItemContent>
|
|
28
31
|
),
|
|
29
32
|
},
|
|
30
33
|
}
|
|
@@ -1,31 +1,15 @@
|
|
|
1
|
-
import { JSX, PropsWithChildren
|
|
1
|
+
import { JSX, PropsWithChildren } from "react"
|
|
2
2
|
import classNames from "classnames"
|
|
3
|
-
import
|
|
4
|
-
import { TextStyles, TextTags } from "../../enums"
|
|
5
|
-
import { HeadingTypes, AsTypes } from "@pnx-mixtape/ids-shape"
|
|
6
|
-
import Text from "../../Atom/Text/Text"
|
|
3
|
+
import { AsTypes } from "@pnx-mixtape/ids-shape"
|
|
7
4
|
|
|
8
5
|
type TeaserProps = PropsWithChildren & {
|
|
9
|
-
title: string
|
|
10
|
-
to: string
|
|
11
|
-
label?: string
|
|
12
|
-
info?: string
|
|
13
|
-
infoBefore?: boolean
|
|
14
6
|
className?: string
|
|
15
7
|
as?: AsTypes
|
|
16
|
-
headingLevel?: HeadingTypes
|
|
17
|
-
image?: ReactNode
|
|
18
8
|
}
|
|
19
9
|
|
|
20
10
|
const ListItem = ({
|
|
21
11
|
children,
|
|
22
|
-
title,
|
|
23
|
-
to,
|
|
24
|
-
label,
|
|
25
|
-
info,
|
|
26
|
-
infoBefore = false,
|
|
27
12
|
className,
|
|
28
|
-
image,
|
|
29
13
|
as = AsTypes.ARTICLE,
|
|
30
14
|
...props
|
|
31
15
|
}: TeaserProps): JSX.Element => {
|
|
@@ -33,20 +17,7 @@ const ListItem = ({
|
|
|
33
17
|
return (
|
|
34
18
|
<div className="mx-container">
|
|
35
19
|
<Tag className={classNames(["mx-list-item", className])} {...props}>
|
|
36
|
-
{
|
|
37
|
-
<div className="mx-list-item__content mx-vertical-flow">
|
|
38
|
-
{label && (
|
|
39
|
-
<Text modifier={TextStyles.S} tag={TextTags.STRONG}>
|
|
40
|
-
{info}
|
|
41
|
-
</Text>
|
|
42
|
-
)}
|
|
43
|
-
{info && infoBefore && <Text modifier={TextStyles.S}>{info}</Text>}
|
|
44
|
-
<div className="mx-heading--m">
|
|
45
|
-
<Link to={to}>{title}</Link>
|
|
46
|
-
</div>
|
|
47
|
-
{info && !infoBefore && <Text modifier={TextStyles.S}>{info}</Text>}
|
|
48
|
-
{children}
|
|
49
|
-
</div>
|
|
20
|
+
{children}
|
|
50
21
|
</Tag>
|
|
51
22
|
</div>
|
|
52
23
|
)
|
|
@@ -4,6 +4,9 @@ exports[`Elements/ListItem ListItem smoke-test 1`] = `
|
|
|
4
4
|
<div class="mx-container">
|
|
5
5
|
<article class="mx-list-item">
|
|
6
6
|
<div class="mx-list-item__content mx-vertical-flow">
|
|
7
|
+
<strong class="mx-text--s">
|
|
8
|
+
label
|
|
9
|
+
</strong>
|
|
7
10
|
<div class="mx-heading--m">
|
|
8
11
|
<a href="http://example.com"
|
|
9
12
|
class="mx-link"
|
|
@@ -53,8 +53,14 @@ const PaginationProvider = ({
|
|
|
53
53
|
// Calculate the "from a to b of x" values.
|
|
54
54
|
const startVal = resultsPerPage * (currentPage - 1) + 1
|
|
55
55
|
const endVal = resultsPerPage * currentPage
|
|
56
|
-
const pageStart =
|
|
57
|
-
|
|
56
|
+
const pageStart = useMemo<number>(
|
|
57
|
+
() => (currentPage > 1 ? startVal : 1),
|
|
58
|
+
[currentPage, startVal],
|
|
59
|
+
)
|
|
60
|
+
const pageEnd = useMemo<number>(
|
|
61
|
+
() => (total > endVal ? endVal : total),
|
|
62
|
+
[total, endVal],
|
|
63
|
+
)
|
|
58
64
|
|
|
59
65
|
const showPager: boolean = useMemo(
|
|
60
66
|
() => total > resultsPerPage,
|
|
@@ -157,8 +163,8 @@ const PaginationProvider = ({
|
|
|
157
163
|
visiblePages,
|
|
158
164
|
showFirstEllipsis,
|
|
159
165
|
showLastEllipsis,
|
|
160
|
-
pageStart
|
|
161
|
-
pageEnd
|
|
166
|
+
pageStart,
|
|
167
|
+
pageEnd,
|
|
162
168
|
onClick,
|
|
163
169
|
onMouseOver,
|
|
164
170
|
}),
|
|
@@ -31,16 +31,16 @@ const PaginationItem = ({
|
|
|
31
31
|
</>
|
|
32
32
|
)}
|
|
33
33
|
{(as === "next" || as === "previous") && (
|
|
34
|
-
<button
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
<button type="button" disabled={disabled} data-page={number}>
|
|
35
|
+
{as === "previous" && (
|
|
36
|
+
<span className={classNames("mx-icon", "mx-icon--arrow-left")}></span>
|
|
37
|
+
)}
|
|
38
|
+
<span>{as}</span>
|
|
39
|
+
{as === "next" && (
|
|
40
|
+
<span
|
|
41
|
+
className={classNames("mx-icon", "mx-icon--arrow-right")}
|
|
42
|
+
></span>
|
|
43
|
+
)}
|
|
44
44
|
</button>
|
|
45
45
|
)}
|
|
46
46
|
</li>
|
|
@@ -16,7 +16,9 @@ const Pagination = (): JSX.Element => {
|
|
|
16
16
|
|
|
17
17
|
const handleClick: MouseEventHandler = e => {
|
|
18
18
|
const target = e.target as HTMLElement
|
|
19
|
-
const page: string = target
|
|
19
|
+
const page: string = target
|
|
20
|
+
.closest("[data-page]")
|
|
21
|
+
?.getAttribute("data-page")
|
|
20
22
|
if (!page) return
|
|
21
23
|
onClick(parseInt(page))
|
|
22
24
|
e.preventDefault()
|
|
@@ -25,7 +27,9 @@ const Pagination = (): JSX.Element => {
|
|
|
25
27
|
|
|
26
28
|
const handleMouseOver: MouseEventHandler = e => {
|
|
27
29
|
const target = e.target as HTMLElement
|
|
28
|
-
const page: string = target
|
|
30
|
+
const page: string = target
|
|
31
|
+
.closest("[data-page]")
|
|
32
|
+
?.getAttribute("data-page")
|
|
29
33
|
if (page) onMouseOver(parseInt(page))
|
|
30
34
|
}
|
|
31
35
|
|
|
@@ -10,9 +10,12 @@ exports[`Component/Pagination Pagination smoke-test 1`] = `
|
|
|
10
10
|
>
|
|
11
11
|
<button type="button"
|
|
12
12
|
disabled
|
|
13
|
-
class="mx-icon mx-icon--arrow-left"
|
|
14
13
|
>
|
|
15
|
-
|
|
14
|
+
<span class="mx-icon mx-icon--arrow-left">
|
|
15
|
+
</span>
|
|
16
|
+
<span>
|
|
17
|
+
previous
|
|
18
|
+
</span>
|
|
16
19
|
</button>
|
|
17
20
|
</li>
|
|
18
21
|
<li class="mx-pagination__item"
|
|
@@ -47,9 +50,12 @@ exports[`Component/Pagination Pagination smoke-test 1`] = `
|
|
|
47
50
|
<li class="mx-pagination__next">
|
|
48
51
|
<button type="button"
|
|
49
52
|
data-page="2"
|
|
50
|
-
class="mx-icon mx-icon--arrow-right"
|
|
51
53
|
>
|
|
52
|
-
|
|
54
|
+
<span>
|
|
55
|
+
next
|
|
56
|
+
</span>
|
|
57
|
+
<span class="mx-icon mx-icon--arrow-right">
|
|
58
|
+
</span>
|
|
53
59
|
</button>
|
|
54
60
|
</li>
|
|
55
61
|
</ul>
|
|
@@ -11,6 +11,15 @@
|
|
|
11
11
|
padding: unset;
|
|
12
12
|
background: transparent;
|
|
13
13
|
cursor: pointer;
|
|
14
|
+
border: none;
|
|
15
|
+
font-size: inherit;
|
|
16
|
+
text-transform: inherit;
|
|
17
|
+
|
|
18
|
+
&:has(.mx-icon) {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: var(--spacing-xxs);
|
|
22
|
+
}
|
|
14
23
|
}
|
|
15
24
|
|
|
16
25
|
& :is(a, button, [aria-current="page"], [aria-current="step"]) {
|
|
@@ -35,12 +44,6 @@
|
|
|
35
44
|
pointer-events: none;
|
|
36
45
|
}
|
|
37
46
|
|
|
38
|
-
& .mx-icon:not(.mx-icon--only) {
|
|
39
|
-
display: flex;
|
|
40
|
-
align-items: center;
|
|
41
|
-
gap: var(--spacing-xxs);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
47
|
& .mx-pagination__items {
|
|
45
48
|
display: flex;
|
|
46
49
|
place-content: center;
|
|
@@ -54,20 +57,12 @@
|
|
|
54
57
|
padding-inline: var(--spacing-xs);
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
&
|
|
58
|
-
:is(.mx-pagination__previous, .mx-pagination__next)
|
|
59
|
-
.mx-icon:not(.mx-icon--only) {
|
|
60
|
-
font-weight: var(--font-weight-bold);
|
|
60
|
+
& :is(.mx-pagination__previous, .mx-pagination__next) {
|
|
61
61
|
text-transform: capitalize;
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
position: relative;
|
|
67
|
-
text-indent: 100%;
|
|
68
|
-
|
|
69
|
-
&::before {
|
|
70
|
-
position: absolute;
|
|
63
|
+
& span:where(:not(.mx-icon)) {
|
|
64
|
+
@media (--small-down) {
|
|
65
|
+
display: none;
|
|
71
66
|
}
|
|
72
67
|
}
|
|
73
68
|
}
|
|
@@ -4,7 +4,7 @@ exports[`Component/Steps Counters smoke-test 1`] = `
|
|
|
4
4
|
<div class="mx-page default">
|
|
5
5
|
<div class="mx-steps mx-steps--counters">
|
|
6
6
|
<div class="mx-steps__panel ">
|
|
7
|
-
<div class="mx-steps__panel-content mx-container mx-vertical-flow">
|
|
7
|
+
<div class="mx-steps__panel-content mx-container mx-vertical-flow rich-text">
|
|
8
8
|
<h2>
|
|
9
9
|
Funk
|
|
10
10
|
</h2>
|
|
@@ -14,7 +14,7 @@ exports[`Component/Steps Counters smoke-test 1`] = `
|
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
16
16
|
<div class="mx-steps__panel ">
|
|
17
|
-
<div class="mx-steps__panel-content mx-container mx-vertical-flow">
|
|
17
|
+
<div class="mx-steps__panel-content mx-container mx-vertical-flow rich-text">
|
|
18
18
|
<h3>
|
|
19
19
|
Soul
|
|
20
20
|
</h3>
|
|
@@ -24,7 +24,7 @@ exports[`Component/Steps Counters smoke-test 1`] = `
|
|
|
24
24
|
</div>
|
|
25
25
|
</div>
|
|
26
26
|
<div class="mx-steps__panel ">
|
|
27
|
-
<div class="mx-steps__panel-content mx-container mx-vertical-flow">
|
|
27
|
+
<div class="mx-steps__panel-content mx-container mx-vertical-flow rich-text">
|
|
28
28
|
<h4>
|
|
29
29
|
Motown
|
|
30
30
|
</h4>
|
|
@@ -41,17 +41,17 @@ exports[`Component/Steps Progress smoke-test 1`] = `
|
|
|
41
41
|
<div class="mx-page default">
|
|
42
42
|
<div class="mx-steps mx-steps--supplementary ">
|
|
43
43
|
<div class="mx-steps__panel mx-steps--fill">
|
|
44
|
-
<div class="mx-steps__panel-content mx-container mx-vertical-flow">
|
|
44
|
+
<div class="mx-steps__panel-content mx-container mx-vertical-flow rich-text">
|
|
45
45
|
Funk is the ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.
|
|
46
46
|
</div>
|
|
47
47
|
</div>
|
|
48
48
|
<div class="mx-steps__panel ">
|
|
49
|
-
<div class="mx-steps__panel-content mx-container mx-vertical-flow">
|
|
49
|
+
<div class="mx-steps__panel-content mx-container mx-vertical-flow rich-text">
|
|
50
50
|
Soul music ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem.
|
|
51
51
|
</div>
|
|
52
52
|
</div>
|
|
53
53
|
<div class="mx-steps__panel ">
|
|
54
|
-
<div class="mx-steps__panel-content mx-container mx-vertical-flow">
|
|
54
|
+
<div class="mx-steps__panel-content mx-container mx-vertical-flow rich-text">
|
|
55
55
|
Motown lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.
|
|
56
56
|
</div>
|
|
57
57
|
</div>
|
|
@@ -63,17 +63,17 @@ exports[`Component/Steps ProgressCounters smoke-test 1`] = `
|
|
|
63
63
|
<div class="mx-page default">
|
|
64
64
|
<div class="mx-steps mx-steps--dark mx-steps--counters ">
|
|
65
65
|
<div class="mx-steps__panel mx-steps--fill">
|
|
66
|
-
<div class="mx-steps__panel-content mx-container mx-vertical-flow">
|
|
66
|
+
<div class="mx-steps__panel-content mx-container mx-vertical-flow rich-text">
|
|
67
67
|
Funk is the ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.
|
|
68
68
|
</div>
|
|
69
69
|
</div>
|
|
70
70
|
<div class="mx-steps__panel mx-steps--fill">
|
|
71
|
-
<div class="mx-steps__panel-content mx-container mx-vertical-flow">
|
|
71
|
+
<div class="mx-steps__panel-content mx-container mx-vertical-flow rich-text">
|
|
72
72
|
Soul music ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem.
|
|
73
73
|
</div>
|
|
74
74
|
</div>
|
|
75
75
|
<div class="mx-steps__panel ">
|
|
76
|
-
<div class="mx-steps__panel-content mx-container mx-vertical-flow">
|
|
76
|
+
<div class="mx-steps__panel-content mx-container mx-vertical-flow rich-text">
|
|
77
77
|
Motown lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.
|
|
78
78
|
</div>
|
|
79
79
|
</div>
|
|
@@ -85,7 +85,7 @@ exports[`Component/Steps Steps smoke-test 1`] = `
|
|
|
85
85
|
<div class="mx-page default">
|
|
86
86
|
<div class="mx-steps ">
|
|
87
87
|
<div class="mx-steps__panel ">
|
|
88
|
-
<div class="mx-steps__panel-content mx-container mx-vertical-flow">
|
|
88
|
+
<div class="mx-steps__panel-content mx-container mx-vertical-flow rich-text">
|
|
89
89
|
<h2>
|
|
90
90
|
Funk
|
|
91
91
|
</h2>
|
|
@@ -95,7 +95,7 @@ exports[`Component/Steps Steps smoke-test 1`] = `
|
|
|
95
95
|
</div>
|
|
96
96
|
</div>
|
|
97
97
|
<div class="mx-steps__panel ">
|
|
98
|
-
<div class="mx-steps__panel-content mx-container mx-vertical-flow">
|
|
98
|
+
<div class="mx-steps__panel-content mx-container mx-vertical-flow rich-text">
|
|
99
99
|
<h3>
|
|
100
100
|
Soul
|
|
101
101
|
</h3>
|
|
@@ -105,7 +105,7 @@ exports[`Component/Steps Steps smoke-test 1`] = `
|
|
|
105
105
|
</div>
|
|
106
106
|
</div>
|
|
107
107
|
<div class="mx-steps__panel ">
|
|
108
|
-
<div class="mx-steps__panel-content mx-container mx-vertical-flow">
|
|
108
|
+
<div class="mx-steps__panel-content mx-container mx-vertical-flow rich-text">
|
|
109
109
|
<h4>
|
|
110
110
|
Motown
|
|
111
111
|
</h4>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
] %}
|
|
6
6
|
{% set attributes = (attributes ?? create_attribute()).addClass(classes) %}
|
|
7
7
|
<div{{ attributes }}>
|
|
8
|
-
<div class="mx-steps__panel-content mx-container mx-vertical-flow">
|
|
8
|
+
<div class="mx-steps__panel-content mx-container mx-vertical-flow rich-text">
|
|
9
9
|
{{ content }}
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
@@ -70,8 +70,7 @@
|
|
|
70
70
|
inline-size: var(--line-width, 2px);
|
|
71
71
|
background-color: var(--line-colour, var(--colour-border));
|
|
72
72
|
inset-inline-start: calc(
|
|
73
|
-
(var(--counter-size,
|
|
74
|
-
(var(--line-width, 2px) / 2)
|
|
73
|
+
(var(--counter-size, 2rem) / 2) + (var(--line-width, 2px))
|
|
75
74
|
);
|
|
76
75
|
inset-block: 0;
|
|
77
76
|
position: absolute;
|
|
@@ -19,7 +19,7 @@ const TabPanel = ({
|
|
|
19
19
|
id={id}
|
|
20
20
|
className={classNames("mx-tabs__panel", "mx-vertical-flow", className)}
|
|
21
21
|
// @ts-expect-error inert is allowed.
|
|
22
|
-
inert={!isActive ? "" : null}
|
|
22
|
+
inert={!isActive ? "true" : null}
|
|
23
23
|
aria-labelledby={`${id}-button`}
|
|
24
24
|
role="tabpanel"
|
|
25
25
|
tabIndex={0}
|
|
@@ -93,6 +93,7 @@ exports[`Component/Tabs Default smoke-test 1`] = `
|
|
|
93
93
|
</div>
|
|
94
94
|
<div id="unique-5"
|
|
95
95
|
class="mx-tabs__panel mx-vertical-flow mx-section--l"
|
|
96
|
+
inert
|
|
96
97
|
aria-labelledby="unique-8"
|
|
97
98
|
role="tabpanel"
|
|
98
99
|
tabindex="0"
|
|
@@ -103,6 +104,7 @@ exports[`Component/Tabs Default smoke-test 1`] = `
|
|
|
103
104
|
</div>
|
|
104
105
|
<div id="unique-6"
|
|
105
106
|
class="mx-tabs__panel mx-vertical-flow mx-section--l"
|
|
107
|
+
inert
|
|
106
108
|
aria-labelledby="unique-9"
|
|
107
109
|
role="tabpanel"
|
|
108
110
|
tabindex="0"
|