@pnx-mixtape/mxds 0.1.0-rc.3 → 0.1.0-rc.5
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/.claude/skills/create-mxds-component/SKILL.md +77 -0
- package/DESIGN.md +595 -0
- package/README.md +1 -2
- package/dist/build/accordion.css +1 -1
- package/dist/build/accordion.entry.js +2 -1
- package/dist/build/autocomplete.entry.js +1 -1
- package/dist/build/back-to-top.css +1 -0
- package/dist/build/back-to-top.entry.js +1 -0
- package/dist/build/base.css +1 -1
- package/dist/build/button.css +1 -1
- package/dist/build/card.css +1 -1
- package/dist/build/carousel.css +1 -1
- package/dist/build/chunks/Accordion-D2wp8hBG.js +44 -0
- package/dist/build/chunks/AccordionGroup-BYtoAFxg.js +47 -0
- package/dist/build/chunks/AccordionMobile-D3sTeiM5.js +26 -0
- package/dist/build/chunks/Autocomplete-kRo8RNbC.js +135 -0
- package/dist/build/chunks/BackToTop-4M-Wl7z3.js +64 -0
- package/dist/build/chunks/ClosableAlert-yy84gae6.js +55 -0
- package/dist/build/chunks/CookieConsent-wd8gQ2Oe.js +18 -0
- package/dist/build/chunks/Dialog-DWoXW-7Z.js +48 -0
- package/dist/build/chunks/DropMenu-CSTZq0Zt.js +68 -0
- package/dist/build/chunks/FeedbackForm-BochXEDx.js +64 -0
- package/dist/build/chunks/Gallery-Rkfv7Mbb.js +165 -0
- package/dist/build/chunks/GlobalToggle-CzlkpLpc.js +82 -0
- package/dist/build/chunks/InPageNavigation-D1Kk-rCm.js +86 -0
- package/dist/build/chunks/Navigation-CDQnN61h.js +147 -0
- package/dist/build/chunks/Popover-CiTAftNU.js +30 -0
- package/dist/build/chunks/Sticky-DoVndENm.js +51 -0
- package/dist/build/chunks/Tabs-BDlxCDNh.js +160 -0
- package/dist/build/chunks/Translate-bmM38j6z.js +46 -0
- package/dist/build/chunks/cookie-compliance-CG6x-TcV.js +119 -0
- package/dist/build/chunks/enums-BrHxPZZ_.js +36 -0
- package/dist/build/chunks/polyfills-D-qh1a_2.js +33 -0
- package/dist/build/chunks/utilities-Dd-08SW6.js +255 -0
- package/dist/build/constants.css +1 -1
- package/dist/build/content-block.css +1 -1
- package/dist/build/cookie-consent.css +1 -1
- package/dist/build/cookie-consent.entry.js +1 -1
- package/dist/build/dialog.css +1 -1
- package/dist/build/dialog.entry.js +1 -1
- package/dist/build/drop-menu.entry.js +1 -1
- package/dist/build/elements.js +147 -1
- package/dist/build/feedback-form.css +1 -0
- package/dist/build/feedback-form.entry.js +1 -0
- package/dist/build/filters.entry.js +145 -1
- package/dist/build/form.css +1 -1
- package/dist/build/gallery.entry.js +1 -1
- package/dist/build/global-alert.css +1 -1
- package/dist/build/global-alert.entry.js +1 -1
- package/dist/build/grid.css +1 -1
- package/dist/build/header.css +1 -1
- package/dist/build/header.entry.js +1 -1
- package/dist/build/icon.css +1 -1
- package/dist/build/in-page-navigation.entry.js +1 -1
- package/dist/build/navigation.css +1 -1
- package/dist/build/navigation.entry.js +1 -1
- package/dist/build/pagination.css +1 -1
- package/dist/build/popover.css +1 -1
- package/dist/build/popover.entry.js +1 -1
- package/dist/build/react.js +2270 -1
- package/dist/build/sticky.entry.js +1 -1
- package/dist/build/tabs.css +1 -1
- package/dist/build/tabs.entry.js +1 -1
- package/dist/build/translate.css +1 -0
- package/dist/build/translate.entry.js +1 -0
- package/dist/build/utility-list.entry.js +53 -1
- package/dist/types/Component/BackToTop/BackToTop.d.ts +20 -0
- package/dist/types/Component/BackToTop/BackToTop.d.ts.map +1 -0
- package/dist/types/Component/BackToTop/Elements/BackToTop.d.ts +27 -0
- package/dist/types/Component/BackToTop/Elements/BackToTop.d.ts.map +1 -0
- package/dist/types/Component/BackToTop/back-to-top.entry.d.ts +2 -0
- package/dist/types/Component/BackToTop/back-to-top.entry.d.ts.map +1 -0
- package/dist/types/Component/DropMenu/DropMenu.d.ts +2 -1
- package/dist/types/Component/DropMenu/DropMenu.d.ts.map +1 -1
- package/dist/types/Component/Tabs/Components/TabDropMenu.d.ts.map +1 -1
- package/dist/types/Component/Tabs/Elements/Tabs.d.ts.map +1 -1
- package/dist/types/Component/Translate/Elements/Translate.d.ts +23 -0
- package/dist/types/Component/Translate/Elements/Translate.d.ts.map +1 -0
- package/dist/types/Component/Translate/Translate.d.ts +37 -0
- package/dist/types/Component/Translate/Translate.d.ts.map +1 -0
- package/dist/types/Component/Translate/languages.d.ts +11 -0
- package/dist/types/Component/Translate/languages.d.ts.map +1 -0
- package/dist/types/Component/Translate/translate.entry.d.ts +2 -0
- package/dist/types/Component/Translate/translate.entry.d.ts.map +1 -0
- package/dist/types/Form/FeedbackForm/Elements/FeedbackForm.d.ts +37 -0
- package/dist/types/Form/FeedbackForm/Elements/FeedbackForm.d.ts.map +1 -0
- package/dist/types/Form/FeedbackForm/FeedbackForm.d.ts +36 -0
- package/dist/types/Form/FeedbackForm/FeedbackForm.d.ts.map +1 -0
- package/dist/types/Form/FeedbackForm/feedback-form.entry.d.ts +2 -0
- package/dist/types/Form/FeedbackForm/feedback-form.entry.d.ts.map +1 -0
- package/dist/types/Utility/Elements/google-translate-widget.d.ts +91 -0
- package/dist/types/Utility/Elements/google-translate-widget.d.ts.map +1 -0
- package/dist/types/Utility/utilities.d.ts +2 -0
- package/dist/types/Utility/utilities.d.ts.map +1 -1
- package/dist/types/elements.d.ts +3 -0
- package/dist/types/elements.d.ts.map +1 -1
- package/dist/types/enums.d.ts +3 -1
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/react.d.ts +3 -0
- package/dist/types/react.d.ts.map +1 -1
- package/docs/API.md +1215 -0
- package/docs/CSSGuidelines.md +891 -0
- package/docs/CodeQuality.md +940 -0
- package/docs/ComponentArchitecture.md +714 -0
- package/docs/Contributing.md +626 -0
- package/docs/MemoryManagement.md +598 -0
- package/docs/Migrations.md +6 -0
- package/docs/README.md +100 -0
- package/docs/Security.md +444 -0
- package/docs/Testing.md +739 -0
- package/docs/Troubleshooting.md +674 -0
- package/package.json +6 -3
- package/src/Atom/Button/Button.tsx +1 -1
- package/src/Atom/Button/__snapshots__/Button.stories.tsx.snap +2 -2
- package/src/Atom/Button/_buttons.css +1 -0
- package/src/Atom/Icon/README.md +1 -1
- package/src/Atom/Icon/_icon.css +1 -0
- package/src/Atom/Icon/images/thumb.svg +1 -0
- package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +4 -9
- package/src/Atom/Media/media.twig +4 -5
- package/src/Atom/_generic.css +0 -10
- package/src/Component/Accordion/accordion.css +3 -1
- package/src/Component/BackToTop/BackToTop.stories.ts +127 -0
- package/src/Component/BackToTop/BackToTop.stories.tsx +53 -0
- package/src/Component/BackToTop/BackToTop.tsx +120 -0
- package/src/Component/BackToTop/Elements/BackToTop.ts +119 -0
- package/src/Component/BackToTop/README.md +164 -0
- package/src/Component/BackToTop/__snapshots__/BackToTop.stories.ts.snap +24 -0
- package/src/Component/BackToTop/__snapshots__/BackToTop.stories.tsx.snap +3 -0
- package/src/Component/BackToTop/back-to-top.css +70 -0
- package/src/Component/BackToTop/back-to-top.entry.js +1 -0
- package/src/Component/BackToTop/back-to-top.twig +26 -0
- package/src/Component/Card/Components/CardContent.tsx +1 -1
- package/src/Component/Card/Components/CardMedia.tsx +1 -1
- package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +3 -3
- package/src/Component/Card/card.css +1 -1
- package/src/Component/Carousel/Carousel.stories.ts +66 -36
- package/src/Component/Carousel/__snapshots__/Carousel.stories.tsx.snap +5 -5
- package/src/Component/Carousel/carousel.css +1 -1
- package/src/Component/ContentBlock/Components/ContentBlockMedia.tsx +1 -1
- package/src/Component/ContentBlock/content-block.css +1 -1
- package/src/Component/CookieConsent/cookie-consent.css +3 -0
- package/src/Component/Dialog/dialog.css +5 -2
- package/src/Component/DropMenu/DropMenu.stories.ts +21 -2
- package/src/Component/DropMenu/DropMenu.tsx +14 -4
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +3 -3
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +2 -2
- package/src/Component/DropMenu/drop-menu.twig +7 -1
- package/src/Component/GlobalAlert/global-alert.css +3 -0
- package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.tsx.snap +1 -1
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +48 -13
- package/src/Component/InPageNavigation/in-page-navigation.twig +4 -6
- package/src/Component/ListItem/Components/ListItemMedia.tsx +1 -1
- package/src/Component/Navigation/_navigation-collapsible.css +3 -1
- package/src/Component/Navigation/_navigation-dropdown.css +3 -1
- package/src/Component/Pagination/Pagination.stories.ts +57 -27
- package/src/Component/Pagination/pagination.css +16 -7
- package/src/Component/Popover/__snapshots__/Popover.stories.tsx.snap +3 -3
- package/src/Component/Popover/popover.css +3 -1
- package/src/Component/Tabs/Components/TabDropMenu.tsx +7 -1
- package/src/Component/Tabs/Elements/Tabs.ts +13 -3
- package/src/Component/Tabs/Tabs.stories.ts +33 -12
- package/src/Component/Tabs/Tabs.stories.tsx +28 -14
- package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +3 -3
- package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +2 -2
- package/src/Component/Tabs/tabs.css +4 -5
- package/src/Component/Translate/Elements/Translate.ts +76 -0
- package/src/Component/Translate/README.md +283 -0
- package/src/Component/Translate/Translate.stories.ts +87 -0
- package/src/Component/Translate/Translate.stories.tsx +77 -0
- package/src/Component/Translate/Translate.tsx +213 -0
- package/src/Component/Translate/__snapshots__/Translate.stories.ts.snap +18 -0
- package/src/Component/Translate/__snapshots__/Translate.stories.tsx.snap +3 -0
- package/src/Component/Translate/languages.ts +39 -0
- package/src/Component/Translate/translate.css +62 -0
- package/src/Component/Translate/translate.entry.js +1 -0
- package/src/Component/Translate/translate.twig +44 -0
- package/src/Form/Autocomplete/Autocomplete.stories.tsx +2 -1
- package/src/Form/FeedbackForm/Elements/FeedbackForm.ts +122 -0
- package/src/Form/FeedbackForm/FeedbackForm.stories.ts +99 -0
- package/src/Form/FeedbackForm/FeedbackForm.stories.tsx +73 -0
- package/src/Form/FeedbackForm/FeedbackForm.tsx +196 -0
- package/src/Form/FeedbackForm/README.md +233 -0
- package/src/Form/FeedbackForm/__snapshots__/FeedbackForm.stories.ts.snap +125 -0
- package/src/Form/FeedbackForm/__snapshots__/FeedbackForm.stories.tsx.snap +5 -0
- package/src/Form/FeedbackForm/feedback-form.css +74 -0
- package/src/Form/FeedbackForm/feedback-form.entry.js +1 -0
- package/src/Form/FeedbackForm/feedback-form.twig +80 -0
- package/src/Form/form.css +5 -3
- package/src/Layout/Grid/Grid.stories.ts +1 -0
- package/src/Layout/Grid/Grid.stories.tsx +26 -0
- package/src/Layout/Grid/__snapshots__/Grid.stories.tsx.snap +2 -0
- package/src/Layout/Grid/grid.css +12 -0
- package/src/Layout/Header/Components/GlobalToggle.tsx +1 -1
- package/src/Layout/Header/Header.stories.ts +53 -48
- package/src/Layout/Header/Header.stories.tsx +35 -22
- package/src/Layout/Header/Header.tsx +2 -2
- package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +14 -10
- package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +2 -2
- package/src/Layout/Header/_header.css +4 -2
- package/src/Layout/Header/_toggles.css +9 -6
- package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +1 -1
- package/src/Utility/Elements/google-translate-widget.ts +293 -0
- package/src/Utility/_mixins.css +35 -13
- package/src/Utility/global.d.ts +4 -0
- package/src/Utility/utilities.ts +2 -0
- package/src/_custom-media.css +2 -2
- package/src/constants.css +3 -13
- package/src/elements.ts +3 -0
- package/src/enums.ts +2 -0
- package/src/react.ts +3 -0
- package/dist/build/chunks/Accordion-GN0sME4W.js +0 -1
- package/dist/build/chunks/AccordionGroup-Bzqp5__q.js +0 -1
- package/dist/build/chunks/AccordionMobile-DG5jSe8Q.js +0 -1
- package/dist/build/chunks/Autocomplete-B4RtkAyh.js +0 -1
- package/dist/build/chunks/ClosableAlert-DEhj8Nxm.js +0 -1
- package/dist/build/chunks/CookieConsent-BkCMRVST.js +0 -1
- package/dist/build/chunks/Dialog-Haahn-Yn.js +0 -1
- package/dist/build/chunks/DropMenu-1baQc8Yc.js +0 -1
- package/dist/build/chunks/Gallery-D8NGXy2Q.js +0 -1
- package/dist/build/chunks/GlobalToggle-B52fdBQu.js +0 -1
- package/dist/build/chunks/InPageNavigation-Dyn2TR-N.js +0 -1
- package/dist/build/chunks/Navigation-hOrfLq7h.js +0 -1
- package/dist/build/chunks/Popover-Cxg-s5Jn.js +0 -1
- package/dist/build/chunks/Sticky-BGCuuEJK.js +0 -1
- package/dist/build/chunks/Tabs-DYy1YTdU.js +0 -15
- package/dist/build/chunks/cookie-compliance-Bbm-0vpj.js +0 -1
- package/dist/build/chunks/enums-DLV_1NAf.js +0 -1
- package/dist/build/chunks/polyfills-C7pRt54M.js +0 -1
- package/dist/build/chunks/utilities-_Bq3TxAQ.js +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { Meta, StoryObj } from "@storybook/html-vite"
|
|
2
2
|
import { expect } from "storybook/test"
|
|
3
|
+
import { modes } from "../../../.storybook/modes"
|
|
4
|
+
import { runScreenReaderWalkthrough } from "../../../tools/test-utils/screen-reader"
|
|
3
5
|
import Component from "./header.twig"
|
|
4
6
|
import "./_header.css"
|
|
5
7
|
import "./_toggles.css"
|
|
6
8
|
import "./Elements/GlobalToggle"
|
|
7
|
-
import {
|
|
8
|
-
import { Icons } from "../../enums"
|
|
9
|
+
import { Header as HeaderType } from "@pnx-mixtape/ids-shape"
|
|
9
10
|
|
|
10
11
|
// Deps.
|
|
11
|
-
import Icon from "../../Atom/Icon/icon.twig"
|
|
12
12
|
import Logo from "../Header/twig/logo.twig"
|
|
13
|
-
import Button from "../../Atom/Button/button.twig"
|
|
14
13
|
import Navigation from "../../Component/Navigation/navigation.twig"
|
|
15
14
|
import SearchForm from "../../Form/Search/search-form.twig"
|
|
15
|
+
import Translate from "../../Component/Translate/translate.twig"
|
|
16
16
|
// js.
|
|
17
17
|
import "../../Component/Navigation/Elements/Navigation"
|
|
18
|
+
import "../../Component/Translate/Elements/Translate"
|
|
18
19
|
// css.
|
|
19
20
|
import "../../Component/Navigation/navigation.css"
|
|
20
|
-
import
|
|
21
|
-
import { runScreenReaderWalkthrough } from "../../../tools/test-utils/screen-reader"
|
|
21
|
+
import "../../Component/Translate/translate.css"
|
|
22
22
|
|
|
23
23
|
type MxHeaderType = Omit<HeaderType, "controls"> & {
|
|
24
24
|
stacked: boolean
|
|
@@ -91,7 +91,7 @@ type Story = StoryObj<MxHeaderType>
|
|
|
91
91
|
export const Header: Story = {
|
|
92
92
|
play: async ({ canvas, canvasElement, userEvent, step }) => {
|
|
93
93
|
// The toggle only attaches its click/keyboard handlers below the mobile breakpoint.
|
|
94
|
-
const isMobile = matchMedia("(max-width:
|
|
94
|
+
const isMobile = matchMedia("(max-width: 767px)").matches
|
|
95
95
|
if (!isMobile) return
|
|
96
96
|
|
|
97
97
|
const trigger = canvas.getByRole("button", { name: "Open Menu" })
|
|
@@ -120,33 +120,54 @@ export const Header: Story = {
|
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
122
|
* Steps a virtual screen reader through the page and asserts on what it announces.
|
|
123
|
+
*
|
|
124
|
+
* Below the `--global-nav-down` breakpoint the primary nav starts collapsed
|
|
125
|
+
* behind the "Open Menu" toggle (`inert`, so it's excluded from the
|
|
126
|
+
* accessibility tree entirely) - see `GlobalToggle.ts`. This branches on the
|
|
127
|
+
* real `matchMedia(...).matches`, same as the `Header` story above, and is
|
|
128
|
+
* paired with `chromatic.modes` on `meta` so both shapes get exercised in CI.
|
|
129
|
+
* See "Testing Mobile / matchMedia-Driven Behavior in Play Functions" in
|
|
130
|
+
* docs/Testing.md.
|
|
123
131
|
*/
|
|
124
132
|
export const ScreenReaderAnnouncements: Story = {
|
|
125
133
|
play: async () => {
|
|
134
|
+
const isMobile = matchMedia("(max-width: 767px)").matches
|
|
126
135
|
const log = await runScreenReaderWalkthrough()
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
136
|
+
|
|
137
|
+
if (isMobile) {
|
|
138
|
+
await expect(log).toEqual([
|
|
139
|
+
"document",
|
|
140
|
+
"banner",
|
|
141
|
+
"image, Mixtape",
|
|
142
|
+
"button, Open Menu, 1 control, not expanded",
|
|
143
|
+
"end of banner",
|
|
144
|
+
"end of document",
|
|
145
|
+
])
|
|
146
|
+
} else {
|
|
147
|
+
await expect(log).toEqual([
|
|
148
|
+
"document",
|
|
149
|
+
"banner",
|
|
150
|
+
"image, Mixtape",
|
|
151
|
+
"navigation, Primary navigation",
|
|
152
|
+
"list",
|
|
153
|
+
"listitem, level 1, position 1, set size 4",
|
|
154
|
+
"link, News",
|
|
155
|
+
"end of listitem, level 1, position 1, set size 4",
|
|
156
|
+
"listitem, level 1, position 2, set size 4",
|
|
157
|
+
"link, About us",
|
|
158
|
+
"end of listitem, level 1, position 2, set size 4",
|
|
159
|
+
"listitem, level 1, position 3, set size 4",
|
|
160
|
+
"link, Contact",
|
|
161
|
+
"end of listitem, level 1, position 3, set size 4",
|
|
162
|
+
"listitem, level 1, position 4, set size 4",
|
|
163
|
+
"link, Resources",
|
|
164
|
+
"end of listitem, level 1, position 4, set size 4",
|
|
165
|
+
"end of list",
|
|
166
|
+
"end of navigation, Primary navigation",
|
|
167
|
+
"end of banner",
|
|
168
|
+
"end of document",
|
|
169
|
+
])
|
|
170
|
+
}
|
|
150
171
|
},
|
|
151
172
|
}
|
|
152
173
|
|
|
@@ -168,15 +189,7 @@ export const Search: Story = {
|
|
|
168
189
|
|
|
169
190
|
export const Controls: Story = {
|
|
170
191
|
args: {
|
|
171
|
-
controls: [
|
|
172
|
-
Button({
|
|
173
|
-
as: ButtonTypes.BUTTON,
|
|
174
|
-
title: "Translate",
|
|
175
|
-
iconEnd: Icon({
|
|
176
|
-
icon: Icons.CHEVRON_DOWN,
|
|
177
|
-
}),
|
|
178
|
-
}),
|
|
179
|
-
].join(""),
|
|
192
|
+
controls: [Translate({})].join(""),
|
|
180
193
|
},
|
|
181
194
|
}
|
|
182
195
|
|
|
@@ -187,15 +200,7 @@ export const Stacked: Story = {
|
|
|
187
200
|
action: "#search",
|
|
188
201
|
id: "search-keyword",
|
|
189
202
|
}),
|
|
190
|
-
controls: [
|
|
191
|
-
Button({
|
|
192
|
-
as: ButtonTypes.BUTTON,
|
|
193
|
-
title: "Translate",
|
|
194
|
-
iconEnd: Icon({
|
|
195
|
-
icon: Icons.CHEVRON_DOWN,
|
|
196
|
-
}),
|
|
197
|
-
}),
|
|
198
|
-
].join(""),
|
|
203
|
+
controls: [Translate({})].join(""),
|
|
199
204
|
navigation: Navigation({
|
|
200
205
|
id: "header-stacked-story",
|
|
201
206
|
type: "mega",
|
|
@@ -20,7 +20,7 @@ export default meta
|
|
|
20
20
|
export const PrimaryHeader: StoryObj<typeof meta> = {
|
|
21
21
|
play: async ({ canvas, canvasElement, userEvent, step }) => {
|
|
22
22
|
// The mobile toggle only renders below the header's mobile breakpoint.
|
|
23
|
-
const isMobile = matchMedia("(max-width:
|
|
23
|
+
const isMobile = matchMedia("(max-width: 767px)").matches
|
|
24
24
|
if (!isMobile) return
|
|
25
25
|
|
|
26
26
|
const trigger = canvas.getByRole("button", { name: "Open menu" })
|
|
@@ -52,27 +52,40 @@ export const PrimaryHeader: StoryObj<typeof meta> = {
|
|
|
52
52
|
*/
|
|
53
53
|
export const ScreenReaderAnnouncements: StoryObj<typeof meta> = {
|
|
54
54
|
play: async () => {
|
|
55
|
+
const isMobile = matchMedia("(max-width: 767px)").matches
|
|
55
56
|
const log = await runScreenReaderWalkthrough()
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
57
|
+
|
|
58
|
+
if (isMobile) {
|
|
59
|
+
await expect(log).toEqual([
|
|
60
|
+
"document",
|
|
61
|
+
"banner",
|
|
62
|
+
"image, Mixtape",
|
|
63
|
+
"button, Open Menu, 1 control, not expanded",
|
|
64
|
+
"end of banner",
|
|
65
|
+
"end of document",
|
|
66
|
+
])
|
|
67
|
+
} else {
|
|
68
|
+
await expect(log).toEqual([
|
|
69
|
+
"document",
|
|
70
|
+
"banner",
|
|
71
|
+
"image, Mixtape",
|
|
72
|
+
"navigation, Primary Navigation",
|
|
73
|
+
"list",
|
|
74
|
+
"listitem, level 1, position 1, set size 3",
|
|
75
|
+
"link, Home",
|
|
76
|
+
"button, Sub-navigation, not expanded",
|
|
77
|
+
"end of listitem, level 1, position 1, set size 3",
|
|
78
|
+
"listitem, level 1, position 2, set size 3",
|
|
79
|
+
"link, About",
|
|
80
|
+
"end of listitem, level 1, position 2, set size 3",
|
|
81
|
+
"listitem, level 1, position 3, set size 3",
|
|
82
|
+
"link, Contact",
|
|
83
|
+
"end of listitem, level 1, position 3, set size 3",
|
|
84
|
+
"end of list",
|
|
85
|
+
"end of navigation, Primary Navigation",
|
|
86
|
+
"end of banner",
|
|
87
|
+
"end of document",
|
|
88
|
+
])
|
|
89
|
+
}
|
|
77
90
|
},
|
|
78
91
|
}
|
|
@@ -49,7 +49,7 @@ const Header = ({
|
|
|
49
49
|
<GlobalToggle
|
|
50
50
|
toggleId={id}
|
|
51
51
|
icon={Icons.MENU}
|
|
52
|
-
name="
|
|
52
|
+
name="Menu"
|
|
53
53
|
open={isExpanded}
|
|
54
54
|
onClick={() => toggle()}
|
|
55
55
|
/>
|
|
@@ -70,7 +70,7 @@ const Header = ({
|
|
|
70
70
|
title="Primary Navigation"
|
|
71
71
|
items={navigationItems}
|
|
72
72
|
mediaQuery={mediaQuery}
|
|
73
|
-
id={id}
|
|
73
|
+
id={`${id}-nav`}
|
|
74
74
|
></NavigationDropdown>
|
|
75
75
|
</Wrapper>
|
|
76
76
|
</div>
|
|
@@ -44,13 +44,15 @@ exports[`Controls 1`] = `
|
|
|
44
44
|
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
<mx-translate class="mx-translate" closeonclick="" data-default-language="en" data-update-trigger-label="true">
|
|
48
|
+
<button id="unique-1" type="button" class="mx-button mx-button--light mx-button--small mx-translate__trigger mx-popover__trigger notranslate" popovertarget="translate" style="anchor-name: --translate" data-label="Language" aria-label="Language">
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<span class="mx-icon mx-icon--chevron-down"></span>
|
|
52
|
-
|
|
50
|
+
<span class="mx-icon mx-icon--globe"></span>
|
|
51
|
+
<span class="mx-translate__code">EN</span>
|
|
53
52
|
</button>
|
|
53
|
+
<div class="mx-popover mx-translate__menu notranslate" id="translate" aria-describedby="unique-1" aria-labelledby="unique-1" style="position-anchor: --translate" data-placement="bottom-start" popover="" role="menu">
|
|
54
|
+
</div>
|
|
55
|
+
</mx-translate>
|
|
54
56
|
|
|
55
57
|
</div>
|
|
56
58
|
</div>
|
|
@@ -337,13 +339,15 @@ exports[`Stacked 1`] = `
|
|
|
337
339
|
|
|
338
340
|
<div class="mx-header__nav-right">
|
|
339
341
|
|
|
340
|
-
|
|
342
|
+
<mx-translate class="mx-translate" closeonclick="" data-default-language="en" data-update-trigger-label="true">
|
|
343
|
+
<button id="unique-8" type="button" class="mx-button mx-button--light mx-button--small mx-translate__trigger mx-popover__trigger notranslate" popovertarget="translate" style="anchor-name: --translate" data-label="Language" aria-label="Language">
|
|
341
344
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
<span class="mx-icon mx-icon--chevron-down"></span>
|
|
345
|
-
|
|
345
|
+
<span class="mx-icon mx-icon--globe"></span>
|
|
346
|
+
<span class="mx-translate__code">EN</span>
|
|
346
347
|
</button>
|
|
348
|
+
<div class="mx-popover mx-translate__menu notranslate" id="translate" aria-describedby="unique-8" aria-labelledby="unique-8" style="position-anchor: --translate" data-placement="bottom-start" popover="" role="menu">
|
|
349
|
+
</div>
|
|
350
|
+
</mx-translate>
|
|
347
351
|
|
|
348
352
|
</div>
|
|
349
353
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`Primary Header 1`] = `"<header class="mx-page mx-header mx-section--s"><div class="mx-header__inner"><div class="mx-header__brand"><img alt="Mixtape" src="mixtape-logo.png"></div><div class="mx-header__main"><div id="_r_0_" class="mx-header__nav mx-header__collapse-toggle"><nav class="mx-nav mx-nav--dropdown" aria-label="Primary Navigation" id="_r_0_"><ul class="mx-nav__level-1"><li class="mx-nav__has-subnav"><a href="http://example.com/#1" class="">Home</a><button aria-controls="_r_1_" aria-expanded="false" class="mx-nav__toggle mx-icon mx-icon--only mx-icon--chevron-down" type="button">Sub-navigation</button></li><li class=""><a href="http://example.com/#2" class="">About</a></li><li class=""><a href="http://example.com/#3" class="">Contact</a></li></ul></nav></div></div></div></header>"`;
|
|
3
|
+
exports[`Primary Header 1`] = `"<header class="mx-page mx-header mx-section--s"><div class="mx-header__inner"><div class="mx-header__brand"><img alt="Mixtape" src="mixtape-logo.png"></div><div class="mx-header__main"><div id="_r_0_" class="mx-header__nav mx-header__collapse-toggle"><nav class="mx-nav mx-nav--dropdown" aria-label="Primary Navigation" id="_r_0_-nav"><ul class="mx-nav__level-1"><li class="mx-nav__has-subnav"><a href="http://example.com/#1" class="">Home</a><button aria-controls="_r_1_" aria-expanded="false" class="mx-nav__toggle mx-icon mx-icon--only mx-icon--chevron-down" type="button">Sub-navigation</button></li><li class=""><a href="http://example.com/#2" class="">About</a></li><li class=""><a href="http://example.com/#3" class="">Contact</a></li></ul></nav></div></div></div></header>"`;
|
|
4
4
|
|
|
5
|
-
exports[`Screen Reader Announcements 1`] = `"<header class="mx-page mx-header mx-section--s"><div class="mx-header__inner"><div class="mx-header__brand"><img alt="Mixtape" src="mixtape-logo.png"></div><div class="mx-header__main"><div id="_r_7_" class="mx-header__nav mx-header__collapse-toggle"><nav class="mx-nav mx-nav--dropdown" aria-label="Primary Navigation" id="_r_7_"><ul class="mx-nav__level-1"><li class="mx-nav__has-subnav"><a href="http://example.com/#1" class="">Home</a><button aria-controls="_r_8_" aria-expanded="false" class="mx-nav__toggle mx-icon mx-icon--only mx-icon--chevron-down" type="button">Sub-navigation</button></li><li class=""><a href="http://example.com/#2" class="">About</a></li><li class=""><a href="http://example.com/#3" class="">Contact</a></li></ul></nav></div></div></div></header>"`;
|
|
5
|
+
exports[`Screen Reader Announcements 1`] = `"<header class="mx-page mx-header mx-section--s"><div class="mx-header__inner"><div class="mx-header__brand"><img alt="Mixtape" src="mixtape-logo.png"></div><div class="mx-header__main"><div id="_r_7_" class="mx-header__nav mx-header__collapse-toggle"><nav class="mx-nav mx-nav--dropdown" aria-label="Primary Navigation" id="_r_7_-nav"><ul class="mx-nav__level-1"><li class="mx-nav__has-subnav"><a href="http://example.com/#1" class="">Home</a><button aria-controls="_r_8_" aria-expanded="false" class="mx-nav__toggle mx-icon mx-icon--only mx-icon--chevron-down" type="button">Sub-navigation</button></li><li class=""><a href="http://example.com/#2" class="">About</a></li><li class=""><a href="http://example.com/#3" class="">Contact</a></li></ul></nav></div></div></div></header>"`;
|
|
@@ -5,15 +5,17 @@
|
|
|
5
5
|
@layer design-system.layouts {
|
|
6
6
|
.mx-header__inner {
|
|
7
7
|
display: grid;
|
|
8
|
-
grid-template-columns: 1fr auto;
|
|
8
|
+
grid-template-columns: minmax(var(--brand-logo-width, 120px), 1fr) auto;
|
|
9
9
|
align-items: center;
|
|
10
|
+
gap: var(--header-gap, var(--spacing-xxxs));
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
.mx-header__brand {
|
|
13
14
|
display: flex;
|
|
14
|
-
gap: var(--brand-gap, var(--gap));
|
|
15
|
+
gap: var(--brand-gap, var(--spacing-xxxs) var(--gap));
|
|
15
16
|
align-items: center;
|
|
16
17
|
margin-inline-end: auto;
|
|
18
|
+
flex-wrap: wrap;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
.mx-header__name {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Global Header
|
|
3
3
|
*/
|
|
4
|
+
@import "../../Utility/_mixins.css";
|
|
4
5
|
|
|
5
6
|
@layer design-system.layouts {
|
|
6
7
|
.mx-header__toggles {
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
padding-inline-end: 2px;
|
|
10
11
|
position: relative;
|
|
11
12
|
z-index: var(--toggle-index, 3);
|
|
13
|
+
align-self: var(--toggle-align, start);
|
|
12
14
|
|
|
13
15
|
@media (--global-nav-up) {
|
|
14
16
|
display: none;
|
|
@@ -25,22 +27,23 @@
|
|
|
25
27
|
|
|
26
28
|
.mx-header__collapse-toggle {
|
|
27
29
|
inline-size: 100%;
|
|
28
|
-
opacity: 1;
|
|
29
30
|
display: grid;
|
|
30
31
|
position: fixed;
|
|
31
32
|
z-index: var(--collapse-index, 2);
|
|
32
33
|
inset: 0;
|
|
33
34
|
align-items: center;
|
|
34
35
|
|
|
35
|
-
@starting-style {
|
|
36
|
-
opacity: 0;
|
|
37
|
-
display: grid;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
36
|
@media (--global-nav-down) {
|
|
37
|
+
@add-mixin transition;
|
|
38
|
+
|
|
41
39
|
padding-inline: var(--gutter, var(--spacing-l));
|
|
42
40
|
grid-template-columns: inherit;
|
|
43
41
|
|
|
42
|
+
@starting-style {
|
|
43
|
+
opacity: 0;
|
|
44
|
+
display: grid;
|
|
45
|
+
}
|
|
46
|
+
|
|
44
47
|
& .mx-header__nav-inner {
|
|
45
48
|
grid-column: full;
|
|
46
49
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`Page 1`] = `"<div class="mx-page"><header class="mx-page mx-header mx-section--s"><div class="mx-header__inner"><div class="mx-header__brand"><img alt="Mixtape" src="mixtape-logo.png"></div><div class="mx-header__main"><div id="_r_0_" class="mx-header__nav mx-header__collapse-toggle"><nav class="mx-nav mx-nav--dropdown" aria-label="Primary Navigation" id="_r_0_"><ul class="mx-nav__level-1"><li class="mx-nav__has-subnav"><a href="http://example.com/#1" class="">Home</a><button aria-controls="_r_1_" aria-expanded="false" class="mx-nav__toggle mx-icon mx-icon--only mx-icon--chevron-down" type="button">Sub-navigation</button></li><li class=""><a href="http://example.com/#2" class="">About</a></li><li class=""><a href="http://example.com/#3" class="">Contact</a></li></ul></nav></div></div></div></header><main id="main" class="mx-page"><div class="mx-page mx-hero-banner"><div class="mx-hero-banner__inner"><h1 class="mx-headline" id="always-put-your-best">Always put your best foot forward.</h1><p class="mx-text--xl">Make the most of the opportunity by encouraging an action and keeping your copy clear and concise.</p></div></div></main><footer class="mx-footer mx-section--l"><div class="mx-footer__inner"><span class="mx-footer__copyright mx-text--s">© 2022 Company Name</span></div></footer></div>"`;
|
|
3
|
+
exports[`Page 1`] = `"<div class="mx-page"><header class="mx-page mx-header mx-section--s"><div class="mx-header__inner"><div class="mx-header__brand"><img alt="Mixtape" src="mixtape-logo.png"></div><div class="mx-header__main"><div id="_r_0_" class="mx-header__nav mx-header__collapse-toggle"><nav class="mx-nav mx-nav--dropdown" aria-label="Primary Navigation" id="_r_0_-nav"><ul class="mx-nav__level-1"><li class="mx-nav__has-subnav"><a href="http://example.com/#1" class="">Home</a><button aria-controls="_r_1_" aria-expanded="false" class="mx-nav__toggle mx-icon mx-icon--only mx-icon--chevron-down" type="button">Sub-navigation</button></li><li class=""><a href="http://example.com/#2" class="">About</a></li><li class=""><a href="http://example.com/#3" class="">Contact</a></li></ul></nav></div></div></div></header><main id="main" class="mx-page"><div class="mx-page mx-hero-banner"><div class="mx-hero-banner__inner"><h1 class="mx-headline" id="always-put-your-best">Always put your best foot forward.</h1><p class="mx-text--xl">Make the most of the opportunity by encouraging an action and keeping your copy clear and concise.</p></div></div></main><footer class="mx-footer mx-section--l"><div class="mx-footer__inner"><span class="mx-footer__copyright mx-text--s">© 2022 Company Name</span></div></footer></div>"`;
|