@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,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
|
+
export const resolveObject = (path: string, obj: any, separator = ".") => {
|
|
3
|
+
const properties = Array.isArray(path) ? path : path.split(separator)
|
|
4
|
+
return properties.reduce((prev, curr) => prev && prev[curr], obj)
|
|
5
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { t } from "./translator"
|
|
3
|
+
import { UnitSummary } from "@bloom-housing/backend-core/types"
|
|
4
|
+
import { GroupedTableGroup } from "../tables/GroupedTable"
|
|
5
|
+
|
|
6
|
+
export const unitSummariesTable = (summaries: UnitSummary[]) => {
|
|
7
|
+
const unitSummaries = summaries.map((unitSummary) => {
|
|
8
|
+
const unitPluralization = unitSummary.totalAvailable == 1 ? t("t.unit") : t("t.units")
|
|
9
|
+
const minIncome =
|
|
10
|
+
unitSummary.minIncomeRange.min == unitSummary.minIncomeRange.max ? (
|
|
11
|
+
<strong>{unitSummary.minIncomeRange.min}</strong>
|
|
12
|
+
) : (
|
|
13
|
+
<>
|
|
14
|
+
<strong>{unitSummary.minIncomeRange.min}</strong> {t("t.to")}{" "}
|
|
15
|
+
<strong>{unitSummary.minIncomeRange.max}</strong>
|
|
16
|
+
</>
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
const getRent = (rentMin: string, rentMax: string, percent = false) => {
|
|
20
|
+
const unit = percent ? `% ${t("t.income")}` : ` ${t("t.perMonth")}`
|
|
21
|
+
return rentMin == rentMax ? (
|
|
22
|
+
<>
|
|
23
|
+
<strong>{rentMin}</strong>
|
|
24
|
+
{unit}
|
|
25
|
+
</>
|
|
26
|
+
) : (
|
|
27
|
+
<>
|
|
28
|
+
<strong>{rentMin}</strong> {t("t.to")} <strong>{rentMax}</strong>
|
|
29
|
+
{unit}
|
|
30
|
+
</>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Use rent as percent income if available, otherwise use exact rent
|
|
35
|
+
const rent = unitSummary.rentAsPercentIncomeRange.min
|
|
36
|
+
? getRent(
|
|
37
|
+
unitSummary.rentAsPercentIncomeRange.min.toString(),
|
|
38
|
+
unitSummary.rentAsPercentIncomeRange.max.toString(),
|
|
39
|
+
true
|
|
40
|
+
)
|
|
41
|
+
: getRent(unitSummary.rentRange.min, unitSummary.rentRange.max)
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
unitType: <strong>{t(`listings.unitTypes.${unitSummary.unitType.name}`)}</strong>,
|
|
45
|
+
minimumIncome: (
|
|
46
|
+
<>
|
|
47
|
+
{minIncome} {t("t.perMonth")}
|
|
48
|
+
</>
|
|
49
|
+
),
|
|
50
|
+
rent: <>{rent}</>,
|
|
51
|
+
availability: (
|
|
52
|
+
<>
|
|
53
|
+
{unitSummary.totalAvailable > 0 ? (
|
|
54
|
+
<>
|
|
55
|
+
<strong>{unitSummary.totalAvailable}</strong> {unitPluralization}
|
|
56
|
+
</>
|
|
57
|
+
) : (
|
|
58
|
+
<span className="uppercase">{t("listings.waitlist.label")}</span>
|
|
59
|
+
)}
|
|
60
|
+
</>
|
|
61
|
+
),
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
return unitSummaries
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const getSummariesTable = (summaries: UnitSummary[]) => {
|
|
69
|
+
let groupedUnits = [] as Array<GroupedTableGroup>
|
|
70
|
+
|
|
71
|
+
if (summaries?.length > 0) {
|
|
72
|
+
const unitSummaries = unitSummariesTable(summaries)
|
|
73
|
+
groupedUnits = [
|
|
74
|
+
{
|
|
75
|
+
data: unitSummaries,
|
|
76
|
+
},
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
return groupedUnits
|
|
80
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Polyglot from "node-polyglot"
|
|
2
|
+
|
|
3
|
+
interface TranslatorConfig {
|
|
4
|
+
polyglot?: any
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const translatorConfig: TranslatorConfig = {}
|
|
8
|
+
;(global as any).Translator = translatorConfig
|
|
9
|
+
|
|
10
|
+
export const addTranslation = (translationPhrases: any, resetPolyglot = false) => {
|
|
11
|
+
if (!translatorConfig.polyglot || resetPolyglot) {
|
|
12
|
+
// Set up the initial Polyglot instance and phrases
|
|
13
|
+
translatorConfig.polyglot = new Polyglot({
|
|
14
|
+
phrases: translationPhrases,
|
|
15
|
+
})
|
|
16
|
+
} else {
|
|
17
|
+
// Extend the Polyglot instance with new phrases
|
|
18
|
+
translatorConfig.polyglot.extend(translationPhrases)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const t = (phrase: string, options?: any): string => {
|
|
23
|
+
if (translatorConfig.polyglot) {
|
|
24
|
+
return translatorConfig.polyglot.t(phrase, options)
|
|
25
|
+
}
|
|
26
|
+
return "{{ Missing Translation Phrases }}"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const locale = () => {
|
|
30
|
+
if (!translatorConfig.polyglot) {
|
|
31
|
+
return translatorConfig.polyglot()
|
|
32
|
+
} else {
|
|
33
|
+
return "en"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { t as default, t, locale }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useEffect } from "react"
|
|
2
|
+
|
|
3
|
+
function useKeyPress(targetKey: string, callback: () => unknown) {
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
function keyUp(e: KeyboardEvent) {
|
|
6
|
+
if (e.key === targetKey) callback()
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
window.addEventListener("keyup", keyUp)
|
|
10
|
+
|
|
11
|
+
return () => {
|
|
12
|
+
window.removeEventListener("keyup", keyUp)
|
|
13
|
+
}
|
|
14
|
+
}, [targetKey, callback])
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default useKeyPress
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useState } from "react"
|
|
2
|
+
|
|
3
|
+
const useMutate = <UseMutateResponse>() => {
|
|
4
|
+
const [data, setData] = useState<UseMutateResponse | undefined>(undefined)
|
|
5
|
+
const [isSuccess, setSuccess] = useState(false)
|
|
6
|
+
const [isLoading, setLoading] = useState(false)
|
|
7
|
+
const [isError, setError] = useState(null)
|
|
8
|
+
|
|
9
|
+
const mutate = async (mutateFn: (args?: unknown) => Promise<UseMutateResponse>) => {
|
|
10
|
+
try {
|
|
11
|
+
setLoading(true)
|
|
12
|
+
const response = await mutateFn()
|
|
13
|
+
setData(response)
|
|
14
|
+
setSuccess(true)
|
|
15
|
+
setLoading(false)
|
|
16
|
+
} catch (err) {
|
|
17
|
+
setSuccess(false)
|
|
18
|
+
setLoading(false)
|
|
19
|
+
setError(err)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const reset = () => {
|
|
24
|
+
setData(undefined)
|
|
25
|
+
setSuccess(false)
|
|
26
|
+
setLoading(false)
|
|
27
|
+
setError(null)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
mutate,
|
|
32
|
+
reset,
|
|
33
|
+
data,
|
|
34
|
+
isSuccess,
|
|
35
|
+
isLoading,
|
|
36
|
+
isError,
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { useMutate as default, useMutate }
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect, useCallback, RefObject } from "react"
|
|
2
|
+
|
|
3
|
+
type OutsideClickProps = {
|
|
4
|
+
ref: RefObject<Element>
|
|
5
|
+
callback: () => unknown
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const useOutsideClick = ({ ref, callback }: OutsideClickProps) => {
|
|
9
|
+
const handleClick = useCallback(
|
|
10
|
+
(e) => {
|
|
11
|
+
if (ref?.current && !ref.current.contains(e.target)) {
|
|
12
|
+
callback()
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
[ref, callback]
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
document.addEventListener("click", handleClick)
|
|
20
|
+
|
|
21
|
+
return () => {
|
|
22
|
+
document.removeEventListener("click", handleClick)
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
|
2
|
+
export const passwordRegex = /^(?=.*[0-9])(?=.*[a-zA-Z])([a-zA-Z0-9]+).{7,}$/
|
|
3
|
+
export const urlRegex = /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})$/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.header-badge {
|
|
2
|
+
@apply inline-block;
|
|
3
|
+
@apply p-4;
|
|
4
|
+
@apply pt-0;
|
|
5
|
+
@pply mb-4;
|
|
6
|
+
@apply border-solid;
|
|
7
|
+
@apply border-b-4;
|
|
8
|
+
@apply border-primary;
|
|
9
|
+
|
|
10
|
+
@screen md {
|
|
11
|
+
@apply px-8;
|
|
12
|
+
@apply pb-4;
|
|
13
|
+
@apply mb-6;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ui-icon {
|
|
17
|
+
@apply inline-block;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
svg {
|
|
21
|
+
@apply h-10;
|
|
22
|
+
@apply w-10;
|
|
23
|
+
|
|
24
|
+
@screen md {
|
|
25
|
+
@apply h-12;
|
|
26
|
+
@apply w-12;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import "./HeaderBadge.scss"
|
|
3
|
+
|
|
4
|
+
const HeaderBadge = () => (
|
|
5
|
+
<span className="header-badge">
|
|
6
|
+
<svg id="i-application" viewBox="0 0 24 32">
|
|
7
|
+
<title>application</title>
|
|
8
|
+
<path fill="#edebda" d="M24.51 7.626l-7.626-7.626h-16.885v31.592h24.51v-23.966z"></path>
|
|
9
|
+
<path fill="#cec9ae" d="M16.885 0v7.626h7.626l-7.626-7.626z"></path>
|
|
10
|
+
<path
|
|
11
|
+
fill="#cec9ae"
|
|
12
|
+
d="M19.064 11.982h-8.715c-0.301 0-0.544-0.243-0.544-0.544s0.245-0.544 0.544-0.544h8.715c0.301 0 0.544 0.245 0.544 0.544s-0.245 0.544-0.544 0.544z"
|
|
13
|
+
></path>
|
|
14
|
+
<path
|
|
15
|
+
fill="#13a085"
|
|
16
|
+
d="M5.992 12.528c-0.139 0-0.28-0.054-0.386-0.16l-1.090-1.090c-0.213-0.213-0.213-0.557 0-0.77s0.557-0.213 0.77 0l0.744 0.744 2.342-1.874c0.235-0.187 0.578-0.15 0.766 0.085s0.15 0.578-0.085 0.766l-2.723 2.179c-0.101 0.080-0.221 0.12-0.341 0.12z"
|
|
17
|
+
></path>
|
|
18
|
+
<path
|
|
19
|
+
fill="#cec9ae"
|
|
20
|
+
d="M19.064 17.974h-8.715c-0.301 0-0.544-0.243-0.544-0.544s0.245-0.544 0.544-0.544h8.715c0.301 0 0.544 0.243 0.544 0.544s-0.245 0.544-0.544 0.544z"
|
|
21
|
+
></path>
|
|
22
|
+
<path
|
|
23
|
+
fill="#13a085"
|
|
24
|
+
d="M5.992 18.518c-0.139 0-0.28-0.053-0.386-0.16l-1.090-1.090c-0.213-0.213-0.213-0.557 0-0.77s0.557-0.213 0.77 0l0.744 0.744 2.342-1.874c0.235-0.187 0.578-0.15 0.766 0.085s0.15 0.578-0.085 0.766l-2.723 2.179c-0.101 0.080-0.221 0.12-0.341 0.12z"
|
|
25
|
+
></path>
|
|
26
|
+
<path
|
|
27
|
+
fill="#cec9ae"
|
|
28
|
+
d="M19.064 23.966h-8.715c-0.301 0-0.544-0.243-0.544-0.544s0.245-0.544 0.544-0.544h8.715c0.301 0 0.544 0.243 0.544 0.544s-0.245 0.544-0.544 0.544z"
|
|
29
|
+
></path>
|
|
30
|
+
<path
|
|
31
|
+
fill="#13a085"
|
|
32
|
+
d="M5.992 24.51c-0.139 0-0.28-0.053-0.386-0.16l-1.090-1.090c-0.213-0.213-0.213-0.557 0-0.77s0.557-0.213 0.77 0l0.744 0.744 2.342-1.874c0.235-0.187 0.578-0.15 0.766 0.085s0.15 0.578-0.085 0.766l-2.723 2.179c-0.101 0.080-0.221 0.12-0.341 0.12z"
|
|
33
|
+
></path>
|
|
34
|
+
</svg>
|
|
35
|
+
</span>
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
export { HeaderBadge as default, HeaderBadge }
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@keyframes icons-svg-spin {
|
|
2
|
+
0% {
|
|
3
|
+
transform: rotate(0deg);
|
|
4
|
+
}
|
|
5
|
+
100% {
|
|
6
|
+
transform: rotate(359deg);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.spinner-animation > svg {
|
|
11
|
+
animation: icons-svg-spin 1s linear infinite;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ui-icon svg {
|
|
15
|
+
@apply inline-block;
|
|
16
|
+
@apply align-middle;
|
|
17
|
+
@apply w-6;
|
|
18
|
+
@apply h-6;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ui-icon svg {
|
|
22
|
+
margin-top: -3px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ui-tiny svg {
|
|
26
|
+
@apply w-2;
|
|
27
|
+
@apply h-2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ui-small svg {
|
|
31
|
+
@apply w-3;
|
|
32
|
+
@apply h-3;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ui-medium svg {
|
|
36
|
+
@apply w-4;
|
|
37
|
+
@apply h-4;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ui-large svg {
|
|
41
|
+
@apply w-8;
|
|
42
|
+
@apply h-8;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ui-xlarge svg {
|
|
46
|
+
@apply w-10;
|
|
47
|
+
@apply h-10;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ui-2xl svg {
|
|
51
|
+
@apply w-12;
|
|
52
|
+
@apply h-12;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ui-3xl svg {
|
|
56
|
+
@apply w-16;
|
|
57
|
+
@apply h-16;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ui-white svg use {
|
|
61
|
+
fill: #fff !important;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
a svg use {
|
|
65
|
+
fill: $tailwind-primary;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.bg-alert-light svg use {
|
|
69
|
+
fill: $tailwind-alert;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ui-icon {
|
|
73
|
+
&.is-primary svg use {
|
|
74
|
+
fill: $tailwind-primary;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import "./Icon.scss"
|
|
3
|
+
import {
|
|
4
|
+
Application,
|
|
5
|
+
ArrowBack,
|
|
6
|
+
ArrowDown,
|
|
7
|
+
ArrowForward,
|
|
8
|
+
Assistance,
|
|
9
|
+
Asterisk,
|
|
10
|
+
Bed,
|
|
11
|
+
Browse,
|
|
12
|
+
Building,
|
|
13
|
+
Calendar,
|
|
14
|
+
Check,
|
|
15
|
+
Clock,
|
|
16
|
+
Close,
|
|
17
|
+
CloseRound,
|
|
18
|
+
Cross,
|
|
19
|
+
Down,
|
|
20
|
+
Download,
|
|
21
|
+
Draggable,
|
|
22
|
+
Edit,
|
|
23
|
+
Eligibility,
|
|
24
|
+
Eye,
|
|
25
|
+
Favorite,
|
|
26
|
+
File,
|
|
27
|
+
Forward,
|
|
28
|
+
Globe,
|
|
29
|
+
Info,
|
|
30
|
+
Left,
|
|
31
|
+
Lightbulb,
|
|
32
|
+
Like,
|
|
33
|
+
LikeFill,
|
|
34
|
+
Link,
|
|
35
|
+
List,
|
|
36
|
+
Lock,
|
|
37
|
+
Mail,
|
|
38
|
+
Map,
|
|
39
|
+
MapThin,
|
|
40
|
+
Menu,
|
|
41
|
+
Oval,
|
|
42
|
+
Phone,
|
|
43
|
+
Plus,
|
|
44
|
+
Polygon,
|
|
45
|
+
Profile,
|
|
46
|
+
Question,
|
|
47
|
+
Result,
|
|
48
|
+
Right,
|
|
49
|
+
Search,
|
|
50
|
+
Settings,
|
|
51
|
+
Spinner,
|
|
52
|
+
Star,
|
|
53
|
+
Ticket,
|
|
54
|
+
Trash,
|
|
55
|
+
Warning,
|
|
56
|
+
} from "./Icons"
|
|
57
|
+
|
|
58
|
+
const IconMap = {
|
|
59
|
+
application: Application,
|
|
60
|
+
arrowBack: ArrowBack,
|
|
61
|
+
arrowForward: ArrowForward,
|
|
62
|
+
arrowDown: ArrowDown,
|
|
63
|
+
assistance: Assistance,
|
|
64
|
+
asterisk: Asterisk,
|
|
65
|
+
bed: Bed,
|
|
66
|
+
browse: Browse,
|
|
67
|
+
building: Building,
|
|
68
|
+
calendar: Calendar,
|
|
69
|
+
check: Check,
|
|
70
|
+
clock: Clock,
|
|
71
|
+
close: Close,
|
|
72
|
+
closeRound: CloseRound,
|
|
73
|
+
cross: Cross,
|
|
74
|
+
down: Down,
|
|
75
|
+
download: Download,
|
|
76
|
+
draggable: Draggable,
|
|
77
|
+
edit: Edit,
|
|
78
|
+
eligibility: Eligibility,
|
|
79
|
+
eye: Eye,
|
|
80
|
+
favorite: Favorite,
|
|
81
|
+
file: File,
|
|
82
|
+
forward: Forward,
|
|
83
|
+
globe: Globe,
|
|
84
|
+
info: Info,
|
|
85
|
+
left: Left,
|
|
86
|
+
lightbulb: Lightbulb,
|
|
87
|
+
like: Like,
|
|
88
|
+
likeFill: LikeFill,
|
|
89
|
+
link: Link,
|
|
90
|
+
list: List,
|
|
91
|
+
lock: Lock,
|
|
92
|
+
mail: Mail,
|
|
93
|
+
map: Map,
|
|
94
|
+
mapThin: MapThin,
|
|
95
|
+
menu: Menu,
|
|
96
|
+
oval: Oval,
|
|
97
|
+
phone: Phone,
|
|
98
|
+
plus: Plus,
|
|
99
|
+
polygon: Polygon,
|
|
100
|
+
profile: Profile,
|
|
101
|
+
question: Question,
|
|
102
|
+
result: Result,
|
|
103
|
+
right: Right,
|
|
104
|
+
search: Search,
|
|
105
|
+
settings: Settings,
|
|
106
|
+
spinner: Spinner,
|
|
107
|
+
star: Star,
|
|
108
|
+
ticket: Ticket,
|
|
109
|
+
trash: Trash,
|
|
110
|
+
warning: Warning,
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type IconTypes = keyof typeof IconMap
|
|
114
|
+
|
|
115
|
+
export type IconFill = "white" | "primary"
|
|
116
|
+
|
|
117
|
+
export const IconFillColors = {
|
|
118
|
+
white: "#ffffff",
|
|
119
|
+
black: "#000000",
|
|
120
|
+
primary: "#0077DA",
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface IconProps {
|
|
124
|
+
size: "tiny" | "small" | "medium" | "large" | "xlarge" | "2xl" | "3xl"
|
|
125
|
+
symbol: IconTypes
|
|
126
|
+
className?: string
|
|
127
|
+
fill?: string
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const Icon = (props: IconProps) => {
|
|
131
|
+
const wrapperClasses = ["ui-icon"]
|
|
132
|
+
wrapperClasses.push(`ui-${props.size}`)
|
|
133
|
+
if (props.className) wrapperClasses.push(props.className)
|
|
134
|
+
if (props.symbol == "spinner") wrapperClasses.push("spinner-animation")
|
|
135
|
+
|
|
136
|
+
const SpecificIcon = IconMap[props.symbol]
|
|
137
|
+
|
|
138
|
+
return (
|
|
139
|
+
<span className={wrapperClasses.join(" ")}>
|
|
140
|
+
<SpecificIcon fill={props.fill ? props.fill : undefined} />
|
|
141
|
+
</span>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export { Icon as default, Icon }
|