@ably/ui 13.3.0 → 14.0.0-dev.1939f45
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/README.md +26 -155
- package/core/.DS_Store +0 -0
- package/core/Accordion/.DS_Store +0 -0
- package/core/Accordion.js +1 -0
- package/core/Code/.DS_Store +0 -0
- package/core/Code/component.css +1 -72
- package/core/Code/component.js +1 -1
- package/core/Code.js +1 -0
- package/core/ConnectStateWrapper.js +1 -0
- package/core/ContactFooter/.DS_Store +0 -0
- package/core/ContactFooter/component.css +0 -1
- package/core/ContactFooter/component.js +1 -1
- package/core/ContactFooter.js +1 -0
- package/core/CookieMessage/.DS_Store +0 -0
- package/core/CookieMessage/component.css +0 -1
- package/core/CookieMessage.js +1 -0
- package/core/CustomerLogos/.DS_Store +0 -0
- package/core/CustomerLogos.js +1 -0
- package/core/DropdownMenu/.DS_Store +0 -0
- package/core/DropdownMenu.js +1 -0
- package/core/Expander.js +1 -0
- package/core/FeaturedLink/.DS_Store +0 -0
- package/core/FeaturedLink.js +1 -0
- package/core/Flash/.DS_Store +0 -0
- package/core/Flash/component.css +0 -1
- package/core/Flash.js +1 -0
- package/core/Footer/.DS_Store +0 -0
- package/core/Footer/component.css +0 -1
- package/core/Footer.js +1 -0
- package/core/Icon/.DS_Store +0 -0
- package/core/Icon.js +1 -0
- package/core/Loader/.DS_Store +0 -0
- package/core/Loader.js +13 -0
- package/core/Logo/.DS_Store +0 -0
- package/core/Logo.js +1 -0
- package/core/Meganav/.DS_Store +0 -0
- package/core/Meganav/component.css +2 -3
- package/core/Meganav/component.js +1 -1
- package/core/Meganav.js +1 -0
- package/core/MeganavBlogPostsList/.DS_Store +0 -0
- package/core/MeganavBlogPostsList/component.js +1 -2
- package/core/MeganavBlogPostsList.js +1 -0
- package/core/MeganavContentCompany.js +1 -0
- package/core/MeganavContentDevelopers.js +1 -0
- package/core/MeganavContentProducts.js +1 -0
- package/core/MeganavContentUseCases.js +1 -0
- package/core/MeganavControl/.DS_Store +0 -0
- package/core/MeganavControl/component.js +1 -1
- package/core/MeganavControl.js +1 -0
- package/core/MeganavControlMobileDropdown/.DS_Store +0 -0
- package/core/MeganavControlMobileDropdown/component.js +1 -1
- package/core/MeganavControlMobileDropdown.js +1 -0
- package/core/MeganavControlMobilePanelClose/.DS_Store +0 -0
- package/core/MeganavControlMobilePanelClose/component.js +1 -1
- package/core/MeganavControlMobilePanelClose.js +1 -0
- package/core/MeganavControlMobilePanelOpen/.DS_Store +0 -0
- package/core/MeganavControlMobilePanelOpen/component.js +1 -1
- package/core/MeganavControlMobilePanelOpen.js +1 -0
- package/core/MeganavItemsDesktop.js +1 -0
- package/core/MeganavItemsMobile.js +1 -0
- package/core/MeganavItemsSignedIn.js +1 -0
- package/core/MeganavSearch.js +1 -0
- package/core/MeganavSearchAutocomplete/.DS_Store +0 -0
- package/core/MeganavSearchAutocomplete/component.js +1 -1
- package/core/MeganavSearchAutocomplete.js +1 -0
- package/core/MeganavSearchPanel.js +1 -0
- package/core/MeganavSearchSuggestions/.DS_Store +0 -0
- package/core/MeganavSearchSuggestions/component.js +1 -1
- package/core/MeganavSearchSuggestions.js +1 -0
- package/core/Notice/.DS_Store +0 -0
- package/core/Notice/component.css +0 -1
- package/core/Notice/component.js +1 -1
- package/core/Notice.js +1 -0
- package/core/SignOutLink.js +1 -0
- package/core/Slider/.DS_Store +0 -0
- package/core/Slider/component.css +32 -1
- package/core/Slider/component.js +1 -1
- package/core/Slider.js +1 -0
- package/core/Table/.DS_Store +0 -0
- package/core/Table/Table.js +1 -0
- package/core/Table/TableCell.js +7 -0
- package/core/Table/TableRow.js +1 -0
- package/core/Table/data.js +1 -0
- package/core/Table.js +1 -0
- package/core/Tooltip/.DS_Store +0 -0
- package/core/Tooltip.js +1 -0
- package/core/css.js +1 -0
- package/core/dom-query.js +1 -0
- package/core/hubspot-chat-toggle.js +1 -0
- package/core/icons/discord.svg +10 -0
- package/core/icons/facebook.svg +4 -0
- package/core/icons/github.svg +3 -0
- package/core/icons/glassdoor.svg +3 -0
- package/core/icons/google.svg +3 -0
- package/core/icons/icon-display-48hrs.svg +3 -0
- package/core/icons/icon-display-about-ably-col.svg +4 -0
- package/core/icons/icon-display-api-keys.svg +3 -0
- package/core/icons/icon-display-api.svg +3 -0
- package/core/icons/icon-display-asset-tracking-col.svg +18 -0
- package/core/icons/icon-display-browser.svg +10 -0
- package/core/icons/icon-display-calendar.svg +3 -0
- package/core/icons/icon-display-call-mobile.svg +3 -0
- package/core/icons/icon-display-careers-col.svg +9 -0
- package/core/icons/icon-display-case-studies-col.svg +5 -0
- package/core/icons/icon-display-chat-col.svg +4 -0
- package/core/icons/icon-display-chat-stack-col.svg +4 -0
- package/core/icons/icon-display-chat-stack.svg +4 -0
- package/core/icons/icon-display-cloud-servers.svg +3 -0
- package/core/icons/icon-display-compare-tech-col.svg +9 -0
- package/core/icons/icon-display-customers-col.svg +15 -0
- package/core/icons/icon-display-data-broadcast-col.svg +26 -0
- package/core/icons/icon-display-data-synchronization-col.svg +14 -0
- package/core/icons/icon-display-docs-col.svg +7 -0
- package/core/icons/icon-display-documentation.svg +3 -0
- package/core/icons/icon-display-events-col.svg +13 -0
- package/core/icons/icon-display-examples-col.svg +11 -0
- package/core/icons/icon-display-gdpr.svg +3 -0
- package/core/icons/icon-display-general-comms.svg +3 -0
- package/core/icons/icon-display-hipaa.svg +10 -0
- package/core/icons/icon-display-integrations-col.svg +8 -0
- package/core/icons/icon-display-it-support-access.svg +3 -0
- package/core/icons/icon-display-it-support-helpdesk.svg +3 -0
- package/core/icons/icon-display-kafka-at-the-edge-col.svg +8 -0
- package/core/icons/icon-display-laptop.svg +10 -0
- package/core/icons/icon-display-lightbulb-col.svg +10 -0
- package/core/icons/icon-display-live-chat.svg +3 -0
- package/core/icons/icon-display-map-pin.svg +3 -0
- package/core/icons/icon-display-message.svg +3 -0
- package/core/icons/icon-display-padlock-closed.svg +3 -0
- package/core/icons/icon-display-platform.svg +22 -0
- package/core/icons/icon-display-play.svg +3 -0
- package/core/icons/icon-display-privacy-shield-framework.svg +7 -0
- package/core/icons/icon-display-push-notifications-col.svg +6 -0
- package/core/icons/icon-display-quickstart-guides-col.svg +8 -0
- package/core/icons/icon-display-resources-col.svg +21 -0
- package/core/icons/icon-display-sdks-col.svg +11 -0
- package/core/icons/icon-display-servers.svg +3 -0
- package/core/icons/icon-display-shopping-cart.svg +10 -0
- package/core/icons/icon-display-sla.svg +3 -0
- package/core/icons/icon-display-soc2-type2.svg +3 -0
- package/core/icons/icon-display-tech-account-comms.svg +3 -0
- package/core/icons/icon-display-tutorials-demos-col.svg +25 -0
- package/core/icons/icon-display-virtual-events-col.svg +12 -0
- package/core/icons/icon-display-virtual-events.svg +12 -0
- package/core/icons/icon-gui-ably-badge.svg +3 -0
- package/core/icons/icon-gui-arrow-bidirectional-horizontal.svg +3 -0
- package/core/icons/icon-gui-arrow-bidirectional-vertical.svg +3 -0
- package/core/icons/icon-gui-arrow-down.svg +3 -0
- package/core/icons/icon-gui-arrow-left.svg +3 -0
- package/core/icons/icon-gui-arrow-right.svg +3 -0
- package/core/icons/icon-gui-arrow-up.svg +3 -0
- package/core/icons/icon-gui-burger-menu.svg +5 -0
- package/core/icons/icon-gui-check-circled-fill-black.svg +4 -0
- package/core/icons/icon-gui-check-circled-fill.svg +4 -0
- package/core/icons/icon-gui-check-circled.svg +3 -0
- package/core/icons/icon-gui-checklist-checked.svg +3 -0
- package/core/icons/icon-gui-clock.svg +3 -0
- package/core/icons/icon-gui-close.svg +3 -0
- package/core/icons/icon-gui-copy.svg +10 -0
- package/core/icons/icon-gui-cross-circled-fill.svg +4 -0
- package/core/icons/icon-gui-cross-circled.svg +3 -0
- package/core/icons/icon-gui-dash-circled.svg +3 -0
- package/core/icons/icon-gui-disclosure-arrow.svg +3 -0
- package/core/icons/icon-gui-document-generic.svg +3 -0
- package/core/icons/icon-gui-enlarge.svg +3 -0
- package/core/icons/icon-gui-external-link.svg +3 -0
- package/core/icons/icon-gui-filter-flow-step-1.svg +5 -0
- package/core/icons/icon-gui-filter-flow-step-2.svg +5 -0
- package/core/icons/icon-gui-filter-flow-step-3.svg +5 -0
- package/core/icons/icon-gui-history.svg +3 -0
- package/core/icons/icon-gui-info.svg +3 -0
- package/core/icons/icon-gui-link-arrow.svg +3 -0
- package/core/icons/icon-gui-link.svg +4 -0
- package/core/icons/icon-gui-live-chat.svg +3 -0
- package/core/icons/icon-gui-minus.svg +3 -0
- package/core/icons/icon-gui-partial.svg +4 -0
- package/core/icons/icon-gui-plus.svg +3 -0
- package/core/icons/icon-gui-quote-marks-solid.svg +3 -0
- package/core/icons/icon-gui-refresh.svg +10 -0
- package/core/icons/icon-gui-resources.svg +3 -0
- package/core/icons/icon-gui-search.svg +3 -0
- package/core/icons/icon-gui-tick.svg +3 -0
- package/core/icons/icon-gui-warning.svg +5 -0
- package/core/icons/icon-live-updates-results-metrics-col.svg +26 -0
- package/core/icons/icon-multi-user-spaces-col.svg +13 -0
- package/core/icons/icon-social-x.svg +3 -0
- package/core/icons/icon-tech-apachekafka.svg +3 -0
- package/core/icons/linkedin.svg +3 -0
- package/core/icons/quote.svg +3 -0
- package/core/icons/stackoverflow.svg +3 -0
- package/core/icons/twitter.svg +3 -0
- package/core/icons/youtube.svg +11 -0
- package/core/icons.js +1 -0
- package/core/load-sprites.js +1 -0
- package/core/react-renderer.js +1 -0
- package/core/remote-blogs-posts.js +1 -0
- package/core/remote-data-store.js +1 -0
- package/core/remote-data-util.js +1 -0
- package/core/remote-session-data.js +1 -0
- package/core/scripts.js +1 -2
- package/core/sprites.svg +1 -525
- package/core/styles/buttons.css +124 -0
- package/core/styles/forms.css +64 -0
- package/core/styles/layout.css +21 -0
- package/core/styles/properties.css +278 -0
- package/core/styles/text.css +168 -0
- package/core/styles.base.css +1 -0
- package/core/styles.components.css +35 -0
- package/core/styles.css +2 -699
- package/core/url-base.js +1 -0
- package/core/utils/syntax-highlighter-registry.js +1 -0
- package/core/utils/syntax-highlighter.css +74 -0
- package/core/utils/syntax-highlighter.js +1 -0
- package/package.json +39 -35
- package/reset/scripts.js +1 -1
- package/reset/styles/normalize.css +353 -0
- package/reset/styles/reset.css +129 -0
- package/reset/styles.css +2 -477
- package/src/.DS_Store +0 -0
- package/src/core/.DS_Store +0 -0
- package/src/core/Accordion/.DS_Store +0 -0
- package/src/core/Accordion/Accordion.stories.tsx +39 -0
- package/src/core/Accordion.tsx +147 -0
- package/src/core/Code/.DS_Store +0 -0
- package/src/core/Code/Code.stories.tsx +71 -0
- package/src/core/Code.tsx +45 -0
- package/src/core/{ConnectStateWrapper/component.jsx → ConnectStateWrapper.tsx} +8 -4
- package/src/core/ContactFooter/.DS_Store +0 -0
- package/src/core/ContactFooter/ContactFooter.stories.tsx +11 -0
- package/src/core/{ContactFooter/component.jsx → ContactFooter.tsx} +44 -19
- package/src/core/CookieMessage/.DS_Store +0 -0
- package/src/core/CookieMessage/CookieMessage.stories.tsx +12 -0
- package/src/core/{CookieMessage/component.jsx → CookieMessage.tsx} +15 -11
- package/src/core/CustomerLogos/.DS_Store +0 -0
- package/src/core/CustomerLogos/CustomerLogos.stories.tsx +43 -0
- package/src/core/CustomerLogos.tsx +35 -0
- package/src/core/DropdownMenu/.DS_Store +0 -0
- package/src/core/DropdownMenu/DropdownMenu.stories.tsx +48 -0
- package/src/core/{DropdownMenu/component.jsx → DropdownMenu.tsx} +64 -36
- package/src/core/Expander/Expander.stories.tsx +132 -0
- package/src/core/Expander.tsx +54 -0
- package/src/core/FeaturedLink/.DS_Store +0 -0
- package/src/core/FeaturedLink/FeaturedLink.stories.tsx +43 -0
- package/src/core/{FeaturedLink/component.jsx → FeaturedLink.tsx} +26 -18
- package/src/core/Flash/.DS_Store +0 -0
- package/src/core/Flash/Flash.stories.tsx +37 -0
- package/src/core/{Flash/component.jsx → Flash.tsx} +77 -39
- package/src/core/Footer/.DS_Store +0 -0
- package/src/core/Footer/Footer.stories.tsx +26 -0
- package/src/core/{Footer/component.jsx → Footer.tsx} +236 -70
- package/src/core/Icon/.DS_Store +0 -0
- package/src/core/Icon/Icon.stories.tsx +151 -0
- package/src/core/Icon.tsx +26 -0
- package/src/core/Loader/.DS_Store +0 -0
- package/src/core/Loader/Loader.stories.tsx +21 -0
- package/src/core/{Loader/component.jsx → Loader.tsx} +11 -8
- package/src/core/Logo/.DS_Store +0 -0
- package/src/core/Logo/Logo.stories.tsx +12 -0
- package/src/core/Logo.tsx +29 -0
- package/src/core/Meganav/.DS_Store +0 -0
- package/src/core/Meganav/Meganav.stories.tsx +86 -0
- package/src/core/Meganav/component.css +2 -2
- package/src/core/Meganav/component.js +6 -9
- package/src/core/Meganav.tsx +225 -0
- package/src/core/MeganavBlogPostsList/.DS_Store +0 -0
- package/src/core/{MeganavBlogPostsList/component.jsx → MeganavBlogPostsList.tsx} +15 -14
- package/src/core/{MeganavContentCompany/component.jsx → MeganavContentCompany.tsx} +82 -33
- package/src/core/{MeganavContentDevelopers/component.jsx → MeganavContentDevelopers.tsx} +98 -34
- package/src/core/MeganavContentProducts.tsx +165 -0
- package/src/core/MeganavContentUseCases.tsx +244 -0
- package/src/core/MeganavControl/.DS_Store +0 -0
- package/src/core/{MeganavControl/component.jsx → MeganavControl.tsx} +18 -12
- package/src/core/MeganavControlMobileDropdown/.DS_Store +0 -0
- package/src/core/{MeganavControlMobileDropdown/component.jsx → MeganavControlMobileDropdown.tsx} +3 -7
- package/src/core/MeganavControlMobilePanelClose/.DS_Store +0 -0
- package/src/core/{MeganavControlMobilePanelClose/component.jsx → MeganavControlMobilePanelClose.tsx} +15 -9
- package/src/core/MeganavControlMobilePanelOpen/.DS_Store +0 -0
- package/src/core/MeganavControlMobilePanelOpen.tsx +31 -0
- package/src/core/MeganavItemsDesktop.tsx +68 -0
- package/src/core/MeganavItemsMobile.tsx +197 -0
- package/src/core/{MeganavItemsSignedIn/component.jsx → MeganavItemsSignedIn.tsx} +55 -23
- package/src/core/MeganavSearch.tsx +36 -0
- package/src/core/MeganavSearchAutocomplete/.DS_Store +0 -0
- package/src/core/MeganavSearchAutocomplete.tsx +12 -0
- package/src/core/MeganavSearchPanel.tsx +52 -0
- package/src/core/MeganavSearchSuggestions/.DS_Store +0 -0
- package/src/core/MeganavSearchSuggestions.tsx +62 -0
- package/src/core/Notice/.DS_Store +0 -0
- package/src/core/Notice/component.js +1 -2
- package/src/core/Notice.tsx +102 -0
- package/src/core/SignOutLink.tsx +51 -0
- package/src/core/Slider/.DS_Store +0 -0
- package/src/core/Slider/Slider.stories.tsx +98 -0
- package/src/core/Slider/component.css +32 -0
- package/src/core/Slider/component.js +0 -2
- package/src/core/Slider.tsx +192 -0
- package/src/core/Table/.DS_Store +0 -0
- package/src/core/Table/Table.stories.tsx +12 -0
- package/src/core/Table/Table.tsx +59 -0
- package/src/core/Table/TableCell.tsx +109 -0
- package/src/core/Table/TableRow.tsx +25 -0
- package/src/core/Table/data.tsx +113 -0
- package/src/core/Table.tsx +26 -0
- package/src/core/Tooltip/.DS_Store +0 -0
- package/src/core/Tooltip/Tooltip.stories.tsx +27 -0
- package/src/core/Tooltip.tsx +88 -0
- package/src/core/icons/icon-gui-partial.svg +4 -0
- package/src/core/icons.js +6 -0
- package/src/core/{react-renderer.js → react-renderer.tsx} +9 -7
- package/src/core/scripts.js +0 -2
- package/src/core/styles/properties.css +0 -7
- package/src/core/utils/syntax-highlighter.css +3 -0
- package/src/pages/Buttons.mdx +121 -0
- package/src/pages/Chips.mdx +136 -0
- package/src/pages/Colour.mdx +23 -0
- package/src/pages/Forms.mdx +173 -0
- package/src/pages/Layout.mdx +58 -0
- package/src/pages/Typography.mdx +206 -0
- package/src/pages/utils.ts +70 -0
- package/tailwind.config.js +1 -7
- package/tailwind.extend.js +1 -1
- package/core/.gitignore +0 -1
- package/core/Code.jsx +0 -684
- package/core/CompanyAutocomplete/component.css +0 -46
- package/core/CompanyAutocomplete/component.js +0 -2
- package/core/CompanyAutocomplete/component.js.LICENSE.txt +0 -1
- package/core/ConnectStateWrapper/component.js +0 -1
- package/core/ConnectStateWrapper.jsx +0 -222
- package/core/ContactFooter.jsx +0 -342
- package/core/CookieMessage/component.js +0 -1
- package/core/CookieMessage.jsx +0 -204
- package/core/CustomerLogos/component.js +0 -1
- package/core/CustomerLogos.jsx +0 -144
- package/core/DropdownMenu/component.js +0 -1
- package/core/DropdownMenu.jsx +0 -313
- package/core/FeatureFooter/component.css +0 -13
- package/core/FeatureFooter/component.js +0 -1
- package/core/FeaturedLink/component.js +0 -1
- package/core/FeaturedLink.jsx +0 -241
- package/core/Flash/component.js +0 -1
- package/core/Flash.jsx +0 -622
- package/core/Footer/component.js +0 -1
- package/core/Footer.jsx +0 -587
- package/core/Icon/component.js +0 -1
- package/core/Icon.jsx +0 -152
- package/core/Loader/component.js +0 -1
- package/core/Loader.jsx +0 -154
- package/core/Logo/component.js +0 -1
- package/core/Logo.jsx +0 -147
- package/core/Meganav.jsx +0 -4151
- package/core/MeganavBlogPostsList/component.js.LICENSE.txt +0 -1
- package/core/MeganavBlogPostsList.jsx +0 -296
- package/core/MeganavContentCompany/component.js +0 -1
- package/core/MeganavContentCompany.jsx +0 -1058
- package/core/MeganavContentDevelopers/component.js +0 -1
- package/core/MeganavContentDevelopers.jsx +0 -334
- package/core/MeganavContentProducts/component.js +0 -1
- package/core/MeganavContentProducts.jsx +0 -373
- package/core/MeganavContentUseCases/component.js +0 -1
- package/core/MeganavContentUseCases.jsx +0 -341
- package/core/MeganavControl.jsx +0 -199
- package/core/MeganavControlMobileDropdown.jsx +0 -197
- package/core/MeganavControlMobilePanelClose.jsx +0 -198
- package/core/MeganavControlMobilePanelOpen.jsx +0 -193
- package/core/MeganavItemsDesktop/component.js +0 -1
- package/core/MeganavItemsDesktop.jsx +0 -279
- package/core/MeganavItemsMobile/component.js +0 -1
- package/core/MeganavItemsMobile.jsx +0 -689
- package/core/MeganavItemsSignedIn/component.js +0 -1
- package/core/MeganavItemsSignedIn.jsx +0 -643
- package/core/MeganavSearch/component.js +0 -1
- package/core/MeganavSearch.jsx +0 -434
- package/core/MeganavSearchAutocomplete.jsx +0 -117
- package/core/MeganavSearchPanel/component.js +0 -1
- package/core/MeganavSearchPanel.jsx +0 -386
- package/core/MeganavSearchSuggestions.jsx +0 -299
- package/core/Notice.jsx +0 -914
- package/core/Showcase/component.css +0 -31
- package/core/Showcase/component.js +0 -1
- package/core/Showcase.jsx +0 -17
- package/core/SignOutLink/component.js +0 -1
- package/core/SignOutLink.jsx +0 -157
- package/core/Slider.jsx +0 -400
- package/core/Uptime/component.css +0 -128
- package/core/Uptime/component.js +0 -1
- package/core/Uptime.jsx +0 -895
- package/core/scripts.js.LICENSE.txt +0 -1
- package/preview/log/.keep +0 -0
- package/preview/tmp/.keep +0 -0
- package/preview/tmp/pids/.keep +0 -0
- package/reset/.gitignore +0 -1
- package/src/core/Code/component.html.erb +0 -3
- package/src/core/Code/component.jsx +0 -31
- package/src/core/Code/component.rb +0 -12
- package/src/core/CompanyAutocomplete/component.css +0 -45
- package/src/core/CompanyAutocomplete/component.js +0 -204
- package/src/core/ConnectStateWrapper/component.js +0 -0
- package/src/core/ContactFooter/component.html.erb +0 -32
- package/src/core/ContactFooter/component.rb +0 -13
- package/src/core/CookieMessage/component.js +0 -1
- package/src/core/CustomerLogos/component.html.erb +0 -9
- package/src/core/CustomerLogos/component.js +0 -0
- package/src/core/CustomerLogos/component.jsx +0 -28
- package/src/core/CustomerLogos/component.rb +0 -14
- package/src/core/DropdownMenu/component.js +0 -0
- package/src/core/FeatureFooter/component.css +0 -12
- package/src/core/FeatureFooter/component.html.erb +0 -54
- package/src/core/FeatureFooter/component.js +0 -7
- package/src/core/FeatureFooter/component.rb +0 -30
- package/src/core/FeaturedLink/component.html.erb +0 -15
- package/src/core/FeaturedLink/component.js +0 -0
- package/src/core/FeaturedLink/component.rb +0 -21
- package/src/core/Flash/component.js +0 -1
- package/src/core/Footer/component.html.erb +0 -256
- package/src/core/Footer/component.js +0 -1
- package/src/core/Footer/component.rb +0 -14
- package/src/core/Icon/component.html.erb +0 -3
- package/src/core/Icon/component.js +0 -0
- package/src/core/Icon/component.jsx +0 -19
- package/src/core/Icon/component.rb +0 -25
- package/src/core/Loader/component.html.erb +0 -18
- package/src/core/Loader/component.js +0 -0
- package/src/core/Loader/component.rb +0 -19
- package/src/core/Logo/component.html.erb +0 -3
- package/src/core/Logo/component.js +0 -0
- package/src/core/Logo/component.jsx +0 -20
- package/src/core/Logo/component.rb +0 -31
- package/src/core/Meganav/component.html.erb +0 -31
- package/src/core/Meganav/component.jsx +0 -123
- package/src/core/Meganav/component.rb +0 -60
- package/src/core/MeganavBlogPostsList/component.html.erb +0 -5
- package/src/core/MeganavBlogPostsList/component.rb +0 -13
- package/src/core/MeganavContentCompany/component.html.erb +0 -90
- package/src/core/MeganavContentCompany/component.js +0 -0
- package/src/core/MeganavContentCompany/component.rb +0 -14
- package/src/core/MeganavContentDevelopers/component.html.erb +0 -129
- package/src/core/MeganavContentDevelopers/component.js +0 -0
- package/src/core/MeganavContentDevelopers/component.rb +0 -13
- package/src/core/MeganavContentProducts/component.html.erb +0 -83
- package/src/core/MeganavContentProducts/component.js +0 -0
- package/src/core/MeganavContentProducts/component.jsx +0 -105
- package/src/core/MeganavContentProducts/component.rb +0 -14
- package/src/core/MeganavContentUseCases/component.html.erb +0 -135
- package/src/core/MeganavContentUseCases/component.js +0 -1
- package/src/core/MeganavContentUseCases/component.jsx +0 -147
- package/src/core/MeganavContentUseCases/component.rb +0 -13
- package/src/core/MeganavControl/component.html.erb +0 -6
- package/src/core/MeganavControl/component.rb +0 -20
- package/src/core/MeganavControlMobileDropdown/component.html.erb +0 -7
- package/src/core/MeganavControlMobileDropdown/component.rb +0 -11
- package/src/core/MeganavControlMobilePanelClose/component.html.erb +0 -12
- package/src/core/MeganavControlMobilePanelClose/component.rb +0 -12
- package/src/core/MeganavControlMobilePanelOpen/component.html.erb +0 -7
- package/src/core/MeganavControlMobilePanelOpen/component.jsx +0 -25
- package/src/core/MeganavControlMobilePanelOpen/component.rb +0 -9
- package/src/core/MeganavItemsDesktop/component.html.erb +0 -17
- package/src/core/MeganavItemsDesktop/component.js +0 -0
- package/src/core/MeganavItemsDesktop/component.jsx +0 -49
- package/src/core/MeganavItemsDesktop/component.rb +0 -23
- package/src/core/MeganavItemsMobile/component.html.erb +0 -75
- package/src/core/MeganavItemsMobile/component.js +0 -0
- package/src/core/MeganavItemsMobile/component.jsx +0 -137
- package/src/core/MeganavItemsMobile/component.rb +0 -21
- package/src/core/MeganavItemsSignedIn/component.html.erb +0 -53
- package/src/core/MeganavItemsSignedIn/component.js +0 -0
- package/src/core/MeganavItemsSignedIn/component.rb +0 -33
- package/src/core/MeganavSearch/component.html.erb +0 -15
- package/src/core/MeganavSearch/component.js +0 -0
- package/src/core/MeganavSearch/component.jsx +0 -33
- package/src/core/MeganavSearch/component.rb +0 -13
- package/src/core/MeganavSearchAutocomplete/component.html.erb +0 -6
- package/src/core/MeganavSearchAutocomplete/component.jsx +0 -14
- package/src/core/MeganavSearchAutocomplete/component.rb +0 -6
- package/src/core/MeganavSearchPanel/component.html.erb +0 -22
- package/src/core/MeganavSearchPanel/component.js +0 -0
- package/src/core/MeganavSearchPanel/component.jsx +0 -39
- package/src/core/MeganavSearchPanel/component.rb +0 -13
- package/src/core/MeganavSearchSuggestions/component.html.erb +0 -22
- package/src/core/MeganavSearchSuggestions/component.jsx +0 -49
- package/src/core/MeganavSearchSuggestions/component.rb +0 -18
- package/src/core/Notice/component.html.erb +0 -16
- package/src/core/Notice/component.jsx +0 -71
- package/src/core/Notice/component.rb +0 -29
- package/src/core/Showcase/component.css +0 -30
- package/src/core/Showcase/component.html.erb +0 -76
- package/src/core/Showcase/component.js +0 -180
- package/src/core/Showcase/component.jsx +0 -0
- package/src/core/Showcase/component.rb +0 -190
- package/src/core/SignOutLink/component.html.erb +0 -1
- package/src/core/SignOutLink/component.js +0 -0
- package/src/core/SignOutLink/component.jsx +0 -32
- package/src/core/SignOutLink/component.rb +0 -17
- package/src/core/Slider/component.html.erb +0 -28
- package/src/core/Slider/component.jsx +0 -86
- package/src/core/Slider/component.rb +0 -38
- package/src/core/Uptime/component.css +0 -127
- package/src/core/Uptime/component.html.erb +0 -0
- package/src/core/Uptime/component.js +0 -1
- package/src/core/Uptime/component.jsx +0 -183
- package/src/core/Uptime/component.rb +0 -7
- package/src/core/core.rb +0 -81
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expander from "../Expander";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/Expander",
|
|
6
|
+
component: Expander,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
args: {
|
|
9
|
+
height: 200,
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
height: {
|
|
13
|
+
control: {
|
|
14
|
+
type: "number",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const longContentInner = (
|
|
21
|
+
<div>
|
|
22
|
+
<p>Ipsum</p>
|
|
23
|
+
<ul className="mb-16 list-inside list-disc">
|
|
24
|
+
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</li>
|
|
25
|
+
<li>Sed convallis ex pharetra, tristique tellus vel, rhoncus velit.</li>
|
|
26
|
+
<li>Mauris molestie felis et scelerisque ullamcorper.</li>
|
|
27
|
+
<li>Maecenas congue ligula ut commodo tristique.</li>
|
|
28
|
+
<li>
|
|
29
|
+
Pellentesque venenatis elit vitae urna condimentum, in mollis arcu
|
|
30
|
+
venenatis.
|
|
31
|
+
</li>
|
|
32
|
+
<li>Donec nec turpis vel urna egestas fringilla.</li>
|
|
33
|
+
</ul>
|
|
34
|
+
<p>Ipsum</p>
|
|
35
|
+
<ul className="mb-16 list-inside list-disc">
|
|
36
|
+
<li>Mauris ut nibh vel metus cursus semper.</li>
|
|
37
|
+
<li>Ut mattis tortor eu urna accumsan gravida.</li>
|
|
38
|
+
<li>Nunc pellentesque neque at elit pretium tempor.</li>
|
|
39
|
+
<li>Curabitur finibus magna vitae nunc varius fermentum.</li>
|
|
40
|
+
</ul>
|
|
41
|
+
<ul className="mb-16 list-inside list-disc">
|
|
42
|
+
<li>Curabitur vehicula mi iaculis, luctus augue eu, venenatis quam.</li>
|
|
43
|
+
<li>Praesent in eros efficitur, consequat ante eu, faucibus arcu.</li>
|
|
44
|
+
<li>Nulla laoreet nibh a odio interdum, non molestie diam auctor.</li>
|
|
45
|
+
</ul>
|
|
46
|
+
<p>Ipsum</p>
|
|
47
|
+
<ul className="mb-16 list-inside list-disc">
|
|
48
|
+
<li>
|
|
49
|
+
Praesent aliquam diam tincidunt, sollicitudin tortor eget, vulputate
|
|
50
|
+
lacus.
|
|
51
|
+
</li>
|
|
52
|
+
<li>Quisque in mi sed ex vulputate varius in a leo.</li>
|
|
53
|
+
<li>Etiam posuere dolor at tortor aliquam imperdiet.</li>
|
|
54
|
+
<li>
|
|
55
|
+
Maecenas quis neque consequat, ultricies est sit amet, congue est.
|
|
56
|
+
</li>
|
|
57
|
+
<li>Aenean a elit sed nibh pretium lacinia sed convallis sapien.</li>
|
|
58
|
+
</ul>
|
|
59
|
+
<p>Ipsum</p>
|
|
60
|
+
<ul className="mb-16 list-inside list-disc">
|
|
61
|
+
<li>
|
|
62
|
+
Nulla malesuada libero id dolor aliquam, non sagittis mi scelerisque.
|
|
63
|
+
</li>
|
|
64
|
+
<li>
|
|
65
|
+
Etiam tincidunt lacus eu diam laoreet consectetur sit amet non est.
|
|
66
|
+
</li>
|
|
67
|
+
<li>In porta arcu nec purus tincidunt vulputate.</li>
|
|
68
|
+
</ul>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
export const LongContent = {
|
|
73
|
+
render: () => <Expander>{longContentInner}</Expander>,
|
|
74
|
+
parameters: {
|
|
75
|
+
docs: {
|
|
76
|
+
description: {
|
|
77
|
+
story:
|
|
78
|
+
"A larger amount of content that exceeds the height cut-off, controls shown.",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const ShortContent = {
|
|
85
|
+
render: () => (
|
|
86
|
+
<Expander>
|
|
87
|
+
<div>
|
|
88
|
+
<p>Ipsum</p>
|
|
89
|
+
<ul className="mb-16 list-inside list-disc">
|
|
90
|
+
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</li>
|
|
91
|
+
<li>
|
|
92
|
+
Sed convallis ex pharetra, tristique tellus vel, rhoncus velit.
|
|
93
|
+
</li>
|
|
94
|
+
<li>Mauris molestie felis et scelerisque ullamcorper.</li>
|
|
95
|
+
<li>Maecenas congue ligula ut commodo tristique.</li>
|
|
96
|
+
<li>
|
|
97
|
+
Pellentesque venenatis elit vitae urna condimentum, in mollis arcu
|
|
98
|
+
venenatis.
|
|
99
|
+
</li>
|
|
100
|
+
<li>Donec nec turpis vel urna egestas fringilla.</li>
|
|
101
|
+
</ul>
|
|
102
|
+
</div>
|
|
103
|
+
</Expander>
|
|
104
|
+
),
|
|
105
|
+
parameters: {
|
|
106
|
+
docs: {
|
|
107
|
+
description: {
|
|
108
|
+
story:
|
|
109
|
+
"A smaller amount of content that doesn't exceed the height cut-off, therefore no controls shown.",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const OverriddenStyles = {
|
|
116
|
+
render: () => (
|
|
117
|
+
<Expander
|
|
118
|
+
className="bg-neutral-400 p-16 rounded-lg"
|
|
119
|
+
fadeClassName="from-neutral-800"
|
|
120
|
+
>
|
|
121
|
+
{longContentInner}
|
|
122
|
+
</Expander>
|
|
123
|
+
),
|
|
124
|
+
parameters: {
|
|
125
|
+
docs: {
|
|
126
|
+
description: {
|
|
127
|
+
story:
|
|
128
|
+
"A larger amount of content, with overridden styles for the content wrapper and fader.",
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { PropsWithChildren, useEffect, useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
type ExpanderProps = {
|
|
4
|
+
height?: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
fadeClassName?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const Expander = ({
|
|
10
|
+
height = 200,
|
|
11
|
+
className,
|
|
12
|
+
fadeClassName,
|
|
13
|
+
children,
|
|
14
|
+
}: PropsWithChildren<ExpanderProps>) => {
|
|
15
|
+
const innerRef = useRef<HTMLDivElement>(null);
|
|
16
|
+
const [contentHeight, setContentHeight] = useState(height);
|
|
17
|
+
const [expanded, setExpanded] = useState(false);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setContentHeight(innerRef.current?.clientHeight ?? height);
|
|
21
|
+
}, [height, expanded]);
|
|
22
|
+
|
|
23
|
+
const showControls = contentHeight > height;
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<>
|
|
27
|
+
<div
|
|
28
|
+
style={{ height: expanded ? contentHeight : height }}
|
|
29
|
+
className={`overflow-hidden transition-all relative ${className ?? ""}`}
|
|
30
|
+
>
|
|
31
|
+
{showControls && !expanded && (
|
|
32
|
+
<div
|
|
33
|
+
className={`h-64 w-full bg-gradient-to-t from-white to-transparent absolute bottom-0 left-0 right-0 ${
|
|
34
|
+
fadeClassName ?? ""
|
|
35
|
+
}`}
|
|
36
|
+
></div>
|
|
37
|
+
)}
|
|
38
|
+
<div ref={innerRef}>{children}</div>
|
|
39
|
+
</div>
|
|
40
|
+
{showControls && (
|
|
41
|
+
<div
|
|
42
|
+
onClick={() => setExpanded(!expanded)}
|
|
43
|
+
onKeyDown={(e) => e.key === "Enter" && setExpanded(!expanded)}
|
|
44
|
+
tabIndex={0}
|
|
45
|
+
className="mt-16 cursor-pointer font-bold text-gui-blue-default-light hover:text-gui-blue-hover-light active:text-gui-blue-active-light focus:text-gui-blue-focus"
|
|
46
|
+
>
|
|
47
|
+
{expanded ? "View less -" : "View all +"}
|
|
48
|
+
</div>
|
|
49
|
+
)}
|
|
50
|
+
</>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default Expander;
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import FeaturedLink from "../FeaturedLink";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/Featured Link",
|
|
5
|
+
component: FeaturedLink,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered",
|
|
8
|
+
},
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
args: {
|
|
11
|
+
url: "#",
|
|
12
|
+
children: "Featured link",
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Default = {
|
|
17
|
+
args: {},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const Reverse = {
|
|
21
|
+
args: {
|
|
22
|
+
reverse: true,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const Large = {
|
|
27
|
+
args: {
|
|
28
|
+
textSize: "text-p1",
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const Small = {
|
|
33
|
+
args: {
|
|
34
|
+
textSize: "text-p3",
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Pink = {
|
|
39
|
+
args: {
|
|
40
|
+
iconColor: "text-pink-500",
|
|
41
|
+
additionalCSS: "text-pink-800",
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import T from "prop-types";
|
|
1
|
+
import React, { CSSProperties, ReactNode } from "react";
|
|
3
2
|
|
|
4
|
-
import Icon from "
|
|
3
|
+
import Icon from "./Icon";
|
|
4
|
+
|
|
5
|
+
type FeaturedLinkProps = {
|
|
6
|
+
url: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
textSize?: string;
|
|
9
|
+
iconColor?: string;
|
|
10
|
+
flush?: boolean;
|
|
11
|
+
reverse?: boolean;
|
|
12
|
+
additionalCSS?: string;
|
|
13
|
+
newWindow?: boolean;
|
|
14
|
+
onClick?: () => void;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type TargetProps = { target?: string; rel?: string };
|
|
5
18
|
|
|
6
19
|
// When generating links with target=_blank, we only add `noreferrer` to
|
|
7
20
|
// links that don't start with `/`, so we can continue tracking referrers
|
|
8
21
|
// across our own domains
|
|
9
22
|
const buildTargetAndRel = (url, newWindow) => {
|
|
10
|
-
const props = {};
|
|
23
|
+
const props: TargetProps = {};
|
|
11
24
|
|
|
12
25
|
if (newWindow) {
|
|
13
26
|
props.target = "_blank";
|
|
@@ -32,7 +45,7 @@ const FeaturedLink = ({
|
|
|
32
45
|
newWindow = false,
|
|
33
46
|
onClick = undefined,
|
|
34
47
|
children,
|
|
35
|
-
}) => {
|
|
48
|
+
}: FeaturedLinkProps) => {
|
|
36
49
|
const targetAndRel = buildTargetAndRel(url, newWindow);
|
|
37
50
|
|
|
38
51
|
return (
|
|
@@ -41,7 +54,14 @@ const FeaturedLink = ({
|
|
|
41
54
|
className={`font-sans font-bold block text-gui-default hover:text-gui-hover focus:text-gui-focus focus:outline-gui-focus group ui-${textSize} ${
|
|
42
55
|
flush ? "" : "py-8"
|
|
43
56
|
} ${additionalCSS}`}
|
|
44
|
-
style={
|
|
57
|
+
style={
|
|
58
|
+
{
|
|
59
|
+
"--featured-link-icon-size": `var(${textSize.replace(
|
|
60
|
+
"text",
|
|
61
|
+
"--fs"
|
|
62
|
+
)})`,
|
|
63
|
+
} as CSSProperties
|
|
64
|
+
}
|
|
45
65
|
{...targetAndRel}
|
|
46
66
|
onClick={onClick}
|
|
47
67
|
>
|
|
@@ -70,16 +90,4 @@ const FeaturedLink = ({
|
|
|
70
90
|
);
|
|
71
91
|
};
|
|
72
92
|
|
|
73
|
-
FeaturedLink.propTypes = {
|
|
74
|
-
url: T.string,
|
|
75
|
-
children: T.node,
|
|
76
|
-
textSize: T.string,
|
|
77
|
-
iconColor: T.string,
|
|
78
|
-
flush: T.bool,
|
|
79
|
-
reverse: T.bool,
|
|
80
|
-
additionalCSS: T.string,
|
|
81
|
-
newWindow: T.bool,
|
|
82
|
-
onClick: T.func,
|
|
83
|
-
};
|
|
84
|
-
|
|
85
93
|
export default FeaturedLink;
|
|
Binary file
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Flash, { reducerFlashes } from "../Flash";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
attachStoreToWindow,
|
|
6
|
+
createRemoteDataStore,
|
|
7
|
+
} from "../remote-data-store.js";
|
|
8
|
+
import { reducerBlogPosts } from "../remote-blogs-posts.js";
|
|
9
|
+
import { reducerSessionData } from "../remote-session-data.js";
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: "Components/Flash",
|
|
13
|
+
component: Flash,
|
|
14
|
+
args: {
|
|
15
|
+
flashes: [
|
|
16
|
+
["success", "Congratulations! You've won the Oscar"],
|
|
17
|
+
["notice", "This is a notice"],
|
|
18
|
+
["error", "This is an error, very bad"],
|
|
19
|
+
["alert", "This is an alert"],
|
|
20
|
+
["info", "Some useful information, you are welcome"],
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Default = {
|
|
26
|
+
render: (args) => {
|
|
27
|
+
const store = createRemoteDataStore({
|
|
28
|
+
...reducerBlogPosts,
|
|
29
|
+
...reducerSessionData,
|
|
30
|
+
...reducerFlashes,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
attachStoreToWindow(store);
|
|
34
|
+
|
|
35
|
+
return <Flash {...args} />;
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from "react";
|
|
2
2
|
import DOMPurify from "dompurify";
|
|
3
|
-
import T from "prop-types";
|
|
4
3
|
import { nanoid } from "nanoid/non-secure";
|
|
5
4
|
|
|
6
|
-
import { getRemoteDataStore } from "
|
|
7
|
-
import ConnectStateWrapper from "
|
|
8
|
-
import Icon from "
|
|
5
|
+
import { getRemoteDataStore } from "./remote-data-store.js";
|
|
6
|
+
import ConnectStateWrapper from "./ConnectStateWrapper";
|
|
7
|
+
import Icon from "./Icon";
|
|
8
|
+
|
|
9
|
+
type FlashProps = {
|
|
10
|
+
id: string;
|
|
11
|
+
removed: boolean;
|
|
12
|
+
type: "error" | "success" | "notice" | "info" | "alert";
|
|
13
|
+
content: string;
|
|
14
|
+
removeFlash: (id: string) => void;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type FlashesProps = {
|
|
18
|
+
flashes: { items: FlashProps[] };
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type BackendFlashesProps = {
|
|
22
|
+
flashes: string[][];
|
|
23
|
+
};
|
|
9
24
|
|
|
10
25
|
const REDUCER_KEY = "flashes";
|
|
11
26
|
const FLASH_DATA_ID = "ui-flashes";
|
|
@@ -16,7 +31,9 @@ const reducerFlashes = {
|
|
|
16
31
|
[REDUCER_KEY]: (state = initialState, action) => {
|
|
17
32
|
switch (action.type) {
|
|
18
33
|
case "flash/push": {
|
|
19
|
-
const flashes = Array.isArray(action.payload)
|
|
34
|
+
const flashes = Array.isArray(action.payload)
|
|
35
|
+
? action.payload
|
|
36
|
+
: [action.payload];
|
|
20
37
|
return { items: [...state.items, ...flashes] };
|
|
21
38
|
}
|
|
22
39
|
default:
|
|
@@ -27,11 +44,6 @@ const reducerFlashes = {
|
|
|
27
44
|
|
|
28
45
|
const selectFlashes = (store) => store.getState()[REDUCER_KEY];
|
|
29
46
|
|
|
30
|
-
const FlashT = {
|
|
31
|
-
type: T.oneOf(["error", "success", "notice", "info", "alert"]),
|
|
32
|
-
content: T.string,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
47
|
const FLASH_BG_COLOR = {
|
|
36
48
|
error: "bg-gui-error",
|
|
37
49
|
success: "bg-zingy-green",
|
|
@@ -52,7 +64,7 @@ const AUTO_HIDE = ["success", "info", "notice"];
|
|
|
52
64
|
const AUTO_HIDE_TIME = 8000;
|
|
53
65
|
|
|
54
66
|
const useAutoHide = (type, closeFlash) => {
|
|
55
|
-
const timeoutId = useRef(null);
|
|
67
|
+
const timeoutId = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
56
68
|
|
|
57
69
|
useEffect(() => {
|
|
58
70
|
if (AUTO_HIDE.includes(type)) {
|
|
@@ -69,8 +81,8 @@ const useAutoHide = (type, closeFlash) => {
|
|
|
69
81
|
}, []);
|
|
70
82
|
};
|
|
71
83
|
|
|
72
|
-
const Flash = ({ id, type, content, removeFlash }) => {
|
|
73
|
-
const ref = useRef(null);
|
|
84
|
+
const Flash = ({ id, type, content, removeFlash }: FlashProps) => {
|
|
85
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
74
86
|
const [closed, setClosed] = useState(false);
|
|
75
87
|
const [flashHeight, setFlashHeight] = useState(0);
|
|
76
88
|
const [triggerEntryAnimation, setTriggerEntryAnimation] = useState(false);
|
|
@@ -83,7 +95,7 @@ const Flash = ({ id, type, content, removeFlash }) => {
|
|
|
83
95
|
setClosed(true);
|
|
84
96
|
|
|
85
97
|
setTimeout(() => {
|
|
86
|
-
removeFlash(id);
|
|
98
|
+
id && removeFlash(id);
|
|
87
99
|
}, 100);
|
|
88
100
|
};
|
|
89
101
|
|
|
@@ -122,30 +134,62 @@ const Flash = ({ id, type, content, removeFlash }) => {
|
|
|
122
134
|
};
|
|
123
135
|
|
|
124
136
|
return (
|
|
125
|
-
<div
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
137
|
+
<div
|
|
138
|
+
className={`ui-flash-message ui-grid-px ${
|
|
139
|
+
animateEntry ? "ui-flash-message-enter" : ""
|
|
140
|
+
}`}
|
|
141
|
+
style={style}
|
|
142
|
+
ref={ref}
|
|
143
|
+
data-id="ui-flash"
|
|
144
|
+
>
|
|
145
|
+
<div
|
|
146
|
+
className={`${FLASH_BG_COLOR[type]} p-32 flex align-center rounded shadow-container-subtle`}
|
|
147
|
+
>
|
|
148
|
+
{withIcons[type] && (
|
|
149
|
+
<Icon
|
|
150
|
+
name={withIcons[type]}
|
|
151
|
+
color={iconColor[type]}
|
|
152
|
+
size="1.5rem"
|
|
153
|
+
additionalCSS="mr-16 self-baseline"
|
|
154
|
+
/>
|
|
155
|
+
)}
|
|
156
|
+
<p
|
|
157
|
+
className={`ui-text-p1 mr-16 ${FLASH_TEXT_COLOR[type]}`}
|
|
158
|
+
dangerouslySetInnerHTML={{ __html: safeContent }}
|
|
159
|
+
/>
|
|
160
|
+
<button
|
|
161
|
+
type="button"
|
|
162
|
+
className="p-0 ml-auto self-start focus:outline-none"
|
|
163
|
+
onClick={closeFlash}
|
|
164
|
+
>
|
|
165
|
+
<Icon
|
|
166
|
+
name="icon-gui-close"
|
|
167
|
+
color={iconColor[type]}
|
|
168
|
+
size="1.5rem"
|
|
169
|
+
additionalCSS="transition-colors"
|
|
170
|
+
/>
|
|
131
171
|
</button>
|
|
132
172
|
</div>
|
|
133
173
|
</div>
|
|
134
174
|
);
|
|
135
175
|
};
|
|
136
176
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
const Flashes = ({ flashes }) => {
|
|
142
|
-
const [flashesWithIds, setFlashesWithIds] = useState([]);
|
|
177
|
+
const Flashes = ({ flashes }: FlashesProps) => {
|
|
178
|
+
const [flashesWithIds, setFlashesWithIds] = useState<FlashProps[]>([]);
|
|
143
179
|
|
|
144
|
-
const removeFlash = (flashId) =>
|
|
180
|
+
const removeFlash = (flashId) =>
|
|
181
|
+
setFlashesWithIds((items) => items.filter((item) => item.id !== flashId));
|
|
145
182
|
|
|
146
183
|
useEffect(() => {
|
|
147
184
|
setFlashesWithIds((state) => {
|
|
148
|
-
return [
|
|
185
|
+
return [
|
|
186
|
+
...state,
|
|
187
|
+
...(flashes?.items).map((flash) => ({
|
|
188
|
+
...flash,
|
|
189
|
+
id: nanoid(),
|
|
190
|
+
removed: false,
|
|
191
|
+
})),
|
|
192
|
+
];
|
|
149
193
|
});
|
|
150
194
|
}, [flashes]);
|
|
151
195
|
|
|
@@ -154,17 +198,13 @@ const Flashes = ({ flashes }) => {
|
|
|
154
198
|
{flashesWithIds
|
|
155
199
|
.filter((item) => !item.removed)
|
|
156
200
|
.map((flash) => (
|
|
157
|
-
<Flash
|
|
201
|
+
<Flash key={flash.id} {...flash} removeFlash={removeFlash} />
|
|
158
202
|
))}
|
|
159
203
|
</div>
|
|
160
204
|
);
|
|
161
205
|
};
|
|
162
206
|
|
|
163
|
-
|
|
164
|
-
flashes: T.shape({ items: T.arrayOf(T.shape(FlashT)) }),
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
const BackendFlashes = ({ flashes }) => {
|
|
207
|
+
const BackendFlashes = ({ flashes }: BackendFlashesProps) => {
|
|
168
208
|
useEffect(() => {
|
|
169
209
|
const transformedFlashes =
|
|
170
210
|
flashes.map((flash) => {
|
|
@@ -182,14 +222,12 @@ const BackendFlashes = ({ flashes }) => {
|
|
|
182
222
|
}
|
|
183
223
|
}, []);
|
|
184
224
|
|
|
185
|
-
const WrappedFlashes = ConnectStateWrapper(Flashes, {
|
|
225
|
+
const WrappedFlashes = ConnectStateWrapper(Flashes, {
|
|
226
|
+
flashes: selectFlashes,
|
|
227
|
+
});
|
|
186
228
|
|
|
187
229
|
return <WrappedFlashes />;
|
|
188
230
|
};
|
|
189
231
|
|
|
190
|
-
BackendFlashes.propTypes = {
|
|
191
|
-
flashes: T.arrayOf(T.arrayOf(T.string)),
|
|
192
|
-
};
|
|
193
|
-
|
|
194
232
|
export { reducerFlashes, FLASH_DATA_ID, Flashes };
|
|
195
233
|
export default BackendFlashes;
|
|
Binary file
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Footer from "../Footer";
|
|
2
|
+
|
|
3
|
+
import ablyStack from "../images/ably-stack.svg";
|
|
4
|
+
import highestPerformer from "../images/high-performer-2023.svg";
|
|
5
|
+
import bestSupport from "../images/best-support-2023.svg";
|
|
6
|
+
import fastestImplementation from "../images/fastest-implementation-2023.svg";
|
|
7
|
+
import highestUserAdoption from "../images/highest-user-adoption-2023.svg";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: "Components/Footer",
|
|
11
|
+
component: Footer,
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: "fullscreen",
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
paths: {
|
|
17
|
+
ablyStack,
|
|
18
|
+
highestPerformer,
|
|
19
|
+
bestSupport,
|
|
20
|
+
fastestImplementation,
|
|
21
|
+
highestUserAdoption,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const Default = {};
|