@bloom-housing/ui-components 12.7.6 → 13.0.0
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/dist/__tests__/storyshots.spec.d.ts +0 -1
- package/dist/__tests__/storyshots.spec.js +9 -9
- package/dist/__tests__/storyshots.spec.js.map +1 -1
- package/dist/src/actions/Button.stories.d.ts +58 -9
- package/dist/src/actions/Button.stories.js +54 -38
- package/dist/src/actions/Button.stories.js.map +1 -1
- package/dist/src/actions/ButtonGroup.stories.d.ts +0 -5
- package/dist/src/actions/ButtonGroup.stories.js +0 -4
- package/dist/src/actions/ButtonGroup.stories.js.map +1 -1
- package/dist/src/blocks/Card.stories.d.ts +0 -5
- package/dist/src/blocks/Card.stories.js +0 -4
- package/dist/src/blocks/Card.stories.js.map +1 -1
- package/dist/src/blocks/ImageCard.stories.d.ts +0 -5
- package/dist/src/blocks/ImageCard.stories.js +0 -4
- package/dist/src/blocks/ImageCard.stories.js.map +1 -1
- package/dist/src/blocks/InfoCard.stories.d.ts +0 -5
- package/dist/src/blocks/InfoCard.stories.js +0 -4
- package/dist/src/blocks/InfoCard.stories.js.map +1 -1
- package/dist/src/blocks/MediaCard.stories.d.ts +0 -5
- package/dist/src/blocks/MediaCard.stories.js +0 -4
- package/dist/src/blocks/MediaCard.stories.js.map +1 -1
- package/dist/src/blocks/StandardCard.stories.d.ts +0 -5
- package/dist/src/blocks/StandardCard.stories.js +0 -4
- package/dist/src/blocks/StandardCard.stories.js.map +1 -1
- package/dist/src/forms/Dropzone.stories.d.ts +1 -1
- package/dist/src/forms/Dropzone.stories.js +1 -2
- package/dist/src/forms/Dropzone.stories.js.map +1 -1
- package/dist/src/forms/MultiSelectField.stories.d.ts +0 -5
- package/dist/src/forms/MultiSelectField.stories.js +0 -4
- package/dist/src/forms/MultiSelectField.stories.js.map +1 -1
- package/dist/src/headers/HeadingGroup.stories.d.ts +0 -5
- package/dist/src/headers/HeadingGroup.stories.js +0 -4
- package/dist/src/headers/HeadingGroup.stories.js.map +1 -1
- package/dist/src/headers/PageHeader.stories.d.ts +0 -5
- package/dist/src/headers/PageHeader.stories.js +0 -4
- package/dist/src/headers/PageHeader.stories.js.map +1 -1
- package/dist/src/headers/StepHeader.stories.js +1 -2
- package/dist/src/headers/StepHeader.stories.js.map +1 -1
- package/dist/src/navigation/LanguageNav.stories.d.ts +1 -1
- package/dist/src/navigation/LanguageNav.stories.js +2 -3
- package/dist/src/navigation/LanguageNav.stories.js.map +1 -1
- package/dist/src/navigation/ProgressNav.stories.d.ts +0 -5
- package/dist/src/navigation/ProgressNav.stories.js +0 -4
- package/dist/src/navigation/ProgressNav.stories.js.map +1 -1
- package/dist/src/navigation/SideNav.stories.d.ts +0 -5
- package/dist/src/navigation/SideNav.stories.js +0 -4
- package/dist/src/navigation/SideNav.stories.js.map +1 -1
- package/dist/src/notifications/AlertBox.stories.d.ts +0 -5
- package/dist/src/notifications/AlertBox.stories.js +0 -4
- package/dist/src/notifications/AlertBox.stories.js.map +1 -1
- package/dist/src/notifications/ApplicationStatus.stories.d.ts +1 -1
- package/dist/src/notifications/ApplicationStatus.stories.js +3 -4
- package/dist/src/notifications/ApplicationStatus.stories.js.map +1 -1
- package/dist/src/overlays/Modal.stories.d.ts +101 -13
- package/dist/src/overlays/Modal.stories.js +119 -76
- package/dist/src/overlays/Modal.stories.js.map +1 -1
- package/dist/src/overlays/Overlay.d.ts +1 -0
- package/dist/src/overlays/Overlay.js +5 -4
- package/dist/src/overlays/Overlay.js.map +1 -1
- package/package.json +30 -30
- package/src/actions/Button.docs.mdx +6 -5
- package/src/actions/Button.stories.tsx +73 -62
- package/src/actions/ButtonGroup.docs.mdx +7 -5
- package/src/actions/ButtonGroup.stories.tsx +0 -4
- package/src/blocks/Card.docs.mdx +10 -11
- package/src/blocks/Card.stories.tsx +0 -4
- package/src/blocks/ImageCard.docs.mdx +8 -6
- package/src/blocks/ImageCard.stories.tsx +0 -4
- package/src/blocks/InfoCard.docs.mdx +8 -6
- package/src/blocks/InfoCard.stories.tsx +0 -4
- package/src/blocks/MediaCard.docs.mdx +10 -11
- package/src/blocks/MediaCard.stories.tsx +0 -4
- package/src/blocks/StandardCard.docs.mdx +7 -8
- package/src/blocks/StandardCard.stories.tsx +0 -4
- package/src/documentation/{Utilities.stories.mdx → Utilities.docs.mdx} +4 -2
- package/src/forms/Dropzone.stories.tsx +1 -2
- package/src/forms/MultiSelectField.docs.mdx +6 -5
- package/src/forms/MultiSelectField.stories.tsx +0 -4
- package/src/global/forms.scss +14 -14
- package/src/global/lists.scss +13 -8
- package/src/headers/HeadingGroup.docs.mdx +6 -5
- package/src/headers/HeadingGroup.stories.tsx +0 -4
- package/src/headers/PageHeader.docs.mdx +10 -12
- package/src/headers/PageHeader.stories.tsx +0 -4
- package/src/headers/StepHeader.docs.mdx +14 -13
- package/src/headers/StepHeader.scss +2 -2
- package/src/headers/StepHeader.stories.tsx +1 -2
- package/src/lists/PreferencesList.docs.mdx +8 -6
- package/src/navigation/LanguageNav.stories.tsx +1 -3
- package/src/navigation/ProgressNav.docs.mdx +13 -8
- package/src/navigation/ProgressNav.scss +12 -12
- package/src/navigation/ProgressNav.stories.tsx +0 -4
- package/src/navigation/SideNav.docs.mdx +7 -5
- package/src/navigation/SideNav.stories.tsx +0 -4
- package/src/notifications/AlertBox.docs.mdx +7 -8
- package/src/notifications/AlertBox.scss +3 -3
- package/src/notifications/AlertBox.stories.tsx +0 -4
- package/src/notifications/ApplicationStatus.stories.tsx +3 -4
- package/src/overlays/Modal.docs.mdx +7 -5
- package/src/overlays/Modal.stories.tsx +273 -232
- package/src/overlays/Overlay.tsx +8 -2
- package/src/page_components/ApplicationTimeline.scss +9 -9
- package/src/page_components/listing/ListingCard.docs.mdx +9 -9
- package/src/text/Heading.docs.mdx +7 -5
- package/src/text/Tag.docs.mdx +10 -14
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
-
import {
|
|
2
|
+
import { useArgs } from "@storybook/preview-api"
|
|
3
3
|
import { BADGES } from "../../.storybook/constants"
|
|
4
4
|
import { Button } from "../actions/Button"
|
|
5
5
|
import {
|
|
@@ -7,18 +7,37 @@ import {
|
|
|
7
7
|
AppearanceSizeType,
|
|
8
8
|
AppearanceStyleType,
|
|
9
9
|
} from "../global/AppearanceTypes"
|
|
10
|
-
import ButtonDocumentation from "./Button.docs.mdx"
|
|
11
10
|
import { faArrowsRotate, faCoffee, faTable } from "@fortawesome/free-solid-svg-icons"
|
|
12
11
|
|
|
13
12
|
export default {
|
|
14
13
|
title: "Actions/Button 🚩",
|
|
15
|
-
|
|
16
|
-
decorators: [(storyFn: any) => <div>{storyFn()}</div>, withKnobs],
|
|
14
|
+
decorators: [(storyFn: any) => <div>{storyFn()}</div>],
|
|
17
15
|
parameters: {
|
|
18
|
-
docs: {
|
|
19
|
-
page: ButtonDocumentation,
|
|
20
|
-
},
|
|
21
16
|
badges: [BADGES.GEN2],
|
|
17
|
+
controls: {
|
|
18
|
+
disable: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
argTypes: {
|
|
22
|
+
label: {
|
|
23
|
+
control: "text",
|
|
24
|
+
},
|
|
25
|
+
styleType: {
|
|
26
|
+
options: AppearanceStyleType,
|
|
27
|
+
control: "select",
|
|
28
|
+
},
|
|
29
|
+
border: {
|
|
30
|
+
options: AppearanceBorderType,
|
|
31
|
+
control: "select",
|
|
32
|
+
},
|
|
33
|
+
icon: {
|
|
34
|
+
options: { arrowBack: "arrowBack", arrowForward: "arrowForward", coffee: faCoffee, rotate: faArrowsRotate, table: faTable },
|
|
35
|
+
control: "select",
|
|
36
|
+
},
|
|
37
|
+
iconPlacement: {
|
|
38
|
+
options: { left: "left", right: "right" },
|
|
39
|
+
control: "select",
|
|
40
|
+
},
|
|
22
41
|
},
|
|
23
42
|
}
|
|
24
43
|
|
|
@@ -26,63 +45,55 @@ const handleClick = (e: React.MouseEvent) => {
|
|
|
26
45
|
alert(`You clicked me! Event: ${e.type}`)
|
|
27
46
|
}
|
|
28
47
|
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{text("Label", "Hello Storybook")}
|
|
56
|
-
</Button>
|
|
57
|
-
|
|
58
|
-
<p className="mt-10">Try out different styles with the Knobs below.</p>
|
|
59
|
-
</>
|
|
60
|
-
)
|
|
48
|
+
export const standard = {
|
|
49
|
+
parameters: {
|
|
50
|
+
controls: {
|
|
51
|
+
disable: false,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
args: {
|
|
55
|
+
label: "Hello Storybook",
|
|
56
|
+
},
|
|
57
|
+
render: (args: Record<string, any>) => {
|
|
58
|
+
return (
|
|
59
|
+
<>
|
|
60
|
+
<Button
|
|
61
|
+
styleType={args.styleType}
|
|
62
|
+
border={args.border}
|
|
63
|
+
icon={args.icon}
|
|
64
|
+
iconPlacement={args.iconPlacement}
|
|
65
|
+
onClick={handleClick}
|
|
66
|
+
>
|
|
67
|
+
{args.label}
|
|
68
|
+
</Button>
|
|
69
|
+
|
|
70
|
+
<p className="mt-10">Try out different styles with the controls below.</p>
|
|
71
|
+
</>
|
|
72
|
+
)
|
|
73
|
+
},
|
|
61
74
|
}
|
|
62
75
|
|
|
63
|
-
export const withFontAwesomeIcon =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
iconSize="medium"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
</>
|
|
85
|
-
)
|
|
76
|
+
export const withFontAwesomeIcon = {
|
|
77
|
+
parameters: {
|
|
78
|
+
controls: {
|
|
79
|
+
disable: false,
|
|
80
|
+
include: ["icon"]
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
args: {
|
|
84
|
+
icon: faArrowsRotate,
|
|
85
|
+
},
|
|
86
|
+
render: (args: Record<string, any>) => {
|
|
87
|
+
return (
|
|
88
|
+
<>
|
|
89
|
+
<Button icon={args.icon} iconSize="medium" iconPlacement="left" onClick={handleClick}>
|
|
90
|
+
FontAwesome is awesome
|
|
91
|
+
</Button>
|
|
92
|
+
|
|
93
|
+
<p className="mt-10">Try out different icons with the controls below.</p>
|
|
94
|
+
</>
|
|
95
|
+
)
|
|
96
|
+
},
|
|
86
97
|
}
|
|
87
98
|
|
|
88
99
|
export const small = () => (
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { Canvas,
|
|
1
|
+
import { ArgTypes, Canvas, Meta, Story } from "@storybook/blocks"
|
|
2
2
|
import { Swatch } from "../prototypes/Swatch"
|
|
3
3
|
import { ButtonGroup } from "./ButtonGroup"
|
|
4
|
+
import * as ButtonGroupStories from './ButtonGroup.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={ButtonGroupStories} />
|
|
4
7
|
|
|
5
8
|
# ButtonGroup
|
|
6
9
|
|
|
7
10
|
The button group component lets you place multiple buttons along a horizontal or vertical (mobile primarily) axis and group/space buttons according to some simple flex rules.
|
|
8
11
|
|
|
9
|
-
<Canvas
|
|
10
|
-
<Story id="actions-button-group--two-columns" />
|
|
11
|
-
</Canvas>
|
|
12
|
+
<Canvas of={ButtonGroupStories.twoColumns} />
|
|
12
13
|
|
|
13
14
|
<br />
|
|
15
|
+
|
|
14
16
|
<br />
|
|
15
17
|
|
|
16
18
|
## Component Properties
|
|
17
19
|
|
|
18
|
-
<
|
|
20
|
+
<ArgTypes of={ButtonGroup} />
|
|
19
21
|
|
|
20
22
|
## Theming Variables
|
|
21
23
|
|
|
@@ -2,7 +2,6 @@ import * as React from "react"
|
|
|
2
2
|
import { BADGES } from "../../.storybook/constants"
|
|
3
3
|
import { AppearanceStyleType } from "../.."
|
|
4
4
|
import Button from "./Button"
|
|
5
|
-
import ButtonGroupDocumentation from "./ButtonGroup.docs.mdx"
|
|
6
5
|
|
|
7
6
|
import { ButtonGroup, ButtonGroupSpacing } from "./ButtonGroup"
|
|
8
7
|
|
|
@@ -10,9 +9,6 @@ export default {
|
|
|
10
9
|
title: "Actions/Button Group 🚩",
|
|
11
10
|
id: "actions-button-group",
|
|
12
11
|
parameters: {
|
|
13
|
-
docs: {
|
|
14
|
-
page: ButtonGroupDocumentation,
|
|
15
|
-
},
|
|
16
12
|
badges: [BADGES.GEN2],
|
|
17
13
|
},
|
|
18
14
|
}
|
package/src/blocks/Card.docs.mdx
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from "@storybook/blocks"
|
|
2
2
|
import { Swatch } from "../prototypes/Swatch"
|
|
3
3
|
import { Card } from "./Card"
|
|
4
|
+
import * as CardStories from './Card.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={CardStories} />
|
|
4
7
|
|
|
5
8
|
# Card
|
|
6
9
|
|
|
7
|
-
<Canvas
|
|
8
|
-
<Story id="blocks-card--text-content" />
|
|
9
|
-
</Canvas>
|
|
10
|
+
<Canvas of={CardStories.TextContent} />
|
|
10
11
|
|
|
11
12
|
The 2nd-generation Card component is intended to serve as a flexible content container with a header, optional content sections, and a footer. Over time our intention is to "port" some other card types and content blocks in the system to use Card as their underlying structure.
|
|
12
13
|
|
|
@@ -20,25 +21,23 @@ The `<Card.Header>` subcomponent will typically be paired with a child `<Heading
|
|
|
20
21
|
|
|
21
22
|
You can browse through the various stories for different examples of how you'd pattern a card with various subcomponents. Many of the visual aspects of a Card can be customized using the CSS variables listed below. For example, this "Detroit style" example:
|
|
22
23
|
|
|
23
|
-
<Canvas
|
|
24
|
-
<Story id="blocks-card--detroit-style" />
|
|
25
|
-
</Canvas>
|
|
24
|
+
<Canvas of={CardStories.DetroitStyle} />
|
|
26
25
|
|
|
27
26
|
## Card Properties
|
|
28
27
|
|
|
29
|
-
<
|
|
28
|
+
<ArgTypes of={Card} />
|
|
30
29
|
|
|
31
30
|
## Card.Header Properties
|
|
32
31
|
|
|
33
|
-
<
|
|
32
|
+
<ArgTypes of={Card.Header} />
|
|
34
33
|
|
|
35
34
|
## Card.Section Properties
|
|
36
35
|
|
|
37
|
-
<
|
|
36
|
+
<ArgTypes of={Card.Section} />
|
|
38
37
|
|
|
39
38
|
## Card.Footer Properties
|
|
40
39
|
|
|
41
|
-
<
|
|
40
|
+
<ArgTypes of={Card.Footer} />
|
|
42
41
|
|
|
43
42
|
## Theming Variables
|
|
44
43
|
|
|
@@ -3,15 +3,11 @@ import { BADGES } from "../../.storybook/constants"
|
|
|
3
3
|
import { AppearanceStyleType, Button, ButtonGroup, ButtonGroupSpacing, LinkButton } from "../.."
|
|
4
4
|
import { HeadingGroup } from "../headers/HeadingGroup"
|
|
5
5
|
import Card from "./Card"
|
|
6
|
-
import CardDocumentation from "./Card.docs.mdx"
|
|
7
6
|
|
|
8
7
|
export default {
|
|
9
8
|
title: "Blocks/Card 🚩",
|
|
10
9
|
id: "blocks/card",
|
|
11
10
|
parameters: {
|
|
12
|
-
docs: {
|
|
13
|
-
page: CardDocumentation,
|
|
14
|
-
},
|
|
15
11
|
badges: [BADGES.GEN2],
|
|
16
12
|
},
|
|
17
13
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from "@storybook/blocks"
|
|
2
2
|
import { Swatch } from "../prototypes/Swatch"
|
|
3
3
|
import { ImageCard, ImageItem } from "./ImageCard"
|
|
4
|
+
import * as ImageCardStories from './ImageCard.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={ImageCardStories} />
|
|
4
7
|
|
|
5
8
|
# Image Card
|
|
6
9
|
|
|
7
|
-
The image card component renders an image with optional tags at top and status bars below it. You can optionally pass multiple images in which will
|
|
10
|
+
The image card component renders an image with optional tags at top and status bars below it. You can optionally pass multiple images in which will facilitate a popup gallery modal automatically.
|
|
8
11
|
|
|
9
|
-
<Canvas
|
|
10
|
-
<Story id="blocks-image-card--with-one-status-and-tag" />
|
|
11
|
-
</Canvas>
|
|
12
|
+
<Canvas of={ImageCardStories.withOneStatusAndTag} />
|
|
12
13
|
|
|
13
14
|
<br />
|
|
15
|
+
|
|
14
16
|
<br />
|
|
15
17
|
|
|
16
18
|
## Component Properties
|
|
17
19
|
|
|
18
|
-
<
|
|
20
|
+
<ArgTypes of={ImageCard} />
|
|
19
21
|
|
|
20
22
|
## Theming Variables
|
|
21
23
|
|
|
@@ -4,16 +4,12 @@ import { ImageCard } from "./ImageCard"
|
|
|
4
4
|
import { t } from "../helpers/translator"
|
|
5
5
|
import { ApplicationStatusType } from "../global/ApplicationStatusType"
|
|
6
6
|
import { IconFillColors, UniversalIconType } from "../icons/Icon"
|
|
7
|
-
import ImageCardDocumentation from "./ImageCard.docs.mdx"
|
|
8
7
|
|
|
9
8
|
export default {
|
|
10
9
|
title: "Blocks/Image Card 🚩",
|
|
11
10
|
id: "blocks/image-card",
|
|
12
11
|
decorators: [(storyFn: any) => <div style={{ maxWidth: "700px" }}>{storyFn()}</div>],
|
|
13
12
|
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
page: ImageCardDocumentation,
|
|
16
|
-
},
|
|
17
13
|
badges: [BADGES.GEN2],
|
|
18
14
|
},
|
|
19
15
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from "@storybook/blocks"
|
|
2
2
|
import { Swatch } from "../prototypes/Swatch"
|
|
3
3
|
import { InfoCard } from "./InfoCard"
|
|
4
|
+
import * as InfoCardStories from './InfoCard.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={InfoCardStories} />
|
|
4
7
|
|
|
5
8
|
# Info Card
|
|
6
9
|
|
|
7
10
|
The Info Card component renders a box with a title, which can optionally be a hyperlink. Beneath the title is an optional subtitle. Beneath the subtitle can be a string, a component, or markdown.
|
|
8
11
|
|
|
9
|
-
<Canvas
|
|
10
|
-
<Story id="blocks-info-card" />
|
|
11
|
-
</Canvas>
|
|
12
|
+
<Canvas of={InfoCardStories.Default} />
|
|
12
13
|
|
|
13
14
|
<br />
|
|
15
|
+
|
|
14
16
|
<br />
|
|
15
17
|
|
|
16
18
|
## Component Properties
|
|
17
19
|
|
|
18
|
-
<
|
|
20
|
+
<ArgTypes of={InfoCard} />
|
|
19
21
|
|
|
20
22
|
## Theming Variables
|
|
21
23
|
|
|
@@ -26,7 +28,7 @@ You can apply CSS variables to the `.info-card` selector to customize the appear
|
|
|
26
28
|
| `--padding` | Size | Padding around card | `--bloom-s6` |
|
|
27
29
|
| `--margin-bottom` | Size | Margin beneath card | `--bloom-s4` |
|
|
28
30
|
| `--border-color` | <Swatch colorVar="--bloom-color-gray-450" /> | Color of border around card | `--bloom-color-gray-450` |
|
|
29
|
-
| `--background-color` | <Swatch colorVar="--bloom-color-primary-lighter"/> | Background color of card | `--bloom-color-primary-lighter` |
|
|
31
|
+
| `--background-color` | <Swatch colorVar="--bloom-color-primary-lighter" /> | Background color of card | `--bloom-color-primary-lighter` |
|
|
30
32
|
| `--title-color` | <Swatch colorVar="--bloom-color-gray-800" /> | Color of title text | `--bloom-color-gray-800` |
|
|
31
33
|
| `--title-font-size` | Size | Size of title text | `--bloom-font-size-base` |
|
|
32
34
|
| `--title-font-family` | Font | Font family of title text | `--bloom-font-sans` |
|
|
@@ -2,16 +2,12 @@ import React from "react"
|
|
|
2
2
|
import { BADGES } from "../../.storybook/constants"
|
|
3
3
|
import { InfoCard } from "../blocks/InfoCard"
|
|
4
4
|
import { ExpandableText } from "../actions/ExpandableText"
|
|
5
|
-
import InfoCardDocumentation from "./InfoCard.docs.mdx"
|
|
6
5
|
|
|
7
6
|
export default {
|
|
8
7
|
title: "blocks/Info Card 🚩",
|
|
9
8
|
decorators: [(storyFn: any) => <div style={{ padding: "1rem" }}>{storyFn()}</div>],
|
|
10
9
|
id: "blocks/info-card",
|
|
11
10
|
parameters: {
|
|
12
|
-
docs: {
|
|
13
|
-
page: InfoCardDocumentation,
|
|
14
|
-
},
|
|
15
11
|
badges: [BADGES.GEN2],
|
|
16
12
|
},
|
|
17
13
|
}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from "@storybook/blocks"
|
|
2
2
|
import { MediaCard } from "./MediaCard"
|
|
3
|
+
import * as MediaCardStories from './MediaCard.stories';
|
|
4
|
+
|
|
5
|
+
<Meta of={MediaCardStories} />
|
|
3
6
|
|
|
4
7
|
# Media Card
|
|
5
8
|
|
|
6
9
|
The media card component is used to describe the title and, optionally, subtitle of a corresponding piece of media. The header section and title of the media card is clickable and displays the media via the required handleClick prop.
|
|
7
10
|
|
|
8
|
-
<Canvas
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</Canvas>
|
|
14
|
-
<Canvas>
|
|
15
|
-
<Story id="blocks-media-card--with-custom-icon" />
|
|
16
|
-
</Canvas>
|
|
11
|
+
<Canvas of={MediaCardStories.withTitleAndSubtitle} />
|
|
12
|
+
|
|
13
|
+
<Canvas of={MediaCardStories.withJustTitle} />
|
|
14
|
+
|
|
15
|
+
<Canvas of={MediaCardStories.withCustomIcon} />
|
|
17
16
|
|
|
18
17
|
## Component Properties
|
|
19
18
|
|
|
20
|
-
<
|
|
19
|
+
<ArgTypes of={MediaCard} />
|
|
21
20
|
|
|
22
21
|
## Theming Variables
|
|
23
22
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { MediaCard } from "./MediaCard"
|
|
3
3
|
import { faCirclePlay } from "@fortawesome/free-solid-svg-icons"
|
|
4
|
-
import MediaCardDocumentation from "./MediaCard.docs.mdx"
|
|
5
4
|
import { BADGES } from "../../.storybook/constants"
|
|
6
5
|
|
|
7
6
|
export default {
|
|
@@ -9,9 +8,6 @@ export default {
|
|
|
9
8
|
id: "blocks/media-card",
|
|
10
9
|
decorators: [(storyFn: any) => <div style={{ maxWidth: "313px" }}>{storyFn()}</div>],
|
|
11
10
|
parameters: {
|
|
12
|
-
docs: {
|
|
13
|
-
page: MediaCardDocumentation,
|
|
14
|
-
},
|
|
15
11
|
badges: [BADGES.GEN2],
|
|
16
12
|
},
|
|
17
13
|
}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from "@storybook/blocks"
|
|
2
2
|
import { StandardCard } from "./StandardCard"
|
|
3
|
+
import * as StandardCardStories from './StandardCard.stories';
|
|
4
|
+
|
|
5
|
+
<Meta of={StandardCardStories} />
|
|
3
6
|
|
|
4
7
|
# Standard Card
|
|
5
8
|
|
|
6
9
|
The standard card component displays a title with a child element (e.g table) and optional footer.
|
|
7
10
|
|
|
8
|
-
<Canvas
|
|
9
|
-
<Story id="blocks-standard-card" />
|
|
10
|
-
</Canvas>
|
|
11
|
+
<Canvas of={StandardCardStories.Blank} />
|
|
11
12
|
|
|
12
13
|
## Component Properties
|
|
13
14
|
|
|
14
|
-
<
|
|
15
|
+
<ArgTypes of={StandardCard} />
|
|
15
16
|
|
|
16
17
|
## Theming Variables
|
|
17
18
|
|
|
18
|
-
<Canvas
|
|
19
|
-
<Story id="blocks-standard-card--style-overrides" />
|
|
20
|
-
</Canvas>
|
|
19
|
+
<Canvas of={StandardCardStories.styleOverrides} />
|
|
21
20
|
|
|
22
21
|
You can apply CSS variables to the `.standard-card` selector to customize the appearance of the component.
|
|
23
22
|
|
|
@@ -6,7 +6,6 @@ import { MinimalTable } from "../tables/MinimalTable"
|
|
|
6
6
|
import { mockDataWithStyling, mockHeadersWithStyling } from "../tables/MinimalTable.stories"
|
|
7
7
|
|
|
8
8
|
import { Button } from "../actions/Button"
|
|
9
|
-
import StandardCardDocumentation from "./StandardCard.docs.mdx"
|
|
10
9
|
|
|
11
10
|
export default {
|
|
12
11
|
title: "Blocks/StandardCard 🚩",
|
|
@@ -14,9 +13,6 @@ export default {
|
|
|
14
13
|
decorators: [(storyFn: any) => <div style={{ padding: "1rem" }}>{storyFn()}</div>],
|
|
15
14
|
component: StandardCard,
|
|
16
15
|
parameters: {
|
|
17
|
-
docs: {
|
|
18
|
-
page: StandardCardDocumentation,
|
|
19
|
-
},
|
|
20
16
|
badges: [BADGES.GEN2],
|
|
21
17
|
},
|
|
22
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Meta, DocsContainer, Unstyled } from "@storybook/addon-docs"
|
|
2
2
|
import { LargeHeader, LargeHeaderSource, Typography } from "./Utilities"
|
|
3
3
|
|
|
4
4
|
<Meta
|
|
@@ -22,4 +22,6 @@ These styles are component agnostic and can be used to ensure UI consistency acr
|
|
|
22
22
|
|
|
23
23
|
These classes can be added to any text element in order to give it visual identity and hierarchy.
|
|
24
24
|
|
|
25
|
-
<
|
|
25
|
+
<Unstyled>
|
|
26
|
+
<Typography />
|
|
27
|
+
</Unstyled>
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
-
import { withKnobs } from "@storybook/addon-knobs"
|
|
3
2
|
import { Dropzone } from "./Dropzone"
|
|
4
3
|
|
|
5
4
|
export default {
|
|
6
5
|
title: "Forms/Dropzone",
|
|
7
|
-
decorators: [(storyFn: any) => <div style={{ padding: "1rem" }}>{storyFn()}</div
|
|
6
|
+
decorators: [(storyFn: any) => <div style={{ padding: "1rem" }}>{storyFn()}</div>],
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
export const defaultDropzone = () => {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from "@storybook/blocks"
|
|
2
2
|
import { MultiSelectField } from "./MultiSelectField"
|
|
3
|
+
import * as MultiSelectFieldStories from './MultiSelectField.stories';
|
|
4
|
+
|
|
5
|
+
<Meta of={MultiSelectFieldStories} />
|
|
3
6
|
|
|
4
7
|
# Multi-Select Field
|
|
5
8
|
|
|
6
9
|
The multi-select field component lets you type to autocomplete and select from a list of options which possibly are lazy-loaded from an API. Selected options show as tags below the text input, and those options can also be removed.
|
|
7
10
|
|
|
8
|
-
<Canvas
|
|
9
|
-
<Story id="forms-multi-select-field--standard" />
|
|
10
|
-
</Canvas>
|
|
11
|
+
<Canvas of={MultiSelectFieldStories.standard} />
|
|
11
12
|
|
|
12
13
|
## Data Source and Default Values
|
|
13
14
|
|
|
@@ -64,7 +65,7 @@ return [
|
|
|
64
65
|
|
|
65
66
|
## Component Properties
|
|
66
67
|
|
|
67
|
-
<
|
|
68
|
+
<ArgTypes of={MultiSelectField} />
|
|
68
69
|
|
|
69
70
|
## Theming Variables
|
|
70
71
|
|
|
@@ -5,7 +5,6 @@ import MultiSelectField, {
|
|
|
5
5
|
MultiSelectFieldItem,
|
|
6
6
|
} from "./MultiSelectField"
|
|
7
7
|
import { useForm } from "react-hook-form"
|
|
8
|
-
import MultiSelectFieldDocumentation from "./MultiSelectField.docs.mdx"
|
|
9
8
|
|
|
10
9
|
export default {
|
|
11
10
|
title: "Forms/MultiSelect Field 🚩",
|
|
@@ -16,9 +15,6 @@ export default {
|
|
|
16
15
|
),
|
|
17
16
|
],
|
|
18
17
|
parameters: {
|
|
19
|
-
docs: {
|
|
20
|
-
page: MultiSelectFieldDocumentation,
|
|
21
|
-
},
|
|
22
18
|
badges: [BADGES.GEN2],
|
|
23
19
|
},
|
|
24
20
|
}
|
package/src/global/forms.scss
CHANGED
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
.field-border {
|
|
39
39
|
label {
|
|
40
40
|
background-color: var(--bloom-color-white);
|
|
41
|
-
padding-
|
|
42
|
-
padding-
|
|
43
|
-
padding-
|
|
41
|
+
padding-block-start: var(--bordered-vertical-padding);
|
|
42
|
+
padding-block-end: var(--bordered-vertical-padding);
|
|
43
|
+
padding-inline-start: var(--bordered-leftward-padding);
|
|
44
44
|
border-width: var(--bordered-border-width);
|
|
45
45
|
border-radius: var(--bordered-border-radius);
|
|
46
46
|
border-color: var(--bloom-color-gray-450);
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
select.input {
|
|
83
|
-
@apply
|
|
84
|
-
@apply
|
|
83
|
+
@apply ps-3;
|
|
84
|
+
@apply pe-8;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
input.input {
|
|
@@ -98,11 +98,11 @@
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
.prepend + input[aria-invalid="false"] {
|
|
101
|
-
@apply
|
|
101
|
+
@apply ps-8;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
.prepend + input[aria-invalid="true"] {
|
|
105
|
-
@apply
|
|
105
|
+
@apply ps-12;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
&.control-narrower {
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
input[type="radio"] {
|
|
115
115
|
opacity: 0;
|
|
116
116
|
position: absolute;
|
|
117
|
-
margin-
|
|
117
|
+
margin-inline-start: -20px;
|
|
118
118
|
|
|
119
119
|
&:focus {
|
|
120
120
|
text-decoration: none;
|
|
@@ -287,7 +287,7 @@ input[type="number"] {
|
|
|
287
287
|
@apply flex;
|
|
288
288
|
|
|
289
289
|
.field {
|
|
290
|
-
@apply
|
|
290
|
+
@apply me-5;
|
|
291
291
|
@apply mb-0;
|
|
292
292
|
}
|
|
293
293
|
}
|
|
@@ -303,23 +303,23 @@ input[type="number"] {
|
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
.field--inline + .field--inline {
|
|
306
|
-
margin-
|
|
306
|
+
margin-inline-start: 1.5rem;
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
.flex > .field,
|
|
310
310
|
.field-group--date .field {
|
|
311
311
|
@apply flex-auto;
|
|
312
|
-
margin-
|
|
313
|
-
margin-
|
|
312
|
+
margin-inline-start: 0.325rem;
|
|
313
|
+
margin-inline-end: 0.325rem;
|
|
314
314
|
}
|
|
315
315
|
|
|
316
316
|
.flex > .field,
|
|
317
317
|
.field-group--date .field {
|
|
318
318
|
&:first-of-type {
|
|
319
|
-
margin-
|
|
319
|
+
margin-inline-start: 0;
|
|
320
320
|
}
|
|
321
321
|
&:last-of-type {
|
|
322
|
-
margin-
|
|
322
|
+
margin-inline-end: 0;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
|