@bloom-housing/ui-components 2.0.0-pre-tailwind
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/.jest/setup-tests.js +24 -0
- package/CHANGELOG.md +20 -0
- package/README.md +195 -0
- package/index.ts +148 -0
- package/jest.config.js +41 -0
- package/package.json +98 -0
- package/public/images/alameda-logo-white.svg +1 -0
- package/public/images/arrow-down.png +0 -0
- package/public/images/arrow-down.svg +1 -0
- package/public/images/check.png +0 -0
- package/public/images/check.svg +11 -0
- package/public/images/eho-logo-white.svg +1 -0
- package/public/images/eho-logo.svg +1 -0
- package/public/images/logo_glyph.svg +11 -0
- package/src/actions/Button.scss +157 -0
- package/src/actions/Button.tsx +80 -0
- package/src/actions/ExpandableContent.tsx +29 -0
- package/src/actions/ExpandableText.scss +18 -0
- package/src/actions/ExpandableText.tsx +52 -0
- package/src/actions/LinkButton.tsx +30 -0
- package/src/actions/LocalizedLink.tsx +11 -0
- package/src/authentication/AuthContext.ts +327 -0
- package/src/authentication/RequireLogin.tsx +62 -0
- package/src/authentication/index.ts +5 -0
- package/src/authentication/timeout.tsx +127 -0
- package/src/authentication/token.ts +17 -0
- package/src/authentication/useRequireLoggedInUser.ts +19 -0
- package/src/blocks/ActionBlock.scss +108 -0
- package/src/blocks/ActionBlock.tsx +51 -0
- package/src/blocks/AppStatusItem.scss +140 -0
- package/src/blocks/AppStatusItem.tsx +75 -0
- package/src/blocks/DashBlock.tsx +42 -0
- package/src/blocks/DashBlocks.scss +56 -0
- package/src/blocks/DashBlocks.tsx +7 -0
- package/src/blocks/FormCard.scss +201 -0
- package/src/blocks/FormCard.tsx +29 -0
- package/src/blocks/HousingCounselor.tsx +51 -0
- package/src/blocks/ImageCard.scss +91 -0
- package/src/blocks/ImageCard.tsx +77 -0
- package/src/blocks/InfoCard.scss +42 -0
- package/src/blocks/InfoCard.tsx +44 -0
- package/src/blocks/StatusBar.scss +30 -0
- package/src/blocks/StatusBar.tsx +31 -0
- package/src/blocks/ViewItem.scss +59 -0
- package/src/blocks/ViewItem.tsx +32 -0
- package/src/config/ConfigContext.tsx +36 -0
- package/src/config/NavigationContext.tsx +54 -0
- package/src/config/index.ts +2 -0
- package/src/footers/ExygyFooter.tsx +12 -0
- package/src/footers/SiteFooter.scss +28 -0
- package/src/footers/SiteFooter.tsx +10 -0
- package/src/forms/CloudinaryUpload.ts +50 -0
- package/src/forms/DOBField.tsx +132 -0
- package/src/forms/DateField.tsx +120 -0
- package/src/forms/Dropzone.scss +17 -0
- package/src/forms/Dropzone.tsx +67 -0
- package/src/forms/Field.tsx +115 -0
- package/src/forms/FieldGroup.tsx +82 -0
- package/src/forms/Form.tsx +22 -0
- package/src/forms/HouseholdMemberForm.tsx +41 -0
- package/src/forms/HouseholdSizeField.tsx +74 -0
- package/src/forms/PhoneField.tsx +69 -0
- package/src/forms/PhoneMask.tsx +24 -0
- package/src/forms/Select.tsx +80 -0
- package/src/forms/Textarea.scss +40 -0
- package/src/forms/Textarea.tsx +64 -0
- package/src/forms/TimeField.tsx +176 -0
- package/src/global/AppearanceTypes.ts +46 -0
- package/src/global/ApplicationStatusType.ts +6 -0
- package/src/global/accordion.scss +4 -0
- package/src/global/blocks.scss +137 -0
- package/src/global/custom_counter.scss +50 -0
- package/src/global/forms.scss +362 -0
- package/src/global/headers.scss +89 -0
- package/src/global/homepage.scss +8 -0
- package/src/global/index.scss +72 -0
- package/src/global/lists.scss +21 -0
- package/src/global/markdown.scss +33 -0
- package/src/global/mixins.scss +175 -0
- package/src/global/navbar.scss +280 -0
- package/src/global/print.scss +59 -0
- package/src/global/tables.scss +197 -0
- package/src/global/text.scss +141 -0
- package/src/global/vendor/AgPagination.tsx +133 -0
- package/src/global/vendor/_setup_bulma.scss +31 -0
- package/src/global/vendor/ag_grid.scss +140 -0
- package/src/headers/Hero.scss +56 -0
- package/src/headers/Hero.tsx +76 -0
- package/src/headers/PageHeader.scss +31 -0
- package/src/headers/PageHeader.tsx +39 -0
- package/src/headers/SiteHeader.tsx +136 -0
- package/src/helpers/address.tsx +46 -0
- package/src/helpers/blankApplication.ts +108 -0
- package/src/helpers/capitalize.tsx +7 -0
- package/src/helpers/dateToString.ts +11 -0
- package/src/helpers/debounce.ts +12 -0
- package/src/helpers/formOptions.tsx +229 -0
- package/src/helpers/formatYesNoLabel.ts +9 -0
- package/src/helpers/getTranslationWithArguments.ts +14 -0
- package/src/helpers/links.ts +7 -0
- package/src/helpers/localeRoute.tsx +13 -0
- package/src/helpers/mergeDeep.ts +12 -0
- package/src/helpers/nextjs.ts +7 -0
- package/src/helpers/numberOrdinal.ts +17 -0
- package/src/helpers/occupancyFormatting.tsx +46 -0
- package/src/helpers/pdfs.ts +19 -0
- package/src/helpers/photos.ts +19 -0
- package/src/helpers/preferences.tsx +426 -0
- package/src/helpers/resolveObject.ts +5 -0
- package/src/helpers/state.tsx +7 -0
- package/src/helpers/tableSummaries.tsx +80 -0
- package/src/helpers/translator.tsx +37 -0
- package/src/helpers/useKeyPress.ts +17 -0
- package/src/helpers/useMutate.ts +40 -0
- package/src/helpers/useOutsideClick.ts +25 -0
- package/src/helpers/validators.ts +3 -0
- package/src/icons/HeaderBadge.scss +29 -0
- package/src/icons/HeaderBadge.tsx +38 -0
- package/src/icons/Icon.scss +76 -0
- package/src/icons/Icon.tsx +145 -0
- package/src/icons/Icons.tsx +556 -0
- package/src/lists/PreferencesList.scss +72 -0
- package/src/lists/PreferencesList.tsx +60 -0
- package/src/locales/es.json +745 -0
- package/src/locales/general.json +1307 -0
- package/src/locales/general_OLD.json +868 -0
- package/src/locales/vi.json +745 -0
- package/src/locales/zh.json +745 -0
- package/src/navigation/Breadcrumbs.scss +25 -0
- package/src/navigation/Breadcrumbs.tsx +27 -0
- package/src/navigation/FooterNav.scss +47 -0
- package/src/navigation/FooterNav.tsx +19 -0
- package/src/navigation/LanguageNav.scss +32 -0
- package/src/navigation/LanguageNav.tsx +53 -0
- package/src/navigation/ProgressNav.scss +102 -0
- package/src/navigation/ProgressNav.tsx +50 -0
- package/src/navigation/TabNav.scss +38 -0
- package/src/navigation/TabNav.tsx +69 -0
- package/src/navigation/Tabs.scss +65 -0
- package/src/navigation/Tabs.tsx +93 -0
- package/src/navigation/UserNav.tsx +37 -0
- package/src/notifications/AlertBox.scss +78 -0
- package/src/notifications/AlertBox.tsx +79 -0
- package/src/notifications/AlertNotice.scss +58 -0
- package/src/notifications/AlertNotice.tsx +37 -0
- package/src/notifications/ApplicationStatus.scss +10 -0
- package/src/notifications/ApplicationStatus.tsx +64 -0
- package/src/notifications/ErrorMessage.tsx +15 -0
- package/src/notifications/SiteAlert.tsx +54 -0
- package/src/notifications/StatusAside.scss +11 -0
- package/src/notifications/StatusAside.tsx +25 -0
- package/src/notifications/StatusMessage.scss +25 -0
- package/src/notifications/StatusMessage.tsx +59 -0
- package/src/notifications/alertTypes.ts +7 -0
- package/src/notifications/index.ts +4 -0
- package/src/overlays/Drawer.scss +105 -0
- package/src/overlays/Drawer.tsx +51 -0
- package/src/overlays/LoadingOverlay.scss +25 -0
- package/src/overlays/LoadingOverlay.tsx +29 -0
- package/src/overlays/Modal.scss +55 -0
- package/src/overlays/Modal.tsx +61 -0
- package/src/overlays/Overlay.scss +50 -0
- package/src/overlays/Overlay.tsx +100 -0
- package/src/page_components/listing/AdditionalFees.tsx +56 -0
- package/src/page_components/listing/ListingCard.scss +47 -0
- package/src/page_components/listing/ListingCard.tsx +34 -0
- package/src/page_components/listing/ListingDetailHeader.tsx +25 -0
- package/src/page_components/listing/ListingDetails.tsx +29 -0
- package/src/page_components/listing/ListingMap.scss +36 -0
- package/src/page_components/listing/ListingMap.tsx +138 -0
- package/src/page_components/listing/ListingsGroup.scss +65 -0
- package/src/page_components/listing/ListingsGroup.tsx +49 -0
- package/src/page_components/listing/UnitTables.tsx +111 -0
- package/src/page_components/listing/listing_sidebar/ApplicationSection.tsx +49 -0
- package/src/page_components/listing/listing_sidebar/Apply.tsx +225 -0
- package/src/page_components/listing/listing_sidebar/LeasingAgent.tsx +77 -0
- package/src/page_components/listing/listing_sidebar/ListingUpdated.tsx +20 -0
- package/src/page_components/listing/listing_sidebar/ReferralApplication.tsx +28 -0
- package/src/page_components/listing/listing_sidebar/SidebarAddress.tsx +56 -0
- package/src/page_components/listing/listing_sidebar/Waitlist.tsx +94 -0
- package/src/page_components/listing/listing_sidebar/WhatToExpect.tsx +22 -0
- package/src/page_components/listing/listing_sidebar/events/DownloadLotteryResults.tsx +34 -0
- package/src/page_components/listing/listing_sidebar/events/EventDateSection.tsx +24 -0
- package/src/page_components/listing/listing_sidebar/events/LotteryResultsEvent.tsx +26 -0
- package/src/page_components/listing/listing_sidebar/events/OpenHouseEvent.tsx +27 -0
- package/src/page_components/listing/listing_sidebar/events/PublicLotteryEvent.tsx +22 -0
- package/src/prototypes/AppCard.scss +64 -0
- package/src/prototypes/Back.scss +19 -0
- package/src/prototypes/ButtonGroup.scss +6 -0
- package/src/prototypes/ButtonPager.scss +22 -0
- package/src/prototypes/FieldSection.scss +35 -0
- package/src/prototypes/FieldSection.tsx +31 -0
- package/src/prototypes/GridItem.tsx +15 -0
- package/src/prototypes/SideNav.scss +32 -0
- package/src/prototypes/SideNav.tsx +14 -0
- package/src/prototypes/SummaryCard.scss +34 -0
- package/src/sections/ContentSection.scss +15 -0
- package/src/sections/ContentSection.tsx +25 -0
- package/src/sections/FooterSection.scss +6 -0
- package/src/sections/FooterSection.tsx +16 -0
- package/src/sections/GridSection.scss +72 -0
- package/src/sections/GridSection.tsx +82 -0
- package/src/sections/InfoCardGrid.scss +45 -0
- package/src/sections/InfoCardGrid.tsx +20 -0
- package/src/sections/ListSection.scss +7 -0
- package/src/sections/ListSection.tsx +23 -0
- package/src/sections/MarkdownSection.scss +13 -0
- package/src/sections/MarkdownSection.tsx +21 -0
- package/src/sections/ResponsiveContentList.tsx +67 -0
- package/src/sections/ResponsiveWrappers.tsx +23 -0
- package/src/tables/GroupedTable.tsx +86 -0
- package/src/tables/MinimalTable.tsx +32 -0
- package/src/tables/ResponsiveTable.tsx +24 -0
- package/src/tables/StandardTable.tsx +229 -0
- package/src/text/Description.scss +52 -0
- package/src/text/Description.tsx +24 -0
- package/src/text/Message.scss +16 -0
- package/src/text/Message.tsx +16 -0
- package/src/text/Tag.scss +94 -0
- package/src/text/Tag.tsx +22 -0
- package/tailwind.config.js +128 -0
- package/tailwind.tosass.js +29 -0
- package/tsconfig.json +31 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
export interface GridItemProps {
|
|
4
|
+
children: React.ReactNode
|
|
5
|
+
className?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const GridItem = (props: GridItemProps) => {
|
|
9
|
+
const gridItemClasses = ["grid-item"]
|
|
10
|
+
if (props.className) gridItemClasses.push(props.className)
|
|
11
|
+
|
|
12
|
+
return <div className={gridItemClasses.join(" ")}>{props.children}</div>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { GridItem as default, GridItem }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.side-nav {
|
|
2
|
+
@apply border;
|
|
3
|
+
@apply rounded-lg;
|
|
4
|
+
|
|
5
|
+
li {
|
|
6
|
+
&:first-of-type a {
|
|
7
|
+
@apply rounded-t-lg;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&:last-of-type a {
|
|
11
|
+
@apply rounded-b-lg;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
a {
|
|
16
|
+
@apply text-gray-700;
|
|
17
|
+
@apply block;
|
|
18
|
+
@apply px-4;
|
|
19
|
+
@apply py-2;
|
|
20
|
+
@apply border-b;
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
@apply bg-primary-lighter;
|
|
24
|
+
@apply text-primary;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.is-current {
|
|
28
|
+
@apply text-gray-900;
|
|
29
|
+
box-shadow: inset 3px 0px 0px 0px $tailwind-primary;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import "./SideNav.scss"
|
|
3
|
+
|
|
4
|
+
export interface SideNavProps {
|
|
5
|
+
children: React.ReactNode[]
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const SideNav = (props: SideNavProps) => (
|
|
9
|
+
<nav className="side-nav" aria-label="Secondary navigation">
|
|
10
|
+
<ul>{props.children}</ul>
|
|
11
|
+
</nav>
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
export { SideNav as default, SideNav }
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.summary-card {
|
|
2
|
+
@apply rounded-lg;
|
|
3
|
+
@apply border-solid;
|
|
4
|
+
@apply border;
|
|
5
|
+
@apply border-gray-450;
|
|
6
|
+
|
|
7
|
+
table {
|
|
8
|
+
&.td-plain tr:last-of-type td {
|
|
9
|
+
@apply border-b-0;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.summary-card__header {
|
|
15
|
+
@apply px-5;
|
|
16
|
+
@apply py-4;
|
|
17
|
+
@apply rounded-t-lg;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.summary-card__title {
|
|
21
|
+
@apply text-lg;
|
|
22
|
+
@apply font-alt-sans;
|
|
23
|
+
|
|
24
|
+
a {
|
|
25
|
+
@apply text-primary-dark;
|
|
26
|
+
|
|
27
|
+
&:after {
|
|
28
|
+
content: "\203A";
|
|
29
|
+
@apply text-2xl;
|
|
30
|
+
@apply px-2;
|
|
31
|
+
line-height: 1.4rem;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import "./ContentSection.scss"
|
|
3
|
+
|
|
4
|
+
export interface ContentSectionProps {
|
|
5
|
+
title?: string
|
|
6
|
+
subtitle?: string
|
|
7
|
+
children: React.ReactNode
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const ContentSection = (props: ContentSectionProps) => (
|
|
11
|
+
<section className="content-section">
|
|
12
|
+
{props.title && (
|
|
13
|
+
<header className="content-section__header">
|
|
14
|
+
<hgroup>
|
|
15
|
+
<h3 className="content-section__title">{props.title}</h3>
|
|
16
|
+
<span className="content-section__subtitle">{props.subtitle}</span>
|
|
17
|
+
</hgroup>
|
|
18
|
+
</header>
|
|
19
|
+
)}
|
|
20
|
+
|
|
21
|
+
{props.children}
|
|
22
|
+
</section>
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
export { ContentSection as default, ContentSection }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import "./FooterSection.scss"
|
|
3
|
+
|
|
4
|
+
export interface FooterSectionProps {
|
|
5
|
+
children: React.ReactNode
|
|
6
|
+
className?: string
|
|
7
|
+
small?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const FooterSection = (props: FooterSectionProps) => (
|
|
11
|
+
<div className={`footer-row ${props.className || ""}`}>
|
|
12
|
+
<div className={`footer-row__section ${props.small ? "py-2" : "pb-8"}`}>{props.children}</div>
|
|
13
|
+
</div>
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
export { FooterSection as default, FooterSection }
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
.grid-section {
|
|
2
|
+
.grid-item {
|
|
3
|
+
@apply mb-4;
|
|
4
|
+
overflow-wrap: break-word; // temp fix
|
|
5
|
+
|
|
6
|
+
@screen md {
|
|
7
|
+
@apply mb-0;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&.has-separator {
|
|
12
|
+
@apply border-t;
|
|
13
|
+
@apply border-gray-450;
|
|
14
|
+
@apply pt-8;
|
|
15
|
+
@apply mt-8;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.grid-section:not(.has-separator) + .grid-section {
|
|
20
|
+
@apply mt-6;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.grid-section__header {
|
|
24
|
+
@apply mb-4;
|
|
25
|
+
@apply flex;
|
|
26
|
+
@apply flex-wrap;
|
|
27
|
+
@apply flex-col;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.grid-section__title {
|
|
31
|
+
@apply font-alt-sans;
|
|
32
|
+
@apply text-xl;
|
|
33
|
+
@apply inline-block;
|
|
34
|
+
@apply w-4/5;
|
|
35
|
+
@screen sm {
|
|
36
|
+
@apply w-auto;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.grid-section__subtitle {
|
|
41
|
+
@apply mb-4;
|
|
42
|
+
@apply text-gray-750;
|
|
43
|
+
@apply uppercase;
|
|
44
|
+
@apply font-alt-sans;
|
|
45
|
+
@apply font-bold;
|
|
46
|
+
@apply text-sm;
|
|
47
|
+
@apply tracking-widest;
|
|
48
|
+
@apply w-full;
|
|
49
|
+
@apply mt-4;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.grid-section__description {
|
|
53
|
+
@apply font-sans;
|
|
54
|
+
@apply text-base;
|
|
55
|
+
@apply text-gray-750;
|
|
56
|
+
@apply block;
|
|
57
|
+
@apply mb-4;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.grid-section__inner {
|
|
61
|
+
&.is-tinted {
|
|
62
|
+
@apply bg-primary-lighter;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.is-inset {
|
|
66
|
+
@apply p-8;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.is-reversed {
|
|
70
|
+
direction: rtl;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import "./GridSection.scss"
|
|
3
|
+
|
|
4
|
+
export interface GridCellProps {
|
|
5
|
+
children: React.ReactNode
|
|
6
|
+
span?: number
|
|
7
|
+
className?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const GridCell = (props: GridCellProps) => {
|
|
11
|
+
const gridCellClasses = ["grid-item"]
|
|
12
|
+
if (props.span) gridCellClasses.push(`md:col-span-${props.span}`)
|
|
13
|
+
if (props.className) gridCellClasses.push(props.className)
|
|
14
|
+
|
|
15
|
+
return <article className={gridCellClasses.join(" ")}>{props.children}</article>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface GridSectionProps {
|
|
19
|
+
title?: string
|
|
20
|
+
edit?: string
|
|
21
|
+
subtitle?: string
|
|
22
|
+
description?: string
|
|
23
|
+
tinted?: boolean
|
|
24
|
+
grid?: boolean
|
|
25
|
+
columns?: number
|
|
26
|
+
inset?: boolean
|
|
27
|
+
className?: string
|
|
28
|
+
tightSpacing?: boolean
|
|
29
|
+
reverse?: boolean
|
|
30
|
+
children: React.ReactNode
|
|
31
|
+
separator?: boolean
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const GridSection = (props: GridSectionProps) => {
|
|
35
|
+
const sectionClasses = ["grid-section"]
|
|
36
|
+
if (props.separator) sectionClasses.push("has-separator")
|
|
37
|
+
|
|
38
|
+
const gridClasses = ["grid-section__inner"]
|
|
39
|
+
const grid = typeof props.grid != "undefined" ? props.grid : true
|
|
40
|
+
if (props.tinted) gridClasses.push("is-tinted")
|
|
41
|
+
if (props.inset) gridClasses.push("is-inset")
|
|
42
|
+
if (grid) {
|
|
43
|
+
const columns = props.columns || 3
|
|
44
|
+
gridClasses.push(`md:grid md:grid-cols-${columns}`)
|
|
45
|
+
if (props.tightSpacing) {
|
|
46
|
+
gridClasses.push("md:gap-2")
|
|
47
|
+
} else {
|
|
48
|
+
gridClasses.push("md:gap-8")
|
|
49
|
+
}
|
|
50
|
+
if (props.reverse) gridClasses.push("is-reversed")
|
|
51
|
+
}
|
|
52
|
+
if (props.className) gridClasses.push(props.className)
|
|
53
|
+
|
|
54
|
+
const headerClasses = ["grid-section__header"]
|
|
55
|
+
if (props.subtitle && (!props.title || !props.inset)) headerClasses.push("mb-0")
|
|
56
|
+
|
|
57
|
+
const subtitleClasses = ["grid-section__subtitle"]
|
|
58
|
+
if (props.title) subtitleClasses.push("mt-4")
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<section className={sectionClasses.join(" ")}>
|
|
62
|
+
{(props.title || props.subtitle) && (
|
|
63
|
+
<header className={headerClasses.join(" ")}>
|
|
64
|
+
{props.title && <h2 className="grid-section__title">{props.title}</h2>}
|
|
65
|
+
{props.edit && (
|
|
66
|
+
<span className="ml-auto">
|
|
67
|
+
<a className="edit-link">{props.edit}</a>
|
|
68
|
+
</span>
|
|
69
|
+
)}
|
|
70
|
+
{props.subtitle && <h3 className={subtitleClasses.join(" ")}>{props.subtitle}</h3>}
|
|
71
|
+
{props.description && (
|
|
72
|
+
<span className={"grid-section__description"}>{props.description}</span>
|
|
73
|
+
)}
|
|
74
|
+
</header>
|
|
75
|
+
)}
|
|
76
|
+
|
|
77
|
+
<div className={gridClasses.join(" ")}>{props.children}</div>
|
|
78
|
+
</section>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export { GridSection as default, GridSection, GridCell }
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.info-cards__header {
|
|
2
|
+
@apply mb-3;
|
|
3
|
+
|
|
4
|
+
@screen md {
|
|
5
|
+
margin-right: 1rem;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.info-cards__title {
|
|
10
|
+
@apply font-alt-sans;
|
|
11
|
+
@apply uppercase;
|
|
12
|
+
@apply text-tiny;
|
|
13
|
+
@apply mb-5;
|
|
14
|
+
@apply pb-2;
|
|
15
|
+
@apply border-0;
|
|
16
|
+
@apply border-b-4;
|
|
17
|
+
@apply border-primary;
|
|
18
|
+
@apply font-semibold;
|
|
19
|
+
@apply text-gray-800;
|
|
20
|
+
@apply tracking-widest;
|
|
21
|
+
@apply inline-block;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.info-cards__subtitle {
|
|
25
|
+
@apply font-serif;
|
|
26
|
+
@apply mb-5;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.info-cards__grid {
|
|
30
|
+
@screen md {
|
|
31
|
+
@apply flex;
|
|
32
|
+
@apply flex-wrap;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.info-card {
|
|
36
|
+
& > :not(.info-card__title) {
|
|
37
|
+
@apply text-tiny;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@screen md {
|
|
41
|
+
width: calc(50% - 1rem);
|
|
42
|
+
margin-right: 1rem;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import "./InfoCardGrid.scss"
|
|
3
|
+
|
|
4
|
+
export interface InfoCardGridProps {
|
|
5
|
+
title: string
|
|
6
|
+
subtitle?: string
|
|
7
|
+
children: React.ReactNode
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const InfoCardGrid = (props: InfoCardGridProps) => (
|
|
11
|
+
<section className="info-cards">
|
|
12
|
+
<header className="info-cards__header">
|
|
13
|
+
<h2 className="info-cards__title">{props.title}</h2>
|
|
14
|
+
{props.subtitle && <p className="info-cards__subtitle">{props.subtitle}</p>}
|
|
15
|
+
</header>
|
|
16
|
+
<div className="info-cards__grid">{props.children}</div>
|
|
17
|
+
</section>
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
export { InfoCardGrid as default, InfoCardGrid }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import "./ListSection.scss"
|
|
3
|
+
|
|
4
|
+
export interface ListSectionProps {
|
|
5
|
+
title: string
|
|
6
|
+
subtitle: string
|
|
7
|
+
children?: React.ReactNode
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const ListSection = (props: ListSectionProps) => (
|
|
11
|
+
<li className="list-section custom-counter__item">
|
|
12
|
+
<header className="list-section__header custom-counter__header">
|
|
13
|
+
<hgroup>
|
|
14
|
+
<h4 className="custom-counter__title">{props.title}</h4>
|
|
15
|
+
<span className="custom-counter__subtitle">{props.subtitle}</span>
|
|
16
|
+
</hgroup>
|
|
17
|
+
</header>
|
|
18
|
+
|
|
19
|
+
{props.children}
|
|
20
|
+
</li>
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
export { ListSection as default, ListSection }
|