@thecb/components 5.6.7 → 5.6.9

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
@@ -6107,6 +6107,16 @@ var checkDeniedCards = function checkDeniedCards(name) {
6107
6107
  return "";
6108
6108
  }
6109
6109
  };
6110
+ /*
6111
+ An optional style for layout atoms that positions the atom completely off screen
6112
+ This will *not* be visible or accessible to sighted users
6113
+ Use to contain text content or a11y interactive content (skip links when not visible)
6114
+ that is only for users of assistive technologies (screen readers)
6115
+
6116
+ Currently implemented on the Box atom via the srOnly prop
6117
+ */
6118
+
6119
+ var screenReaderOnlyStyle = "\n position: absolute;\n left: -10000px;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n";
6110
6120
 
6111
6121
  var general = /*#__PURE__*/Object.freeze({
6112
6122
  __proto__: null,
@@ -6118,7 +6128,8 @@ var general = /*#__PURE__*/Object.freeze({
6118
6128
  generateClickHandler: generateClickHandler,
6119
6129
  checkCardBrand: checkCardBrand,
6120
6130
  displayCardBrand: displayCardBrand,
6121
- checkDeniedCards: checkDeniedCards
6131
+ checkDeniedCards: checkDeniedCards,
6132
+ screenReaderOnlyStyle: screenReaderOnlyStyle
6122
6133
  });
6123
6134
 
6124
6135
  var _excluded$1 = ["themeValues", "weight", "color", "extraStyles", "hoverStyles", "onClick", "onKeyPress", "as", "dataQa", "children"];
@@ -6261,10 +6272,13 @@ var BoxWrapper = styled(function (_ref) {
6261
6272
  });
6262
6273
  /* eslint-enable no-unused-vars */
6263
6274
 
6264
- var _excluded$3 = ["padding", "borderSize", "borderColor", "borderRadius", "boxShadow", "background", "color", "minHeight", "width", "minWidth", "maxWidth", "borderWidthOverride", "border", "textAlign", "hoverStyles", "activeStyles", "disabledStyles", "variant", "as", "onClick", "onKeyDown", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onTouchEnd", "theme", "hiddenStyles", "extraStyles", "dataQa", "children"];
6275
+ var _excluded$3 = ["padding", "borderSize", "borderColor", "borderRadius", "boxShadow", "background", "color", "minHeight", "width", "minWidth", "maxWidth", "borderWidthOverride", "border", "textAlign", "hoverStyles", "activeStyles", "disabledStyles", "variant", "as", "onClick", "onKeyDown", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onTouchEnd", "theme", "hiddenStyles", "extraStyles", "srOnly", "dataQa", "children"];
6265
6276
  /*
6266
6277
  Box component to create generic boxes
6267
6278
  Supply padding, border, background, and color values
6279
+
6280
+ srOnly prop enables special screen-reader style that is used to position content
6281
+ completely off screen (only for users of screen readers)
6268
6282
  */
6269
6283
 
6270
6284
  var Box = function Box(_ref) {
@@ -6301,6 +6315,8 @@ var Box = function Box(_ref) {
6301
6315
  theme = _ref.theme,
6302
6316
  hiddenStyles = _ref.hiddenStyles,
6303
6317
  extraStyles = _ref.extraStyles,
6318
+ _ref$srOnly = _ref.srOnly,
6319
+ srOnly = _ref$srOnly === void 0 ? false : _ref$srOnly,
6304
6320
  dataQa = _ref.dataQa,
6305
6321
  children = _ref.children,
6306
6322
  rest = _objectWithoutProperties(_ref, _excluded$3);
@@ -6327,7 +6343,7 @@ var Box = function Box(_ref) {
6327
6343
  onClick: onClick,
6328
6344
  hiddenStyles: hiddenStyles,
6329
6345
  onKeyDown: onKeyDown,
6330
- extraStyles: extraStyles,
6346
+ extraStyles: srOnly ? "".concat(screenReaderOnlyStyle).concat(extraStyles) : extraStyles,
6331
6347
  theme: theme,
6332
6348
  textAlign: textAlign,
6333
6349
  "data-qa": dataQa,
@@ -41438,6 +41454,119 @@ var WorkflowTile = function WorkflowTile(_ref) {
41438
41454
  }))));
41439
41455
  };
41440
41456
 
41457
+ var DashboardIframe = styled.iframe.withConfig({
41458
+ displayName: "PeriscopeDashboardIframestyled__DashboardIframe",
41459
+ componentId: "sc-j0cucj-0"
41460
+ })(["border:none;box-shadow:0 0 5px 0 ", ";display:none;"], ALTO_GREY);
41461
+
41462
+ /**
41463
+ * Component: PeriscopeDashboardIframe
41464
+ *
41465
+ * Used for rendering Citybase's periscope reporting dashboards in iframes.
41466
+ * Receives action props to trigger a request on mount for the iframe's url.
41467
+ * Receives a string prop if/when we receive the url result.
41468
+ * And receives action props to emit errors from failed iframe loading.
41469
+ *
41470
+ * The logic and api client methods to handle requests/response,
41471
+ * store the url, etc. should be provided from the app consuming this library.
41472
+ *
41473
+ * If the url request is pending, render a spinner.
41474
+ * If the url request failed, render a UI error state.
41475
+ **/
41476
+
41477
+ var DASHBOARD_SIZE_MESSAGE_TYPE = "dashboard_resize";
41478
+ var PERISCOPE_ORIGIN = "https://app.periscopedata.com";
41479
+
41480
+ var isValidMessage = function isValidMessage(message) {
41481
+ return message.isTrusted && message.origin === PERISCOPE_ORIGIN && message.data && message.data.event_type === DASHBOARD_SIZE_MESSAGE_TYPE;
41482
+ };
41483
+
41484
+ var PeriscopeDashboardIframe = function PeriscopeDashboardIframe(_ref) {
41485
+ var url = _ref.url,
41486
+ requestDashboardUrl = _ref.requestDashboardUrl,
41487
+ periscopeDataPending = _ref.periscopeDataPending,
41488
+ periscopeDataSuccess = _ref.periscopeDataSuccess,
41489
+ periscopeDataFailure = _ref.periscopeDataFailure,
41490
+ periscopeDataRequestSuccess = _ref.periscopeDataRequestSuccess,
41491
+ periscopeDataRequestFailure = _ref.periscopeDataRequestFailure;
41492
+
41493
+ var _useState = useState(0),
41494
+ _useState2 = _slicedToArray(_useState, 2),
41495
+ height = _useState2[0],
41496
+ setHeight = _useState2[1];
41497
+
41498
+ var time = {
41499
+ timer: null
41500
+ };
41501
+ useEffect$1(function () {
41502
+ time.timer = setTimeout(function () {
41503
+ periscopeDataRequestFailure();
41504
+ }, 10000);
41505
+ }, []);
41506
+
41507
+ var Dashboard = function Dashboard(height) {
41508
+ return function (url) {
41509
+ return /*#__PURE__*/React.createElement(DashboardIframe, {
41510
+ src: url,
41511
+ width: "100%",
41512
+ height: height,
41513
+ "data-qa": "DashboardIframe",
41514
+ onLoad: function onLoad() {
41515
+ var iframe = document.querySelector("iframe");
41516
+ iframe.style.display = "initial";
41517
+ }
41518
+ });
41519
+ };
41520
+ };
41521
+
41522
+ var validatePeriscope = function validatePeriscope(message) {
41523
+ if (isValidMessage(message)) {
41524
+ setHeight(message.data.dashboard_height + 100);
41525
+ clearTimeout(time.timer);
41526
+ periscopeDataRequestSuccess();
41527
+ }
41528
+ };
41529
+
41530
+ useLayoutEffect(function () {
41531
+ window.addEventListener("message", validatePeriscope);
41532
+ requestDashboardUrl();
41533
+ return function () {
41534
+ return window.removeEventListener("message", validatePeriscope);
41535
+ };
41536
+ }, [requestDashboardUrl]);
41537
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(BoxWithShadow$1, {
41538
+ padding: "0",
41539
+ minWidth: "100%",
41540
+ minHeight: "592px",
41541
+ variant: "baseStandard",
41542
+ background: "#fff",
41543
+ borderRadius: "4px",
41544
+ extraStyles: "display: flex; justify-content: center; align-items: center; flex-direction: column;"
41545
+ }, periscopeDataPending && !periscopeDataSuccess && /*#__PURE__*/React.createElement(Cover, {
41546
+ minHeight: "100%",
41547
+ singleChild: true
41548
+ }, /*#__PURE__*/React.createElement(Center, {
41549
+ intrinsic: true
41550
+ }, /*#__PURE__*/React.createElement(Spinner$2, {
41551
+ size: "100"
41552
+ }))), periscopeDataFailure && !periscopeDataSuccess && /*#__PURE__*/React.createElement(Box, {
41553
+ padding: "64px"
41554
+ }, /*#__PURE__*/React.createElement(Center, {
41555
+ intrinsic: true
41556
+ }, /*#__PURE__*/React.createElement(Box, {
41557
+ padding: "0 0 2rem"
41558
+ }, /*#__PURE__*/React.createElement(PeriscopeFailedIcon, null)), /*#__PURE__*/React.createElement(Heading$1, {
41559
+ variant: "h3",
41560
+ weight: "700"
41561
+ }, "Something Went Wrong"), /*#__PURE__*/React.createElement(Paragraph$1, {
41562
+ variant: "p",
41563
+ extraStyles: "text-align: center;"
41564
+ }, "There was an issue trying to load the dashboard."), /*#__PURE__*/React.createElement(Paragraph$1, {
41565
+ variant: "p",
41566
+ extraStyles: "text-align: center;"
41567
+ }, "Your organization may not have a dashboard configured."))), !periscopeDataFailure && url && Dashboard(height)(url)));
41568
+ };
41569
+
41441
41570
  var pageBackground = "#F6F6F9";
41442
41571
  var fallbackValues$H = {
41443
41572
  pageBackground: pageBackground
@@ -41712,5 +41841,5 @@ var index$5 = /*#__PURE__*/Object.freeze({
41712
41841
  theme: themeUtils
41713
41842
  });
41714
41843
 
41715
- 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, AutopayOnIcon$1 as AutopayOnIcon, BankIcon, Box, BoxWithShadow$1 as BoxWithShadow, Breadcrumbs as Breadcrumb, ButtonWithAction, ButtonWithLink, CalendarIcon, CarrotIcon$1 as CarrotIcon, CashIcon, Center, CenterSingle$1 as CenterSingle, CenterStack$1 as CenterStack, ChangePasswordForm, ChargebackIcon, ChargebackReversalIcon, CheckIcon, Checkbox$1 as Checkbox, CheckboxList$1 as CheckboxList, CheckmarkIcon, ChevronIcon$1 as ChevronIcon, Cluster, CollapsibleSection$1 as CollapsibleSection, 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, FailedIcon, 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, FormattedCreditCard$1 as FormattedCreditCard, Frame, GenericCard, GenericCardLarge, GoToEmailIcon$1 as GoToEmailIcon, Grid, HamburgerButton, Heading$1 as Heading, HighlightTabRow$1 as HighlightTabRow, IconAdd, IconQuitLarge, Imposter, InternalLink, InternalUserInfoForm, Jumbo$1 as Jumbo, LabeledAmount$1 as LabeledAmount, LineItem$1 as LineItem, Loading, LoginForm, Modal$1 as Modal, Module$1 as Module, Motion, NavFooter, NavHeader, NavMenuDesktop$1 as NavMenuDesktop, NavMenuMobile$1 as NavMenuMobile, NoCustomerResultsIcon, NoPaymentResultsIcon, NotFoundIcon, Obligation, iconsMap as ObligationIcons, Pagination, Paragraph$1 as Paragraph, PartialAmountForm, PasswordRequirements, PaymentButtonBar, PaymentDetails$1 as PaymentDetails, PaymentFormACH, PaymentFormCard$1 as PaymentFormCard, PaymentIcon, PaymentMethodAddIcon$1 as PaymentMethodAddIcon, PaymentMethodIcon$1 as PaymentMethodIcon, PaymentSearchIcon, PaymentsIconSmall$1 as PaymentsIconSmall, PendingIcon, PeriscopeFailedIcon, PhoneForm, Placeholder$1 as Placeholder, ProcessingFee$1 as ProcessingFee, ProfileIcon$1 as ProfileIcon, ProfileIconSmall$1 as ProfileIconSmall, PropertiesAddIcon$1 as PropertiesAddIcon, PropertiesIconSmall$1 as PropertiesIconSmall, RadioButton$2 as RadioButton, RadioSection$1 as RadioSection, Reel, RefundIcon, RegistrationForm, RejectedIcon, RejectedVelocityIcon, ResetConfirmationForm$1 as ResetConfirmationForm, ResetPasswordForm, ResetPasswordIcon, ResetPasswordSuccess, 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, FormStateDropdown as StateProvinceDropdown, StatusUnknownIcon, SuccessfulIcon, Switcher, TabSidebar$1 as TabSidebar, TableListItem, 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, WalletIcon$1 as WalletIcon, WarningIconXS, WelcomeModule$1 as WelcomeModule, WorkflowTile, cardRegistry, index$4 as constants, createPartialAmountFormState, index$5 as util, withWindowSize };
41844
+ 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, AutopayOnIcon$1 as AutopayOnIcon, BankIcon, Box, BoxWithShadow$1 as BoxWithShadow, Breadcrumbs as Breadcrumb, ButtonWithAction, ButtonWithLink, CalendarIcon, CarrotIcon$1 as CarrotIcon, CashIcon, Center, CenterSingle$1 as CenterSingle, CenterStack$1 as CenterStack, ChangePasswordForm, ChargebackIcon, ChargebackReversalIcon, CheckIcon, Checkbox$1 as Checkbox, CheckboxList$1 as CheckboxList, CheckmarkIcon, ChevronIcon$1 as ChevronIcon, Cluster, CollapsibleSection$1 as CollapsibleSection, 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, FailedIcon, 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, FormattedCreditCard$1 as FormattedCreditCard, Frame, GenericCard, GenericCardLarge, GoToEmailIcon$1 as GoToEmailIcon, Grid, HamburgerButton, Heading$1 as Heading, HighlightTabRow$1 as HighlightTabRow, IconAdd, IconQuitLarge, Imposter, InternalLink, InternalUserInfoForm, Jumbo$1 as Jumbo, LabeledAmount$1 as LabeledAmount, LineItem$1 as LineItem, Loading, LoginForm, Modal$1 as Modal, Module$1 as Module, Motion, NavFooter, NavHeader, NavMenuDesktop$1 as NavMenuDesktop, NavMenuMobile$1 as NavMenuMobile, NoCustomerResultsIcon, NoPaymentResultsIcon, NotFoundIcon, Obligation, iconsMap as ObligationIcons, Pagination, Paragraph$1 as Paragraph, PartialAmountForm, PasswordRequirements, PaymentButtonBar, PaymentDetails$1 as PaymentDetails, PaymentFormACH, PaymentFormCard$1 as PaymentFormCard, PaymentIcon, PaymentMethodAddIcon$1 as PaymentMethodAddIcon, PaymentMethodIcon$1 as PaymentMethodIcon, PaymentSearchIcon, PaymentsIconSmall$1 as PaymentsIconSmall, PendingIcon, PeriscopeDashboardIframe, PeriscopeFailedIcon, PhoneForm, Placeholder$1 as Placeholder, ProcessingFee$1 as ProcessingFee, ProfileIcon$1 as ProfileIcon, ProfileIconSmall$1 as ProfileIconSmall, PropertiesAddIcon$1 as PropertiesAddIcon, PropertiesIconSmall$1 as PropertiesIconSmall, RadioButton$2 as RadioButton, RadioSection$1 as RadioSection, Reel, RefundIcon, RegistrationForm, RejectedIcon, RejectedVelocityIcon, ResetConfirmationForm$1 as ResetConfirmationForm, ResetPasswordForm, ResetPasswordIcon, ResetPasswordSuccess, 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, FormStateDropdown as StateProvinceDropdown, StatusUnknownIcon, SuccessfulIcon, Switcher, TabSidebar$1 as TabSidebar, TableListItem, 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, WalletIcon$1 as WalletIcon, WarningIconXS, WelcomeModule$1 as WelcomeModule, WorkflowTile, cardRegistry, index$4 as constants, createPartialAmountFormState, index$5 as util, withWindowSize };
41716
41845
  //# sourceMappingURL=index.esm.js.map