@ably/ui 13.3.0 → 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} +26 -18
- 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 -241
- 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 -4151
- package/core/MeganavBlogPostsList/component.js.LICENSE.txt +0 -1
- package/core/MeganavBlogPostsList.jsx +0 -296
- package/core/MeganavContentCompany.jsx +0 -1058
- package/core/MeganavContentDevelopers.jsx +0 -334
- package/core/MeganavContentProducts.jsx +0 -373
- 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 -689
- package/core/MeganavItemsSignedIn.jsx +0 -643
- package/core/MeganavSearch.jsx +0 -434
- package/core/MeganavSearchAutocomplete.jsx +0 -117
- 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.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/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
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import "../utils/syntax-highlighter.css";
|
|
4
|
+
import {
|
|
5
|
+
highlightSnippet,
|
|
6
|
+
registerDefaultLanguages,
|
|
7
|
+
} from "../utils/syntax-highlighter";
|
|
8
|
+
import languagesRegistry from "../utils/syntax-highlighter-registry";
|
|
9
|
+
|
|
10
|
+
registerDefaultLanguages(languagesRegistry);
|
|
11
|
+
|
|
12
|
+
type CodeProps = {
|
|
13
|
+
language: string;
|
|
14
|
+
snippet: string;
|
|
15
|
+
textSize?: string;
|
|
16
|
+
padding?: string;
|
|
17
|
+
additionalCSS?: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const Code = ({
|
|
21
|
+
language,
|
|
22
|
+
snippet,
|
|
23
|
+
textSize = "ui-text-code",
|
|
24
|
+
padding = "p-32",
|
|
25
|
+
additionalCSS = "",
|
|
26
|
+
}: CodeProps) => {
|
|
27
|
+
const HTMLraw = highlightSnippet(language, `${snippet}`.trim()) ?? "";
|
|
28
|
+
const className = `language-${language} ${textSize}`;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
className={`hljs overflow-auto ${padding} ${additionalCSS}`}
|
|
33
|
+
data-id="code"
|
|
34
|
+
>
|
|
35
|
+
<pre lang={language}>
|
|
36
|
+
<code
|
|
37
|
+
className={className}
|
|
38
|
+
dangerouslySetInnerHTML={{ __html: HTMLraw }}
|
|
39
|
+
/>
|
|
40
|
+
</pre>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default Code;
|
|
@@ -12,14 +12,18 @@ import { connectState, getRemoteDataStore } from "../remote-data-store";
|
|
|
12
12
|
- initial state is set in useEffect so the wrapped component needs to handle it's props set to undefined initially
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const ConnectStateWrapper = (Component, selectors) => {
|
|
16
16
|
const [state, setState] = useState({});
|
|
17
17
|
|
|
18
|
-
const setStateForKey = (key) => (storeState) =>
|
|
18
|
+
const setStateForKey = (key) => (storeState) =>
|
|
19
|
+
setState(() => ({ [key]: storeState }));
|
|
19
20
|
|
|
20
21
|
useEffect(() => {
|
|
21
22
|
const store = getRemoteDataStore();
|
|
22
|
-
const resolvedState = Object.keys(selectors).reduce(
|
|
23
|
+
const resolvedState = Object.keys(selectors).reduce(
|
|
24
|
+
(acc, key) => ({ ...acc, [key]: selectors[key](store) }),
|
|
25
|
+
{}
|
|
26
|
+
);
|
|
23
27
|
|
|
24
28
|
// Set initial state
|
|
25
29
|
setState(resolvedState);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
.ui-contact-footer {
|
|
2
|
+
background-size: 100% 100%;
|
|
3
|
+
background-position: right center;
|
|
4
|
+
@apply w-full bg-gradient-active-orange;
|
|
5
|
+
}
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
7
|
+
.ui-contact-footer-box {
|
|
8
|
+
@apply p-24 sm:p-32 xl:p-40 bg-white flex flex-col justify-between rounded-sm;
|
|
11
9
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
import Icon from "../Icon/component.tsx";
|
|
4
|
+
import _absUrl from "../url-base.js";
|
|
5
|
+
import toggleChatWidget from "../hubspot-chat-toggle";
|
|
6
|
+
import "./component.css";
|
|
7
|
+
|
|
8
|
+
type ContactFooterProps = {
|
|
9
|
+
urlBase: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const ContactFooter = ({ urlBase }: ContactFooterProps) => {
|
|
13
|
+
useEffect(() => toggleChatWidget({ dataId: "contact-footer" }), []);
|
|
14
|
+
const absUrl = (path) => _absUrl(path, urlBase);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div
|
|
18
|
+
className="ui-contact-footer font-sans antialiased"
|
|
19
|
+
data-id="contact-footer"
|
|
20
|
+
>
|
|
21
|
+
<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">
|
|
22
|
+
<div className="ui-contact-footer-box">
|
|
23
|
+
<Icon
|
|
24
|
+
name="icon-display-live-chat"
|
|
25
|
+
size="3rem"
|
|
26
|
+
additionalCSS="block mb-16"
|
|
27
|
+
/>
|
|
28
|
+
<div>
|
|
29
|
+
<div className="ui-text-h3 mb-24">Live Chat</div>
|
|
30
|
+
<p className="ui-text-p1">
|
|
31
|
+
Reach out team of experts over chat powered by Ably.
|
|
32
|
+
</p>
|
|
33
|
+
</div>
|
|
34
|
+
<button
|
|
35
|
+
type="button"
|
|
36
|
+
className="ui-btn-secondary self-start mt-16"
|
|
37
|
+
disabled
|
|
38
|
+
data-id="open-chat-widget"
|
|
39
|
+
data-enabled-label="Start a live chat"
|
|
40
|
+
data-disabled-label="Live chat unavailable"
|
|
41
|
+
>
|
|
42
|
+
Live chat unavailable
|
|
43
|
+
</button>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div className="ui-contact-footer-box">
|
|
47
|
+
<Icon
|
|
48
|
+
name="icon-display-call-mobile"
|
|
49
|
+
size="3rem"
|
|
50
|
+
additionalCSS="block mb-16"
|
|
51
|
+
/>
|
|
52
|
+
<div className="flex-grow">
|
|
53
|
+
<div className="ui-text-h3 mb-24">Call us</div>
|
|
54
|
+
<p className="ui-text-p1">
|
|
55
|
+
<span className="block">
|
|
56
|
+
<strong className="font-bold">+1 877 434 5287</strong> (USA,
|
|
57
|
+
toll free)
|
|
58
|
+
</span>
|
|
59
|
+
<span className="block">
|
|
60
|
+
<strong className="font-bold">+44 20 3318 4689</strong> (UK)
|
|
61
|
+
</span>
|
|
62
|
+
</p>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div className="ui-contact-footer-box">
|
|
67
|
+
<Icon
|
|
68
|
+
name="icon-display-tech-account-comms"
|
|
69
|
+
size="3rem"
|
|
70
|
+
additionalCSS="block mb-16"
|
|
71
|
+
/>
|
|
72
|
+
<div>
|
|
73
|
+
<div className="ui-text-h3 mb-24">
|
|
74
|
+
Technical and account support
|
|
75
|
+
</div>
|
|
76
|
+
<p className="ui-text-p1">
|
|
77
|
+
We're standing by to help with any questions or code.
|
|
78
|
+
</p>
|
|
79
|
+
</div>
|
|
80
|
+
<a
|
|
81
|
+
className="ui-btn-secondary self-start p-btn mt-16"
|
|
82
|
+
href={absUrl("/support")}
|
|
83
|
+
>
|
|
84
|
+
Get support now
|
|
85
|
+
</a>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export default ContactFooter;
|
|
@@ -1,13 +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
|
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useState } from "react";
|
|
2
|
-
import T from "prop-types";
|
|
3
2
|
import Cookie from "js-cookie";
|
|
3
|
+
import "./component.css";
|
|
4
4
|
|
|
5
5
|
import _absUrl from "../url-base";
|
|
6
6
|
|
|
7
7
|
const COOKIE_EXPIRY = 365;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
type CookieMessageProps = {
|
|
10
|
+
cookieId: string;
|
|
11
|
+
urlBase: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const CookieMessage = ({ cookieId, urlBase }: CookieMessageProps) => {
|
|
15
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
11
16
|
const [hideCookieMessage, setHideCookieMessage] = useState(true);
|
|
12
17
|
|
|
13
18
|
useEffect(() => {
|
|
@@ -18,7 +23,7 @@ export default function CookieMessage({ cookieId, urlBase }) {
|
|
|
18
23
|
const handleClose = () => {
|
|
19
24
|
Cookie.set(cookieId, "1", { expires: COOKIE_EXPIRY });
|
|
20
25
|
|
|
21
|
-
ref.current
|
|
26
|
+
ref.current?.classList.add("bottom-1", "opacity-0");
|
|
22
27
|
setTimeout(() => setHideCookieMessage(true), 500);
|
|
23
28
|
};
|
|
24
29
|
|
|
@@ -35,14 +40,14 @@ export default function CookieMessage({ cookieId, urlBase }) {
|
|
|
35
40
|
</a>{" "}
|
|
36
41
|
to improve your experience.
|
|
37
42
|
</p>
|
|
38
|
-
<button
|
|
43
|
+
<button
|
|
44
|
+
className="ui-btn-secondary mt-12 sm:mt-0 whitespace-nowrap"
|
|
45
|
+
onClick={handleClose}
|
|
46
|
+
>
|
|
39
47
|
Accept and close
|
|
40
48
|
</button>
|
|
41
49
|
</div>
|
|
42
50
|
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
CookieMessage.propTypes = {
|
|
46
|
-
cookieId: T.string,
|
|
47
|
-
urlBase: T.string,
|
|
48
51
|
};
|
|
52
|
+
|
|
53
|
+
export default CookieMessage;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import CustomerLogos from "./component.tsx";
|
|
2
|
+
|
|
3
|
+
import hubspot from "../images/cust-logo-hubspot-mono-pos.svg";
|
|
4
|
+
import webflow from "../images/cust-logo-webflow-col-pos.svg";
|
|
5
|
+
import mentimeter from "../images/cust-logo-mentimeter-mono-pos.svg";
|
|
6
|
+
import toyota from "../images/cust-logo-toyota-mono-pos.svg";
|
|
7
|
+
import split from "../images/cust-logo-split-mono-pos.svg";
|
|
8
|
+
import australian from "../images/cust-logo-ausopen-mono-pos.svg";
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: "Components/Customer Logos",
|
|
12
|
+
component: CustomerLogos,
|
|
13
|
+
args: {
|
|
14
|
+
companies: [
|
|
15
|
+
{
|
|
16
|
+
label: "Hubspot",
|
|
17
|
+
logo: hubspot,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
label: "Webflow",
|
|
21
|
+
logo: webflow,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: "Mentimeter",
|
|
25
|
+
logo: mentimeter,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: "Toyota",
|
|
29
|
+
logo: toyota,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: "Split",
|
|
33
|
+
logo: split,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: "Australian Open",
|
|
37
|
+
logo: australian,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Default = {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
type CompanyEntity = {
|
|
4
|
+
label: string;
|
|
5
|
+
logo: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type CustomerLogosProps = {
|
|
9
|
+
companies: CompanyEntity[];
|
|
10
|
+
additionalCss?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const CustomerLogos = ({
|
|
14
|
+
companies,
|
|
15
|
+
additionalCss = "",
|
|
16
|
+
}: CustomerLogosProps) => {
|
|
17
|
+
return (
|
|
18
|
+
<section className="w-full bg-white">
|
|
19
|
+
<ul
|
|
20
|
+
className={`py-64 flex flex-row flex-wrap md:flex-nowrap content-between m-auto items-center ${additionalCss}`}
|
|
21
|
+
>
|
|
22
|
+
{companies.map((company) => (
|
|
23
|
+
<li
|
|
24
|
+
key={company.label}
|
|
25
|
+
className="flex-auto text-center sm:w-1/3 w-1/2"
|
|
26
|
+
>
|
|
27
|
+
<img alt={company.label} src={company.logo} className="mx-auto" />
|
|
28
|
+
</li>
|
|
29
|
+
))}
|
|
30
|
+
</ul>
|
|
31
|
+
</section>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default CustomerLogos;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Icon from "../Icon/component.tsx";
|
|
3
|
+
import DropdownMenu from "./component.tsx";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "Components/Dropdown Menu",
|
|
7
|
+
component: DropdownMenu,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Default = {
|
|
11
|
+
render: () => (
|
|
12
|
+
<DropdownMenu>
|
|
13
|
+
<DropdownMenu.Trigger additionalTriggerCSS="ui-text-h3">
|
|
14
|
+
Dropdown Menu Trigger
|
|
15
|
+
</DropdownMenu.Trigger>
|
|
16
|
+
<DropdownMenu.Content anchorPosition="left">
|
|
17
|
+
<DropdownMenu.Link
|
|
18
|
+
url="https://ably.com/"
|
|
19
|
+
title="Using DropdownMenuLink Component"
|
|
20
|
+
subtitle="This is using the inbuilt component which takes props for title, subtitle, icon name & children."
|
|
21
|
+
iconName="icon-gui-link-arrow"
|
|
22
|
+
>
|
|
23
|
+
<p className="ui-text-p3">I am a child! 🐣</p>
|
|
24
|
+
</DropdownMenu.Link>
|
|
25
|
+
<DropdownMenu.Link
|
|
26
|
+
url="https://ably.com/"
|
|
27
|
+
title="Using DropdownMenuLink Component - no icon, subtitle or children"
|
|
28
|
+
/>
|
|
29
|
+
<a
|
|
30
|
+
href="https://ably.com/docs"
|
|
31
|
+
target="_blank"
|
|
32
|
+
rel="noreferrer"
|
|
33
|
+
className="group block p-8 hover:bg-light-grey hover:text-cool-black rounded"
|
|
34
|
+
>
|
|
35
|
+
<p className="ui-featured-link group-hover:text-gui-hover font-light text-cool-black">
|
|
36
|
+
Using plain HTML
|
|
37
|
+
<Icon
|
|
38
|
+
name="icon-gui-link-arrow"
|
|
39
|
+
size="1rem"
|
|
40
|
+
color="text-cool-black"
|
|
41
|
+
additionalCSS="ui-featured-link-icon group-hover:text-gui-hover group-active:text-gui-active group-focus:text-gui-focus"
|
|
42
|
+
/>
|
|
43
|
+
</p>
|
|
44
|
+
</a>
|
|
45
|
+
</DropdownMenu.Content>
|
|
46
|
+
</DropdownMenu>
|
|
47
|
+
),
|
|
48
|
+
};
|
|
@@ -1,16 +1,52 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React, {
|
|
2
|
+
createContext,
|
|
3
|
+
useContext,
|
|
4
|
+
useState,
|
|
5
|
+
useEffect,
|
|
6
|
+
useRef,
|
|
7
|
+
ReactNode,
|
|
8
|
+
Dispatch,
|
|
9
|
+
} from "react";
|
|
10
|
+
import Icon from "../Icon/component.tsx";
|
|
11
|
+
|
|
12
|
+
const DropdownMenuContext = createContext<{
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
setOpen: Dispatch<React.SetStateAction<boolean>>;
|
|
15
|
+
}>({
|
|
16
|
+
isOpen: false,
|
|
17
|
+
setOpen: () => {},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
type DropdownMenuProps = {
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type TriggerProps = {
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
additionalTriggerCSS?: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
type ContentProps = {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
anchorPosition?: string;
|
|
32
|
+
additionalContentCSS?: string;
|
|
33
|
+
};
|
|
4
34
|
|
|
5
|
-
|
|
35
|
+
type LinkProps = {
|
|
36
|
+
url: string;
|
|
37
|
+
title: string;
|
|
38
|
+
subtitle: string;
|
|
39
|
+
iconName: string;
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
};
|
|
6
42
|
|
|
7
|
-
const DropdownMenu = ({ children }) => {
|
|
43
|
+
const DropdownMenu = ({ children }: DropdownMenuProps) => {
|
|
8
44
|
const [isOpen, setOpen] = useState(false);
|
|
9
|
-
const ref = useRef(null);
|
|
45
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
10
46
|
|
|
11
47
|
useEffect(() => {
|
|
12
48
|
const clickHandler = (e) => {
|
|
13
|
-
if (ref
|
|
49
|
+
if (ref.current?.contains(e.target)) return;
|
|
14
50
|
setOpen(false);
|
|
15
51
|
};
|
|
16
52
|
|
|
@@ -30,11 +66,7 @@ const DropdownMenu = ({ children }) => {
|
|
|
30
66
|
);
|
|
31
67
|
};
|
|
32
68
|
|
|
33
|
-
|
|
34
|
-
children: T.node,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const Trigger = ({ children, additionalTriggerCSS = "" }) => {
|
|
69
|
+
const Trigger = ({ children, additionalTriggerCSS = "" }: TriggerProps) => {
|
|
38
70
|
const { isOpen, setOpen } = useContext(DropdownMenuContext);
|
|
39
71
|
|
|
40
72
|
return (
|
|
@@ -54,19 +86,19 @@ const Trigger = ({ children, additionalTriggerCSS = "" }) => {
|
|
|
54
86
|
);
|
|
55
87
|
};
|
|
56
88
|
|
|
57
|
-
|
|
58
|
-
children
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const Content = ({ children, anchorPosition = "right", additionalContentCSS }) => {
|
|
89
|
+
const Content = ({
|
|
90
|
+
children,
|
|
91
|
+
anchorPosition = "right",
|
|
92
|
+
additionalContentCSS,
|
|
93
|
+
}: ContentProps) => {
|
|
63
94
|
const { isOpen } = useContext(DropdownMenuContext);
|
|
64
95
|
|
|
65
96
|
if (!isOpen) {
|
|
66
97
|
return null;
|
|
67
98
|
}
|
|
68
99
|
|
|
69
|
-
const anchorPositionClasses =
|
|
100
|
+
const anchorPositionClasses =
|
|
101
|
+
anchorPosition === "right" ? "right-0" : "left-0";
|
|
70
102
|
|
|
71
103
|
return (
|
|
72
104
|
<div
|
|
@@ -79,18 +111,22 @@ const Content = ({ children, anchorPosition = "right", additionalContentCSS }) =
|
|
|
79
111
|
);
|
|
80
112
|
};
|
|
81
113
|
|
|
82
|
-
|
|
83
|
-
children: T.node,
|
|
84
|
-
anchorPosition: T.string,
|
|
85
|
-
additionalContentCSS: T.string,
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const Link = ({ url, title, subtitle, iconName, children }) => {
|
|
114
|
+
const Link = ({ url, title, subtitle, iconName, children }: LinkProps) => {
|
|
89
115
|
return (
|
|
90
|
-
<a
|
|
116
|
+
<a
|
|
117
|
+
href={url}
|
|
118
|
+
className="menu-link group block p-8 hover:bg-light-grey hover:text-cool-black rounded"
|
|
119
|
+
>
|
|
91
120
|
<p className="mb-4">
|
|
92
121
|
{title}
|
|
93
|
-
{iconName ?
|
|
122
|
+
{iconName ? (
|
|
123
|
+
<Icon
|
|
124
|
+
name={iconName}
|
|
125
|
+
size="1rem"
|
|
126
|
+
color="text-cool-black"
|
|
127
|
+
additionalCSS="align-middle ml-8 relative -top-1 -left-4"
|
|
128
|
+
/>
|
|
129
|
+
) : null}
|
|
94
130
|
</p>
|
|
95
131
|
{subtitle ? <p className="ui-text-p3 mb-16">{subtitle}</p> : null}
|
|
96
132
|
{children}
|
|
@@ -98,14 +134,6 @@ const Link = ({ url, title, subtitle, iconName, children }) => {
|
|
|
98
134
|
);
|
|
99
135
|
};
|
|
100
136
|
|
|
101
|
-
Link.propTypes = {
|
|
102
|
-
url: T.string,
|
|
103
|
-
title: T.string,
|
|
104
|
-
subtitle: T.string,
|
|
105
|
-
iconName: T.string,
|
|
106
|
-
children: T.node,
|
|
107
|
-
};
|
|
108
|
-
|
|
109
137
|
DropdownMenu.Trigger = Trigger;
|
|
110
138
|
DropdownMenu.Content = Content;
|
|
111
139
|
DropdownMenu.Link = Link;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import FeaturedLink from "./component.tsx";
|
|
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 "../Icon/component.
|
|
3
|
+
import Icon from "../Icon/component.tsx";
|
|
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;
|