@axos-web-dev/shared-components 0.0.167 → 0.0.168
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/ATMLocator/ATMLocator.js +35 -35
- package/dist/Accordion/Accordion.css.js +4 -4
- package/dist/Accordion/Accordion.js +3 -3
- package/dist/AlertBanner/AlertBanner.css.js +1 -1
- package/dist/AlertBanner/index.js +3 -3
- package/dist/Article/Article.css.js +4 -4
- package/dist/ArticlesSet/ArticlesSet.css.js +4 -4
- package/dist/AwardsBanner/AwardsBanner.css.js +1 -1
- package/dist/AwardsItem/AwardsItem.css.js +2 -2
- package/dist/BulletItem/BulletItem.css.js +2 -2
- package/dist/BulletItem/BulletItem.js +3 -3
- package/dist/Button/Button.css.js +4 -4
- package/dist/Button/Button.js +35 -35
- package/dist/Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js +3 -3
- package/dist/Calculators/ApyCalculator/ApyCalculator.css.js +3 -3
- package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js +4 -4
- package/dist/Calculators/AxosOneCalculator/index.js +3 -3
- package/dist/Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js +4 -4
- package/dist/Calculators/BalanceAPYCalculator/index.js +3 -3
- package/dist/Calculators/Calculator.js +35 -35
- package/dist/Calculators/MarginTradingCalculator/MarginTradingCalculator.css.js +1 -1
- package/dist/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js +3 -3
- package/dist/Calculators/calculator.css.js +4 -4
- package/dist/CallToActionBar/CallToActionBar.css.js +3 -3
- package/dist/Carousel/Carousel.css.js +3 -3
- package/dist/Carousel/index.js +35 -35
- package/dist/Chevron/Chevron.css.js +4 -4
- package/dist/Chevron/index.js +35 -35
- package/dist/CollectInformationAlert/CollectInformationAlert.css.js +4 -4
- package/dist/CollectInformationAlert/index.js +3 -3
- package/dist/Comparison/Comparison.css.js +7 -7
- package/dist/Comparison/Comparison.js +34 -34
- package/dist/ContentBanner/ContentBanner.css.js +4 -4
- package/dist/DownloadTile/DownloadTile.css.js +3 -3
- package/dist/ExecutiveBio/ExecutiveBio.css.js +4 -4
- package/dist/FaqAccordion/FaqAccordion.css.js +4 -4
- package/dist/FaqAccordion/index.js +35 -35
- package/dist/FooterDisclosure/FooterDisclosure.css.js +1 -1
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.css.js +4 -4
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +34 -34
- package/dist/Forms/ApplicationStart.js +4 -4
- package/dist/Forms/ClearingForm.js +4 -4
- package/dist/Forms/CommercialDeposits.js +4 -4
- package/dist/Forms/CommercialLending.js +4 -4
- package/dist/Forms/ContactCompany.js +4 -4
- package/dist/Forms/ContactUs.js +4 -4
- package/dist/Forms/ContactUsAAS.js +4 -4
- package/dist/Forms/ContactUsBusiness.js +35 -35
- package/dist/Forms/ContactUsNMLSId.js +35 -35
- package/dist/Forms/CpraRequest.js +4 -4
- package/dist/Forms/DealerServices.js +4 -4
- package/dist/Forms/EmailOnly.js +35 -35
- package/dist/Forms/EmailUs.js +3 -3
- package/dist/Forms/Forms.css.js +7 -7
- package/dist/Forms/MortgageRate/MortgageRateForm.js +35 -35
- package/dist/Forms/MortgageRate/MortgageRateQuoteFilters.js +1 -1
- package/dist/Forms/MortgageRate/MortgageRateWatch.js +35 -35
- package/dist/Forms/QuickPricer/QuickPricerForm.js +4 -4
- package/dist/Forms/QuickPricer/QuickPricerResults.css.js +1 -1
- package/dist/Forms/QuickPricer/UserInformation.css.js +3 -3
- package/dist/Forms/ScheduleCall.js +4 -4
- package/dist/Forms/ScheduleCallPremier.js +4 -4
- package/dist/Forms/SuccesForm.js +36 -36
- package/dist/Forms/WcplSurvey.js +4 -4
- package/dist/HeroBanner/HeroBanner.css.js +5 -5
- package/dist/HeroBanner/LargeBanner.css.js +4 -4
- package/dist/HeroBanner/SelectionBanner.css.js +4 -4
- package/dist/Hyperlink/Hyperlink.css.js +1 -1
- package/dist/Hyperlink/index.js +35 -35
- package/dist/IconBillboard/IconBillboard.css.js +4 -4
- package/dist/ImageBillboard/ImageBillboard.css.js +4 -4
- package/dist/ImageBillboard/ImageBillboard.js +3 -3
- package/dist/ImageBillboard/ImageBillboardSet.js +3 -3
- package/dist/ImageLink/ImageLink.css.js +1 -1
- package/dist/ImageLink/ImageLink.js +35 -35
- package/dist/ImageLink/ImageLinkSet.js +37 -35
- package/dist/ImageLink/index.js +35 -35
- package/dist/Input/Checkbox.css.js +1 -1
- package/dist/Input/CurrencyInput.js +1 -1
- package/dist/Input/DatePicker.css.d.ts +1 -0
- package/dist/Input/DatePicker.css.js +6 -0
- package/dist/Input/DatePicker2.d.ts +21 -0
- package/dist/Input/DatePicker2.js +103 -0
- package/dist/Input/DatePickerComponents/DatePicker.d.ts +11 -0
- package/dist/Input/DatePickerComponents/DatePicker.js +13 -0
- package/dist/Input/DatePickerComponents/InputDate.d.ts +15 -0
- package/dist/Input/DatePickerComponents/InputDate.js +66 -0
- package/dist/Input/DatePickerComponents/index.d.ts +2 -0
- package/dist/Input/DatePickerComponents/index.js +6 -0
- package/dist/Input/Datepicker.d.ts +3 -0
- package/dist/Input/Datepicker.js +47 -0
- package/dist/Input/Dropdown.css.js +2 -2
- package/dist/Input/Input.css.js +4 -4
- package/dist/Input/InputAmount.js +1 -1
- package/dist/Input/InputDate.css.d.ts +6 -0
- package/dist/Input/InputDate.css.js +15 -0
- package/dist/Input/InputDate.d.ts +3 -0
- package/dist/Input/InputDate.js +47 -0
- package/dist/Input/InputPhone.js +1 -1
- package/dist/Input/RadioButton.css.js +1 -1
- package/dist/Input/index.d.ts +1 -1
- package/dist/Input/index.js +1 -1
- package/dist/Inputs/Input.css.js +3 -3
- package/dist/Insight/Featured/CategorySelector.css.js +5 -5
- package/dist/Insight/Featured/CategorySelector.js +34 -34
- package/dist/Insight/Featured/Featured.css.js +2 -2
- package/dist/Insight/Featured/Featured.js +36 -36
- package/dist/Insight/Featured/Header.css.js +1 -1
- package/dist/Insight/Featured/Header.js +34 -34
- package/dist/Insight/Insight.css.js +2 -2
- package/dist/Interstitial/Interstitial-variants.css.js +4 -4
- package/dist/Interstitial/Interstitial.js +24 -22
- package/dist/LandingPageHeader/LandingPageHeader.css.js +3 -3
- package/dist/LandingPageHeader/LandingPageHeader.js +3 -3
- package/dist/LoadingIndicator/LoadingIndicator.css.js +1 -1
- package/dist/Modal/Modal.css.js +3 -3
- package/dist/Modal/Modal.js +34 -34
- package/dist/NavigationMenu/AxosAdvisor/NavBar.css.js +3 -3
- package/dist/NavigationMenu/AxosAdvisor/SubNavbar.css.js +3 -3
- package/dist/NavigationMenu/AxosAdvisorServices/NavBar.css.js +3 -3
- package/dist/NavigationMenu/AxosAdvisorServices/SubNavbar.css.js +3 -3
- package/dist/NavigationMenu/AxosBank/NavBar.css.js +3 -3
- package/dist/NavigationMenu/AxosBank/NavBar.module.js +54 -54
- package/dist/NavigationMenu/AxosBank/NavData.js +35 -35
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +34 -34
- package/dist/NavigationMenu/AxosBank/SubNavbar.css.js +3 -3
- package/dist/NavigationMenu/AxosBank/index.js +33 -33
- package/dist/NavigationMenu/AxosClearing/NavBar.css.js +1 -1
- package/dist/PageNavItem/PageNavItem.css.js +4 -4
- package/dist/PageNavSet/PageNavigationSet.css.js +1 -1
- package/dist/Pagination/Pagination.css.js +1 -1
- package/dist/Pagination/Pagination.js +3 -3
- package/dist/SecondaryFooter/SecondaryFooter.css.js +3 -3
- package/dist/SetContainer/SetContainer.css.d.ts +16 -0
- package/dist/SetContainer/SetContainer.css.js +10 -8
- package/dist/SetContainer/SetContainer.d.ts +2 -1
- package/dist/SetContainer/SetContainer.js +50 -38
- package/dist/SetContainer/index.js +2 -1
- package/dist/SocialMediaBar/SocialMediaBar.css.js +1 -1
- package/dist/StepItem/StepItem.css.js +3 -3
- package/dist/StepItemSet/StepItemSet.css.js +3 -3
- package/dist/Tab/Tab.css.js +3 -3
- package/dist/Table/Table.css.js +3 -3
- package/dist/Table/Table.js +3 -3
- package/dist/TextBlock/TextBlock.css.js +3 -3
- package/dist/TopicalNavItem/TopicalNavItem.css.js +1 -1
- package/dist/TopicalNavSet/TopicalNavSet.css.js +1 -1
- package/dist/Typography/Typography.css.js +1 -1
- package/dist/VideoTile/VideoTile.css.js +4 -4
- package/dist/VideoTile/VideoTile.js +3 -3
- package/dist/VideoWrapper/VideoWrapper.css.js +1 -1
- package/dist/VideoWrapper/index.js +34 -34
- package/dist/assets/Input/DatePicker.css +95 -0
- package/dist/assets/Input/InputDate.css +39 -0
- package/dist/assets/Interstitial/Interstitial-variants.css +3 -0
- package/dist/assets/NavigationMenu/AxosBank/NavBar.css.css +650 -650
- package/dist/assets/SetContainer/SetContainer.css +38 -24
- package/dist/assets/node_modules/react-date-range/dist/styles.css.css +194 -0
- package/dist/assets/node_modules/react-date-range/dist/theme/default.css.css +385 -0
- package/dist/globals.css.js +2 -2
- package/dist/icons/ArrowIcon/ArrowIcon.css.js +3 -3
- package/dist/icons/CalendarIcon/CalendarIcon.d.ts +3 -0
- package/dist/icons/CalendarIcon/CalendarIcon.js +17 -0
- package/dist/icons/CalendarIcon/index.d.ts +1 -0
- package/dist/icons/CalendarIcon/index.js +4 -0
- package/dist/icons/CheckIcon/CheckIcon.css.js +3 -3
- package/dist/icons/DownloadIcon/DownloadIcon.css.js +3 -3
- package/dist/icons/FollowIcon/FollowIcon.css.js +3 -3
- package/dist/icons/Star/Star.css.js +1 -1
- package/dist/index.css.js +3 -3
- package/dist/main.js +5 -2
- package/dist/themes/axos.css.js +1 -1
- package/dist/themes/premier.css.js +2 -2
- package/dist/types/icon.d.ts +3 -0
- package/dist/types/icon.js +1 -0
- package/dist/types/popover.d.ts +8 -0
- package/dist/types/popover.js +1 -0
- package/dist/utils/allowedAxosDomains.js +4 -1
- package/dist/utils/constants/format.d.ts +1 -0
- package/dist/utils/constants/format.js +4 -0
- package/dist/utils/constants/popper.d.ts +6 -0
- package/dist/utils/constants/popper.js +10 -0
- package/dist/utils/getNumber.d.ts +1 -0
- package/dist/utils/getNumber.js +17 -0
- package/dist/utils/hooks/usePopover.d.ts +25 -0
- package/dist/utils/hooks/usePopover.js +64 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/variant.types.d.ts +2 -0
- package/dist/utils/variant.types.js +4 -1
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from "react";
|
|
3
|
+
const Component = ({ height = 24, width = 24, ...props }) => /* @__PURE__ */ jsx(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
height,
|
|
8
|
+
viewBox: "0 -960 960 960",
|
|
9
|
+
width,
|
|
10
|
+
...props,
|
|
11
|
+
children: /* @__PURE__ */ jsx("path", { d: "M180-80q-24 0-42-18t-18-42v-620q0-24 18-42t42-18h65v-60h65v60h340v-60h65v60h65q24 0 42 18t18 42v620q0 24-18 42t-42 18H180Zm0-60h600v-430H180v430Zm0-490h600v-130H180v130Zm0 0v-130 130Zm300 230q-17 0-28.5-11.5T440-440q0-17 11.5-28.5T480-480q17 0 28.5 11.5T520-440q0 17-11.5 28.5T480-400Zm-160 0q-17 0-28.5-11.5T280-440q0-17 11.5-28.5T320-480q17 0 28.5 11.5T360-440q0 17-11.5 28.5T320-400Zm320 0q-17 0-28.5-11.5T600-440q0-17 11.5-28.5T640-480q17 0 28.5 11.5T680-440q0 17-11.5 28.5T640-400ZM480-240q-17 0-28.5-11.5T440-280q0-17 11.5-28.5T480-320q17 0 28.5 11.5T520-280q0 17-11.5 28.5T480-240Zm-160 0q-17 0-28.5-11.5T280-280q0-17 11.5-28.5T320-320q17 0 28.5 11.5T360-280q0 17-11.5 28.5T320-240Zm320 0q-17 0-28.5-11.5T600-280q0-17 11.5-28.5T640-320q17 0 28.5 11.5T680-280q0 17-11.5 28.5T640-240Z" })
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
const CalendarIcon = memo(Component);
|
|
15
|
+
export {
|
|
16
|
+
CalendarIcon
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CalendarIcon';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/* empty css
|
|
2
|
-
/* empty css
|
|
3
|
-
/* empty css
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
4
|
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
5
5
|
var checkColor = createRuntimeFn({ defaultClassName: "_1xajnqu0", variantClassNames: { variant: { primary: "_1xajnqu1", secondary: "_1xajnqu2" } }, defaultVariants: {}, compoundVariants: [] });
|
|
6
6
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* empty css
|
|
1
|
+
/* empty css */
|
|
2
2
|
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
3
|
var Star = createRuntimeFn({ defaultClassName: "mi4mae0", variantClassNames: { variant: { gold: "mi4mae1", gray: "mi4mae2" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4
4
|
export {
|
package/dist/index.css.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* empty css
|
|
2
|
-
/* empty css
|
|
3
|
-
/* empty css
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
package/dist/main.js
CHANGED
|
@@ -108,11 +108,12 @@ import { ImageBillboardSet } from "./ImageBillboard/ImageBillboard.js";
|
|
|
108
108
|
import { apy_billboard, billboard, billboard_body, billboard_container, billboard_ctas, billboard_header_section, billboard_image, billboard_img, body, body_copy, header, imagePlacement, image_background, mh_330, rate_billboard, rate_container, rate_pad, section_text_ImageBillboard, single_container, sub_bullets, supertag, three_inline, two_inline, up_to } from "./ImageBillboard/ImageBillboard.css.js";
|
|
109
109
|
import { ImageBillboard } from "./ImageBillboard/ImageBillboardSet.js";
|
|
110
110
|
import { SetContainer } from "./SetContainer/SetContainer.js";
|
|
111
|
-
import { heading, imageLinkContainer, inline_container, isolate_container, set_container, set_logo, setcontainer_section_text } from "./SetContainer/SetContainer.css.js";
|
|
111
|
+
import { heading, imageLinkContainer, inline_container, isolate_container, set_container, set_container_cols, set_logo, setcontainer_section_text } from "./SetContainer/SetContainer.css.js";
|
|
112
112
|
import "react";
|
|
113
113
|
import { ImageLinkSet } from "./ImageLink/ImageLinkSet.js";
|
|
114
114
|
import { Checkbox } from "./Input/Checkbox.js";
|
|
115
115
|
import { CurrencyInput } from "./Input/CurrencyInput.js";
|
|
116
|
+
import { DownPaymentInput } from "./Input/DownPaymentInput.js";
|
|
116
117
|
import { Dropdown } from "./Input/Dropdown.js";
|
|
117
118
|
import { dp_input, selectInput } from "./Input/Dropdown.css.js";
|
|
118
119
|
import { Input } from "./Input/Input.js";
|
|
@@ -120,7 +121,6 @@ import { container, helperText, iconContainer, iconContainerBase, iconInput, inp
|
|
|
120
121
|
import { InputAmount } from "./Input/InputAmount.js";
|
|
121
122
|
import { InputPhone } from "./Input/InputPhone.js";
|
|
122
123
|
import { InputTextArea } from "./Input/InputTextArea.js";
|
|
123
|
-
import { DownPaymentInput } from "./Input/DownPaymentInput.js";
|
|
124
124
|
import { CategorySelector, InsightItem } from "./Insight/Featured/CategorySelector.js";
|
|
125
125
|
import { Featured, FeaturedItem } from "./Insight/Featured/Featured.js";
|
|
126
126
|
import { featured_center_vertical, featured_grid, featured_maingrid, featured_maingrid_img, featured_maingrid_item, featured_maingrid_title, featured_section, featured_subgrid, featured_subgrid_divider, featured_subgrid_item, featured_subgrid_title, featured_supertag, featured_title } from "./Insight/Featured/Featured.css.js";
|
|
@@ -167,6 +167,7 @@ import { findMoreAxosDomains, isAllowedUrl } from "./utils/allowedAxosDomains.js
|
|
|
167
167
|
import { associatedEmail } from "./utils/EverestValidity.js";
|
|
168
168
|
import { getVariant, getVariantWithRegex } from "./utils/getVariant.js";
|
|
169
169
|
import { isAbsoluteUrl, isEmailLink, isPhoneLink, shortUrl, validateLink } from "./utils/validateExternalLinks.js";
|
|
170
|
+
import { columnValues } from "./utils/variant.types.js";
|
|
170
171
|
import { padding_in_footer, smb_section, smb_wrapper } from "./SocialMediaBar/SocialMediaBar.css.js";
|
|
171
172
|
export {
|
|
172
173
|
default20 as AASLogo,
|
|
@@ -371,6 +372,7 @@ export {
|
|
|
371
372
|
calculator_headline,
|
|
372
373
|
centerSelect,
|
|
373
374
|
checkbox_group,
|
|
375
|
+
columnValues,
|
|
374
376
|
comparison,
|
|
375
377
|
comparison_buttons,
|
|
376
378
|
comparison_container,
|
|
@@ -555,6 +557,7 @@ export {
|
|
|
555
557
|
selection_section_icon,
|
|
556
558
|
selection_section_icon_img,
|
|
557
559
|
set_container,
|
|
560
|
+
set_container_cols,
|
|
558
561
|
set_logo,
|
|
559
562
|
setcontainer_section_text,
|
|
560
563
|
shift,
|
package/dist/themes/axos.css.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* empty css
|
|
1
|
+
/* empty css */
|
|
2
2
|
var axosTheme = "_1073cm80";
|
|
3
3
|
var vars = { colors: { primary: { background: "var(--_1073cm81)", body: "var(--_1073cm82)", headline: "var(--_1073cm83)", textGradient: "var(--_1073cm84)", textButton: "var(--_1073cm85)", backgroundButton: "var(--_1073cm86)", border: "var(--_1073cm87)" }, secondary: { background: "var(--_1073cm88)", body: "var(--_1073cm89)", headline: "var(--_1073cm8a)", textGradient: "var(--_1073cm8b)", textButton: "var(--_1073cm8c)", backgroundButton: "var(--_1073cm8d)", border: "var(--_1073cm8e)" }, tertiary: { background: "var(--_1073cm8f)", body: "var(--_1073cm8g)", headline: "var(--_1073cm8h)", textGradient: "var(--_1073cm8i)", textButton: "var(--_1073cm8j)", backgroundButton: "var(--_1073cm8k)", border: "var(--_1073cm8l)" }, quaternary: { background: "var(--_1073cm8m)", body: "var(--_1073cm8n)", headline: "var(--_1073cm8o)", textGradient: "var(--_1073cm8p)", textButton: "var(--_1073cm8q)", backgroundButton: "var(--_1073cm8r)", border: "var(--_1073cm8s)" } }, error: "var(--_1073cm8t)", disabled: { border: "var(--_1073cm8u)", color: "var(--_1073cm8v)", background: "var(--_1073cm8w)" }, icons: { check: { primary: "var(--_1073cm8x)", secondary: "var(--_1073cm8y)" } }, table: { highlight: "var(--_1073cm8z)", color: "var(--_1073cm810)" }, footer: { link: { color: "var(--_1073cm811)" } } };
|
|
4
4
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -29,7 +29,10 @@ const moreDomains = {
|
|
|
29
29
|
"{JHALOAN}": process.env.JHA_LOANSPQ || "https://jha.loanspq.com",
|
|
30
30
|
"{AXSECURITIES}": process.env.AXOS_SECURITIES_URL ?? "https://www.axossecurities.com",
|
|
31
31
|
"{LIBSYN}": process.env.AXOS_LIBSYN || "https://sites.libsyn.com",
|
|
32
|
-
"{
|
|
32
|
+
"{AXBC}": process.env.AXOS_BUSINESS_CENTER ?? "https://www.axosbusinesscenter.com",
|
|
33
|
+
"{AXMWDJ}": process.env.AXOS_MY_WORK_DAY_JOBS ?? "https://axos.wd5.myworkdayjobs.com/Axos",
|
|
34
|
+
"{AXMHA}": process.env.AXOS_MY_HOME_ADVANTAGE ?? "https://axos.myhomeadvantage.com",
|
|
35
|
+
"{AXTPL}": process.env.AXOS_THIRD_PARTY_LENDING ?? "https://thirdpartylending.axosbank.com"
|
|
33
36
|
};
|
|
34
37
|
const isAllowedUrl = (url) => {
|
|
35
38
|
const uri = new URL(url, location.href);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FORMAT_DATE = "MM.dd.yyyy";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getNumOfColumns: (text: string | undefined) => 1 | 2 | 3 | 4 | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const getNumOfColumns = (text) => {
|
|
2
|
+
if (text) {
|
|
3
|
+
if (text.includes("4")) {
|
|
4
|
+
return 4;
|
|
5
|
+
} else if (text.includes("3")) {
|
|
6
|
+
return 3;
|
|
7
|
+
} else if (text.includes("2")) {
|
|
8
|
+
return 2;
|
|
9
|
+
} else if (text.includes("1")) {
|
|
10
|
+
return 1;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return void 0;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
getNumOfColumns
|
|
17
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TPopoverPosition } from '../../types/popover';
|
|
2
|
+
import { CSSProperties, Dispatch, RefObject, SetStateAction } from 'react';
|
|
3
|
+
|
|
4
|
+
type TUsePopoverResponse = {
|
|
5
|
+
attributes: {
|
|
6
|
+
[p: string]: {
|
|
7
|
+
[p: string]: string;
|
|
8
|
+
} | undefined;
|
|
9
|
+
};
|
|
10
|
+
onPopperElement: Dispatch<SetStateAction<HTMLDivElement | null | undefined>>;
|
|
11
|
+
onPopoverPosition: Dispatch<SetStateAction<TPopoverPosition>>;
|
|
12
|
+
onReferenceElement: Dispatch<SetStateAction<HTMLButtonElement | null | undefined>>;
|
|
13
|
+
popperElement?: HTMLDivElement | null | undefined;
|
|
14
|
+
popoverPosition: TPopoverPosition;
|
|
15
|
+
referenceElement?: HTMLButtonElement | null | undefined;
|
|
16
|
+
styles: {
|
|
17
|
+
[p: string]: CSSProperties;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
type TProps = {
|
|
21
|
+
triggerRef: RefObject<HTMLDivElement>;
|
|
22
|
+
};
|
|
23
|
+
type TUsePopover = (props: TProps) => TUsePopoverResponse;
|
|
24
|
+
export declare const usePopover: TUsePopover;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { usePopper } from "react-popper";
|
|
4
|
+
import { POPOVER_WIDTH } from "../constants/popper.js";
|
|
5
|
+
const usePopover = (props) => {
|
|
6
|
+
const { triggerRef } = props;
|
|
7
|
+
const position = "center";
|
|
8
|
+
const [popperElement, setPopperElement] = useState(null);
|
|
9
|
+
const [popoverPosition, setPopoverPosition] = useState(position);
|
|
10
|
+
const [referenceElement, setReferenceElement] = useState(null);
|
|
11
|
+
const { styles, attributes } = usePopper(referenceElement, popperElement, {
|
|
12
|
+
modifiers: [
|
|
13
|
+
{
|
|
14
|
+
name: "flip",
|
|
15
|
+
options: {
|
|
16
|
+
altBoundary: true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "offset",
|
|
21
|
+
options: {
|
|
22
|
+
offset: [0, 12]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "preventOverflow",
|
|
27
|
+
options: {
|
|
28
|
+
altBoundary: true,
|
|
29
|
+
padding: 12
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (triggerRef.current && !position) {
|
|
36
|
+
const { right, width } = triggerRef.current.getBoundingClientRect();
|
|
37
|
+
const bodyWidth = document.body.clientWidth;
|
|
38
|
+
const centerWidth = POPOVER_WIDTH / 2;
|
|
39
|
+
const triggerCenter = right - width / 2;
|
|
40
|
+
const rightSize = bodyWidth - triggerCenter;
|
|
41
|
+
const isRight = rightSize < centerWidth;
|
|
42
|
+
const isLeft = centerWidth > triggerCenter;
|
|
43
|
+
if (isRight) {
|
|
44
|
+
setPopoverPosition("right");
|
|
45
|
+
}
|
|
46
|
+
if (isLeft) {
|
|
47
|
+
setPopoverPosition("left");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, []);
|
|
51
|
+
return {
|
|
52
|
+
attributes,
|
|
53
|
+
onPopperElement: setPopperElement,
|
|
54
|
+
onPopoverPosition: setPopoverPosition,
|
|
55
|
+
onReferenceElement: setReferenceElement,
|
|
56
|
+
popperElement,
|
|
57
|
+
popoverPosition,
|
|
58
|
+
referenceElement,
|
|
59
|
+
styles
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
usePopover
|
|
64
|
+
};
|
package/dist/utils/index.js
CHANGED
|
@@ -2,8 +2,10 @@ import { findMoreAxosDomains, isAllowedUrl } from "./allowedAxosDomains.js";
|
|
|
2
2
|
import { associatedEmail } from "./EverestValidity.js";
|
|
3
3
|
import { getVariant, getVariantWithRegex } from "./getVariant.js";
|
|
4
4
|
import { isAbsoluteUrl, isEmailLink, isPhoneLink, shortUrl, validateLink } from "./validateExternalLinks.js";
|
|
5
|
+
import { columnValues } from "./variant.types.js";
|
|
5
6
|
export {
|
|
6
7
|
associatedEmail,
|
|
8
|
+
columnValues,
|
|
7
9
|
findMoreAxosDomains,
|
|
8
10
|
getVariant,
|
|
9
11
|
getVariantWithRegex,
|
|
@@ -4,3 +4,5 @@ export type SecondaryTypes = "primary" | "secondary";
|
|
|
4
4
|
export type QuaternaryTypes = "primary" | "secondary" | "tertiary" | "quaternary";
|
|
5
5
|
export type SideProps = "left" | "right";
|
|
6
6
|
export type StarIconTypes = "gold" | "gray";
|
|
7
|
+
export declare const columnValues: readonly [1, 2, 3, 4, undefined];
|
|
8
|
+
export type ColumnTypes = (typeof columnValues)[number];
|