@transferwise/components 46.148.0 → 46.148.1
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/build/container/Container.js.map +1 -1
- package/build/container/Container.mjs.map +1 -1
- package/build/main.css +10 -6
- package/build/prompt/CriticalBanner/CriticalBanner.js +4 -1
- package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -1
- package/build/prompt/CriticalBanner/CriticalBanner.mjs +4 -1
- package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
- package/build/styles/main.css +10 -6
- package/build/styles/prompt/ActionPrompt/ActionPrompt.css +2 -1
- package/build/styles/prompt/CriticalBanner/CriticalBanner.css +2 -1
- package/build/styles/prompt/InfoPrompt/InfoPrompt.css +2 -1
- package/build/styles/prompt/InlinePrompt/InlinePrompt.css +2 -1
- package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +2 -2
- package/build/types/container/Container.d.ts +2 -2
- package/build/types/container/Container.d.ts.map +1 -1
- package/build/types/iconButton/IconButton.d.ts +1 -1
- package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +1 -1
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +1 -1
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/container/Container.tsx +2 -2
- package/src/main.css +10 -6
- package/src/prompt/ActionPrompt/ActionPrompt.css +2 -1
- package/src/prompt/ActionPrompt/ActionPrompt.less +2 -1
- package/src/prompt/CriticalBanner/CriticalBanner.css +2 -1
- package/src/prompt/CriticalBanner/CriticalBanner.less +2 -1
- package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +1 -1
- package/src/prompt/CriticalBanner/CriticalBanner.tsx +6 -3
- package/src/prompt/InfoPrompt/InfoPrompt.css +2 -1
- package/src/prompt/InfoPrompt/InfoPrompt.less +2 -1
- package/src/prompt/InlinePrompt/InlinePrompt.css +2 -1
- package/src/prompt/InlinePrompt/InlinePrompt.less +2 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +2 -2
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +1 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.js","sources":["../../src/container/Container.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport type {
|
|
1
|
+
{"version":3,"file":"Container.js","sources":["../../src/container/Container.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { ComponentPropsWithRef, ElementType, PropsWithChildren } from 'react';\n\nimport { CommonProps } from '../common';\n\ntype ContainerOwnProps<T extends ElementType> = CommonProps & {\n /** Controls the maximum width: `fluid` (100%), `standard` (1160px), `narrow` (840px), `compact` (600px). @default 'standard' */\n size?: 'fluid' | 'standard' | 'narrow' | 'compact';\n as?: T;\n};\n\nexport type ContainerProps<T extends ElementType = 'div'> = PropsWithChildren<\n ContainerOwnProps<T>\n> &\n Omit<ComponentPropsWithRef<T>, keyof ContainerOwnProps<T> | 'children'>;\n\n/**\n * Centers page content within a responsive max-width boundary, with automatic horizontal padding that adapts to the viewport size.\n *\n * **Design guidance**: <a href=\"https://docs.wise.design/foundations/grid\" target=\"_blank\">wise.design/foundations/grid</a>\n */\nconst Container = <T extends ElementType = 'div'>({\n size = 'standard',\n as,\n className,\n children,\n ...otherProps\n}: ContainerProps<T>) => {\n const Element = as ?? 'div';\n return (\n <Element {...otherProps} className={clsx('wds-container', `wds-container--${size}`, className)}>\n {children}\n </Element>\n );\n};\n\nexport default Container;\n"],"names":["Container","size","as","className","children","otherProps","Element","_jsx","clsx"],"mappings":";;;;;;;AAqBA,MAAMA,SAAS,GAAGA,CAAgC;AAChDC,EAAAA,IAAI,GAAG,UAAU;EACjBC,EAAE;EACFC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAU,CACK,KAAI;AACtB,EAAA,MAAMC,OAAO,GAAGJ,EAAE,IAAI,KAAK;EAC3B,oBACEK,cAAA,CAACD,OAAO,EAAA;AAAA,IAAA,GAAKD,UAAU;IAAEF,SAAS,EAAEK,SAAI,CAAC,eAAe,EAAE,kBAAkBP,IAAI,CAAA,CAAE,EAAEE,SAAS,CAAE;AAAAC,IAAAA,QAAA,EAC5FA;AAAQ,GACF,CAAC;AAEd;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.mjs","sources":["../../src/container/Container.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport type {
|
|
1
|
+
{"version":3,"file":"Container.mjs","sources":["../../src/container/Container.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { ComponentPropsWithRef, ElementType, PropsWithChildren } from 'react';\n\nimport { CommonProps } from '../common';\n\ntype ContainerOwnProps<T extends ElementType> = CommonProps & {\n /** Controls the maximum width: `fluid` (100%), `standard` (1160px), `narrow` (840px), `compact` (600px). @default 'standard' */\n size?: 'fluid' | 'standard' | 'narrow' | 'compact';\n as?: T;\n};\n\nexport type ContainerProps<T extends ElementType = 'div'> = PropsWithChildren<\n ContainerOwnProps<T>\n> &\n Omit<ComponentPropsWithRef<T>, keyof ContainerOwnProps<T> | 'children'>;\n\n/**\n * Centers page content within a responsive max-width boundary, with automatic horizontal padding that adapts to the viewport size.\n *\n * **Design guidance**: <a href=\"https://docs.wise.design/foundations/grid\" target=\"_blank\">wise.design/foundations/grid</a>\n */\nconst Container = <T extends ElementType = 'div'>({\n size = 'standard',\n as,\n className,\n children,\n ...otherProps\n}: ContainerProps<T>) => {\n const Element = as ?? 'div';\n return (\n <Element {...otherProps} className={clsx('wds-container', `wds-container--${size}`, className)}>\n {children}\n </Element>\n );\n};\n\nexport default Container;\n"],"names":["Container","size","as","className","children","otherProps","Element","_jsx","clsx"],"mappings":";;;AAqBA,MAAMA,SAAS,GAAGA,CAAgC;AAChDC,EAAAA,IAAI,GAAG,UAAU;EACjBC,EAAE;EACFC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAU,CACK,KAAI;AACtB,EAAA,MAAMC,OAAO,GAAGJ,EAAE,IAAI,KAAK;EAC3B,oBACEK,GAAA,CAACD,OAAO,EAAA;AAAA,IAAA,GAAKD,UAAU;IAAEF,SAAS,EAAEK,IAAI,CAAC,eAAe,EAAE,kBAAkBP,IAAI,CAAA,CAAE,EAAEE,SAAS,CAAE;AAAAC,IAAAA,QAAA,EAC5FA;AAAQ,GACF,CAAC;AAEd;;;;"}
|
package/build/main.css
CHANGED
|
@@ -31706,8 +31706,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31706
31706
|
gap: 16px;
|
|
31707
31707
|
gap: var(--Prompt-gap, var(--size-16));
|
|
31708
31708
|
word-wrap: break-word;
|
|
31709
|
-
padding: 8px;
|
|
31710
|
-
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
31709
|
+
padding: 8px 8px;
|
|
31710
|
+
padding: var(--Prompt-padding-y, var(--padding-x-small)) var(--Prompt-padding-x, var(--padding-x-small));
|
|
31711
31711
|
text-align: left;
|
|
31712
31712
|
word-break: break-word;
|
|
31713
31713
|
width: 100%;
|
|
@@ -31759,7 +31759,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31759
31759
|
|
|
31760
31760
|
.wds-inline-prompt {
|
|
31761
31761
|
--Prompt-gap: calc(var(--size-12) / 2);
|
|
31762
|
-
--Prompt-padding
|
|
31762
|
+
--Prompt-padding-x: var(--padding-x-small);
|
|
31763
|
+
--Prompt-padding-y: calc(var(--padding-x-small) / 2);
|
|
31763
31764
|
display: inline-flex;
|
|
31764
31765
|
border-radius: 10px;
|
|
31765
31766
|
border-radius: var(--radius-small);
|
|
@@ -31829,7 +31830,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31829
31830
|
.wds-info-prompt {
|
|
31830
31831
|
--Prompt-border-radius: var(--radius-medium);
|
|
31831
31832
|
--Prompt-gap: var(--size-8);
|
|
31832
|
-
--Prompt-padding: var(--size-12);
|
|
31833
|
+
--Prompt-padding-x: var(--size-12);
|
|
31834
|
+
--Prompt-padding-y: var(--size-12);
|
|
31833
31835
|
}
|
|
31834
31836
|
|
|
31835
31837
|
.wds-info-prompt__content {
|
|
@@ -31895,7 +31897,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31895
31897
|
}
|
|
31896
31898
|
|
|
31897
31899
|
.wds-action-prompt {
|
|
31898
|
-
--Prompt-padding: var(--size-16);
|
|
31900
|
+
--Prompt-padding-x: var(--size-16);
|
|
31901
|
+
--Prompt-padding-y: var(--size-16);
|
|
31899
31902
|
--Prompt-actions-gap: var(--size-8);
|
|
31900
31903
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
31901
31904
|
--Prompt-border-radius: var(--radius-large);
|
|
@@ -31930,7 +31933,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31930
31933
|
}
|
|
31931
31934
|
|
|
31932
31935
|
.wds-critical-banner {
|
|
31933
|
-
--Prompt-padding: var(--
|
|
31936
|
+
--Prompt-padding-x: var(--wds-container-padding-inline);
|
|
31937
|
+
--Prompt-padding-y: var(--size-16);
|
|
31934
31938
|
--Prompt-actions-gap: var(--size-8);
|
|
31935
31939
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
31936
31940
|
--Prompt-border-radius: 0;
|
|
@@ -4,6 +4,7 @@ var React = require('react');
|
|
|
4
4
|
var clsx = require('clsx');
|
|
5
5
|
var Body = require('../../body/Body.js');
|
|
6
6
|
var Button_resolver = require('../../button/Button.resolver.js');
|
|
7
|
+
var Container = require('../../container/Container.js');
|
|
7
8
|
require('../../common/theme.js');
|
|
8
9
|
require('../../common/direction.js');
|
|
9
10
|
var neptuneTokens = require('@transferwise/neptune-tokens');
|
|
@@ -58,7 +59,9 @@ const CriticalBanner = ({
|
|
|
58
59
|
const titleId = React.useId();
|
|
59
60
|
const descId = React.useId();
|
|
60
61
|
const ariaLabelledByIds = [media['aria-hidden'] ? undefined : mediaId, !title ? undefined : titleId].filter(Boolean).join(' ');
|
|
61
|
-
const bannerSurface = /*#__PURE__*/jsxRuntime.jsxs(
|
|
62
|
+
const bannerSurface = /*#__PURE__*/jsxRuntime.jsxs(Container.default, {
|
|
63
|
+
size: "fluid",
|
|
64
|
+
as: PrimitivePrompt.PrimitivePrompt,
|
|
62
65
|
ref: containerRef,
|
|
63
66
|
id: id,
|
|
64
67
|
sentiment: sentiment,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CriticalBanner.js","sources":["../../../src/prompt/CriticalBanner/CriticalBanner.tsx"],"sourcesContent":["import { ReactNode, useId, useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport Body from '../../body';\nimport Button from '../../button';\nimport { Breakpoint, LiveRegion, Typography } from '../../common';\nimport { ButtonProps } from '../../button/Button.types';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\n\nimport { renderPromptMedia, PromptMedia } from '../helpers/promptMedia';\nimport { ExpanderToggle } from '../common/Expander/Expander';\nimport { buildAnnouncementString } from './helpers';\nimport { useContainerSize } from '../../common/hooks/useContainerSize';\n\nexport type CriticalBannerProps = {\n title?: ReactNode;\n description: ReactNode;\n media?: PromptMedia;\n action?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n sentiment?: Exclude<PrimitivePromptProps['sentiment'], 'proposition'>;\n /**\n * Controls whether the description and actions are visible, as a controlled component.\n * When collapsed with a title, only the title is shown.\n * When collapsed without a title, the description is trimmed to 2 lines.\n *\n * Note: On desktop (container width >= 768px), the banner is always expanded\n * regardless of this prop value.\n */\n expanded?: boolean;\n /**\n * Called when the user clicks the chevron toggle.\n * If not provided, the component will manage expanded state internally.\n */\n onToggle?: () => void;\n} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid'>;\n\n/**\n * A full-width, non-dismissible banner for critical messages such as account blocks or\n * time-sensitive actions that require immediate user attention.\n\n * @see {@link https://docs.wise.design/components/critical-banner Design Spec}\n */\nexport const CriticalBanner = ({\n sentiment = 'negative',\n title,\n description,\n media = {},\n action,\n actionSecondary,\n expanded: expandedProp,\n onToggle,\n id,\n className,\n 'data-testid': testId,\n}: CriticalBannerProps) => {\n const [containerRef, isDesktop] = useContainerSize(Breakpoint.MEDIUM);\n const isControlled = expandedProp !== undefined && onToggle !== undefined;\n const [internalExpanded, setInternalExpanded] = useState(true);\n const resolvedExpanded = isDesktop ? true : isControlled ? expandedProp : internalExpanded;\n const handleToggle = isControlled\n ? onToggle\n : () => setInternalExpanded((previousExpanded) => !previousExpanded);\n const hasActions = action ?? actionSecondary;\n const mediaId = useId();\n const titleId = useId();\n const descId = useId();\n\n const ariaLabelledByIds = [\n media['aria-hidden'] ? undefined : mediaId,\n !title ? undefined : titleId,\n ]\n .filter(Boolean)\n .join(' ');\n\n const bannerSurface = (\n <PrimitivePrompt\n ref={containerRef}\n id={id}\n sentiment={sentiment}\n emphasis={sentiment === 'neutral' ? 'base' : 'elevated'}\n data-testid={testId}\n className={clsx(\n 'wds-critical-banner',\n 'wds-critical-banner-overhang',\n {\n 'wds-critical-banner--collapsed': !resolvedExpanded,\n 'wds-critical-banner--with-two-actions': !!actionSecondary,\n },\n className,\n )}\n media={renderPromptMedia({\n media,\n sentiment,\n mediaId,\n imgClassName: 'wds-critical-banner--media-image',\n })}\n actions={\n hasActions ? (\n <div aria-hidden={!resolvedExpanded ? true : undefined} style={{ display: 'contents' }}>\n {actionSecondary && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"secondary\"\n href={actionSecondary.href}\n tabIndex={resolvedExpanded ? undefined : -1}\n onClick={actionSecondary?.onClick}\n >\n {actionSecondary.label}\n </Button>\n )}\n {action && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"primary\"\n href={action.href}\n tabIndex={resolvedExpanded ? undefined : -1}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n )}\n </div>\n ) : undefined\n }\n role=\"region\"\n aria-labelledby={ariaLabelledByIds || undefined}\n aria-describedby={description ? descId : undefined}\n >\n <div className=\"wds-critical-banner__text-wrapper\">\n {title && (\n <Body\n id={titleId}\n type={Typography.BODY_LARGE_BOLD}\n className=\"wds-critical-banner__content wds-critical-banner__title\"\n >\n {title}\n </Body>\n )}\n {description && (\n <Body\n id={descId}\n className={clsx('wds-critical-banner__content', 'wds-critical-banner__description', {\n 'wds-critical-banner__description--with-title': !!title,\n })}\n >\n {description}\n </Body>\n )}\n </div>\n <ExpanderToggle\n expanded={resolvedExpanded}\n size={24}\n className=\"wds-critical-banner__toggle\"\n onToggle={handleToggle}\n />\n </PrimitivePrompt>\n );\n\n return (\n <LiveRegion\n aria-live=\"assertive\"\n announceOnChange={buildAnnouncementString({\n title,\n description,\n expanded: resolvedExpanded,\n actionLabel: action?.label,\n actionSecondaryLabel: actionSecondary?.label,\n })}\n >\n <div className=\"wds-critical-banner-overhang-query\">\n <div className=\"wds-critical-banner__entry-mask\">\n <div className=\"wds-critical-banner__entry-track\">{bannerSurface}</div>\n </div>\n </div>\n </LiveRegion>\n );\n};\n\nexport default CriticalBanner;\n"],"names":["CriticalBanner","sentiment","title","description","media","action","actionSecondary","expanded","expandedProp","onToggle","id","className","testId","containerRef","isDesktop","useContainerSize","Breakpoint","MEDIUM","isControlled","undefined","internalExpanded","setInternalExpanded","useState","resolvedExpanded","handleToggle","previousExpanded","hasActions","mediaId","useId","titleId","descId","ariaLabelledByIds","filter","Boolean","join","bannerSurface","_jsxs","PrimitivePrompt","ref","emphasis","clsx","renderPromptMedia","imgClassName","actions","style","display","children","_jsx","Button","v2","size","priority","href","tabIndex","onClick","label","role","Body","type","Typography","BODY_LARGE_BOLD","ExpanderToggle","LiveRegion","announceOnChange","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BAAuB,CAAC;MACxC9D,KAAK;MACLC,WAAW;AACXI,MAAAA,QAAQ,EAAEgB,gBAAgB;MAC1B0C,WAAW,EAAE5D,MAAM,EAAEkD,KAAK;MAC1BW,oBAAoB,EAAE5D,eAAe,EAAEiD;AACxC,KAAA,CAAE;AAAAT,IAAAA,QAAA,eAEHC,cAAA,CAAA,KAAA,EAAA;AAAKpC,MAAAA,SAAS,EAAC,oCAAoC;AAAAmC,MAAAA,QAAA,eACjDC,cAAA,CAAA,KAAA,EAAA;AAAKpC,QAAAA,SAAS,EAAC,iCAAiC;AAAAmC,QAAAA,QAAA,eAC9CC,cAAA,CAAA,KAAA,EAAA;AAAKpC,UAAAA,SAAS,EAAC,kCAAkC;AAAAmC,UAAAA,QAAA,EAAEX;SAAmB;OACnE;KACF;AACP,GAAY,CAAC;AAEjB;;;;"}
|
|
1
|
+
{"version":3,"file":"CriticalBanner.js","sources":["../../../src/prompt/CriticalBanner/CriticalBanner.tsx"],"sourcesContent":["import { ElementType, ReactNode, useId, useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport Body from '../../body';\nimport Button from '../../button';\nimport Container from '../../container';\nimport { Breakpoint, LiveRegion, Typography } from '../../common';\nimport { ButtonProps } from '../../button/Button.types';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\n\nimport { renderPromptMedia, PromptMedia } from '../helpers/promptMedia';\nimport { ExpanderToggle } from '../common/Expander/Expander';\nimport { buildAnnouncementString } from './helpers';\nimport { useContainerSize } from '../../common/hooks/useContainerSize';\n\nexport type CriticalBannerProps = {\n title?: ReactNode;\n description: ReactNode;\n media?: PromptMedia;\n action?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n sentiment?: Exclude<PrimitivePromptProps['sentiment'], 'proposition'>;\n /**\n * Controls whether the description and actions are visible, as a controlled component.\n * When collapsed with a title, only the title is shown.\n * When collapsed without a title, the description is trimmed to 2 lines.\n *\n * Note: On desktop (container width >= 768px), the banner is always expanded\n * regardless of this prop value.\n */\n expanded?: boolean;\n /**\n * Called when the user clicks the chevron toggle.\n * If not provided, the component will manage expanded state internally.\n */\n onToggle?: () => void;\n} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid'>;\n\n/**\n * A full-width, non-dismissible banner for critical messages such as account blocks or\n * time-sensitive actions that require immediate user attention.\n\n * @see {@link https://docs.wise.design/components/critical-banner Design Spec}\n */\nexport const CriticalBanner = ({\n sentiment = 'negative',\n title,\n description,\n media = {},\n action,\n actionSecondary,\n expanded: expandedProp,\n onToggle,\n id,\n className,\n 'data-testid': testId,\n}: CriticalBannerProps) => {\n const [containerRef, isDesktop] = useContainerSize(Breakpoint.MEDIUM);\n const isControlled = expandedProp !== undefined && onToggle !== undefined;\n const [internalExpanded, setInternalExpanded] = useState(true);\n const resolvedExpanded = isDesktop ? true : isControlled ? expandedProp : internalExpanded;\n const handleToggle = isControlled\n ? onToggle\n : () => setInternalExpanded((previousExpanded) => !previousExpanded);\n const hasActions = action ?? actionSecondary;\n const mediaId = useId();\n const titleId = useId();\n const descId = useId();\n\n const ariaLabelledByIds = [\n media['aria-hidden'] ? undefined : mediaId,\n !title ? undefined : titleId,\n ]\n .filter(Boolean)\n .join(' ');\n\n const bannerSurface = (\n <Container\n size=\"fluid\"\n as={PrimitivePrompt as ElementType}\n ref={containerRef}\n id={id}\n sentiment={sentiment}\n emphasis={sentiment === 'neutral' ? 'base' : 'elevated'}\n data-testid={testId}\n className={clsx(\n 'wds-critical-banner',\n 'wds-critical-banner-overhang',\n {\n 'wds-critical-banner--collapsed': !resolvedExpanded,\n 'wds-critical-banner--with-two-actions': !!actionSecondary,\n },\n className,\n )}\n media={renderPromptMedia({\n media,\n sentiment,\n mediaId,\n imgClassName: 'wds-critical-banner--media-image',\n })}\n actions={\n hasActions ? (\n <div aria-hidden={!resolvedExpanded ? true : undefined} style={{ display: 'contents' }}>\n {actionSecondary && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"secondary\"\n href={actionSecondary.href}\n tabIndex={resolvedExpanded ? undefined : -1}\n onClick={actionSecondary?.onClick}\n >\n {actionSecondary.label}\n </Button>\n )}\n {action && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"primary\"\n href={action.href}\n tabIndex={resolvedExpanded ? undefined : -1}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n )}\n </div>\n ) : undefined\n }\n role=\"region\"\n aria-labelledby={ariaLabelledByIds || undefined}\n aria-describedby={description ? descId : undefined}\n >\n <div className=\"wds-critical-banner__text-wrapper\">\n {title && (\n <Body\n id={titleId}\n type={Typography.BODY_LARGE_BOLD}\n className=\"wds-critical-banner__content wds-critical-banner__title\"\n >\n {title}\n </Body>\n )}\n {description && (\n <Body\n id={descId}\n className={clsx('wds-critical-banner__content', 'wds-critical-banner__description', {\n 'wds-critical-banner__description--with-title': !!title,\n })}\n >\n {description}\n </Body>\n )}\n </div>\n <ExpanderToggle\n expanded={resolvedExpanded}\n size={24}\n className=\"wds-critical-banner__toggle\"\n onToggle={handleToggle}\n />\n </Container>\n );\n\n return (\n <LiveRegion\n aria-live=\"assertive\"\n announceOnChange={buildAnnouncementString({\n title,\n description,\n expanded: resolvedExpanded,\n actionLabel: action?.label,\n actionSecondaryLabel: actionSecondary?.label,\n })}\n >\n <div className=\"wds-critical-banner-overhang-query\">\n <div className=\"wds-critical-banner__entry-mask\">\n <div className=\"wds-critical-banner__entry-track\">{bannerSurface}</div>\n </div>\n </div>\n </LiveRegion>\n );\n};\n\nexport default CriticalBanner;\n"],"names":["CriticalBanner","sentiment","title","description","media","action","actionSecondary","expanded","expandedProp","onToggle","id","className","testId","containerRef","isDesktop","useContainerSize","Breakpoint","MEDIUM","isControlled","undefined","internalExpanded","setInternalExpanded","useState","resolvedExpanded","handleToggle","previousExpanded","hasActions","mediaId","useId","titleId","descId","ariaLabelledByIds","filter","Boolean","join","bannerSurface","_jsxs","Container","size","as","PrimitivePrompt","ref","emphasis","clsx","renderPromptMedia","imgClassName","actions","style","display","children","_jsx","Button","v2","priority","href","tabIndex","onClick","label","role","Body","type","Typography","BODY_LARGE_BOLD","ExpanderToggle","LiveRegion","announceOnChange","buildAnnouncementString","actionLabel","actionSecondaryLabel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDO,MAAMA,cAAc,GAAGA,CAAC;AAC7BC,EAAAA,SAAS,GAAG,UAAU;EACtBC,KAAK;EACLC,WAAW;EACXC,KAAK,GAAG,EAAE;EACVC,MAAM;EACNC,eAAe;AACfC,EAAAA,QAAQ,EAAEC,YAAY;EACtBC,QAAQ;EACRC,EAAE;EACFC,SAAS;AACT,EAAA,aAAa,EAAEC;AAAM,CACD,KAAI;EACxB,MAAM,CAACC,YAAY,EAAEC,SAAS,CAAC,GAAGC,iCAAgB,CAACC,wBAAU,CAACC,MAAM,CAAC;EACrE,MAAMC,YAAY,GAAGV,YAAY,KAAKW,SAAS,IAAIV,QAAQ,KAAKU,SAAS;EACzE,MAAM,CAACC,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGC,cAAQ,CAAC,IAAI,CAAC;EAC9D,MAAMC,gBAAgB,GAAGT,SAAS,GAAG,IAAI,GAAGI,YAAY,GAAGV,YAAY,GAAGY,gBAAgB;AAC1F,EAAA,MAAMI,YAAY,GAAGN,YAAY,GAC7BT,QAAQ,GACR,MAAMY,mBAAmB,CAAEI,gBAAgB,IAAK,CAACA,gBAAgB,CAAC;AACtE,EAAA,MAAMC,UAAU,GAAGrB,MAAM,IAAIC,eAAe;AAC5C,EAAA,MAAMqB,OAAO,GAAGC,WAAK,EAAE;AACvB,EAAA,MAAMC,OAAO,GAAGD,WAAK,EAAE;AACvB,EAAA,MAAME,MAAM,GAAGF,WAAK,EAAE;AAEtB,EAAA,MAAMG,iBAAiB,GAAG,CACxB3B,K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AAA;AACbxD,MAAAA,QAAQ,EAAEgB,gBAAiB;AAC3Be,MAAAA,IAAI,EAAE,EAAG;AACT3B,MAAAA,SAAS,EAAC,6BAA6B;AACvCF,MAAAA,QAAQ,EAAEe;AAAa,KAAA,CAE3B;AAAA,GAAW,CACZ;EAED,oBACE0B,cAAA,CAACc,qBAAU,EAAA;AACT,IAAA,WAAA,EAAU,WAAW;IACrBC,gBAAgB,EAAEC,+BAAuB,CAAC;MACxChE,KAAK;MACLC,WAAW;AACXI,MAAAA,QAAQ,EAAEgB,gBAAgB;MAC1B4C,WAAW,EAAE9D,MAAM,EAAEoD,KAAK;MAC1BW,oBAAoB,EAAE9D,eAAe,EAAEmD;AACxC,KAAA,CAAE;AAAAR,IAAAA,QAAA,eAEHC,cAAA,CAAA,KAAA,EAAA;AAAKvC,MAAAA,SAAS,EAAC,oCAAoC;AAAAsC,MAAAA,QAAA,eACjDC,cAAA,CAAA,KAAA,EAAA;AAAKvC,QAAAA,SAAS,EAAC,iCAAiC;AAAAsC,QAAAA,QAAA,eAC9CC,cAAA,CAAA,KAAA,EAAA;AAAKvC,UAAAA,SAAS,EAAC,kCAAkC;AAAAsC,UAAAA,QAAA,EAAEd;SAAmB;OACnE;KACF;AACP,GAAY,CAAC;AAEjB;;;;"}
|
|
@@ -2,6 +2,7 @@ import { useState, useId } from 'react';
|
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import Body from '../../body/Body.mjs';
|
|
4
4
|
import Button from '../../button/Button.resolver.mjs';
|
|
5
|
+
import Container from '../../container/Container.mjs';
|
|
5
6
|
import '../../common/theme.mjs';
|
|
6
7
|
import '../../common/direction.mjs';
|
|
7
8
|
import { Breakpoint } from '@transferwise/neptune-tokens';
|
|
@@ -56,7 +57,9 @@ const CriticalBanner = ({
|
|
|
56
57
|
const titleId = useId();
|
|
57
58
|
const descId = useId();
|
|
58
59
|
const ariaLabelledByIds = [media['aria-hidden'] ? undefined : mediaId, !title ? undefined : titleId].filter(Boolean).join(' ');
|
|
59
|
-
const bannerSurface = /*#__PURE__*/jsxs(
|
|
60
|
+
const bannerSurface = /*#__PURE__*/jsxs(Container, {
|
|
61
|
+
size: "fluid",
|
|
62
|
+
as: PrimitivePrompt,
|
|
60
63
|
ref: containerRef,
|
|
61
64
|
id: id,
|
|
62
65
|
sentiment: sentiment,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CriticalBanner.mjs","sources":["../../../src/prompt/CriticalBanner/CriticalBanner.tsx"],"sourcesContent":["import { ReactNode, useId, useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport Body from '../../body';\nimport Button from '../../button';\nimport { Breakpoint, LiveRegion, Typography } from '../../common';\nimport { ButtonProps } from '../../button/Button.types';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\n\nimport { renderPromptMedia, PromptMedia } from '../helpers/promptMedia';\nimport { ExpanderToggle } from '../common/Expander/Expander';\nimport { buildAnnouncementString } from './helpers';\nimport { useContainerSize } from '../../common/hooks/useContainerSize';\n\nexport type CriticalBannerProps = {\n title?: ReactNode;\n description: ReactNode;\n media?: PromptMedia;\n action?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n sentiment?: Exclude<PrimitivePromptProps['sentiment'], 'proposition'>;\n /**\n * Controls whether the description and actions are visible, as a controlled component.\n * When collapsed with a title, only the title is shown.\n * When collapsed without a title, the description is trimmed to 2 lines.\n *\n * Note: On desktop (container width >= 768px), the banner is always expanded\n * regardless of this prop value.\n */\n expanded?: boolean;\n /**\n * Called when the user clicks the chevron toggle.\n * If not provided, the component will manage expanded state internally.\n */\n onToggle?: () => void;\n} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid'>;\n\n/**\n * A full-width, non-dismissible banner for critical messages such as account blocks or\n * time-sensitive actions that require immediate user attention.\n\n * @see {@link https://docs.wise.design/components/critical-banner Design Spec}\n */\nexport const CriticalBanner = ({\n sentiment = 'negative',\n title,\n description,\n media = {},\n action,\n actionSecondary,\n expanded: expandedProp,\n onToggle,\n id,\n className,\n 'data-testid': testId,\n}: CriticalBannerProps) => {\n const [containerRef, isDesktop] = useContainerSize(Breakpoint.MEDIUM);\n const isControlled = expandedProp !== undefined && onToggle !== undefined;\n const [internalExpanded, setInternalExpanded] = useState(true);\n const resolvedExpanded = isDesktop ? true : isControlled ? expandedProp : internalExpanded;\n const handleToggle = isControlled\n ? onToggle\n : () => setInternalExpanded((previousExpanded) => !previousExpanded);\n const hasActions = action ?? actionSecondary;\n const mediaId = useId();\n const titleId = useId();\n const descId = useId();\n\n const ariaLabelledByIds = [\n media['aria-hidden'] ? undefined : mediaId,\n !title ? undefined : titleId,\n ]\n .filter(Boolean)\n .join(' ');\n\n const bannerSurface = (\n <PrimitivePrompt\n ref={containerRef}\n id={id}\n sentiment={sentiment}\n emphasis={sentiment === 'neutral' ? 'base' : 'elevated'}\n data-testid={testId}\n className={clsx(\n 'wds-critical-banner',\n 'wds-critical-banner-overhang',\n {\n 'wds-critical-banner--collapsed': !resolvedExpanded,\n 'wds-critical-banner--with-two-actions': !!actionSecondary,\n },\n className,\n )}\n media={renderPromptMedia({\n media,\n sentiment,\n mediaId,\n imgClassName: 'wds-critical-banner--media-image',\n })}\n actions={\n hasActions ? (\n <div aria-hidden={!resolvedExpanded ? true : undefined} style={{ display: 'contents' }}>\n {actionSecondary && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"secondary\"\n href={actionSecondary.href}\n tabIndex={resolvedExpanded ? undefined : -1}\n onClick={actionSecondary?.onClick}\n >\n {actionSecondary.label}\n </Button>\n )}\n {action && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"primary\"\n href={action.href}\n tabIndex={resolvedExpanded ? undefined : -1}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n )}\n </div>\n ) : undefined\n }\n role=\"region\"\n aria-labelledby={ariaLabelledByIds || undefined}\n aria-describedby={description ? descId : undefined}\n >\n <div className=\"wds-critical-banner__text-wrapper\">\n {title && (\n <Body\n id={titleId}\n type={Typography.BODY_LARGE_BOLD}\n className=\"wds-critical-banner__content wds-critical-banner__title\"\n >\n {title}\n </Body>\n )}\n {description && (\n <Body\n id={descId}\n className={clsx('wds-critical-banner__content', 'wds-critical-banner__description', {\n 'wds-critical-banner__description--with-title': !!title,\n })}\n >\n {description}\n </Body>\n )}\n </div>\n <ExpanderToggle\n expanded={resolvedExpanded}\n size={24}\n className=\"wds-critical-banner__toggle\"\n onToggle={handleToggle}\n />\n </PrimitivePrompt>\n );\n\n return (\n <LiveRegion\n aria-live=\"assertive\"\n announceOnChange={buildAnnouncementString({\n title,\n description,\n expanded: resolvedExpanded,\n actionLabel: action?.label,\n actionSecondaryLabel: actionSecondary?.label,\n })}\n >\n <div className=\"wds-critical-banner-overhang-query\">\n <div className=\"wds-critical-banner__entry-mask\">\n <div className=\"wds-critical-banner__entry-track\">{bannerSurface}</div>\n </div>\n </div>\n </LiveRegion>\n );\n};\n\nexport default CriticalBanner;\n"],"names":["CriticalBanner","sentiment","title","description","media","action","actionSecondary","expanded","expandedProp","onToggle","id","className","testId","containerRef","isDesktop","useContainerSize","Breakpoint","MEDIUM","isControlled","undefined","internalExpanded","setInternalExpanded","useState","resolvedExpanded","handleToggle","previousExpanded","hasActions","mediaId","useId","titleId","descId","ariaLabelledByIds","filter","Boolean","join","bannerSurface","_jsxs","PrimitivePrompt","ref","emphasis","clsx","renderPromptMedia","imgClassName","actions","style","display","children","_jsx","Button","v2","size","priority","href","tabIndex","onClick","label","role","Body","type","Typography","BODY_LARGE_BOLD","ExpanderToggle","LiveRegion","announceOnChange","buildAnnouncementString","actionLabel","actionSecondaryLabel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CO,MAAMA,cAAc,GAAGA,CAAC;AAC7BC,EAAAA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AE5D,eAAe,EAAEiD;AACxC,KAAA,CAAE;AAAAT,IAAAA,QAAA,eAEHC,GAAA,CAAA,KAAA,EAAA;AAAKpC,MAAAA,SAAS,EAAC,oCAAoC;AAAAmC,MAAAA,QAAA,eACjDC,GAAA,CAAA,KAAA,EAAA;AAAKpC,QAAAA,SAAS,EAAC,iCAAiC;AAAAmC,QAAAA,QAAA,eAC9CC,GAAA,CAAA,KAAA,EAAA;AAAKpC,UAAAA,SAAS,EAAC,kCAAkC;AAAAmC,UAAAA,QAAA,EAAEX;SAAmB;OACnE;KACF;AACP,GAAY,CAAC;AAEjB;;;;"}
|
|
1
|
+
{"version":3,"file":"CriticalBanner.mjs","sources":["../../../src/prompt/CriticalBanner/CriticalBanner.tsx"],"sourcesContent":["import { ElementType, ReactNode, useId, useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport Body from '../../body';\nimport Button from '../../button';\nimport Container from '../../container';\nimport { Breakpoint, LiveRegion, Typography } from '../../common';\nimport { ButtonProps } from '../../button/Button.types';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\n\nimport { renderPromptMedia, PromptMedia } from '../helpers/promptMedia';\nimport { ExpanderToggle } from '../common/Expander/Expander';\nimport { buildAnnouncementString } from './helpers';\nimport { useContainerSize } from '../../common/hooks/useContainerSize';\n\nexport type CriticalBannerProps = {\n title?: ReactNode;\n description: ReactNode;\n media?: PromptMedia;\n action?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n sentiment?: Exclude<PrimitivePromptProps['sentiment'], 'proposition'>;\n /**\n * Controls whether the description and actions are visible, as a controlled component.\n * When collapsed with a title, only the title is shown.\n * When collapsed without a title, the description is trimmed to 2 lines.\n *\n * Note: On desktop (container width >= 768px), the banner is always expanded\n * regardless of this prop value.\n */\n expanded?: boolean;\n /**\n * Called when the user clicks the chevron toggle.\n * If not provided, the component will manage expanded state internally.\n */\n onToggle?: () => void;\n} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid'>;\n\n/**\n * A full-width, non-dismissible banner for critical messages such as account blocks or\n * time-sensitive actions that require immediate user attention.\n\n * @see {@link https://docs.wise.design/components/critical-banner Design Spec}\n */\nexport const CriticalBanner = ({\n sentiment = 'negative',\n title,\n description,\n media = {},\n action,\n actionSecondary,\n expanded: expandedProp,\n onToggle,\n id,\n className,\n 'data-testid': testId,\n}: CriticalBannerProps) => {\n const [containerRef, isDesktop] = useContainerSize(Breakpoint.MEDIUM);\n const isControlled = expandedProp !== undefined && onToggle !== undefined;\n const [internalExpanded, setInternalExpanded] = useState(true);\n const resolvedExpanded = isDesktop ? true : isControlled ? expandedProp : internalExpanded;\n const handleToggle = isControlled\n ? onToggle\n : () => setInternalExpanded((previousExpanded) => !previousExpanded);\n const hasActions = action ?? actionSecondary;\n const mediaId = useId();\n const titleId = useId();\n const descId = useId();\n\n const ariaLabelledByIds = [\n media['aria-hidden'] ? undefined : mediaId,\n !title ? undefined : titleId,\n ]\n .filter(Boolean)\n .join(' ');\n\n const bannerSurface = (\n <Container\n size=\"fluid\"\n as={PrimitivePrompt as ElementType}\n ref={containerRef}\n id={id}\n sentiment={sentiment}\n emphasis={sentiment === 'neutral' ? 'base' : 'elevated'}\n data-testid={testId}\n className={clsx(\n 'wds-critical-banner',\n 'wds-critical-banner-overhang',\n {\n 'wds-critical-banner--collapsed': !resolvedExpanded,\n 'wds-critical-banner--with-two-actions': !!actionSecondary,\n },\n className,\n )}\n media={renderPromptMedia({\n media,\n sentiment,\n mediaId,\n imgClassName: 'wds-critical-banner--media-image',\n })}\n actions={\n hasActions ? (\n <div aria-hidden={!resolvedExpanded ? true : undefined} style={{ display: 'contents' }}>\n {actionSecondary && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"secondary\"\n href={actionSecondary.href}\n tabIndex={resolvedExpanded ? undefined : -1}\n onClick={actionSecondary?.onClick}\n >\n {actionSecondary.label}\n </Button>\n )}\n {action && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"primary\"\n href={action.href}\n tabIndex={resolvedExpanded ? undefined : -1}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n )}\n </div>\n ) : undefined\n }\n role=\"region\"\n aria-labelledby={ariaLabelledByIds || undefined}\n aria-describedby={description ? descId : undefined}\n >\n <div className=\"wds-critical-banner__text-wrapper\">\n {title && (\n <Body\n id={titleId}\n type={Typography.BODY_LARGE_BOLD}\n className=\"wds-critical-banner__content wds-critical-banner__title\"\n >\n {title}\n </Body>\n )}\n {description && (\n <Body\n id={descId}\n className={clsx('wds-critical-banner__content', 'wds-critical-banner__description', {\n 'wds-critical-banner__description--with-title': !!title,\n })}\n >\n {description}\n </Body>\n )}\n </div>\n <ExpanderToggle\n expanded={resolvedExpanded}\n size={24}\n className=\"wds-critical-banner__toggle\"\n onToggle={handleToggle}\n />\n </Container>\n );\n\n return (\n <LiveRegion\n aria-live=\"assertive\"\n announceOnChange={buildAnnouncementString({\n title,\n description,\n expanded: resolvedExpanded,\n actionLabel: action?.label,\n actionSecondaryLabel: actionSecondary?.label,\n })}\n >\n <div className=\"wds-critical-banner-overhang-query\">\n <div className=\"wds-critical-banner__entry-mask\">\n <div className=\"wds-critical-banner__entry-track\">{bannerSurface}</div>\n </div>\n </div>\n </LiveRegion>\n );\n};\n\nexport default CriticalBanner;\n"],"names":["CriticalBanner","sentiment","title","description","media","action","actionSecondary","expanded","expandedProp","onToggle","id","className","testId","containerRef","isDesktop","useContainerSize","Breakpoint","MEDIUM","isControlled","undefined","internalExpanded","setInternalExpanded","useState","resolvedExpanded","handleToggle","previousExpanded","hasActions","mediaId","useId","titleId","descId","ariaLabelledByIds","filter","Boolean","join","bannerSurface","_jsxs","Container","size","as","PrimitivePrompt","ref","emphasis","clsx","renderPromptMedia","imgClassName","actions","style","display","children","_jsx","Button","v2","priority","href","tabIndex","onClick","label","role","Body","type","Typography","BODY_LARGE_BOLD","ExpanderToggle","LiveRegion","announceOnChange","buildAnnouncementString","actionLabel","actionSecondaryLabel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDO,MAAMA,cAAc,GAAGA,CAAC;AAC7BC,EAAAA,SAAS,GAAG,UAAU;EACtBC,KAAK;EACLC,WAAW;EACXC,KAAK,GAAG,EAAE;EACVC,MAAM;EACNC,eAAe;AACfC,EAAAA,QAAQ,EAAEC,YAAY;EACtBC,QAAQ;EACRC,EAAE;EACFC,SAAS;AACT,EAAA,aAAa,EAAEC;AAAM,CACD,KAAI;EACxB,MAAM,CAACC,YAAY,EAAEC,SAAS,CAAC,GAAGC,gBAAgB,CAACC,UAAU,CAACC,MAAM,CAAC;EACrE,MAAMC,YAAY,GAAGV,YAAY,KAAKW,SAAS,IAAIV,QAAQ,KAAKU,SAAS;EACzE,MAAM,CAACC,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGC,QAAQ,CAAC,IAAI,CAAC;EAC9D,MAAMC,gBAAgB,GAAGT,SAAS,GAAG,IAAI,GAAGI,YAAY,GAAGV,YAAY,GAAGY,gBAAgB;AAC1F,EAAA,MAAMI,YAAY,GAAGN,YAAY,GAC7BT,QAAQ,GACR,MAAMY,mBAAmB,CAAEI,gBAAgB,IAAK,CAACA,gBAAgB,CAAC;AACtE,EAAA,MAAMC,UAAU,GAAGrB,MAAM,IAAIC,eAAe;AAC5C,EAAA,MAAMqB,OAAO,GAAGC,KAAK,EAAE;AACvB,EAAA,MAAMC,OAAO,GAAGD,KAAK,EAAE;AACvB,EAAA,MAAME,MAAM,GAAGF,KAAK,EAAE;AAEtB,EAAA,MAAMG,iBAAiB,GAAG,CACxB3B,KAAK,CAAC,aAAa,CAAC,GAAGe,SAAS,GAAGQ,OAAO,EAC1C,CAACzB,KAAK,GAAGiB,SAAS,GAAGU,OAAO,CAC7B,CACEG,MAAM,CAACC,OAAO,CAAC,CACfC,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AA,CAE3B;AAAA,GAAW,CACZ;EAED,oBACE0B,GAAA,CAACc,UAAU,EAAA;AACT,IAAA,WAAA,EAAU,WAAW;IACrBC,gBAAgB,EAAEC,uBAAuB,CAAC;MACxChE,KAAK;MACLC,WAAW;AACXI,MAAAA,QAAQ,EAAEgB,gBAAgB;MAC1B4C,WAAW,EAAE9D,MAAM,EAAEoD,KAAK;MAC1BW,oBAAoB,EAAE9D,eAAe,EAAEmD;AACxC,KAAA,CAAE;AAAAR,IAAAA,QAAA,eAEHC,GAAA,CAAA,KAAA,EAAA;AAAKvC,MAAAA,SAAS,EAAC,oCAAoC;AAAAsC,MAAAA,QAAA,eACjDC,GAAA,CAAA,KAAA,EAAA;AAAKvC,QAAAA,SAAS,EAAC,iCAAiC;AAAAsC,QAAAA,QAAA,eAC9CC,GAAA,CAAA,KAAA,EAAA;AAAKvC,UAAAA,SAAS,EAAC,kCAAkC;AAAAsC,UAAAA,QAAA,EAAEd;SAAmB;OACnE;KACF;AACP,GAAY,CAAC;AAEjB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePrompt.js","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Emphasis, Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { forwardRef, HTMLAttributes, ReactNode } from 'react';\n\nexport type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The sentiment determines the colour scheme.\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * The emphasis level affecting background and text contrast.\n * @default 'base'\n */\n emphasis?: Emphasis;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Test ID for testing tools\n */\n 'data-testid'?: string;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */\nexport const PrimitivePrompt = forwardRef<HTMLDivElement, PrimitivePromptProps>(\n (\n {\n sentiment = 'success',\n emphasis = 'base',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n },\n ref,\n ) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n // @ts-expect-error - SentimentSurface forwardRef types don't expose ref in props\n ref={ref}\n sentiment={sentiment}\n emphasis={emphasis}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div\n className={clsx('wds-prompt__content-wrapper', {\n 'wds-prompt__content-wrapper--with-dismiss': !!onDismiss,\n })}\n >\n <div className={clsx('wds-prompt__media-wrapper')}>{media}</div>\n {children}\n {onDismiss && (\n <IconButton\n size={24}\n priority=\"secondary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onDismiss}\n >\n <Cross />\n </IconButton>\n )}\n {actions && <div className=\"wds-prompt__actions-wrapper\">{actions}</div>}\n </div>\n </SentimentSurface>\n );\n },\n);\n\nPrimitivePrompt.displayName = 'PrimitivePrompt';\n"],"names":["PrimitivePrompt","forwardRef","sentiment","emphasis","media","actions","onDismiss","className","children","restProps","ref","intl","useIntl","_jsx","SentimentSurface","clsx","_jsxs","IconButton","size","priority","formatMessage","closeBtnMessages","ariaLabel","onClick","Cross","displayName"],"mappings":";;;;;;;;;;;AAwCO,MAAMA,eAAe,gBAAGC,gBAAU,CACvC,CACE;AACEC,EAAAA,SAAS,GAAG,SAAS;AACrBC,EAAAA,QAAQ,GAAG,MAAM;EACjBC,KAAK;EACLC,OAAO;EACPC,SAAS;EACTC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAS,CACb,EACDC,GAAG,K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esContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Emphasis, Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { forwardRef, HTMLAttributes, ReactNode } from 'react';\n\nexport type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The sentiment determines the colour scheme.\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * The emphasis level affecting background and text contrast.\n * @default 'base'\n */\n emphasis?: Emphasis;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Test ID for testing tools\n */\n 'data-testid'?: string;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding-x. */\nexport const PrimitivePrompt = forwardRef<HTMLDivElement, PrimitivePromptProps>(\n (\n {\n sentiment = 'success',\n emphasis = 'base',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n },\n ref,\n ) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n // @ts-expect-error - SentimentSurface forwardRef types don't expose ref in props\n ref={ref}\n sentiment={sentiment}\n emphasis={emphasis}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div\n className={clsx('wds-prompt__content-wrapper', {\n 'wds-prompt__content-wrapper--with-dismiss': !!onDismiss,\n })}\n >\n <div className={clsx('wds-prompt__media-wrapper')}>{media}</div>\n {children}\n {onDismiss && (\n <IconButton\n size={24}\n priority=\"secondary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onDismiss}\n >\n <Cross />\n </IconButton>\n )}\n {actions && <div className=\"wds-prompt__actions-wrapper\">{actions}</div>}\n </div>\n </SentimentSurface>\n );\n },\n);\n\nPrimitivePrompt.displayName = 'PrimitivePrompt';\n"],"names":["PrimitivePrompt","forwardRef","sentiment","emphasis","media","actions","onDismiss","className","children","restProps","ref","intl","useIntl","_jsx","SentimentSurface","clsx","_jsxs","IconButton","size","priority","formatMessage","closeBtnMessages","ariaLabel","onClick","Cross","displayName"],"mappings":";;;;;;;;;;;AAwCO,MAAMA,eAAe,gBAAGC,gBAAU,CACvC,CACE;AACEC,EAAAA,SAAS,GAAG,SAAS;AACrBC,EAAAA,QAAQ,GAAG,MAAM;EACjBC,KAAK;EACLC,OAAO;EACPC,SAAS;EACTC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAS,CACb,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;AAEtB,EAAA,oBACEC,cAAA,CAACC;AACC;AAAA,IAAA;AACAJ,IAAAA,GAAG,EAAEA,GAAI;AACTR,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,QAAQ,EAAEA,QAAS;IACnBI,SAAS,EAAEQ,SAAI,CAAC,YAAY,EAAE,eAAeb,SAAS,CAAA,CAAE,EAAEK,SAAS,CAAE;AAAA,IAAA,GACjEE,SAAS;AAAAD,IAAAA,QAAA,eAEbQ,eAAA,CAAA,KAAA,EAAA;AACET,MAAAA,SAAS,EAAEQ,SAAI,CAAC,6BAA6B,EAAE;QAC7C,2CAA2C,EAAE,CAAC,CAACT;AAChD,OAAA,CAAE;AAAAE,MAAAA,QAAA,gBAEHK,cAAA,CAAA,KAAA,EAAA;AAAKN,QAAAA,SAAS,EAAEQ,SAAI,CAAC,2BAA2B,CAAE;AAAAP,QAAAA,QAAA,EAAEJ;OAAW,CAC/D,EAACI,QAAQ,EACRF,SAAS,iBACRO,cAAA,CAACI,kBAAU,EAAA;AACTC,QAAAA,IAAI,EAAE,EAAG;AACTC,QAAAA,QAAQ,EAAC,WAAW;AACpB,QAAA,YAAA,EAAYR,IAAI,CAACS,aAAa,CAACC,4BAAgB,CAACC,SAAS,CAAE;AAC3DC,QAAAA,OAAO,EAAEjB,SAAU;AAAAE,QAAAA,QAAA,eAEnBK,cAAA,CAACW,WAAK,EAAA,EAAA;AACR,OAAY,CACb,EACAnB,OAAO,iBAAIQ,cAAA,CAAA,KAAA,EAAA;AAAKN,QAAAA,SAAS,EAAC,6BAA6B;AAAAC,QAAAA,QAAA,EAAEH;AAAO,OAAM,CAAC;KACrE;AACP,GAAkB,CAAC;AAEvB,CAAC;AAGHL,eAAe,CAACyB,WAAW,GAAG,iBAAiB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePrompt.mjs","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Emphasis, Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { forwardRef, HTMLAttributes, ReactNode } from 'react';\n\nexport type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The sentiment determines the colour scheme.\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * The emphasis level affecting background and text contrast.\n * @default 'base'\n */\n emphasis?: Emphasis;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Test ID for testing tools\n */\n 'data-testid'?: string;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */\nexport const PrimitivePrompt = forwardRef<HTMLDivElement, PrimitivePromptProps>(\n (\n {\n sentiment = 'success',\n emphasis = 'base',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n },\n ref,\n ) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n // @ts-expect-error - SentimentSurface forwardRef types don't expose ref in props\n ref={ref}\n sentiment={sentiment}\n emphasis={emphasis}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div\n className={clsx('wds-prompt__content-wrapper', {\n 'wds-prompt__content-wrapper--with-dismiss': !!onDismiss,\n })}\n >\n <div className={clsx('wds-prompt__media-wrapper')}>{media}</div>\n {children}\n {onDismiss && (\n <IconButton\n size={24}\n priority=\"secondary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onDismiss}\n >\n <Cross />\n </IconButton>\n )}\n {actions && <div className=\"wds-prompt__actions-wrapper\">{actions}</div>}\n </div>\n </SentimentSurface>\n );\n },\n);\n\nPrimitivePrompt.displayName = 'PrimitivePrompt';\n"],"names":["PrimitivePrompt","forwardRef","sentiment","emphasis","media","actions","onDismiss","className","children","restProps","ref","intl","useIntl","_jsx","SentimentSurface","clsx","_jsxs","IconButton","size","priority","formatMessage","closeBtnMessages","ariaLabel","onClick","Cross","displayName"],"mappings":";;;;;;;;;AAwCO,MAAMA,eAAe,gBAAGC,UAAU,CACvC,CACE;AACEC,EAAAA,SAAS,GAAG,SAAS;AACrBC,EAAAA,QAAQ,GAAG,MAAM;EACjBC,KAAK;EACLC,OAAO;EACPC,SAAS;EACTC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAS,CACb,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;AAEtB,EAAA,oBACEC,GAAA,CAACC;AACC;AAAA,IAAA;AACAJ,IAAAA,GAAG,EAAEA,GAAI;AACTR,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,QAAQ,EAAEA,QAAS;IACnBI,SAAS,EAAEQ,IAAI,CAAC,YAAY,EAAE,eAAeb,SAAS,CAAA,CAAE,EAAEK,SAAS,CAAE;AAAA,IAAA,GACjEE,SAAS;AAAAD,IAAAA,QAAA,eAEbQ,IAAA,CAAA,KAAA,EAAA;AACET,MAAAA,SAAS,EAAEQ,IAAI,CAAC,6BAA6B,EAAE;QAC7C,2CAA2C,EAAE,CAAC,CAACT;AAChD,OAAA,CAAE;AAAAE,MAAAA,QAAA,gBAEHK,GAAA,CAAA,KAAA,EAAA;AAAKN,QAAAA,SAAS,EAAEQ,IAAI,CAAC,2BAA2B,CAAE;AAAAP,QAAAA,QAAA,EAAEJ;OAAW,CAC/D,EAACI,QAAQ,EACRF,SAAS,iBACRO,GAAA,CAACI,UAAU,EAAA;AACTC,QAAAA,IAAI,EAAE,EAAG;AACTC,QAAAA,QAAQ,EAAC,WAAW;AACpB,QAAA,YAAA,EAAYR,IAAI,CAACS,aAAa,CAACC,gBAAgB,CAACC,SAAS,CAAE;AAC3DC,QAAAA,OAAO,EAAEjB,SAAU;AAAAE,QAAAA,QAAA,eAEnBK,GAAA,CAACW,KAAK,EAAA,EAAA;AACR,OAAY,CACb,EACAnB,OAAO,iBAAIQ,GAAA,CAAA,KAAA,EAAA;AAAKN,QAAAA,SAAS,EAAC,6BAA6B;AAAAC,QAAAA,QAAA,EAAEH;AAAO,OAAM,CAAC;KACrE;AACP,GAAkB,CAAC;AAEvB,CAAC;AAGHL,eAAe,CAACyB,WAAW,GAAG,iBAAiB;;;;"}
|
|
1
|
+
{"version":3,"file":"PrimitivePrompt.mjs","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Emphasis, Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { forwardRef, HTMLAttributes, ReactNode } from 'react';\n\nexport type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The sentiment determines the colour scheme.\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * The emphasis level affecting background and text contrast.\n * @default 'base'\n */\n emphasis?: Emphasis;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Test ID for testing tools\n */\n 'data-testid'?: string;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding-x. */\nexport const PrimitivePrompt = forwardRef<HTMLDivElement, PrimitivePromptProps>(\n (\n {\n sentiment = 'success',\n emphasis = 'base',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n },\n ref,\n ) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n // @ts-expect-error - SentimentSurface forwardRef types don't expose ref in props\n ref={ref}\n sentiment={sentiment}\n emphasis={emphasis}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div\n className={clsx('wds-prompt__content-wrapper', {\n 'wds-prompt__content-wrapper--with-dismiss': !!onDismiss,\n })}\n >\n <div className={clsx('wds-prompt__media-wrapper')}>{media}</div>\n {children}\n {onDismiss && (\n <IconButton\n size={24}\n priority=\"secondary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onDismiss}\n >\n <Cross />\n </IconButton>\n )}\n {actions && <div className=\"wds-prompt__actions-wrapper\">{actions}</div>}\n </div>\n </SentimentSurface>\n );\n },\n);\n\nPrimitivePrompt.displayName = 'PrimitivePrompt';\n"],"names":["PrimitivePrompt","forwardRef","sentiment","emphasis","media","actions","onDismiss","className","children","restProps","ref","intl","useIntl","_jsx","SentimentSurface","clsx","_jsxs","IconButton","size","priority","formatMessage","closeBtnMessages","ariaLabel","onClick","Cross","displayName"],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6B;AAAAC,QAAAA,QAAA,EAAEH;AAAO,OAAM,CAAC;KACrE;AACP,GAAkB,CAAC;AAEvB,CAAC;AAGHL,eAAe,CAACyB,WAAW,GAAG,iBAAiB;;;;"}
|
package/build/styles/main.css
CHANGED
|
@@ -31706,8 +31706,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31706
31706
|
gap: 16px;
|
|
31707
31707
|
gap: var(--Prompt-gap, var(--size-16));
|
|
31708
31708
|
word-wrap: break-word;
|
|
31709
|
-
padding: 8px;
|
|
31710
|
-
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
31709
|
+
padding: 8px 8px;
|
|
31710
|
+
padding: var(--Prompt-padding-y, var(--padding-x-small)) var(--Prompt-padding-x, var(--padding-x-small));
|
|
31711
31711
|
text-align: left;
|
|
31712
31712
|
word-break: break-word;
|
|
31713
31713
|
width: 100%;
|
|
@@ -31759,7 +31759,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31759
31759
|
|
|
31760
31760
|
.wds-inline-prompt {
|
|
31761
31761
|
--Prompt-gap: calc(var(--size-12) / 2);
|
|
31762
|
-
--Prompt-padding
|
|
31762
|
+
--Prompt-padding-x: var(--padding-x-small);
|
|
31763
|
+
--Prompt-padding-y: calc(var(--padding-x-small) / 2);
|
|
31763
31764
|
display: inline-flex;
|
|
31764
31765
|
border-radius: 10px;
|
|
31765
31766
|
border-radius: var(--radius-small);
|
|
@@ -31829,7 +31830,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31829
31830
|
.wds-info-prompt {
|
|
31830
31831
|
--Prompt-border-radius: var(--radius-medium);
|
|
31831
31832
|
--Prompt-gap: var(--size-8);
|
|
31832
|
-
--Prompt-padding: var(--size-12);
|
|
31833
|
+
--Prompt-padding-x: var(--size-12);
|
|
31834
|
+
--Prompt-padding-y: var(--size-12);
|
|
31833
31835
|
}
|
|
31834
31836
|
|
|
31835
31837
|
.wds-info-prompt__content {
|
|
@@ -31895,7 +31897,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31895
31897
|
}
|
|
31896
31898
|
|
|
31897
31899
|
.wds-action-prompt {
|
|
31898
|
-
--Prompt-padding: var(--size-16);
|
|
31900
|
+
--Prompt-padding-x: var(--size-16);
|
|
31901
|
+
--Prompt-padding-y: var(--size-16);
|
|
31899
31902
|
--Prompt-actions-gap: var(--size-8);
|
|
31900
31903
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
31901
31904
|
--Prompt-border-radius: var(--radius-large);
|
|
@@ -31930,7 +31933,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31930
31933
|
}
|
|
31931
31934
|
|
|
31932
31935
|
.wds-critical-banner {
|
|
31933
|
-
--Prompt-padding: var(--
|
|
31936
|
+
--Prompt-padding-x: var(--wds-container-padding-inline);
|
|
31937
|
+
--Prompt-padding-y: var(--size-16);
|
|
31934
31938
|
--Prompt-actions-gap: var(--size-8);
|
|
31935
31939
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
31936
31940
|
--Prompt-border-radius: 0;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.wds-critical-banner {
|
|
2
|
-
--Prompt-padding: var(--
|
|
2
|
+
--Prompt-padding-x: var(--wds-container-padding-inline);
|
|
3
|
+
--Prompt-padding-y: var(--size-16);
|
|
3
4
|
--Prompt-actions-gap: var(--size-8);
|
|
4
5
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
5
6
|
--Prompt-border-radius: 0;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.wds-inline-prompt {
|
|
2
2
|
--Prompt-gap: calc(var(--size-12) / 2);
|
|
3
|
-
--Prompt-padding
|
|
3
|
+
--Prompt-padding-x: var(--padding-x-small);
|
|
4
|
+
--Prompt-padding-y: calc(var(--padding-x-small) / 2);
|
|
4
5
|
display: inline-flex;
|
|
5
6
|
border-radius: 10px;
|
|
6
7
|
border-radius: var(--radius-small);
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
gap: 16px;
|
|
6
6
|
gap: var(--Prompt-gap, var(--size-16));
|
|
7
7
|
word-wrap: break-word;
|
|
8
|
-
padding: 8px;
|
|
9
|
-
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
8
|
+
padding: 8px 8px;
|
|
9
|
+
padding: var(--Prompt-padding-y, var(--padding-x-small)) var(--Prompt-padding-x, var(--padding-x-small));
|
|
10
10
|
text-align: left;
|
|
11
11
|
word-break: break-word;
|
|
12
12
|
width: 100%;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentPropsWithRef, ElementType, PropsWithChildren } from 'react';
|
|
2
2
|
import { CommonProps } from '../common';
|
|
3
3
|
type ContainerOwnProps<T extends ElementType> = CommonProps & {
|
|
4
4
|
/** Controls the maximum width: `fluid` (100%), `standard` (1160px), `narrow` (840px), `compact` (600px). @default 'standard' */
|
|
5
5
|
size?: 'fluid' | 'standard' | 'narrow' | 'compact';
|
|
6
6
|
as?: T;
|
|
7
7
|
};
|
|
8
|
-
export type ContainerProps<T extends ElementType = 'div'> = PropsWithChildren<ContainerOwnProps<T>> & Omit<
|
|
8
|
+
export type ContainerProps<T extends ElementType = 'div'> = PropsWithChildren<ContainerOwnProps<T>> & Omit<ComponentPropsWithRef<T>, keyof ContainerOwnProps<T> | 'children'>;
|
|
9
9
|
/**
|
|
10
10
|
* Centers page content within a responsive max-width boundary, with automatic horizontal padding that adapts to the viewport size.
|
|
11
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/container/Container.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/container/Container.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,KAAK,iBAAiB,CAAC,CAAC,SAAS,WAAW,IAAI,WAAW,GAAG;IAC5D,gIAAgI;IAChI,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;IACnD,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,iBAAiB,CAC3E,iBAAiB,CAAC,CAAC,CAAC,CACrB,GACC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,MAAM,iBAAiB,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC;AAE1E;;;;GAIG;AACH,QAAA,MAAM,SAAS,GAAI,CAAC,SAAS,WAAW,GAAG,KAAK,EAAE,kDAM/C,cAAc,CAAC,CAAC,CAAC,gCAOnB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -16,6 +16,6 @@ declare const IconButton: import("react").ForwardRefExoticComponent<{
|
|
|
16
16
|
/** @default 'default' */
|
|
17
17
|
type?: "default" | "negative";
|
|
18
18
|
'data-testid'?: string;
|
|
19
|
-
} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "onClick" | "
|
|
19
|
+
} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "onClick" | "target" | "href"> & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "onClick"> & Pick<HTMLAttributes<HTMLDivElement>, "id" | "className" | "tabIndex" | "role" | "aria-label" | "children"> & import("react").RefAttributes<unknown>>;
|
|
20
20
|
export default IconButton;
|
|
21
21
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CriticalBanner.d.ts","sourceRoot":"","sources":["../../../../src/prompt/CriticalBanner/CriticalBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CriticalBanner.d.ts","sourceRoot":"","sources":["../../../../src/prompt/CriticalBanner/CriticalBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAmB,MAAM,OAAO,CAAC;AAOhE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAmB,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAqB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAKxE,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG;QAC1D,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;KAChC,CAAC;IACF,eAAe,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG;QACnE,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;KAChC,CAAC;IACF,SAAS,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC,CAAC;IACtE;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,GAAG,IAAI,CAAC,oBAAoB,EAAE,IAAI,GAAG,WAAW,GAAG,aAAa,CAAC,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,4IAY5B,mBAAmB,gCAgIrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -30,7 +30,7 @@ export type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
32
|
* PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.
|
|
33
|
-
* Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */
|
|
33
|
+
* Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding-x. */
|
|
34
34
|
export declare const PrimitivePrompt: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
35
35
|
/**
|
|
36
36
|
* The sentiment determines the colour scheme.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePrompt.d.ts","sourceRoot":"","sources":["../../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"names":[],"mappings":"AAEA,OAAyB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAI/E,OAAO,EAAc,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAClE;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;
|
|
1
|
+
{"version":3,"file":"PrimitivePrompt.d.ts","sourceRoot":"","sources":["../../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"names":[],"mappings":"AAEA,OAAyB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAI/E,OAAO,EAAc,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAClE;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;gHAEgH;AAChH,eAAO,MAAM,eAAe;IA/B1B;;;OAGG;gBACS,SAAS;IACrB;;;OAGG;eACQ,QAAQ;IACnB;;OAEG;WACI,SAAS;IAChB;;OAEG;cACO,SAAS;IACnB;;OAEG;gBACS,MAAM,IAAI;IACtB;;OAEG;oBACa,MAAM;kDAqDvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ComponentPropsWithRef, ElementType, PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
4
|
import { CommonProps } from '../common';
|
|
5
5
|
|
|
@@ -12,7 +12,7 @@ type ContainerOwnProps<T extends ElementType> = CommonProps & {
|
|
|
12
12
|
export type ContainerProps<T extends ElementType = 'div'> = PropsWithChildren<
|
|
13
13
|
ContainerOwnProps<T>
|
|
14
14
|
> &
|
|
15
|
-
Omit<
|
|
15
|
+
Omit<ComponentPropsWithRef<T>, keyof ContainerOwnProps<T> | 'children'>;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Centers page content within a responsive max-width boundary, with automatic horizontal padding that adapts to the viewport size.
|
package/src/main.css
CHANGED
|
@@ -31706,8 +31706,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31706
31706
|
gap: 16px;
|
|
31707
31707
|
gap: var(--Prompt-gap, var(--size-16));
|
|
31708
31708
|
word-wrap: break-word;
|
|
31709
|
-
padding: 8px;
|
|
31710
|
-
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
31709
|
+
padding: 8px 8px;
|
|
31710
|
+
padding: var(--Prompt-padding-y, var(--padding-x-small)) var(--Prompt-padding-x, var(--padding-x-small));
|
|
31711
31711
|
text-align: left;
|
|
31712
31712
|
word-break: break-word;
|
|
31713
31713
|
width: 100%;
|
|
@@ -31759,7 +31759,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31759
31759
|
|
|
31760
31760
|
.wds-inline-prompt {
|
|
31761
31761
|
--Prompt-gap: calc(var(--size-12) / 2);
|
|
31762
|
-
--Prompt-padding
|
|
31762
|
+
--Prompt-padding-x: var(--padding-x-small);
|
|
31763
|
+
--Prompt-padding-y: calc(var(--padding-x-small) / 2);
|
|
31763
31764
|
display: inline-flex;
|
|
31764
31765
|
border-radius: 10px;
|
|
31765
31766
|
border-radius: var(--radius-small);
|
|
@@ -31829,7 +31830,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31829
31830
|
.wds-info-prompt {
|
|
31830
31831
|
--Prompt-border-radius: var(--radius-medium);
|
|
31831
31832
|
--Prompt-gap: var(--size-8);
|
|
31832
|
-
--Prompt-padding: var(--size-12);
|
|
31833
|
+
--Prompt-padding-x: var(--size-12);
|
|
31834
|
+
--Prompt-padding-y: var(--size-12);
|
|
31833
31835
|
}
|
|
31834
31836
|
|
|
31835
31837
|
.wds-info-prompt__content {
|
|
@@ -31895,7 +31897,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31895
31897
|
}
|
|
31896
31898
|
|
|
31897
31899
|
.wds-action-prompt {
|
|
31898
|
-
--Prompt-padding: var(--size-16);
|
|
31900
|
+
--Prompt-padding-x: var(--size-16);
|
|
31901
|
+
--Prompt-padding-y: var(--size-16);
|
|
31899
31902
|
--Prompt-actions-gap: var(--size-8);
|
|
31900
31903
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
31901
31904
|
--Prompt-border-radius: var(--radius-large);
|
|
@@ -31930,7 +31933,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31930
31933
|
}
|
|
31931
31934
|
|
|
31932
31935
|
.wds-critical-banner {
|
|
31933
|
-
--Prompt-padding: var(--
|
|
31936
|
+
--Prompt-padding-x: var(--wds-container-padding-inline);
|
|
31937
|
+
--Prompt-padding-y: var(--size-16);
|
|
31934
31938
|
--Prompt-actions-gap: var(--size-8);
|
|
31935
31939
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
31936
31940
|
--Prompt-border-radius: 0;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.wds-critical-banner {
|
|
2
|
-
--Prompt-padding: var(--
|
|
2
|
+
--Prompt-padding-x: var(--wds-container-padding-inline);
|
|
3
|
+
--Prompt-padding-y: var(--size-16);
|
|
3
4
|
--Prompt-actions-gap: var(--size-8);
|
|
4
5
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
5
6
|
--Prompt-border-radius: 0;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
@import (reference) "./CriticalBanner.vars.less";
|
|
3
3
|
|
|
4
4
|
.wds-critical-banner {
|
|
5
|
-
--Prompt-padding: var(--
|
|
5
|
+
--Prompt-padding-x: var(--wds-container-padding-inline);
|
|
6
|
+
--Prompt-padding-y: var(--size-16);
|
|
6
7
|
--Prompt-actions-gap: var(--size-8);
|
|
7
8
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
8
9
|
--Prompt-border-radius: 0;
|
|
@@ -19,7 +19,7 @@ const meta = {
|
|
|
19
19
|
component: CriticalBanner,
|
|
20
20
|
title: 'Prompts/CriticalBanner',
|
|
21
21
|
tags: ['new'],
|
|
22
|
-
parameters: { docs: { toc: true } },
|
|
22
|
+
parameters: { docs: { toc: true }, padding: '0', },
|
|
23
23
|
args: {
|
|
24
24
|
title: 'Your account requires verification',
|
|
25
25
|
description: 'Please verify your identity to continue using all features.',
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ReactNode, useId, useState } from 'react';
|
|
1
|
+
import { ElementType, ReactNode, useId, useState } from 'react';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
|
|
4
4
|
import Body from '../../body';
|
|
5
5
|
import Button from '../../button';
|
|
6
|
+
import Container from '../../container';
|
|
6
7
|
import { Breakpoint, LiveRegion, Typography } from '../../common';
|
|
7
8
|
import { ButtonProps } from '../../button/Button.types';
|
|
8
9
|
import { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';
|
|
@@ -78,7 +79,9 @@ export const CriticalBanner = ({
|
|
|
78
79
|
.join(' ');
|
|
79
80
|
|
|
80
81
|
const bannerSurface = (
|
|
81
|
-
<
|
|
82
|
+
<Container
|
|
83
|
+
size="fluid"
|
|
84
|
+
as={PrimitivePrompt as ElementType}
|
|
82
85
|
ref={containerRef}
|
|
83
86
|
id={id}
|
|
84
87
|
sentiment={sentiment}
|
|
@@ -162,7 +165,7 @@ export const CriticalBanner = ({
|
|
|
162
165
|
className="wds-critical-banner__toggle"
|
|
163
166
|
onToggle={handleToggle}
|
|
164
167
|
/>
|
|
165
|
-
</
|
|
168
|
+
</Container>
|
|
166
169
|
);
|
|
167
170
|
|
|
168
171
|
return (
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.wds-inline-prompt {
|
|
2
2
|
--Prompt-gap: calc(var(--size-12) / 2);
|
|
3
|
-
--Prompt-padding
|
|
3
|
+
--Prompt-padding-x: var(--padding-x-small);
|
|
4
|
+
--Prompt-padding-y: calc(var(--padding-x-small) / 2);
|
|
4
5
|
display: inline-flex;
|
|
5
6
|
border-radius: 10px;
|
|
6
7
|
border-radius: var(--radius-small);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.wds-inline-prompt {
|
|
2
2
|
--Prompt-gap: calc(var(--size-12) / 2);
|
|
3
|
-
--Prompt-padding
|
|
3
|
+
--Prompt-padding-x: var(--padding-x-small);
|
|
4
|
+
--Prompt-padding-y: calc(var(--padding-x-small) / 2);
|
|
4
5
|
|
|
5
6
|
display: inline-flex;
|
|
6
7
|
border-radius: var(--radius-small);
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
gap: 16px;
|
|
6
6
|
gap: var(--Prompt-gap, var(--size-16));
|
|
7
7
|
word-wrap: break-word;
|
|
8
|
-
padding: 8px;
|
|
9
|
-
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
8
|
+
padding: 8px 8px;
|
|
9
|
+
padding: var(--Prompt-padding-y, var(--padding-x-small)) var(--Prompt-padding-x, var(--padding-x-small));
|
|
10
10
|
text-align: left;
|
|
11
11
|
word-break: break-word;
|
|
12
12
|
width: 100%;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
display: flex;
|
|
4
4
|
gap: var(--Prompt-gap, var(--size-16));
|
|
5
5
|
overflow-wrap: break-word;
|
|
6
|
-
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
6
|
+
padding: var(--Prompt-padding-y, var(--padding-x-small)) var(--Prompt-padding-x, var(--padding-x-small));
|
|
7
7
|
text-align: left;
|
|
8
8
|
word-break: break-word;
|
|
9
9
|
width: 100%;
|
|
@@ -37,7 +37,7 @@ export type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.
|
|
40
|
-
* Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */
|
|
40
|
+
* Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding-x. */
|
|
41
41
|
export const PrimitivePrompt = forwardRef<HTMLDivElement, PrimitivePromptProps>(
|
|
42
42
|
(
|
|
43
43
|
{
|