@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,91 @@
|
|
|
1
|
+
@import "../global/mixins.scss";
|
|
2
|
+
|
|
3
|
+
.image-card__wrapper {
|
|
4
|
+
@apply relative;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.image-card {
|
|
8
|
+
@apply relative;
|
|
9
|
+
@include has-image-skeleton();
|
|
10
|
+
|
|
11
|
+
img {
|
|
12
|
+
@apply w-full;
|
|
13
|
+
min-height: 3rem;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.image-card-tag__wrapper {
|
|
18
|
+
@apply flex;
|
|
19
|
+
@apply items-center;
|
|
20
|
+
@apply justify-center;
|
|
21
|
+
@apply absolute;
|
|
22
|
+
@apply z-10;
|
|
23
|
+
@apply w-full;
|
|
24
|
+
@apply mt-4;
|
|
25
|
+
|
|
26
|
+
@screen md {
|
|
27
|
+
@apply items-start;
|
|
28
|
+
@apply justify-start;
|
|
29
|
+
@apply ml-4;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.image-card__figcaption {
|
|
34
|
+
@apply absolute;
|
|
35
|
+
@apply inset-x-0;
|
|
36
|
+
@apply bottom-0;
|
|
37
|
+
@apply py-1;
|
|
38
|
+
|
|
39
|
+
&:before {
|
|
40
|
+
@include overlay-image;
|
|
41
|
+
@include custom-linear-gradient(transparent, rgba(0, 0, 0, 0.8));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.image-card__tag {
|
|
46
|
+
@apply absolute;
|
|
47
|
+
@apply top-0;
|
|
48
|
+
@apply p-3;
|
|
49
|
+
@apply m-5;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.image-card__title {
|
|
53
|
+
@apply text-white;
|
|
54
|
+
@apply text-left;
|
|
55
|
+
@apply text-3xl;
|
|
56
|
+
@apply uppercase;
|
|
57
|
+
@apply font-alt-sans;
|
|
58
|
+
@apply relative;
|
|
59
|
+
@apply z-10;
|
|
60
|
+
@apply tracking-wider;
|
|
61
|
+
@apply px-5;
|
|
62
|
+
@apply pb-1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.image-card__subtitle {
|
|
66
|
+
@apply text-white;
|
|
67
|
+
@apply text-left;
|
|
68
|
+
@apply uppercase;
|
|
69
|
+
@apply font-alt-sans;
|
|
70
|
+
@apply text-sm;
|
|
71
|
+
@apply px-5;
|
|
72
|
+
@apply pb-3;
|
|
73
|
+
@apply relative;
|
|
74
|
+
@apply z-10;
|
|
75
|
+
@apply tracking-widest;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.image-card--leader {
|
|
79
|
+
@apply w-full;
|
|
80
|
+
|
|
81
|
+
@screen md {
|
|
82
|
+
@apply w-2/3;
|
|
83
|
+
@apply pr-8;
|
|
84
|
+
@apply pt-8;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.image-card__title {
|
|
88
|
+
@apply text-4xl;
|
|
89
|
+
@apply text-center;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { LocalizedLink } from "../actions/LocalizedLink"
|
|
3
|
+
import { ApplicationStatus } from "../notifications/ApplicationStatus"
|
|
4
|
+
import "./ImageCard.scss"
|
|
5
|
+
import { Tag } from "../text/Tag"
|
|
6
|
+
import { ApplicationStatusType } from "../global/ApplicationStatusType"
|
|
7
|
+
import { AppearanceStyleType } from "../global/AppearanceTypes"
|
|
8
|
+
import { t } from "../helpers/translator"
|
|
9
|
+
|
|
10
|
+
export interface StatusBarType {
|
|
11
|
+
status?: ApplicationStatusType
|
|
12
|
+
content: string
|
|
13
|
+
subContent?: string
|
|
14
|
+
hideIcon?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ImageCardProps {
|
|
18
|
+
imageUrl: string
|
|
19
|
+
subtitle?: string
|
|
20
|
+
title: string
|
|
21
|
+
href?: string
|
|
22
|
+
description?: string
|
|
23
|
+
tagLabel?: string
|
|
24
|
+
statuses?: StatusBarType[]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const ImageCard = (props: ImageCardProps) => {
|
|
28
|
+
const getStatuses = () => {
|
|
29
|
+
return props.statuses?.map((status, index) => {
|
|
30
|
+
return (
|
|
31
|
+
<aside className="image-card__status" aria-label={status.content} key={index}>
|
|
32
|
+
<ApplicationStatus
|
|
33
|
+
status={status.status}
|
|
34
|
+
content={status.content}
|
|
35
|
+
subContent={status.subContent}
|
|
36
|
+
withIcon={!status.hideIcon}
|
|
37
|
+
vivid
|
|
38
|
+
/>
|
|
39
|
+
</aside>
|
|
40
|
+
)
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const image = (
|
|
45
|
+
<div className="image-card__wrapper">
|
|
46
|
+
{props.tagLabel && (
|
|
47
|
+
<div className="image-card-tag__wrapper">
|
|
48
|
+
<Tag styleType={AppearanceStyleType.warning}>{props.tagLabel}</Tag>
|
|
49
|
+
</div>
|
|
50
|
+
)}
|
|
51
|
+
<figure className="image-card">
|
|
52
|
+
{props.imageUrl && (
|
|
53
|
+
<img src={props.imageUrl} alt={props.description || t("listings.buildingImageAltText")} />
|
|
54
|
+
)}
|
|
55
|
+
<figcaption className="image-card__figcaption">
|
|
56
|
+
<h2 className="image-card__title">{props.title}</h2>
|
|
57
|
+
{props.subtitle && <p className="image-card__subtitle">{props.subtitle}</p>}
|
|
58
|
+
</figcaption>
|
|
59
|
+
</figure>
|
|
60
|
+
{getStatuses()}
|
|
61
|
+
</div>
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
let card = image
|
|
65
|
+
|
|
66
|
+
if (props.href) {
|
|
67
|
+
card = (
|
|
68
|
+
<LocalizedLink className="block" href={props.href}>
|
|
69
|
+
{image}
|
|
70
|
+
</LocalizedLink>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return card
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { ImageCard as default, ImageCard }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.info-card {
|
|
2
|
+
@apply p-6;
|
|
3
|
+
@apply rounded;
|
|
4
|
+
@apply border;
|
|
5
|
+
@apply border-gray-450;
|
|
6
|
+
@apply mb-4;
|
|
7
|
+
@apply bg-white;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.info-card.is-normal-primary-lighter,
|
|
11
|
+
.markdown .info-card {
|
|
12
|
+
@apply bg-primary-lighter;
|
|
13
|
+
|
|
14
|
+
.info-card__title {
|
|
15
|
+
@apply text-base;
|
|
16
|
+
@apply normal-case;
|
|
17
|
+
@apply tracking-normal;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.info-card__title {
|
|
22
|
+
@apply text-gray-800;
|
|
23
|
+
@apply uppercase;
|
|
24
|
+
@apply font-sans;
|
|
25
|
+
@apply font-bold;
|
|
26
|
+
@apply text-sm;
|
|
27
|
+
@apply tracking-wide;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.info-card__header {
|
|
31
|
+
&:not([class*="mb-"]) {
|
|
32
|
+
@apply mb-4;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.info-card__columns {
|
|
37
|
+
@apply flex;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.info-card__column {
|
|
41
|
+
@apply flex-1;
|
|
42
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import "./InfoCard.scss"
|
|
3
|
+
import Markdown from "markdown-to-jsx"
|
|
4
|
+
|
|
5
|
+
export interface InfoCardProps {
|
|
6
|
+
title: string
|
|
7
|
+
subtitle?: string
|
|
8
|
+
externalHref?: string
|
|
9
|
+
className?: string
|
|
10
|
+
children: React.ReactNode
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const InfoCard = (props: InfoCardProps) => {
|
|
14
|
+
const wrapperClasses = ["info-card"]
|
|
15
|
+
if (props.className) {
|
|
16
|
+
wrapperClasses.push(props.className)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className={wrapperClasses.join(" ")}>
|
|
21
|
+
<div className={"info-card__header"}>
|
|
22
|
+
{props.externalHref ? (
|
|
23
|
+
<h3 className="info-card__title">
|
|
24
|
+
<a href={props.externalHref} target="_blank">
|
|
25
|
+
{props.title}
|
|
26
|
+
</a>
|
|
27
|
+
</h3>
|
|
28
|
+
) : (
|
|
29
|
+
<h3 className="info-card__title">{props.title}</h3>
|
|
30
|
+
)}
|
|
31
|
+
{props.subtitle && <span className={"text-sm text-gray-700"}>{props.subtitle}</span>}
|
|
32
|
+
</div>
|
|
33
|
+
{typeof props.children == "string" ? (
|
|
34
|
+
<div className="markdown">
|
|
35
|
+
<Markdown options={{ disableParsingRawHTML: true }} children={props.children} />
|
|
36
|
+
</div>
|
|
37
|
+
) : (
|
|
38
|
+
props.children
|
|
39
|
+
)}
|
|
40
|
+
</div>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { InfoCard as default, InfoCard }
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.status-bar {
|
|
2
|
+
@apply border-t;
|
|
3
|
+
@apply bg-white;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.status-bar__row {
|
|
7
|
+
@apply flex;
|
|
8
|
+
@apply flex-row;
|
|
9
|
+
@apply w-full;
|
|
10
|
+
@apply mx-auto;
|
|
11
|
+
@apply max-w-screen-xl;
|
|
12
|
+
@apply justify-between;
|
|
13
|
+
@apply px-5;
|
|
14
|
+
@apply items-center;
|
|
15
|
+
@apply my-3;
|
|
16
|
+
|
|
17
|
+
&.tag-only {
|
|
18
|
+
@apply flex-row-reverse;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
.status-bar__tag {
|
|
22
|
+
@screen md {
|
|
23
|
+
@apply pl-6;
|
|
24
|
+
@apply w-3/12;
|
|
25
|
+
}
|
|
26
|
+
.tag.is-pill {
|
|
27
|
+
display: inline-block;
|
|
28
|
+
width: 100%;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import "./StatusBar.scss"
|
|
3
|
+
import { AppearanceStyleType } from "../global/AppearanceTypes"
|
|
4
|
+
import { Tag } from "../text/Tag"
|
|
5
|
+
|
|
6
|
+
export interface StatusBarProps {
|
|
7
|
+
backButton?: React.ReactNode
|
|
8
|
+
tagStyle: AppearanceStyleType
|
|
9
|
+
tagLabel: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const StatusBar = (props: StatusBarProps) => {
|
|
13
|
+
const rowClasses = ["status-bar__row"]
|
|
14
|
+
if (!props.backButton) rowClasses.push("tag-only")
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<section className="status-bar">
|
|
18
|
+
<div className={rowClasses.join(" ")}>
|
|
19
|
+
{props.backButton}
|
|
20
|
+
|
|
21
|
+
<div className="status-bar__tag">
|
|
22
|
+
<Tag styleType={props.tagStyle} pillStyle>
|
|
23
|
+
{props.tagLabel}
|
|
24
|
+
</Tag>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</section>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { StatusBar as default, StatusBar }
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
@import "../global/mixins.scss";
|
|
2
|
+
|
|
3
|
+
.view-item {
|
|
4
|
+
@apply relative;
|
|
5
|
+
@apply text-base;
|
|
6
|
+
@apply mb-4;
|
|
7
|
+
|
|
8
|
+
&:last-of-type {
|
|
9
|
+
@apply mb-0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&.is-flagged {
|
|
13
|
+
@apply bg-warn-light;
|
|
14
|
+
@apply -my-1;
|
|
15
|
+
@apply py-1;
|
|
16
|
+
@apply -ml-8;
|
|
17
|
+
@apply pl-8;
|
|
18
|
+
box-shadow: inset 2px 0px 0px 0px $tailwind-warn;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.edit-link {
|
|
22
|
+
@apply absolute;
|
|
23
|
+
right: 0;
|
|
24
|
+
top: 0;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.view-item__label {
|
|
29
|
+
@apply text-gray-800;
|
|
30
|
+
@apply font-sans;
|
|
31
|
+
@apply text-tiny;
|
|
32
|
+
@apply block;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.view-item__value {
|
|
36
|
+
@apply font-alt-sans;
|
|
37
|
+
@apply tracking-wide;
|
|
38
|
+
@apply font-semibold;
|
|
39
|
+
@apply block;
|
|
40
|
+
padding-top: 10px;
|
|
41
|
+
|
|
42
|
+
&.is-truncated {
|
|
43
|
+
@include ellipsis;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// do not change font-family for inputs
|
|
47
|
+
.field .control .input,
|
|
48
|
+
.error-message {
|
|
49
|
+
@apply font-sans;
|
|
50
|
+
@apply font-normal;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.view-item__helper {
|
|
55
|
+
@apply text-gray-750;
|
|
56
|
+
@apply font-sans;
|
|
57
|
+
@apply text-tiny;
|
|
58
|
+
@apply block;
|
|
59
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import "./ViewItem.scss"
|
|
3
|
+
|
|
4
|
+
export interface ViewItemProps {
|
|
5
|
+
id?: string
|
|
6
|
+
label?: string
|
|
7
|
+
children?: React.ReactNode
|
|
8
|
+
helper?: string
|
|
9
|
+
flagged?: boolean
|
|
10
|
+
className?: string
|
|
11
|
+
truncated?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const ViewItem = (props: ViewItemProps) => {
|
|
15
|
+
const viewItemClasses = ["view-item"]
|
|
16
|
+
if (props.flagged) viewItemClasses.push("is-flagged")
|
|
17
|
+
if (props.className) viewItemClasses.push(props.className)
|
|
18
|
+
|
|
19
|
+
let valueClassName = "view-item__value"
|
|
20
|
+
if (!props.label) valueClassName += " pt-0"
|
|
21
|
+
if (props.truncated) valueClassName += " is-truncated"
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div id={props.id} className={viewItemClasses.join(" ")}>
|
|
25
|
+
{props.label && <span className="view-item__label">{props.label}</span>}
|
|
26
|
+
{props.children && <span className={valueClassName}>{props.children}</span>}
|
|
27
|
+
{props.helper && <span className="view-item__helper">{props.helper}</span>}
|
|
28
|
+
</div>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { ViewItem as default, ViewItem }
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createContext, createElement, FunctionComponent } from "react"
|
|
2
|
+
|
|
3
|
+
type ConfigContextProps = {
|
|
4
|
+
storageType: "local" | "session"
|
|
5
|
+
apiUrl: string
|
|
6
|
+
idleTimeout: number
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const timeoutMinutes = parseInt(process.env.idleTimeout || process.env.IDLE_TIMEOUT || "5")
|
|
10
|
+
const defaultTimeout = timeoutMinutes * 60 * 1000
|
|
11
|
+
|
|
12
|
+
export const ConfigContext = createContext<ConfigContextProps>({
|
|
13
|
+
storageType: "session",
|
|
14
|
+
apiUrl: "",
|
|
15
|
+
idleTimeout: defaultTimeout,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export const ConfigProvider: FunctionComponent<{
|
|
19
|
+
apiUrl: string
|
|
20
|
+
storageType?: ConfigContextProps["storageType"]
|
|
21
|
+
idleTimeout?: number
|
|
22
|
+
}> = ({ apiUrl, storageType = "session", idleTimeout = defaultTimeout, children }) => {
|
|
23
|
+
return createElement(
|
|
24
|
+
ConfigContext.Provider,
|
|
25
|
+
{
|
|
26
|
+
value: {
|
|
27
|
+
apiUrl,
|
|
28
|
+
storageType,
|
|
29
|
+
idleTimeout,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
children
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default ConfigContext
|