@thecb/components 7.7.8-beta.9 → 7.8.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/index.esm.js CHANGED
@@ -24454,73 +24454,6 @@ var useOutsideClickHook = function useOutsideClickHook(handler) {
24454
24454
  return ref;
24455
24455
  };
24456
24456
 
24457
- /*
24458
- Hook that determines whether every element in an array of DOM selectors is fully present
24459
- within the user's current viewport.
24460
-
24461
- (elements: Array<String>) => Boolean;
24462
-
24463
- Takes an array of strings that correspond to DOM selectors. Examples:
24464
- "#submit-button", ".module-small", "h2.alert-title"
24465
-
24466
- The document query function will return the *first* element in the document that matches
24467
- the string given.
24468
-
24469
- A combination string of multiple selectors can also be provided as an item in the array, e.g.:
24470
- ".alert-info, .alert-warning, .alert-error". This will return the first element that matches *any* of the provided selectors.
24471
-
24472
- If the element is present in the DOM (domEL !== null), the function examines the element's bounding box
24473
- to determine if the element is within the viewport. If any portion of the element is outside of
24474
- the viewport, the function returns false.
24475
-
24476
- If all elements that exist are within the viewport, the function returns true.
24477
- */
24478
-
24479
- var useCheckElementsInViewport = function useCheckElementsInViewport() {
24480
- var elements = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
24481
- var elementsVisible = true;
24482
- var timeoutID = false;
24483
- var delay = 250;
24484
-
24485
- var _useState = useState(window.innerWidth || document.documentElement.clientWidth),
24486
- _useState2 = _slicedToArray(_useState, 2),
24487
- viewportWidth = _useState2[0],
24488
- setViewportWidth = _useState2[1];
24489
-
24490
- var _useState3 = useState(window.innerHeight || document.documentElement.clientHeight),
24491
- _useState4 = _slicedToArray(_useState3, 2),
24492
- viewportHeight = _useState4[0],
24493
- setViewportHeight = _useState4[1];
24494
-
24495
- var updateViewportValues = function updateViewportValues() {
24496
- clearTimeout(timeoutID);
24497
- timeoutID = setTimeout(function () {
24498
- setViewportWidth(window.innerWidth || document.documentElement.clientWidth);
24499
- setViewportHeight(window.innerHeight || document.documentElement.clientHeight);
24500
- }, delay);
24501
- };
24502
-
24503
- useEffect$1(function () {
24504
- window.addEventListener("resize", updateViewportValues);
24505
- return function () {
24506
- clearTimeout(timeoutID);
24507
- };
24508
- }, []);
24509
- useLayoutEffect(function () {
24510
- elements.forEach(function (element) {
24511
- var domEl = document.querySelector(element);
24512
- var boundingBox = domEl === null || domEl === void 0 ? void 0 : domEl.getBoundingClientRect(); // Skip any elements not in the DOM
24513
-
24514
- if (domEl !== null) {
24515
- if (boundingBox.top < 0 || boundingBox.left < 0 || boundingBox.right > viewportWidth || boundingBox.bottom > viewportHeight) {
24516
- elementsVisible = false;
24517
- }
24518
- }
24519
- });
24520
- }, [elements, viewportWidth, viewportHeight]);
24521
- return elementsVisible;
24522
- };
24523
-
24524
24457
 
24525
24458
 
