@nationalarchives/frontend 0.1.65 → 0.2.1
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/config/.eslintrc.js +1 -1
- package/config/.htmlvalidate.json +12 -5
- package/config/stylelint.config.js +1 -0
- package/nationalarchives/all.css +1 -1
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/all.mjs +0 -18
- package/nationalarchives/analytics.js +1 -1
- package/nationalarchives/analytics.js.map +1 -1
- package/nationalarchives/analytics.mjs +1 -1
- package/nationalarchives/components/_forms.scss +9 -0
- package/nationalarchives/components/_index.scss +2 -35
- package/nationalarchives/components/_presentation.scss +23 -0
- package/nationalarchives/components/accordion/accordion.css +1 -1
- package/nationalarchives/components/accordion/accordion.css.map +1 -1
- package/nationalarchives/components/accordion/accordion.js +1 -1
- package/nationalarchives/components/accordion/accordion.js.map +1 -1
- package/nationalarchives/components/accordion/accordion.mjs +1 -4
- package/nationalarchives/components/accordion/accordion.scss +4 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
- package/nationalarchives/components/button/button.css +1 -1
- package/nationalarchives/components/button/button.css.map +1 -1
- package/nationalarchives/components/button/button.scss +9 -9
- package/nationalarchives/components/card/card.css +1 -1
- package/nationalarchives/components/card/card.css.map +1 -1
- package/nationalarchives/components/card/card.scss +15 -0
- package/nationalarchives/components/card/fixtures.json +74 -26
- package/nationalarchives/components/card/macro-options.json +7 -7
- package/nationalarchives/components/card/template.njk +7 -4
- package/nationalarchives/components/checkboxes/checkboxes.css +1 -1
- package/nationalarchives/components/checkboxes/checkboxes.css.map +1 -1
- package/nationalarchives/components/checkboxes/checkboxes.njk +1 -1
- package/nationalarchives/components/checkboxes/checkboxes.scss +1 -1
- package/nationalarchives/components/checkboxes/macro-options.json +6 -0
- package/nationalarchives/components/compound-filters/compound-filters.css.map +1 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.js +1 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.js.map +1 -1
- package/nationalarchives/components/date-input/date-input.css +1 -1
- package/nationalarchives/components/date-input/date-input.css.map +1 -1
- package/nationalarchives/components/date-input/date-input.scss +2 -2
- package/nationalarchives/components/date-input/fixtures.json +5 -5
- package/nationalarchives/components/date-input/template.njk +1 -1
- package/nationalarchives/components/date-search/date-search.css +1 -1
- package/nationalarchives/components/date-search/date-search.css.map +1 -1
- package/nationalarchives/components/date-search/date-search.scss +2 -2
- package/nationalarchives/components/details/details.css.map +1 -1
- package/nationalarchives/components/details/template.njk +3 -1
- package/nationalarchives/components/error-summary/error-summary.css +1 -1
- package/nationalarchives/components/error-summary/error-summary.css.map +1 -1
- package/nationalarchives/components/error-summary/error-summary.js +1 -1
- package/nationalarchives/components/error-summary/error-summary.js.map +1 -1
- package/nationalarchives/components/error-summary/error-summary.mjs +1 -1
- package/nationalarchives/components/error-summary/error-summary.scss +3 -4
- package/nationalarchives/components/files-list/_index.scss +1 -0
- package/nationalarchives/components/files-list/files-list.css +1 -0
- package/nationalarchives/components/files-list/files-list.css.map +1 -0
- package/nationalarchives/components/{files/files.scss → files-list/files-list.scss} +2 -7
- package/nationalarchives/components/files-list/fixtures.json +74 -0
- package/nationalarchives/components/{files → files-list}/macro-options.json +6 -0
- package/nationalarchives/components/files-list/macro.njk +3 -0
- package/nationalarchives/components/files-list/template.njk +33 -0
- package/nationalarchives/components/footer/footer.css.map +1 -1
- package/nationalarchives/components/footer/footer.js +1 -1
- package/nationalarchives/components/footer/footer.js.map +1 -1
- package/nationalarchives/components/gallery/fixtures.json +1 -1
- package/nationalarchives/components/gallery/gallery.css +1 -1
- package/nationalarchives/components/gallery/gallery.css.map +1 -1
- package/nationalarchives/components/gallery/gallery.js +1 -1
- package/nationalarchives/components/gallery/gallery.js.map +1 -1
- package/nationalarchives/components/gallery/gallery.scss +36 -29
- package/nationalarchives/components/gallery/template.njk +10 -8
- package/nationalarchives/components/global-header/global-header.css.map +1 -1
- package/nationalarchives/components/global-header/global-header.js +1 -1
- package/nationalarchives/components/global-header/global-header.js.map +1 -1
- package/nationalarchives/components/header/header.css.map +1 -1
- package/nationalarchives/components/header/header.js +1 -1
- package/nationalarchives/components/header/header.js.map +1 -1
- package/nationalarchives/components/hero/hero.css +1 -1
- package/nationalarchives/components/hero/hero.css.map +1 -1
- package/nationalarchives/components/hero/hero.scss +0 -24
- package/nationalarchives/components/index-grid/index-grid.css +1 -1
- package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
- package/nationalarchives/components/index-grid/index-grid.scss +1 -1
- package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
- package/nationalarchives/components/picture/picture.css.map +1 -1
- package/nationalarchives/components/picture/picture.js +1 -1
- package/nationalarchives/components/picture/picture.js.map +1 -1
- package/nationalarchives/components/quick-filters/quick-filters.css +1 -1
- package/nationalarchives/components/quick-filters/quick-filters.css.map +1 -1
- package/nationalarchives/components/radios/radios.css +1 -1
- package/nationalarchives/components/radios/radios.css.map +1 -1
- package/nationalarchives/components/radios/radios.scss +1 -1
- package/nationalarchives/components/records-list/_index.scss +1 -0
- package/nationalarchives/components/records-list/fixtures.json +42 -0
- package/nationalarchives/components/records-list/macro.njk +3 -0
- package/nationalarchives/components/records-list/records-list.css +1 -0
- package/nationalarchives/components/records-list/records-list.css.map +1 -0
- package/nationalarchives/components/{featured-records/featured-records.scss → records-list/records-list.scss} +1 -1
- package/nationalarchives/components/records-list/template.njk +21 -0
- package/nationalarchives/components/search-field/search-field.css +1 -1
- package/nationalarchives/components/search-field/search-field.css.map +1 -1
- package/nationalarchives/components/search-field/search-field.scss +1 -1
- package/nationalarchives/components/select/select.css +1 -1
- package/nationalarchives/components/select/select.css.map +1 -1
- package/nationalarchives/components/select/select.scss +2 -2
- package/nationalarchives/components/sidebar/fixtures.json +12 -2
- package/nationalarchives/components/sidebar/sidebar.css +1 -1
- package/nationalarchives/components/sidebar/sidebar.css.map +1 -1
- package/nationalarchives/components/sidebar/template.njk +9 -0
- package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
- package/nationalarchives/components/skip-link/skip-link.js +1 -1
- package/nationalarchives/components/skip-link/skip-link.js.map +1 -1
- package/nationalarchives/components/tabs/tabs.css.map +1 -1
- package/nationalarchives/components/tabs/tabs.js +1 -1
- package/nationalarchives/components/tabs/tabs.js.map +1 -1
- package/nationalarchives/components/text-input/text-input.css +1 -1
- package/nationalarchives/components/text-input/text-input.css.map +1 -1
- package/nationalarchives/components/text-input/text-input.scss +2 -2
- package/nationalarchives/components/textarea/textarea.css +1 -1
- package/nationalarchives/components/textarea/textarea.css.map +1 -1
- package/nationalarchives/components/textarea/textarea.scss +2 -2
- package/nationalarchives/components/warning/warning.css +1 -1
- package/nationalarchives/components/warning/warning.css.map +1 -1
- package/nationalarchives/components/warning/warning.scss +1 -0
- package/nationalarchives/global-header-package.css +1 -1
- package/nationalarchives/global-header-package.css.map +1 -1
- package/nationalarchives/global-header-package.scss +1 -1
- package/nationalarchives/print.css +1 -1
- package/nationalarchives/print.css.map +1 -1
- package/nationalarchives/prototype-kit.css +1 -1
- package/nationalarchives/prototype-kit.css.map +1 -1
- package/nationalarchives/templates/fixtures.json +1 -1
- package/nationalarchives/tools/_colour.scss +28 -53
- package/nationalarchives/utilities/_columns.scss +1 -1
- package/nationalarchives/utilities/_index.scss +1 -0
- package/nationalarchives/utilities/_reset.scss +2 -8
- package/nationalarchives/utilities/{_colour.scss → colour/_index.scss} +2 -2
- package/nationalarchives/utilities/{_forms.scss → forms/_index.scss} +6 -6
- package/nationalarchives/{components/grid/grid.scss → utilities/grid/_index.scss} +6 -1
- package/nationalarchives/utilities/grid/macro.njk +3 -0
- package/nationalarchives/utilities/{_lists.scss → lists/_index.scss} +27 -9
- package/nationalarchives/utilities/{_overrides.scss → overrides/_index.scss} +2 -2
- package/nationalarchives/utilities/{_tables.scss → tables/_index.scss} +20 -8
- package/nationalarchives/utilities/{_typography.scss → typography/_index.scss} +30 -10
- package/nationalarchives/variables/_colour.scss +12 -5
- package/package.json +3 -3
- package/nationalarchives/components/accordion/accordion.stories.js +0 -432
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +0 -128
- package/nationalarchives/components/button/button-group.stories.js +0 -114
- package/nationalarchives/components/button/button.stories.js +0 -207
- package/nationalarchives/components/card/card.stories.js +0 -402
- package/nationalarchives/components/checkboxes/checkboxes.stories.js +0 -241
- package/nationalarchives/components/compound-filters/compound-filters.stories.js +0 -61
- package/nationalarchives/components/cookie-banner/cookie-banner.stories.js +0 -250
- package/nationalarchives/components/date-input/date-input.stories.js +0 -119
- package/nationalarchives/components/date-search/date-search.stories.js +0 -124
- package/nationalarchives/components/details/details.stories.js +0 -33
- package/nationalarchives/components/error-summary/error-summary.stories.js +0 -59
- package/nationalarchives/components/featured-records/_index.scss +0 -1
- package/nationalarchives/components/featured-records/featured-records.css +0 -1
- package/nationalarchives/components/featured-records/featured-records.css.map +0 -1
- package/nationalarchives/components/featured-records/featured-records.stories.js +0 -50
- package/nationalarchives/components/featured-records/fixtures.json +0 -42
- package/nationalarchives/components/featured-records/macro.njk +0 -3
- package/nationalarchives/components/featured-records/template.njk +0 -21
- package/nationalarchives/components/files/_index.scss +0 -1
- package/nationalarchives/components/files/files.css +0 -1
- package/nationalarchives/components/files/files.css.map +0 -1
- package/nationalarchives/components/files/files.stories.js +0 -59
- package/nationalarchives/components/files/fixtures.json +0 -71
- package/nationalarchives/components/files/macro.njk +0 -3
- package/nationalarchives/components/files/template.njk +0 -33
- package/nationalarchives/components/footer/footer.stories.js +0 -241
- package/nationalarchives/components/gallery/gallery.stories.js +0 -87
- package/nationalarchives/components/global-header/global-header.stories.js +0 -364
- package/nationalarchives/components/grid/_index.scss +0 -1
- package/nationalarchives/components/grid/grid.css +0 -1
- package/nationalarchives/components/grid/grid.css.map +0 -1
- package/nationalarchives/components/grid/grid.stories.js +0 -279
- package/nationalarchives/components/grid/macro.njk +0 -3
- package/nationalarchives/components/header/header.stories.js +0 -239
- package/nationalarchives/components/hero/hero.stories.js +0 -326
- package/nationalarchives/components/index-grid/index-grid.stories.js +0 -128
- package/nationalarchives/components/pagination/pagination.stories.js +0 -532
- package/nationalarchives/components/phase-banner/phase-banner.stories.js +0 -39
- package/nationalarchives/components/picture/picture.stories.js +0 -75
- package/nationalarchives/components/quick-filters/quick-filters.stories.js +0 -76
- package/nationalarchives/components/radios/radios.stories.js +0 -244
- package/nationalarchives/components/search-field/search-field.stories.js +0 -88
- package/nationalarchives/components/search-filters/_index.scss +0 -1
- package/nationalarchives/components/search-filters/fixtures.json +0 -16
- package/nationalarchives/components/search-filters/macro-options.json +0 -39
- package/nationalarchives/components/search-filters/macro.njk +0 -3
- package/nationalarchives/components/search-filters/search-filters.css +0 -1
- package/nationalarchives/components/search-filters/search-filters.css.map +0 -1
- package/nationalarchives/components/search-filters/search-filters.js +0 -2
- package/nationalarchives/components/search-filters/search-filters.js.map +0 -1
- package/nationalarchives/components/search-filters/search-filters.mjs +0 -67
- package/nationalarchives/components/search-filters/search-filters.scss +0 -198
- package/nationalarchives/components/search-filters/search-filters.stories.js +0 -207
- package/nationalarchives/components/search-filters/template.njk +0 -108
- package/nationalarchives/components/select/select.stories.js +0 -197
- package/nationalarchives/components/sensitive-image/_index.scss +0 -1
- package/nationalarchives/components/sensitive-image/fixtures.json +0 -51
- package/nationalarchives/components/sensitive-image/macro-options.json +0 -58
- package/nationalarchives/components/sensitive-image/macro.njk +0 -3
- package/nationalarchives/components/sensitive-image/sensitive-image.css +0 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.css.map +0 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.js +0 -2
- package/nationalarchives/components/sensitive-image/sensitive-image.js.map +0 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.mjs +0 -23
- package/nationalarchives/components/sensitive-image/sensitive-image.scss +0 -85
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +0 -86
- package/nationalarchives/components/sensitive-image/template.njk +0 -11
- package/nationalarchives/components/sidebar/sidebar.stories.js +0 -227
- package/nationalarchives/components/skip-link/skip-link.stories.js +0 -76
- package/nationalarchives/components/tabs/tabs.stories.js +0 -300
- package/nationalarchives/components/text-input/text-input.stories.js +0 -188
- package/nationalarchives/components/textarea/textarea.stories.js +0 -130
- package/nationalarchives/components/warning/warning.stories.js +0 -39
- package/nationalarchives/stories/intro.mdx +0 -13
- package/nationalarchives/stories/utilities/colour-schemes/colour-combinations.stories.js +0 -293
- package/nationalarchives/stories/utilities/colour-schemes/colour-themes.stories.js +0 -1513
- package/nationalarchives/stories/utilities/forms/forms.mdx +0 -117
- package/nationalarchives/stories/utilities/lists/lists.stories.js +0 -212
- package/nationalarchives/stories/utilities/overrides/overrides.stories.js +0 -42
- package/nationalarchives/stories/utilities/tables/tables.stories.js +0 -47
- package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +0 -94
- package/nationalarchives/stories/utilities/typography/headings.stories.js +0 -33
- package/nationalarchives/stories/utilities/typography/typography.stories.js +0 -91
- /package/nationalarchives/components/{featured-records → records-list}/macro-options.json +0 -0
- /package/nationalarchives/{components → utilities}/grid/fixtures.json +0 -0
- /package/nationalarchives/{components → utilities}/grid/macro-options.json +0 -0
- /package/nationalarchives/{components → utilities}/grid/template.njk +0 -0
@@ -1,114 +0,0 @@
|
|
1
|
-
import Button from "./template.njk";
|
2
|
-
|
3
|
-
export default {
|
4
|
-
title: "Components/Button group",
|
5
|
-
};
|
6
|
-
|
7
|
-
const Template = ({
|
8
|
-
text,
|
9
|
-
href,
|
10
|
-
title,
|
11
|
-
icon,
|
12
|
-
accent,
|
13
|
-
small,
|
14
|
-
plain,
|
15
|
-
iconOnly,
|
16
|
-
iconOnlyOnMobile,
|
17
|
-
rightAlignIcon,
|
18
|
-
buttonElement,
|
19
|
-
buttonType,
|
20
|
-
classes,
|
21
|
-
attributes,
|
22
|
-
}) =>
|
23
|
-
Button({
|
24
|
-
params: {
|
25
|
-
text,
|
26
|
-
href,
|
27
|
-
title,
|
28
|
-
icon,
|
29
|
-
accent,
|
30
|
-
small,
|
31
|
-
plain,
|
32
|
-
iconOnly,
|
33
|
-
iconOnlyOnMobile,
|
34
|
-
rightAlignIcon,
|
35
|
-
buttonElement,
|
36
|
-
buttonType,
|
37
|
-
classes,
|
38
|
-
attributes,
|
39
|
-
},
|
40
|
-
});
|
41
|
-
|
42
|
-
const GroupTemplate = ({ buttons }) =>
|
43
|
-
`<div class="tna-button-group">
|
44
|
-
${buttons.map((button) => Template(button)).join("")}
|
45
|
-
</div>`;
|
46
|
-
|
47
|
-
export const Group = GroupTemplate.bind({});
|
48
|
-
Group.args = {
|
49
|
-
buttons: [
|
50
|
-
{
|
51
|
-
text: "Standard",
|
52
|
-
href: "#",
|
53
|
-
classes: "tna-button--demo",
|
54
|
-
},
|
55
|
-
{
|
56
|
-
text: "Accent",
|
57
|
-
href: "#",
|
58
|
-
accent: true,
|
59
|
-
classes: "tna-button--demo",
|
60
|
-
},
|
61
|
-
{
|
62
|
-
text: "Icon",
|
63
|
-
href: "#",
|
64
|
-
icon: "phone",
|
65
|
-
classes: "tna-button--demo",
|
66
|
-
},
|
67
|
-
{
|
68
|
-
text: "Right Aligned Icon",
|
69
|
-
href: "#",
|
70
|
-
icon: "chevron-right",
|
71
|
-
rightAlignIcon: true,
|
72
|
-
classes: "tna-button--demo",
|
73
|
-
},
|
74
|
-
{
|
75
|
-
text: "Icon Only",
|
76
|
-
href: "#",
|
77
|
-
icon: "list",
|
78
|
-
iconOnly: true,
|
79
|
-
classes: "tna-button--demo",
|
80
|
-
},
|
81
|
-
{
|
82
|
-
text: "Icon Only On Mobile",
|
83
|
-
href: "#",
|
84
|
-
icon: "list",
|
85
|
-
iconOnlyOnMobile: true,
|
86
|
-
classes: "tna-button--demo",
|
87
|
-
},
|
88
|
-
{
|
89
|
-
text: "Plain",
|
90
|
-
plain: true,
|
91
|
-
classes: "tna-button--demo",
|
92
|
-
},
|
93
|
-
{
|
94
|
-
text: "Plain With Icon",
|
95
|
-
href: "#",
|
96
|
-
icon: "map-location-dot",
|
97
|
-
plain: true,
|
98
|
-
classes: "tna-button--demo",
|
99
|
-
},
|
100
|
-
{
|
101
|
-
text: "Button",
|
102
|
-
buttonElement: true,
|
103
|
-
classes: "tna-button--demo",
|
104
|
-
},
|
105
|
-
],
|
106
|
-
};
|
107
|
-
|
108
|
-
const SmallGroupTemplate = ({ buttons }) =>
|
109
|
-
`<div class="tna-button-group tna-button-group--small">
|
110
|
-
${buttons.map((button) => Template({ ...button, text: `Small ${button.text}` })).join("")}
|
111
|
-
</div>`;
|
112
|
-
|
113
|
-
export const SmallGroup = SmallGroupTemplate.bind({});
|
114
|
-
SmallGroup.args = Group.args;
|
@@ -1,207 +0,0 @@
|
|
1
|
-
import Button from "./template.njk";
|
2
|
-
import macroOptions from "./macro-options.json";
|
3
|
-
|
4
|
-
const argTypes = {
|
5
|
-
text: { control: "text" },
|
6
|
-
href: { control: "text" },
|
7
|
-
title: { control: "text" },
|
8
|
-
icon: { control: "text" },
|
9
|
-
iconSvg: { control: "text" },
|
10
|
-
accent: { control: "boolean" },
|
11
|
-
small: { control: "boolean" },
|
12
|
-
plain: { control: "boolean" },
|
13
|
-
iconOnly: { control: "boolean" },
|
14
|
-
iconOnlyOnMobile: { control: "boolean" },
|
15
|
-
rightAlignIcon: { control: "boolean" },
|
16
|
-
buttonElement: { control: "boolean" },
|
17
|
-
buttonType: { control: "text" },
|
18
|
-
classes: { control: "text" },
|
19
|
-
attributes: { control: "object" },
|
20
|
-
};
|
21
|
-
|
22
|
-
Object.keys(argTypes).forEach((argType) => {
|
23
|
-
argTypes[argType].description = macroOptions.find(
|
24
|
-
(option) => option.name === argType,
|
25
|
-
)?.description;
|
26
|
-
});
|
27
|
-
|
28
|
-
export default {
|
29
|
-
title: "Components/Button",
|
30
|
-
argTypes,
|
31
|
-
};
|
32
|
-
|
33
|
-
const Template = ({
|
34
|
-
text,
|
35
|
-
href,
|
36
|
-
title,
|
37
|
-
icon,
|
38
|
-
iconSvg,
|
39
|
-
accent,
|
40
|
-
small,
|
41
|
-
plain,
|
42
|
-
iconOnly,
|
43
|
-
iconOnlyOnMobile,
|
44
|
-
rightAlignIcon,
|
45
|
-
buttonElement,
|
46
|
-
buttonType,
|
47
|
-
classes,
|
48
|
-
attributes,
|
49
|
-
}) =>
|
50
|
-
Button({
|
51
|
-
params: {
|
52
|
-
text,
|
53
|
-
href,
|
54
|
-
title,
|
55
|
-
icon,
|
56
|
-
iconSvg,
|
57
|
-
accent,
|
58
|
-
small,
|
59
|
-
plain,
|
60
|
-
iconOnly,
|
61
|
-
iconOnlyOnMobile,
|
62
|
-
rightAlignIcon,
|
63
|
-
buttonElement,
|
64
|
-
buttonType,
|
65
|
-
classes,
|
66
|
-
attributes,
|
67
|
-
},
|
68
|
-
});
|
69
|
-
|
70
|
-
export const Standard = Template.bind({});
|
71
|
-
Standard.parameters = {
|
72
|
-
chromatic: { disableSnapshot: true },
|
73
|
-
};
|
74
|
-
Standard.args = {
|
75
|
-
text: "Button",
|
76
|
-
href: "#",
|
77
|
-
classes: "tna-button--demo",
|
78
|
-
};
|
79
|
-
|
80
|
-
export const Accent = Template.bind({});
|
81
|
-
Accent.parameters = {
|
82
|
-
chromatic: { disableSnapshot: true },
|
83
|
-
};
|
84
|
-
Accent.args = {
|
85
|
-
text: "Button",
|
86
|
-
href: "#",
|
87
|
-
accent: true,
|
88
|
-
classes: "tna-button--demo",
|
89
|
-
};
|
90
|
-
|
91
|
-
export const Icon = Template.bind({});
|
92
|
-
Icon.parameters = {
|
93
|
-
chromatic: { disableSnapshot: true },
|
94
|
-
};
|
95
|
-
Icon.args = {
|
96
|
-
text: "Explore the collection",
|
97
|
-
href: "#",
|
98
|
-
icon: "map-location-dot",
|
99
|
-
classes: "tna-button--demo",
|
100
|
-
};
|
101
|
-
|
102
|
-
export const RightAlignedIcon = Template.bind({});
|
103
|
-
RightAlignedIcon.parameters = {
|
104
|
-
chromatic: { disableSnapshot: true },
|
105
|
-
};
|
106
|
-
RightAlignedIcon.args = {
|
107
|
-
text: "Search",
|
108
|
-
href: "#",
|
109
|
-
icon: "chevron-right",
|
110
|
-
rightAlignIcon: true,
|
111
|
-
classes: "tna-button--demo",
|
112
|
-
};
|
113
|
-
|
114
|
-
export const IconOnly = Template.bind({});
|
115
|
-
IconOnly.parameters = {
|
116
|
-
chromatic: { disableSnapshot: true },
|
117
|
-
};
|
118
|
-
IconOnly.args = {
|
119
|
-
text: "Show as a list",
|
120
|
-
href: "#",
|
121
|
-
icon: "list",
|
122
|
-
iconOnly: true,
|
123
|
-
classes: "tna-button--demo",
|
124
|
-
};
|
125
|
-
|
126
|
-
export const Small = Template.bind({});
|
127
|
-
Small.parameters = {
|
128
|
-
chromatic: { disableSnapshot: true },
|
129
|
-
};
|
130
|
-
Small.args = {
|
131
|
-
text: "Small button",
|
132
|
-
href: "#",
|
133
|
-
small: true,
|
134
|
-
classes: "tna-button--demo",
|
135
|
-
};
|
136
|
-
|
137
|
-
export const SmallWithIcon = Template.bind({});
|
138
|
-
SmallWithIcon.parameters = {
|
139
|
-
chromatic: { disableSnapshot: true },
|
140
|
-
};
|
141
|
-
SmallWithIcon.args = {
|
142
|
-
text: "Explore the collection",
|
143
|
-
href: "#",
|
144
|
-
icon: "map-location-dot",
|
145
|
-
small: true,
|
146
|
-
classes: "tna-button--demo",
|
147
|
-
};
|
148
|
-
|
149
|
-
export const SmallIconOnly = Template.bind({});
|
150
|
-
SmallIconOnly.parameters = {
|
151
|
-
chromatic: { disableSnapshot: true },
|
152
|
-
};
|
153
|
-
SmallIconOnly.args = {
|
154
|
-
text: "Explore the collection",
|
155
|
-
href: "#",
|
156
|
-
icon: "map-location-dot",
|
157
|
-
small: true,
|
158
|
-
iconOnly: true,
|
159
|
-
classes: "tna-button--demo",
|
160
|
-
};
|
161
|
-
|
162
|
-
export const Plain = Template.bind({});
|
163
|
-
Plain.parameters = {
|
164
|
-
chromatic: { disableSnapshot: true },
|
165
|
-
};
|
166
|
-
Plain.args = {
|
167
|
-
text: "Plain button",
|
168
|
-
href: "#",
|
169
|
-
plain: true,
|
170
|
-
classes: "tna-button--demo",
|
171
|
-
};
|
172
|
-
|
173
|
-
export const SmallPlain = Template.bind({});
|
174
|
-
SmallPlain.parameters = {
|
175
|
-
chromatic: { disableSnapshot: true },
|
176
|
-
};
|
177
|
-
SmallPlain.args = {
|
178
|
-
text: "Plain small button",
|
179
|
-
href: "#",
|
180
|
-
small: true,
|
181
|
-
plain: true,
|
182
|
-
classes: "tna-button--demo",
|
183
|
-
};
|
184
|
-
|
185
|
-
export const SmallPlainIcon = Template.bind({});
|
186
|
-
SmallPlainIcon.parameters = {
|
187
|
-
chromatic: { disableSnapshot: true },
|
188
|
-
};
|
189
|
-
SmallPlainIcon.args = {
|
190
|
-
text: "Plain small button",
|
191
|
-
href: "#",
|
192
|
-
icon: "map-location-dot",
|
193
|
-
small: true,
|
194
|
-
plain: true,
|
195
|
-
classes: "tna-button--demo",
|
196
|
-
};
|
197
|
-
|
198
|
-
export const ButtonElement = Template.bind({});
|
199
|
-
ButtonElement.parameters = {
|
200
|
-
chromatic: { disableSnapshot: true },
|
201
|
-
};
|
202
|
-
ButtonElement.args = {
|
203
|
-
text: "Button element",
|
204
|
-
href: "#",
|
205
|
-
buttonElement: true,
|
206
|
-
classes: "tna-button--demo",
|
207
|
-
};
|
@@ -1,402 +0,0 @@
|
|
1
|
-
import Card from "./template.njk";
|
2
|
-
import macroOptions from "./macro-options.json";
|
3
|
-
import { customViewports } from "../../../../.storybook/viewports";
|
4
|
-
|
5
|
-
const argTypes = {
|
6
|
-
supertitle: { control: "text" },
|
7
|
-
title: { control: "text" },
|
8
|
-
headingLevel: { control: { type: "number", min: 1, max: 6 } },
|
9
|
-
headingSize: { control: "inline-radio", options: ["s", "m", "l"] },
|
10
|
-
href: { control: "text" },
|
11
|
-
hrefClasses: { control: "text" },
|
12
|
-
hrefAttributes: { control: "object" },
|
13
|
-
imageSrc: { control: { type: "file", accept: ".jpg" } },
|
14
|
-
imageAlt: { control: "text" },
|
15
|
-
imageWidth: { control: { type: "number", min: 1 } },
|
16
|
-
imageHeight: { control: { type: "number", min: 1 } },
|
17
|
-
imageType: { control: "text" },
|
18
|
-
imageSources: { control: "object" },
|
19
|
-
lazyImage: { control: "boolean" },
|
20
|
-
label: { control: "text" },
|
21
|
-
labelColour: {
|
22
|
-
control: "inline-radio",
|
23
|
-
options: ["accent", "black", "pink", "orange", "yellow", "green", "blue"],
|
24
|
-
},
|
25
|
-
meta: { control: "object" },
|
26
|
-
body: { control: "text" },
|
27
|
-
text: { control: "text" },
|
28
|
-
actions: { control: "object" },
|
29
|
-
horizontal: { control: "boolean" },
|
30
|
-
style: {
|
31
|
-
control: "inline-radio",
|
32
|
-
options: ["none", "contrast", "tint", "accent"],
|
33
|
-
},
|
34
|
-
plainSupertitle: { control: "boolean" },
|
35
|
-
htmlElement: { control: "text" },
|
36
|
-
classes: { control: "text" },
|
37
|
-
attributes: { control: "object" },
|
38
|
-
};
|
39
|
-
|
40
|
-
Object.keys(argTypes).forEach((argType) => {
|
41
|
-
const macroOption = macroOptions.find((option) => option.name === argType);
|
42
|
-
argTypes[argType] = {
|
43
|
-
...argTypes[argType],
|
44
|
-
description: macroOption?.description,
|
45
|
-
};
|
46
|
-
});
|
47
|
-
|
48
|
-
export default {
|
49
|
-
title: "Components/Card",
|
50
|
-
argTypes,
|
51
|
-
};
|
52
|
-
|
53
|
-
const Template = ({
|
54
|
-
supertitle,
|
55
|
-
title,
|
56
|
-
headingLevel,
|
57
|
-
headingSize,
|
58
|
-
href,
|
59
|
-
hrefClasses,
|
60
|
-
hrefAttributes,
|
61
|
-
imageSrc,
|
62
|
-
imageAlt,
|
63
|
-
imageWidth,
|
64
|
-
imageHeight,
|
65
|
-
imageType,
|
66
|
-
imageSources,
|
67
|
-
lazyImage,
|
68
|
-
label,
|
69
|
-
labelColour,
|
70
|
-
meta,
|
71
|
-
body,
|
72
|
-
text,
|
73
|
-
actions,
|
74
|
-
horizontal,
|
75
|
-
style,
|
76
|
-
plainSupertitle,
|
77
|
-
htmlElement,
|
78
|
-
classes,
|
79
|
-
attributes,
|
80
|
-
}) =>
|
81
|
-
Card({
|
82
|
-
params: {
|
83
|
-
supertitle,
|
84
|
-
title,
|
85
|
-
headingLevel,
|
86
|
-
headingSize,
|
87
|
-
href,
|
88
|
-
hrefClasses,
|
89
|
-
hrefAttributes,
|
90
|
-
imageSrc,
|
91
|
-
imageAlt,
|
92
|
-
imageWidth,
|
93
|
-
imageHeight,
|
94
|
-
imageType,
|
95
|
-
imageSources,
|
96
|
-
lazyImage,
|
97
|
-
label,
|
98
|
-
labelColour,
|
99
|
-
meta,
|
100
|
-
body,
|
101
|
-
text,
|
102
|
-
actions,
|
103
|
-
horizontal,
|
104
|
-
style,
|
105
|
-
plainSupertitle,
|
106
|
-
htmlElement,
|
107
|
-
classes,
|
108
|
-
attributes,
|
109
|
-
},
|
110
|
-
});
|
111
|
-
|
112
|
-
export const Standard = Template.bind({});
|
113
|
-
Standard.args = {
|
114
|
-
supertitle: "Card supertitle",
|
115
|
-
title: "Card title",
|
116
|
-
headingLevel: 3,
|
117
|
-
headingSize: "m",
|
118
|
-
href: "#",
|
119
|
-
imageSrc:
|
120
|
-
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
121
|
-
imageAlt: "The National Archives office",
|
122
|
-
imageWidth: 499,
|
123
|
-
imageHeight: 333,
|
124
|
-
label: "New",
|
125
|
-
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
126
|
-
htmlElement: "article",
|
127
|
-
classes: "tna-card--demo",
|
128
|
-
};
|
129
|
-
|
130
|
-
export const Simple = Template.bind({});
|
131
|
-
Simple.args = {
|
132
|
-
title: "Card title",
|
133
|
-
headingLevel: 3,
|
134
|
-
headingSize: "m",
|
135
|
-
imageSrc:
|
136
|
-
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
137
|
-
imageAlt: "The National Archives office",
|
138
|
-
imageWidth: 499,
|
139
|
-
imageHeight: 333,
|
140
|
-
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
141
|
-
htmlElement: "article",
|
142
|
-
classes: "tna-card--demo",
|
143
|
-
};
|
144
|
-
|
145
|
-
export const Meta = Template.bind({});
|
146
|
-
Meta.args = {
|
147
|
-
supertitle: "Card supertitle",
|
148
|
-
title: "Card title",
|
149
|
-
headingLevel: 3,
|
150
|
-
headingSize: "m",
|
151
|
-
href: "#",
|
152
|
-
imageSrc:
|
153
|
-
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
154
|
-
imageAlt: "The National Archives office",
|
155
|
-
imageWidth: 499,
|
156
|
-
imageHeight: 333,
|
157
|
-
label: "New",
|
158
|
-
labelColour: "green",
|
159
|
-
meta: [
|
160
|
-
{ title: "Event date", text: "24th September 2023", icon: "calendar" },
|
161
|
-
{ title: "Cost", text: "From £16", icon: "ticket" },
|
162
|
-
{ title: "Location", text: "Online", icon: "location-dot" },
|
163
|
-
],
|
164
|
-
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
165
|
-
htmlElement: "article",
|
166
|
-
classes: "tna-card--demo",
|
167
|
-
};
|
168
|
-
|
169
|
-
export const PlainSupertitle = Template.bind({});
|
170
|
-
PlainSupertitle.args = {
|
171
|
-
supertitle: "Card supertitle",
|
172
|
-
title: "Card title",
|
173
|
-
headingLevel: 3,
|
174
|
-
headingSize: "m",
|
175
|
-
href: "#",
|
176
|
-
imageSrc:
|
177
|
-
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
178
|
-
imageAlt: "The National Archives office",
|
179
|
-
imageWidth: 499,
|
180
|
-
imageHeight: 333,
|
181
|
-
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
182
|
-
htmlElement: "article",
|
183
|
-
plainSupertitle: true,
|
184
|
-
classes: "tna-card--demo",
|
185
|
-
};
|
186
|
-
|
187
|
-
export const Contrast = Template.bind({});
|
188
|
-
Contrast.args = {
|
189
|
-
supertitle: "Card supertitle",
|
190
|
-
title: "Card title",
|
191
|
-
headingLevel: 3,
|
192
|
-
headingSize: "m",
|
193
|
-
href: "#",
|
194
|
-
imageSrc:
|
195
|
-
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
196
|
-
imageAlt: "The National Archives office",
|
197
|
-
imageWidth: 499,
|
198
|
-
imageHeight: 333,
|
199
|
-
label: "New",
|
200
|
-
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
201
|
-
style: "contrast",
|
202
|
-
htmlElement: "article",
|
203
|
-
classes: "tna-card--demo",
|
204
|
-
};
|
205
|
-
|
206
|
-
export const Accent = Template.bind({});
|
207
|
-
Accent.args = {
|
208
|
-
supertitle: "Card supertitle",
|
209
|
-
title: "Card title",
|
210
|
-
headingLevel: 3,
|
211
|
-
headingSize: "m",
|
212
|
-
href: "#",
|
213
|
-
imageSrc:
|
214
|
-
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
215
|
-
imageAlt: "The National Archives office",
|
216
|
-
imageWidth: 499,
|
217
|
-
imageHeight: 333,
|
218
|
-
label: "New",
|
219
|
-
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
220
|
-
style: "accent",
|
221
|
-
htmlElement: "article",
|
222
|
-
classes: "tna-card--demo",
|
223
|
-
};
|
224
|
-
|
225
|
-
export const NoImage = Template.bind({});
|
226
|
-
NoImage.args = {
|
227
|
-
title: "Card title",
|
228
|
-
headingLevel: 3,
|
229
|
-
headingSize: "m",
|
230
|
-
href: "#",
|
231
|
-
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
232
|
-
htmlElement: "article",
|
233
|
-
classes: "tna-card--demo",
|
234
|
-
};
|
235
|
-
|
236
|
-
export const Actions = Template.bind({});
|
237
|
-
Actions.args = {
|
238
|
-
title: "Card title",
|
239
|
-
headingLevel: 3,
|
240
|
-
headingSize: "m",
|
241
|
-
imageSrc:
|
242
|
-
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
243
|
-
imageAlt: "The National Archives office",
|
244
|
-
imageWidth: 499,
|
245
|
-
imageHeight: 333,
|
246
|
-
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
247
|
-
actions: [
|
248
|
-
{
|
249
|
-
text: "Card action 1",
|
250
|
-
href: "#",
|
251
|
-
},
|
252
|
-
{
|
253
|
-
text: "Card action 2",
|
254
|
-
href: "#",
|
255
|
-
title: "Go and do the action",
|
256
|
-
},
|
257
|
-
],
|
258
|
-
htmlElement: "article",
|
259
|
-
classes: "tna-card--demo",
|
260
|
-
};
|
261
|
-
|
262
|
-
export const Horizontal = Template.bind({});
|
263
|
-
Horizontal.args = {
|
264
|
-
supertitle: "Card supertitle",
|
265
|
-
title: "Card title",
|
266
|
-
href: "#",
|
267
|
-
headingLevel: 3,
|
268
|
-
headingSize: "l",
|
269
|
-
imageSrc:
|
270
|
-
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
271
|
-
imageAlt: "The National Archives office",
|
272
|
-
imageWidth: 499,
|
273
|
-
imageHeight: 333,
|
274
|
-
label: "New",
|
275
|
-
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
276
|
-
horizontal: true,
|
277
|
-
htmlElement: "article",
|
278
|
-
classes: "tna-card--demo",
|
279
|
-
};
|
280
|
-
|
281
|
-
export const HorizontalContrast = Template.bind({});
|
282
|
-
HorizontalContrast.args = {
|
283
|
-
supertitle: "Card supertitle",
|
284
|
-
title: "Card title",
|
285
|
-
href: "#",
|
286
|
-
headingLevel: 3,
|
287
|
-
headingSize: "l",
|
288
|
-
imageSrc:
|
289
|
-
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
290
|
-
imageAlt: "The National Archives office",
|
291
|
-
imageWidth: 499,
|
292
|
-
imageHeight: 333,
|
293
|
-
label: "New",
|
294
|
-
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
295
|
-
horizontal: true,
|
296
|
-
style: "contrast",
|
297
|
-
htmlElement: "article",
|
298
|
-
classes: "tna-card--demo",
|
299
|
-
};
|
300
|
-
|
301
|
-
export const HorizontalAccent = Template.bind({});
|
302
|
-
HorizontalAccent.args = {
|
303
|
-
supertitle: "Card supertitle",
|
304
|
-
title: "Card title",
|
305
|
-
href: "#",
|
306
|
-
headingLevel: 3,
|
307
|
-
headingSize: "l",
|
308
|
-
imageSrc:
|
309
|
-
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
310
|
-
imageAlt: "The National Archives office",
|
311
|
-
imageWidth: 499,
|
312
|
-
imageHeight: 333,
|
313
|
-
label: "New",
|
314
|
-
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
315
|
-
horizontal: true,
|
316
|
-
style: "accent",
|
317
|
-
htmlElement: "article",
|
318
|
-
classes: "tna-card--demo",
|
319
|
-
};
|
320
|
-
|
321
|
-
export const HorizontalMinimal = Template.bind({});
|
322
|
-
HorizontalMinimal.args = {
|
323
|
-
title: "Card title",
|
324
|
-
headingLevel: 3,
|
325
|
-
headingSize: "l",
|
326
|
-
imageSrc:
|
327
|
-
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
328
|
-
imageAlt: "The National Archives office",
|
329
|
-
imageWidth: 499,
|
330
|
-
imageHeight: 333,
|
331
|
-
horizontal: true,
|
332
|
-
htmlElement: "article",
|
333
|
-
classes: "tna-card--demo",
|
334
|
-
};
|
335
|
-
|
336
|
-
export const HorizontalMobile = Template.bind({});
|
337
|
-
HorizontalMobile.parameters = {
|
338
|
-
viewport: {
|
339
|
-
defaultViewport: "small",
|
340
|
-
},
|
341
|
-
chromatic: {
|
342
|
-
viewports: [customViewports["small"].styles.width.replace(/px$/, "")],
|
343
|
-
},
|
344
|
-
};
|
345
|
-
HorizontalMobile.args = {
|
346
|
-
title: "Card title",
|
347
|
-
headingLevel: 3,
|
348
|
-
headingSize: "l",
|
349
|
-
imageSrc:
|
350
|
-
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
351
|
-
imageAlt: "The National Archives office",
|
352
|
-
imageWidth: 499,
|
353
|
-
imageHeight: 333,
|
354
|
-
horizontal: true,
|
355
|
-
htmlElement: "article",
|
356
|
-
classes: "tna-card--demo",
|
357
|
-
};
|
358
|
-
|
359
|
-
export const HorizontalContrastMobile = Template.bind({});
|
360
|
-
HorizontalContrastMobile.parameters = {
|
361
|
-
viewport: {
|
362
|
-
defaultViewport: "small",
|
363
|
-
},
|
364
|
-
chromatic: {
|
365
|
-
viewports: [customViewports["small"].styles.width.replace(/px$/, "")],
|
366
|
-
},
|
367
|
-
};
|
368
|
-
HorizontalContrastMobile.args = {
|
369
|
-
title: "Card title",
|
370
|
-
headingLevel: 3,
|
371
|
-
headingSize: "l",
|
372
|
-
imageSrc:
|
373
|
-
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
374
|
-
imageAlt: "The National Archives office",
|
375
|
-
imageWidth: 499,
|
376
|
-
imageHeight: 333,
|
377
|
-
horizontal: true,
|
378
|
-
style: "contrast",
|
379
|
-
htmlElement: "article",
|
380
|
-
classes: "tna-card--demo",
|
381
|
-
};
|
382
|
-
|
383
|
-
export const Sources = Template.bind({});
|
384
|
-
Sources.args = {
|
385
|
-
supertitle: "Card supertitle",
|
386
|
-
title: "Card title",
|
387
|
-
headingLevel: 3,
|
388
|
-
headingSize: "m",
|
389
|
-
imageSrc: "https://www.gstatic.com/webp/gallery/2.jpg",
|
390
|
-
imageAlt: "A man in a canoe paddling through white water",
|
391
|
-
imageWidth: 550,
|
392
|
-
imageHeight: 404,
|
393
|
-
imageSources: [
|
394
|
-
{
|
395
|
-
src: "https://www.gstatic.com/webp/gallery/2.webp",
|
396
|
-
type: "image/webp",
|
397
|
-
},
|
398
|
-
],
|
399
|
-
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
400
|
-
htmlElement: "article",
|
401
|
-
classes: "tna-card--demo",
|
402
|
-
};
|