@bloom-housing/ui-components 4.2.3 → 4.3.0

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +535 -2
  2. package/README.md +10 -4
  3. package/index.ts +14 -10
  4. package/package.json +6 -4
  5. package/src/actions/Button.docs.mdx +76 -0
  6. package/src/actions/Button.scss +58 -61
  7. package/src/authentication/timeout.tsx +1 -0
  8. package/src/blocks/DashBlock.tsx +5 -3
  9. package/src/blocks/DashBlocks.scss +4 -1
  10. package/src/blocks/FormCard.tsx +1 -1
  11. package/src/forms/FieldGroup.tsx +18 -17
  12. package/src/global/app-css.scss +7 -0
  13. package/src/global/markdown.scss +20 -0
  14. package/src/global/mixins.scss +66 -49
  15. package/src/global/tables.scss +236 -58
  16. package/src/global/text.scss +11 -3
  17. package/src/global/tokens/borders.scss +15 -0
  18. package/src/global/tokens/colors.scss +64 -0
  19. package/src/global/tokens/fonts.scss +45 -0
  20. package/src/global/tokens/screens.scss +6 -0
  21. package/src/global/tokens/sizes.scss +48 -0
  22. package/src/headers/Heading.tsx +2 -0
  23. package/src/headers/PageHeader.docs.mdx +45 -0
  24. package/src/headers/PageHeader.scss +30 -17
  25. package/src/headers/PageHeader.tsx +2 -10
  26. package/src/headers/SiteHeader.tsx +7 -1
  27. package/src/helpers/MultiLineAddress.tsx +37 -0
  28. package/src/helpers/OneLineAddress.tsx +21 -0
  29. package/src/helpers/tableSummaries.tsx +34 -23
  30. package/src/locales/general.json +12 -2
  31. package/src/navigation/FooterNav.scss +8 -3
  32. package/src/overlays/Drawer.tsx +11 -3
  33. package/src/overlays/Modal.tsx +16 -7
  34. package/src/overlays/Overlay.tsx +4 -3
  35. package/src/page_components/ApplicationTimeline.scss +36 -0
  36. package/src/page_components/ApplicationTimeline.tsx +33 -0
  37. package/src/page_components/forgot-password/FormForgotPassword.tsx +5 -4
  38. package/src/page_components/listing/AdditionalFees.tsx +38 -31
  39. package/src/page_components/listing/ListingCard.scss +12 -0
  40. package/src/page_components/listing/ListingCard.tsx +5 -3
  41. package/src/page_components/listing/ListingMap.tsx +7 -2
  42. package/src/page_components/listing/UnitTables.tsx +19 -18
  43. package/src/page_components/listing/listing_sidebar/Contact.tsx +110 -0
  44. package/src/page_components/listing/listing_sidebar/ContactAddress.tsx +41 -0
  45. package/src/page_components/listing/listing_sidebar/GetApplication.tsx +35 -15
  46. package/src/page_components/listing/listing_sidebar/QuantityRowSection.tsx +46 -0
  47. package/src/page_components/listing/listing_sidebar/SubmitApplication.tsx +52 -57
  48. package/src/page_components/listing/listing_sidebar/events/EventSection.tsx +3 -2
  49. package/src/page_components/sign-in/FormSignIn.tsx +2 -1
  50. package/src/page_components/sign-in/ResendConfirmationModal.tsx +106 -0
  51. package/src/prototypes/Swatch.tsx +10 -0
  52. package/src/tables/CategoryTable.tsx +33 -0
  53. package/src/tables/GroupedTable.tsx +5 -5
  54. package/src/tables/MinimalTable.tsx +12 -2
  55. package/src/tables/StackedTable.tsx +38 -26
  56. package/src/tables/StandardTable.tsx +26 -10
  57. package/tailwind.config.js +76 -81
  58. package/tailwind.tosass.js +2 -1
  59. package/src/helpers/address.tsx +0 -46
  60. package/src/page_components/listing/listing_sidebar/LeasingAgent.tsx +0 -72
  61. package/src/page_components/listing/listing_sidebar/SidebarAddress.tsx +0 -56
  62. package/src/page_components/listing/listing_sidebar/Waitlist.tsx +0 -49
