@pnx-mixtape/mxds 0.1.0-rc.2 → 0.1.0-rc.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/.storybook/{preview.ts → preview.tsx} +4 -0
- package/.storybook/src/docs.tsx +29 -0
- package/dist/build/accordion.css +1 -1
- package/dist/build/accordion.entry.js +1 -1
- package/dist/build/autocomplete.css +1 -1
- package/dist/build/autocomplete.entry.js +1 -1
- package/dist/build/base.css +1 -1
- package/dist/build/breadcrumb.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-z-dH6nFH.js → Accordion-GN0sME4W.js} +1 -1
- package/dist/build/chunks/{AccordionMobile-BYPPNyf5.js → AccordionMobile-DG5jSe8Q.js} +1 -1
- package/dist/build/chunks/{Autocomplete-2L6tLLuh.js → Autocomplete-B4RtkAyh.js} +1 -1
- package/dist/build/chunks/{ClosableAlert-DdXbF1J2.js → ClosableAlert-DEhj8Nxm.js} +1 -1
- package/dist/build/chunks/{Dialog-Ds8gzhri.js → Dialog-Haahn-Yn.js} +1 -1
- package/dist/build/chunks/Gallery-D8NGXy2Q.js +1 -0
- package/dist/build/chunks/GlobalToggle-B52fdBQu.js +1 -0
- package/dist/build/chunks/{InPageNavigation-CVieEl9u.js → InPageNavigation-Dyn2TR-N.js} +1 -1
- package/dist/build/chunks/Navigation-hOrfLq7h.js +1 -0
- package/dist/build/chunks/{Sticky-cWUVSOXN.js → Sticky-BGCuuEJK.js} +1 -1
- package/dist/build/chunks/{Tabs-DA_Ez8pv.js → Tabs-DYy1YTdU.js} +1 -1
- package/dist/build/chunks/enums-DLV_1NAf.js +1 -0
- package/dist/build/chunks/utilities-_Bq3TxAQ.js +1 -0
- package/dist/build/constants.css +1 -1
- package/dist/build/cookie-consent.css +1 -1
- package/dist/build/dialog.css +1 -1
- package/dist/build/dialog.entry.js +1 -1
- package/dist/build/elements.js +1 -1
- package/dist/build/filters.css +1 -1
- package/dist/build/filters.entry.js +1 -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/list-item.css +1 -1
- package/dist/build/navigation.css +1 -1
- package/dist/build/navigation.entry.js +1 -1
- package/dist/build/one-time-code.css +1 -0
- package/dist/build/popover.css +1 -1
- package/dist/build/print.css +1 -1
- package/dist/build/react.js +1 -1
- package/dist/build/steps.css +1 -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/utilities.css +1 -1
- package/dist/types/Atom/Link/Link.d.ts.map +1 -1
- package/dist/types/Component/Accordion/Accordion.d.ts.map +1 -1
- package/dist/types/Component/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/Component/Filters/Elements/Filters.d.ts +20 -1
- package/dist/types/Component/Filters/Elements/Filters.d.ts.map +1 -1
- package/dist/types/Component/Filters/Filters.d.ts +7 -2
- package/dist/types/Component/Filters/Filters.d.ts.map +1 -1
- package/dist/types/Component/Gallery/Gallery.d.ts.map +1 -1
- package/dist/types/Component/Pagination/Components/PaginationContext.d.ts.map +1 -1
- package/dist/types/Component/Tabs/Tabs.d.ts.map +1 -1
- package/dist/types/Form/Autocomplete/Autocomplete.d.ts +2 -2
- package/dist/types/Form/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/types/Form/Autocomplete/Elements/Autocomplete.d.ts +10 -0
- package/dist/types/Form/Autocomplete/Elements/Autocomplete.d.ts.map +1 -1
- package/dist/types/Form/OneTimeCode/OneTimeCode.d.ts +12 -0
- package/dist/types/Form/OneTimeCode/OneTimeCode.d.ts.map +1 -0
- package/dist/types/Utility/Hooks/useIsomorphicLayoutEffect.d.ts +4 -0
- package/dist/types/Utility/Hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/dist/types/enums.d.ts +4 -0
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/react.d.ts +1 -0
- package/dist/types/react.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/Atom/Button/__snapshots__/Button.stories.ts.snap +2 -3
- package/src/Atom/Button/_buttons.css +16 -0
- package/src/Atom/Button/button.twig +4 -1
- package/src/Atom/DefinitionList/DefinitionList.stories.ts +3 -0
- package/src/Atom/Icon/_icon.css +3 -0
- package/src/Atom/Link/Link.tsx +16 -3
- package/src/Atom/Link/__snapshots__/Link.stories.ts.snap +7 -12
- package/src/Atom/Link/__snapshots__/Link.stories.tsx.snap +1 -1
- package/src/Atom/Link/_links.css +9 -0
- package/src/Atom/Link/link.twig +8 -2
- package/src/Atom/LinkedImage/linked-image.twig +1 -2
- package/src/Atom/_generic.css +0 -10
- package/src/Component/Accordion/Accordion.stories.ts +31 -0
- package/src/Component/Accordion/Accordion.tsx +3 -2
- package/src/Component/Accordion/AccordionItem.stories.ts +27 -0
- package/src/Component/Accordion/__snapshots__/Accordion.stories.ts.snap +36 -0
- package/src/Component/Accordion/__snapshots__/AccordionItem.stories.ts.snap +16 -0
- package/src/Component/Accordion/accordion.css +3 -1
- package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.ts.snap +3 -6
- package/src/Component/Breadcrumb/breadcrumb.css +4 -0
- package/src/Component/Card/__snapshots__/Card.stories.ts.snap +11 -22
- package/src/Component/Card/card.css +2 -2
- package/src/Component/Carousel/Carousel.stories.ts +55 -0
- package/src/Component/Carousel/Carousel.stories.tsx +74 -0
- package/src/Component/Carousel/__snapshots__/Carousel.stories.ts.snap +273 -88
- package/src/Component/Carousel/__snapshots__/Carousel.stories.tsx.snap +5 -3
- package/src/Component/Carousel/carousel.css +1 -1
- package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.ts.snap +12 -24
- package/src/Component/CookieConsent/cookie-consent.css +6 -1
- package/src/Component/Dialog/Dialog.stories.ts +33 -0
- package/src/Component/Dialog/Dialog.stories.tsx +25 -0
- package/src/Component/Dialog/Dialog.tsx +2 -2
- package/src/Component/Dialog/__snapshots__/Dialog.stories.ts.snap +33 -2
- package/src/Component/Dialog/__snapshots__/Dialog.stories.tsx.snap +2 -0
- package/src/Component/Dialog/dialog.css +5 -2
- package/src/Component/DropMenu/DropMenu.stories.ts +39 -1
- package/src/Component/DropMenu/DropMenu.stories.tsx +29 -0
- package/src/Component/DropMenu/DropMenu.tsx +1 -1
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +14 -0
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +3 -1
- package/src/Component/Filters/Elements/Filters.ts +71 -1
- package/src/Component/Filters/FilterItem.stories.ts +2 -1
- package/src/Component/Filters/FilterItem.tsx +1 -1
- package/src/Component/Filters/Filters.figma.ts +1 -1
- package/src/Component/Filters/Filters.stories.ts +95 -3
- package/src/Component/Filters/Filters.stories.tsx +246 -17
- package/src/Component/Filters/Filters.tsx +145 -29
- package/src/Component/Filters/README.md +102 -37
- package/src/Component/Filters/__snapshots__/FilterItem.stories.tsx.snap +3 -3
- package/src/Component/Filters/__snapshots__/Filters.stories.ts.snap +82 -4
- package/src/Component/Filters/__snapshots__/Filters.stories.tsx.snap +9 -3
- package/src/Component/Filters/filters.css +11 -0
- package/src/Component/Gallery/Gallery.tsx +2 -2
- package/src/Component/GlobalAlert/global-alert.css +3 -0
- package/src/Component/HeroBanner/HeroBanner.stories.ts +1 -1
- package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +4 -8
- package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.ts.snap +5 -10
- package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.ts.snap +6 -12
- package/src/Component/InPageNavigation/InPageNavigation.stories.ts +50 -0
- package/src/Component/InPageNavigation/InPageNavigation.stories.tsx +78 -0
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +35 -1
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.tsx.snap +2 -0
- package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +6 -12
- package/src/Component/ListItem/__snapshots__/ListItem.stories.ts.snap +7 -14
- package/src/Component/ListItem/list-item.css +1 -1
- package/src/Component/Navigation/Dropdown.stories.tsx +46 -0
- package/src/Component/Navigation/Navigation.stories.ts +56 -0
- package/src/Component/Navigation/__snapshots__/Dropdown.stories.tsx.snap +2 -0
- package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +57 -0
- package/src/Component/Navigation/_navigation-collapsible.css +3 -1
- package/src/Component/Navigation/_navigation-dropdown.css +3 -1
- package/src/Component/Pagination/Components/PaginationContext.tsx +2 -1
- package/src/Component/Pagination/Components/PaginationItem.tsx +1 -1
- package/src/Component/Pagination/Pagination.stories.ts +36 -0
- package/src/Component/Pagination/Pagination.stories.tsx +31 -0
- package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +69 -12
- package/src/Component/Pagination/__snapshots__/Pagination.stories.tsx.snap +3 -1
- package/src/Component/Pagination/pagination-item.twig +1 -1
- package/src/Component/Popover/__snapshots__/Popover.stories.ts.snap +13 -26
- package/src/Component/Popover/popover.css +4 -2
- package/src/Component/SideNavigation/__snapshots__/SideNavigation.stories.ts.snap +1 -2
- package/src/Component/SocialLinks/__snapshots__/SocialLinks.stories.ts.snap +6 -9
- package/src/Component/Steps/Steps.stories.ts +1 -1
- package/src/Component/Steps/steps.css +13 -0
- package/src/Component/Tabs/Tabs.stories.ts +22 -0
- package/src/Component/Tabs/Tabs.stories.tsx +24 -0
- package/src/Component/Tabs/Tabs.tsx +2 -2
- package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +18 -0
- package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +3 -1
- package/src/Component/Tabs/tabs.css +6 -5
- package/src/Form/Autocomplete/Autocomplete.stories.ts +81 -4
- package/src/Form/Autocomplete/Autocomplete.stories.tsx +85 -1
- package/src/Form/Autocomplete/Autocomplete.tsx +19 -6
- package/src/Form/Autocomplete/Elements/Autocomplete.ts +24 -1
- package/src/Form/Autocomplete/__snapshots__/Autocomplete.stories.ts.snap +38 -4
- package/src/Form/Autocomplete/__snapshots__/Autocomplete.stories.tsx.snap +8 -4
- package/src/Form/Autocomplete/autocomplete.css +12 -1
- package/src/Form/Autocomplete/autocomplete.twig +1 -1
- package/src/Form/OneTimeCode/OneTimeCode.stories.ts +20 -0
- package/src/Form/OneTimeCode/OneTimeCode.stories.tsx +18 -0
- package/src/Form/OneTimeCode/OneTimeCode.tsx +56 -0
- package/src/Form/OneTimeCode/README.md +83 -0
- package/src/Form/OneTimeCode/__snapshots__/OneTimeCode.stories.ts.snap +7 -0
- package/src/Form/OneTimeCode/__snapshots__/OneTimeCode.stories.tsx.snap +3 -0
- package/src/Form/OneTimeCode/one-time-code.css +13 -0
- package/src/Form/OneTimeCode/one-time-code.twig +31 -0
- package/src/Form/__snapshots__/Validation.stories.ts.snap +1 -1
- package/src/Form/form.css +95 -35
- package/src/Layout/Footer/__snapshots__/Footer.stories.ts.snap +18 -33
- 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/Header.stories.ts +33 -0
- package/src/Layout/Header/Header.stories.tsx +31 -0
- package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +50 -0
- package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +2 -0
- package/src/Layout/Header/_header.css +4 -2
- package/src/Layout/Header/_toggles.css +4 -1
- package/src/Layout/Masthead/__snapshots__/Masthead.stories.ts.snap +8 -16
- package/src/Layout/Section/__snapshots__/Background.stories.ts.snap +2 -4
- package/src/Layout/Section/__snapshots__/Section.stories.ts.snap +4 -8
- package/src/Utility/Hooks/useIsomorphicLayoutEffect.ts +8 -0
- package/src/Utility/_mixins.css +46 -0
- package/src/Utility/print.css +1 -1
- package/src/Utility/utilities.css +20 -0
- package/src/_custom-media.css +3 -2
- package/src/constants.css +3 -13
- package/src/enums.ts +5 -0
- package/src/react.ts +1 -0
- package/tools/test-utils/screen-reader.ts +33 -0
- package/dist/build/chunks/Gallery-BT3cxS5m.js +0 -1
- package/dist/build/chunks/GlobalToggle-DQHho97V.js +0 -1
- package/dist/build/chunks/Navigation-B9Wug-ok.js +0 -1
- package/dist/build/chunks/disclosure-widget-BETzOHLO.js +0 -1
- package/dist/build/chunks/utilities-C5dAO2YA.js +0 -1
package/src/Form/form.css
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import "../Utility/_mixins.css";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Form
|
|
3
5
|
*/
|
|
@@ -7,7 +9,8 @@
|
|
|
7
9
|
max-inline-size: var(--container-max-width);
|
|
8
10
|
|
|
9
11
|
&:has([required]) :is(.mx-label, .mx-legend) {
|
|
10
|
-
|
|
12
|
+
&::after,
|
|
13
|
+
& > .mx-required {
|
|
11
14
|
color: var(--colour-error);
|
|
12
15
|
}
|
|
13
16
|
}
|
|
@@ -65,6 +68,15 @@
|
|
|
65
68
|
&[disabled] {
|
|
66
69
|
opacity: var(--disabled-opacity, 0.6);
|
|
67
70
|
cursor: not-allowed;
|
|
71
|
+
|
|
72
|
+
@media (--forced-colors) {
|
|
73
|
+
/* opt out so GrayText survives */
|
|
74
|
+
forced-color-adjust: none;
|
|
75
|
+
opacity: 1;
|
|
76
|
+
color: GrayText;
|
|
77
|
+
border-color: GrayText;
|
|
78
|
+
background-color: Canvas;
|
|
79
|
+
}
|
|
68
80
|
}
|
|
69
81
|
}
|
|
70
82
|
|
|
@@ -160,6 +172,7 @@
|
|
|
160
172
|
background-color: transparent;
|
|
161
173
|
border: 0;
|
|
162
174
|
flex-grow: 1;
|
|
175
|
+
inline-size: 100%;
|
|
163
176
|
|
|
164
177
|
&:focus-visible {
|
|
165
178
|
outline: none;
|
|
@@ -198,6 +211,7 @@
|
|
|
198
211
|
.mx-checkbox [type="checkbox"] {
|
|
199
212
|
box-shadow: none;
|
|
200
213
|
appearance: none;
|
|
214
|
+
display: flex;
|
|
201
215
|
inline-size: var(--control-size, var(--spacing-m));
|
|
202
216
|
block-size: var(--control-size, var(--spacing-m));
|
|
203
217
|
background-color: var(--background, var(--colour-background));
|
|
@@ -205,30 +219,48 @@
|
|
|
205
219
|
border-radius: var(--border-radius);
|
|
206
220
|
font-size: 1rem;
|
|
207
221
|
|
|
208
|
-
@media (
|
|
222
|
+
@media (--touch) {
|
|
209
223
|
--control-size: 2rem;
|
|
210
224
|
}
|
|
211
225
|
|
|
212
|
-
&:checked {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
226
|
+
&:checked::after {
|
|
227
|
+
content: "";
|
|
228
|
+
display: block;
|
|
229
|
+
inline-size: 0.75rem;
|
|
230
|
+
block-size: 0.75rem;
|
|
231
|
+
margin: auto;
|
|
232
|
+
mask-image: url("./images/checkmark.svg");
|
|
233
|
+
mask-size: contain;
|
|
234
|
+
mask-position: center;
|
|
235
|
+
mask-repeat: no-repeat;
|
|
236
|
+
background-color: var(--checkbox-colour, currentcolor);
|
|
237
|
+
|
|
238
|
+
@add-mixin forced-colors-paint;
|
|
216
239
|
}
|
|
217
240
|
|
|
218
241
|
&[disabled] {
|
|
219
|
-
|
|
220
|
-
opacity: var(--disabled-opacity, 0.6);
|
|
221
|
-
cursor: not-allowed;
|
|
222
|
-
content: "";
|
|
223
|
-
display: block;
|
|
224
|
-
inline-size: 100%;
|
|
225
|
-
block-size: 100%;
|
|
226
|
-
border-radius: var(--border-radius);
|
|
227
|
-
}
|
|
242
|
+
cursor: not-allowed;
|
|
228
243
|
|
|
229
244
|
& + label {
|
|
230
245
|
opacity: var(--disabled-opacity, 0.6);
|
|
231
246
|
cursor: not-allowed;
|
|
247
|
+
|
|
248
|
+
@media (--forced-colors) {
|
|
249
|
+
/* opt out or the UA forces this straight back to CanvasText */
|
|
250
|
+
forced-color-adjust: none;
|
|
251
|
+
opacity: 1;
|
|
252
|
+
color: GrayText;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@media (--forced-colors) {
|
|
257
|
+
/* opt out so GrayText survives */
|
|
258
|
+
--forced-colour: GrayText;
|
|
259
|
+
|
|
260
|
+
forced-color-adjust: none;
|
|
261
|
+
color: GrayText;
|
|
262
|
+
border-color: GrayText;
|
|
263
|
+
background-color: Canvas;
|
|
232
264
|
}
|
|
233
265
|
}
|
|
234
266
|
}
|
|
@@ -254,36 +286,45 @@
|
|
|
254
286
|
border-radius: 50%;
|
|
255
287
|
font-size: 1rem;
|
|
256
288
|
|
|
257
|
-
@media (
|
|
289
|
+
@media (--touch) {
|
|
258
290
|
--control-size: 2rem;
|
|
259
291
|
}
|
|
260
292
|
|
|
261
|
-
&:checked {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
293
|
+
&:checked::after {
|
|
294
|
+
content: "";
|
|
295
|
+
display: block;
|
|
296
|
+
inline-size: 0.5rem;
|
|
297
|
+
block-size: 0.5rem;
|
|
298
|
+
margin: auto;
|
|
299
|
+
border-radius: 50%;
|
|
300
|
+
background-color: var(--radio-colour, var(--colour-primary));
|
|
301
|
+
|
|
302
|
+
@add-mixin forced-colors-paint;
|
|
271
303
|
}
|
|
272
304
|
|
|
273
305
|
&[disabled] {
|
|
274
|
-
|
|
275
|
-
opacity: var(--disabled-opacity, 0.6);
|
|
276
|
-
cursor: not-allowed;
|
|
277
|
-
content: "";
|
|
278
|
-
display: block;
|
|
279
|
-
inline-size: 100%;
|
|
280
|
-
block-size: 100%;
|
|
281
|
-
border-radius: 50%;
|
|
282
|
-
}
|
|
306
|
+
cursor: not-allowed;
|
|
283
307
|
|
|
284
308
|
& + label {
|
|
285
309
|
opacity: var(--disabled-opacity, 0.6);
|
|
286
310
|
cursor: not-allowed;
|
|
311
|
+
|
|
312
|
+
@media (--forced-colors) {
|
|
313
|
+
/* opt out or the UA forces this straight back to CanvasText */
|
|
314
|
+
forced-color-adjust: none;
|
|
315
|
+
opacity: 1;
|
|
316
|
+
color: GrayText;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
@media (--forced-colors) {
|
|
321
|
+
/* opt out so GrayText survives */
|
|
322
|
+
--forced-colour: GrayText;
|
|
323
|
+
|
|
324
|
+
forced-color-adjust: none;
|
|
325
|
+
color: GrayText;
|
|
326
|
+
border-color: GrayText;
|
|
327
|
+
background-color: Canvas;
|
|
287
328
|
}
|
|
288
329
|
}
|
|
289
330
|
}
|
|
@@ -467,12 +508,25 @@
|
|
|
467
508
|
}
|
|
468
509
|
}
|
|
469
510
|
|
|
511
|
+
/* A <select> has no pseudo-element to mask, and the chevron asset is a
|
|
512
|
+
fixed black, so on the legacy path hand the arrow back to the UA under
|
|
513
|
+
forced colours. The base-select path masks ::picker-icon instead. */
|
|
514
|
+
@supports not (appearance: base-select) {
|
|
515
|
+
@media (--forced-colors) {
|
|
516
|
+
appearance: auto;
|
|
517
|
+
background-image: none;
|
|
518
|
+
padding-inline-end: revert;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
470
522
|
&::picker-icon {
|
|
471
523
|
mask-image: url("./images/form-chevron-down.svg");
|
|
472
524
|
mask-repeat: no-repeat;
|
|
473
525
|
mask-position: center;
|
|
474
526
|
background-color: currentcolor;
|
|
475
527
|
aspect-ratio: 1 / 1;
|
|
528
|
+
|
|
529
|
+
@add-mixin forced-colors-paint;
|
|
476
530
|
}
|
|
477
531
|
|
|
478
532
|
&:open::picker-icon {
|
|
@@ -486,6 +540,8 @@
|
|
|
486
540
|
display: block;
|
|
487
541
|
mask-image: url("./images/checkmark.svg");
|
|
488
542
|
background-color: currentcolor;
|
|
543
|
+
|
|
544
|
+
@add-mixin forced-colors-paint;
|
|
489
545
|
}
|
|
490
546
|
|
|
491
547
|
&[multiple] {
|
|
@@ -606,11 +662,15 @@
|
|
|
606
662
|
.mx-error-message::before {
|
|
607
663
|
mask-image: url("./images/form-error.svg");
|
|
608
664
|
background-color: var(--error-foreground, var(--colour-error));
|
|
665
|
+
|
|
666
|
+
@add-mixin forced-colors-paint;
|
|
609
667
|
}
|
|
610
668
|
|
|
611
669
|
.mx-success-message::before {
|
|
612
670
|
mask-image: url("./images/form-success.svg");
|
|
613
671
|
background-color: var(--success-foreground, var(--colour-success));
|
|
672
|
+
|
|
673
|
+
@add-mixin forced-colors-paint;
|
|
614
674
|
}
|
|
615
675
|
}
|
|
616
676
|
|
|
@@ -78,28 +78,25 @@ exports[`Everything 1`] = `
|
|
|
78
78
|
|
|
79
79
|
<nav class="mx-social-links" aria-label="Social media links">
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
<a href="#">
|
|
81
|
+
|
|
82
|
+
<a href="#" aria-label="Facebook">
|
|
83
83
|
|
|
84
84
|
<span class="mx-icon mx-icon--facebook mx-icon--size-md"></span>
|
|
85
85
|
|
|
86
|
-
<span class="sr-only">Facebook</span>
|
|
87
86
|
|
|
88
87
|
</a>
|
|
89
|
-
|
|
90
|
-
<a href="#">
|
|
88
|
+
|
|
89
|
+
<a href="#" aria-label="Instagram">
|
|
91
90
|
|
|
92
91
|
<span class="mx-icon mx-icon--instagram mx-icon--size-md"></span>
|
|
93
92
|
|
|
94
|
-
<span class="sr-only">Instagram</span>
|
|
95
93
|
|
|
96
94
|
</a>
|
|
97
|
-
|
|
98
|
-
<a href="#">
|
|
95
|
+
|
|
96
|
+
<a href="#" aria-label="LinkedIn">
|
|
99
97
|
|
|
100
98
|
<span class="mx-icon mx-icon--linkedin mx-icon--size-md"></span>
|
|
101
99
|
|
|
102
|
-
<span class="sr-only">LinkedIn</span>
|
|
103
100
|
|
|
104
101
|
</a>
|
|
105
102
|
|
|
@@ -112,14 +109,12 @@ exports[`Everything 1`] = `
|
|
|
112
109
|
|
|
113
110
|
<a href="#">
|
|
114
111
|
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
Accessibility
|
|
117
113
|
</a>
|
|
118
114
|
|
|
119
115
|
<a href="#">
|
|
120
116
|
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
Terms & Conditions
|
|
123
118
|
</a>
|
|
124
119
|
|
|
125
120
|
</nav>
|
|
@@ -169,14 +164,12 @@ exports[`Footer 1`] = `
|
|
|
169
164
|
|
|
170
165
|
<a href="#">
|
|
171
166
|
|
|
172
|
-
|
|
173
|
-
|
|
167
|
+
Accessibility
|
|
174
168
|
</a>
|
|
175
169
|
|
|
176
170
|
<a href="#">
|
|
177
171
|
|
|
178
|
-
|
|
179
|
-
|
|
172
|
+
Terms & Conditions
|
|
180
173
|
</a>
|
|
181
174
|
|
|
182
175
|
</nav>
|
|
@@ -226,14 +219,12 @@ exports[`Light 1`] = `
|
|
|
226
219
|
|
|
227
220
|
<a href="#">
|
|
228
221
|
|
|
229
|
-
|
|
230
|
-
|
|
222
|
+
Accessibility
|
|
231
223
|
</a>
|
|
232
224
|
|
|
233
225
|
<a href="#">
|
|
234
226
|
|
|
235
|
-
|
|
236
|
-
|
|
227
|
+
Terms & Conditions
|
|
237
228
|
</a>
|
|
238
229
|
|
|
239
230
|
</nav>
|
|
@@ -283,14 +274,12 @@ exports[`No Logo 1`] = `
|
|
|
283
274
|
|
|
284
275
|
<a href="#">
|
|
285
276
|
|
|
286
|
-
|
|
287
|
-
|
|
277
|
+
Accessibility
|
|
288
278
|
</a>
|
|
289
279
|
|
|
290
280
|
<a href="#">
|
|
291
281
|
|
|
292
|
-
|
|
293
|
-
|
|
282
|
+
Terms & Conditions
|
|
294
283
|
</a>
|
|
295
284
|
|
|
296
285
|
</nav>
|
|
@@ -313,14 +302,12 @@ exports[`No Menu 1`] = `
|
|
|
313
302
|
|
|
314
303
|
<a href="#">
|
|
315
304
|
|
|
316
|
-
|
|
317
|
-
|
|
305
|
+
Accessibility
|
|
318
306
|
</a>
|
|
319
307
|
|
|
320
308
|
<a href="#">
|
|
321
309
|
|
|
322
|
-
|
|
323
|
-
|
|
310
|
+
Terms & Conditions
|
|
324
311
|
</a>
|
|
325
312
|
|
|
326
313
|
</nav>
|
|
@@ -371,14 +358,12 @@ exports[`With Acknowledgment 1`] = `
|
|
|
371
358
|
|
|
372
359
|
<a href="#">
|
|
373
360
|
|
|
374
|
-
|
|
375
|
-
|
|
361
|
+
Accessibility
|
|
376
362
|
</a>
|
|
377
363
|
|
|
378
364
|
<a href="#">
|
|
379
365
|
|
|
380
|
-
|
|
381
|
-
|
|
366
|
+
Terms & Conditions
|
|
382
367
|
</a>
|
|
383
368
|
|
|
384
369
|
</nav>
|
|
@@ -102,6 +102,32 @@ export const Container: Story = {
|
|
|
102
102
|
],
|
|
103
103
|
},
|
|
104
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Uses the experimental CSS Grid Lanes `display: grid-lanes` to pack items
|
|
107
|
+
* into the shortest column (masonry/waterfall), instead of the default
|
|
108
|
+
* row-by-row grid. Falls back to the regular auto-fit grid in browsers
|
|
109
|
+
* without support.
|
|
110
|
+
* @see https://webkit.org/blog/18098/introducing-the-field-guide-to-grid-lanes/
|
|
111
|
+
*/
|
|
112
|
+
export const Masonry: Story = {
|
|
113
|
+
args: {
|
|
114
|
+
className: "mx-grid--masonry",
|
|
115
|
+
children: [
|
|
116
|
+
{ value: "Short item" },
|
|
117
|
+
{
|
|
118
|
+
value:
|
|
119
|
+
"A taller item with more content, showing how Grid Lanes packs items into the shortest column instead of a fixed row height.",
|
|
120
|
+
},
|
|
121
|
+
{ value: "Medium length item with a little more text than the short one." },
|
|
122
|
+
{ value: "Short" },
|
|
123
|
+
{
|
|
124
|
+
value: "Another tall item demonstrating the waterfall packing behaviour of CSS Grid Lanes.",
|
|
125
|
+
},
|
|
126
|
+
{ value: "Tiny" },
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
}
|
|
130
|
+
|
|
105
131
|
export const List: Story = {
|
|
106
132
|
render: ({ children, ...args }) => (
|
|
107
133
|
<Component wrapper as={SectionTypes.LIST} {...args}>
|
|
@@ -9,3 +9,5 @@ exports[`Dynamic 1`] = `"<div class="mx-grid"><div class="">1</div><div class=""
|
|
|
9
9
|
exports[`Fixed 1`] = `"<div class="mx-grid mx-grid--cols-md-3"><div class="mx-grid-item__span-md-2">1</div><div class="">2</div></div>"`;
|
|
10
10
|
|
|
11
11
|
exports[`List 1`] = `"<ul class="mx-grid mx-grid--cols-md-3"><li class="mx-grid-item__span-md-2">1</li><li class="">2</li></ul>"`;
|
|
12
|
+
|
|
13
|
+
exports[`Masonry 1`] = `"<div class="mx-grid mx-grid--masonry"><div class="">Short item</div><div class="">A taller item with more content, showing how Grid Lanes packs items into the shortest column instead of a fixed row height.</div><div class="">Medium length item with a little more text than the short one.</div><div class="">Short</div><div class="">Another tall item demonstrating the waterfall packing behaviour of CSS Grid Lanes.</div><div class="">Tiny</div></div>"`;
|
package/src/Layout/Grid/grid.css
CHANGED
|
@@ -103,6 +103,18 @@
|
|
|
103
103
|
.mx-grid--collapse-rows {
|
|
104
104
|
row-gap: 0;
|
|
105
105
|
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Experimental: CSS Grid Lanes masonry (waterfall). Falls back to the
|
|
109
|
+
* standard auto-fit/auto-fill grid above until browser support lands.
|
|
110
|
+
* https://webkit.org/blog/18098/introducing-the-field-guide-to-grid-lanes/
|
|
111
|
+
*/
|
|
112
|
+
.mx-grid--masonry {
|
|
113
|
+
@supports (display: grid-lanes) {
|
|
114
|
+
display: grid-lanes;
|
|
115
|
+
grid-template-rows: none;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
106
118
|
}
|
|
107
119
|
|
|
108
120
|
/**
|
|
@@ -18,6 +18,7 @@ import "../../Component/Navigation/Elements/Navigation"
|
|
|
18
18
|
// css.
|
|
19
19
|
import "../../Component/Navigation/navigation.css"
|
|
20
20
|
import { modes } from "../../../.storybook/modes"
|
|
21
|
+
import { runScreenReaderWalkthrough } from "../../../tools/test-utils/screen-reader"
|
|
21
22
|
|
|
22
23
|
type MxHeaderType = Omit<HeaderType, "controls"> & {
|
|
23
24
|
stacked: boolean
|
|
@@ -117,6 +118,38 @@ export const Header: Story = {
|
|
|
117
118
|
},
|
|
118
119
|
}
|
|
119
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Steps a virtual screen reader through the page and asserts on what it announces.
|
|
123
|
+
*/
|
|
124
|
+
export const ScreenReaderAnnouncements: Story = {
|
|
125
|
+
play: async () => {
|
|
126
|
+
const log = await runScreenReaderWalkthrough()
|
|
127
|
+
await expect(log).toEqual([
|
|
128
|
+
"document",
|
|
129
|
+
"banner",
|
|
130
|
+
"image, Mixtape",
|
|
131
|
+
"navigation, Primary navigation",
|
|
132
|
+
"list",
|
|
133
|
+
"listitem, level 1, position 1, set size 4",
|
|
134
|
+
"link, News",
|
|
135
|
+
"end of listitem, level 1, position 1, set size 4",
|
|
136
|
+
"listitem, level 1, position 2, set size 4",
|
|
137
|
+
"link, About us",
|
|
138
|
+
"end of listitem, level 1, position 2, set size 4",
|
|
139
|
+
"listitem, level 1, position 3, set size 4",
|
|
140
|
+
"link, Contact",
|
|
141
|
+
"end of listitem, level 1, position 3, set size 4",
|
|
142
|
+
"listitem, level 1, position 4, set size 4",
|
|
143
|
+
"link, Resources",
|
|
144
|
+
"end of listitem, level 1, position 4, set size 4",
|
|
145
|
+
"end of list",
|
|
146
|
+
"end of navigation, Primary navigation",
|
|
147
|
+
"end of banner",
|
|
148
|
+
"end of document",
|
|
149
|
+
])
|
|
150
|
+
},
|
|
151
|
+
}
|
|
152
|
+
|
|
120
153
|
export const WithTitle: Story = {
|
|
121
154
|
args: {
|
|
122
155
|
title: "Design System",
|
|
@@ -4,6 +4,7 @@ import Component from "./Header"
|
|
|
4
4
|
import { mixtapeLogo, navigationItems } from "../../../mockups/constants"
|
|
5
5
|
import "./header.css"
|
|
6
6
|
import { Page } from "../../../.storybook-react/decorators"
|
|
7
|
+
import { runScreenReaderWalkthrough } from "../../../tools/test-utils/screen-reader"
|
|
7
8
|
|
|
8
9
|
const meta: Meta<typeof Component> = {
|
|
9
10
|
decorators: [Page],
|
|
@@ -45,3 +46,33 @@ export const PrimaryHeader: StoryObj<typeof meta> = {
|
|
|
45
46
|
})
|
|
46
47
|
},
|
|
47
48
|
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Steps a virtual screen reader through the page and asserts on what it announces.
|
|
52
|
+
*/
|
|
53
|
+
export const ScreenReaderAnnouncements: StoryObj<typeof meta> = {
|
|
54
|
+
play: async () => {
|
|
55
|
+
const log = await runScreenReaderWalkthrough()
|
|
56
|
+
await expect(log).toEqual([
|
|
57
|
+
"document",
|
|
58
|
+
"banner",
|
|
59
|
+
"image, Mixtape",
|
|
60
|
+
"navigation, Primary Navigation",
|
|
61
|
+
"list",
|
|
62
|
+
"listitem, level 1, position 1, set size 3",
|
|
63
|
+
"link, Home",
|
|
64
|
+
"button, Sub-navigation, not expanded",
|
|
65
|
+
"end of listitem, level 1, position 1, set size 3",
|
|
66
|
+
"listitem, level 1, position 2, set size 3",
|
|
67
|
+
"link, About",
|
|
68
|
+
"end of listitem, level 1, position 2, set size 3",
|
|
69
|
+
"listitem, level 1, position 3, set size 3",
|
|
70
|
+
"link, Contact",
|
|
71
|
+
"end of listitem, level 1, position 3, set size 3",
|
|
72
|
+
"end of list",
|
|
73
|
+
"end of navigation, Primary Navigation",
|
|
74
|
+
"end of banner",
|
|
75
|
+
"end of document",
|
|
76
|
+
])
|
|
77
|
+
},
|
|
78
|
+
}
|
|
@@ -72,6 +72,56 @@ exports[`Header 1`] = `
|
|
|
72
72
|
<div id="unique-0" class="mx-header__nav mx-header__collapse-toggle">
|
|
73
73
|
|
|
74
74
|
|
|
75
|
+
<mx-nav flyout="">
|
|
76
|
+
<nav class="mx-nav mx-nav--dropdown" aria-label="Primary navigation" id="header-story">
|
|
77
|
+
<ul class="mx-nav__level-1">
|
|
78
|
+
<li>
|
|
79
|
+
<a href="#">
|
|
80
|
+
News
|
|
81
|
+
</a>
|
|
82
|
+
</li>
|
|
83
|
+
<li>
|
|
84
|
+
<a href="#">
|
|
85
|
+
About us
|
|
86
|
+
</a>
|
|
87
|
+
</li>
|
|
88
|
+
<li>
|
|
89
|
+
<a href="#">
|
|
90
|
+
Contact
|
|
91
|
+
</a>
|
|
92
|
+
</li>
|
|
93
|
+
<li>
|
|
94
|
+
<a href="#">
|
|
95
|
+
Resources
|
|
96
|
+
</a>
|
|
97
|
+
</li>
|
|
98
|
+
</ul>
|
|
99
|
+
|
|
100
|
+
</nav>
|
|
101
|
+
</mx-nav>
|
|
102
|
+
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</header>
|
|
108
|
+
"
|
|
109
|
+
`;
|
|
110
|
+
|
|
111
|
+
exports[`Screen Reader Announcements 1`] = `
|
|
112
|
+
"<header class="mx-header mx-page mx-section--s">
|
|
113
|
+
<div class="mx-header__inner">
|
|
114
|
+
<div class="mx-header__brand">
|
|
115
|
+
<img alt="Mixtape" src="./mixtape-logo.png" width="120" height="">
|
|
116
|
+
|
|
117
|
+
</div>
|
|
118
|
+
<div class="mx-header__toggles">
|
|
119
|
+
<mx-global-toggle><button aria-controls="unique-0" class="mx-button mx-button--icon-only mx-icon mx-icon--menu">Open Menu</button></mx-global-toggle>
|
|
120
|
+
</div>
|
|
121
|
+
<div class="mx-header__main">
|
|
122
|
+
<div id="unique-0" class="mx-header__nav mx-header__collapse-toggle">
|
|
123
|
+
|
|
124
|
+
|
|
75
125
|
<mx-nav flyout="">
|
|
76
126
|
<nav class="mx-nav mx-nav--dropdown" aria-label="Primary navigation" id="header-story">
|
|
77
127
|
<ul class="mx-nav__level-1">
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
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>"`;
|
|
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,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;
|
|
@@ -24,8 +26,9 @@
|
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
.mx-header__collapse-toggle {
|
|
29
|
+
@add-mixin transition;
|
|
30
|
+
|
|
27
31
|
inline-size: 100%;
|
|
28
|
-
opacity: 1;
|
|
29
32
|
display: grid;
|
|
30
33
|
position: fixed;
|
|
31
34
|
z-index: var(--collapse-index, 2);
|