24526
24459
  var index$4 = /*#__PURE__*/Object.freeze({
@@ -24529,8 +24462,7 @@ var index$4 = /*#__PURE__*/Object.freeze({
24529
24462
  general: general,
24530
24463
  theme: themeUtils,
24531
24464
  useFocusInvalidInput: useFocusInvalidInput,
24532
- useOutsideClick: useOutsideClickHook,
24533
- useCheckElementsInViewport: useCheckElementsInViewport
24465
+ useOutsideClick: useOutsideClickHook
24534
24466
  });
24535
24467
 
24536
24468
  var hoverColor$4 = "#116285";
@@ -25382,6 +25314,59 @@ var Heading = function Heading(_ref) {
25382
25314
 
25383
25315
  var Heading$1 = themeComponent(Heading, "Heading", fallbackValues$n, "h1");
25384
25316
 
25317
+ var Image = styled.img.withConfig({
25318
+ displayName: "ImageBoxstyled__Image",
25319
+ componentId: "sc-8lg9y6-0"
25320
+ })(["width:", ";height:", ";object-fit:", ";object-position:", ";"], function (_ref) {
25321
+ var _ref$width = _ref.width,
25322
+ width = _ref$width === void 0 ? "100%" : _ref$width;
25323
+ return width;
25324
+ }, function (_ref2) {
25325
+ var _ref2$height = _ref2.height,
25326
+ height = _ref2$height === void 0 ? "100%" : _ref2$height;
25327
+ return height;
25328
+ }, function (_ref3) {
25329
+ var _ref3$objectFit = _ref3.objectFit,
25330
+ objectFit = _ref3$objectFit === void 0 ? "cover" : _ref3$objectFit;
25331
+ return objectFit;
25332
+ }, function (_ref4) {
25333
+ var _ref4$objectPosition = _ref4.objectPosition,
25334
+ objectPosition = _ref4$objectPosition === void 0 ? "center" : _ref4$objectPosition;
25335
+ return objectPosition;
25336
+ });
25337
+
25338
+ var ImageBox = function ImageBox(_ref) {
25339
+ var image = _ref.image,
25340
+ minHeight = _ref.minHeight,
25341
+ minWidth = _ref.minWidth,
25342
+ maxWidth = _ref.maxWidth,
25343
+ borderRadius = _ref.borderRadius,
25344
+ imgWidth = _ref.imgWidth,
25345
+ imgHeight = _ref.imgHeight,
25346
+ objectFit = _ref.objectFit,
25347
+ objectPosition = _ref.objectPosition;
25348
+ var boxMaxWidth = maxWidth || minWidth;
25349
+ var _image$url = image.url,
25350
+ url = _image$url === void 0 ? "" : _image$url,
25351
+ _image$altText = image.altText,
25352
+ altText = _image$altText === void 0 ? "" : _image$altText;
25353
+ return /*#__PURE__*/React.createElement(Box, {
25354
+ padding: "0",
25355
+ minWidth: minWidth,
25356
+ minHeight: minHeight,
25357
+ maxWidth: boxMaxWidth,
25358
+ borderRadius: borderRadius,
25359
+ extraStyles: "height: ".concat(minHeight, ";")
25360
+ }, /*#__PURE__*/React.createElement(Image, {
25361
+ width: imgWidth,
25362
+ height: imgHeight,
25363
+ objectFit: objectFit,
25364
+ objectPosition: objectPosition,
25365
+ src: url,
25366
+ alt: altText
25367
+ }));
25368
+ };
25369
+
25385
25370
  var Jumbo = function Jumbo(_ref) {
25386
25371
  var showButton = _ref.showButton,
25387
25372
  heading = _ref.heading,
@@ -40346,8 +40331,6 @@ var HighlightTabRow = function HighlightTabRow(_ref) {
40346
40331
  useOrderedList: useOrderedList,
40347
40332
  useUnorderedList: useUnorderedList
40348
40333
  }, repeat( /*#__PURE__*/React.createElement(Box, null), boxesBefore), tabs.map(function (t, i) {
40349
- var _t$toLowerCase;
40350
-
40351
40334
  return /*#__PURE__*/React.createElement(Box, {
40352
40335
  key: t,
40353
40336
  borderSize: "3px",
@@ -40361,8 +40344,7 @@ var HighlightTabRow = function HighlightTabRow(_ref) {
40361
40344
  textAlign: "center",
40362
40345
  color: themeValues.textColor,
40363
40346
  weight: FONT_WEIGHT_SEMIBOLD,
40364
- extraStyles: "display: block; white-space: nowrap;",
40365
- id: "".concat(t === null || t === void 0 ? void 0 : (_t$toLowerCase = t.toLowerCase()) === null || _t$toLowerCase === void 0 ? void 0 : _t$toLowerCase.replace(/\s/g, "-"), "-tab-text")
40347
+ extraStyles: "display: block; white-space: nowrap;"
40366
40348
  }, t));
40367
40349
  }), repeat( /*#__PURE__*/React.createElement(Box, null), boxesAfter))));
40368
40350
  };
