@bloom-housing/ui-components 6.0.1-alpha.1 → 6.0.1-alpha.3
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 +42 -0
- package/index.ts +3 -1
- package/package.json +5 -2
- package/src/actions/Button.scss +1 -1
- package/src/blocks/Card.docs.mdx +60 -0
- package/src/blocks/Card.scss +65 -0
- package/src/blocks/Card.tsx +74 -0
- package/src/blocks/ImageCard.scss +1 -1
- package/src/blocks/StandardCard.scss +1 -1
- package/src/blocks/StandardCard.tsx +1 -1
- package/src/documentation/Utilities.scss +30 -0
- package/src/documentation/Utilities.stories.mdx +25 -0
- package/src/documentation/Utilities.tsx +67 -0
- package/src/forms/DOBField.tsx +1 -1
- package/src/forms/Field.tsx +1 -1
- package/src/forms/FieldGroup.tsx +1 -1
- package/src/forms/MultiSelectField.scss +2 -2
- package/src/forms/PhoneField.tsx +1 -1
- package/src/global/forms.scss +3 -15
- package/src/global/mixins.scss +2 -2
- package/src/global/text.scss +81 -63
- package/src/global/tokens/colors.scss +1 -0
- package/src/headers/HeadingGroup.docs.mdx +25 -0
- package/src/headers/HeadingGroup.scss +23 -0
- package/src/headers/HeadingGroup.tsx +31 -0
- package/src/navigation/ProgressNav.scss +1 -1
- package/src/page_components/listing/ListingCard.tsx +14 -14
- package/src/page_components/listing/ListingMap.tsx +2 -2
- package/src/page_components/listing/listing_sidebar/Contact.tsx +3 -3
- package/src/page_components/listing/listing_sidebar/ExpandableSection.tsx +4 -1
- package/src/page_components/listing/listing_sidebar/GetApplication.tsx +6 -5
- package/src/page_components/listing/listing_sidebar/QuantityRowSection.tsx +4 -1
- package/src/page_components/listing/listing_sidebar/ReferralApplication.tsx +4 -1
- package/src/page_components/listing/listing_sidebar/SidebarBlock.tsx +3 -3
- package/src/page_components/listing/listing_sidebar/SubmitApplication.tsx +4 -4
- package/src/page_components/listing/listing_sidebar/events/EventSection.tsx +5 -2
- package/src/sections/InfoCardGrid.tsx +2 -2
- package/src/tables/CategoryTable.tsx +2 -2
- package/src/text/Heading.docs.mdx +18 -0
- package/src/text/Heading.tsx +32 -0
- package/src/text/Tag.scss +1 -1
- package/tailwind.config.js +1 -0
- package/src/headers/Heading.tsx +0 -31
package/src/global/text.scss
CHANGED
|
@@ -72,31 +72,6 @@ h1.title {
|
|
|
72
72
|
@apply text-4xl;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
.text-caps-underline {
|
|
76
|
-
@apply font-alt-sans;
|
|
77
|
-
@apply uppercase;
|
|
78
|
-
@apply text-tiny;
|
|
79
|
-
@apply mb-5;
|
|
80
|
-
@apply pb-2;
|
|
81
|
-
@apply border-0;
|
|
82
|
-
@apply border-b-4;
|
|
83
|
-
@apply border-primary;
|
|
84
|
-
@apply font-semibold;
|
|
85
|
-
@apply text-gray-800;
|
|
86
|
-
@apply tracking-widest;
|
|
87
|
-
@apply inline-block;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.text-caps-tiny {
|
|
91
|
-
@apply mb-3;
|
|
92
|
-
@apply text-gray-750;
|
|
93
|
-
@apply uppercase;
|
|
94
|
-
@apply font-sans;
|
|
95
|
-
@apply font-bold;
|
|
96
|
-
@apply text-tiny;
|
|
97
|
-
@apply tracking-wide;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
75
|
.text-serif-lg {
|
|
101
76
|
@apply font-serif;
|
|
102
77
|
@apply text-lg;
|
|
@@ -140,42 +115,85 @@ h1.title {
|
|
|
140
115
|
@apply block;
|
|
141
116
|
}
|
|
142
117
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
font-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.
|
|
161
|
-
font-family: var(--
|
|
162
|
-
font-weight: var(--
|
|
163
|
-
color: var(--
|
|
164
|
-
font-size: var(--
|
|
165
|
-
margin-block: var(--
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.
|
|
169
|
-
font-family: var(--
|
|
170
|
-
font-weight: var(--
|
|
171
|
-
color: var(--
|
|
172
|
-
font-size: var(--
|
|
173
|
-
margin-block: var(--
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.
|
|
177
|
-
font-family: var(--
|
|
178
|
-
font-weight: var(--
|
|
179
|
-
color: var(--
|
|
180
|
-
font-size: var(--
|
|
118
|
+
:root {
|
|
119
|
+
--bloom-text-color-light: var(--bloom-color-gray-700);
|
|
120
|
+
--bloom-text-color: var(--bloom-color-gray-750);
|
|
121
|
+
--bloom-text-color-dark: var(--bloom-color-gray-800);
|
|
122
|
+
--bloom-text-color-darker: var(--bloom-color-gray-850);
|
|
123
|
+
--bloom-text-color-darkest: var(--bloom-color-black);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.text__large-primary {
|
|
127
|
+
font-family: var(--text-large-primary-font-family, var(--bloom-font-alt-sans));
|
|
128
|
+
font-weight: var(--text-large-primary-font-weight, 600);
|
|
129
|
+
color: var(--text-large-primary--color, var(--bloom-color-primary-dark));
|
|
130
|
+
font-size: var(--text-large-primary-font-size, var(--bloom-font-size-3xl));
|
|
131
|
+
margin-block: var(--text-large-primary-margin-block, 0 var(--bloom-s3));
|
|
132
|
+
line-height: var(--text-large-primary-line-height, var(--bloom-line-height-tight));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.text__medium-normal {
|
|
136
|
+
font-family: var(--text-medium-normal-font-family, var(--bloom-font-alt-sans));
|
|
137
|
+
font-weight: var(--text-medium-normal-font-weight, normal);
|
|
138
|
+
color: var(--text-medium-normal-color, var(--bloom-text-color-darkest));
|
|
139
|
+
font-size: var(--text-medium-normal-font-size, var(--bloom-font-size-base));
|
|
140
|
+
margin-block: var(--text-medium-normal-margin-block, 0 var(--bloom-s3));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.text__small-weighted {
|
|
144
|
+
font-family: var(--text-small-weighted-font-family, var(--bloom-font-alt-sans));
|
|
145
|
+
font-weight: var(--text-small-weighted-font-weight, 600);
|
|
146
|
+
color: var(--text-small-weighted-color, var(--bloom-text-color-dark));
|
|
147
|
+
font-size: var(--text-small-weighted-font-size, var(--bloom-font-size-sm));
|
|
148
|
+
margin-block: var(--text-small-weighted-margin-block, 0 var(--bloom-s1));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.text__small-normal {
|
|
152
|
+
font-family: var(--text-small-normal-font-family, var(--bloom-font-alt-sans));
|
|
153
|
+
font-weight: var(--text-small-normal-font-weight, normal);
|
|
154
|
+
color: var(--text-small-normal-color, var(--bloom-text-color));
|
|
155
|
+
font-size: var(--text-small-normal-font-size, var(--bloom-font-size-sm));
|
|
156
|
+
margin-block: var(--text-small-normal-margin-block, 0 var(--bloom-s3));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.text__light-weighted {
|
|
160
|
+
font-family: var(--text-light-weighted-font-family, var(--bloom-font-alt-sans));
|
|
161
|
+
font-weight: var(--text-light-weighted-font-weight, 600);
|
|
162
|
+
color: var(--text-light-weighted-color, var(--bloom-text-color-light));
|
|
163
|
+
font-size: var(--text-light-weighted-font-size, var(--bloom-font-size-sm));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.text_caps-spaced {
|
|
167
|
+
font-family: var(--text-caps-spaced-font-family, var(--bloom-font-sans));
|
|
168
|
+
text-transform: uppercase;
|
|
169
|
+
color: var(--text-caps-spaced-color, var(--bloom-text-color));
|
|
170
|
+
letter-spacing: var(--text-caps-spaced-letter-spacing, var(--bloom-letter-spacing-widest));
|
|
171
|
+
font-weight: var(--text-caps-spaced-font-weight, 600);
|
|
172
|
+
font-size: var(--text-caps-spaced-font-size, var(--bloom-font-size-tiny));
|
|
173
|
+
margin-bottom: var(--text-caps-spaced-margin-bottom, var(--bloom-s3));
|
|
174
|
+
display: inline-block;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.text__underline-weighted {
|
|
178
|
+
font-family: var(--text-underline-weighted-font-family, var(--bloom-font-alt-sans));
|
|
179
|
+
text-transform: var(--text-underline-weighted-transform, uppercase);
|
|
180
|
+
font-size: var(--text-underline-weighted-font-size, var(--bloom-font-size-tiny));
|
|
181
|
+
margin-bottom: var(--text-underline-weighted-bottom-margin, var(--bloom-s5));
|
|
182
|
+
padding-bottom: var(--text-underline-weighted-bottom-padding, var(--bloom-s2));
|
|
183
|
+
border: var(--text-underline-weighted-border, 0);
|
|
184
|
+
border-bottom: var(--text-underline-weighted-border, 4px solid var(--bloom-color-primary));
|
|
185
|
+
font-weight: var(--text-underline-weighted-font-weight, 600);
|
|
186
|
+
color: var(--text-underline-weighted-color, var(--bloom-text-color-dark));
|
|
187
|
+
letter-spacing: var(--text-underline-weighted-letter-spacing, var(--bloom-letter-spacing-widest));
|
|
188
|
+
display: inline-block;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.text__caps-weighted {
|
|
192
|
+
margin-bottom: var(--text-caps-weighted-bottom-margin, var(--bloom-s3));
|
|
193
|
+
color: var(--text-caps-weighted-color, var(--bloom-text-color));
|
|
194
|
+
text-transform: var(--text-caps-weighted-text-transform, uppercase);
|
|
195
|
+
font-family: var(--text-caps-weighted-font-family, var(--bloom-font-sans));
|
|
196
|
+
font-weight: var(--text-caps-weighted-font-weight, 700);
|
|
197
|
+
font-size: var(--text-caps-weighted-font-size, var(--bloom-font-size-tiny));
|
|
198
|
+
letter-spacing: var(--text-caps-weighted-letter-spacing, var(--bloom-letter-spacing-wide));
|
|
181
199
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Canvas, Story, ArgsTable } from "@storybook/addon-docs"
|
|
2
|
+
import { HeadingGroup } from "./HeadingGroup"
|
|
3
|
+
|
|
4
|
+
# Heading Group
|
|
5
|
+
|
|
6
|
+
<Canvas>
|
|
7
|
+
<Story id="headers-heading-group--with-content" />
|
|
8
|
+
</Canvas>
|
|
9
|
+
|
|
10
|
+
The HeadingGroup component provides a heading tag (h1-h6) combined with a paragraph tag as a subheading in an aria-minded fashion. Good for use in Card header components and other headers.
|
|
11
|
+
|
|
12
|
+
## Heading Group Properties
|
|
13
|
+
|
|
14
|
+
<ArgsTable of={HeadingGroup} />
|
|
15
|
+
|
|
16
|
+
## Theming Variables
|
|
17
|
+
|
|
18
|
+
You can apply CSS variables to the `.heading-group` selector to customize the appearance of the component.
|
|
19
|
+
|
|
20
|
+
| Name | Type | Description | Default |
|
|
21
|
+
| --------------------- | ----- | --------------------------------------------------- | ------------ |
|
|
22
|
+
| `--heading-margin` | Size | Vertical space added around the top heading, if any | `0rem` |
|
|
23
|
+
| `--subheading-margin` | Size | The space between the heading and subheading | `--bloom-s3` |
|
|
24
|
+
| `--heading-color` | Color | Override to set a specific heading text color | `inherit` |
|
|
25
|
+
| `--subheading-color` | Color | Override to set a specific subheading text color | `inherit` |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.heading-group {
|
|
2
|
+
/* Component Variables */
|
|
3
|
+
--heading-margin: 0rem;
|
|
4
|
+
--subheading-margin: var(--bloom-s3);
|
|
5
|
+
--heading-color: inherit;
|
|
6
|
+
--subheading-color: inherit;
|
|
7
|
+
|
|
8
|
+
h1,
|
|
9
|
+
h2,
|
|
10
|
+
h3,
|
|
11
|
+
h4,
|
|
12
|
+
h5,
|
|
13
|
+
h6 {
|
|
14
|
+
margin-block: var(--heading-margin);
|
|
15
|
+
color: var(--heading-color);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
p {
|
|
19
|
+
margin-block: var(--subheading-margin);
|
|
20
|
+
font-size: var(--bloom-font-size-base);
|
|
21
|
+
color: var(--subheading-color);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Heading } from "../text/Heading"
|
|
3
|
+
import "./HeadingGroup.scss"
|
|
4
|
+
|
|
5
|
+
export interface HeadingGroupProps {
|
|
6
|
+
/** A string or element to display in an `h2` tag (overridable via `headingPriority`) */
|
|
7
|
+
heading: React.ReactNode
|
|
8
|
+
/** A string or element to display in an `p` tag (using `aria-roledescription="subtitle"`) */
|
|
9
|
+
subheading: React.ReactNode
|
|
10
|
+
/**
|
|
11
|
+
* The heading level (1 through 6)
|
|
12
|
+
* @default 2
|
|
13
|
+
*/
|
|
14
|
+
headingPriority?: number
|
|
15
|
+
/** Additional class name for the whole group */
|
|
16
|
+
className?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const HeadingGroup = (props: HeadingGroupProps) => {
|
|
20
|
+
const classNames = ["heading-group"]
|
|
21
|
+
if (props.className) classNames.push(props.className)
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<hgroup className={classNames.join(" ")} role="group">
|
|
25
|
+
<Heading priority={props.headingPriority ?? 2}>{props.heading}</Heading>
|
|
26
|
+
<p aria-roledescription="subtitle">{props.subheading}</p>
|
|
27
|
+
</hgroup>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { HeadingGroup as default, HeadingGroup }
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
--active-step-color: var(--bloom-color-primary);
|
|
5
5
|
--active-step-font-color: var(--bloom-color-gray-900);
|
|
6
6
|
--future-step-color: var(--bloom-color-gray-450);
|
|
7
|
-
--future-step-font-color: var(--bloom-color
|
|
7
|
+
--future-step-font-color: var(--bloom-text-color);
|
|
8
8
|
|
|
9
9
|
--dot-size: var(--bloom-s3);
|
|
10
10
|
--dot-padding-left-mobile: var(--bloom-s2);
|
|
@@ -3,7 +3,7 @@ import { ImageCard, ImageCardProps, ImageTag } from "../../blocks/ImageCard"
|
|
|
3
3
|
import { LinkButton } from "../../actions/LinkButton"
|
|
4
4
|
import { StackedTable, StackedTableProps } from "../../tables/StackedTable"
|
|
5
5
|
import { StandardTable, StandardTableProps } from "../../tables/StandardTable"
|
|
6
|
-
import { Heading, HeaderType } from "../../
|
|
6
|
+
import { Heading, HeaderType } from "../../text/Heading"
|
|
7
7
|
import { Tag } from "../../text/Tag"
|
|
8
8
|
import { AppearanceShadeType, AppearanceStyleType } from "../../global/AppearanceTypes"
|
|
9
9
|
import { Icon, IconFillColors } from "../../icons/Icon"
|
|
@@ -12,7 +12,7 @@ import { NavigationContext } from "../../config/NavigationContext"
|
|
|
12
12
|
|
|
13
13
|
interface ListingCardTableProps extends StandardTableProps, StackedTableProps {}
|
|
14
14
|
|
|
15
|
-
export interface
|
|
15
|
+
export interface ListingCardHeader {
|
|
16
16
|
content: string | React.ReactNode
|
|
17
17
|
href?: string
|
|
18
18
|
customClass?: string
|
|
@@ -20,17 +20,17 @@ export interface CardHeader {
|
|
|
20
20
|
isPillType?: boolean
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export interface
|
|
23
|
+
export interface ListingFooterButton {
|
|
24
24
|
href: string
|
|
25
25
|
text: string
|
|
26
26
|
ariaHidden?: boolean
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export interface ListingCardContentProps {
|
|
30
|
-
contentHeader?:
|
|
31
|
-
contentSubheader?:
|
|
32
|
-
tableHeader?:
|
|
33
|
-
tableSubheader?:
|
|
30
|
+
contentHeader?: ListingCardHeader
|
|
31
|
+
contentSubheader?: ListingCardHeader
|
|
32
|
+
tableHeader?: ListingCardHeader
|
|
33
|
+
tableSubheader?: ListingCardHeader
|
|
34
34
|
}
|
|
35
35
|
export interface ListingCardProps {
|
|
36
36
|
/** A list of tags to be rendered below the content header, a Tag component is rendered for each */
|
|
@@ -40,7 +40,7 @@ export interface ListingCardProps {
|
|
|
40
40
|
/** An object containing fields that render optional headers above the content section's table */
|
|
41
41
|
contentProps?: ListingCardContentProps
|
|
42
42
|
/** A list of buttons to render in the footer of the content section */
|
|
43
|
-
footerButtons?:
|
|
43
|
+
footerButtons?: ListingFooterButton[]
|
|
44
44
|
/** A class name applied to the footer container of the content section */
|
|
45
45
|
footerContainerClass?: string
|
|
46
46
|
/** Custom content rendered below the content table */
|
|
@@ -74,7 +74,7 @@ const ListingCard = (props: ListingCardProps) => {
|
|
|
74
74
|
const { LinkComponent } = useContext(NavigationContext)
|
|
75
75
|
|
|
76
76
|
const getHeader = (
|
|
77
|
-
header:
|
|
77
|
+
header: ListingCardHeader | undefined,
|
|
78
78
|
priority: number,
|
|
79
79
|
styleType?: HeaderType,
|
|
80
80
|
customClass?: string
|
|
@@ -94,7 +94,7 @@ const ListingCard = (props: ListingCardProps) => {
|
|
|
94
94
|
)
|
|
95
95
|
}
|
|
96
96
|
return (
|
|
97
|
-
<Heading priority={priority}
|
|
97
|
+
<Heading priority={priority} styleType={styleType} className={customClass}>
|
|
98
98
|
{header.href ? (
|
|
99
99
|
<LinkComponent className="is-card-link" href={header.href}>
|
|
100
100
|
{header.content}
|
|
@@ -112,8 +112,8 @@ const ListingCard = (props: ListingCardProps) => {
|
|
|
112
112
|
const getContentHeader = () => {
|
|
113
113
|
return (
|
|
114
114
|
<div className="listings-row_headers">
|
|
115
|
-
{getHeader(contentProps?.contentHeader, 2, "
|
|
116
|
-
{getHeader(contentProps?.contentSubheader, 3, "
|
|
115
|
+
{getHeader(contentProps?.contentHeader, 2, "largePrimary", "order-1")}
|
|
116
|
+
{getHeader(contentProps?.contentSubheader, 3, "mediumNormal", "order-2")}
|
|
117
117
|
{cardTags && cardTags?.length > 0 && (
|
|
118
118
|
<div className="listings-row_tags">
|
|
119
119
|
{cardTags?.map((cardTag, index) => {
|
|
@@ -145,8 +145,8 @@ const ListingCard = (props: ListingCardProps) => {
|
|
|
145
145
|
<hr className={"mb-2"} />
|
|
146
146
|
)}
|
|
147
147
|
<div className={"listings-row_headers"}>
|
|
148
|
-
{getHeader(contentProps?.tableHeader, 4, "
|
|
149
|
-
{getHeader(contentProps?.tableSubheader, 5, "
|
|
148
|
+
{getHeader(contentProps?.tableHeader, 4, "smallWeighted")}
|
|
149
|
+
{getHeader(contentProps?.tableSubheader, 5, "smallNormal")}
|
|
150
150
|
</div>
|
|
151
151
|
{children && children}
|
|
152
152
|
{tableProps && (tableProps.data || tableProps.stackedData) && (
|
|
@@ -5,7 +5,7 @@ import MapGL, { Marker } from "react-map-gl"
|
|
|
5
5
|
import "./ListingMap.scss"
|
|
6
6
|
import { MultiLineAddress, Address } from "../../helpers/MultiLineAddress"
|
|
7
7
|
import { useIntersect } from "../../.."
|
|
8
|
-
import { Heading } from "../../
|
|
8
|
+
import { Heading } from "../../text/Heading"
|
|
9
9
|
|
|
10
10
|
export interface ListingMapProps {
|
|
11
11
|
address?: Address
|
|
@@ -109,7 +109,7 @@ const ListingMap = (props: ListingMapProps) => {
|
|
|
109
109
|
<div className="listing-map" ref={setIntersectingElement}>
|
|
110
110
|
<div className="addressPopup">
|
|
111
111
|
{props.listingName && (
|
|
112
|
-
<Heading priority={3}
|
|
112
|
+
<Heading priority={3} styleType={"capsWeighted"}>
|
|
113
113
|
{props.listingName}
|
|
114
114
|
</Heading>
|
|
115
115
|
)}
|
|
@@ -2,7 +2,7 @@ import * as React from "react"
|
|
|
2
2
|
import { ContactAddress } from "./ContactAddress"
|
|
3
3
|
import { Icon, IconFillColors } from "../../../icons/Icon"
|
|
4
4
|
import { Address } from "../../../helpers/MultiLineAddress"
|
|
5
|
-
import { Heading } from "../../../
|
|
5
|
+
import { Heading } from "../../../text/Heading"
|
|
6
6
|
|
|
7
7
|
export interface ContactProps {
|
|
8
8
|
/** Any number of text sections rendered after the contact information */
|
|
@@ -49,7 +49,7 @@ const Contact = ({
|
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
51
|
<section className="aside-block">
|
|
52
|
-
<Heading priority={4}
|
|
52
|
+
<Heading priority={4} styleType={"underlineWeighted"}>
|
|
53
53
|
{sectionTitle}
|
|
54
54
|
</Heading>
|
|
55
55
|
|
|
@@ -96,7 +96,7 @@ const Contact = ({
|
|
|
96
96
|
{additionalInformation?.map((info) => {
|
|
97
97
|
return (
|
|
98
98
|
<div key={info.title} className={"my-3"}>
|
|
99
|
-
<Heading priority={3}
|
|
99
|
+
<Heading priority={3} styleType={"capsWeighted"}>
|
|
100
100
|
{info.title}
|
|
101
101
|
</Heading>
|
|
102
102
|
<div className="text-gray-800 text-tiny markdown">{info.content}</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import Markdown from "markdown-to-jsx"
|
|
3
3
|
import { ExpandableContent } from "../../../actions/ExpandableContent"
|
|
4
|
+
import { Heading } from "../../../text/Heading"
|
|
4
5
|
|
|
5
6
|
export interface ExpandableSectionProps {
|
|
6
7
|
content: string | React.ReactNode
|
|
@@ -28,7 +29,9 @@ const ExpandableSection = ({ content, expandableContent, strings }: ExpandableSe
|
|
|
28
29
|
}
|
|
29
30
|
return (
|
|
30
31
|
<section className="aside-block">
|
|
31
|
-
<
|
|
32
|
+
<Heading priority={4} styleType={"underlineWeighted"}>
|
|
33
|
+
{strings.title}
|
|
34
|
+
</Heading>
|
|
32
35
|
<div className="text-tiny text-gray-750">
|
|
33
36
|
{getTextContent(content)}
|
|
34
37
|
{expandableContent && (
|
|
@@ -4,7 +4,7 @@ import { Button } from "../../../actions/Button"
|
|
|
4
4
|
import { LinkButton } from "../../../actions/LinkButton"
|
|
5
5
|
import { AppearanceStyleType } from "../../../global/AppearanceTypes"
|
|
6
6
|
import { Address } from "../../../helpers/MultiLineAddress"
|
|
7
|
-
import { Heading } from "../../../
|
|
7
|
+
import { Heading } from "../../../text/Heading"
|
|
8
8
|
import { t } from "../../../helpers/translator"
|
|
9
9
|
import { OrDivider } from "./OrDivider"
|
|
10
10
|
import { ContactAddress } from "./ContactAddress"
|
|
@@ -56,9 +56,10 @@ const GetApplication = (props: ApplicationsProps) => {
|
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
58
|
<section className="aside-block" data-test-id="get-application-section">
|
|
59
|
-
<
|
|
59
|
+
<Heading priority={2} styleType={"underlineWeighted"}>
|
|
60
60
|
{props.strings?.howToApply ?? t("listings.apply.howToApply")}
|
|
61
|
-
</
|
|
61
|
+
</Heading>
|
|
62
|
+
|
|
62
63
|
{!props.applicationsOpen && (
|
|
63
64
|
<p className="mb-5 text-gray-700">
|
|
64
65
|
{props.strings?.applicationsOpenInFuture ??
|
|
@@ -121,7 +122,7 @@ const GetApplication = (props: ApplicationsProps) => {
|
|
|
121
122
|
{props.applicationsOpen && (props.onlineApplicationURL || props.paperMethod) && (
|
|
122
123
|
<OrDivider bgColor="white" />
|
|
123
124
|
)}
|
|
124
|
-
<Heading priority={3}
|
|
125
|
+
<Heading priority={3} styleType={"capsWeighted"}>
|
|
125
126
|
{props.strings?.pickUpApplication ?? t("listings.apply.pickUpAnApplication")}
|
|
126
127
|
</Heading>
|
|
127
128
|
<ContactAddress
|
|
@@ -130,7 +131,7 @@ const GetApplication = (props: ApplicationsProps) => {
|
|
|
130
131
|
/>
|
|
131
132
|
{props.applicationPickUpAddressOfficeHours && (
|
|
132
133
|
<>
|
|
133
|
-
<Heading priority={3}
|
|
134
|
+
<Heading priority={3} styleType={"capsWeighted"}>
|
|
134
135
|
{props.strings?.officeHoursHeading ?? t("leasingAgent.officeHours")}
|
|
135
136
|
</Heading>
|
|
136
137
|
<p className="text-gray-800 text-tiny markdown">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
+
import { Heading } from "../../../text/Heading"
|
|
2
3
|
|
|
3
4
|
export interface QuantityRow {
|
|
4
5
|
amount: number | null
|
|
@@ -33,7 +34,9 @@ const QuantityRowSection = ({ quantityRows, strings }: QuantityRowSectionProps)
|
|
|
33
34
|
|
|
34
35
|
return (
|
|
35
36
|
<section className="aside-block is-tinted">
|
|
36
|
-
<
|
|
37
|
+
<Heading priority={4} styleType={"capsWeighted"}>
|
|
38
|
+
{strings.sectionTitle}
|
|
39
|
+
</Heading>
|
|
37
40
|
<div>
|
|
38
41
|
{strings.description && (
|
|
39
42
|
<p className="text-tiny text-gray-800 pb-3">{strings.description}</p>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
+
import { Heading } from "../../../text/Heading"
|
|
2
3
|
import { t } from "../../../helpers/translator"
|
|
3
4
|
import { Icon, IconFillColors } from "../../../icons/Icon"
|
|
4
5
|
|
|
@@ -16,7 +17,9 @@ const ReferralApplication = (props: ReferralApplicationProps) => {
|
|
|
16
17
|
|
|
17
18
|
return (
|
|
18
19
|
<section className="aside-block">
|
|
19
|
-
<
|
|
20
|
+
<Heading priority={2} styleType={"underlineWeighted"}>
|
|
21
|
+
{props.strings.title}
|
|
22
|
+
</Heading>
|
|
20
23
|
<p>
|
|
21
24
|
<a href={linkedPhoneNumber}>
|
|
22
25
|
<Icon symbol="phone" size="medium" fill={IconFillColors.primary} />{" "}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
-
import { Heading, HeadingProps } from "../../../
|
|
2
|
+
import { Heading, HeadingProps } from "../../../text/Heading"
|
|
3
3
|
|
|
4
4
|
export interface SidebarBlockProps extends Omit<HeadingProps, "children" | "className"> {
|
|
5
5
|
children: React.ReactNode
|
|
@@ -7,11 +7,11 @@ export interface SidebarBlockProps extends Omit<HeadingProps, "children" | "clas
|
|
|
7
7
|
title?: string
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const SidebarBlock = ({ children, className, title, priority,
|
|
10
|
+
const SidebarBlock = ({ children, className, title, priority, styleType }: SidebarBlockProps) => {
|
|
11
11
|
return (
|
|
12
12
|
<section className={`aside-block ${className ? className : ""}`}>
|
|
13
13
|
{title && (
|
|
14
|
-
<Heading priority={priority ?? 4}
|
|
14
|
+
<Heading priority={priority ?? 4} styleType={styleType ?? "underlineWeighted"}>
|
|
15
15
|
{title}
|
|
16
16
|
</Heading>
|
|
17
17
|
)}
|
|
@@ -3,7 +3,7 @@ import Markdown from "markdown-to-jsx"
|
|
|
3
3
|
import { Address } from "../../../helpers/MultiLineAddress"
|
|
4
4
|
import { ContactAddress } from "./ContactAddress"
|
|
5
5
|
import { OrDivider } from "./OrDivider"
|
|
6
|
-
import { Heading } from "../../../
|
|
6
|
+
import { Heading } from "../../../text/Heading"
|
|
7
7
|
|
|
8
8
|
export interface ApplicationAddressesProps {
|
|
9
9
|
/** The dropoff address for paper applications */
|
|
@@ -38,7 +38,7 @@ const SubmitApplication = ({
|
|
|
38
38
|
<div className="text-serif-lg">{strings.sectionHeader}</div>
|
|
39
39
|
{applicationMailingAddress && (
|
|
40
40
|
<>
|
|
41
|
-
<Heading priority={3}
|
|
41
|
+
<Heading priority={3} styleType={"capsWeighted"}>
|
|
42
42
|
{strings.mailHeader}
|
|
43
43
|
</Heading>
|
|
44
44
|
<>
|
|
@@ -51,13 +51,13 @@ const SubmitApplication = ({
|
|
|
51
51
|
{applicationDropOffAddress && (
|
|
52
52
|
<>
|
|
53
53
|
{applicationMailingAddress && <OrDivider bgColor="gray-100" />}
|
|
54
|
-
<Heading priority={3}
|
|
54
|
+
<Heading priority={3} styleType={"capsWeighted"}>
|
|
55
55
|
{strings.dropOffHeader}
|
|
56
56
|
</Heading>
|
|
57
57
|
<ContactAddress address={applicationDropOffAddress} mapString={strings.mapString} />
|
|
58
58
|
{applicationDropOffAddressOfficeHours && (
|
|
59
59
|
<>
|
|
60
|
-
<Heading priority={3}
|
|
60
|
+
<Heading priority={3} styleType={"capsWeighted"}>
|
|
61
61
|
{strings.officeHoursHeader}
|
|
62
62
|
</Heading>
|
|
63
63
|
<p className="mt-4 text-tiny text-gray-750">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
-
import { Heading } from "../../../../
|
|
2
|
+
import { Heading } from "../../../../text/Heading"
|
|
3
3
|
|
|
4
4
|
export type EventType = {
|
|
5
5
|
timeString?: string
|
|
@@ -28,7 +28,10 @@ const EventSection = (props: EventSectionProps) => {
|
|
|
28
28
|
return (
|
|
29
29
|
<section className="aside-block">
|
|
30
30
|
{props.headerText && (
|
|
31
|
-
<Heading
|
|
31
|
+
<Heading
|
|
32
|
+
priority={4}
|
|
33
|
+
styleType={props.sectionHeader ? "underlineWeighted" : "capsWeighted"}
|
|
34
|
+
>
|
|
32
35
|
{props.headerText}
|
|
33
36
|
</Heading>
|
|
34
37
|
)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
-
import { Heading } from "../
|
|
2
|
+
import { Heading } from "../text/Heading"
|
|
3
3
|
import "./InfoCardGrid.scss"
|
|
4
4
|
|
|
5
5
|
export interface InfoCardGridProps {
|
|
@@ -11,7 +11,7 @@ export interface InfoCardGridProps {
|
|
|
11
11
|
const InfoCardGrid = (props: InfoCardGridProps) => (
|
|
12
12
|
<section className="info-cards">
|
|
13
13
|
<header className="info-cards__header">
|
|
14
|
-
<Heading
|
|
14
|
+
<Heading styleType={"underlineWeighted"} priority={2} className={"text-tiny"}>
|
|
15
15
|
{props.title}
|
|
16
16
|
</Heading>
|
|
17
17
|
{props.subtitle && <p className="info-cards__subtitle">{props.subtitle}</p>}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { StackedTable, StackedTableProps } from "./StackedTable"
|
|
3
|
-
import { Heading } from "../
|
|
3
|
+
import { Heading } from "../text/Heading"
|
|
4
4
|
|
|
5
5
|
export interface CategoryTableSection {
|
|
6
6
|
/** The header text for a category */
|
|
@@ -18,7 +18,7 @@ const CategoryTable = (props: CategoryTableProps) => {
|
|
|
18
18
|
const tables = props.categoryData.map((category, index) => {
|
|
19
19
|
return (
|
|
20
20
|
<div key={index}>
|
|
21
|
-
<Heading priority={3}
|
|
21
|
+
<Heading priority={3} styleType={"lightWeighted"}>
|
|
22
22
|
{category.header}
|
|
23
23
|
</Heading>
|
|
24
24
|
<hr className={"my-2"} />
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Canvas, Story, ArgsTable } from "@storybook/addon-docs"
|
|
2
|
+
import { Swatch } from "../prototypes/Swatch"
|
|
3
|
+
import { Heading } from "./Heading"
|
|
4
|
+
|
|
5
|
+
# Heading
|
|
6
|
+
|
|
7
|
+
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
|
+
|
|
9
|
+
<Canvas>
|
|
10
|
+
<Story id="text-heading--large-header" />
|
|
11
|
+
</Canvas>
|
|
12
|
+
|
|
13
|
+
<br />
|
|
14
|
+
<br />
|
|
15
|
+
|
|
16
|
+
## Component Properties
|
|
17
|
+
|
|
18
|
+
<ArgsTable of={Heading} />
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
export interface HeadingProps {
|
|
4
|
+
children?: React.ReactNode
|
|
5
|
+
className?: string
|
|
6
|
+
priority?: number
|
|
7
|
+
styleType?: HeaderType
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type HeaderType = keyof typeof HeaderStyleMap
|
|
11
|
+
|
|
12
|
+
const HeaderStyleMap = {
|
|
13
|
+
largePrimary: "text__large-primary",
|
|
14
|
+
mediumNormal: "text__medium-normal",
|
|
15
|
+
smallWeighted: "text__small-weighted",
|
|
16
|
+
smallNormal: "text__small-normal",
|
|
17
|
+
underlineWeighted: "text__underline-weighted",
|
|
18
|
+
lightWeighted: "text__light-weighted",
|
|
19
|
+
capsWeighted: "text__caps-weighted",
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const Heading = (props: HeadingProps) => {
|
|
23
|
+
const priority = props.priority && props.priority >= 1 && props.priority <= 6 ? props.priority : 1
|
|
24
|
+
const Tag = `h${priority}` as keyof JSX.IntrinsicElements
|
|
25
|
+
const classNames = []
|
|
26
|
+
if (props.styleType) classNames.push(HeaderStyleMap[props.styleType])
|
|
27
|
+
if (props.className) classNames.push(props.className)
|
|
28
|
+
|
|
29
|
+
return <Tag className={classNames.join(" ")}>{props.children}</Tag>
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { Heading as default, Heading }
|