diff --git a/.changeset/cool-buttons-happen.md b/.changeset/cool-buttons-happen.md
new file mode 100644
index 0000000000..aa09bacf3c
--- /dev/null
+++ b/.changeset/cool-buttons-happen.md
@@ -0,0 +1,5 @@
+---
+'@kadena/react-ui': minor
+---
+
+Updated the Notification component API
diff --git a/packages/apps/docs/src/components/BottomPageSection/components/Subscribe.tsx b/packages/apps/docs/src/components/BottomPageSection/components/Subscribe.tsx
index 0542601ce7..ac389afd88 100644
--- a/packages/apps/docs/src/components/BottomPageSection/components/Subscribe.tsx
+++ b/packages/apps/docs/src/components/BottomPageSection/components/Subscribe.tsx
@@ -49,16 +49,16 @@ export const Subscribe: FC = () => {
{Boolean(message) && (
-
+
{message}
-
+
)}
>
) : (
Boolean(message) && (
-
+
{message}
-
+
)
)}
diff --git a/packages/apps/docs/src/components/CookieConsent/CookieConsent.tsx b/packages/apps/docs/src/components/CookieConsent/CookieConsent.tsx
index a6f179b7f1..45cb619903 100644
--- a/packages/apps/docs/src/components/CookieConsent/CookieConsent.tsx
+++ b/packages/apps/docs/src/components/CookieConsent/CookieConsent.tsx
@@ -1,8 +1,15 @@
import { updateConsent } from '@/utils/analytics';
-import { Notification, Text } from '@kadena/react-ui';
+import {
+ Notification,
+ NotificationButton,
+ NotificationFooter,
+ NotificationHeading,
+ SystemIcon,
+ Text,
+} from '@kadena/react-ui';
import type { FC } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
-import { notificationClass } from './styles.css';
+import { containerClass, notificationWrapperClass } from './styles.css';
export const CookieConsent: FC = () => {
const [cookieConsent, setCookieConsent] = useState(null);
@@ -31,36 +38,34 @@ export const CookieConsent: FC = () => {
if (cookieConsent !== null || !mounted) return null;
return (
-
-
-
- This notification concerns the cookie policy requirement to ask users
- for their consent to use Google Analytics or other
- tracking tools for better optimizations/performances.
-
-
-
- Accept
-
-
- Reject
-
-
-
-
+
+
+ }
+ role="none"
+ >
+
+ Cookie Consent
+
+
+ This notification concerns the cookie policy requirement to ask
+ users for their consent to use Google Analytics or
+ other tracking tools for better optimizations/performances.
+
+
+
+ Accept
+
+
+
+ Reject
+
+
+
+
+
+
);
};
diff --git a/packages/apps/docs/src/components/CookieConsent/styles.css.ts b/packages/apps/docs/src/components/CookieConsent/styles.css.ts
index dcd2ec2a3b..e45e7f439e 100644
--- a/packages/apps/docs/src/components/CookieConsent/styles.css.ts
+++ b/packages/apps/docs/src/components/CookieConsent/styles.css.ts
@@ -1,12 +1,20 @@
import { sprinkles } from '@kadena/react-ui/theme';
import { style } from '@vanilla-extract/css';
+import { $$pageWidth, globalClass } from '../Layout/global.css';
-export const notificationClass = style([
+export const containerClass = style([
sprinkles({
position: 'sticky',
top: '$17',
+ bg: '$primarySurfaceInverted',
}),
{
zIndex: 1000,
},
]);
+
+export const notificationWrapperClass = style([
+ globalClass,
+ sprinkles({ marginX: 'auto' }),
+ { maxWidth: $$pageWidth },
+]);
diff --git a/packages/apps/docs/src/components/Markdown/MDNotification/MDNotification.tsx b/packages/apps/docs/src/components/Markdown/MDNotification/MDNotification.tsx
index ffebb7b097..a81178a95d 100644
--- a/packages/apps/docs/src/components/Markdown/MDNotification/MDNotification.tsx
+++ b/packages/apps/docs/src/components/Markdown/MDNotification/MDNotification.tsx
@@ -1,4 +1,4 @@
-import { Notification } from '@kadena/react-ui';
+import { Notification, NotificationHeading } from '@kadena/react-ui';
import classNames from 'classnames';
import type { FC, ReactNode } from 'react';
import React from 'react';
@@ -16,15 +16,15 @@ interface IProps {
export const MDNotification: FC = ({ children, title = '', label }) => {
return (
-
+ {title}
{children}
-
+
);
};
diff --git a/packages/apps/docs/src/components/Markdown/MDNotification/utils.ts b/packages/apps/docs/src/components/Markdown/MDNotification/utils.tsx
similarity index 76%
rename from packages/apps/docs/src/components/Markdown/MDNotification/utils.ts
rename to packages/apps/docs/src/components/Markdown/MDNotification/utils.tsx
index 6939dbad03..1af910dbc5 100644
--- a/packages/apps/docs/src/components/Markdown/MDNotification/utils.ts
+++ b/packages/apps/docs/src/components/Markdown/MDNotification/utils.tsx
@@ -1,4 +1,6 @@
import type { INotificationProps } from '@kadena/react-ui';
+import { SystemIcon } from '@kadena/react-ui';
+import React from 'react';
export type LabelType =
| 'info'
@@ -7,14 +9,10 @@ export type LabelType =
| 'caution'
| 'danger'
| 'warning';
-type IconType = 'Information' | 'Bell' | undefined;
export const getColor = (label?: LabelType): INotificationProps['color'] => {
if (!label) return;
switch (label) {
- case 'note':
- case 'info':
- return 'primary';
case 'tip':
return 'positive';
case 'danger':
@@ -22,23 +20,23 @@ export const getColor = (label?: LabelType): INotificationProps['color'] => {
return 'negative';
case 'caution':
return 'warning';
+ case 'note':
+ case 'info':
default:
- return 'primary';
+ return 'info';
}
};
-export const getIcon = (label?: LabelType): IconType => {
+export const getIcon = (label?: LabelType): INotificationProps['icon'] => {
if (!label) return undefined;
switch (label) {
- case 'note':
- case 'info':
- case 'tip':
- return 'Information';
case 'caution':
case 'warning':
case 'danger':
- return 'Bell';
-
+ return ;
+ case 'note':
+ case 'info':
+ case 'tip':
default:
return undefined;
}
diff --git a/packages/apps/docs/src/components/Search/components/SearchResults.tsx b/packages/apps/docs/src/components/Search/components/SearchResults.tsx
index b31c1c2c41..21f773fd35 100644
--- a/packages/apps/docs/src/components/Search/components/SearchResults.tsx
+++ b/packages/apps/docs/src/components/Search/components/SearchResults.tsx
@@ -7,7 +7,9 @@ import {
Button,
Heading,
Notification,
+ NotificationHeading,
Stack,
+ SystemIcon,
Tabs,
useModal,
} from '@kadena/react-ui';
@@ -98,14 +100,13 @@ export const SearchResults: FC = ({
)}
{semanticError ? (
- }
+ role="status"
>
{semanticError}
-
+
) : (
<>
@@ -136,11 +137,8 @@ export const SearchResults: FC = ({
-
+ } role="none">
+ QA search is in beta
QA search our latest AI vector-based search, designed to provide
instant answers to your queries.
@@ -155,7 +153,7 @@ export const SearchResults: FC = ({
collect valuable data that will aid us in refining and enhancing
the accuracy of our model’s responses in the future.
-
+
{isLoading && (
@@ -164,13 +162,13 @@ export const SearchResults: FC = ({
)}
{error && (
- }
+ role="status"
>
{error}
-
+
)}
{conversation.history?.map((interaction, idx) => {
diff --git a/packages/apps/graph-client/src/components/error-box/error-box.tsx b/packages/apps/graph-client/src/components/error-box/error-box.tsx
index 18765a69d3..9d136bba2a 100644
--- a/packages/apps/graph-client/src/components/error-box/error-box.tsx
+++ b/packages/apps/graph-client/src/components/error-box/error-box.tsx
@@ -1,5 +1,5 @@
import type { ApolloError } from '@apollo/client';
-import { Box, Notification } from '@kadena/react-ui';
+import { Box, Notification, SystemIcon } from '@kadena/react-ui';
import React from 'react';
interface IErrorBoxProps {
@@ -28,7 +28,7 @@ export const ErrorBox = (props: IErrorBoxProps): JSX.Element => {
}
return (
-
+ } role="status">
{errorTitle}
{errorMessage}
@@ -38,6 +38,6 @@ export const ErrorBox = (props: IErrorBoxProps): JSX.Element => {
{errorExtra}
>
)}
-
+
);
};
diff --git a/packages/apps/graph-client/src/pages/account/overview/[module]/[account].tsx b/packages/apps/graph-client/src/pages/account/overview/[module]/[account].tsx
index 39371e5b23..eff0c54bff 100644
--- a/packages/apps/graph-client/src/pages/account/overview/[module]/[account].tsx
+++ b/packages/apps/graph-client/src/pages/account/overview/[module]/[account].tsx
@@ -41,10 +41,10 @@ const Account: React.FC = () => {
data?.account?.totalBalance === 0 &&
data?.account?.chainAccounts.length === 0 && (
<>
-
+
We could not find any data on this account. Please check the
module and account name.
-
+
>
)}
diff --git a/packages/apps/graph-client/src/pages/transactions/[key].tsx b/packages/apps/graph-client/src/pages/transactions/[key].tsx
index 923966c77b..7d96aadd11 100644
--- a/packages/apps/graph-client/src/pages/transactions/[key].tsx
+++ b/packages/apps/graph-client/src/pages/transactions/[key].tsx
@@ -2,7 +2,14 @@ import { useGetTransactionByRequestKeySubscription } from '@/__generated__/sdk';
import LoaderAndError from '@/components/LoaderAndError/loader-and-error';
import routes from '@/constants/routes';
import { formatCode, formatLisp } from '@/utils/formatter';
-import { Box, Breadcrumbs, Link, Notification, Table } from '@kadena/react-ui';
+import {
+ Box,
+ Breadcrumbs,
+ Link,
+ Notification,
+ SystemIcon,
+ Table,
+} from '@kadena/react-ui';
import { useRouter } from 'next/router';
import React from 'react';
@@ -47,10 +54,10 @@ const RequestKey: React.FC = () => {
{data?.transaction?.badResult && (
- }
+ role="status"
>
Transaction failed with status:{' '}
@@ -60,24 +67,24 @@ const RequestKey: React.FC = () => {
4,
)}
-
+
)}
{data?.transaction?.goodResult && (
- }
+ role="status"
>
Transaction succeeded with status:
{formatCode(data?.transaction?.goodResult)}
-
+
)}
{!data?.transaction?.goodResult &&
!data?.transaction?.badResult && (
-
+
Unknown transaction status
-
+
)}
diff --git a/packages/apps/tools/src/components/Global/CloseableNotification/index.tsx b/packages/apps/tools/src/components/Global/CloseableNotification/index.tsx
deleted file mode 100644
index c148683caf..0000000000
--- a/packages/apps/tools/src/components/Global/CloseableNotification/index.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import type { INotificationProps } from '@kadena/react-ui';
-import { Notification } from '@kadena/react-ui';
-import React from 'react';
-
-export interface ICloseableNotificationProps
- extends Omit {}
-
-export const CloseableNotification = ({
- onClose,
- ...rest
-}: ICloseableNotificationProps) => {
- const [show, setShow] = React.useState(true);
- if (!show) return null;
- return (
- {
- onClose?.();
- setShow(false);
- }}
- {...rest}
- />
- );
-};
diff --git a/packages/apps/tools/src/components/Global/FormStatusNotification/index.tsx b/packages/apps/tools/src/components/Global/FormStatusNotification/index.tsx
index fe88942b59..781fcd7df0 100644
--- a/packages/apps/tools/src/components/Global/FormStatusNotification/index.tsx
+++ b/packages/apps/tools/src/components/Global/FormStatusNotification/index.tsx
@@ -1,5 +1,9 @@
import type { INotificationProps } from '@kadena/react-ui';
-import { Notification } from '@kadena/react-ui';
+import {
+ Notification,
+ NotificationHeading,
+ SystemIcon,
+} from '@kadena/react-ui';
import useTranslation from 'next-translate/useTranslation';
import type { FC } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
@@ -18,10 +22,10 @@ const statusToColorMap: Record = {
};
const statusToIconMap: Record = {
- erroneous: 'AlertBox',
- idle: 'AlertCircleOutline',
- processing: 'Information',
- successful: 'Check',
+ erroneous: ,
+ idle: ,
+ processing: ,
+ successful: ,
};
export interface IFormStatusNotificationProps {
@@ -75,18 +79,17 @@ export const FormStatusNotification: FC = (
return (
-
+ {title ?? titles[status!]}
{body ?? bodies[status!]}
{children}
-
+
);
};
diff --git a/packages/apps/tools/src/pages/faucet/existing/index.tsx b/packages/apps/tools/src/pages/faucet/existing/index.tsx
index 69330bc199..28aa584953 100644
--- a/packages/apps/tools/src/pages/faucet/existing/index.tsx
+++ b/packages/apps/tools/src/pages/faucet/existing/index.tsx
@@ -17,6 +17,7 @@ import {
Card,
Heading,
Notification,
+ NotificationHeading,
} from '@kadena/react-ui';
import Trans from 'next-translate/Trans';
import useTranslation from 'next-translate/useTranslation';
@@ -143,13 +144,10 @@ const ExistingAccountFaucetPage: FC = () => {
{t('Add Funds to Existing Account')}
{mainnetSelected ? (
-
+
+
+ {t('The Faucet is not available on Mainnet')}
+
{
/>,
]}
/>
-
+
) : null}