@@ -45556,27 +45538,19 @@ var Module = function Module(_ref) {
45556
45538
  variant = _ref$variant === void 0 ? "default" : _ref$variant,
45557
45539
  fontSize = _ref.fontSize,
45558
45540
  as = _ref.as,
45559
- _ref$titleID = _ref.titleID,
45560
- titleID = _ref$titleID === void 0 ? "" : _ref$titleID,
45561
- rightTitleContent = _ref.rightTitleContent,
45562
45541
  children = _ref.children;
45563
45542
  var themedFontSize = variant === "small" ? "1.25rem" : variant === "default" ? "1.375rem" : "2rem";
45564
45543
  var computedFontSize = fontSize || themedFontSize;
45565
45544
  var themedElemType = variant === "small" ? "h6" : variant === "default" ? "h5" : "h2";
45566
45545
  var computedElemType = as || themedElemType;
45567
- var headingText = /*#__PURE__*/React.createElement(Title$1, {
45546
+ return /*#__PURE__*/React.createElement(Fragment$1, null, heading && /*#__PURE__*/React.createElement(Title$1, {
45568
45547
  weight: themeValues.fontWeight,
45569
45548
  color: themeValues.fontColor,
45570
45549
  margin: "".concat(spacing, " 0 ").concat(themeValues.titleSpacing, " 0"),
45571
45550
  textAlign: themeValues.textAlign,
45572
45551
  as: computedElemType,
45573
- extraStyles: "font-size: ".concat(computedFontSize, ";"),
45574
- id: titleID
45575
- }, heading);
45576
- return /*#__PURE__*/React.createElement(Fragment$1, null, heading && !rightTitleContent && headingText, heading && rightTitleContent && /*#__PURE__*/React.createElement(Cluster, {
45577
- justify: "center",
45578
- align: "space-between"
45579
- }, headingText, rightTitleContent), /*#__PURE__*/React.createElement(Box, {
45552
+ extraStyles: "font-size: ".concat(computedFontSize, ";")
45553
+ }, heading), /*#__PURE__*/React.createElement(Box, {
45580
45554
  padding: "0 0 ".concat(spacingBottom)
45581
45555
  }, /*#__PURE__*/React.createElement(Box, {
45582
45556
  padding: padding,
@@ -48893,5 +48867,5 @@ var SidebarStackContent = function SidebarStackContent(_ref) {
48893
48867
 
48894
48868
  var SidebarStackContent$1 = withWindowSize(themeComponent(SidebarStackContent, "Global", fallbackValues$R));
48895
48869
 
48896
- export { AccountNumberImage, AccountsAddIcon$1 as AccountsAddIcon, AccountsIcon$1 as AccountsIcon, AccountsIconSmall$1 as AccountsIconSmall, AchReturnIcon, AddObligation$1 as AddObligation, AddressForm, Alert$1 as Alert, AllocatedIcon, AmountCallout$1 as AmountCallout, ArrowDownCircleIconSmall, ArrowLeftCircleIconMedium, ArrowLeftCircleIconSmall, ArrowRightCircleIconSmall, ArrowUpCircleIconSmall, AutopayOnIcon, BankIcon, BankIconLarge, Banner$1 as Banner, Box, BoxWithShadow$1 as BoxWithShadow, Breadcrumbs as Breadcrumb, ButtonWithAction, ButtonWithLink, CalendarIcon, Card$1 as Card, CarrotIcon$1 as CarrotIcon, CashIcon, Center, CenterSingle$1 as CenterSingle, CenterStack$1 as CenterStack, ChangePasswordForm, ChargebackIcon, ChargebackIconMedium, ChargebackIconSmall, ChargebackReversalIcon, ChargebackReversalIconMedium, ChargebackReversalIconSmall, CheckIcon, Checkbox$1 as Checkbox, CheckboxList$1 as CheckboxList, CheckmarkIcon, ChevronIcon$1 as ChevronIcon, Cluster, CollapsibleSection$1 as CollapsibleSection, Copyable, CountryDropdown, Cover, CustomerSearchIcon, DefaultPageTemplate, Detail$1 as Detail, DisplayBox$1 as DisplayBox, DisplayCard, Dropdown$1 as Dropdown, DuplicateIcon, EditNameForm, EditableList, EditableTable, EmailForm, EmptyCartIcon$1 as EmptyCartIcon, ErroredIcon, ExternalLink, ExternalLinkIcon, FailedIcon, FindIconSmall$1 as FindIconSmall, FooterWithSubfooter$1 as FooterWithSubfooter, ForgotPasswordForm, ForgotPasswordIcon$1 as ForgotPasswordIcon, FormContainer$1 as FormContainer, FormFooterPanel$1 as FormFooterPanel, FormInput$1 as FormInput, FormInputColumn, FormInputRow, FormSelect$1 as FormSelect, FormattedAddress$1 as FormattedAddress, FormattedBankAccount$1 as FormattedBankAccount, FormattedCreditCard$1 as FormattedCreditCard, Frame, GenericCard, GenericCardLarge, GoToEmailIcon$1 as GoToEmailIcon, Grid, GuidedCheckoutImage, HamburgerButton, Heading$1 as Heading, HighlightTabRow$1 as HighlightTabRow, HistoryIconSmall$1 as HistoryIconSmall, IconAdd, IconQuitLarge, Imposter, InternalLink, Jumbo$1 as Jumbo, LabeledAmount$1 as LabeledAmount, LineItem$1 as LineItem, Loading, LoadingLine, LoginForm, Modal$1 as Modal, Module$1 as Module, Motion, NavFooter, NavHeader, NavMenuDesktop$1 as NavMenuDesktop, NavMenuMobile$1 as NavMenuMobile, NavTabs, NoCustomerResultsIcon, NoPaymentResultsIcon, NotFoundIcon, Obligation, iconsMap as ObligationIcons, Pagination$1 as Pagination, Paragraph$1 as Paragraph, PartialAmountForm, PasswordRequirements, PaymentButtonBar, PaymentDetails$1 as PaymentDetails, PaymentFormACH, PaymentFormCard$1 as PaymentFormCard, PaymentMethodAddIcon$1 as PaymentMethodAddIcon, PaymentMethodIcon$1 as PaymentMethodIcon, PaymentSearchIcon, PaymentsIconSmall$1 as PaymentsIconSmall, PendingIcon, PeriscopeDashboardIframe, PeriscopeFailedIcon, PhoneForm, Placeholder$1 as Placeholder, Popover$1 as Popover, ProcessingFee$1 as ProcessingFee, ProfileIcon$1 as ProfileIcon, ProfileIconSmall$1 as ProfileIconSmall, ProfileImage, PropertiesAddIcon$1 as PropertiesAddIcon, PropertiesIconSmall$1 as PropertiesIconSmall, RadioButton$2 as RadioButton, RadioButtonWithLabel, RadioGroup, RadioSection$1 as RadioSection, Reel, RefundIcon, RefundIconMedium, RefundIconSmall, RegistrationForm, RejectedIcon, RejectedVelocityIcon, ResetConfirmationForm$1 as ResetConfirmationForm, ResetPasswordForm, ResetPasswordIcon, ResetPasswordSuccess, RevenueManagementImage, RoutingNumberImage, SearchIcon, SearchableSelect$1 as SearchableSelect, SettingsIconSmall$1 as SettingsIconSmall, ShoppingCartIcon, Sidebar, SidebarSingleContent$1 as SidebarSingleContent, SidebarStackContent$1 as SidebarStackContent, SolidDivider$1 as SolidDivider, Spinner$2 as Spinner, Stack, StandardCheckoutImage, FormStateDropdown as StateProvinceDropdown, StatusUnknownIcon, SuccessfulIcon, SuccessfulIconMedium, SuccessfulIconSmall, Switcher, TabSidebar$1 as TabSidebar, Table_styled as Table, TableBody_styled as TableBody, TableCell_styled as TableCell, TableHead$1 as TableHead, TableHeading_styled as TableHeading, TableListItem, TableRow$1 as TableRow, Tabs$1 as Tabs, TermsAndConditions, TermsAndConditionsModal$1 as TermsAndConditionsModal, Text$1 as Text, Timeout$1 as Timeout, TimeoutImage, Title$1 as Title, ToggleSwitch$1 as ToggleSwitch, TrashIcon$1 as TrashIcon, TypeaheadInput, VerifiedEmailIcon$1 as VerifiedEmailIcon, VoidedIcon, WalletBannerIcon$1 as WalletBannerIcon, WalletIcon$1 as WalletIcon, WalletIconSmall$1 as WalletIconSmall, WarningIconXS, WelcomeModule$1 as WelcomeModule, WorkflowTile, XCircleIconMedium, XCircleIconSmall, cardRegistry, index$5 as constants, createPartialAmountFormState, index$4 as util, withWindowSize };
48870
+ export { AccountNumberImage, AccountsAddIcon$1 as AccountsAddIcon, AccountsIcon$1 as AccountsIcon, AccountsIconSmall$1 as AccountsIconSmall, AchReturnIcon, AddObligation$1 as AddObligation, AddressForm, Alert$1 as Alert, AllocatedIcon, AmountCallout$1 as AmountCallout, ArrowDownCircleIconSmall, ArrowLeftCircleIconMedium, ArrowLeftCircleIconSmall, ArrowRightCircleIconSmall, ArrowUpCircleIconSmall, AutopayOnIcon, BankIcon, BankIconLarge, Banner$1 as Banner, Box, BoxWithShadow$1 as BoxWithShadow, Breadcrumbs as Breadcrumb, ButtonWithAction, ButtonWithLink, CalendarIcon, Card$1 as Card, CarrotIcon$1 as CarrotIcon, CashIcon, Center, CenterSingle$1 as CenterSingle, CenterStack$1 as CenterStack, ChangePasswordForm, ChargebackIcon, ChargebackIconMedium, ChargebackIconSmall, ChargebackReversalIcon, ChargebackReversalIconMedium, ChargebackReversalIconSmall, CheckIcon, Checkbox$1 as Checkbox, CheckboxList$1 as CheckboxList, CheckmarkIcon, ChevronIcon$1 as ChevronIcon, Cluster, CollapsibleSection$1 as CollapsibleSection, Copyable, CountryDropdown, Cover, CustomerSearchIcon, DefaultPageTemplate, Detail$1 as Detail, DisplayBox$1 as DisplayBox, DisplayCard, Dropdown$1 as Dropdown, DuplicateIcon, EditNameForm, EditableList, EditableTable, EmailForm, EmptyCartIcon$1 as EmptyCartIcon, ErroredIcon, ExternalLink, ExternalLinkIcon, FailedIcon, FindIconSmall$1 as FindIconSmall, FooterWithSubfooter$1 as FooterWithSubfooter, ForgotPasswordForm, ForgotPasswordIcon$1 as ForgotPasswordIcon, FormContainer$1 as FormContainer, FormFooterPanel$1 as FormFooterPanel, FormInput$1 as FormInput, FormInputColumn, FormInputRow, FormSelect$1 as FormSelect, FormattedAddress$1 as FormattedAddress, FormattedBankAccount$1 as FormattedBankAccount, FormattedCreditCard$1 as FormattedCreditCard, Frame, GenericCard, GenericCardLarge, GoToEmailIcon$1 as GoToEmailIcon, Grid, GuidedCheckoutImage, HamburgerButton, Heading$1 as Heading, HighlightTabRow$1 as HighlightTabRow, HistoryIconSmall$1 as HistoryIconSmall, IconAdd, IconQuitLarge, ImageBox, Imposter, InternalLink, Jumbo$1 as Jumbo, LabeledAmount$1 as LabeledAmount, LineItem$1 as LineItem, Loading, LoadingLine, LoginForm, Modal$1 as Modal, Module$1 as Module, Motion, NavFooter, NavHeader, NavMenuDesktop$1 as NavMenuDesktop, NavMenuMobile$1 as NavMenuMobile, NavTabs, NoCustomerResultsIcon, NoPaymentResultsIcon, NotFoundIcon, Obligation, iconsMap as ObligationIcons, Pagination$1 as Pagination, Paragraph$1 as Paragraph, PartialAmountForm, PasswordRequirements, PaymentButtonBar, PaymentDetails$1 as PaymentDetails, PaymentFormACH, PaymentFormCard$1 as PaymentFormCard, PaymentMethodAddIcon$1 as PaymentMethodAddIcon, PaymentMethodIcon$1 as PaymentMethodIcon, PaymentSearchIcon, PaymentsIconSmall$1 as PaymentsIconSmall, PendingIcon, PeriscopeDashboardIframe, PeriscopeFailedIcon, PhoneForm, Placeholder$1 as Placeholder, Popover$1 as Popover, ProcessingFee$1 as ProcessingFee, ProfileIcon$1 as ProfileIcon, ProfileIconSmall$1 as ProfileIconSmall, ProfileImage, PropertiesAddIcon$1 as PropertiesAddIcon, PropertiesIconSmall$1 as PropertiesIconSmall, RadioButton$2 as RadioButton, RadioButtonWithLabel, RadioGroup, RadioSection$1 as RadioSection, Reel, RefundIcon, RefundIconMedium, RefundIconSmall, RegistrationForm, RejectedIcon, RejectedVelocityIcon, ResetConfirmationForm$1 as ResetConfirmationForm, ResetPasswordForm, ResetPasswordIcon, ResetPasswordSuccess, RevenueManagementImage, RoutingNumberImage, SearchIcon, SearchableSelect$1 as SearchableSelect, SettingsIconSmall$1 as SettingsIconSmall, ShoppingCartIcon, Sidebar, SidebarSingleContent$1 as SidebarSingleContent, SidebarStackContent$1 as SidebarStackContent, SolidDivider$1 as SolidDivider, Spinner$2 as Spinner, Stack, StandardCheckoutImage, FormStateDropdown as StateProvinceDropdown, StatusUnknownIcon, SuccessfulIcon, SuccessfulIconMedium, SuccessfulIconSmall, Switcher, TabSidebar$1 as TabSidebar, Table_styled as Table, TableBody_styled as TableBody, TableCell_styled as TableCell, TableHead$1 as TableHead, TableHeading_styled as TableHeading, TableListItem, TableRow$1 as TableRow, Tabs$1 as Tabs, TermsAndConditions, TermsAndConditionsModal$1 as TermsAndConditionsModal, Text$1 as Text, Timeout$1 as Timeout, TimeoutImage, Title$1 as Title, ToggleSwitch$1 as ToggleSwitch, TrashIcon$1 as TrashIcon, TypeaheadInput, VerifiedEmailIcon$1 as VerifiedEmailIcon, VoidedIcon, WalletBannerIcon$1 as WalletBannerIcon, WalletIcon$1 as WalletIcon, WalletIconSmall$1 as WalletIconSmall, WarningIconXS, WelcomeModule$1 as WelcomeModule, WorkflowTile, XCircleIconMedium, XCircleIconSmall, cardRegistry, index$5 as constants, createPartialAmountFormState, index$4 as util, withWindowSize };
48897
48871
  //# sourceMappingURL=index.esm.js.map