@@ -1,46 +0,0 @@
1
- import * as React from "react"
2
- import Markdown from "markdown-to-jsx"
3
-
4
- export interface Address {
5
- city?: string
6
- latitude?: number
7
- longitude?: number
8
- placeName?: string
9
- state?: string
10
- street2?: string
11
- street?: string
12
- zipCode?: string
13
- }
14
-
15
- interface AddressProps {
16
- address: Address
17
- }
18
-
19
- export const OneLineAddress = (props: AddressProps) => {
20
- if (!props.address) return null
21
-
22
- return (
23
- <>
24
- {props.address.street},{` `}
25
- {props.address.city}, {props.address.state} {props.address.zipCode}
26
- </>
27
- )
28
- }
29
-
30
- export const MultiLineAddress = (props: AddressProps) => {
31
- if (!props.address) return null
32
-
33
- return (
34
- <>
35
- {props.address.placeName && (
36
- <>
37
- {props.address.placeName}
38
- <br />
39
- </>
40
- )}
41
- <Markdown children={props.address.street || ""} />
42
- <br />
43
- {props.address.city}, {props.address.state} {props.address.zipCode}
44
- </>
45
- )
46
- }
@@ -1,72 +0,0 @@
1
- import * as React from "react"
2
- import { SidebarAddress } from "./SidebarAddress"
3
- import { t } from "../../../helpers/translator"
4
- import { Icon, IconFillColors } from "../../../icons/Icon"
5
- import { Listing } from "@bloom-housing/backend-core/types"
6
-
7
- interface LeasingAgentProps {
8
- listing: Listing
9
- managementCompany?: { name: string; website: string }
10
- }
11
-
12
- const LeasingAgent = (props: LeasingAgentProps) => {
13
- const listing = props.listing
14
-
15
- const phoneNumber = listing.leasingAgentPhone
16
- ? `tel:${listing.leasingAgentPhone.replace(/[-()]/g, "")}`
17
- : ""
18
-
19
- let managementWebsite = props.managementCompany?.website
20
- if (managementWebsite && !managementWebsite.startsWith("http")) {
21
- managementWebsite = `http://${managementWebsite}`
22
- }
23
-
24
- return (
25
- <section className="aside-block">
26
- <h4 className="text-caps-underline">{t("leasingAgent.contact")}</h4>
27
-
28
- {listing.leasingAgentName && <p className="text-xl">{listing.leasingAgentName}</p>}
29
- {listing.leasingAgentTitle && <p className="text-gray-700">{listing.leasingAgentTitle}</p>}
30
- {props.managementCompany?.name && (
31
- <p className="text-gray-700">{props.managementCompany.name}</p>
32
- )}
33
-
34
- {listing.leasingAgentPhone && (
35
- <>
36
- <p className="mt-5">
37
- <a href={phoneNumber}>
38
- <Icon symbol="phone" size="medium" fill={IconFillColors.primary} /> {t("t.call")}{" "}
39
- {listing.leasingAgentPhone}
40
- </a>
41
- </p>
42
- <p className="text-sm text-gray-700">{t("leasingAgent.dueToHighCallVolume")}</p>
43
- </>
44
- )}
45
-
46
- {listing.leasingAgentEmail && (
47
- <p className="my-5">
48
- <a href={`mailto:${listing.leasingAgentEmail}`}>
49
- <Icon symbol="mail" size="medium" fill={IconFillColors.primary} /> {t("t.email")}
50
- </a>
51
- </p>
52
- )}
53
-
54
- {managementWebsite && (
55
- <p className="my-5">
56
- <a href={managementWebsite} target="_blank" rel="noreferrer noopener">
57
- <Icon symbol="globe" size="medium" fill={IconFillColors.primary} /> {t("t.website")}
58
- </a>
59
- </p>
60
- )}
61
-
62
- {listing.leasingAgentAddress && (
63
- <SidebarAddress
64
- address={listing.leasingAgentAddress}
65
- officeHours={listing.leasingAgentOfficeHours}
66
- />
67
- )}
68
- </section>
69
- )
70
- }
71
-
72
- export { LeasingAgent as default, LeasingAgent }
@@ -1,56 +0,0 @@
1
- import * as React from "react"
2
- import ReactDOMServer from "react-dom/server"
3
- import { Icon, IconFillColors } from "../../../icons/Icon"
4
- import { OneLineAddress, MultiLineAddress, Address } from "../../../helpers/address"
5
- import { t } from "../../../helpers/translator"
6
- import Markdown from "markdown-to-jsx"
7
-
8
- export interface SidebarAddressProps {
9
- address?: Address
10
- officeHours?: string
11
- }
12
-
13
- const SidebarAddress = (props: SidebarAddressProps) => {
14
- const { address, officeHours } = props
15
- let mainAddress = null
16
- let googleMapsHref = ""
17
- let hours = <></>
18
-
19
- if (address?.street) {
20
- const oneLineAddress = <OneLineAddress address={address} />
21
- mainAddress = <MultiLineAddress address={address} />
22
-
23
- googleMapsHref =
24
- "https://www.google.com/maps/place/" + ReactDOMServer.renderToStaticMarkup(oneLineAddress)
25
- }
26
-
27
- if (officeHours) {
28
- hours = (
29
- <>
30
- <h3 className="text-caps-tiny ">{t("leasingAgent.officeHours")}</h3>
31
- <div className="text-gray-800 text-tiny markdown">
32
- <Markdown children={officeHours} options={{ disableParsingRawHTML: true }} />
33
- </div>
34
- </>
35
- )
36
- }
37
-
38
- return (
39
- <>
40
- {address?.street && (
41
- <>
42
- <p className="text-gray-700 mb-1">{mainAddress}</p>
43
- <p className="mb-4">
44
- <a href={googleMapsHref} className="inline-block pt-1" target="_blank">
45
- <Icon symbol="map" size="medium" fill={IconFillColors.primary} />{" "}
46
- {t("t.getDirections")}
47
- </a>
48
- </p>
49
- </>
50
- )}
51
- {hours}
52
- </>
53
- )
54
- }
55
-
56
- export { SidebarAddress as default, SidebarAddress }
@@ -1,49 +0,0 @@
1
- import * as React from "react"
2
- import { t } from "../../../helpers/translator"
3
-
4
- export interface WaitlistProps {
5
- isWaitlistOpen: boolean
6
- waitlistMaxSize?: number | null
7
- waitlistCurrentSize?: number | null
8
- waitlistOpenSpots?: number | null
9
- }
10
-
11
- const WaitlistItem = (props: { className?: string; value: number; text: string }) => (
12
- <li className={`uppercase text-gray-800 text-tiny ${props.className}`}>
13
- <span className="text-right w-12 inline-block pr-2">{props.value}</span>
14
- <span>{props.text}</span>
15
- </li>
16
- )
17
-
18
- const Waitlist = (props: WaitlistProps) => {
19
- if (!props.isWaitlistOpen) return <></>
20
-
21
- return (
22
- <section className="aside-block is-tinted">
23
- <h4 className="text-caps-tiny">{t("listings.waitlist.unitsAndWaitlist")}</h4>
24
- <div>
25
- <p className="text-tiny text-gray-800 pb-3">{t("listings.waitlist.submitAnApplication")}</p>
26
- <ul>
27
- {props.waitlistCurrentSize !== null && props.waitlistCurrentSize !== undefined && (
28
- <WaitlistItem
29
- value={props.waitlistCurrentSize}
30
- text={t("listings.waitlist.currentSize")}
31
- />
32
- )}
33
- {props.waitlistOpenSpots !== null && props.waitlistOpenSpots !== undefined && (
34
- <WaitlistItem
35
- value={props.waitlistOpenSpots}
36
- text={t("listings.waitlist.openSlots")}
37
- className={"font-semibold"}
38
- />
39
- )}
40
- {props.waitlistMaxSize != null && (
41
- <WaitlistItem value={props.waitlistMaxSize} text={t("listings.waitlist.finalSize")} />
42
- )}
43
- </ul>
44
- </div>
45
- </section>
46
- )
47
- }
48
-
49
- export { Waitlist as default, Waitlist }