@bloom-housing/ui-components 5.0.1-alpha.0 → 5.0.1-alpha.11
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 +119 -0
- package/index.ts +3 -0
- package/package.json +2 -2
- package/src/actions/Button.docs.mdx +6 -6
- package/src/actions/Button.scss +36 -13
- package/src/actions/Button.tsx +15 -11
- package/src/actions/ExpandableContent.tsx +1 -1
- package/src/actions/LinkButton.tsx +17 -1
- package/src/blocks/ImageCard.docs.mdx +30 -0
- package/src/blocks/ImageCard.scss +45 -70
- package/src/blocks/ImageCard.tsx +10 -12
- package/src/blocks/InfoCard.scss +9 -0
- package/src/blocks/StandardCard.scss +1 -1
- package/src/global/mixins.scss +18 -11
- package/src/global/text.scss +25 -23
- package/src/global/tokens/sizes.scss +2 -0
- package/src/headers/PageHeader.scss +14 -1
- package/src/headers/PageHeader.tsx +4 -1
- package/src/lists/PreferencesList.scss +13 -9
- package/src/locales/es.json +11 -1
- package/src/locales/general.json +11 -1
- package/src/locales/tl.json +2 -1
- package/src/locales/vi.json +11 -1
- package/src/locales/zh.json +11 -1
- package/src/navigation/TabNav.scss +5 -2
- package/src/page_components/NavigationHeader.scss +3 -0
- package/src/page_components/NavigationHeader.tsx +95 -0
- package/src/page_components/listing/AdditionalFees.tsx +14 -10
- package/src/page_components/listing/ListingCard.docs.mdx +43 -0
- package/src/page_components/listing/ListingCard.scss +63 -40
- package/src/page_components/listing/ListingCard.tsx +35 -24
- package/src/page_components/listing/listing_sidebar/ExpandableSection.tsx +6 -2
- package/src/page_components/listing/listing_sidebar/GetApplication.tsx +8 -2
- package/src/page_components/listing/listing_sidebar/SidebarBlock.tsx +23 -0
- package/src/page_components/sign-in/FormSignInMFAType.tsx +2 -2
- package/src/text/Tag.docs.mdx +64 -0
- package/src/text/Tag.scss +85 -47
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,125 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.0.1-alpha.11](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@5.0.1-alpha.10...@bloom-housing/ui-components@5.0.1-alpha.11) (2022-07-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* ux updates and bug fixes for sidebar components ([#2859](https://github.com/bloom-housing/bloom/issues/2859)) ([1bd3b36](https://github.com/bloom-housing/bloom/commit/1bd3b36415ff55be88ea5ada6184de2c232f2da5))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [5.0.1-alpha.10](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@5.0.1-alpha.9...@bloom-housing/ui-components@5.0.1-alpha.10) (2022-07-08)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @bloom-housing/ui-components
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [5.0.1-alpha.9](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@5.0.1-alpha.8...@bloom-housing/ui-components@5.0.1-alpha.9) (2022-07-07)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* populate jurisdictional preferences on settings page ([#2828](https://github.com/bloom-housing/bloom/issues/2828)) ([2ea5646](https://github.com/bloom-housing/bloom/commit/2ea5646a49dc6782fe0e83e942e1917929fde153))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## [5.0.1-alpha.8](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@5.0.1-alpha.7...@bloom-housing/ui-components@5.0.1-alpha.8) (2022-07-06)
|
|
37
|
+
|
|
38
|
+
**Note:** Version bump only for package @bloom-housing/ui-components
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## [5.0.1-alpha.7](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@5.0.1-alpha.6...@bloom-housing/ui-components@5.0.1-alpha.7) (2022-07-02)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* switch back to padding for image card leader ([#2851](https://github.com/bloom-housing/bloom/issues/2851)) ([c3fde4a](https://github.com/bloom-housing/bloom/commit/c3fde4adbff2bd116c4acaf39f609d3c0ed0638f))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## [5.0.1-alpha.6](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@5.0.1-alpha.5...@bloom-housing/ui-components@5.0.1-alpha.6) (2022-06-29)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### Bug Fixes
|
|
59
|
+
|
|
60
|
+
* hide apply section if there is no data ([#2846](https://github.com/bloom-housing/bloom/issues/2846)) ([5fcaf58](https://github.com/bloom-housing/bloom/commit/5fcaf58acc8cc083c738f53a23beba4e567b2994))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## [5.0.1-alpha.5](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@5.0.1-alpha.4...@bloom-housing/ui-components@5.0.1-alpha.5) (2022-06-27)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Bug Fixes
|
|
70
|
+
|
|
71
|
+
* application due date sentence ([#2822](https://github.com/bloom-housing/bloom/issues/2822)) ([62a870e](https://github.com/bloom-housing/bloom/commit/62a870e3696849dc751e410282279e23071db544))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## [5.0.1-alpha.4](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@5.0.1-alpha.3...@bloom-housing/ui-components@5.0.1-alpha.4) (2022-06-23)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
### Features
|
|
81
|
+
|
|
82
|
+
* **preferenceslist:** add storybook example without subtitle ([4a32106](https://github.com/bloom-housing/bloom/commit/4a32106d0f171822961e4dcee5ee9013ee23b329))
|
|
83
|
+
* **preferenceslist:** move ordinal at mobile bp; update text color for contrast ([b063f5d](https://github.com/bloom-housing/bloom/commit/b063f5dd0813778f1d77efa510ee3a2d788be717)), closes [#2827](https://github.com/bloom-housing/bloom/issues/2827)
|
|
84
|
+
* **preferenceslist:** move ordinal left; make other elements align horizontally ([7034cc7](https://github.com/bloom-housing/bloom/commit/7034cc76a04e8c395ae3a51b2f2c4e5cef944086)), closes [Issue#2827](https://github.com/Issue/issues/2827)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## [5.0.1-alpha.3](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@5.0.1-alpha.2...@bloom-housing/ui-components@5.0.1-alpha.3) (2022-06-23)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Bug Fixes
|
|
94
|
+
|
|
95
|
+
* mfa verificication fields ([#2842](https://github.com/bloom-housing/bloom/issues/2842)) ([32a3df6](https://github.com/bloom-housing/bloom/commit/32a3df66a883dcffca8b304ba769f8a2d8c5c240))
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
## [5.0.1-alpha.2](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@5.0.1-alpha.1...@bloom-housing/ui-components@5.0.1-alpha.2) (2022-06-23)
|
|
102
|
+
|
|
103
|
+
**Note:** Version bump only for package @bloom-housing/ui-components
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
## [5.0.1-alpha.1](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@5.0.1-alpha.0...@bloom-housing/ui-components@5.0.1-alpha.1) (2022-06-21)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
### Features
|
|
113
|
+
|
|
114
|
+
* **listingcard:** add compatability for jsx elements in subheader ([#2821](https://github.com/bloom-housing/bloom/issues/2821)) ([77693dc](https://github.com/bloom-housing/bloom/commit/77693dcee60be8deba641595ed6ae5e141d14a51))
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### BREAKING CHANGES
|
|
118
|
+
|
|
119
|
+
* **listingcard:** prop name change for header from "text" to "content"
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
6
125
|
## [5.0.1-alpha.0](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.4.1-alpha.27...@bloom-housing/ui-components@5.0.1-alpha.0) (2022-06-16)
|
|
7
126
|
|
|
8
127
|
|
package/index.ts
CHANGED
|
@@ -82,6 +82,7 @@ export * from "./src/navigation/LanguageNav"
|
|
|
82
82
|
export * from "./src/navigation/ProgressNav"
|
|
83
83
|
export * from "./src/navigation/TabNav"
|
|
84
84
|
export * from "./src/navigation/Tabs"
|
|
85
|
+
export * from "./src/navigation/Breadcrumbs"
|
|
85
86
|
|
|
86
87
|
/* Notifications */
|
|
87
88
|
export * from "./src/notifications/AlertBox"
|
|
@@ -115,6 +116,7 @@ export * from "./src/page_components/listing/listing_sidebar/NumberedHeader"
|
|
|
115
116
|
export * from "./src/page_components/listing/listing_sidebar/OrDivider"
|
|
116
117
|
export * from "./src/page_components/listing/listing_sidebar/ReferralApplication"
|
|
117
118
|
export * from "./src/page_components/listing/listing_sidebar/ContactAddress"
|
|
119
|
+
export * from "./src/page_components/listing/listing_sidebar/SidebarBlock"
|
|
118
120
|
export * from "./src/page_components/listing/listing_sidebar/SubmitApplication"
|
|
119
121
|
export * from "./src/page_components/listing/listing_sidebar/QuantityRowSection"
|
|
120
122
|
export * from "./src/page_components/listing/listing_sidebar/ExpandableSection"
|
|
@@ -128,6 +130,7 @@ export * from "./src/page_components/sign-in/FormSignInMFACode"
|
|
|
128
130
|
export * from "./src/page_components/sign-in/FormSignInAddPhone"
|
|
129
131
|
export * from "./src/page_components/sign-in/FormSignInErrorBox"
|
|
130
132
|
export * from "./src/page_components/forgot-password/FormForgotPassword"
|
|
133
|
+
export * from "./src/page_components/NavigationHeader"
|
|
131
134
|
|
|
132
135
|
/* Responsive Wrappers */
|
|
133
136
|
export * from "./src/sections/ResponsiveWrappers"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloom-housing/ui-components",
|
|
3
|
-
"version": "5.0.1-alpha.
|
|
3
|
+
"version": "5.0.1-alpha.11",
|
|
4
4
|
"author": "Sean Albert <sean.albert@exygy.com>",
|
|
5
5
|
"description": "Shared user interface components for Bloom affordable housing system",
|
|
6
6
|
"homepage": "https://github.com/bloom-housing/bloom/tree/master/shared/ui-components",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"ts-jest": "^26.4.1",
|
|
109
109
|
"typesafe-actions": "^5.1.0"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "7641496db149c31bf7307ed44367ae1b3688e2b7"
|
|
112
112
|
}
|
|
@@ -50,12 +50,12 @@ You can apply CSS variables to the `.button` selector to customize the appearanc
|
|
|
50
50
|
| `--alert-appearance-hover-background-color` | <Swatch colorVar="--bloom-color-alert-dark" /> | Hover state alert background color |
|
|
51
51
|
| `--alert-appearance-hover-border-color` | <Swatch colorVar="--bloom-color-alert" /> | Hover state alert border color |
|
|
52
52
|
| `--alert-appearance-hover-label-color` | <Swatch colorVar="--bloom-color-white" /> | Hover state alert label color |
|
|
53
|
-
| `--
|
|
54
|
-
| `--
|
|
55
|
-
| `--
|
|
56
|
-
| `--
|
|
57
|
-
| `--
|
|
58
|
-
| `--
|
|
53
|
+
| `--warning-appearance-background-color` | <Swatch colorVar="--bloom-color-warn" /> | Warning background color |
|
|
54
|
+
| `--warning-appearance-border-color` | <Swatch colorVar="--bloom-color-warn" /> | Warning border color |
|
|
55
|
+
| `--warning-appearance-label-color` | <Swatch colorVar="--bloom-color-white" /> | Warning label color |
|
|
56
|
+
| `--warning-appearance-hover-background-color` | <Swatch colorVar="--bloom-color-warn-dark" /> | Hover state warning background color |
|
|
57
|
+
| `--warning-appearance-hover-border-color` | <Swatch colorVar="--bloom-color-warn" /> | Hover state warning border color |
|
|
58
|
+
| `--warning-appearance-hover-label-color` | <Swatch colorVar="--bloom-color-white" /> | Hover state warning label color |
|
|
59
59
|
|
|
60
60
|
### Typographic & Spacing Variables
|
|
61
61
|
|
package/src/actions/Button.scss
CHANGED
|
@@ -1,18 +1,38 @@
|
|
|
1
1
|
@import "../global/mixins.scss";
|
|
2
2
|
|
|
3
3
|
.button {
|
|
4
|
+
/* Component Variables */
|
|
5
|
+
--normal-rounded: var(--bloom-rounded);
|
|
6
|
+
--normal-padding: var(--bloom-s4) var(--bloom-s6);
|
|
7
|
+
--label-transform: uppercase;
|
|
8
|
+
--label-font: var(--bloom-font-alt-sans);
|
|
9
|
+
--label-letter-spacing: var(--bloom-letter-spacing-widest);
|
|
10
|
+
--normal-font-size: var(--bloom-font-size-sm);
|
|
11
|
+
--label-weight: bold;
|
|
12
|
+
--small-rounded: var(--bloom-rounded);
|
|
13
|
+
--small-padding: var(--bloom-s3) var(--bloom-s6);
|
|
14
|
+
--small-font-size: var(--bloom-font-size-xs);
|
|
15
|
+
--big-rounded: var(--bloom-rounded);
|
|
16
|
+
--big-padding: var(--bloom-s6);
|
|
17
|
+
--big-font-size: var(--bloom-font-size-sm);
|
|
18
|
+
|
|
19
|
+
/* Base Styles */
|
|
4
20
|
position: relative;
|
|
5
|
-
border-radius: var(--normal-rounded
|
|
6
|
-
padding: var(--normal-padding
|
|
21
|
+
border-radius: var(--normal-rounded);
|
|
22
|
+
padding: var(--normal-padding);
|
|
7
23
|
text-align: center;
|
|
8
|
-
text-transform: var(--label-transform
|
|
9
|
-
font-family: var(--label-font
|
|
24
|
+
text-transform: var(--label-transform);
|
|
25
|
+
font-family: var(--label-font);
|
|
10
26
|
display: inline-block;
|
|
11
|
-
letter-spacing: var(--label-letter-spacing
|
|
12
|
-
font-size: var(--normal-font-size
|
|
13
|
-
font-weight: var(--label-weight
|
|
27
|
+
letter-spacing: var(--label-letter-spacing);
|
|
28
|
+
font-size: var(--normal-font-size);
|
|
29
|
+
font-weight: var(--label-weight);
|
|
14
30
|
line-height: var(--bloom-line-height-snug);
|
|
15
31
|
|
|
32
|
+
&.transition {
|
|
33
|
+
transition: all 200ms ease-out;
|
|
34
|
+
}
|
|
35
|
+
|
|
16
36
|
&:focus {
|
|
17
37
|
outline: none;
|
|
18
38
|
box-shadow: 0 0 0 2px #fff, 0 0 3px 4px var(--bloom-color-accent-cool);
|
|
@@ -20,6 +40,9 @@
|
|
|
20
40
|
|
|
21
41
|
&:hover {
|
|
22
42
|
border-color: var(--bloom-color-primary-dark);
|
|
43
|
+
&.transition {
|
|
44
|
+
transition: all 200ms ease-in;
|
|
45
|
+
}
|
|
23
46
|
}
|
|
24
47
|
|
|
25
48
|
&:disabled {
|
|
@@ -40,15 +63,15 @@
|
|
|
40
63
|
}
|
|
41
64
|
|
|
42
65
|
&.is-small {
|
|
43
|
-
border-radius: var(--small-rounded
|
|
44
|
-
padding: var(--small-padding
|
|
45
|
-
font-size: var(--small-font-size
|
|
66
|
+
border-radius: var(--small-rounded);
|
|
67
|
+
padding: var(--small-padding);
|
|
68
|
+
font-size: var(--small-font-size);
|
|
46
69
|
}
|
|
47
70
|
|
|
48
71
|
&.is-big {
|
|
49
|
-
border-radius: var(--big-rounded
|
|
50
|
-
padding: var(--big-padding
|
|
51
|
-
font-size: var(--big-font-size
|
|
72
|
+
border-radius: var(--big-rounded);
|
|
73
|
+
padding: var(--big-padding);
|
|
74
|
+
font-size: var(--big-font-size);
|
|
52
75
|
}
|
|
53
76
|
|
|
54
77
|
&.is-normal-case {
|
package/src/actions/Button.tsx
CHANGED
|
@@ -4,24 +4,26 @@ import { AppearanceProps, classNamesForAppearanceTypes } from "../global/Appeara
|
|
|
4
4
|
import { Icon, IconSize, UniversalIconType } from "../icons/Icon"
|
|
5
5
|
|
|
6
6
|
export interface ButtonProps extends AppearanceProps {
|
|
7
|
-
id?: string
|
|
8
|
-
|
|
7
|
+
"data-test-id"?: string
|
|
8
|
+
ariaHidden?: boolean
|
|
9
|
+
ariaLabel?: string
|
|
9
10
|
children: React.ReactNode
|
|
10
|
-
|
|
11
|
+
className?: string
|
|
12
|
+
dataTestId?: string
|
|
13
|
+
disabled?: boolean
|
|
14
|
+
fullWidth?: boolean
|
|
11
15
|
icon?: UniversalIconType
|
|
12
16
|
iconPlacement?: "left" | "right"
|
|
13
17
|
iconSize?: IconSize
|
|
18
|
+
id?: string
|
|
14
19
|
// TODO: inlineIcon is deprecated
|
|
15
|
-
inlineIcon?: "left" | "right"
|
|
16
20
|
inline?: boolean
|
|
17
|
-
|
|
18
|
-
fullWidth?: boolean
|
|
19
|
-
className?: string
|
|
20
|
-
disabled?: boolean
|
|
21
|
+
inlineIcon?: "left" | "right"
|
|
21
22
|
loading?: boolean
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
23
|
+
onClick?: (e: React.MouseEvent) => void
|
|
24
|
+
transition?: boolean
|
|
25
|
+
type?: "button" | "submit" | "reset"
|
|
26
|
+
unstyled?: boolean
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
export const buttonClassesForProps = (props: Omit<ButtonProps, "onClick">) => {
|
|
@@ -35,6 +37,7 @@ export const buttonClassesForProps = (props: Omit<ButtonProps, "onClick">) => {
|
|
|
35
37
|
if (props.fullWidth) classNames.push("is-fullwidth")
|
|
36
38
|
if (props.className) classNames.push(props.className)
|
|
37
39
|
if (props.loading) classNames.push("is-loading")
|
|
40
|
+
if (props.transition) classNames.push("transition")
|
|
38
41
|
return classNames
|
|
39
42
|
}
|
|
40
43
|
|
|
@@ -75,6 +78,7 @@ const Button = (props: ButtonProps) => {
|
|
|
75
78
|
className={buttonClasses.join(" ")}
|
|
76
79
|
onClick={props.onClick}
|
|
77
80
|
disabled={props.disabled || props.loading}
|
|
81
|
+
aria-hidden={props.ariaHidden}
|
|
78
82
|
aria-label={props.ariaLabel}
|
|
79
83
|
data-test-id={props.dataTestId || props["data-test-id"]}
|
|
80
84
|
>
|
|
@@ -15,6 +15,7 @@ const ExpandableContent = ({ children, strings, className }: ExpandableContentPr
|
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
17
|
<div className={rootClassNames}>
|
|
18
|
+
{isExpanded && <div>{children}</div>}
|
|
18
19
|
<button
|
|
19
20
|
type="button"
|
|
20
21
|
className="button is-unstyled m-0 no-underline has-toggle"
|
|
@@ -25,7 +26,6 @@ const ExpandableContent = ({ children, strings, className }: ExpandableContentPr
|
|
|
25
26
|
>
|
|
26
27
|
{isExpanded ? strings.readLess : strings.readMore}
|
|
27
28
|
</button>
|
|
28
|
-
{isExpanded && <div className="mt-6">{children}</div>}
|
|
29
29
|
</div>
|
|
30
30
|
)
|
|
31
31
|
}
|
|
@@ -3,10 +3,14 @@ import "./Button.scss"
|
|
|
3
3
|
import { buttonClassesForProps, buttonInner, ButtonProps } from "./Button"
|
|
4
4
|
import { NavigationContext } from "../config/NavigationContext"
|
|
5
5
|
import { isExternalLink } from "../helpers/links"
|
|
6
|
+
import { faUpRightFromSquare } from "@fortawesome/free-solid-svg-icons"
|
|
7
|
+
import { Icon } from "../icons/Icon"
|
|
6
8
|
|
|
7
9
|
export interface LinkButtonProps extends Omit<ButtonProps, "onClick"> {
|
|
8
10
|
href: string
|
|
9
11
|
dataTestId?: string
|
|
12
|
+
newTab?: boolean
|
|
13
|
+
newTabIcon?: boolean
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
const LinkButton = (props: LinkButtonProps) => {
|
|
@@ -15,14 +19,26 @@ const LinkButton = (props: LinkButtonProps) => {
|
|
|
15
19
|
|
|
16
20
|
if (isExternalLink(props.href)) {
|
|
17
21
|
return (
|
|
18
|
-
<a
|
|
22
|
+
<a
|
|
23
|
+
href={props.href}
|
|
24
|
+
className={buttonClasses.join(" ")}
|
|
25
|
+
data-test-id={props.dataTestId}
|
|
26
|
+
target={props.newTab ? "_blank" : "_self"}
|
|
27
|
+
>
|
|
19
28
|
{buttonInner(props)}
|
|
29
|
+
{props.newTabIcon && (
|
|
30
|
+
<>
|
|
31
|
+
<Icon symbol={faUpRightFromSquare} size={"small"} className={"ml-2"} />
|
|
32
|
+
<span className="sr-only">{"Opens in a new tab"}</span>
|
|
33
|
+
</>
|
|
34
|
+
)}
|
|
20
35
|
</a>
|
|
21
36
|
)
|
|
22
37
|
} else {
|
|
23
38
|
return (
|
|
24
39
|
<LinkComponent
|
|
25
40
|
href={props.href}
|
|
41
|
+
aria-hidden={props.ariaHidden}
|
|
26
42
|
className={buttonClasses.join(" ")}
|
|
27
43
|
data-test-id={props.dataTestId}
|
|
28
44
|
>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Canvas, Story, ArgsTable } from "@storybook/addon-docs"
|
|
2
|
+
import { Swatch } from "../prototypes/Swatch"
|
|
3
|
+
import { ImageCard } from "./ImageCard"
|
|
4
|
+
|
|
5
|
+
# Image Card
|
|
6
|
+
|
|
7
|
+
The image card component renders an image with optional tags at top and status bars below it.
|
|
8
|
+
|
|
9
|
+
<Canvas>
|
|
10
|
+
<Story id="blocks-image-card--with-one-status-and-tag" />
|
|
11
|
+
</Canvas>
|
|
12
|
+
|
|
13
|
+
<br />
|
|
14
|
+
<br />
|
|
15
|
+
|
|
16
|
+
## Component Properties
|
|
17
|
+
|
|
18
|
+
<ArgsTable of={ImageCard} />
|
|
19
|
+
|
|
20
|
+
## Theming Variables
|
|
21
|
+
|
|
22
|
+
You can apply CSS variables to the `.image-card` selector to customize the appearance of the component. Interior tags themselves are customizable separately, see the **Text/Tag** documentation for details.
|
|
23
|
+
|
|
24
|
+
| Name | Type | Description | Default |
|
|
25
|
+
| ---------------------------- | -------------------------------------------- | ------------------------------------------------------------------ | ------------------------ |
|
|
26
|
+
| `--default-background-color` | <Swatch colorVar="--bloom-color-gray-500" /> | Background color when an image URL isn't available | `--bloom-color-gray-500` |
|
|
27
|
+
| `--border-radius` | Size | The border radius of the card | `0px` |
|
|
28
|
+
| `--image-height` | Size | A height limit for the image area | `auto` |
|
|
29
|
+
| `--tags-justify-mobile` | Flex Jusification | The horizontal alignment of tags over the image on mobile screens | `center` |
|
|
30
|
+
| `--tags-justify-desktop` | Flex Jusification | The horizontal alignment of tags over the image on desktop screens | `flex-start` |
|
|
@@ -1,92 +1,67 @@
|
|
|
1
1
|
@import "../global/mixins.scss";
|
|
2
2
|
|
|
3
|
-
.image-
|
|
4
|
-
|
|
3
|
+
.image-card {
|
|
4
|
+
/* Component Variables */
|
|
5
|
+
--default-background-color: var(--bloom-color-gray-500);
|
|
6
|
+
--border-radius: 0px;
|
|
7
|
+
--image-height: auto;
|
|
8
|
+
--tags-justify-mobile: center;
|
|
9
|
+
--tags-justify-desktop: flex-start;
|
|
10
|
+
|
|
11
|
+
position: relative;
|
|
5
12
|
}
|
|
6
13
|
|
|
7
|
-
.image-
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
.image-card__inner {
|
|
15
|
+
position: relative;
|
|
16
|
+
background-color: var(--default-background-color);
|
|
17
|
+
border-radius: var(--border-radius);
|
|
18
|
+
|
|
10
19
|
img {
|
|
11
|
-
|
|
20
|
+
border-radius: var(--border-radius);
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: var(--image-height);
|
|
23
|
+
object-fit: cover;
|
|
12
24
|
}
|
|
13
25
|
}
|
|
14
26
|
|
|
15
27
|
.image-card-tag__wrapper {
|
|
16
|
-
|
|
17
|
-
@apply items-center;
|
|
18
|
-
@apply justify-center;
|
|
19
|
-
@apply absolute;
|
|
20
|
-
@apply z-10;
|
|
21
|
-
@apply w-full;
|
|
22
|
-
@apply mt-1;
|
|
23
|
-
@apply px-4;
|
|
24
|
-
@apply flex-wrap;
|
|
28
|
+
--tags-justify: var(--tags-justify-mobile);
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@apply py-1;
|
|
37
|
-
}
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: var(--tags-justify);
|
|
33
|
+
position: absolute;
|
|
34
|
+
z-index: 10;
|
|
35
|
+
width: 100%;
|
|
36
|
+
margin-block-start: var(--bloom-s1);
|
|
37
|
+
padding-inline: var(--bloom-s4);
|
|
38
|
+
flex-wrap: wrap;
|
|
39
|
+
max-width: 100%;
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
41
|
+
@media (min-width: $screen-sm) {
|
|
42
|
+
--tags-justify: var(--tags-justify-desktop);
|
|
43
|
+
}
|
|
42
44
|
|
|
43
|
-
.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
@apply p-3;
|
|
47
|
-
@apply m-5;
|
|
48
|
-
}
|
|
45
|
+
.tag {
|
|
46
|
+
margin-top: var(--bloom-s3);
|
|
47
|
+
margin-inline: var(--bloom-s2);
|
|
49
48
|
|
|
50
|
-
.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
@apply text-lg;
|
|
54
|
-
@apply uppercase;
|
|
55
|
-
@apply font-alt-sans;
|
|
56
|
-
@apply relative;
|
|
57
|
-
@apply z-10;
|
|
58
|
-
@apply tracking-wider;
|
|
59
|
-
@apply px-5;
|
|
60
|
-
@apply pb-1;
|
|
61
|
-
@screen md {
|
|
62
|
-
@apply text-3xl;
|
|
49
|
+
.ui-icon {
|
|
50
|
+
margin-inline-end: var(--bloom-s2);
|
|
51
|
+
}
|
|
63
52
|
}
|
|
64
53
|
}
|
|
65
54
|
|
|
66
|
-
.image-
|
|
67
|
-
|
|
68
|
-
@apply text-left;
|
|
69
|
-
@apply uppercase;
|
|
70
|
-
@apply font-alt-sans;
|
|
71
|
-
@apply text-sm;
|
|
72
|
-
@apply px-5;
|
|
73
|
-
@apply pb-3;
|
|
74
|
-
@apply relative;
|
|
75
|
-
@apply z-10;
|
|
76
|
-
@apply tracking-widest;
|
|
55
|
+
.image-card__placeholder {
|
|
56
|
+
height: 300px;
|
|
77
57
|
}
|
|
78
58
|
|
|
79
59
|
.image-card--leader {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
@screen md {
|
|
83
|
-
@apply w-2/3;
|
|
84
|
-
@apply pr-8;
|
|
85
|
-
@apply pt-8;
|
|
86
|
-
}
|
|
60
|
+
width: 100%;
|
|
87
61
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
62
|
+
@media (min-width: $screen-sm) {
|
|
63
|
+
width: var(--bloom-width-2-3rd);
|
|
64
|
+
padding-block-start: var(--bloom-s8);
|
|
65
|
+
padding-inline-end: var(--bloom-s8);
|
|
91
66
|
}
|
|
92
67
|
}
|
package/src/blocks/ImageCard.tsx
CHANGED
|
@@ -20,27 +20,26 @@ export interface ImageTag {
|
|
|
20
20
|
text?: string
|
|
21
21
|
iconType?: UniversalIconType
|
|
22
22
|
iconColor?: string
|
|
23
|
+
styleType?: AppearanceStyleType
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export interface ImageCardProps {
|
|
27
|
+
/** A description of the image, used as alt text */
|
|
26
28
|
description?: string
|
|
29
|
+
/** A link, used to wrap the entire component */
|
|
27
30
|
href?: string
|
|
31
|
+
/** An image URL, used as the background image */
|
|
28
32
|
imageUrl?: string
|
|
33
|
+
/** A list of status indicators, an ApplicationStatus component is rendered for each item at the bottom of the card */
|
|
29
34
|
statuses?: StatusBarType[]
|
|
35
|
+
/** A list of image tags, a Tag component is rendered for each over the image */
|
|
30
36
|
tags?: ImageTag[]
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
/**
|
|
34
40
|
* @component ImageCard
|
|
35
41
|
*
|
|
36
|
-
* A component that renders an image with optional status bars below it
|
|
37
|
-
*
|
|
38
|
-
* @prop description - A description of the image, used as alt text
|
|
39
|
-
* @prop href - A link, used to wrap the entire component
|
|
40
|
-
* @prop imageUrl - An image URL, used as a background image
|
|
41
|
-
* @prop statuses - A list of status indicators, an ApplicationStatus component is rendered for each item at the bottom of the card
|
|
42
|
-
* @prop tags - A list of image tags, a Tag component is rendered for each over the image
|
|
43
|
-
*
|
|
42
|
+
* A component that renders an image with optional tags at top and status bars below it
|
|
44
43
|
*/
|
|
45
44
|
const ImageCard = (props: ImageCardProps) => {
|
|
46
45
|
const getStatuses = () => {
|
|
@@ -61,18 +60,17 @@ const ImageCard = (props: ImageCardProps) => {
|
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
const image = (
|
|
64
|
-
<div className="image-
|
|
63
|
+
<div className="image-card">
|
|
65
64
|
<div className="image-card-tag__wrapper">
|
|
66
65
|
{props.tags?.map((tag, index) => {
|
|
67
66
|
return (
|
|
68
67
|
<React.Fragment key={index}>
|
|
69
|
-
<Tag styleType={AppearanceStyleType.warning}
|
|
68
|
+
<Tag styleType={tag.styleType || AppearanceStyleType.warning}>
|
|
70
69
|
{tag.iconType && (
|
|
71
70
|
<Icon
|
|
72
71
|
size={"medium"}
|
|
73
72
|
symbol={tag.iconType}
|
|
74
73
|
fill={tag.iconColor ?? IconFillColors.primary}
|
|
75
|
-
className={"mr-2"}
|
|
76
74
|
/>
|
|
77
75
|
)}
|
|
78
76
|
{tag.text}
|
|
@@ -81,7 +79,7 @@ const ImageCard = (props: ImageCardProps) => {
|
|
|
81
79
|
)
|
|
82
80
|
})}
|
|
83
81
|
</div>
|
|
84
|
-
<figure className="image-
|
|
82
|
+
<figure className="image-card__inner">
|
|
85
83
|
{props.imageUrl ? (
|
|
86
84
|
<img src={props.imageUrl} alt={props.description || t("listings.buildingImageAltText")} />
|
|
87
85
|
) : (
|
package/src/blocks/InfoCard.scss
CHANGED
|
@@ -35,8 +35,17 @@
|
|
|
35
35
|
|
|
36
36
|
.info-card__columns {
|
|
37
37
|
@apply flex;
|
|
38
|
+
@apply flex-wrap;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
.info-card__column {
|
|
41
42
|
@apply flex-1;
|
|
42
43
|
}
|
|
44
|
+
.info-card__column-2 {
|
|
45
|
+
flex: 1 1 100%;
|
|
46
|
+
@apply mt-4;
|
|
47
|
+
@apply mr-4;
|
|
48
|
+
@media (min-width: 440px) {
|
|
49
|
+
flex: 1 1 45%;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
.standard-card__title {
|
|
20
20
|
color: var(--title-color);
|
|
21
21
|
font-family: var(--font-family);
|
|
22
|
-
padding: var(--bloom-s6) var(--bloom-
|
|
22
|
+
padding: var(--bloom-s6) var(--bloom-s5) var(--bloom-s2) var(--bloom-s5);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.standard-card__blank {
|