@ably/ui 15.2.0 → 15.2.1-dev.f94d58d
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/Notice.js +1 -1
- package/core/styles/colors/computed-colors.json +1 -0
- package/index.d.ts +11 -18
- package/package.json +12 -12
package/core/Notice.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import React,{useEffect}from"react";import NoticeScripts from"./Notice/component.js";import Icon from"./Icon";const contentWrapperClasses="w-full pr-8 ui-text-p3 self-center";const ContentWrapper=({buttonLink,children})=>buttonLink?React.createElement("a",{href:buttonLink,className:contentWrapperClasses},children):React.createElement("div",{className:contentWrapperClasses},children);const Notice=({buttonLink,buttonLabel,bodyText,title,config,closeBtn,bgColor="bg-gradient-active-orange",textColor="text-white"})=>{useEffect(()=>{NoticeScripts({bannerContainer:document.querySelector('[data-id="ui-notice"]'),cookieId:config?.cookieId,noticeId:config?.noticeId,options:{collapse:config?.collapse||false}})},[]);const wrapperClasses=["ui-announcement",bgColor,textColor].join(" ");return React.createElement("div",{className:wrapperClasses,"data-id":"ui-notice",style:{maxHeight:0,overflow:"hidden"}},React.createElement("div",{className:"ui-grid-px py-16 max-w-screen-xl mx-auto flex items-start"},React.createElement(ContentWrapper,{buttonLink:buttonLink??"#"},React.createElement("strong",{className:"font-bold whitespace-nowrap pr-4"},title),React.createElement("span",{className:"pr-4"
|
|
1
|
+
import React,{useEffect}from"react";import DOMPurify from"dompurify";import NoticeScripts from"./Notice/component.js";import Icon from"./Icon";const contentWrapperClasses="w-full pr-8 ui-text-p3 self-center";const ContentWrapper=({buttonLink,children})=>buttonLink?React.createElement("a",{href:buttonLink,className:contentWrapperClasses},children):React.createElement("div",{className:contentWrapperClasses},children);const Notice=({buttonLink,buttonLabel,bodyText="",title,config,closeBtn,bgColor="bg-gradient-active-orange",textColor="text-white"})=>{useEffect(()=>{NoticeScripts({bannerContainer:document.querySelector('[data-id="ui-notice"]'),cookieId:config?.cookieId,noticeId:config?.noticeId,options:{collapse:config?.collapse||false}})},[]);const wrapperClasses=["ui-announcement",bgColor,textColor].join(" ");const safeContent=DOMPurify.sanitize(bodyText,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href","data-method","rel"]});return React.createElement("div",{className:wrapperClasses,"data-id":"ui-notice",style:{maxHeight:0,overflow:"hidden"}},React.createElement("div",{className:"ui-grid-px py-16 max-w-screen-xl mx-auto flex items-start"},React.createElement(ContentWrapper,{buttonLink:buttonLink??"#"},React.createElement("strong",{className:"font-bold whitespace-nowrap pr-4"},title),React.createElement("span",{className:"pr-4",dangerouslySetInnerHTML:{__html:DOMPurify.sanitize(safeContent)}}),buttonLabel&&React.createElement("span",{className:"underline cursor-pointer whitespace-nowrap"},buttonLabel)),closeBtn&&React.createElement("button",{type:"button",className:"ml-auto h-20 w-20 border-none bg-none self-baseline"},React.createElement(Icon,{name:"icon-gui-close",size:"1.25rem",color:"text-cool-black"}))))};export default Notice;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["bg-blue-400","bg-blue-100","bg-neutral-1300","bg-neutral-300","bg-neutral-200","bg-neutral-100","bg-neutral-000","bg-neutral-600","bg-orange-900","bg-orange-600","border-blue-400","border-neutral-200","border-neutral-600","border-neutral-500","border-orange-600","from-neutral-400","group-hover:bg-neutral-100","text-blue-600","text-blue-200","text-neutral-1300","text-neutral-300","text-neutral-000","text-neutral-1100","text-neutral-1000","text-neutral-800","text-neutral-700","text-neutral-600","text-neutral-500","text-orange-200","text-orange-600"]
|
package/index.d.ts
CHANGED
|
@@ -551,6 +551,7 @@ export default function Meganav({ themeName, addSearchApiKey }: {
|
|
|
551
551
|
|
|
552
552
|
declare module '@ably/ui/core/Meganav' {
|
|
553
553
|
import { ReactNode } from "react";
|
|
554
|
+
import type { NoticeProps } from "@ably/ui/core/Notice";
|
|
554
555
|
import { ColorClass } from "@ably/ui/core/styles/colors/types";
|
|
555
556
|
export type MeganavTheme = {
|
|
556
557
|
backgroundColor?: ColorClass;
|
|
@@ -566,9 +567,6 @@ export type MeganavPaths = {
|
|
|
566
567
|
logo: string;
|
|
567
568
|
iconSprites: string;
|
|
568
569
|
ablyStack: string;
|
|
569
|
-
blogThumb1: string;
|
|
570
|
-
blogThumb2: string;
|
|
571
|
-
blogThumb3: string;
|
|
572
570
|
awsLogo?: string;
|
|
573
571
|
};
|
|
574
572
|
export type MeganavPanels = {
|
|
@@ -603,23 +601,18 @@ export type MeganavSessionState = {
|
|
|
603
601
|
href: string;
|
|
604
602
|
};
|
|
605
603
|
};
|
|
604
|
+
export type NoticeApiProps = {
|
|
605
|
+
props: NoticeProps;
|
|
606
|
+
config: {
|
|
607
|
+
cookieId: string;
|
|
608
|
+
noticeId: string;
|
|
609
|
+
collapse: boolean;
|
|
610
|
+
};
|
|
611
|
+
};
|
|
606
612
|
type MeganavProps = {
|
|
607
613
|
paths?: MeganavPaths;
|
|
608
614
|
themeName: "white" | "black" | "transparentToWhite";
|
|
609
|
-
notice?:
|
|
610
|
-
props: {
|
|
611
|
-
title: string;
|
|
612
|
-
bodyText: string;
|
|
613
|
-
buttonLink: string;
|
|
614
|
-
buttonLabel: string;
|
|
615
|
-
closeBtn: boolean;
|
|
616
|
-
};
|
|
617
|
-
config: {
|
|
618
|
-
cookieId: string;
|
|
619
|
-
noticeId: string;
|
|
620
|
-
collapse: boolean;
|
|
621
|
-
};
|
|
622
|
-
};
|
|
615
|
+
notice?: NoticeApiProps;
|
|
623
616
|
loginLink?: string;
|
|
624
617
|
urlBase?: string;
|
|
625
618
|
addSearchApiKey: string;
|
|
@@ -883,7 +876,7 @@ function Notice({ bannerContainer, cookieId, noticeId, options }: {
|
|
|
883
876
|
}
|
|
884
877
|
|
|
885
878
|
declare module '@ably/ui/core/Notice' {
|
|
886
|
-
type NoticeProps = {
|
|
879
|
+
export type NoticeProps = {
|
|
887
880
|
buttonLink?: string;
|
|
888
881
|
buttonLabel?: string;
|
|
889
882
|
bodyText?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ably/ui",
|
|
3
|
-
"version": "15.2.
|
|
3
|
+
"version": "15.2.1-dev.f94d58d",
|
|
4
4
|
"description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"workerDirectory": "./public"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@storybook/addon-a11y": "^8.4.
|
|
23
|
-
"@storybook/addon-essentials": "^8.4.
|
|
24
|
-
"@storybook/addon-interactions": "^8.4.
|
|
25
|
-
"@storybook/addon-links": "^8.4.
|
|
26
|
-
"@storybook/blocks": "^8.4.
|
|
27
|
-
"@storybook/react-vite": "^8.4.
|
|
28
|
-
"@storybook/test": "^8.4.
|
|
22
|
+
"@storybook/addon-a11y": "^8.4.7",
|
|
23
|
+
"@storybook/addon-essentials": "^8.4.7",
|
|
24
|
+
"@storybook/addon-interactions": "^8.4.7",
|
|
25
|
+
"@storybook/addon-links": "^8.4.7",
|
|
26
|
+
"@storybook/blocks": "^8.4.7",
|
|
27
|
+
"@storybook/react-vite": "^8.4.7",
|
|
28
|
+
"@storybook/test": "^8.4.7",
|
|
29
29
|
"@storybook/test-runner": "^0.21.0",
|
|
30
|
-
"@swc/cli": "^0.
|
|
30
|
+
"@swc/cli": "^0.6.0",
|
|
31
31
|
"@swc/core": "^1.4.11",
|
|
32
32
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
33
33
|
"@types/dompurify": "^3.0.5",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"eslint": "^8.57.0",
|
|
44
44
|
"eslint-config-prettier": "^9.1.0",
|
|
45
45
|
"eslint-plugin-react": "^7.34.3",
|
|
46
|
-
"eslint-plugin-storybook": "^0.11.
|
|
46
|
+
"eslint-plugin-storybook": "^0.11.2",
|
|
47
47
|
"heroicons": "^2.2.0",
|
|
48
48
|
"http-server": "14.1.1",
|
|
49
49
|
"msw": "2.6.1",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"playwright": "^1.49.1",
|
|
52
52
|
"prettier": "^3.2.5",
|
|
53
53
|
"react-syntax-highlighter": "^15.6.1",
|
|
54
|
-
"storybook": "^8.4.
|
|
54
|
+
"storybook": "^8.4.7",
|
|
55
55
|
"storybook-dark-mode": "^4.0.2",
|
|
56
56
|
"svg-sprite": "^2.0.4",
|
|
57
57
|
"tailwindcss": "^3.3.6",
|
|
58
58
|
"ts-node": "^10.9.2",
|
|
59
59
|
"typescript": "5.7.2",
|
|
60
|
-
"vite": "^
|
|
60
|
+
"vite": "^6.0.0"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build:prebuild": "rm -rf core reset && mkdir -p dist/core",
|