@ably/ui 14.0.4 → 14.0.6
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/core/Flash.js +1 -1
- package/core/styles/forms.css +4 -4
- package/core/styles/toggles.css +38 -0
- package/core/styles.components.css +1 -0
- package/package.json +15 -18
- package/tailwind.config.js +3 -0
- package/src/core/Accordion/Accordion.stories.tsx +0 -39
- package/src/core/Accordion.tsx +0 -149
- package/src/core/Code/Code.stories.tsx +0 -71
- package/src/core/Code/component.css +0 -1
- package/src/core/Code/component.js +0 -27
- package/src/core/Code.tsx +0 -44
- package/src/core/ConnectStateWrapper.tsx +0 -43
- package/src/core/ContactFooter/ContactFooter.stories.tsx +0 -11
- package/src/core/ContactFooter/component.css +0 -11
- package/src/core/ContactFooter/component.js +0 -2
- package/src/core/ContactFooter.tsx +0 -91
- package/src/core/CookieMessage/CookieMessage.stories.tsx +0 -12
- package/src/core/CookieMessage/component.css +0 -15
- package/src/core/CookieMessage.tsx +0 -52
- package/src/core/CustomerLogos/CustomerLogos.stories.tsx +0 -43
- package/src/core/CustomerLogos.tsx +0 -35
- package/src/core/DropdownMenu/DropdownMenu.stories.tsx +0 -48
- package/src/core/DropdownMenu.tsx +0 -140
- package/src/core/Expander/Expander.stories.tsx +0 -132
- package/src/core/Expander.tsx +0 -63
- package/src/core/FeaturedLink/FeaturedLink.stories.tsx +0 -43
- package/src/core/FeaturedLink.tsx +0 -93
- package/src/core/Flash/Flash.stories.tsx +0 -37
- package/src/core/Flash/component.css +0 -28
- package/src/core/Flash.tsx +0 -233
- package/src/core/Footer/Footer.stories.tsx +0 -26
- package/src/core/Footer/component.css +0 -33
- package/src/core/Footer.tsx +0 -535
- package/src/core/Icon/Icon.stories.tsx +0 -151
- package/src/core/Icon.tsx +0 -26
- package/src/core/Loader/Loader.stories.tsx +0 -21
- package/src/core/Loader.tsx +0 -52
- package/src/core/Logo/Logo.stories.tsx +0 -12
- package/src/core/Logo.tsx +0 -29
- package/src/core/Meganav/Meganav.stories.tsx +0 -86
- package/src/core/Meganav/component.css +0 -114
- package/src/core/Meganav/component.js +0 -150
- package/src/core/Meganav/component.json +0 -37
- package/src/core/Meganav.tsx +0 -225
- package/src/core/MeganavBlogPostsList/component.js +0 -43
- package/src/core/MeganavBlogPostsList.tsx +0 -41
- package/src/core/MeganavContentCompany.tsx +0 -166
- package/src/core/MeganavContentDevelopers.tsx +0 -210
- package/src/core/MeganavContentProducts.tsx +0 -163
- package/src/core/MeganavContentUseCases.tsx +0 -244
- package/src/core/MeganavControl/component.js +0 -117
- package/src/core/MeganavControl.tsx +0 -39
- package/src/core/MeganavControlMobileDropdown/component.js +0 -46
- package/src/core/MeganavControlMobileDropdown.tsx +0 -31
- package/src/core/MeganavControlMobilePanelClose/component.js +0 -36
- package/src/core/MeganavControlMobilePanelClose.tsx +0 -34
- package/src/core/MeganavControlMobilePanelOpen/component.js +0 -59
- package/src/core/MeganavControlMobilePanelOpen.tsx +0 -31
- package/src/core/MeganavItemsDesktop.tsx +0 -68
- package/src/core/MeganavItemsMobile.tsx +0 -197
- package/src/core/MeganavItemsSignedIn.tsx +0 -130
- package/src/core/MeganavSearch.tsx +0 -36
- package/src/core/MeganavSearchAutocomplete/component.js +0 -177
- package/src/core/MeganavSearchAutocomplete.tsx +0 -12
- package/src/core/MeganavSearchPanel.tsx +0 -52
- package/src/core/MeganavSearchSuggestions/component.js +0 -133
- package/src/core/MeganavSearchSuggestions.tsx +0 -62
- package/src/core/Notice/component.css +0 -7
- package/src/core/Notice/component.js +0 -154
- package/src/core/Notice.tsx +0 -102
- package/src/core/SignOutLink.tsx +0 -51
- package/src/core/Slider/Slider.stories.tsx +0 -98
- package/src/core/Slider/component.css +0 -40
- package/src/core/Slider/component.js +0 -105
- package/src/core/Slider.tsx +0 -224
- package/src/core/Table/Table.stories.tsx +0 -12
- package/src/core/Table/Table.tsx +0 -58
- package/src/core/Table/TableCell.tsx +0 -71
- package/src/core/Table/TableRow.tsx +0 -25
- package/src/core/Table/data.tsx +0 -133
- package/src/core/Table.tsx +0 -15
- package/src/core/Tooltip/Tooltip.stories.tsx +0 -27
- package/src/core/Tooltip.tsx +0 -88
- package/src/core/css.js +0 -3
- package/src/core/dom-query.js +0 -5
- package/src/core/fonts/NEXT-Book-Light-Italic.eot +0 -0
- package/src/core/fonts/NEXT-Book-Light-Italic.otf +0 -0
- package/src/core/fonts/NEXT-Book-Light-Italic.woff +0 -0
- package/src/core/fonts/NEXT-Book-Light-Italic.woff2 +0 -0
- package/src/core/fonts/NEXT-Book-Light.eot +0 -0
- package/src/core/fonts/NEXT-Book-Light.otf +0 -0
- package/src/core/fonts/NEXT-Book-Light.woff +0 -0
- package/src/core/fonts/NEXT-Book-Light.woff2 +0 -0
- package/src/core/fonts/NEXT-Book-Medium-Italic.eot +0 -0
- package/src/core/fonts/NEXT-Book-Medium-Italic.otf +0 -0
- package/src/core/fonts/NEXT-Book-Medium-Italic.woff +0 -0
- package/src/core/fonts/NEXT-Book-Medium-Italic.woff2 +0 -0
- package/src/core/fonts/NEXT-Book-Medium.eot +0 -0
- package/src/core/fonts/NEXT-Book-Medium.otf +0 -0
- package/src/core/fonts/NEXT-Book-Medium.woff +0 -0
- package/src/core/fonts/NEXT-Book-Medium.woff2 +0 -0
- package/src/core/fonts/jetBrains-mono.css +0 -3
- package/src/core/fonts/manrope.css +0 -3
- package/src/core/fonts/next.css +0 -63
- package/src/core/fonts/source-code-pro.css +0 -3
- package/src/core/hubspot-chat-toggle.js +0 -67
- package/src/core/icons/discord.svg +0 -10
- package/src/core/icons/facebook.svg +0 -4
- package/src/core/icons/github.svg +0 -3
- package/src/core/icons/glassdoor.svg +0 -3
- package/src/core/icons/google.svg +0 -3
- package/src/core/icons/icon-display-48hrs.svg +0 -3
- package/src/core/icons/icon-display-about-ably-col.svg +0 -4
- package/src/core/icons/icon-display-api-keys.svg +0 -3
- package/src/core/icons/icon-display-api.svg +0 -3
- package/src/core/icons/icon-display-asset-tracking-col.svg +0 -18
- package/src/core/icons/icon-display-browser.svg +0 -10
- package/src/core/icons/icon-display-calendar.svg +0 -3
- package/src/core/icons/icon-display-call-mobile.svg +0 -3
- package/src/core/icons/icon-display-careers-col.svg +0 -9
- package/src/core/icons/icon-display-case-studies-col.svg +0 -5
- package/src/core/icons/icon-display-chat-col.svg +0 -4
- package/src/core/icons/icon-display-chat-stack-col.svg +0 -4
- package/src/core/icons/icon-display-chat-stack.svg +0 -4
- package/src/core/icons/icon-display-cloud-servers.svg +0 -3
- package/src/core/icons/icon-display-compare-tech-col.svg +0 -9
- package/src/core/icons/icon-display-customers-col.svg +0 -15
- package/src/core/icons/icon-display-data-broadcast-col.svg +0 -26
- package/src/core/icons/icon-display-data-synchronization-col.svg +0 -14
- package/src/core/icons/icon-display-docs-col.svg +0 -7
- package/src/core/icons/icon-display-documentation.svg +0 -3
- package/src/core/icons/icon-display-events-col.svg +0 -13
- package/src/core/icons/icon-display-examples-col.svg +0 -11
- package/src/core/icons/icon-display-gdpr.svg +0 -3
- package/src/core/icons/icon-display-general-comms.svg +0 -3
- package/src/core/icons/icon-display-hipaa.svg +0 -10
- package/src/core/icons/icon-display-integrations-col.svg +0 -8
- package/src/core/icons/icon-display-it-support-access.svg +0 -3
- package/src/core/icons/icon-display-it-support-helpdesk.svg +0 -3
- package/src/core/icons/icon-display-kafka-at-the-edge-col.svg +0 -8
- package/src/core/icons/icon-display-laptop.svg +0 -10
- package/src/core/icons/icon-display-lightbulb-col.svg +0 -10
- package/src/core/icons/icon-display-live-chat.svg +0 -3
- package/src/core/icons/icon-display-map-pin.svg +0 -3
- package/src/core/icons/icon-display-message.svg +0 -3
- package/src/core/icons/icon-display-padlock-closed.svg +0 -3
- package/src/core/icons/icon-display-platform.svg +0 -22
- package/src/core/icons/icon-display-play.svg +0 -3
- package/src/core/icons/icon-display-privacy-shield-framework.svg +0 -7
- package/src/core/icons/icon-display-push-notifications-col.svg +0 -6
- package/src/core/icons/icon-display-quickstart-guides-col.svg +0 -8
- package/src/core/icons/icon-display-resources-col.svg +0 -21
- package/src/core/icons/icon-display-sdks-col.svg +0 -11
- package/src/core/icons/icon-display-servers.svg +0 -3
- package/src/core/icons/icon-display-shopping-cart.svg +0 -10
- package/src/core/icons/icon-display-sla.svg +0 -3
- package/src/core/icons/icon-display-soc2-type2.svg +0 -3
- package/src/core/icons/icon-display-tech-account-comms.svg +0 -3
- package/src/core/icons/icon-display-tutorials-demos-col.svg +0 -25
- package/src/core/icons/icon-display-virtual-events-col.svg +0 -12
- package/src/core/icons/icon-display-virtual-events.svg +0 -12
- package/src/core/icons/icon-gui-ably-badge.svg +0 -3
- package/src/core/icons/icon-gui-arrow-bidirectional-horizontal.svg +0 -3
- package/src/core/icons/icon-gui-arrow-bidirectional-vertical.svg +0 -3
- package/src/core/icons/icon-gui-arrow-down.svg +0 -3
- package/src/core/icons/icon-gui-arrow-left.svg +0 -3
- package/src/core/icons/icon-gui-arrow-right.svg +0 -3
- package/src/core/icons/icon-gui-arrow-up.svg +0 -3
- package/src/core/icons/icon-gui-burger-menu.svg +0 -5
- package/src/core/icons/icon-gui-check-circled-fill-black.svg +0 -4
- package/src/core/icons/icon-gui-check-circled-fill.svg +0 -4
- package/src/core/icons/icon-gui-check-circled.svg +0 -3
- package/src/core/icons/icon-gui-checklist-checked.svg +0 -3
- package/src/core/icons/icon-gui-clock.svg +0 -3
- package/src/core/icons/icon-gui-close.svg +0 -3
- package/src/core/icons/icon-gui-copy.svg +0 -10
- package/src/core/icons/icon-gui-cross-circled-fill.svg +0 -4
- package/src/core/icons/icon-gui-cross-circled.svg +0 -3
- package/src/core/icons/icon-gui-dash-circled.svg +0 -3
- package/src/core/icons/icon-gui-disclosure-arrow.svg +0 -3
- package/src/core/icons/icon-gui-document-generic.svg +0 -3
- package/src/core/icons/icon-gui-enlarge.svg +0 -3
- package/src/core/icons/icon-gui-external-link.svg +0 -3
- package/src/core/icons/icon-gui-filter-flow-step-1.svg +0 -5
- package/src/core/icons/icon-gui-filter-flow-step-2.svg +0 -5
- package/src/core/icons/icon-gui-filter-flow-step-3.svg +0 -5
- package/src/core/icons/icon-gui-history.svg +0 -3
- package/src/core/icons/icon-gui-info.svg +0 -3
- package/src/core/icons/icon-gui-link-arrow.svg +0 -3
- package/src/core/icons/icon-gui-link.svg +0 -4
- package/src/core/icons/icon-gui-live-chat.svg +0 -3
- package/src/core/icons/icon-gui-minus.svg +0 -3
- package/src/core/icons/icon-gui-partial.svg +0 -4
- package/src/core/icons/icon-gui-plus.svg +0 -3
- package/src/core/icons/icon-gui-quote-marks-solid.svg +0 -3
- package/src/core/icons/icon-gui-refresh.svg +0 -10
- package/src/core/icons/icon-gui-resources.svg +0 -3
- package/src/core/icons/icon-gui-search.svg +0 -3
- package/src/core/icons/icon-gui-tick.svg +0 -3
- package/src/core/icons/icon-gui-warning.svg +0 -5
- package/src/core/icons/icon-live-updates-results-metrics-col.svg +0 -26
- package/src/core/icons/icon-multi-user-spaces-col.svg +0 -13
- package/src/core/icons/icon-social-x.svg +0 -3
- package/src/core/icons/icon-tech-apachekafka.svg +0 -3
- package/src/core/icons/linkedin.svg +0 -3
- package/src/core/icons/quote.svg +0 -3
- package/src/core/icons/stackoverflow.svg +0 -3
- package/src/core/icons/twitter.svg +0 -3
- package/src/core/icons/youtube.svg +0 -11
- package/src/core/icons.js +0 -6
- package/src/core/images/ably-logo.png +0 -0
- package/src/core/images/ably-logo.svg +0 -15
- package/src/core/images/ably-stack.svg +0 -14
- package/src/core/images/best-support-2023.svg +0 -1
- package/src/core/images/cust-logo-ao-col-pos.png +0 -0
- package/src/core/images/cust-logo-ao-col-pos@2x.png +0 -0
- package/src/core/images/cust-logo-ausopen-col-pos.png +0 -0
- package/src/core/images/cust-logo-ausopen-col-pos@2x.png +0 -0
- package/src/core/images/cust-logo-ausopen-mono-pos.svg +0 -5
- package/src/core/images/cust-logo-bloomberg-mono-pos.svg +0 -11
- package/src/core/images/cust-logo-hopin-mono-pos.svg +0 -4
- package/src/core/images/cust-logo-hubspot-col-pos.png +0 -0
- package/src/core/images/cust-logo-hubspot-col-pos@2x.png +0 -0
- package/src/core/images/cust-logo-hubspot-mono-pos.svg +0 -4
- package/src/core/images/cust-logo-lightspeed-col-pos.png +0 -0
- package/src/core/images/cust-logo-lightspeed-col-pos@2x.png +0 -0
- package/src/core/images/cust-logo-lightspeed-syst-col-pos.png +0 -0
- package/src/core/images/cust-logo-lightspeed-syst-col-pos@2x.png +0 -0
- package/src/core/images/cust-logo-mentimeter-mono-pos.svg +0 -17
- package/src/core/images/cust-logo-split-col-pos.png +0 -0
- package/src/core/images/cust-logo-split-col-pos@2x.png +0 -0
- package/src/core/images/cust-logo-split-mono-pos.svg +0 -9
- package/src/core/images/cust-logo-toyota-mono-pos.svg +0 -18
- package/src/core/images/cust-logo-vitac-col-pos.png +0 -0
- package/src/core/images/cust-logo-vitac-col-pos@2x.png +0 -0
- package/src/core/images/cust-logo-webflow-col-pos.svg +0 -3
- package/src/core/images/cust-photo-hubspot-max-freiert.jpg +0 -0
- package/src/core/images/cust-photo-split-pato-echague.jpg +0 -0
- package/src/core/images/cust-photo-vitac-joe-antonio.jpg +0 -0
- package/src/core/images/fastest-implementation-2023.svg +0 -1
- package/src/core/images/flexible-companies.png +0 -0
- package/src/core/images/high-performer-2022.png +0 -0
- package/src/core/images/high-performer-2023.svg +0 -1
- package/src/core/images/highest-user-adoption-2022.png +0 -0
- package/src/core/images/highest-user-adoption-2023.svg +0 -1
- package/src/core/images/icon-tech-aws.svg +0 -4
- package/src/core/images/rocket-list-2021.png +0 -0
- package/src/core/images/scale-motif-open-empathetic.svg +0 -1
- package/src/core/images/technical-support-01-800x533.jpg +0 -0
- package/src/core/images/users-love-us-2022.png +0 -0
- package/src/core/load-sprites.js +0 -11
- package/src/core/react-renderer.tsx +0 -29
- package/src/core/remote-blogs-posts.js +0 -42
- package/src/core/remote-data-store.js +0 -34
- package/src/core/remote-data-util.js +0 -4
- package/src/core/remote-session-data.js +0 -58
- package/src/core/scripts.js +0 -10
- package/src/core/styles/buttons.css +0 -124
- package/src/core/styles/forms.css +0 -64
- package/src/core/styles/layout.css +0 -21
- package/src/core/styles/properties.css +0 -278
- package/src/core/styles/text.css +0 -168
- package/src/core/styles.base.css +0 -1
- package/src/core/styles.components.css +0 -43
- package/src/core/styles.css +0 -2
- package/src/core/url-base.js +0 -7
- package/src/core/utils/syntax-highlighter-registry.js +0 -63
- package/src/core/utils/syntax-highlighter.css +0 -71
- package/src/core/utils/syntax-highlighter.js +0 -103
- package/src/pages/Buttons.mdx +0 -121
- package/src/pages/Chips.mdx +0 -136
- package/src/pages/Colour.mdx +0 -23
- package/src/pages/Forms.mdx +0 -173
- package/src/pages/Layout.mdx +0 -58
- package/src/pages/Typography.mdx +0 -206
- package/src/pages/utils.ts +0 -70
- package/src/reset/scripts.js +0 -1
- package/src/reset/styles/normalize.css +0 -353
- package/src/reset/styles/reset.css +0 -139
- package/src/reset/styles.css +0 -2
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Flash, { reducerFlashes } from "../Flash";
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
attachStoreToWindow,
|
|
6
|
-
createRemoteDataStore,
|
|
7
|
-
} from "../remote-data-store.js";
|
|
8
|
-
import { reducerBlogPosts } from "../remote-blogs-posts.js";
|
|
9
|
-
import { reducerSessionData } from "../remote-session-data.js";
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
title: "Components/Flash",
|
|
13
|
-
component: Flash,
|
|
14
|
-
args: {
|
|
15
|
-
flashes: [
|
|
16
|
-
["success", "Congratulations! You've won the Oscar"],
|
|
17
|
-
["notice", "This is a notice"],
|
|
18
|
-
["error", "This is an error, very bad"],
|
|
19
|
-
["alert", "This is an alert"],
|
|
20
|
-
["info", "Some useful information, you are welcome"],
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Default = {
|
|
26
|
-
render: (args) => {
|
|
27
|
-
const store = createRemoteDataStore({
|
|
28
|
-
...reducerBlogPosts,
|
|
29
|
-
...reducerSessionData,
|
|
30
|
-
...reducerFlashes,
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
attachStoreToWindow(store);
|
|
34
|
-
|
|
35
|
-
return <Flash {...args} />;
|
|
36
|
-
},
|
|
37
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
@layer components {
|
|
2
|
-
.ui-flash {
|
|
3
|
-
@apply w-full fixed;
|
|
4
|
-
top: 5.5rem;
|
|
5
|
-
z-index: calc(var(--stacking-context-page-meganav) - 10);
|
|
6
|
-
transition: margin-top 200ms;
|
|
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:
|
|
12
|
-
opacity 200ms,
|
|
13
|
-
transform 200ms,
|
|
14
|
-
height 200ms 200ms,
|
|
15
|
-
margin-top 200ms 200ms;
|
|
16
|
-
transform: translateY(-200%) rotateX(-90deg);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/* dynamic content inside flash, can't add classes */
|
|
20
|
-
.ui-flash-text a {
|
|
21
|
-
@apply underline;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.ui-flash-message-enter {
|
|
25
|
-
@apply opacity-100;
|
|
26
|
-
transform: translateY(0) rotateX(0);
|
|
27
|
-
}
|
|
28
|
-
}
|
package/src/core/Flash.tsx
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState, useRef } from "react";
|
|
2
|
-
import DOMPurify from "dompurify";
|
|
3
|
-
import { nanoid } from "nanoid/non-secure";
|
|
4
|
-
|
|
5
|
-
import { getRemoteDataStore } from "./remote-data-store.js";
|
|
6
|
-
import ConnectStateWrapper from "./ConnectStateWrapper";
|
|
7
|
-
import Icon from "./Icon";
|
|
8
|
-
|
|
9
|
-
type FlashProps = {
|
|
10
|
-
id: string;
|
|
11
|
-
removed: boolean;
|
|
12
|
-
type: "error" | "success" | "notice" | "info" | "alert";
|
|
13
|
-
content: string;
|
|
14
|
-
removeFlash: (id: string) => void;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
type FlashesProps = {
|
|
18
|
-
flashes: { items: FlashProps[] };
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
type BackendFlashesProps = {
|
|
22
|
-
flashes: string[][];
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const REDUCER_KEY = "flashes";
|
|
26
|
-
const FLASH_DATA_ID = "ui-flashes";
|
|
27
|
-
|
|
28
|
-
const initialState = { items: [] };
|
|
29
|
-
|
|
30
|
-
const reducerFlashes = {
|
|
31
|
-
[REDUCER_KEY]: (state = initialState, action) => {
|
|
32
|
-
switch (action.type) {
|
|
33
|
-
case "flash/push": {
|
|
34
|
-
const flashes = Array.isArray(action.payload)
|
|
35
|
-
? action.payload
|
|
36
|
-
: [action.payload];
|
|
37
|
-
return { items: [...state.items, ...flashes] };
|
|
38
|
-
}
|
|
39
|
-
default:
|
|
40
|
-
return state;
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const selectFlashes = (store) => store.getState()[REDUCER_KEY];
|
|
46
|
-
|
|
47
|
-
const FLASH_BG_COLOR = {
|
|
48
|
-
error: "bg-gui-error",
|
|
49
|
-
success: "bg-zingy-green",
|
|
50
|
-
notice: "bg-electric-cyan",
|
|
51
|
-
info: "bg-electric-cyan",
|
|
52
|
-
alert: "bg-active-orange",
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const FLASH_TEXT_COLOR = {
|
|
56
|
-
error: "text-white",
|
|
57
|
-
success: "text-cool-black",
|
|
58
|
-
notice: "text-cool-black",
|
|
59
|
-
info: "text-cool-black",
|
|
60
|
-
alert: "text-white",
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const AUTO_HIDE = ["success", "info", "notice"];
|
|
64
|
-
const AUTO_HIDE_TIME = 8000;
|
|
65
|
-
|
|
66
|
-
const useAutoHide = (type, closeFlash) => {
|
|
67
|
-
const timeoutId = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
68
|
-
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
if (AUTO_HIDE.includes(type)) {
|
|
71
|
-
timeoutId.current = setTimeout(() => {
|
|
72
|
-
closeFlash();
|
|
73
|
-
}, AUTO_HIDE_TIME);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return () => {
|
|
77
|
-
if (timeoutId.current) {
|
|
78
|
-
clearTimeout(timeoutId.current);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
}, []);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const Flash = ({ id, type, content, removeFlash }: FlashProps) => {
|
|
85
|
-
const ref = useRef<HTMLDivElement>(null);
|
|
86
|
-
const [closed, setClosed] = useState(false);
|
|
87
|
-
const [flashHeight, setFlashHeight] = useState(0);
|
|
88
|
-
const [triggerEntryAnimation, setTriggerEntryAnimation] = useState(false);
|
|
89
|
-
|
|
90
|
-
const closeFlash = () => {
|
|
91
|
-
if (ref.current) {
|
|
92
|
-
setFlashHeight(ref.current.getBoundingClientRect().height);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
setClosed(true);
|
|
96
|
-
|
|
97
|
-
setTimeout(() => {
|
|
98
|
-
id && removeFlash(id);
|
|
99
|
-
}, 100);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
useEffect(() => setTriggerEntryAnimation(true), []);
|
|
103
|
-
useAutoHide(type, closeFlash);
|
|
104
|
-
|
|
105
|
-
const animateEntry = triggerEntryAnimation && !closed;
|
|
106
|
-
|
|
107
|
-
let style;
|
|
108
|
-
|
|
109
|
-
if (flashHeight && !closed) {
|
|
110
|
-
style = { height: `${flashHeight}px` };
|
|
111
|
-
} else if (closed) {
|
|
112
|
-
style = { height: 0, marginTop: 0, zIndex: -1 };
|
|
113
|
-
} else {
|
|
114
|
-
style = {};
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const safeContent = DOMPurify.sanitize(content, {
|
|
118
|
-
ALLOWED_TAGS: ["a"],
|
|
119
|
-
ALLOWED_ATTR: ["href", "data-method", "rel"],
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
const withIcons = {
|
|
123
|
-
notice: "icon-gui-ably-badge",
|
|
124
|
-
success: "icon-gui-tick",
|
|
125
|
-
error: "icon-gui-warning",
|
|
126
|
-
alert: "icon-gui-warning",
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
const iconColor = {
|
|
130
|
-
notice: "text-cool-black",
|
|
131
|
-
success: "text-cool-black",
|
|
132
|
-
error: "text-white",
|
|
133
|
-
alert: "text-white",
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
return (
|
|
137
|
-
<div
|
|
138
|
-
className={`ui-flash-message ui-grid-px ${
|
|
139
|
-
animateEntry ? "ui-flash-message-enter" : ""
|
|
140
|
-
}`}
|
|
141
|
-
style={style}
|
|
142
|
-
ref={ref}
|
|
143
|
-
data-id="ui-flash"
|
|
144
|
-
>
|
|
145
|
-
<div
|
|
146
|
-
className={`${FLASH_BG_COLOR[type]} p-32 flex align-center rounded shadow-container-subtle`}
|
|
147
|
-
>
|
|
148
|
-
{withIcons[type] && (
|
|
149
|
-
<Icon
|
|
150
|
-
name={withIcons[type]}
|
|
151
|
-
color={iconColor[type]}
|
|
152
|
-
size="1.5rem"
|
|
153
|
-
additionalCSS="mr-16 self-baseline"
|
|
154
|
-
/>
|
|
155
|
-
)}
|
|
156
|
-
<p
|
|
157
|
-
className={`ui-text-p1 mr-16 ${FLASH_TEXT_COLOR[type]}`}
|
|
158
|
-
dangerouslySetInnerHTML={{ __html: safeContent }}
|
|
159
|
-
/>
|
|
160
|
-
<button
|
|
161
|
-
type="button"
|
|
162
|
-
className="p-0 ml-auto self-start focus:outline-none"
|
|
163
|
-
onClick={closeFlash}
|
|
164
|
-
>
|
|
165
|
-
<Icon
|
|
166
|
-
name="icon-gui-close"
|
|
167
|
-
color={iconColor[type]}
|
|
168
|
-
size="1.5rem"
|
|
169
|
-
additionalCSS="transition-colors"
|
|
170
|
-
/>
|
|
171
|
-
</button>
|
|
172
|
-
</div>
|
|
173
|
-
</div>
|
|
174
|
-
);
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
const Flashes = ({ flashes }: FlashesProps) => {
|
|
178
|
-
const [flashesWithIds, setFlashesWithIds] = useState<FlashProps[]>([]);
|
|
179
|
-
|
|
180
|
-
const removeFlash = (flashId) =>
|
|
181
|
-
setFlashesWithIds((items) => items.filter((item) => item.id !== flashId));
|
|
182
|
-
|
|
183
|
-
useEffect(() => {
|
|
184
|
-
setFlashesWithIds((state) => {
|
|
185
|
-
return [
|
|
186
|
-
...state,
|
|
187
|
-
...(flashes?.items).map((flash) => ({
|
|
188
|
-
...flash,
|
|
189
|
-
id: nanoid(),
|
|
190
|
-
removed: false,
|
|
191
|
-
})),
|
|
192
|
-
];
|
|
193
|
-
});
|
|
194
|
-
}, [flashes]);
|
|
195
|
-
|
|
196
|
-
return (
|
|
197
|
-
<div className="ui-flash" data-id={FLASH_DATA_ID}>
|
|
198
|
-
{flashesWithIds
|
|
199
|
-
.filter((item) => !item.removed)
|
|
200
|
-
.map((flash) => (
|
|
201
|
-
<Flash key={flash.id} {...flash} removeFlash={removeFlash} />
|
|
202
|
-
))}
|
|
203
|
-
</div>
|
|
204
|
-
);
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
const BackendFlashes = ({ flashes }: BackendFlashesProps) => {
|
|
208
|
-
useEffect(() => {
|
|
209
|
-
const transformedFlashes =
|
|
210
|
-
flashes.map((flash) => {
|
|
211
|
-
const [type, content] = flash;
|
|
212
|
-
return { type, content };
|
|
213
|
-
}) || [];
|
|
214
|
-
|
|
215
|
-
if (transformedFlashes.length > 0) {
|
|
216
|
-
const store = getRemoteDataStore();
|
|
217
|
-
|
|
218
|
-
store.dispatch({
|
|
219
|
-
type: "flash/push",
|
|
220
|
-
payload: transformedFlashes,
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
}, []);
|
|
224
|
-
|
|
225
|
-
const WrappedFlashes = ConnectStateWrapper(Flashes, {
|
|
226
|
-
flashes: selectFlashes,
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
return <WrappedFlashes />;
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
export { reducerFlashes, FLASH_DATA_ID, Flashes };
|
|
233
|
-
export default BackendFlashes;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import Footer from "../Footer";
|
|
2
|
-
|
|
3
|
-
import ablyStack from "../images/ably-stack.svg";
|
|
4
|
-
import highestPerformer from "../images/high-performer-2023.svg";
|
|
5
|
-
import bestSupport from "../images/best-support-2023.svg";
|
|
6
|
-
import fastestImplementation from "../images/fastest-implementation-2023.svg";
|
|
7
|
-
import highestUserAdoption from "../images/highest-user-adoption-2023.svg";
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: "Components/Footer",
|
|
11
|
-
component: Footer,
|
|
12
|
-
parameters: {
|
|
13
|
-
layout: "fullscreen",
|
|
14
|
-
},
|
|
15
|
-
args: {
|
|
16
|
-
paths: {
|
|
17
|
-
ablyStack,
|
|
18
|
-
highestPerformer,
|
|
19
|
-
bestSupport,
|
|
20
|
-
fastestImplementation,
|
|
21
|
-
highestUserAdoption,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const Default = {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
@layer components {
|
|
2
|
-
.ui-footer-col-title {
|
|
3
|
-
@apply font-mono text-overline2 p-menu-row-title font-medium uppercase tracking-widen-0.16;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.ui-footer-menu-row-link {
|
|
7
|
-
@apply text-menu3 text-cool-black font-sans font-medium hover:text-gui-hover block;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.ui-footer-link {
|
|
11
|
-
@apply text-gui-default hover:text-gui-hover text-menu3 font-sans font-medium;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.ui-footer-compliance-text {
|
|
15
|
-
font-size: 12px;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.ui-footer-tick-icon {
|
|
19
|
-
min-width: 1.5rem;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@media (max-width: 1040px) {
|
|
23
|
-
.ui-footer-bottom-links {
|
|
24
|
-
@apply pb-40;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@media screen {
|
|
29
|
-
.ui-footer-glassdoor {
|
|
30
|
-
display: none;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|