@bloom-housing/ui-components 12.4.1 → 12.6.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.
- package/dist/src/page_components/listing/ListingsGroup.d.ts +3 -0
- package/dist/src/page_components/listing/ListingsGroup.js +14 -4
- package/dist/src/page_components/listing/ListingsGroup.js.map +1 -1
- package/dist/src/page_components/listing/listing_sidebar/Contact.d.ts +3 -1
- package/dist/src/page_components/listing/listing_sidebar/Contact.js +2 -2
- package/dist/src/page_components/listing/listing_sidebar/Contact.js.map +1 -1
- package/dist/src/page_components/listing/listing_sidebar/Contact.stories.d.ts +1 -1
- package/dist/src/page_components/listing/listing_sidebar/ExpandableSection.d.ts +2 -1
- package/dist/src/page_components/listing/listing_sidebar/ExpandableSection.js +2 -2
- package/dist/src/page_components/listing/listing_sidebar/ExpandableSection.js.map +1 -1
- package/dist/src/page_components/listing/listing_sidebar/ExpandableSection.stories.d.ts +1 -1
- package/dist/src/page_components/listing/listing_sidebar/events/EventSection.d.ts +1 -0
- package/dist/src/page_components/listing/listing_sidebar/events/EventSection.js +2 -1
- package/dist/src/page_components/listing/listing_sidebar/events/EventSection.js.map +1 -1
- package/package.json +1 -1
- package/src/page_components/listing/ListingsGroup.tsx +21 -2
- package/src/page_components/listing/listing_sidebar/Contact.tsx +4 -1
- package/src/page_components/listing/listing_sidebar/ExpandableSection.tsx +8 -2
- package/src/page_components/listing/listing_sidebar/events/EventSection.tsx +2 -1
|
@@ -9,6 +9,9 @@ export interface ListingsGroupProps {
|
|
|
9
9
|
info?: string;
|
|
10
10
|
listingsCount: number;
|
|
11
11
|
showButtonText: string;
|
|
12
|
+
refKey?: string;
|
|
13
|
+
observerRef?: React.MutableRefObject<null | IntersectionObserver>;
|
|
14
|
+
isOpen?: boolean;
|
|
12
15
|
}
|
|
13
16
|
declare const ListingsGroup: (props: ListingsGroupProps) => JSX.Element;
|
|
14
17
|
export { ListingsGroup as default, ListingsGroup };
|
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
2
|
import { Button } from "../../actions/Button";
|
|
3
3
|
import { Icon } from "../../icons/Icon";
|
|
4
4
|
import "./ListingsGroup.scss";
|
|
5
5
|
var ListingsGroup = function (props) {
|
|
6
|
-
var _a;
|
|
7
|
-
var
|
|
6
|
+
var _a, _b;
|
|
7
|
+
var _c = useState(false), showListings = _c[0], setShowListings = _c[1];
|
|
8
8
|
var toggleListings = function () { return setShowListings(!showListings); };
|
|
9
9
|
var listingsCount = " (".concat(props.listingsCount, ")");
|
|
10
|
+
useEffect(function () {
|
|
11
|
+
if (props.isOpen) {
|
|
12
|
+
setShowListings(true);
|
|
13
|
+
}
|
|
14
|
+
}, [props.isOpen]);
|
|
10
15
|
return (React.createElement("div", { className: "listings-group" },
|
|
11
16
|
React.createElement("div", { className: "listings-group__header" },
|
|
12
17
|
React.createElement("div", { className: "listings-group__content" },
|
|
13
18
|
React.createElement("div", { className: "listings-group__icon" },
|
|
14
19
|
React.createElement(Icon, { size: "xlarge", symbol: (_a = props.icon) !== null && _a !== void 0 ? _a : "clock" })),
|
|
15
20
|
React.createElement("div", { className: "listings-group__header-group" },
|
|
16
|
-
React.createElement("h2", {
|
|
21
|
+
React.createElement("h2", { id: (_b = props.refKey) !== null && _b !== void 0 ? _b : props.header, ref: function (el) {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
if (el) {
|
|
24
|
+
(_b = (_a = props.observerRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.observe(el);
|
|
25
|
+
}
|
|
26
|
+
}, className: "listings-group__title" }, props.header),
|
|
17
27
|
props.info && React.createElement("div", { className: "listings-group__info" }, props.info))),
|
|
18
28
|
React.createElement("div", { className: "listings-group__button" },
|
|
19
29
|
React.createElement(Button, { className: "w-full", onClick: function () { return toggleListings(); } }, showListings
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListingsGroup.js","sourceRoot":"","sources":["../../../../src/page_components/listing/ListingsGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ListingsGroup.js","sourceRoot":"","sources":["../../../../src/page_components/listing/ListingsGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAqB,MAAM,kBAAkB,CAAA;AAC1D,OAAO,sBAAsB,CAAA;AAe7B,IAAM,aAAa,GAAG,UAAC,KAAyB;;IACxC,IAAA,KAAkC,QAAQ,CAAC,KAAK,CAAC,EAAhD,YAAY,QAAA,EAAE,eAAe,QAAmB,CAAA;IACvD,IAAM,cAAc,GAAG,cAAM,OAAA,eAAe,CAAC,CAAC,YAAY,CAAC,EAA9B,CAA8B,CAAA;IAE3D,IAAM,aAAa,GAAG,YAAK,KAAK,CAAC,aAAa,MAAG,CAAA;IAEjD,SAAS,CAAC;QACR,IAAI,KAAK,CAAC,MAAM,EAAE;YAChB,eAAe,CAAC,IAAI,CAAC,CAAA;SACtB;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;IAElB,OAAO,CACL,6BAAK,SAAS,EAAC,gBAAgB;QAC7B,6BAAK,SAAS,EAAC,wBAAwB;YACrC,6BAAK,SAAS,EAAE,yBAAyB;gBACvC,6BAAK,SAAS,EAAC,sBAAsB;oBACnC,oBAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,MAAM,EAAE,MAAA,KAAK,CAAC,IAAI,mCAAI,OAAO,GAAI,CACjD;gBACN,6BAAK,SAAS,EAAC,8BAA8B;oBAC3C,4BACE,EAAE,EAAE,MAAA,KAAK,CAAC,MAAM,mCAAI,KAAK,CAAC,MAAM,EAChC,GAAG,EAAE,UAAC,EAAE;;4BACN,IAAI,EAAE,EAAE;gCACN,MAAA,MAAA,KAAK,CAAC,WAAW,0CAAE,OAAO,0CAAE,OAAO,CAAC,EAAE,CAAC,CAAA;6BACxC;wBACH,CAAC,EACD,SAAS,EAAC,uBAAuB,IAEhC,KAAK,CAAC,MAAM,CACV;oBACJ,KAAK,CAAC,IAAI,IAAI,6BAAK,SAAS,EAAC,sBAAsB,IAAE,KAAK,CAAC,IAAI,CAAO,CACnE,CACF;YACN,6BAAK,SAAS,EAAC,wBAAwB;gBACrC,oBAAC,MAAM,IAAC,SAAS,EAAC,QAAQ,EAAC,OAAO,EAAE,cAAM,OAAA,cAAc,EAAE,EAAhB,CAAgB,IACvD,YAAY;oBACX,CAAC,CAAC,KAAK,CAAC,cAAc,GAAG,aAAa;oBACtC,CAAC,CAAC,KAAK,CAAC,cAAc,GAAG,aAAa,CACjC,CACL,CACF;QACL,YAAY,IAAI,KAAK,CAAC,QAAQ,CAC3B,CACP,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -27,6 +27,8 @@ export interface ContactProps {
|
|
|
27
27
|
contactTitleClassname?: string;
|
|
28
28
|
/** The text for the section's header */
|
|
29
29
|
sectionTitle: string;
|
|
30
|
+
/** The header level for the sectionTitle */
|
|
31
|
+
priority?: number;
|
|
30
32
|
strings: {
|
|
31
33
|
email?: string;
|
|
32
34
|
getDirections: string;
|
|
@@ -34,5 +36,5 @@ export interface ContactProps {
|
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
38
|
/** Displays information about a contact, including their address, contact information, and notes */
|
|
37
|
-
declare const Contact: ({ additionalInformation, contactAddress, contactCompany, contactEmail, contactName, contactPhoneNumber, contactPhoneNumberNote, contactTitle, contactTitleClassname, sectionTitle, strings, }: ContactProps) => JSX.Element;
|
|
39
|
+
declare const Contact: ({ additionalInformation, contactAddress, contactCompany, contactEmail, contactName, contactPhoneNumber, contactPhoneNumberNote, contactTitle, contactTitleClassname, sectionTitle, priority, strings, }: ContactProps) => JSX.Element;
|
|
38
40
|
export { Contact as default, Contact };
|
|
@@ -4,7 +4,7 @@ import { Icon, IconFillColors } from "../../../icons/Icon";
|
|
|
4
4
|
import { Heading } from "../../../text/Heading";
|
|
5
5
|
/** Displays information about a contact, including their address, contact information, and notes */
|
|
6
6
|
var Contact = function (_a) {
|
|
7
|
-
var additionalInformation = _a.additionalInformation, contactAddress = _a.contactAddress, contactCompany = _a.contactCompany, contactEmail = _a.contactEmail, contactName = _a.contactName, contactPhoneNumber = _a.contactPhoneNumber, contactPhoneNumberNote = _a.contactPhoneNumberNote, contactTitle = _a.contactTitle, contactTitleClassname = _a.contactTitleClassname, sectionTitle = _a.sectionTitle, strings = _a.strings;
|
|
7
|
+
var additionalInformation = _a.additionalInformation, contactAddress = _a.contactAddress, contactCompany = _a.contactCompany, contactEmail = _a.contactEmail, contactName = _a.contactName, contactPhoneNumber = _a.contactPhoneNumber, contactPhoneNumberNote = _a.contactPhoneNumberNote, contactTitle = _a.contactTitle, contactTitleClassname = _a.contactTitleClassname, sectionTitle = _a.sectionTitle, priority = _a.priority, strings = _a.strings;
|
|
8
8
|
var formattedPhoneLink = contactPhoneNumber
|
|
9
9
|
? "tel:".concat(contactPhoneNumber.replace(/[-()]/g, ""))
|
|
10
10
|
: undefined;
|
|
@@ -15,7 +15,7 @@ var Contact = function (_a) {
|
|
|
15
15
|
if (contactTitleClassname)
|
|
16
16
|
contactTitleClasses.push(contactTitleClassname);
|
|
17
17
|
return (React.createElement("section", { className: "aside-block" },
|
|
18
|
-
React.createElement(Heading, { priority: 4, styleType: "underlineWeighted" }, sectionTitle),
|
|
18
|
+
React.createElement(Heading, { priority: priority !== null && priority !== void 0 ? priority : 4, styleType: "underlineWeighted" }, sectionTitle),
|
|
19
19
|
contactName && React.createElement("p", { className: "text-xl" }, contactName),
|
|
20
20
|
contactTitle && React.createElement("p", { className: contactTitleClasses.join(" ") }, contactTitle),
|
|
21
21
|
(contactCompany === null || contactCompany === void 0 ? void 0 : contactCompany.name) && React.createElement("p", { className: "text-gray-700" }, contactCompany.name),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contact.js","sourceRoot":"","sources":["../../../../../src/page_components/listing/listing_sidebar/Contact.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"Contact.js","sourceRoot":"","sources":["../../../../../src/page_components/listing/listing_sidebar/Contact.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AA4B/C,oGAAoG;AACpG,IAAM,OAAO,GAAG,UAAC,EAaF;QAZb,qBAAqB,2BAAA,EACrB,cAAc,oBAAA,EACd,cAAc,oBAAA,EACd,YAAY,kBAAA,EACZ,WAAW,iBAAA,EACX,kBAAkB,wBAAA,EAClB,sBAAsB,4BAAA,EACtB,YAAY,kBAAA,EACZ,qBAAqB,2BAAA,EACrB,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,OAAO,aAAA;IAEP,IAAM,kBAAkB,GAAG,kBAAkB;QAC3C,CAAC,CAAC,cAAO,kBAAkB,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAE;QACnD,CAAC,CAAC,SAAS,CAAA;IACb,IAAM,uBAAuB,GAC3B,CAAA,cAA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E,OAAO,IAAI,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: ({ additionalInformation, contactAddress, contactCompany, contactEmail, contactName, contactPhoneNumber, contactPhoneNumberNote, contactTitle, contactTitleClassname, sectionTitle, strings, }: import("./Contact").ContactProps) => JSX.Element;
|
|
3
|
+
component: ({ additionalInformation, contactAddress, contactCompany, contactEmail, contactName, contactPhoneNumber, contactPhoneNumberNote, contactTitle, contactTitleClassname, sectionTitle, priority, strings, }: import("./Contact").ContactProps) => JSX.Element;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const NoAddress: () => JSX.Element;
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
export interface ExpandableSectionProps {
|
|
3
3
|
content: string | React.ReactNode;
|
|
4
4
|
expandableContent?: string | React.ReactNode;
|
|
5
|
+
priority?: number;
|
|
5
6
|
strings: {
|
|
6
7
|
title: string;
|
|
7
8
|
readMore?: string;
|
|
@@ -9,5 +10,5 @@ export interface ExpandableSectionProps {
|
|
|
9
10
|
buttonAriaLabel?: string;
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
|
-
declare const ExpandableSection: ({ content, expandableContent, strings }: ExpandableSectionProps) => JSX.Element | null;
|
|
13
|
+
declare const ExpandableSection: ({ content, expandableContent, priority, strings, }: ExpandableSectionProps) => JSX.Element | null;
|
|
13
14
|
export { ExpandableSection as default, ExpandableSection };
|
|
@@ -3,14 +3,14 @@ import Markdown from "markdown-to-jsx";
|
|
|
3
3
|
import { ExpandableContent } from "../../../actions/ExpandableContent";
|
|
4
4
|
import { Heading } from "../../../text/Heading";
|
|
5
5
|
var ExpandableSection = function (_a) {
|
|
6
|
-
var content = _a.content, expandableContent = _a.expandableContent, strings = _a.strings;
|
|
6
|
+
var content = _a.content, expandableContent = _a.expandableContent, priority = _a.priority, strings = _a.strings;
|
|
7
7
|
if (!content)
|
|
8
8
|
return null;
|
|
9
9
|
var getTextContent = function (textContent) {
|
|
10
10
|
return (React.createElement(React.Fragment, null, typeof textContent === "string" ? (React.createElement(Markdown, { options: { disableParsingRawHTML: false } }, textContent)) : (textContent)));
|
|
11
11
|
};
|
|
12
12
|
return (React.createElement("section", { className: "aside-block" },
|
|
13
|
-
React.createElement(Heading, { priority: 4, styleType: "underlineWeighted" }, strings.title),
|
|
13
|
+
React.createElement(Heading, { priority: priority !== null && priority !== void 0 ? priority : 4, styleType: "underlineWeighted" }, strings.title),
|
|
14
14
|
React.createElement("div", { className: "text-sm text-gray-750" },
|
|
15
15
|
getTextContent(content),
|
|
16
16
|
expandableContent && (React.createElement("div", { className: "mt-2" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableSection.js","sourceRoot":"","sources":["../../../../../src/page_components/listing/listing_sidebar/ExpandableSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,QAAQ,MAAM,iBAAiB,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"ExpandableSection.js","sourceRoot":"","sources":["../../../../../src/page_components/listing/listing_sidebar/ExpandableSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,QAAQ,MAAM,iBAAiB,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAc/C,IAAM,iBAAiB,GAAG,UAAC,EAKF;QAJvB,OAAO,aAAA,EACP,iBAAiB,uBAAA,EACjB,QAAQ,cAAA,EACR,OAAO,aAAA;IAEP,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAEzB,IAAM,cAAc,GAAG,UAAC,WAAqC;QAC3D,OAAO,CACL,0CACG,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,CACjC,oBAAC,QAAQ,IAAC,OAAO,EAAE,EAAE,qBAAqB,EAAE,KAAK,EAAE,IAAG,WAAW,CAAY,CAC9E,CAAC,CAAC,CAAC,CACF,WAAW,CACZ,CACA,CACJ,CAAA;IACH,CAAC,CAAA;IACD,OAAO,CACL,iCAAS,SAAS,EAAC,aAAa;QAC9B,oBAAC,OAAO,IAAC,QAAQ,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,IAC7D,OAAO,CAAC,KAAK,CACN;QACV,6BAAK,SAAS,EAAC,uBAAuB;YACnC,cAAc,CAAC,OAAO,CAAC;YACvB,iBAAiB,IAAI,CACpB,6BAAK,SAAS,EAAE,MAAM;gBACpB,oBAAC,iBAAiB,IAChB,OAAO,EAAE;wBACP,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,eAAe,EAAE,OAAO,CAAC,eAAe;qBACzC,IAEA,cAAc,CAAC,iBAAiB,CAAC,CAChB,CAChB,CACP,CACG,CACE,CACX,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: ({ content, expandableContent, strings }: import("./ExpandableSection").ExpandableSectionProps) => JSX.Element | null;
|
|
3
|
+
component: ({ content, expandableContent, priority, strings, }: import("./ExpandableSection").ExpandableSectionProps) => JSX.Element | null;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const Default: () => JSX.Element;
|
|
@@ -11,6 +11,7 @@ type EventSectionProps = {
|
|
|
11
11
|
headerText?: string;
|
|
12
12
|
sectionHeader?: boolean;
|
|
13
13
|
dateClassName?: string;
|
|
14
|
+
priority?: number;
|
|
14
15
|
};
|
|
15
16
|
declare const EventSection: (props: EventSectionProps) => JSX.Element | null;
|
|
16
17
|
export { EventSection as default, EventSection };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Heading } from "../../../../text/Heading";
|
|
3
3
|
var EventSection = function (props) {
|
|
4
|
+
var _a;
|
|
4
5
|
if (!props.events.length)
|
|
5
6
|
return null;
|
|
6
7
|
var dateClasses = ["inline-block text-sm uppercase"];
|
|
@@ -8,7 +9,7 @@ var EventSection = function (props) {
|
|
|
8
9
|
dateClasses.push(props.dateClassName);
|
|
9
10
|
}
|
|
10
11
|
return (React.createElement("section", { className: "aside-block" },
|
|
11
|
-
props.headerText && (React.createElement(Heading, { priority: 4, styleType: props.sectionHeader ? "underlineWeighted" : "capsWeighted" }, props.headerText)),
|
|
12
|
+
props.headerText && (React.createElement(Heading, { priority: (_a = props.priority) !== null && _a !== void 0 ? _a : 4, styleType: props.sectionHeader ? "underlineWeighted" : "capsWeighted" }, props.headerText)),
|
|
12
13
|
props.events.map(function (event, index) { return (React.createElement("div", { key: "events-".concat(index), className: "".concat(index !== props.events.length - 1 && "pb-3") },
|
|
13
14
|
event.dateString && (React.createElement("p", { className: "text text-gray-800 pb-2 flex justify-between items-center" },
|
|
14
15
|
React.createElement("span", { className: dateClasses.join(" ") }, event.dateString),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventSection.js","sourceRoot":"","sources":["../../../../../../src/page_components/listing/listing_sidebar/events/EventSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"EventSection.js","sourceRoot":"","sources":["../../../../../../src/page_components/listing/listing_sidebar/events/EventSection.tsx"],"names":[],"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AE,KAAK,CAAC,OAAO,IAAG,KAAK,CAAC,QAAQ,CAAK,CAC1C,CACL;YACA,KAAK,CAAC,IAAI,IAAI,CACb,6BAAK,SAAS,EAAE,gCAAyB,KAAK,KAAK,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAE,IACnF,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,+BAAI,KAAK,CAAC,IAAI,CAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAC9D,CACP,CACG,CACP,EAvBmC,CAuBnC,CAAC,CACM,CACX,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,YAAY,IAAI,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloom-housing/ui-components",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.6.0",
|
|
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/ui-components",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from "react"
|
|
1
|
+
import React, { useState, useEffect } from "react"
|
|
2
2
|
import { Button } from "../../actions/Button"
|
|
3
3
|
import { Icon, UniversalIconType } from "../../icons/Icon"
|
|
4
4
|
import "./ListingsGroup.scss"
|
|
@@ -11,6 +11,9 @@ export interface ListingsGroupProps {
|
|
|
11
11
|
info?: string
|
|
12
12
|
listingsCount: number
|
|
13
13
|
showButtonText: string
|
|
14
|
+
refKey?: string
|
|
15
|
+
observerRef?: React.MutableRefObject<null | IntersectionObserver>
|
|
16
|
+
isOpen?: boolean
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
const ListingsGroup = (props: ListingsGroupProps) => {
|
|
@@ -19,6 +22,12 @@ const ListingsGroup = (props: ListingsGroupProps) => {
|
|
|
19
22
|
|
|
20
23
|
const listingsCount = ` (${props.listingsCount})`
|
|
21
24
|
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (props.isOpen) {
|
|
27
|
+
setShowListings(true)
|
|
28
|
+
}
|
|
29
|
+
}, [props.isOpen])
|
|
30
|
+
|
|
22
31
|
return (
|
|
23
32
|
<div className="listings-group">
|
|
24
33
|
<div className="listings-group__header">
|
|
@@ -27,7 +36,17 @@ const ListingsGroup = (props: ListingsGroupProps) => {
|
|
|
27
36
|
<Icon size="xlarge" symbol={props.icon ?? `clock`} />
|
|
28
37
|
</div>
|
|
29
38
|
<div className="listings-group__header-group">
|
|
30
|
-
<h2
|
|
39
|
+
<h2
|
|
40
|
+
id={props.refKey ?? props.header}
|
|
41
|
+
ref={(el) => {
|
|
42
|
+
if (el) {
|
|
43
|
+
props.observerRef?.current?.observe(el)
|
|
44
|
+
}
|
|
45
|
+
}}
|
|
46
|
+
className="listings-group__title"
|
|
47
|
+
>
|
|
48
|
+
{props.header}
|
|
49
|
+
</h2>
|
|
31
50
|
{props.info && <div className="listings-group__info">{props.info}</div>}
|
|
32
51
|
</div>
|
|
33
52
|
</div>
|
|
@@ -25,6 +25,8 @@ export interface ContactProps {
|
|
|
25
25
|
contactTitleClassname?: string
|
|
26
26
|
/** The text for the section's header */
|
|
27
27
|
sectionTitle: string
|
|
28
|
+
/** The header level for the sectionTitle */
|
|
29
|
+
priority?: number
|
|
28
30
|
strings: { email?: string; getDirections: string; website?: string }
|
|
29
31
|
}
|
|
30
32
|
|
|
@@ -40,6 +42,7 @@ const Contact = ({
|
|
|
40
42
|
contactTitle,
|
|
41
43
|
contactTitleClassname,
|
|
42
44
|
sectionTitle,
|
|
45
|
+
priority,
|
|
43
46
|
strings,
|
|
44
47
|
}: ContactProps) => {
|
|
45
48
|
const formattedPhoneLink = contactPhoneNumber
|
|
@@ -54,7 +57,7 @@ const Contact = ({
|
|
|
54
57
|
|
|
55
58
|
return (
|
|
56
59
|
<section className="aside-block">
|
|
57
|
-
<Heading priority={4} styleType={"underlineWeighted"}>
|
|
60
|
+
<Heading priority={priority ?? 4} styleType={"underlineWeighted"}>
|
|
58
61
|
{sectionTitle}
|
|
59
62
|
</Heading>
|
|
60
63
|
|
|
@@ -6,6 +6,7 @@ import { Heading } from "../../../text/Heading"
|
|
|
6
6
|
export interface ExpandableSectionProps {
|
|
7
7
|
content: string | React.ReactNode
|
|
8
8
|
expandableContent?: string | React.ReactNode
|
|
9
|
+
priority?: number
|
|
9
10
|
strings: {
|
|
10
11
|
title: string
|
|
11
12
|
readMore?: string
|
|
@@ -14,7 +15,12 @@ export interface ExpandableSectionProps {
|
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
const ExpandableSection = ({
|
|
18
|
+
const ExpandableSection = ({
|
|
19
|
+
content,
|
|
20
|
+
expandableContent,
|
|
21
|
+
priority,
|
|
22
|
+
strings,
|
|
23
|
+
}: ExpandableSectionProps) => {
|
|
18
24
|
if (!content) return null
|
|
19
25
|
|
|
20
26
|
const getTextContent = (textContent: string | React.ReactNode) => {
|
|
@@ -30,7 +36,7 @@ const ExpandableSection = ({ content, expandableContent, strings }: ExpandableSe
|
|
|
30
36
|
}
|
|
31
37
|
return (
|
|
32
38
|
<section className="aside-block">
|
|
33
|
-
<Heading priority={4} styleType={"underlineWeighted"}>
|
|
39
|
+
<Heading priority={priority ?? 4} styleType={"underlineWeighted"}>
|
|
34
40
|
{strings.title}
|
|
35
41
|
</Heading>
|
|
36
42
|
<div className="text-sm text-gray-750">
|
|
@@ -14,6 +14,7 @@ type EventSectionProps = {
|
|
|
14
14
|
headerText?: string
|
|
15
15
|
sectionHeader?: boolean
|
|
16
16
|
dateClassName?: string
|
|
17
|
+
priority?: number
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
const EventSection = (props: EventSectionProps) => {
|
|
@@ -29,7 +30,7 @@ const EventSection = (props: EventSectionProps) => {
|
|
|
29
30
|
<section className="aside-block">
|
|
30
31
|
{props.headerText && (
|
|
31
32
|
<Heading
|
|
32
|
-
priority={4}
|
|
33
|
+
priority={props.priority ?? 4}
|
|
33
34
|
styleType={props.sectionHeader ? "underlineWeighted" : "capsWeighted"}
|
|
34
35
|
>
|
|
35
36
|
{props.headerText}
|