@ably/ui 13.2.2 → 14.0.0-dev.fbce38f
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 +25 -152
- package/core/Accordion/component.js +1 -0
- package/core/Code/component.css +1 -72
- package/core/Code/component.js +1 -1
- package/core/ConnectStateWrapper/component.js +1 -1
- package/core/ContactFooter/component.css +7 -10
- package/core/ContactFooter/component.js +1 -1
- package/core/CookieMessage/component.css +10 -13
- package/core/CookieMessage/component.js +1 -1
- package/core/CustomerLogos/component.js +1 -1
- package/core/DropdownMenu/component.js +1 -1
- package/core/FeaturedLink/component.js +1 -1
- package/core/Flash/component.css +19 -22
- package/core/Flash/component.js +1 -1
- package/core/Footer/component.css +22 -25
- package/core/Footer/component.js +1 -1
- package/core/Icon/component.js +1 -1
- package/core/Loader/component.js +1 -1
- package/core/Logo/component.js +1 -1
- package/core/Meganav/component.css +103 -106
- package/core/Meganav/component.js +1 -1
- package/core/MeganavBlogPostsList/component.js +1 -2
- package/core/MeganavContentCompany/component.js +1 -1
- package/core/MeganavContentDevelopers/component.js +1 -1
- package/core/MeganavContentProducts/component.js +1 -1
- package/core/MeganavContentUseCases/component.js +1 -1
- package/core/MeganavControl/component.js +1 -1
- package/core/MeganavControlMobileDropdown/component.js +1 -1
- package/core/MeganavControlMobilePanelClose/component.js +1 -1
- package/core/MeganavControlMobilePanelOpen/component.js +1 -1
- package/core/MeganavItemsDesktop/component.js +1 -1
- package/core/MeganavItemsMobile/component.js +1 -1
- package/core/MeganavItemsSignedIn/component.js +1 -1
- package/core/MeganavSearch/component.js +1 -1
- package/core/MeganavSearchAutocomplete/component.js +1 -1
- package/core/MeganavSearchPanel/component.js +1 -1
- package/core/MeganavSearchSuggestions/component.js +1 -1
- package/core/Notice/component.css +4 -7
- package/core/Notice/component.js +1 -1
- package/core/SignOutLink/component.js +1 -1
- package/core/Slider/component.css +4 -7
- package/core/Slider/component.js +1 -1
- package/core/Table/Table.js +1 -0
- package/core/Table/TableCell.js +1 -0
- package/core/Table/TableRow.js +1 -0
- package/core/Table/index.js +1 -0
- package/core/Table/stories/data.js +1 -0
- package/core/Tooltip/component.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-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 +122 -0
- package/core/styles/forms.css +62 -0
- package/core/styles/layout.css +19 -0
- package/core/styles/properties.css +276 -0
- package/core/styles/text.css +166 -0
- package/core/styles.base.css +1 -0
- package/core/styles.components.css +33 -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 +67 -0
- package/core/utils/syntax-highlighter.js +1 -0
- package/package.json +39 -34
- 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/core/Accordion/Accordion.stories.tsx +39 -0
- package/src/core/Accordion/component.tsx +147 -0
- package/src/core/Code/Code.stories.tsx +71 -0
- package/src/core/Code/component.tsx +45 -0
- package/src/core/ConnectStateWrapper/{component.jsx → component.tsx} +7 -3
- package/src/core/ContactFooter/ContactFooter.stories.tsx +11 -0
- package/src/core/ContactFooter/component.css +7 -9
- package/src/core/ContactFooter/component.tsx +92 -0
- package/src/core/CookieMessage/CookieMessage.stories.tsx +12 -0
- package/src/core/CookieMessage/component.css +10 -12
- package/src/core/CookieMessage/{component.jsx → component.tsx} +15 -10
- package/src/core/CustomerLogos/CustomerLogos.stories.tsx +43 -0
- package/src/core/CustomerLogos/component.tsx +35 -0
- package/src/core/DropdownMenu/DropdownMenu.stories.tsx +48 -0
- package/src/core/DropdownMenu/{component.jsx → component.tsx} +64 -36
- package/src/core/FeaturedLink/FeaturedLink.stories.tsx +43 -0
- package/src/core/FeaturedLink/{component.jsx → component.tsx} +28 -17
- package/src/core/Flash/Flash.stories.tsx +37 -0
- package/src/core/Flash/component.css +19 -21
- package/src/core/Flash/{component.jsx → component.tsx} +78 -39
- package/src/core/Footer/Footer.stories.tsx +26 -0
- package/src/core/Footer/component.css +22 -24
- package/src/core/Footer/{component.jsx → component.tsx} +237 -70
- package/src/core/Icon/Icon.stories.tsx +150 -0
- package/src/core/Icon/component.tsx +26 -0
- package/src/core/Loader/Loader.stories.tsx +21 -0
- package/src/core/Loader/{component.jsx → component.tsx} +11 -8
- package/src/core/Logo/Logo.stories.tsx +12 -0
- package/src/core/Logo/component.tsx +29 -0
- package/src/core/Meganav/Meganav.stories.tsx +86 -0
- package/src/core/Meganav/component.css +103 -105
- package/src/core/Meganav/component.js +6 -7
- package/src/core/Meganav/component.tsx +228 -0
- package/src/core/MeganavBlogPostsList/{component.jsx → component.tsx} +15 -14
- package/src/core/MeganavContentCompany/{component.jsx → component.tsx} +82 -33
- package/src/core/MeganavContentDevelopers/{component.jsx → component.tsx} +98 -34
- package/src/core/MeganavContentProducts/component.tsx +165 -0
- package/src/core/MeganavContentUseCases/component.tsx +244 -0
- package/src/core/MeganavControl/{component.jsx → component.tsx} +18 -12
- package/src/core/MeganavControlMobileDropdown/{component.jsx → component.tsx} +3 -7
- package/src/core/MeganavControlMobilePanelClose/{component.jsx → component.tsx} +16 -9
- package/src/core/MeganavControlMobilePanelOpen/component.tsx +32 -0
- package/src/core/MeganavItemsDesktop/component.tsx +68 -0
- package/src/core/MeganavItemsMobile/component.tsx +197 -0
- package/src/core/MeganavItemsSignedIn/{component.jsx → component.tsx} +59 -23
- package/src/core/MeganavSearch/component.tsx +36 -0
- package/src/core/MeganavSearchAutocomplete/component.tsx +12 -0
- package/src/core/MeganavSearchPanel/component.tsx +52 -0
- package/src/core/MeganavSearchSuggestions/component.tsx +62 -0
- package/src/core/Notice/component.css +4 -6
- package/src/core/Notice/component.js +1 -1
- package/src/core/Notice/component.tsx +104 -0
- package/src/core/SignOutLink/component.tsx +51 -0
- package/src/core/Slider/Slider.stories.tsx +45 -0
- package/src/core/Slider/component.css +4 -6
- package/src/core/Slider/component.tsx +112 -0
- package/src/core/Table/Table.tsx +30 -0
- package/src/core/Table/TableCell.tsx +84 -0
- package/src/core/Table/TableRow.tsx +25 -0
- package/src/core/Table/index.ts +24 -0
- package/src/core/Table/stories/Table.stories.tsx +12 -0
- package/src/core/Table/stories/data.tsx +113 -0
- package/src/core/Tooltip/Tooltip.stories.tsx +27 -0
- package/src/core/Tooltip/component.tsx +60 -0
- package/src/core/icons.js +6 -0
- package/src/core/{react-renderer.js → react-renderer.tsx} +9 -7
- package/src/core/styles/buttons.css +121 -123
- package/src/core/styles/forms.css +49 -51
- package/src/core/styles/layout.css +14 -16
- package/src/core/styles/properties.css +250 -259
- package/src/core/styles/text.css +165 -167
- package/src/core/styles.components.css +22 -24
- package/src/core/utils/syntax-highlighter.css +55 -59
- 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.jsx +0 -222
- package/core/ContactFooter.jsx +0 -342
- package/core/CookieMessage.jsx +0 -204
- package/core/CustomerLogos.jsx +0 -144
- package/core/DropdownMenu.jsx +0 -313
- package/core/FeatureFooter/component.css +0 -13
- package/core/FeatureFooter/component.js +0 -1
- package/core/FeaturedLink.jsx +0 -236
- package/core/Flash.jsx +0 -622
- package/core/Footer.jsx +0 -587
- package/core/Icon.jsx +0 -152
- package/core/Loader.jsx +0 -154
- package/core/Logo.jsx +0 -147
- package/core/Meganav.jsx +0 -4146
- package/core/MeganavBlogPostsList/component.js.LICENSE.txt +0 -1
- package/core/MeganavBlogPostsList.jsx +0 -291
- package/core/MeganavContentCompany.jsx +0 -1053
- package/core/MeganavContentDevelopers.jsx +0 -334
- package/core/MeganavContentProducts.jsx +0 -368
- 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.jsx +0 -279
- package/core/MeganavItemsMobile.jsx +0 -684
- package/core/MeganavItemsSignedIn.jsx +0 -638
- package/core/MeganavSearch.jsx +0 -429
- package/core/MeganavSearchAutocomplete.jsx +0 -117
- package/core/MeganavSearchPanel.jsx +0 -381
- package/core/MeganavSearchSuggestions.jsx +0 -294
- 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.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 -890
- package/core/scripts.js.LICENSE.txt +0 -1
- 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/ContactFooter/component.html.erb +0 -32
- package/src/core/ContactFooter/component.jsx +0 -66
- package/src/core/ContactFooter/component.rb +0 -13
- package/src/core/CustomerLogos/component.html.erb +0 -9
- package/src/core/CustomerLogos/component.jsx +0 -28
- package/src/core/CustomerLogos/component.rb +0 -14
- 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.rb +0 -21
- package/src/core/Footer/component.html.erb +0 -256
- package/src/core/Footer/component.rb +0 -14
- package/src/core/Icon/component.html.erb +0 -3
- 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.rb +0 -19
- package/src/core/Logo/component.html.erb +0 -3
- 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.rb +0 -14
- package/src/core/MeganavContentDevelopers/component.html.erb +0 -129
- package/src/core/MeganavContentDevelopers/component.rb +0 -13
- package/src/core/MeganavContentProducts/component.html.erb +0 -83
- 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.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.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.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.rb +0 -33
- package/src/core/MeganavSearch/component.html.erb +0 -15
- 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.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.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
- /package/{preview/log/.keep → src/core/Accordion/component.js} +0 -0
package/README.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
**_Note:_** some features are still in development and their documentation might be incomplete. Lookout for the ⚠️ icon.
|
|
2
|
-
|
|
3
1
|
# ably-ui
|
|
4
2
|
|
|
5
3
|
`ably-ui` is the of home of the Ably design system library ([https://ably-ui.herokuapp.com/](https://ably-ui.herokuapp.com/)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.
|
|
@@ -20,13 +18,13 @@ In some cases, this is impractical. Some components will be more specialized and
|
|
|
20
18
|
|
|
21
19
|
### Library structure
|
|
22
20
|
|
|
23
|
-
The library is built out of modules, assets, JavaScript
|
|
21
|
+
The library is built out of modules, assets, and JavaScript components. A module is a container for all of those.
|
|
24
22
|
|
|
25
|
-
For example, the `core` module provides the most general elements one can build the “chrome” of a web-based interface — typography, colours, spacing (i.e., containers) etc. The components within the module support our most common needs to build that “chrome”, like navigation elements, footer, hero sections, code samples etc. Assets, JavaScript
|
|
23
|
+
For example, the `core` module provides the most general elements one can build the “chrome” of a web-based interface — typography, colours, spacing (i.e., containers) etc. The components within the module support our most common needs to build that “chrome”, like navigation elements, footer, hero sections, code samples etc. Assets, and JavaScript are all shared between the components in the module.
|
|
26
24
|
|
|
27
25
|
Components do not require assets directly — instead, it's up to the consumer to load the assets and pass them to the components. This ensures flexibility in terms of URLs.
|
|
28
26
|
|
|
29
|
-
Each module, apart from components, exposes a `scripts.js
|
|
27
|
+
Each module, apart from components, exposes a `scripts.js` and `styles.css`. `scripts.js` contains helper functions. `styles.css` contains CSS that does not belong to any module in particular.
|
|
30
28
|
|
|
31
29
|
### Installation
|
|
32
30
|
|
|
@@ -39,7 +37,7 @@ npm install @ably/ui
|
|
|
39
37
|
|
|
40
38
|
# or
|
|
41
39
|
|
|
42
|
-
yarn add @ably/ui
|
|
40
|
+
yarn add @ably/ui # Preferred
|
|
43
41
|
```
|
|
44
42
|
|
|
45
43
|
To attach the imported JavaScript from the `Core` module to the `window` object:
|
|
@@ -121,24 +119,6 @@ Note that depending on the component, you might still need to include CSS & JS f
|
|
|
121
119
|
import Meganav from "@ably/ui/core/Meganav";
|
|
122
120
|
```
|
|
123
121
|
|
|
124
|
-
#### Importing ViewComponent (Rails) components
|
|
125
|
-
|
|
126
|
-
To use `ably-ui` with [Ruby on Rails](https://rubyonrails.org/) add the `ably-ui` gem to your `Gemfile`:
|
|
127
|
-
|
|
128
|
-
```ruby
|
|
129
|
-
gem 'ably-ui',
|
|
130
|
-
'1.0.0',
|
|
131
|
-
require: 'ably_ui'
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
Components are exposed as [View Components](https://github.com/github/view_component) and should be available in any view:
|
|
135
|
-
|
|
136
|
-
```erb
|
|
137
|
-
<%= render(AblyUi::Core::Meganav.new) %>
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Note that this loads neither CSS nor JS — these need to still be loaded by a bundler like webpack.
|
|
141
|
-
|
|
142
122
|
## Usage
|
|
143
123
|
|
|
144
124
|
### Icons
|
|
@@ -147,16 +127,10 @@ Putting SVG files inside a`src/MODULE_NAME/icons` folder will add them to a per-
|
|
|
147
127
|
|
|
148
128
|
Usage with the `Icon` React component:
|
|
149
129
|
|
|
150
|
-
```
|
|
130
|
+
```tsx
|
|
151
131
|
<Icon name="icon-display-live-chat" size="3rem" additionalCSS="block mb-16" />
|
|
152
132
|
```
|
|
153
133
|
|
|
154
|
-
Usage with `Icon` VW component:
|
|
155
|
-
|
|
156
|
-
```rb
|
|
157
|
-
<%= render(AblyUi::Core::Icon.new(name: "icon-gui-disclosure-arrow", size: "1rem", additional_css: "align-middle transform rotate-180 mr-4")) %>
|
|
158
|
-
```
|
|
159
|
-
|
|
160
134
|
Usage without a component:
|
|
161
135
|
|
|
162
136
|
```html
|
|
@@ -168,7 +142,7 @@ Usage without a component:
|
|
|
168
142
|
|
|
169
143
|
Usage without a component, in React, with hover states. Note the [group](https://tailwindcss.com/docs/hover-focus-and-other-states#group-hover) class:
|
|
170
144
|
|
|
171
|
-
```
|
|
145
|
+
```tsx
|
|
172
146
|
<a
|
|
173
147
|
href="{url}"
|
|
174
148
|
className="text-gui-default hover:text-gui-hover focus:text-gui-focus group"
|
|
@@ -186,12 +160,6 @@ See https://ably-ui.herokuapp.com/components/icon for more details.
|
|
|
186
160
|
|
|
187
161
|
Font assets are not included automagically but are part of the repo, together with an example of font-face file; see `src/core/fonts` for examples. Make sure to include the licence file declaration on usage.
|
|
188
162
|
|
|
189
|
-
See `preview/app/javascript/styles/application.css` for an example when using webpacker/rails.
|
|
190
|
-
|
|
191
|
-
#### Rails
|
|
192
|
-
|
|
193
|
-
Because the gem directories are on the asset path (see [Importing ViewComponent (Rails) components](#user-content-importing-viewcomponent-rails-components) section), they will work with standard asset helpers (i.e., `asset_path`).
|
|
194
|
-
|
|
195
163
|
### Accessibility
|
|
196
164
|
|
|
197
165
|
An important part of ably-ui is ensuring the produced UI is accessible to as wide range of users as possible. All components should adhere to at least AA accessibility standards. In most cases, this can be accomplished by following a few simple rules:
|
|
@@ -205,73 +173,19 @@ An important part of ably-ui is ensuring the produced UI is accessible to as wid
|
|
|
205
173
|
|
|
206
174
|
## Development
|
|
207
175
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
To use, first make sure you install dependencies both for the library and the “preview” app:
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
yarn && bundle
|
|
214
|
-
cd preview
|
|
215
|
-
yarn && bundle
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
Then, from the root of the repository, run:
|
|
219
|
-
|
|
220
|
-
```bash
|
|
221
|
-
yarn dev
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
This will run the app and use the published versions of the `ably-ui`, specified in `preview/Gemfile` and `preview/package.json` NPM package.
|
|
225
|
-
|
|
226
|
-
### Using the local ably-ui in the preview app
|
|
176
|
+
To visualise the assets in `ably-ui`, there is a Storybook instance, which serves as both a showcase and a development environment.
|
|
227
177
|
|
|
228
|
-
|
|
178
|
+
Firstly, ensure you have all of the required project dependencies by running `yarn` in the project root.
|
|
229
179
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
```bash
|
|
233
|
-
# in the root directory
|
|
234
|
-
yarn link
|
|
235
|
-
# in the "preview" directory
|
|
236
|
-
yarn link @ably/ui
|
|
237
|
-
```
|
|
180
|
+
Then, to run Storybook, run `yarn storybook` in the project root - it should open automatically in your browser.
|
|
238
181
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
In `preview/Gemfile` replace the Ably UI gem version number with `path: '../'` like this:
|
|
242
|
-
|
|
243
|
-
```bash
|
|
244
|
-
# in preview
|
|
245
|
-
gem 'ably-ui', path: '../', require: 'ably_ui'
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
and run:
|
|
249
|
-
|
|
250
|
-
```bash
|
|
251
|
-
# in preview
|
|
252
|
-
bundle --no-cache
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
Why not `bundle config set local.ably-ui ../`? Because that feature is built around the local gem being a separate repo, and works poorly with our config.
|
|
256
|
-
|
|
257
|
-
A caveat of this approach is that the change `preview/Gemfile` should not be committed, as it will cause the remote app to not build.
|
|
258
|
-
|
|
259
|
-
### Using a deployed package of ably-ui in the preview app
|
|
260
|
-
|
|
261
|
-
If at anytime you don't want to use the local NPM package and/or gems any more, you can do:
|
|
262
|
-
|
|
263
|
-
```bash
|
|
264
|
-
# in "preview" directory
|
|
265
|
-
yarn unlink @ably/ui
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
Then change back `path` to source `source` in the `Gemfile`. If you need to update `Gemfile.lock` without installing gems, you can run `bundle lock`.
|
|
182
|
+
To build Storybook as if it was a statically built site (i.e. what it looks like when deployed), run `yarn build-storybook` from the project root, go to the generated directory with `cd preview`, and then run `npx http-server` (accepting the prompt to install that package if you haven't done already). The built site will be available at the listed local URL.
|
|
269
183
|
|
|
270
184
|
#### Publishing pre-release packages for review apps
|
|
271
185
|
|
|
272
|
-
Make sure you commit & push your work
|
|
186
|
+
Make sure you commit & push your work before doing this.
|
|
273
187
|
|
|
274
|
-
You will need to authenticate with [npmjs](https://docs.npmjs.com/creating-and-viewing-access-tokens)
|
|
188
|
+
You will need to authenticate with [npmjs](https://docs.npmjs.com/creating-and-viewing-access-tokens) to publish.
|
|
275
189
|
|
|
276
190
|
After the above, you should have:
|
|
277
191
|
|
|
@@ -280,11 +194,6 @@ After the above, you should have:
|
|
|
280
194
|
```
|
|
281
195
|
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
|
282
196
|
```
|
|
283
|
-
- a `~/.gem/credentials` file that has your Rubygems API key:
|
|
284
|
-
```
|
|
285
|
-
---
|
|
286
|
-
:rubygems_api_key: REPLACE_THIS_WITH_YOUR_OWN_API_KEY
|
|
287
|
-
```
|
|
288
197
|
|
|
289
198
|
To deploy a review app with your in-progress code, you can use the `pre-release` script:
|
|
290
199
|
|
|
@@ -298,11 +207,10 @@ This script is a combination of two scripts:
|
|
|
298
207
|
1. Pre-Release:
|
|
299
208
|
|
|
300
209
|
- update your local dependencies for ably-ui and run a production build
|
|
301
|
-
- release
|
|
210
|
+
- release an NPM package with the version built from your current SemVer but adding a pre-release tag based on a short SHA of your HEAD commit
|
|
302
211
|
|
|
303
212
|
2. Update Pre-Release Version:
|
|
304
213
|
|
|
305
|
-
- update the preview app
|
|
306
214
|
- commit all the above and push to origin
|
|
307
215
|
|
|
308
216
|
This will trigger a build of the review app.
|
|
@@ -318,8 +226,7 @@ All components live in `src` and follow a directory and filename convention:
|
|
|
318
226
|
- component directory (TitleCase)
|
|
319
227
|
- `component.js` - this is the entry file for a component and is the only required file
|
|
320
228
|
- `components.css` - additional CSS
|
|
321
|
-
- for
|
|
322
|
-
- for react, `components.jsx`
|
|
229
|
+
- for react, `components.tsx`
|
|
323
230
|
|
|
324
231
|
For example:
|
|
325
232
|
|
|
@@ -328,11 +235,9 @@ For example:
|
|
|
328
235
|
- script.js
|
|
329
236
|
- styles.css
|
|
330
237
|
- Accordion
|
|
331
|
-
- component.rb
|
|
332
|
-
- component.html.erb
|
|
333
238
|
- component.js
|
|
334
239
|
- component.css
|
|
335
|
-
- component.
|
|
240
|
+
- component.tsx
|
|
336
241
|
```
|
|
337
242
|
|
|
338
243
|
#### CSS
|
|
@@ -345,50 +250,19 @@ If using positioning any other than static, be mindful of creating stacking cont
|
|
|
345
250
|
|
|
346
251
|
By default, [Prettier](https://prettier.io/) & [ESLint](https://eslint.org/) will handle most of the frontend files. You can use them through your editor (which should pick up the relevant config files) or on the command line (see `scripts` in package.json).
|
|
347
252
|
|
|
348
|
-
Neither handles `erb` and `rb` files. The only config for those files is at the moment in `editorconfig`.
|
|
349
|
-
|
|
350
|
-
#### Note
|
|
351
|
-
|
|
352
|
-
Until we have set up formatting scripts for `erb` it's worth setting up [htmlbeautifier](https://github.com/threedaymonk/htmlbeautifier) for your editor (for example with https://github.com/aliariff/vscode-erb-beautify if you use VS Code) and tracking [this issue in Prettier](https://github.com/prettier/plugin-ruby/issues/371), as Prettier is much faster and hopefully will get support for `erb`.
|
|
353
|
-
|
|
354
253
|
### Adding a new component
|
|
355
254
|
|
|
356
255
|
#### To add a new component:
|
|
357
256
|
|
|
358
|
-
1.
|
|
359
|
-
2.
|
|
360
|
-
3. Add a `component.js`
|
|
257
|
+
1. Create a folder in `src`, in the module of your choice (i.e. `core`). The folder name should be TitleCase.
|
|
258
|
+
2. Add a `component.tsx`
|
|
361
259
|
|
|
362
|
-
-
|
|
363
|
-
- if
|
|
364
|
-
- if you need a React component, add a `components.jsx`
|
|
260
|
+
- also add an empty `component.js` file (current legacy requirement)
|
|
261
|
+
- if the component has custom CSS, add a `component.css` file as well.
|
|
365
262
|
|
|
366
|
-
#### To see this component in
|
|
263
|
+
#### To see this component in Storybook:
|
|
367
264
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
1. Import the file into `preview/app/javascript/packs/application.js` and add as input to the `reactRenderer`
|
|
371
|
-
2. If it contains custom CSS, import it into `preview/app/javascript/styles/application.css`
|
|
372
|
-
3. Add a template in `preview/app/views/components`, with a `_react` suffix, i.e. `my_component_react.html.erb`
|
|
373
|
-
|
|
374
|
-
##### For VW components:
|
|
375
|
-
|
|
376
|
-
1. You will need to restart the server for Rails to load the component (this will also need to happen after any changes to `component.rb`)
|
|
377
|
-
1. If it contains custom CSS, import it into `preview/app/javascript/styles/application.css`
|
|
378
|
-
1. Add a template in `preview/app/views/components`, with a `_vw` suffix, i.e. `my_component_vw.html.erb`
|
|
379
|
-
1. If the component has any JavaScript, import it in the view (`preview/app/views/components/my_component_vw.html.erb`) and initialize:
|
|
380
|
-
|
|
381
|
-
```rb
|
|
382
|
-
<% content_for :component do %>
|
|
383
|
-
<%= javascript_include_tag 'ably_ui/core/my_component/component' %>
|
|
384
|
-
<script type="text/javascript">
|
|
385
|
-
document.addEventListener("DOMContentLoaded", () => {
|
|
386
|
-
const container = document.querySelector("[data-id=my_component]");
|
|
387
|
-
AblyUI.Core.MyComponent(container);
|
|
388
|
-
});
|
|
389
|
-
</script>
|
|
390
|
-
<% end %>
|
|
391
|
-
```
|
|
265
|
+
Create a `[COMPONENT_NAME].stories.tsx` file alongside your `component` assets, following the examples of other Storybook stories, or their online documentation for guidance. When running Storybook, the story should be picked up and rendered in place automatically.
|
|
392
266
|
|
|
393
267
|
### Publishing
|
|
394
268
|
|
|
@@ -396,13 +270,13 @@ We use [Semantic Versioning 2.0.0](https://semver.org/) to version different lib
|
|
|
396
270
|
|
|
397
271
|
Packages are published to the [GitHub private registry](https://github.com/features/packages).
|
|
398
272
|
|
|
399
|
-
Publishing is done by tagging a release in GitHub. This triggers a GitHub action that pushes to the private NPM
|
|
273
|
+
Publishing is done by tagging a release in GitHub. This triggers a GitHub action that pushes to the private NPM registry as well as publishing new artefacts in the CDN, with the version taken from the tag of the GitHub release.
|
|
400
274
|
|
|
401
275
|
This will trigger GitHub actions in supported apps (currently [Voltaire](http://github.com/ably/voltaire) & [Website](http://github.com/ably/website)) to create a PR with an ably-ui version update.
|
|
402
276
|
|
|
403
277
|
**To trigger a release:**
|
|
404
278
|
|
|
405
|
-
- Make sure you have run pre-release script `./pre-release.sh` (This updates the
|
|
279
|
+
- Make sure you have run pre-release script `./pre-release.sh` (This updates the npm package version for ably-ui in `package.json`).
|
|
406
280
|
- Merge your PR into `main` after it has been approved.
|
|
407
281
|
- On the Github [Ably-UI](http://github.com/ably/ably-ui) repo, [create a new release](https://github.com/ably/ably-ui/releases/new) tag.
|
|
408
282
|
- Create a new tag with the new version number for the release.
|
|
@@ -411,10 +285,9 @@ This will trigger GitHub actions in supported apps (currently [Voltaire](http://
|
|
|
411
285
|
- Click on the Autogenerate release notes button.
|
|
412
286
|
- Publish Release.
|
|
413
287
|
- Check the Github `Actions` tab in the repo to make sure the release is green.
|
|
288
|
+
- Upon successful release, a compiled version of the Storybook site will be deployed to Github Pages.
|
|
414
289
|
|
|
415
|
-
This will release the packages
|
|
416
|
-
|
|
417
|
-
_Note: If the version number of the gem has been yanked you will need to increment the version number._
|
|
290
|
+
This will release the packages and update library and create & push the commit & tag, and also create corresponding PRs in Voltaire & Website. It will also deploy a new Storybook site to [https://ably.github.io/ably-ui/](https://ably.github.io/ably-ui/).
|
|
418
291
|
|
|
419
292
|
### Running tests
|
|
420
293
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _array_like_to_array(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _array_without_holes(arr){if(Array.isArray(arr))return _array_like_to_array(arr)}function _iterable_to_array(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _iterable_to_array_limit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _to_consumable_array(arr){return _array_without_holes(arr)||_iterable_to_array(arr)||_unsupported_iterable_to_array(arr)||_non_iterable_spread()}function _unsupported_iterable_to_array(o,minLen){if(!o)return;if(typeof o==="string")return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}import React,{useState}from"react";import Icon from"../Icon/component.tsx";var AccordionRow=function(param){var name=param.name,children=param.children,index=param.index,setActiveIndex=param.setActiveIndex,active=param.active,topBorder=param.topBorder,bottomBorder=param.bottomBorder,last=param.last,arrowIcon=param.arrowIcon;var iconActive,iconInactive;var handleSetIndex=function(){setActiveIndex(index)};if(arrowIcon){iconActive=React.createElement(Icon,{name:"icon-gui-disclosure-arrow",color:"text-dark-grey",size:"1.5rem",additionalCSS:"-rotate-90"});iconInactive=React.createElement(Icon,{name:"icon-gui-disclosure-arrow",color:"text-dark-grey",size:"1.5rem",additionalCSS:"rotate-90"})}else{iconActive=React.createElement(Icon,{name:"icon-gui-minus",color:"text-dark-grey",size:"1.5rem"});iconInactive=React.createElement(Icon,{name:"icon-gui-plus",color:"text-dark-grey",size:"1.5rem"})}return React.createElement("div",{className:"border-mid-grey ".concat(last&&!bottomBorder?"":"border-b"," ").concat(topBorder?"border-t":"")},React.createElement("button",{type:"button",onClick:handleSetIndex,className:"flex w-full px-0 focus:outline-none py-20"},React.createElement("span",{className:"ui-text-p1 font-bold text-left mr-8"},name),React.createElement("span",{className:"ml-auto"},active?iconActive:iconInactive)),React.createElement("section",{className:"ui-text-p2 transition-all overflow-hidden",style:{maxHeight:active?"500px":"0",paddingBottom:active?"1.5rem":"0"}},children))};var Accordion=function(param){var data=param.data,_param_id=param.id,id=_param_id===void 0?"id-accordion":_param_id,topBorder=param.topBorder,bottomBorder=param.bottomBorder,arrowIcon=param.arrowIcon,autoClose=param.autoClose;var _useState=_sliced_to_array(useState([]),2),activeIndexes=_useState[0],setActiveIndexes=_useState[1];var handleSetIndex=function(index){var currentIndexIsActive=activeIndexes.includes(index);if(autoClose){setActiveIndexes(currentIndexIsActive?[]:[index])}else{setActiveIndexes(currentIndexIsActive?activeIndexes.filter(function(i){return i!==index}):_to_consumable_array(activeIndexes).concat([index]))}};return React.createElement("div",{className:"ui-grid-mx max-w-screen-sm sm:mx-auto",id:id},data.map(function(item,currentIndex){return React.createElement(AccordionRow,{key:item.name,name:item.name,arrowIcon:arrowIcon,index:currentIndex,last:data.length===currentIndex+1,topBorder:topBorder&¤tIndex===0,bottomBorder:bottomBorder&&data.length===currentIndex+1,active:activeIndexes.includes(currentIndex),setActiveIndex:handleSetIndex},item.content)}))};export default Accordion;
|
package/core/Code/component.css
CHANGED
|
@@ -1,72 +1 @@
|
|
|
1
|
-
@
|
|
2
|
-
@import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,600;0,700;1,600;1,700&display=swap");
|
|
3
|
-
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@100;200;300;400;500;600;700;800&display=swap");
|
|
4
|
-
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;500;600;700;800&display=swap");
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
@layer components {
|
|
8
|
-
.hljs {
|
|
9
|
-
background: var(--syntax-black);
|
|
10
|
-
color: var(--syntax-light-grey);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.hljs-emphasis {
|
|
14
|
-
@apply italic;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.hljs-strong {
|
|
18
|
-
@apply font-bold;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.hljs-comment,
|
|
22
|
-
.hljs-quote {
|
|
23
|
-
color: var(--syntax-dark-grey);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.hljs-variable,
|
|
27
|
-
.hljs-template-variable,
|
|
28
|
-
.hljs-tag,
|
|
29
|
-
.hljs-name,
|
|
30
|
-
.hljs-selector-id,
|
|
31
|
-
.hljs-selector-class,
|
|
32
|
-
.hljs-regexp,
|
|
33
|
-
.hljs-deletion {
|
|
34
|
-
color: var(--syntax-red);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.hljs-number,
|
|
38
|
-
.hljs-built_in,
|
|
39
|
-
.hljs-literal,
|
|
40
|
-
.hljs-type,
|
|
41
|
-
.hljs-params,
|
|
42
|
-
.hljs-meta,
|
|
43
|
-
.hljs-link {
|
|
44
|
-
color: var(--syntax-orange);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.hljs-attribute {
|
|
48
|
-
color: var(--syntax-yellow);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.hljs-string,
|
|
52
|
-
.hljs-symbol,
|
|
53
|
-
.hljs-bullet,
|
|
54
|
-
.hljs-addition {
|
|
55
|
-
color: var(--syntax-green);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.hljs-title,
|
|
59
|
-
.hljs-section {
|
|
60
|
-
color: var(--syntax-blue);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.hljs-keyword,
|
|
64
|
-
.hljs-selector-tag {
|
|
65
|
-
color: var(--syntax-lilac);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.hljs-subst {
|
|
69
|
-
color: var(--syntax-mid-grey);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
1
|
+
@import "../utils/syntax-highlighter.css";
|
package/core/Code/component.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import React from"react";import"../utils/syntax-highlighter.css";import{highlightSnippet,registerDefaultLanguages}from"../utils/syntax-highlighter";import languagesRegistry from"../utils/syntax-highlighter-registry";registerDefaultLanguages(languagesRegistry);var Code=function(param){var language=param.language,snippet=param.snippet,_param_textSize=param.textSize,textSize=_param_textSize===void 0?"ui-text-code":_param_textSize,_param_padding=param.padding,padding=_param_padding===void 0?"p-32":_param_padding,_param_additionalCSS=param.additionalCSS,additionalCSS=_param_additionalCSS===void 0?"":_param_additionalCSS;var _highlightSnippet;var HTMLraw=(_highlightSnippet=highlightSnippet(language,"".concat(snippet).trim()))!==null&&_highlightSnippet!==void 0?_highlightSnippet:"";var className="language-".concat(language," ").concat(textSize);return React.createElement("div",{className:"hljs overflow-auto ".concat(padding," ").concat(additionalCSS),"data-id":"code"},React.createElement("pre",{lang:language},React.createElement("code",{className:className,dangerouslySetInnerHTML:{__html:HTMLraw}})))};export default Code;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _array_like_to_array(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _iterable_to_array_limit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(!o)return;if(typeof o==="string")return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}import React,{useEffect,useState}from"react";import{connectState,getRemoteDataStore}from"../remote-data-store";var ConnectStateWrapper=function(Component,selectors){var _useState=_sliced_to_array(useState({}),2),state=_useState[0],setState=_useState[1];var setStateForKey=function(key){return function(storeState){return setState(function(){return _define_property({},key,storeState)})}};useEffect(function(){var store=getRemoteDataStore();var resolvedState=Object.keys(selectors).reduce(function(acc,key){return _object_spread_props(_object_spread({},acc),_define_property({},key,selectors[key](store)))},{});setState(resolvedState);Object.keys(selectors).forEach(function(key){connectState(selectors[key],setStateForKey(key))})},[]);var WrappedComponent=function(props){return React.createElement(Component,_object_spread({},props,state))};return WrappedComponent};export default ConnectStateWrapper;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
@apply w-full bg-gradient-active-orange;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.ui-contact-footer-box {
|
|
9
|
-
@apply p-24 sm:p-32 xl:p-40 bg-white flex flex-col justify-between rounded-sm;
|
|
10
|
-
}
|
|
1
|
+
.ui-contact-footer {
|
|
2
|
+
background-size: 100% 100%;
|
|
3
|
+
background-position: right center;
|
|
4
|
+
@apply w-full bg-gradient-active-orange;
|
|
11
5
|
}
|
|
12
6
|
|
|
7
|
+
.ui-contact-footer-box {
|
|
8
|
+
@apply p-24 sm:p-32 xl:p-40 bg-white flex flex-col justify-between rounded-sm;
|
|
9
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import React,{useEffect}from"react";import Icon from"../Icon/component.tsx";import _absUrl from"../url-base.js";import toggleChatWidget from"../hubspot-chat-toggle";import"./component.css";var ContactFooter=function(param){var urlBase=param.urlBase;useEffect(function(){return toggleChatWidget({dataId:"contact-footer"})},[]);var absUrl=function(path){return _absUrl(path,urlBase)};return React.createElement("div",{className:"ui-contact-footer font-sans antialiased","data-id":"contact-footer"},React.createElement("div",{className:"w-full bp-lg max-w-screen-xl mx-auto py-64 grid grid-cols-1 md:grid-cols-3 ui-grid-gap ui-grid-px"},React.createElement("div",{className:"ui-contact-footer-box"},React.createElement(Icon,{name:"icon-display-live-chat",size:"3rem",additionalCSS:"block mb-16"}),React.createElement("div",null,React.createElement("div",{className:"ui-text-h3 mb-24"},"Live Chat"),React.createElement("p",{className:"ui-text-p1"},"Reach out team of experts over chat powered by Ably.")),React.createElement("button",{type:"button",className:"ui-btn-secondary self-start mt-16",disabled:true,"data-id":"open-chat-widget","data-enabled-label":"Start a live chat","data-disabled-label":"Live chat unavailable"},"Live chat unavailable")),React.createElement("div",{className:"ui-contact-footer-box"},React.createElement(Icon,{name:"icon-display-call-mobile",size:"3rem",additionalCSS:"block mb-16"}),React.createElement("div",{className:"flex-grow"},React.createElement("div",{className:"ui-text-h3 mb-24"},"Call us"),React.createElement("p",{className:"ui-text-p1"},React.createElement("span",{className:"block"},React.createElement("strong",{className:"font-bold"},"+1 877 434 5287")," (USA, toll free)"),React.createElement("span",{className:"block"},React.createElement("strong",{className:"font-bold"},"+44 20 3318 4689")," (UK)")))),React.createElement("div",{className:"ui-contact-footer-box"},React.createElement(Icon,{name:"icon-display-tech-account-comms",size:"3rem",additionalCSS:"block mb-16"}),React.createElement("div",null,React.createElement("div",{className:"ui-text-h3 mb-24"},"Technical and account support"),React.createElement("p",{className:"ui-text-p1"},"We're standing by to help with any questions or code.")),React.createElement("a",{className:"ui-btn-secondary self-start p-btn mt-16",href:absUrl("/support")},"Get support now"))))};export default ContactFooter;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
transition: bottom 250ms ease-out, opacity 150ms ease-out;
|
|
12
|
-
}
|
|
1
|
+
.ui-cookie-message {
|
|
2
|
+
@apply rounded-lg bg-white font-sans;
|
|
3
|
+
@apply justify-between items-center;
|
|
4
|
+
@apply opacity-100 z-50 bottom-0 fixed sm:flex;
|
|
5
|
+
@apply p-16 mb-16 ml-16;
|
|
6
|
+
max-width: 70vw;
|
|
7
|
+
box-shadow: 0px 24px 32px 0px #0000000d;
|
|
8
|
+
border: 1px solid var(--color-mid-grey);
|
|
9
|
+
border-left: 0.5rem solid var(--color-electric-cyan);
|
|
10
|
+
transition: bottom 250ms ease-out, opacity 150ms ease-out;
|
|
13
11
|
}
|
|
14
|
-
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import"./component.css";array(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _iterable_to_array_limit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(!o)return;if(typeof o==="string")return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}import React,{useRef,useEffect,useState}from"react";import Cookie from"js-cookie";import"./component.css";import _absUrl from"../url-base";var COOKIE_EXPIRY=365;var CookieMessage=function(param){var cookieId=param.cookieId,urlBase=param.urlBase;var ref=useRef(null);var _useState=_sliced_to_array(useState(true),2),hideCookieMessage=_useState[0],setHideCookieMessage=_useState[1];useEffect(function(){var isCookieSet=Cookie.get(cookieId)?true:false;setHideCookieMessage(isCookieSet)},[]);var handleClose=function(){var _ref_current;Cookie.set(cookieId,"1",{expires:COOKIE_EXPIRY});(_ref_current=ref.current)===null||_ref_current===void 0?void 0:_ref_current.classList.add("bottom-1","opacity-0");setTimeout(function(){return setHideCookieMessage(true)},500)};var absUrl=function(path){return _absUrl(path,urlBase)};if(hideCookieMessage)return null;return React.createElement("div",{className:"ui-cookie-message",ref:ref},React.createElement("p",{className:"ui-text-p2 pr-32"},React.createElement("a",{href:absUrl("/privacy"),className:"underline"},"How we use cookies")," ","to improve your experience."),React.createElement("button",{className:"ui-btn-secondary mt-12 sm:mt-0 whitespace-nowrap",onClick:handleClose},"Accept and close"))};export default CookieMessage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import React from"react";var CustomerLogos=function(param){var companies=param.companies,_param_additionalCss=param.additionalCss,additionalCss=_param_additionalCss===void 0?"":_param_additionalCss;return React.createElement("section",{className:"w-full bg-white"},React.createElement("ul",{className:"py-64 flex flex-row flex-wrap md:flex-nowrap content-between m-auto items-center ".concat(additionalCss)},companies.map(function(company){return React.createElement("li",{key:company.label,className:"flex-auto text-center sm:w-1/3 w-1/2"},React.createElement("img",{alt:company.label,src:company.logo,className:"mx-auto"}))})))};export default CustomerLogos;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _array_like_to_array(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _iterable_to_array_limit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(!o)return;if(typeof o==="string")return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}import React,{createContext,useContext,useState,useEffect,useRef}from"react";import Icon from"../Icon/component.tsx";var DropdownMenuContext=createContext({isOpen:false,setOpen:function(){}});var DropdownMenu=function(param){var children=param.children;var _useState=_sliced_to_array(useState(false),2),isOpen=_useState[0],setOpen=_useState[1];var ref=useRef(null);useEffect(function(){var clickHandler=function(e){var _ref_current;if((_ref_current=ref.current)===null||_ref_current===void 0?void 0:_ref_current.contains(e.target))return;setOpen(false)};document.addEventListener("click",clickHandler);return function(){document.removeEventListener("click",clickHandler)}},[]);return React.createElement(DropdownMenuContext.Provider,{value:{isOpen:isOpen,setOpen:setOpen}},React.createElement("div",{id:"dropdown-menu",className:"relative",ref:ref},children))};var Trigger=function(param){var children=param.children,_param_additionalTriggerCSS=param.additionalTriggerCSS,additionalTriggerCSS=_param_additionalTriggerCSS===void 0?"":_param_additionalTriggerCSS;var _useContext=useContext(DropdownMenuContext),isOpen=_useContext.isOpen,setOpen=_useContext.setOpen;return React.createElement("button",{id:"menu-trigger",onClick:function(){return setOpen(!isOpen)},className:"".concat(additionalTriggerCSS," flex items-center p-8 ml-8 group hover:text-gui-hover hover:bg-light-grey active:text-gui-active focus:text-gui-focus focus:outline-none rounded-lg")},React.createElement("span",{className:"leading-normal"},children),React.createElement(Icon,{name:"icon-gui-disclosure-arrow",color:"text-cool-black",size:"1.25rem",additionalCSS:"transform rotate-90 group-hover:text-gui-hover group-active:text-gui-active group-focus:text-gui-focus"}))};var Content=function(param){var children=param.children,_param_anchorPosition=param.anchorPosition,anchorPosition=_param_anchorPosition===void 0?"right":_param_anchorPosition,additionalContentCSS=param.additionalContentCSS;var isOpen=useContext(DropdownMenuContext).isOpen;if(!isOpen){return null}var anchorPositionClasses=anchorPosition==="right"?"right-0":"left-0";return React.createElement("div",{id:"menu-content",className:"".concat(additionalContentCSS," absolute p-8 z-10 border border-mid-grey bg-white rounded shadow-container ").concat(anchorPositionClasses),style:{minWidth:275,top:44}},children)};var Link=function(param){var url=param.url,title=param.title,subtitle=param.subtitle,iconName=param.iconName,children=param.children;return React.createElement("a",{href:url,className:"menu-link group block p-8 hover:bg-light-grey hover:text-cool-black rounded"},React.createElement("p",{className:"mb-4"},title,iconName?React.createElement(Icon,{name:iconName,size:"1rem",color:"text-cool-black",additionalCSS:"align-middle ml-8 relative -top-1 -left-4"}):null),subtitle?React.createElement("p",{className:"ui-text-p3 mb-16"},subtitle):null,children)};DropdownMenu.Trigger=Trigger;DropdownMenu.Content=Content;DropdownMenu.Link=Link;export default DropdownMenu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}import React from"react";import Icon from"../Icon/component.tsx";var buildTargetAndRel=function(url,newWindow){var props={};if(newWindow){props.target="_blank";if(url.startsWith("/")&&!url.startsWith("//")){props.rel="noopener"}else{props.rel="noopenner noreferrer"}}return props};var FeaturedLink=function(param){var url=param.url,_param_textSize=param.textSize,textSize=_param_textSize===void 0?"text-p2":_param_textSize,_param_iconColor=param.iconColor,iconColor=_param_iconColor===void 0?"text-cool-black":_param_iconColor,_param_flush=param.flush,flush=_param_flush===void 0?false:_param_flush,_param_reverse=param.reverse,reverse=_param_reverse===void 0?false:_param_reverse,_param_additionalCSS=param.additionalCSS,additionalCSS=_param_additionalCSS===void 0?"":_param_additionalCSS,_param_newWindow=param.newWindow,newWindow=_param_newWindow===void 0?false:_param_newWindow,_param_onClick=param.onClick,onClick=_param_onClick===void 0?undefined:_param_onClick,children=param.children;var targetAndRel=buildTargetAndRel(url,newWindow);return React.createElement("a",_object_spread_props(_object_spread({href:url,className:"font-sans font-bold block text-gui-default hover:text-gui-hover focus:text-gui-focus focus:outline-gui-focus group ui-".concat(textSize," ").concat(flush?"":"py-8"," ").concat(additionalCSS),style:{"--featured-link-icon-size":"var(".concat(textSize.replace("text","--fs"),")")}},targetAndRel),{onClick:onClick}),reverse?React.createElement(React.Fragment,null,React.createElement(Icon,{name:"icon-gui-link-arrow",size:"calc(var(--featured-link-icon-size) * 1.25)",color:iconColor,additionalCSS:"align-middle mr-8 relative -top-1 -right-4 transition-all group-hover:right-0 transform rotate-180"}),children):React.createElement(React.Fragment,null,children,React.createElement(Icon,{name:"icon-gui-link-arrow",size:"calc(var(--featured-link-icon-size) * 1.25)",color:iconColor,additionalCSS:"align-middle ml-8 relative -top-1 -left-4 transition-all group-hover:left-0"})))};export default FeaturedLink;
|
package/core/Flash/component.css
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.ui-flash-message {
|
|
10
|
-
@apply font-sans font-light antialiased max-w-screen-xl mx-auto mt-8 opacity-0 relative;
|
|
11
|
-
transition: opacity 200ms, transform 200ms, height 200ms 200ms,
|
|
12
|
-
margin-top 200ms 200ms;
|
|
13
|
-
transform: translateY(-200%) rotateX(-90deg);
|
|
14
|
-
}
|
|
1
|
+
.ui-flash {
|
|
2
|
+
@apply w-full fixed;
|
|
3
|
+
top: 5.5rem;
|
|
4
|
+
z-index: calc(var(--stacking-context-page-meganav) - 10);
|
|
5
|
+
transition: margin-top 200ms;
|
|
6
|
+
}
|
|
15
7
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
.ui-flash-message {
|
|
9
|
+
@apply font-sans font-light antialiased max-w-screen-xl mx-auto mt-8 opacity-0 relative;
|
|
10
|
+
transition: opacity 200ms, transform 200ms, height 200ms 200ms,
|
|
11
|
+
margin-top 200ms 200ms;
|
|
12
|
+
transform: translateY(-200%) rotateX(-90deg);
|
|
13
|
+
}
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
15
|
+
/* dynamic content inside flash, can't add classes */
|
|
16
|
+
.ui-flash-text a {
|
|
17
|
+
@apply underline;
|
|
25
18
|
}
|
|
26
19
|
|
|
20
|
+
.ui-flash-message-enter {
|
|
21
|
+
@apply opacity-100;
|
|
22
|
+
transform: translateY(0) rotateX(0);
|
|
23
|
+
}
|
package/core/Flash/component.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _array_like_to_array(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _array_without_holes(arr){if(Array.isArray(arr))return _array_like_to_array(arr)}function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _iterable_to_array(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _iterable_to_array_limit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _to_consumable_array(arr){return _array_without_holes(arr)||_iterable_to_array(arr)||_unsupported_iterable_to_array(arr)||_non_iterable_spread()}function _unsupported_iterable_to_array(o,minLen){if(!o)return;if(typeof o==="string")return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}import React,{useEffect,useState,useRef}from"react";import DOMPurify from"dompurify";import{nanoid}from"nanoid/non-secure";import{getRemoteDataStore}from"../remote-data-store.js";import ConnectStateWrapper from"../ConnectStateWrapper/component.tsx";import Icon from"../Icon/component.tsx";import"./component.css";var REDUCER_KEY="flashes";var FLASH_DATA_ID="ui-flashes";var initialState={items:[]};var reducerFlashes=_define_property({},REDUCER_KEY,function(){var state=arguments.length>0&&arguments[0]!==void 0?arguments[0]:initialState,action=arguments.length>1?arguments[1]:void 0;switch(action.type){case"flash/push":{var flashes=Array.isArray(action.payload)?action.payload:[action.payload];return{items:_to_consumable_array(state.items).concat(_to_consumable_array(flashes))}}default:return state}});var selectFlashes=function(store){return store.getState()[REDUCER_KEY]};var FLASH_BG_COLOR={error:"bg-gui-error",success:"bg-zingy-green",notice:"bg-electric-cyan",info:"bg-electric-cyan",alert:"bg-active-orange"};var FLASH_TEXT_COLOR={error:"text-white",success:"text-cool-black",notice:"text-cool-black",info:"text-cool-black",alert:"text-white"};var AUTO_HIDE=["success","info","notice"];var AUTO_HIDE_TIME=8e3;var useAutoHide=function(type,closeFlash){var timeoutId=useRef(null);useEffect(function(){if(AUTO_HIDE.includes(type)){timeoutId.current=setTimeout(function(){closeFlash()},AUTO_HIDE_TIME)}return function(){if(timeoutId.current){clearTimeout(timeoutId.current)}}},[])};var Flash=function(param){var id=param.id,type=param.type,content=param.content,removeFlash=param.removeFlash;var ref=useRef(null);var _useState=_sliced_to_array(useState(false),2),closed=_useState[0],setClosed=_useState[1];var _useState1=_sliced_to_array(useState(0),2),flashHeight=_useState1[0],setFlashHeight=_useState1[1];var _useState2=_sliced_to_array(useState(false),2),triggerEntryAnimation=_useState2[0],setTriggerEntryAnimation=_useState2[1];var closeFlash=function(){if(ref.current){setFlashHeight(ref.current.getBoundingClientRect().height)}setClosed(true);setTimeout(function(){id&&removeFlash(id)},100)};useEffect(function(){return setTriggerEntryAnimation(true)},[]);useAutoHide(type,closeFlash);var animateEntry=triggerEntryAnimation&&!closed;var style;if(flashHeight&&!closed){style={height:"".concat(flashHeight,"px")}}else if(closed){style={height:0,marginTop:0,zIndex:-1}}else{style={}}var safeContent=DOMPurify.sanitize(content,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href","data-method","rel"]});var withIcons={notice:"icon-gui-ably-badge",success:"icon-gui-tick",error:"icon-gui-warning",alert:"icon-gui-warning"};var iconColor={notice:"text-cool-black",success:"text-cool-black",error:"text-white",alert:"text-white"};return React.createElement("div",{className:"ui-flash-message ui-grid-px ".concat(animateEntry?"ui-flash-message-enter":""),style:style,ref:ref,"data-id":"ui-flash"},React.createElement("div",{className:"".concat(FLASH_BG_COLOR[type]," p-32 flex align-center rounded shadow-container-subtle")},withIcons[type]&&React.createElement(Icon,{name:withIcons[type],color:iconColor[type],size:"1.5rem",additionalCSS:"mr-16 self-baseline"}),React.createElement("p",{className:"ui-text-p1 mr-16 ".concat(FLASH_TEXT_COLOR[type]),dangerouslySetInnerHTML:{__html:safeContent}}),React.createElement("button",{type:"button",className:"p-0 ml-auto self-start focus:outline-none",onClick:closeFlash},React.createElement(Icon,{name:"icon-gui-close",color:iconColor[type],size:"1.5rem",additionalCSS:"transition-colors"}))))};var Flashes=function(param){var flashes=param.flashes;var _useState=_sliced_to_array(useState([]),2),flashesWithIds=_useState[0],setFlashesWithIds=_useState[1];var removeFlash=function(flashId){return setFlashesWithIds(function(items){return items.filter(function(item){return item.id!==flashId})})};useEffect(function(){setFlashesWithIds(function(state){return _to_consumable_array(state).concat(_to_consumable_array((flashes===null||flashes===void 0?void 0:flashes.items).map(function(flash){return _object_spread_props(_object_spread({},flash),{id:nanoid(),removed:false})})))})},[flashes]);return React.createElement("div",{className:"ui-flash","data-id":FLASH_DATA_ID},flashesWithIds.filter(function(item){return!item.removed}).map(function(flash){return React.createElement(Flash,_object_spread_props(_object_spread({key:flash.id},flash),{removeFlash:removeFlash}))}))};var BackendFlashes=function(param){var flashes=param.flashes;useEffect(function(){var transformedFlashes=flashes.map(function(flash){var _flash=_sliced_to_array(flash,2),type=_flash[0],content=_flash[1];return{type:type,content:content}})||[];if(transformedFlashes.length>0){var store=getRemoteDataStore();store.dispatch({type:"flash/push",payload:transformedFlashes})}},[]);var WrappedFlashes=ConnectStateWrapper(Flashes,{flashes:selectFlashes});return React.createElement(WrappedFlashes,null)};export{reducerFlashes,FLASH_DATA_ID,Flashes};export default BackendFlashes;
|