@nypl/design-system-react-components 0.25.8 → 0.25.9
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/CHANGELOG.md +45 -1
- package/README.md +1 -1
- package/dist/components/Button/Button.d.ts +6 -6
- package/dist/components/Button/ButtonTypes.d.ts +0 -1
- package/dist/components/Card/Card.d.ts +6 -4
- package/dist/components/Checkbox/Checkbox.d.ts +3 -2
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +3 -2
- package/dist/components/ComponentWrapper/ComponentWrapper.d.ts +8 -2
- package/dist/components/DatePicker/DatePicker.d.ts +3 -2
- package/dist/components/Form/Form.d.ts +2 -2
- package/dist/components/Heading/Heading.d.ts +7 -3
- package/dist/components/Heading/HeadingTypes.d.ts +6 -6
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +5 -2
- package/dist/components/HorizontalRule/HorizontalRule.d.ts +2 -2
- package/dist/components/Icons/Icon.d.ts +4 -4
- package/dist/components/Icons/IconSvgs.d.ts +0 -21
- package/dist/components/Icons/IconTypes.d.ts +0 -23
- package/dist/components/Image/Image.d.ts +11 -3
- package/dist/components/Logo/Logo.d.ts +28 -0
- package/dist/components/Logo/LogoSvgs.d.ts +18 -0
- package/dist/components/Logo/LogoTypes.d.ts +30 -0
- package/dist/components/Modal/Modal.d.ts +0 -4
- package/dist/components/Notification/Notification.d.ts +2 -2
- package/dist/components/Placeholder/Placeholder.d.ts +3 -5
- package/dist/components/Radio/Radio.d.ts +6 -5
- package/dist/components/RadioGroup/RadioGroup.d.ts +3 -2
- package/dist/components/SearchBar/SearchBar.d.ts +10 -2
- package/dist/components/Select/Select.d.ts +3 -2
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +8 -4
- package/dist/components/Slider/Slider.d.ts +3 -2
- package/dist/components/StatusBadge/StatusBadge.d.ts +2 -1
- package/dist/components/StructuredContent/StructuredContent.d.ts +41 -0
- package/dist/components/StructuredContent/StructuredContentTypes.d.ts +5 -0
- package/dist/components/Table/Table.d.ts +23 -0
- package/dist/components/Template/Template.d.ts +8 -3
- package/dist/components/Text/Text.d.ts +2 -2
- package/dist/components/TextInput/TextInput.d.ts +4 -3
- package/dist/components/Toggle/Toggle.d.ts +3 -2
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +14 -5
- package/dist/design-system-react-components.cjs.development.js +5630 -5692
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +4304 -4362
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/styles.css +2 -2
- package/dist/theme/components/button.d.ts +0 -12
- package/dist/theme/components/card.d.ts +14 -2
- package/dist/theme/components/customTable.d.ts +47 -0
- package/dist/theme/components/fieldset.d.ts +2 -2
- package/dist/theme/components/global.d.ts +1 -1
- package/dist/theme/components/heading.d.ts +4 -0
- package/dist/theme/components/label.d.ts +1 -1
- package/dist/theme/components/link.d.ts +14 -1
- package/dist/theme/components/list.d.ts +0 -2
- package/dist/theme/components/logo.d.ts +4 -0
- package/dist/theme/components/searchBar.d.ts +7 -13
- package/dist/theme/components/select.d.ts +1 -0
- package/dist/theme/components/structuredContent.d.ts +33 -0
- package/dist/theme/components/template.d.ts +10 -10
- package/dist/theme/components/textInput.d.ts +2 -0
- package/dist/theme/components/toggle.d.ts +8 -5
- package/dist/utils/utils.d.ts +10 -0
- package/package.json +1 -2
- package/src/__tests__/utils/utils.test.ts +23 -1
- package/src/components/Accordion/Accordion.stories.mdx +14 -12
- package/src/components/Autosuggest/Autosuggest.stories.mdx +2 -1
- package/src/components/Autosuggest/Autosuggest.stories.tsx +24 -48
- package/src/components/Autosuggest/_Autosuggest.scss +2 -6
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +30 -11
- package/src/components/Button/Button.stories.mdx +93 -48
- package/src/components/Button/Button.test.tsx +0 -12
- package/src/components/Button/Button.tsx +7 -7
- package/src/components/Button/ButtonTypes.tsx +0 -1
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +0 -12
- package/src/components/Card/Card.stories.mdx +186 -71
- package/src/components/Card/Card.test.tsx +45 -22
- package/src/components/Card/Card.tsx +17 -5
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +8 -2
- package/src/components/Chakra/Box.stories.mdx +3 -3
- package/src/components/Chakra/Center.stories.mdx +5 -5
- package/src/components/Chakra/Grid.stories.mdx +3 -3
- package/src/components/Chakra/Stack.stories.mdx +2 -2
- package/src/components/Checkbox/Checkbox.stories.mdx +37 -15
- package/src/components/Checkbox/Checkbox.tsx +13 -8
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +48 -16
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +14 -10
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +6 -3
- package/src/components/ComponentWrapper/ComponentWrapper.test.tsx +151 -0
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +36 -23
- package/src/components/ComponentWrapper/__snapshots__/ComponentWrapper.test.tsx.snap +85 -0
- package/src/components/DatePicker/DatePicker.stories.mdx +63 -18
- package/src/components/DatePicker/DatePicker.tsx +10 -6
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +36 -18
- package/src/components/Fieldset/Fieldset.stories.mdx +19 -8
- package/src/components/Form/Form.stories.mdx +49 -41
- package/src/components/Form/Form.tsx +5 -4
- package/src/components/Grid/SimpleGrid.stories.mdx +26 -26
- package/src/components/Heading/Heading.stories.mdx +59 -23
- package/src/components/Heading/Heading.test.tsx +82 -18
- package/src/components/Heading/Heading.tsx +31 -31
- package/src/components/Heading/HeadingTypes.tsx +6 -6
- package/src/components/Heading/__snapshots__/Heading.test.tsx.snap +71 -0
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +55 -27
- package/src/components/HelperErrorText/HelperErrorText.test.tsx +42 -15
- package/src/components/HelperErrorText/HelperErrorText.tsx +24 -24
- package/src/components/HelperErrorText/__snapshots__/HelperErrorText.test.tsx.snap +41 -4
- package/src/components/Hero/Hero.stories.mdx +72 -53
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +9 -8
- package/src/components/HorizontalRule/HorizontalRule.tsx +2 -4
- package/src/components/Icons/Icon.stories.mdx +77 -76
- package/src/components/Icons/Icon.tsx +4 -5
- package/src/components/Icons/IconSvgs.tsx +0 -42
- package/src/components/Icons/IconTypes.tsx +0 -24
- package/src/components/Image/Image.stories.mdx +66 -18
- package/src/components/Image/Image.tsx +21 -10
- package/src/components/Label/Label.stories.mdx +20 -19
- package/src/components/Link/Link.stories.mdx +102 -51
- package/src/components/Link/Link.test.tsx +38 -8
- package/src/components/Link/Link.tsx +19 -12
- package/src/components/Link/__snapshots__/Link.test.tsx.snap +60 -0
- package/src/components/List/List.stories.mdx +36 -24
- package/src/components/Logo/Logo.stories.mdx +220 -0
- package/src/components/Logo/Logo.test.tsx +98 -0
- package/src/components/Logo/Logo.tsx +97 -0
- package/src/components/Logo/LogoSvgs.tsx +34 -0
- package/src/components/Logo/LogoTypes.tsx +32 -0
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +71 -0
- package/src/components/Modal/Modal.stories.mdx +20 -5
- package/src/components/Modal/Modal.tsx +2 -8
- package/src/components/Notification/Notification.stories.mdx +61 -38
- package/src/components/Notification/Notification.tsx +9 -4
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +4 -0
- package/src/components/Pagination/Pagination.stories.mdx +17 -6
- package/src/components/Pagination/Pagination.tsx +1 -1
- package/src/components/Placeholder/Placeholder.tsx +7 -14
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +72 -43
- package/src/components/Radio/Radio.stories.mdx +39 -19
- package/src/components/Radio/Radio.tsx +13 -9
- package/src/components/RadioGroup/RadioGroup.stories.mdx +50 -16
- package/src/components/RadioGroup/RadioGroup.tsx +15 -11
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +6 -3
- package/src/components/SearchBar/SearchBar.Test.tsx +58 -10
- package/src/components/SearchBar/SearchBar.stories.mdx +109 -30
- package/src/components/SearchBar/SearchBar.tsx +53 -32
- package/src/components/Select/Select.stories.mdx +48 -14
- package/src/components/Select/Select.tsx +16 -10
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +50 -16
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +8 -4
- package/src/components/Slider/Slider.stories.mdx +72 -22
- package/src/components/Slider/Slider.tsx +15 -10
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +60 -30
- package/src/components/StatusBadge/StatusBadge.stories.mdx +33 -18
- package/src/components/StatusBadge/StatusBadge.tsx +2 -1
- package/src/components/StructuredContent/StructuredContent.stories.mdx +427 -0
- package/src/components/StructuredContent/StructuredContent.test.tsx +376 -0
- package/src/components/StructuredContent/StructuredContent.tsx +153 -0
- package/src/components/StructuredContent/StructuredContentTypes.tsx +5 -0
- package/src/components/StructuredContent/__snapshots__/StructuredContent.test.tsx.snap +283 -0
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +32 -83
- package/src/components/StyleGuide/Breakpoints.stories.mdx +1 -11
- package/src/components/StyleGuide/Buttons.stories.mdx +3 -18
- package/src/components/StyleGuide/ColorCard.tsx +1 -2
- package/src/components/StyleGuide/Colors.stories.mdx +3 -11
- package/src/components/StyleGuide/DesignTokens.stories.mdx +3 -8
- package/src/components/StyleGuide/Forms.stories.mdx +2 -10
- package/src/components/StyleGuide/Iconography.stories.mdx +8 -34
- package/src/components/StyleGuide/Spacing.stories.mdx +3 -14
- package/src/components/StyleGuide/Typography.stories.mdx +64 -76
- package/src/components/Table/Table.stories.mdx +66 -0
- package/src/components/Table/Table.test.tsx +60 -0
- package/src/components/Table/Table.tsx +116 -0
- package/src/components/Tabs/Tabs.stories.mdx +19 -13
- package/src/components/Tabs/Tabs.test.tsx +1 -1
- package/src/components/Template/Template.stories.mdx +56 -47
- package/src/components/Template/Template.test.tsx +65 -5
- package/src/components/Template/Template.tsx +35 -5
- package/src/components/Template/__snapshots__/Template.test.tsx.snap +76 -0
- package/src/components/Text/Text.stories.mdx +33 -11
- package/src/components/Text/Text.tsx +2 -2
- package/src/components/TextInput/TextInput.stories.mdx +84 -17
- package/src/components/TextInput/TextInput.test.tsx +96 -0
- package/src/components/TextInput/TextInput.tsx +12 -8
- package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +240 -0
- package/src/components/Toggle/Toggle.stories.mdx +33 -9
- package/src/components/Toggle/Toggle.tsx +14 -9
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +64 -14
- package/src/components/VideoPlayer/VideoPlayer.tsx +17 -7
- package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +12 -6
- package/src/docs/Chakra.stories.mdx +5 -8
- package/src/docs/Intro.stories.mdx +2 -2
- package/src/index.ts +5 -4
- package/src/styles/base/_03-base.scss +1 -1
- package/src/styles/base/_place-holder.scss +7 -7
- package/src/styles.scss +1 -5
- package/src/theme/components/breadcrumb.ts +3 -3
- package/src/theme/components/button.ts +5 -12
- package/src/theme/components/card.ts +5 -2
- package/src/theme/components/checkbox.ts +1 -1
- package/src/theme/components/customTable.ts +50 -0
- package/src/theme/components/datePicker.ts +1 -1
- package/src/theme/components/global.ts +6 -6
- package/src/theme/components/heading.ts +13 -11
- package/src/theme/components/helperErrorText.ts +1 -1
- package/src/theme/components/image.ts +1 -1
- package/src/theme/components/link.ts +17 -5
- package/src/theme/components/list.ts +1 -3
- package/src/theme/components/logo.ts +54 -0
- package/src/theme/components/notification.ts +1 -1
- package/src/theme/components/searchBar.ts +7 -13
- package/src/theme/components/select.ts +1 -0
- package/src/theme/components/statusBadge.ts +1 -1
- package/src/theme/components/structuredContent.ts +54 -0
- package/src/theme/components/template.ts +10 -10
- package/src/theme/components/text.ts +6 -6
- package/src/theme/components/textInput.ts +1 -0
- package/src/theme/components/toggle.ts +9 -5
- package/src/theme/components/videoPlayer.ts +0 -2
- package/src/theme/foundations/global.ts +2 -2
- package/src/theme/foundations/typography.ts +84 -12
- package/src/theme/index.ts +6 -0
- package/src/utils/componentCategories.ts +1 -1
- package/src/utils/utils.ts +17 -0
- package/dist/__tests__/utils/bem.test.d.ts +0 -1
- package/dist/components/CardEdition/CardEdition.d.ts +0 -21
- package/dist/components/CardEdition/CardEdition.stories.d.ts +0 -27
- package/dist/components/Input/Input.d.ts +0 -36
- package/dist/components/Input/Input.stories.d.ts +0 -29
- package/dist/components/Input/InputTypes.d.ts +0 -6
- package/dist/components/StyleGuide/UIDocCard.d.ts +0 -11
- package/dist/helpers/CSSVariablesHelper.d.ts +0 -3
- package/dist/helpers/getCSSVariable.d.ts +0 -1
- package/dist/interfaces.d.ts +0 -3
- package/dist/utils/bem.d.ts +0 -1
- package/src/__tests__/utils/bem.test.ts +0 -37
- package/src/components/CardEdition/CardEdition.stories.tsx +0 -122
- package/src/components/CardEdition/CardEdition.test.tsx +0 -395
- package/src/components/CardEdition/CardEdition.tsx +0 -60
- package/src/components/CardEdition/_CardEdition.scss +0 -137
- package/src/components/Input/Input.stories.tsx +0 -133
- package/src/components/Input/Input.test.tsx +0 -266
- package/src/components/Input/Input.tsx +0 -81
- package/src/components/Input/InputTypes.tsx +0 -8
- package/src/components/Input/_Input.scss +0 -78
- package/src/components/StyleGuide/UIDocCard.tsx +0 -36
- package/src/helpers/CSSVariablesHelper.tsx +0 -34
- package/src/helpers/getCSSVariable.tsx +0 -5
- package/src/interfaces.ts +0 -3
- package/src/utils/bem.ts +0 -44
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
interface CardEditionProps {
|
|
3
|
-
/** ClassName that appears in addition to "card" */
|
|
4
|
-
className?: string;
|
|
5
|
-
/** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
|
|
6
|
-
blockName?: string;
|
|
7
|
-
/** Calls to Action for the card, such as "download" on a card for a book */
|
|
8
|
-
ctas?: React.ReactNode;
|
|
9
|
-
/** Footer that appears within the card but below the three columns within it */
|
|
10
|
-
footer?: React.ReactNode;
|
|
11
|
-
/** Heading that appears within the card but above the three columns within it */
|
|
12
|
-
heading?: React.ReactNode;
|
|
13
|
-
/** ID that other components can cross reference for accessibility purposes */
|
|
14
|
-
id?: string;
|
|
15
|
-
/** First column within the card */
|
|
16
|
-
image?: React.ReactNode;
|
|
17
|
-
/** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
|
|
18
|
-
modifiers?: string[];
|
|
19
|
-
}
|
|
20
|
-
export default function CardEdition(props: React.PropsWithChildren<CardEditionProps>): JSX.Element;
|
|
21
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import CardEdition from "./CardEdition";
|
|
3
|
-
declare const _default: {
|
|
4
|
-
title: any;
|
|
5
|
-
component: typeof CardEdition;
|
|
6
|
-
};
|
|
7
|
-
export default _default;
|
|
8
|
-
export declare const cardEdition: {
|
|
9
|
-
(): JSX.Element;
|
|
10
|
-
storyName: string;
|
|
11
|
-
parameters: {
|
|
12
|
-
design: {
|
|
13
|
-
type: string;
|
|
14
|
-
url: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare const ExampleCardEdition: {
|
|
19
|
-
(): JSX.Element;
|
|
20
|
-
storyName: string;
|
|
21
|
-
parameters: {
|
|
22
|
-
design: {
|
|
23
|
-
type: string;
|
|
24
|
-
url: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { InputTypes } from "./InputTypes";
|
|
3
|
-
export interface InputProps {
|
|
4
|
-
/** Additional attributes to pass to the <input> tag */
|
|
5
|
-
attributes?: {
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
};
|
|
8
|
-
/** Populates the aria-label on the input */
|
|
9
|
-
ariaLabel?: string;
|
|
10
|
-
/** Populates the aria-labelledby on the input */
|
|
11
|
-
ariaLabelledBy?: string;
|
|
12
|
-
/** BlockName for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
|
|
13
|
-
blockName?: string;
|
|
14
|
-
/** className you can add in addition to 'input' */
|
|
15
|
-
className?: string;
|
|
16
|
-
/** ID that other components can cross reference for accessibility purposes */
|
|
17
|
-
id?: string;
|
|
18
|
-
/** Adds the 'disabled' prop to the input when true */
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
/** Helper for modifiers array; adds 'errored' styling */
|
|
21
|
-
errored?: boolean;
|
|
22
|
-
/** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
|
|
23
|
-
modifiers?: string[];
|
|
24
|
-
/** Populates the placeholder of the input */
|
|
25
|
-
placeholder?: string;
|
|
26
|
-
/** Will add 'aria-required: true' to input */
|
|
27
|
-
required?: boolean;
|
|
28
|
-
/** HTML Input types as defined by MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input */
|
|
29
|
-
type?: InputTypes;
|
|
30
|
-
/** Populates the value of the input */
|
|
31
|
-
value?: string | number;
|
|
32
|
-
/** The action to perform on the `<input>`'s onChange function */
|
|
33
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
34
|
-
}
|
|
35
|
-
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
36
|
-
export default Input;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: any;
|
|
4
|
-
component: React.ForwardRefExoticComponent<import("./Input").InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
7
|
-
export declare const input: {
|
|
8
|
-
(): JSX.Element;
|
|
9
|
-
storyName: string;
|
|
10
|
-
parameters: {
|
|
11
|
-
design: {
|
|
12
|
-
type: string;
|
|
13
|
-
url: string;
|
|
14
|
-
};
|
|
15
|
-
jest: string[];
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare const inputGroup: {
|
|
19
|
-
(): JSX.Element;
|
|
20
|
-
storyName: string;
|
|
21
|
-
parameters: {
|
|
22
|
-
design: {
|
|
23
|
-
type: string;
|
|
24
|
-
url: string;
|
|
25
|
-
};
|
|
26
|
-
jest: string[];
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export declare const inputAttributes: () => JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
interface UIDocCardProps {
|
|
3
|
-
/** backgroundColor of the doc card */
|
|
4
|
-
backgroundColor: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* UIDocCard
|
|
8
|
-
* Component only used for Storybook.
|
|
9
|
-
*/
|
|
10
|
-
export default function UIDocCard(props: React.PropsWithChildren<UIDocCardProps>): JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function getCSSVariable(name: string): string;
|
package/dist/interfaces.d.ts
DELETED
package/dist/utils/bem.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function bem(baseClass: string, modifiers?: string[], blockName?: string, extra?: string[]): string;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import bem from "../../utils/bem";
|
|
2
|
-
|
|
3
|
-
describe("bem", () => {
|
|
4
|
-
it("returns baseclass", () => {
|
|
5
|
-
expect(bem("unorder-list")).toEqual("unorder-list");
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
it("returns properly formatted classes from a baseclass and modifier", () => {
|
|
9
|
-
const modifiers = ["scroll"];
|
|
10
|
-
expect(bem("list-item", modifiers)).toEqual("list-item list-item--scroll");
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it("returns properly formatted classes from a baseclass, modifier, and blockname", () => {
|
|
14
|
-
const modifiers = ["scroll"];
|
|
15
|
-
const blockName = "unordered-list";
|
|
16
|
-
expect(bem("list-item", modifiers, blockName)).toEqual(
|
|
17
|
-
"unordered-list__list-item unordered-list__list-item--scroll"
|
|
18
|
-
);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it("returns properly formatted classes from a baseclass and blockName", () => {
|
|
22
|
-
const blockName = "unordered-list";
|
|
23
|
-
expect(bem("list-item", [], blockName)).toEqual(
|
|
24
|
-
"unordered-list__list-item"
|
|
25
|
-
);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it("returns additional extra classes", () => {
|
|
29
|
-
const modifier = ["modifier"];
|
|
30
|
-
const blockName = "unordered-list";
|
|
31
|
-
const extra = ["extraClass"];
|
|
32
|
-
|
|
33
|
-
expect(bem("list-item", modifier, blockName, extra)).toEqual(
|
|
34
|
-
"unordered-list__list-item unordered-list__list-item--modifier extraClass"
|
|
35
|
-
);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { action } from "@storybook/addon-actions";
|
|
3
|
-
|
|
4
|
-
import CardEdition from "./CardEdition";
|
|
5
|
-
import Heading from "../Heading/Heading";
|
|
6
|
-
import { HeadingLevels } from "../Heading/HeadingTypes";
|
|
7
|
-
import Image from "../Image/Image";
|
|
8
|
-
import Button from "../Button/Button";
|
|
9
|
-
import Link from "../Link/Link";
|
|
10
|
-
import Icon from "../Icons/Icon";
|
|
11
|
-
import {
|
|
12
|
-
IconRotationTypes,
|
|
13
|
-
IconNames,
|
|
14
|
-
IconSizes,
|
|
15
|
-
IconAlign,
|
|
16
|
-
} from "../Icons/IconTypes";
|
|
17
|
-
import { LinkTypes } from "../Link/LinkTypes";
|
|
18
|
-
import { ButtonTypes } from "../Button/ButtonTypes";
|
|
19
|
-
import { getCategory } from "../../utils/componentCategories";
|
|
20
|
-
|
|
21
|
-
export default {
|
|
22
|
-
title: getCategory("CardEdition"),
|
|
23
|
-
component: CardEdition,
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const imageRatios = {
|
|
27
|
-
"1x1": "https://placeimg.com/100/100/animals",
|
|
28
|
-
"2x1": "https://placeimg.com/200/100/animals",
|
|
29
|
-
"3x4": "https://placeimg.com/150/200/animals",
|
|
30
|
-
"4x1": "https://placeimg.com/400/100/animals",
|
|
31
|
-
"4x3": "https://placeimg.com/200/150/animals",
|
|
32
|
-
"16x9": "https://placeimg.com/400/225/animals",
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const cardEdition = () => (
|
|
36
|
-
<>
|
|
37
|
-
<CardEdition
|
|
38
|
-
id="cardID"
|
|
39
|
-
heading={<Heading level={2} id="heading1" text="Header Content" />}
|
|
40
|
-
image={<Image src={imageRatios[2]} alt="" />}
|
|
41
|
-
ctas={
|
|
42
|
-
<Button
|
|
43
|
-
onClick={action("clicked")}
|
|
44
|
-
id="button1"
|
|
45
|
-
buttonType={ButtonTypes.Primary}
|
|
46
|
-
type="submit"
|
|
47
|
-
>
|
|
48
|
-
CTA Button Text
|
|
49
|
-
</Button>
|
|
50
|
-
}
|
|
51
|
-
footer={<>Footer content: </>}
|
|
52
|
-
>
|
|
53
|
-
Card Content:
|
|
54
|
-
</CardEdition>
|
|
55
|
-
</>
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
cardEdition.storyName = "CardEdition";
|
|
59
|
-
|
|
60
|
-
cardEdition.parameters = {
|
|
61
|
-
design: {
|
|
62
|
-
type: "figma",
|
|
63
|
-
url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=17167%3A58131",
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const ExampleCardEdition = () => (
|
|
68
|
-
<CardEdition
|
|
69
|
-
className="example-card-edition"
|
|
70
|
-
image={<Image src="https://placeimg.com/300/400/arch" alt={""} />}
|
|
71
|
-
ctas={
|
|
72
|
-
<>
|
|
73
|
-
<Link type={LinkTypes.Button} href="blah">
|
|
74
|
-
Reserve
|
|
75
|
-
</Link>
|
|
76
|
-
<div className="italicized ui-gray-dark">
|
|
77
|
-
0 of 11 copies available. 3 patrons in the queue.
|
|
78
|
-
</div>
|
|
79
|
-
<Link href="#url" type={LinkTypes.Forwards}>
|
|
80
|
-
View Book Details
|
|
81
|
-
</Link>
|
|
82
|
-
</>
|
|
83
|
-
}
|
|
84
|
-
>
|
|
85
|
-
<>
|
|
86
|
-
<Heading
|
|
87
|
-
level={HeadingLevels.Two}
|
|
88
|
-
id="heading1"
|
|
89
|
-
text="The Year of Magical Thinking"
|
|
90
|
-
/>
|
|
91
|
-
<div className="book__callout">A portrait of loss and grief</div>
|
|
92
|
-
<div>
|
|
93
|
-
By <Link href="#joan-didion">Joan Didion</Link>,{" "}
|
|
94
|
-
<Link href="#another-author">Another Author</Link>,{" "}
|
|
95
|
-
<Link href="#third-author">Third Author</Link>
|
|
96
|
-
</div>
|
|
97
|
-
<div className="book__filetype">
|
|
98
|
-
<Icon
|
|
99
|
-
name={IconNames.Headset}
|
|
100
|
-
size={IconSizes.Small}
|
|
101
|
-
align={IconAlign.Left}
|
|
102
|
-
iconRotation={IconRotationTypes.Rotate0}
|
|
103
|
-
/>
|
|
104
|
-
Audiobook
|
|
105
|
-
</div>
|
|
106
|
-
<div className="book__description">
|
|
107
|
-
An act of consummate literary bravery, a writer known for her clarity
|
|
108
|
-
allowing us to watch her mind as it becomes clouded...{" "}
|
|
109
|
-
<Link href="#">Read More</Link>
|
|
110
|
-
</div>
|
|
111
|
-
</>
|
|
112
|
-
</CardEdition>
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
ExampleCardEdition.storyName = "Example Card Edition";
|
|
116
|
-
|
|
117
|
-
ExampleCardEdition.parameters = {
|
|
118
|
-
design: {
|
|
119
|
-
type: "figma",
|
|
120
|
-
url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=17167%3A58131",
|
|
121
|
-
},
|
|
122
|
-
};
|