@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
package/src/overlays/Overlay.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect } from "react"
|
|
1
|
+
import React, { useRef, useState, useEffect } from "react"
|
|
2
2
|
import "./Overlay.scss"
|
|
3
3
|
import useKeyPress from "../helpers/useKeyPress"
|
|
4
4
|
import { createPortal } from "react-dom"
|
|
@@ -18,6 +18,7 @@ export type OverlayProps = {
|
|
|
18
18
|
slim?: boolean
|
|
19
19
|
role?: string
|
|
20
20
|
scrollable?: boolean
|
|
21
|
+
nodeRef?: React.MutableRefObject<null>
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
const OverlayInner = (props: OverlayProps) => {
|
|
@@ -33,6 +34,7 @@ const OverlayInner = (props: OverlayProps) => {
|
|
|
33
34
|
|
|
34
35
|
return (
|
|
35
36
|
<div
|
|
37
|
+
ref={props.nodeRef}
|
|
36
38
|
className={classNames.join(" ")}
|
|
37
39
|
role={props.role}
|
|
38
40
|
aria-labelledby={props.ariaLabelledBy}
|
|
@@ -53,6 +55,7 @@ const OverlayInner = (props: OverlayProps) => {
|
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
export const Overlay = (props: OverlayProps): any => {
|
|
58
|
+
const nodeRef = useRef(null)
|
|
56
59
|
const documentAvailable = typeof document !== "undefined"
|
|
57
60
|
const overlayRoot = useState<Element | null>(
|
|
58
61
|
documentAvailable ? document.querySelector("#__next") : null
|
|
@@ -76,6 +79,7 @@ export const Overlay = (props: OverlayProps): any => {
|
|
|
76
79
|
elForPortal &&
|
|
77
80
|
createPortal(
|
|
78
81
|
<CSSTransition
|
|
82
|
+
nodeRef={nodeRef}
|
|
79
83
|
in={props.open}
|
|
80
84
|
timeout={250}
|
|
81
85
|
classNames="overlay-effect"
|
|
@@ -83,7 +87,9 @@ export const Overlay = (props: OverlayProps): any => {
|
|
|
83
87
|
unmountOnExit
|
|
84
88
|
>
|
|
85
89
|
<RemoveScroll>
|
|
86
|
-
<OverlayInner {
|
|
90
|
+
<OverlayInner nodeRef={nodeRef} {...props}>
|
|
91
|
+
{props.children}
|
|
92
|
+
</OverlayInner>
|
|
87
93
|
</RemoveScroll>
|
|
88
94
|
</CSSTransition>,
|
|
89
95
|
elForPortal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.markdown ul.application-timeline {
|
|
2
2
|
@apply mb-8;
|
|
3
|
-
@apply
|
|
3
|
+
@apply ms-0;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.application-timeline {
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
text-transform: unset;
|
|
12
12
|
|
|
13
13
|
.absolute {
|
|
14
|
-
margin-
|
|
14
|
+
margin-block-start: 0.25rem;
|
|
15
15
|
z-index: 2;
|
|
16
|
-
margin-
|
|
16
|
+
margin-inline-start: -0.4rem;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
p {
|
|
@@ -21,23 +21,23 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
&:before {
|
|
24
|
-
|
|
24
|
+
inset-inline-start: 50%;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&:after {
|
|
28
|
-
|
|
28
|
+
inset-inline-start: 0;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
&:first-of-type {
|
|
32
32
|
&:after {
|
|
33
|
-
|
|
33
|
+
inset-inline-start: 50%;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
&:last-of-type {
|
|
38
38
|
&:after {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
inset-inline-start: auto;
|
|
40
|
+
inset-inline-end: 50%;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -67,6 +67,6 @@
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.progress-nav__dot-item::after {
|
|
70
|
-
|
|
70
|
+
inset-block-start: 1rem;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from "@storybook/blocks"
|
|
2
2
|
import { ListingCard } from "./ListingCard"
|
|
3
|
+
import * as ListingCardStories from './ListingCard.stories';
|
|
4
|
+
|
|
5
|
+
<Meta of={ListingCardStories} />
|
|
3
6
|
|
|
4
7
|
# ListingCard
|
|
5
8
|
|
|
6
9
|
The listing card component renders an image with optional status bars below it, and a content section associated with the image which can include titles, a table, and custom content.
|
|
7
10
|
|
|
8
|
-
<Canvas
|
|
9
|
-
<Story id="page-components-listing-card--with-tags-and-headers" />
|
|
10
|
-
</Canvas>
|
|
11
|
+
<Canvas of={ListingCardStories.WithTagsAndHeaders} />
|
|
11
12
|
|
|
12
13
|
<br />
|
|
14
|
+
|
|
13
15
|
<br />
|
|
14
16
|
|
|
15
17
|
## Variants
|
|
@@ -20,15 +22,13 @@ Many of the display variations of the card are enabled by the interior content p
|
|
|
20
22
|
|
|
21
23
|
By setting `stackedTable` to true, the interior table component switches from `StandardTable` to `StackedTable` for a different UI presentation.
|
|
22
24
|
|
|
23
|
-
<Canvas
|
|
24
|
-
<Story id="page-components-listing-card--with-stacked-table" />
|
|
25
|
-
</Canvas>
|
|
25
|
+
<Canvas of={ListingCardStories.withStackedTable} />
|
|
26
26
|
|
|
27
27
|
## Component Properties
|
|
28
28
|
|
|
29
|
-
<
|
|
29
|
+
<ArgTypes of={ListingCard} />
|
|
30
30
|
|
|
31
|
-
**Note:** for
|
|
31
|
+
**Note:** for accessibility reasons, if you have a link that should apply to the card as a whole, pass an `href` prop to the `contentHeader` key of `contentProps`. (If you previously passed `href` to `imageCardProps`, you should remove that.) You'll also want to pass `ariaHidden: true` as a prop for the footer button.
|
|
32
32
|
|
|
33
33
|
## Theming Variables
|
|
34
34
|
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from "@storybook/blocks"
|
|
2
2
|
import { Swatch } from "../prototypes/Swatch"
|
|
3
3
|
import { Heading } from "./Heading"
|
|
4
|
+
import * as HeadingStories from './Heading.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={HeadingStories} />
|
|
4
7
|
|
|
5
8
|
# Heading
|
|
6
9
|
|
|
7
10
|
The heading component renders an HTML heading with a flexible priority and style. Each style available maps to a [Typography](?path=/story/theming-typography--page) variant.
|
|
8
11
|
|
|
9
|
-
<Canvas
|
|
10
|
-
<Story id="text-heading--large-header" />
|
|
11
|
-
</Canvas>
|
|
12
|
+
<Canvas of={HeadingStories.largeHeader} />
|
|
12
13
|
|
|
13
14
|
<br />
|
|
15
|
+
|
|
14
16
|
<br />
|
|
15
17
|
|
|
16
18
|
## Component Properties
|
|
17
19
|
|
|
18
|
-
<
|
|
20
|
+
<ArgTypes of={Heading} />
|
package/src/text/Tag.docs.mdx
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from "@storybook/blocks"
|
|
2
2
|
import { Tag } from "./Tag"
|
|
3
|
+
import * as TagStories from './Tag.stories';
|
|
4
|
+
|
|
5
|
+
<Meta of={TagStories} />
|
|
3
6
|
|
|
4
7
|
# Tag
|
|
5
8
|
|
|
6
9
|
The tag component offers a simple way to present a content label or status indicator.
|
|
7
10
|
|
|
8
|
-
<Canvas
|
|
9
|
-
<Story id="text-tag--pill-colors" />
|
|
10
|
-
</Canvas>
|
|
11
|
+
<Canvas of={TagStories.pillColors} />
|
|
11
12
|
|
|
12
13
|
<br />
|
|
14
|
+
|
|
13
15
|
<br />
|
|
14
16
|
|
|
15
17
|
## Variants
|
|
@@ -20,29 +22,23 @@ There are several props which accept enums to adjust style type and size. For ex
|
|
|
20
22
|
|
|
21
23
|
(Default, no prop required.)
|
|
22
24
|
|
|
23
|
-
<Canvas
|
|
24
|
-
<Story id="text-tag--standard" />
|
|
25
|
-
</Canvas>
|
|
25
|
+
<Canvas of={TagStories.standard} />
|
|
26
26
|
|
|
27
27
|
### Pill
|
|
28
28
|
|
|
29
29
|
Set the `pillStyle` property to `true`.
|
|
30
30
|
|
|
31
|
-
<Canvas
|
|
32
|
-
<Story id="text-tag--pill" />
|
|
33
|
-
</Canvas>
|
|
31
|
+
<Canvas of={TagStories.pill} />
|
|
34
32
|
|
|
35
33
|
### Fill Container
|
|
36
34
|
|
|
37
35
|
Set the `fillContainer` property to `true` for a block tag which spans the entire width of its container.
|
|
38
36
|
|
|
39
|
-
<Canvas
|
|
40
|
-
<Story id="text-tag--pill-listings" />
|
|
41
|
-
</Canvas>
|
|
37
|
+
<Canvas of={TagStories.pillListings} />
|
|
42
38
|
|
|
43
39
|
## Component Properties
|
|
44
40
|
|
|
45
|
-
<
|
|
41
|
+
<ArgTypes of={Tag} />
|
|
46
42
|
|
|
47
43
|
## Theming Variables
|
|
48
44
|
|