UNPKG

@navinc/base-react-components

Version:
94 lines (93 loc) 9.57 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.COVID19Resources = exports.Toggle = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); const styled_components_1 = __importStar(require("styled-components")); const header_js_1 = __importDefault(require("./header.js")); const copy_js_1 = __importDefault(require("./copy.js")); const link_js_1 = __importDefault(require("./link.js")); const icon_js_1 = __importDefault(require("./icon.js")); const aside_js_1 = __importDefault(require("./aside.js")); const is_rebrand_js_1 = __importDefault(require("./is-rebrand.js")); const Toggle = ({ isToggleOpen = false, children }) => { const [isOpen, setIsOpen] = (0, react_1.useState)(isToggleOpen); const toggle = () => { setIsOpen(!isOpen); }; return children({ isOpen, toggle, }); }; exports.Toggle = Toggle; const Hr = styled_components_1.default.hr.withConfig({ displayName: "brc-sc-Hr", componentId: "brc-sc-mqwzlk" }) ` flex: 1; width: 100%; margin: 16px 0; border: 0; border-top: 1px solid ${({ theme }) => theme.neutral300}; `; const SectionWrapper = styled_components_1.default.div.withConfig({ displayName: "brc-sc-SectionWrapper", componentId: "brc-sc-fmq332" }) ` padding: 18px; `; const SubSection = styled_components_1.default.div.withConfig({ displayName: "brc-sc-SubSection", componentId: "brc-sc-h4t6pl" }) ` & ~ & { margin-top: ${({ theme }) => ((0, is_rebrand_js_1.default)(theme) ? '24px' : '0')}; } & ${copy_js_1.default} { margin-top: ${({ theme }) => ((0, is_rebrand_js_1.default)(theme) ? '8px' : '0')}; } `; const StyledToggleWrapper = styled_components_1.default.div.withConfig({ displayName: "brc-sc-StyledToggleWrapper", componentId: "brc-sc-1qjznd" }) ` display: flex; justify-content: space-between; cursor: pointer; `; const StyledIconWrapper = styled_components_1.default.div.withConfig({ displayName: "brc-sc-StyledIconWrapper", componentId: "brc-sc-1os25fh" }) ` text-align: right; padding-top: 16px; `; const StyledHeaderWrapper = styled_components_1.default.div.withConfig({ displayName: "brc-sc-StyledHeaderWrapper", componentId: "brc-sc-47pr0m" }) ` text-align: left; `; const COVID19Resources = ({ shouldShowSBAApplicationAndCalculatorSection, shouldShowBothSBAApplicationAndCalculator = shouldShowSBAApplicationAndCalculatorSection, shouldHideNavCaresActSection = false, className, links = {}, }) => { const [toggled, setToggled] = (0, react_1.useState)(true); const { pppForm, sbaLoanCalc, documentionChecklist } = links; const theme = (0, styled_components_1.useTheme)(); const rebrand = (0, is_rebrand_js_1.default)(theme); if (shouldHideNavCaresActSection) { return (0, jsx_runtime_1.jsx)(react_1.Fragment, Object.assign({ className: className }, { children: null })); } else { return ((0, jsx_runtime_1.jsx)(react_1.Fragment, Object.assign({ className: className }, { children: shouldShowBothSBAApplicationAndCalculator ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(SectionWrapper, { children: [(0, jsx_runtime_1.jsxs)(StyledToggleWrapper, Object.assign({ onClick: () => setToggled(!toggled) }, { children: [(0, jsx_runtime_1.jsxs)(StyledHeaderWrapper, { children: [(0, jsx_runtime_1.jsx)(header_js_1.default, Object.assign({ size: rebrand ? 'xs' : 'lg', id: "free-ppp-tools" }, { children: "Free PPP Tools" })), (0, jsx_runtime_1.jsx)(copy_js_1.default, Object.assign({ light: true, size: "sm" }, { children: "Updated Dec 20, 2022 | by Nav" }))] }), (0, jsx_runtime_1.jsx)(StyledIconWrapper, { children: (0, jsx_runtime_1.jsx)(icon_js_1.default, { name: `actions/carrot-${toggled ? 'up' : 'down'}` }) })] })), toggled && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(SubSection, { children: [(0, jsx_runtime_1.jsxs)(copy_js_1.default, { children: [(0, jsx_runtime_1.jsx)(link_js_1.default, Object.assign({ "data-testid": "covid-resourse:sba-loan-form:application-link1", href: pppForm, rel: "noopener noreferrer", target: "_blank", bold: (0, is_rebrand_js_1.default)(theme) }, { children: "Need a PPP loan? Apply with a Nav lending partner in 15 minutes or less!" })), ' ', "- Don\u2019t miss out on PPP funds - whether it\u2019s your first or second draw. Fill out Nav\u2019s form today to get matched instantly to a PPP lender. Once you see your match, complete your PPP application with the lender in 15 minutes or less!"] }), (0, jsx_runtime_1.jsx)(copy_js_1.default, { children: (0, jsx_runtime_1.jsx)(link_js_1.default, Object.assign({ "data-testid": "covid-resourse:sba-loan-form:application-link2", href: pppForm, rel: "noopener noreferrer", target: "_blank", bold: rebrand }, { children: "Get started" })) })] }), (0, jsx_runtime_1.jsx)(SubSection, { children: (0, jsx_runtime_1.jsx)(aside_js_1.default, { children: "Note: Information and/or an application submitted to one of Nav\u2019s partners does not guarantee you will receive/be approved for a PPP loan." }) }), (0, jsx_runtime_1.jsxs)(SubSection, { children: [(0, jsx_runtime_1.jsxs)(copy_js_1.default, { children: [(0, jsx_runtime_1.jsx)(link_js_1.default, Object.assign({ "data-testid": "covid-resource:sba-loan-checklist:link1", href: documentionChecklist, rel: "noopener noreferrer", target: "_blank", bold: rebrand }, { children: "PPP Documentation Checklist" })), ' ', "- Use this checklist to gather the documentation that you need to complete your PPP loan application. Having these ready will speed up the application process."] }), (0, jsx_runtime_1.jsx)(copy_js_1.default, { children: (0, jsx_runtime_1.jsx)(link_js_1.default, Object.assign({ "data-testid": "covid-resource:sba-loan-checklist:link2", href: documentionChecklist, rel: "noopener noreferrer", target: "_blank", bold: rebrand }, { children: "See checklist" })) })] }), (0, jsx_runtime_1.jsxs)(SubSection, { children: [(0, jsx_runtime_1.jsxs)(copy_js_1.default, { children: [(0, jsx_runtime_1.jsx)(link_js_1.default, Object.assign({ "data-testid": "covid-resourse:sba-loan-calculator:link1", href: sbaLoanCalc, rel: "noopener noreferrer", target: "_blank", bold: rebrand }, { children: "PPP Loan Calculator and FAQ" })), ' ', "- Find out how much your business may qualify for with the new Paycheck Protection Loans."] }), (0, jsx_runtime_1.jsx)(copy_js_1.default, { children: (0, jsx_runtime_1.jsx)(link_js_1.default, Object.assign({ "data-testid": "covid-resourse:sba-loan-calculator:link2", href: sbaLoanCalc, rel: "noopener noreferrer", target: "_blank", bold: rebrand }, { children: "Go to calculator" })) })] })] }))] }), !rebrand && (0, jsx_runtime_1.jsx)(Hr, {})] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(SectionWrapper, { children: [(0, jsx_runtime_1.jsxs)(StyledToggleWrapper, Object.assign({ onClick: () => setToggled(!toggled) }, { children: [(0, jsx_runtime_1.jsxs)(StyledHeaderWrapper, { children: [(0, jsx_runtime_1.jsx)(header_js_1.default, Object.assign({ size: (0, is_rebrand_js_1.default)(theme) ? 'xs' : 'lg' }, { children: "CARES Act SBA Loan Calculator" })), (0, jsx_runtime_1.jsx)(copy_js_1.default, Object.assign({ light: true, size: "sm" }, { children: "Updated Dec 20, 2022 | by Nav" }))] }), (0, jsx_runtime_1.jsx)(StyledIconWrapper, { children: (0, jsx_runtime_1.jsx)(icon_js_1.default, { name: `actions/carrot-${toggled ? 'up' : 'down'}` }) })] })), toggled && ((0, jsx_runtime_1.jsxs)(SubSection, { children: [(0, jsx_runtime_1.jsxs)(copy_js_1.default, { children: [(0, jsx_runtime_1.jsx)(link_js_1.default, Object.assign({ "data-testid": "covid-resourse:sba-loan-calculator:link1", href: sbaLoanCalc, target: "_blank", rel: "noreferrer", bold: rebrand }, { children: "CARES Act SBA Loan Calculator and FAQ" })), ' ', "- Find out how much your business may qualify for with the new Paycheck Protection Loans."] }), (0, jsx_runtime_1.jsx)(copy_js_1.default, { children: (0, jsx_runtime_1.jsx)(link_js_1.default, Object.assign({ "data-testid": "covid-resourse:sba-loan-calculator:link2", href: sbaLoanCalc, target: "_blank", rel: "noreferrer", bold: rebrand }, { children: "Go to calculator" })) })] }))] }), !rebrand && (0, jsx_runtime_1.jsx)(Hr, {})] })) }))); } }; exports.COVID19Resources = COVID19Resources; //# sourceMappingURL=sba-resources.js.map