@doist/reactist 26.2.5 → 27.0.0
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/dist/reactist.cjs.development.js +304 -179
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/banner/banner.js +96 -33
- package/es/banner/banner.js.map +1 -1
- package/es/banner/banner.module.css.js +1 -1
- package/es/icons/banner-icon.js +115 -0
- package/es/icons/banner-icon.js.map +1 -0
- package/es/index.js +0 -1
- package/es/index.js.map +1 -1
- package/lib/banner/banner.d.ts +81 -22
- package/lib/banner/banner.js +1 -1
- package/lib/banner/banner.js.map +1 -1
- package/lib/banner/banner.module.css.js +1 -1
- package/lib/banner/story-promo-image.d.ts +4 -0
- package/lib/icons/banner-icon.d.ts +6 -0
- package/lib/icons/banner-icon.js +2 -0
- package/lib/icons/banner-icon.js.map +1 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/styles/banner.css +5 -2
- package/styles/banner.module.css.css +1 -1
- package/styles/reactist.css +1 -2
- package/es/alert/alert.js +0 -53
- package/es/alert/alert.js.map +0 -1
- package/es/alert/alert.module.css.js +0 -4
- package/es/alert/alert.module.css.js.map +0 -1
- package/lib/alert/alert.d.ts +0 -17
- package/lib/alert/alert.js +0 -2
- package/lib/alert/alert.js.map +0 -1
- package/lib/alert/alert.module.css.js +0 -2
- package/lib/alert/alert.module.css.js.map +0 -1
- package/lib/alert/index.d.ts +0 -1
- package/styles/alert.css +0 -10
- package/styles/alert.module.css.css +0 -1
package/es/banner/banner.js
CHANGED
|
@@ -1,61 +1,124 @@
|
|
|
1
1
|
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Box } from '../box/box.js';
|
|
4
|
-
import { Columns, Column } from '../columns/columns.js';
|
|
5
4
|
import { useId } from '../utils/common-helpers.js';
|
|
6
5
|
import modules_afa80466 from './banner.module.css.js';
|
|
6
|
+
import { Button, IconButton } from '../button/button.js';
|
|
7
|
+
import { CloseIcon } from '../icons/close-icon.js';
|
|
8
|
+
import { BannerIcon } from '../icons/banner-icon.js';
|
|
9
|
+
import { TextLink } from '../text-link/text-link.js';
|
|
7
10
|
|
|
8
|
-
const _excluded = ["id", "
|
|
11
|
+
const _excluded = ["id", "type", "title", "description", "action", "icon", "image", "inlineLinks", "closeLabel", "onClose"],
|
|
12
|
+
_excluded2 = ["label"],
|
|
13
|
+
_excluded3 = ["type", "label"],
|
|
14
|
+
_excluded4 = ["type", "label", "variant"];
|
|
9
15
|
const Banner = /*#__PURE__*/React.forwardRef(function Banner(_ref, ref) {
|
|
10
16
|
let {
|
|
11
17
|
id,
|
|
12
|
-
|
|
13
|
-
icon,
|
|
18
|
+
type,
|
|
14
19
|
title,
|
|
15
20
|
description,
|
|
16
|
-
action
|
|
21
|
+
action,
|
|
22
|
+
icon,
|
|
23
|
+
image,
|
|
24
|
+
inlineLinks,
|
|
25
|
+
closeLabel,
|
|
26
|
+
onClose
|
|
17
27
|
} = _ref,
|
|
18
28
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
29
|
|
|
20
30
|
const titleId = useId();
|
|
21
31
|
const descriptionId = useId();
|
|
32
|
+
const closeButton = onClose ? /*#__PURE__*/React.createElement(IconButton, {
|
|
33
|
+
exceptionallySetClassName: modules_afa80466.closeButton,
|
|
34
|
+
variant: "quaternary",
|
|
35
|
+
onClick: onClose,
|
|
36
|
+
icon: /*#__PURE__*/React.createElement(CloseIcon, null),
|
|
37
|
+
"aria-label": closeLabel != null ? closeLabel : 'Close banner'
|
|
38
|
+
}) : null;
|
|
22
39
|
return /*#__PURE__*/React.createElement(Box, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
23
40
|
ref: ref,
|
|
24
41
|
id: id,
|
|
42
|
+
display: "flex",
|
|
43
|
+
flexDirection: "column",
|
|
44
|
+
justifyContent: "center",
|
|
25
45
|
role: "status",
|
|
26
|
-
"aria-labelledby": titleId,
|
|
27
|
-
"aria-describedby": descriptionId,
|
|
46
|
+
"aria-labelledby": title ? titleId : descriptionId,
|
|
47
|
+
"aria-describedby": title ? descriptionId : undefined,
|
|
28
48
|
"aria-live": "polite",
|
|
29
49
|
tabIndex: 0,
|
|
30
|
-
borderRadius: "
|
|
31
|
-
className:
|
|
32
|
-
}), /*#__PURE__*/React.createElement(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
borderRadius: "full",
|
|
51
|
+
className: modules_afa80466.banner
|
|
52
|
+
}), image ? /*#__PURE__*/React.createElement(Box, {
|
|
53
|
+
className: modules_afa80466.image
|
|
54
|
+
}, image) : null, /*#__PURE__*/React.createElement(Box, {
|
|
55
|
+
className: modules_afa80466.content,
|
|
56
|
+
display: "flex",
|
|
57
|
+
gap: "small",
|
|
58
|
+
alignItems: "center"
|
|
59
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
60
|
+
className: modules_afa80466.staticContent,
|
|
61
|
+
display: "flex",
|
|
62
|
+
gap: "small",
|
|
63
|
+
flexGrow: 1
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
65
|
+
className: modules_afa80466.icon
|
|
66
|
+
}, type === 'neutral' ? icon : /*#__PURE__*/React.createElement(BannerIcon, {
|
|
67
|
+
type: type
|
|
68
|
+
}), closeButton), /*#__PURE__*/React.createElement(Box, {
|
|
69
|
+
className: modules_afa80466.copy,
|
|
70
|
+
display: "flex",
|
|
71
|
+
flexDirection: "column"
|
|
72
|
+
}, title ? /*#__PURE__*/React.createElement(Box, {
|
|
48
73
|
id: titleId,
|
|
49
|
-
className:
|
|
50
|
-
|
|
51
|
-
modules_afa80466["title-without-description"], modules_afa80466["title-" + tone]]
|
|
52
|
-
}, title), description ? /*#__PURE__*/React.createElement(Box, {
|
|
74
|
+
className: modules_afa80466.title
|
|
75
|
+
}, title) : null, /*#__PURE__*/React.createElement(Box, {
|
|
53
76
|
id: descriptionId,
|
|
54
|
-
className: [modules_afa80466.description, modules_afa80466
|
|
55
|
-
}, description
|
|
56
|
-
|
|
57
|
-
|
|
77
|
+
className: [modules_afa80466.description, title ? modules_afa80466.secondary : null]
|
|
78
|
+
}, description, inlineLinks == null ? void 0 : inlineLinks.map((_ref2, index) => {
|
|
79
|
+
let {
|
|
80
|
+
label
|
|
81
|
+
} = _ref2,
|
|
82
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
83
|
+
|
|
84
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
85
|
+
key: index
|
|
86
|
+
}, /*#__PURE__*/React.createElement(TextLink, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
87
|
+
exceptionallySetClassName: modules_afa80466.inlineLink
|
|
88
|
+
}), label), index < inlineLinks.length - 1 ? /*#__PURE__*/React.createElement("span", null, " \u00B7 ") : '');
|
|
89
|
+
})))), action || closeButton ? /*#__PURE__*/React.createElement(Box, {
|
|
90
|
+
className: modules_afa80466.actions,
|
|
91
|
+
display: "flex",
|
|
92
|
+
gap: "small"
|
|
93
|
+
}, (action == null ? void 0 : action.type) === 'button' ? /*#__PURE__*/React.createElement(ActionButton, _objectSpread2({}, action)) : null, (action == null ? void 0 : action.type) === 'link' ? /*#__PURE__*/React.createElement(ActionLink, _objectSpread2({}, action)) : null, closeButton) : null));
|
|
58
94
|
});
|
|
59
95
|
|
|
96
|
+
function ActionButton(_ref3) {
|
|
97
|
+
let {
|
|
98
|
+
type,
|
|
99
|
+
label
|
|
100
|
+
} = _ref3,
|
|
101
|
+
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
102
|
+
|
|
103
|
+
return /*#__PURE__*/React.createElement(Button, _objectSpread2({}, props), label);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function ActionLink(_ref4) {
|
|
107
|
+
let {
|
|
108
|
+
type,
|
|
109
|
+
label,
|
|
110
|
+
variant
|
|
111
|
+
} = _ref4,
|
|
112
|
+
props = _objectWithoutProperties(_ref4, _excluded4);
|
|
113
|
+
|
|
114
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
115
|
+
variant: variant,
|
|
116
|
+
render: /*#__PURE__*/React.createElement("a", _objectSpread2({
|
|
117
|
+
rel: "noopener noreferrer",
|
|
118
|
+
target: "_blank"
|
|
119
|
+
}, props))
|
|
120
|
+
}, label);
|
|
121
|
+
}
|
|
122
|
+
|
|
60
123
|
export { Banner };
|
|
61
124
|
//# sourceMappingURL=banner.js.map
|
package/es/banner/banner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sources":["../../src/banner/banner.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box } from '../box'\nimport { Columns, Column } from '../columns'\nimport { useId } from '../utils/common-helpers'\n\nimport styles from './banner.module.css'\n\nexport type BannerTone = 'info' | 'promotion'\n\ntype BannerProps = {\n id?: string\n\n /**\n * The tone of the Banner. Affects the background color and the outline.\n */\n tone: BannerTone\n\n /**\n * The icon that should be added inside the Banner.\n */\n icon: React.ReactElement | string | number\n\n /**\n * The title to be displayed at the top of the Banner.\n */\n title: React.ReactNode\n\n /**\n * An optional description to be displayed inside the Banner.\n */\n description?: React.ReactNode\n\n /**\n * An optional action to displayed inside the Banner.\n */\n action?: React.ReactElement | string | number\n}\n\nconst Banner = React.forwardRef<HTMLDivElement, BannerProps>(function Banner(\n { id, tone, icon, title, description, action, ...props }: BannerProps,\n ref,\n) {\n const titleId = useId()\n const descriptionId = useId()\n return (\n <Box\n {...props}\n ref={ref}\n id={id}\n role=\"status\"\n aria-labelledby={titleId}\n aria-describedby={descriptionId}\n aria-live=\"polite\"\n tabIndex={0}\n borderRadius=\"standard\"\n className={[styles.banner, styles[`banner-${tone}`]]}\n >\n <Columns space=\"medium\" alignY=\"center\">\n <Column\n width=\"content\"\n aria-hidden\n style={{\n /* Make sure the icon is centered vertically */\n lineHeight: 0,\n }}\n >\n {icon}\n </Column>\n <Column>\n <Box paddingY=\"xsmall\">\n {description ? (\n <Box id={titleId} className={[styles.title, styles[`title-${tone}`]]}>\n {title}\n </Box>\n ) : (\n <Box\n id={titleId}\n className={[\n styles.title,\n // If the banner does not have a description, we need to slightly tweak\n // the styling of the title applying an extra css class\n styles[`title-without-description`],\n styles[`title-${tone}`],\n ]}\n >\n {title}\n </Box>\n )}\n {description ? (\n <Box\n id={descriptionId}\n className={[styles.description, styles[`description-${tone}`]]}\n >\n {description}\n </Box>\n ) : null}\n </Box>\n </Column>\n {action ? <Column width=\"content\">{action}</Column> : null}\n </Columns>\n </Box>\n )\n})\n\nexport { Banner }\nexport type { BannerProps }\n"],"names":["Banner","React","forwardRef","ref","id","tone","icon","title","description","action","props","titleId","useId","descriptionId","Box","role","tabIndex","borderRadius","className","styles","banner","createElement","Columns","space","alignY","Column","width","style","lineHeight","paddingY"],"mappings":";;;;;;;;AAsCMA,MAAAA,MAAM,gBAAGC,KAAK,CAACC,UAAN,CAA8C,SAASF,MAAT,CAEzDG,IAAAA,EAAAA,GAFyD,EAEtD;EAAA,IADH;IAAEC,EAAF;IAAMC,IAAN;IAAYC,IAAZ;IAAkBC,KAAlB;IAAyBC,WAAzB;AAAsCC,IAAAA,MAAAA;GACnC,GAAA,IAAA;AAAA,MAD8CC,KAC9C,GAAA,wBAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;;EAEH,MAAMC,OAAO,GAAGC,KAAK,EAArB,CAAA;EACA,MAAMC,aAAa,GAAGD,KAAK,EAA3B,CAAA;AACA,EAAA,oBACIX,mBAAA,CAACa,GAAD,oCACQJ,KADR,CAAA,EAAA,EAAA,EAAA;AAEIP,IAA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CAAA;GAFf,EAUKE,KAVL,CANR,EAmBKC,WAAW,gBACRP,mBAAA,CAACa,GAAD,EAAI;AACAV,IAAAA,EAAE,EAAES,aADJ;IAEAK,SAAS,EAAE,CAACC,gBAAM,CAACX,WAAR,EAAqBW,gBAAM,CAAgBd,cAAAA,GAAAA,IAAhB,CAA3B,CAAA;AAFX,GAAJ,EAIKG,WAJL,CADQ,GAOR,IA1BR,CADJ,CAXJ,EAyCKC,MAAM,gBAAGR,mBAAA,CAACwB,MAAD,EAAO;AAACC,IAAAA,KAAK,EAAC,SAAA;AAAP,GAAP,EAAyBjB,MAAzB,CAAH,GAA+C,IAzC1D,CAZJ,CADJ,CAAA;AA0DH,CAhEc;;;;"}
|
|
1
|
+
{"version":3,"file":"banner.js","sources":["../../src/banner/banner.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box } from '../box'\nimport { useId } from '../utils/common-helpers'\n\nimport styles from './banner.module.css'\nimport { Button, ButtonProps, IconButton } from '../button'\nimport { CloseIcon } from '../icons/close-icon'\nimport { BannerIcon } from '../icons/banner-icon'\nimport { TextLink } from '../text-link'\n\n/**\n * Represents the type of a banner.\n * 'neutral' accepts a custom icon, the rest do not.\n * @default 'neutral'\n */\nexport type BannerType = 'neutral' | SystemBannerType\n\n/**\n * Predefined system types for banners.\n * Each type has its own preset icon.\n */\nexport type SystemBannerType = 'info' | 'upgrade' | 'experiment' | 'warning' | 'error' | 'success'\n\ntype BaseAction = {\n variant: 'primary' | 'tertiary'\n label: string\n} & Pick<ButtonProps, 'loading' | 'disabled'>\ntype ActionButton = BaseAction & { type: 'button' } & Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'className'\n >\ntype ActionLink = BaseAction & { type: 'link' } & Omit<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n 'className'\n >\n/**\n * Represents an action that can be taken from the banner.\n * Can be either a button or a link, sharing common properties from BaseAction.\n */\ntype Action = ActionButton | ActionLink\n\n/**\n * Configuration for inline links within the banner description.\n * Extends TextLink component props with a required label.\n */\ntype InlineLink = { label: string } & React.ComponentProps<typeof TextLink>\n\ntype WithCloseButton = {\n closeLabel?: string\n onClose: () => void\n}\ntype WithoutCloseButton = {\n closeLabel?: never\n onClose?: never\n}\n/**\n * Controls the close button behavior.\n * If none is provided, the banner will not have a close button.\n */\ntype CloseButton = WithCloseButton | WithoutCloseButton\n\ntype BaseBanner = {\n id?: string\n title?: React.ReactNode\n description: Exclude<React.ReactNode, null | undefined | boolean>\n action?: Action\n inlineLinks?: InlineLink[]\n} & CloseButton\n\n/**\n * Configuration for neutral banners.\n * Can include either an image, an icon, or neither, but never both.\n */\ntype NeutralBanner = BaseBanner & {\n type: Extract<BannerType, 'neutral'>\n} & (\n | { image: React.ReactElement; icon?: never }\n | { icon: React.ReactElement; image?: never }\n | { image?: never; icon?: never }\n )\n\n/**\n * Configuration for system banners.\n * Cannot include custom images or icons as they use preset ones.\n */\ntype SystemBanner = BaseBanner & {\n type: SystemBannerType\n image?: never\n icon?: never\n}\n\ntype BannerProps = NeutralBanner | SystemBanner\n\nconst Banner = React.forwardRef<HTMLDivElement, BannerProps>(function Banner(\n {\n id,\n type,\n title,\n description,\n action,\n icon,\n image,\n inlineLinks,\n closeLabel,\n onClose,\n ...props\n }: BannerProps,\n ref,\n) {\n const titleId = useId()\n const descriptionId = useId()\n\n const closeButton = onClose ? (\n <IconButton\n exceptionallySetClassName={styles.closeButton}\n variant=\"quaternary\"\n onClick={onClose}\n icon={<CloseIcon />}\n aria-label={closeLabel ?? 'Close banner'}\n />\n ) : null\n\n return (\n <Box\n {...props}\n ref={ref}\n id={id}\n display=\"flex\"\n flexDirection=\"column\"\n justifyContent=\"center\"\n role=\"status\"\n aria-labelledby={title ? titleId : descriptionId}\n aria-describedby={title ? descriptionId : undefined}\n aria-live=\"polite\"\n tabIndex={0}\n borderRadius=\"full\"\n className={styles.banner}\n >\n {image ? <Box className={styles.image}>{image}</Box> : null}\n\n <Box className={styles.content} display=\"flex\" gap=\"small\" alignItems=\"center\">\n <Box className={styles.staticContent} display=\"flex\" gap=\"small\" flexGrow={1}>\n <Box className={styles.icon}>\n {type === 'neutral' ? icon : <BannerIcon type={type} />}\n {closeButton}\n </Box>\n\n <Box className={styles.copy} display=\"flex\" flexDirection=\"column\">\n {title ? (\n <Box id={titleId} className={styles.title}>\n {title}\n </Box>\n ) : null}\n <Box\n id={descriptionId}\n className={[styles.description, title ? styles.secondary : null]}\n >\n {description}\n {inlineLinks?.map(({ label, ...props }, index) => {\n return (\n <React.Fragment key={index}>\n <TextLink\n {...props}\n exceptionallySetClassName={styles.inlineLink}\n >\n {label}\n </TextLink>\n {index < inlineLinks.length - 1 ? <span> · </span> : ''}\n </React.Fragment>\n )\n })}\n </Box>\n </Box>\n </Box>\n\n {action || closeButton ? (\n <Box className={styles.actions} display=\"flex\" gap=\"small\">\n {action?.type === 'button' ? <ActionButton {...action} /> : null}\n {action?.type === 'link' ? <ActionLink {...action} /> : null}\n {closeButton}\n </Box>\n ) : null}\n </Box>\n </Box>\n )\n})\n\nfunction ActionButton({ type, label, ...props }: ActionButton) {\n return <Button {...props}>{label}</Button>\n}\n\nfunction ActionLink({ type, label, variant, ...props }: ActionLink) {\n return (\n <Button\n variant={variant}\n render={<a rel=\"noopener noreferrer\" target=\"_blank\" {...props} />}\n >\n {label}\n </Button>\n )\n}\n\nexport { Banner }\nexport type { BannerProps }\n"],"names":["Banner","React","forwardRef","ref","id","type","title","description","action","icon","image","inlineLinks","closeLabel","onClose","props","titleId","useId","descriptionId","closeButton","createElement","IconButton","exceptionallySetClassName","styles","variant","onClick","CloseIcon","Box","display","flexDirection","justifyContent","role","undefined","tabIndex","borderRadius","className","banner","content","gap","alignItems","staticContent","flexGrow","BannerIcon","copy","secondary","map","index","label","Fragment","key","TextLink","inlineLink","length","actions","ActionButton","_objectSpread","ActionLink","Button","render","rel","target"],"mappings":";;;;;;;;;;;;;;AA6FMA,MAAAA,MAAM,gBAAGC,KAAK,CAACC,UAAN,CAA8C,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8d68de","title":"_05e2783a","secondary":"d5e077f5","icon":"dbf93d2e","closeButton":"_22f9ed25","copy":"_99ded674","inlineLink":"fe6dd094","staticContent":"e6ed6d9e","actions":"_51bd96a8"};
|
|
2
2
|
|
|
3
3
|
export { modules_afa80466 as default };
|
|
4
4
|
//# sourceMappingURL=banner.module.css.js.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
const _excluded = ["type"];
|
|
5
|
+
const bannerIconForType = {
|
|
6
|
+
info: BannerInfoIcon,
|
|
7
|
+
upgrade: BannerUpgradeIcon,
|
|
8
|
+
experiment: BannerExperimentIcon,
|
|
9
|
+
warning: BannerWarningIcon,
|
|
10
|
+
error: BannerErrorIcon,
|
|
11
|
+
success: BannerSuccessIcon
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function BannerIcon(_ref) {
|
|
15
|
+
let {
|
|
16
|
+
type
|
|
17
|
+
} = _ref,
|
|
18
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
|
|
20
|
+
const Icon = bannerIconForType[type];
|
|
21
|
+
return Icon ? /*#__PURE__*/React.createElement(Icon, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
22
|
+
"data-testid": "banner-icon-" + type,
|
|
23
|
+
"aria-hidden": true
|
|
24
|
+
})) : null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function BannerInfoIcon(props) {
|
|
28
|
+
return /*#__PURE__*/React.createElement("svg", _objectSpread2({
|
|
29
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
30
|
+
width: "24",
|
|
31
|
+
height: "24",
|
|
32
|
+
fill: "none"
|
|
33
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
34
|
+
fill: "#316FEA",
|
|
35
|
+
fillRule: "evenodd",
|
|
36
|
+
d: "M21 12.25a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-8-3.94a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-2.75 1.94a.75.75 0 0 0 0 1.5h1.25v3.5h-1.25a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5H13V11a.752.752 0 0 0-.75-.75h-2Z",
|
|
37
|
+
clipRule: "evenodd"
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function BannerUpgradeIcon(props) {
|
|
42
|
+
return /*#__PURE__*/React.createElement("svg", _objectSpread2({
|
|
43
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
44
|
+
width: "24",
|
|
45
|
+
height: "24",
|
|
46
|
+
fill: "none"
|
|
47
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
48
|
+
fill: "#F48318",
|
|
49
|
+
fillRule: "evenodd",
|
|
50
|
+
d: "M13.974 4.226a2.485 2.485 0 0 0-3.948 0 2.485 2.485 0 0 1-2.304.954A2.485 2.485 0 0 0 4.93 7.972a2.485 2.485 0 0 1-.954 2.304 2.485 2.485 0 0 0 0 3.948 2.485 2.485 0 0 1 .954 2.304 2.485 2.485 0 0 0 2.792 2.792 2.485 2.485 0 0 1 2.304.954 2.485 2.485 0 0 0 3.948 0 2.485 2.485 0 0 1 2.304-.954 2.485 2.485 0 0 0 2.792-2.792 2.485 2.485 0 0 1 .954-2.304 2.485 2.485 0 0 0 0-3.948 2.485 2.485 0 0 1-.954-2.304 2.485 2.485 0 0 0-2.792-2.792 2.485 2.485 0 0 1-2.304-.954ZM11.228 7.08c-.297-.581-1.177-.345-1.144.306l.125 2.437a.605.605 0 0 1-.635.635l-2.437-.125c-.651-.033-.887.847-.306 1.144l2.172 1.11c.32.163.428.567.233.868L7.91 15.503c-.355.548.289 1.192.837.837l2.047-1.326a.605.605 0 0 1 .868.233l1.11 2.172c.297.581 1.177.345 1.144-.306l-.125-2.437a.605.605 0 0 1 .635-.635l2.437.125c.651.033.887-.847.306-1.144l-2.172-1.11a.605.605 0 0 1-.233-.868l1.326-2.047c.355-.548-.289-1.192-.837-.837l-2.047 1.326a.605.605 0 0 1-.868-.233l-1.11-2.172Z",
|
|
51
|
+
clipRule: "evenodd"
|
|
52
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
53
|
+
fill: "#fff",
|
|
54
|
+
d: "M10.084 7.387c-.033-.651.847-.887 1.144-.306l1.11 2.172c.163.32.567.428.868.233l2.047-1.326c.548-.355 1.192.289.837.837l-1.326 2.047a.605.605 0 0 0 .233.868l2.172 1.11c.581.297.345 1.177-.306 1.144l-2.437-.125a.605.605 0 0 0-.635.635l.125 2.437c.033.651-.847.887-1.144.306l-1.11-2.172a.605.605 0 0 0-.868-.233L8.747 16.34c-.548.355-1.192-.289-.837-.837l1.326-2.047a.605.605 0 0 0-.233-.868l-2.172-1.11c-.581-.297-.345-1.177.306-1.144l2.437.125a.605.605 0 0 0 .635-.635l-.125-2.437Z"
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function BannerExperimentIcon(props) {
|
|
59
|
+
return /*#__PURE__*/React.createElement("svg", _objectSpread2({
|
|
60
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
61
|
+
width: "24",
|
|
62
|
+
height: "25",
|
|
63
|
+
fill: "none"
|
|
64
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
65
|
+
fill: "#F48318",
|
|
66
|
+
fillRule: "evenodd",
|
|
67
|
+
d: "M12 3.25a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-3 4.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1H14v4.333a2 2 0 0 0 .4 1.2l4.4 5.867a1 1 0 0 1-.8 1.6H6a1 1 0 0 1-.8-1.6l4.4-5.867a2 2 0 0 0 .4-1.2V8.25h-.5a.5.5 0 0 1-.5-.5Zm1.5-2.5a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1Zm4.5 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-4 3v4.333a3 3 0 0 1-.6 1.8l-.752 1.003c.11.078.245.16.403.226.41.173.985.253 1.682-.188.808-.51 1.547-.67 2.142-.674l-.275-.367a3 3 0 0 1-.6-1.8V8.25h-2Z",
|
|
68
|
+
clipRule: "evenodd"
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function BannerWarningIcon(props) {
|
|
73
|
+
return /*#__PURE__*/React.createElement("svg", _objectSpread2({
|
|
74
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
75
|
+
width: "24",
|
|
76
|
+
height: "24",
|
|
77
|
+
fill: "none"
|
|
78
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
79
|
+
fill: "#EB8909",
|
|
80
|
+
fillRule: "evenodd",
|
|
81
|
+
d: "m10.272 5.212-7.018 12.03a2 2 0 0 0 1.728 3.008h14.036a2 2 0 0 0 1.727-3.008l-7.018-12.03a2 2 0 0 0-3.455 0ZM13 16.75a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.014-7.014A.987.987 0 0 0 12 8.75h-.027l-.028.002a.987.987 0 0 0-.93 1.04l.236 4.25c.053.944 1.445.944 1.498 0l.236-4.25.001-.028v-.028Z",
|
|
82
|
+
clipRule: "evenodd"
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function BannerErrorIcon(props) {
|
|
87
|
+
return /*#__PURE__*/React.createElement("svg", _objectSpread2({
|
|
88
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
89
|
+
width: "24",
|
|
90
|
+
height: "24",
|
|
91
|
+
fill: "none"
|
|
92
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
93
|
+
fill: "#DC4C3E",
|
|
94
|
+
fillRule: "evenodd",
|
|
95
|
+
d: "M12.987 2.5a2.07 2.07 0 0 0-1.974 0L4.048 6.287A1.989 1.989 0 0 0 3 8.032v7.436c0 .725.401 1.393 1.048 1.745L11.013 21a2.07 2.07 0 0 0 1.974 0l6.965-3.787A1.989 1.989 0 0 0 21 15.468V8.032c0-.725-.401-1.393-1.048-1.745L12.987 2.5ZM12 7.25a.987.987 0 0 1 .986 1.014l-.001.027-.236 4.25c-.053.945-1.445.945-1.498 0l-.236-4.25a.987.987 0 0 1 .93-1.04h.028L12 7.25Zm1 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",
|
|
96
|
+
clipRule: "evenodd"
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function BannerSuccessIcon(props) {
|
|
101
|
+
return /*#__PURE__*/React.createElement("svg", _objectSpread2({
|
|
102
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
103
|
+
width: "24",
|
|
104
|
+
height: "24",
|
|
105
|
+
fill: "none"
|
|
106
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
107
|
+
fill: "#058527",
|
|
108
|
+
fillRule: "evenodd",
|
|
109
|
+
d: "M21 12.25a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-5.555-2.99a.75.75 0 0 1 1.06 1.06l-5.303 5.303a.748.748 0 0 1-1.061 0L7.666 13.15a.75.75 0 1 1 1.06-1.06l1.945 1.944 4.774-4.773Z",
|
|
110
|
+
clipRule: "evenodd"
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { BannerIcon };
|
|
115
|
+
//# sourceMappingURL=banner-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner-icon.js","sources":["../../src/icons/banner-icon.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { SystemBannerType } from '../banner/banner'\n\nconst bannerIconForType: Record<SystemBannerType, typeof BannerInfoIcon> = {\n info: BannerInfoIcon,\n upgrade: BannerUpgradeIcon,\n experiment: BannerExperimentIcon,\n warning: BannerWarningIcon,\n error: BannerErrorIcon,\n success: BannerSuccessIcon,\n}\n\nfunction BannerIcon({ type, ...props }: JSX.IntrinsicElements['svg'] & { type: SystemBannerType }) {\n const Icon = bannerIconForType[type]\n return Icon ? <Icon {...props} data-testid={`banner-icon-${type}`} aria-hidden /> : null\n}\n\nfunction BannerInfoIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"#316FEA\"\n fillRule=\"evenodd\"\n d=\"M21 12.25a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-8-3.94a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-2.75 1.94a.75.75 0 0 0 0 1.5h1.25v3.5h-1.25a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5H13V11a.752.752 0 0 0-.75-.75h-2Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerUpgradeIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"#F48318\"\n fillRule=\"evenodd\"\n d=\"M13.974 4.226a2.485 2.485 0 0 0-3.948 0 2.485 2.485 0 0 1-2.304.954A2.485 2.485 0 0 0 4.93 7.972a2.485 2.485 0 0 1-.954 2.304 2.485 2.485 0 0 0 0 3.948 2.485 2.485 0 0 1 .954 2.304 2.485 2.485 0 0 0 2.792 2.792 2.485 2.485 0 0 1 2.304.954 2.485 2.485 0 0 0 3.948 0 2.485 2.485 0 0 1 2.304-.954 2.485 2.485 0 0 0 2.792-2.792 2.485 2.485 0 0 1 .954-2.304 2.485 2.485 0 0 0 0-3.948 2.485 2.485 0 0 1-.954-2.304 2.485 2.485 0 0 0-2.792-2.792 2.485 2.485 0 0 1-2.304-.954ZM11.228 7.08c-.297-.581-1.177-.345-1.144.306l.125 2.437a.605.605 0 0 1-.635.635l-2.437-.125c-.651-.033-.887.847-.306 1.144l2.172 1.11c.32.163.428.567.233.868L7.91 15.503c-.355.548.289 1.192.837.837l2.047-1.326a.605.605 0 0 1 .868.233l1.11 2.172c.297.581 1.177.345 1.144-.306l-.125-2.437a.605.605 0 0 1 .635-.635l2.437.125c.651.033.887-.847.306-1.144l-2.172-1.11a.605.605 0 0 1-.233-.868l1.326-2.047c.355-.548-.289-1.192-.837-.837l-2.047 1.326a.605.605 0 0 1-.868-.233l-1.11-2.172Z\"\n clipRule=\"evenodd\"\n />\n <path\n fill=\"#fff\"\n d=\"M10.084 7.387c-.033-.651.847-.887 1.144-.306l1.11 2.172c.163.32.567.428.868.233l2.047-1.326c.548-.355 1.192.289.837.837l-1.326 2.047a.605.605 0 0 0 .233.868l2.172 1.11c.581.297.345 1.177-.306 1.144l-2.437-.125a.605.605 0 0 0-.635.635l.125 2.437c.033.651-.847.887-1.144.306l-1.11-2.172a.605.605 0 0 0-.868-.233L8.747 16.34c-.548.355-1.192-.289-.837-.837l1.326-2.047a.605.605 0 0 0-.233-.868l-2.172-1.11c-.581-.297-.345-1.177.306-1.144l2.437.125a.605.605 0 0 0 .635-.635l-.125-2.437Z\"\n />\n </svg>\n )\n}\n\nfunction BannerExperimentIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"25\" fill=\"none\" {...props}>\n <path\n fill=\"#F48318\"\n fillRule=\"evenodd\"\n d=\"M12 3.25a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-3 4.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1H14v4.333a2 2 0 0 0 .4 1.2l4.4 5.867a1 1 0 0 1-.8 1.6H6a1 1 0 0 1-.8-1.6l4.4-5.867a2 2 0 0 0 .4-1.2V8.25h-.5a.5.5 0 0 1-.5-.5Zm1.5-2.5a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1Zm4.5 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-4 3v4.333a3 3 0 0 1-.6 1.8l-.752 1.003c.11.078.245.16.403.226.41.173.985.253 1.682-.188.808-.51 1.547-.67 2.142-.674l-.275-.367a3 3 0 0 1-.6-1.8V8.25h-2Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerWarningIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"#EB8909\"\n fillRule=\"evenodd\"\n d=\"m10.272 5.212-7.018 12.03a2 2 0 0 0 1.728 3.008h14.036a2 2 0 0 0 1.727-3.008l-7.018-12.03a2 2 0 0 0-3.455 0ZM13 16.75a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.014-7.014A.987.987 0 0 0 12 8.75h-.027l-.028.002a.987.987 0 0 0-.93 1.04l.236 4.25c.053.944 1.445.944 1.498 0l.236-4.25.001-.028v-.028Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerErrorIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"#DC4C3E\"\n fillRule=\"evenodd\"\n d=\"M12.987 2.5a2.07 2.07 0 0 0-1.974 0L4.048 6.287A1.989 1.989 0 0 0 3 8.032v7.436c0 .725.401 1.393 1.048 1.745L11.013 21a2.07 2.07 0 0 0 1.974 0l6.965-3.787A1.989 1.989 0 0 0 21 15.468V8.032c0-.725-.401-1.393-1.048-1.745L12.987 2.5ZM12 7.25a.987.987 0 0 1 .986 1.014l-.001.027-.236 4.25c-.053.945-1.445.945-1.498 0l-.236-4.25a.987.987 0 0 1 .93-1.04h.028L12 7.25Zm1 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerSuccessIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"#058527\"\n fillRule=\"evenodd\"\n d=\"M21 12.25a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-5.555-2.99a.75.75 0 0 1 1.06 1.06l-5.303 5.303a.748.748 0 0 1-1.061 0L7.666 13.15a.75.75 0 1 1 1.06-1.06l1.945 1.944 4.774-4.773Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nexport { BannerIcon }\n"],"names":["bannerIconForType","info","BannerInfoIcon","upgrade","BannerUpgradeIcon","experiment","BannerExperimentIcon","warning","BannerWarningIcon","error","BannerErrorIcon","success","BannerSuccessIcon","BannerIcon","type","props","Icon","React","createElement","_objectSpread","xmlns","width","height","fill","fillRule","d","clipRule"],"mappings":";;;;AAGA,MAAMA,iBAAiB,GAAoD;AACvEC,EAAAA,IAAI,EAAEC,cADiE;AAEvEC,EAAAA,OAAO,EAAEC,iBAF8D;AAGvEC,EAAAA,UAAU,EAAEC,oBAH2D;AAIvEC,EAAAA,OAAO,EAAEC,iBAJ8D;AAKvEC,EAAAA,KAAK,EAAEC,eALgE;AAMvEC,EAAAA,OAAO,EAAEC,iBAAAA;AAN8D,CAA3E,CAAA;;AASA,SAASC,UAAT,CAAiG,IAAA,EAAA;EAAA,IAA7E;AAAEC,IAAAA,IAAAA;GAA2E,GAAA,IAAA;AAAA,MAAlEC,KAAkE,GAAA,wBAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;;AAC7F,EAAA,MAAMC,IAAI,GAAGhB,iBAAiB,CAACc,IAAD,CAA9B,CAAA;EACA,OAAOE,IAAI,gBAAGC,KAAA,CAAAC,aAAA,CAACF,IAAD,oCAAUD,KAAV,CAAA,EAAA,EAAA,EAAA;AAA8B,IAAA,aAAA,EAAA,cAAA,GAAeD,IAA7C;IAAmD,aAAA,EAAA,IAAA;AAAnD,GAAA,CAAA,CAAH,GAAyE,IAApF,CAAA;AACH,CAAA;;AAED,SAASZ,cAAT,CAAwBa,KAAxB,EAA2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,QAAQ,EAAC,SAFb;AAGIC,IAAAA,CAAC,EAAC,4YAHN;AAIIC,IAAAA,QAAQ,EAAC,SAAA;AAJb,GAAA,CADJ,CADJ,CAAA;AAUH,CAAA;;AAED,SAASd,iBAAT,CAA2BG,KAA3B,EAA8D;AAC1D,EAAA,oBACIE,KAAK,CAAAC,aAAL,CAAK,KAAL,EAAAC,cAAA,CAAA;AAAKC,IAAAA,KAAK,EAAC,4BAAX;AAAwCC,IAAAA,KAAK,EAAC,IAA9C;AAAmDC,IAAAA,MAAM,EAAC,IAA1D;AAA+DC,IAAAA,IAAI,EAAC,MAAA;AAApE,GAAA,EAA+ER,KAA/E,CACIE,eAAAA,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AACIK,IAAAA,IAAI,EAAC,SADT;AAEIC,IAAAA,QAAQ,EAAC,SAFb;AAGIC,IAAAA,CAAC,EAAC,6KAHN;AAIIC,IAAAA,QAAQ,EAAC,SAAA;AAJb,GAAA,CADJ,CADJ,CAAA;AAUH;;;;"}
|
package/es/index.js
CHANGED
|
@@ -5,7 +5,6 @@ export { Inline } from './inline/inline.js';
|
|
|
5
5
|
export { Stack } from './stack/stack.js';
|
|
6
6
|
export { Hidden } from './hidden/hidden.js';
|
|
7
7
|
export { HiddenVisually } from './hidden-visually/hidden-visually.js';
|
|
8
|
-
export { Alert } from './alert/alert.js';
|
|
9
8
|
export { Banner } from './banner/banner.js';
|
|
10
9
|
export { Loading } from './loading/loading.js';
|
|
11
10
|
export { Notice } from './notice/notice.js';
|
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/banner/banner.d.ts
CHANGED
|
@@ -1,28 +1,87 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { ButtonProps } from '../button';
|
|
3
|
+
import { TextLink } from '../text-link';
|
|
4
|
+
/**
|
|
5
|
+
* Represents the type of a banner.
|
|
6
|
+
* 'neutral' accepts a custom icon, the rest do not.
|
|
7
|
+
* @default 'neutral'
|
|
8
|
+
*/
|
|
9
|
+
export type BannerType = 'neutral' | SystemBannerType;
|
|
10
|
+
/**
|
|
11
|
+
* Predefined system types for banners.
|
|
12
|
+
* Each type has its own preset icon.
|
|
13
|
+
*/
|
|
14
|
+
export type SystemBannerType = 'info' | 'upgrade' | 'experiment' | 'warning' | 'error' | 'success';
|
|
15
|
+
type BaseAction = {
|
|
16
|
+
variant: 'primary' | 'tertiary';
|
|
17
|
+
label: string;
|
|
18
|
+
} & Pick<ButtonProps, 'loading' | 'disabled'>;
|
|
19
|
+
type ActionButton = BaseAction & {
|
|
20
|
+
type: 'button';
|
|
21
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className'>;
|
|
22
|
+
type ActionLink = BaseAction & {
|
|
23
|
+
type: 'link';
|
|
24
|
+
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'className'>;
|
|
25
|
+
/**
|
|
26
|
+
* Represents an action that can be taken from the banner.
|
|
27
|
+
* Can be either a button or a link, sharing common properties from BaseAction.
|
|
28
|
+
*/
|
|
29
|
+
type Action = ActionButton | ActionLink;
|
|
30
|
+
/**
|
|
31
|
+
* Configuration for inline links within the banner description.
|
|
32
|
+
* Extends TextLink component props with a required label.
|
|
33
|
+
*/
|
|
34
|
+
type InlineLink = {
|
|
35
|
+
label: string;
|
|
36
|
+
} & React.ComponentProps<typeof TextLink>;
|
|
37
|
+
type WithCloseButton = {
|
|
38
|
+
closeLabel?: string;
|
|
39
|
+
onClose: () => void;
|
|
40
|
+
};
|
|
41
|
+
type WithoutCloseButton = {
|
|
42
|
+
closeLabel?: never;
|
|
43
|
+
onClose?: never;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Controls the close button behavior.
|
|
47
|
+
* If none is provided, the banner will not have a close button.
|
|
48
|
+
*/
|
|
49
|
+
type CloseButton = WithCloseButton | WithoutCloseButton;
|
|
50
|
+
type BaseBanner = {
|
|
4
51
|
id?: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
52
|
+
title?: React.ReactNode;
|
|
53
|
+
description: Exclude<React.ReactNode, null | undefined | boolean>;
|
|
54
|
+
action?: Action;
|
|
55
|
+
inlineLinks?: InlineLink[];
|
|
56
|
+
} & CloseButton;
|
|
57
|
+
/**
|
|
58
|
+
* Configuration for neutral banners.
|
|
59
|
+
* Can include either an image, an icon, or neither, but never both.
|
|
60
|
+
*/
|
|
61
|
+
type NeutralBanner = BaseBanner & {
|
|
62
|
+
type: Extract<BannerType, 'neutral'>;
|
|
63
|
+
} & ({
|
|
64
|
+
image: React.ReactElement;
|
|
65
|
+
icon?: never;
|
|
66
|
+
} | {
|
|
67
|
+
icon: React.ReactElement;
|
|
68
|
+
image?: never;
|
|
69
|
+
} | {
|
|
70
|
+
image?: never;
|
|
71
|
+
icon?: never;
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Configuration for system banners.
|
|
75
|
+
* Cannot include custom images or icons as they use preset ones.
|
|
76
|
+
*/
|
|
77
|
+
type SystemBanner = BaseBanner & {
|
|
78
|
+
type: SystemBannerType;
|
|
79
|
+
image?: never;
|
|
80
|
+
icon?: never;
|
|
25
81
|
};
|
|
82
|
+
type BannerProps = NeutralBanner | SystemBanner;
|
|
26
83
|
declare const Banner: React.ForwardRefExoticComponent<BannerProps & React.RefAttributes<HTMLDivElement>>;
|
|
84
|
+
declare function ActionButton({ type, label, ...props }: ActionButton): React.JSX.Element;
|
|
85
|
+
declare function ActionLink({ type, label, variant, ...props }: ActionLink): React.JSX.Element;
|
|
27
86
|
export { Banner };
|
|
28
87
|
export type { BannerProps };
|
package/lib/banner/banner.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),l=require("../box/box.js"),n=require("../utils/common-helpers.js"),a=require("./banner.module.css.js"),r=require("../button/button.js"),o=require("../icons/close-icon.js"),i=require("../icons/banner-icon.js"),c=require("../text-link/text-link.js");function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(l){if("default"!==l){var n=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,n.get?n:{enumerable:!0,get:function(){return e[l]}})}})),t.default=e,t}var u=s(t);const d=["id","type","title","description","action","icon","image","inlineLinks","closeLabel","onClose"],m=["label"],p=["type","label"],b=["type","label","variant"];function f(t){let{label:l}=t,n=e.objectWithoutProperties(t,p);return u.createElement(r.Button,e.objectSpread2({},n),l)}function x(t){let{label:l,variant:n}=t,a=e.objectWithoutProperties(t,b);return u.createElement(r.Button,{variant:n,render:u.createElement("a",e.objectSpread2({rel:"noopener noreferrer",target:"_blank"},a))},l)}exports.Banner=u.forwardRef((function(t,s){let{id:p,type:b,title:j,description:y,action:E,icon:B,image:v,inlineLinks:g,closeLabel:k,onClose:N}=t,q=e.objectWithoutProperties(t,d);const S=n.useId(),C=n.useId(),P=N?u.createElement(r.IconButton,{exceptionallySetClassName:a.default.closeButton,variant:"quaternary",onClick:N,icon:u.createElement(o.CloseIcon,null),"aria-label":null!=k?k:"Close banner"}):null;return u.createElement(l.Box,e.objectSpread2(e.objectSpread2({},q),{},{ref:s,id:p,display:"flex",flexDirection:"column",justifyContent:"center",role:"status","aria-labelledby":j?S:C,"aria-describedby":j?C:void 0,"aria-live":"polite",tabIndex:0,borderRadius:"full",className:a.default.banner}),v?u.createElement(l.Box,{className:a.default.image},v):null,u.createElement(l.Box,{className:a.default.content,display:"flex",gap:"small",alignItems:"center"},u.createElement(l.Box,{className:a.default.staticContent,display:"flex",gap:"small",flexGrow:1},u.createElement(l.Box,{className:a.default.icon},"neutral"===b?B:u.createElement(i.BannerIcon,{type:b}),P),u.createElement(l.Box,{className:a.default.copy,display:"flex",flexDirection:"column"},j?u.createElement(l.Box,{id:S,className:a.default.title},j):null,u.createElement(l.Box,{id:C,className:[a.default.description,j?a.default.secondary:null]},y,null==g?void 0:g.map((t,l)=>{let{label:n}=t,r=e.objectWithoutProperties(t,m);return u.createElement(u.Fragment,{key:l},u.createElement(c.TextLink,e.objectSpread2(e.objectSpread2({},r),{},{exceptionallySetClassName:a.default.inlineLink}),n),l<g.length-1?u.createElement("span",null," · "):"")})))),E||P?u.createElement(l.Box,{className:a.default.actions,display:"flex",gap:"small"},"button"===(null==E?void 0:E.type)?u.createElement(f,e.objectSpread2({},E)):null,"link"===(null==E?void 0:E.type)?u.createElement(x,e.objectSpread2({},E)):null,P):null))}));
|
|
2
2
|
//# sourceMappingURL=banner.js.map
|
package/lib/banner/banner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sources":["../../src/banner/banner.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box } from '../box'\nimport {
|
|
1
|
+
{"version":3,"file":"banner.js","sources":["../../src/banner/banner.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box } from '../box'\nimport { useId } from '../utils/common-helpers'\n\nimport styles from './banner.module.css'\nimport { Button, ButtonProps, IconButton } from '../button'\nimport { CloseIcon } from '../icons/close-icon'\nimport { BannerIcon } from '../icons/banner-icon'\nimport { TextLink } from '../text-link'\n\n/**\n * Represents the type of a banner.\n * 'neutral' accepts a custom icon, the rest do not.\n * @default 'neutral'\n */\nexport type BannerType = 'neutral' | SystemBannerType\n\n/**\n * Predefined system types for banners.\n * Each type has its own preset icon.\n */\nexport type SystemBannerType = 'info' | 'upgrade' | 'experiment' | 'warning' | 'error' | 'success'\n\ntype BaseAction = {\n variant: 'primary' | 'tertiary'\n label: string\n} & Pick<ButtonProps, 'loading' | 'disabled'>\ntype ActionButton = BaseAction & { type: 'button' } & Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'className'\n >\ntype ActionLink = BaseAction & { type: 'link' } & Omit<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n 'className'\n >\n/**\n * Represents an action that can be taken from the banner.\n * Can be either a button or a link, sharing common properties from BaseAction.\n */\ntype Action = ActionButton | ActionLink\n\n/**\n * Configuration for inline links within the banner description.\n * Extends TextLink component props with a required label.\n */\ntype InlineLink = { label: string } & React.ComponentProps<typeof TextLink>\n\ntype WithCloseButton = {\n closeLabel?: string\n onClose: () => void\n}\ntype WithoutCloseButton = {\n closeLabel?: never\n onClose?: never\n}\n/**\n * Controls the close button behavior.\n * If none is provided, the banner will not have a close button.\n */\ntype CloseButton = WithCloseButton | WithoutCloseButton\n\ntype BaseBanner = {\n id?: string\n title?: React.ReactNode\n description: Exclude<React.ReactNode, null | undefined | boolean>\n action?: Action\n inlineLinks?: InlineLink[]\n} & CloseButton\n\n/**\n * Configuration for neutral banners.\n * Can include either an image, an icon, or neither, but never both.\n */\ntype NeutralBanner = BaseBanner & {\n type: Extract<BannerType, 'neutral'>\n} & (\n | { image: React.ReactElement; icon?: never }\n | { icon: React.ReactElement; image?: never }\n | { image?: never; icon?: never }\n )\n\n/**\n * Configuration for system banners.\n * Cannot include custom images or icons as they use preset ones.\n */\ntype SystemBanner = BaseBanner & {\n type: SystemBannerType\n image?: never\n icon?: never\n}\n\ntype BannerProps = NeutralBanner | SystemBanner\n\nconst Banner = React.forwardRef<HTMLDivElement, BannerProps>(function Banner(\n {\n id,\n type,\n title,\n description,\n action,\n icon,\n image,\n inlineLinks,\n closeLabel,\n onClose,\n ...props\n }: BannerProps,\n ref,\n) {\n const titleId = useId()\n const descriptionId = useId()\n\n const closeButton = onClose ? (\n <IconButton\n exceptionallySetClassName={styles.closeButton}\n variant=\"quaternary\"\n onClick={onClose}\n icon={<CloseIcon />}\n aria-label={closeLabel ?? 'Close banner'}\n />\n ) : null\n\n return (\n <Box\n {...props}\n ref={ref}\n id={id}\n display=\"flex\"\n flexDirection=\"column\"\n justifyContent=\"center\"\n role=\"status\"\n aria-labelledby={title ? titleId : descriptionId}\n aria-describedby={title ? descriptionId : undefined}\n aria-live=\"polite\"\n tabIndex={0}\n borderRadius=\"full\"\n className={styles.banner}\n >\n {image ? <Box className={styles.image}>{image}</Box> : null}\n\n <Box className={styles.content} display=\"flex\" gap=\"small\" alignItems=\"center\">\n <Box className={styles.staticContent} display=\"flex\" gap=\"small\" flexGrow={1}>\n <Box className={styles.icon}>\n {type === 'neutral' ? icon : <BannerIcon type={type} />}\n {closeButton}\n </Box>\n\n <Box className={styles.copy} display=\"flex\" flexDirection=\"column\">\n {title ? (\n <Box id={titleId} className={styles.title}>\n {title}\n </Box>\n ) : null}\n <Box\n id={descriptionId}\n className={[styles.description, title ? styles.secondary : null]}\n >\n {description}\n {inlineLinks?.map(({ label, ...props }, index) => {\n return (\n <React.Fragment key={index}>\n <TextLink\n {...props}\n exceptionallySetClassName={styles.inlineLink}\n >\n {label}\n </TextLink>\n {index < inlineLinks.length - 1 ? <span> · </span> : ''}\n </React.Fragment>\n )\n })}\n </Box>\n </Box>\n </Box>\n\n {action || closeButton ? (\n <Box className={styles.actions} display=\"flex\" gap=\"small\">\n {action?.type === 'button' ? <ActionButton {...action} /> : null}\n {action?.type === 'link' ? <ActionLink {...action} /> : null}\n {closeButton}\n </Box>\n ) : null}\n </Box>\n </Box>\n )\n})\n\nfunction ActionButton({ type, label, ...props }: ActionButton) {\n return <Button {...props}>{label}</Button>\n}\n\nfunction ActionLink({ type, label, variant, ...props }: ActionLink) {\n return (\n <Button\n variant={variant}\n render={<a rel=\"noopener noreferrer\" target=\"_blank\" {...props} />}\n >\n {label}\n </Button>\n )\n}\n\nexport { Banner }\nexport type { BannerProps }\n"],"names":["ActionButton","_ref3","label","props","_objectWithoutProperties","objectWithoutProperties","_excluded3","React","Button","ActionLink","_ref4","variant","_excluded4","createElement","render","_objectSpread","rel","target","forwardRef","ref","id","type","title","description","action","icon","image","inlineLinks","closeLabel","onClose","_ref","_excluded","titleId","useId","descriptionId","closeButton","IconButton","exceptionallySetClassName","styles","onClick","CloseIcon","aria-label","Box","display","flexDirection","justifyContent","role","aria-describedby","undefined","aria-live","tabIndex","borderRadius","className","banner","content","gap","alignItems","staticContent","flexGrow","BannerIcon","copy","secondary","map","index","_ref2","_excluded2","Fragment","key","TextLink","inlineLink","length","actions"],"mappings":"y0BA2LA,SAASA,EAAoDC,GAAA,IAAvCC,MAAQA,GAA+BD,EAArBE,EAAqBC,EAAAC,wBAAAJ,EAAAK,GACzD,OAAOC,gBAACC,SAAWL,EAAAA,cAAAA,GAAAA,GAAQD,GAG/B,SAASO,EAAyDC,GAAA,IAA9CR,MAAQA,EAARS,QAAeA,GAA+BD,EAAnBP,EAAmBC,EAAAC,wBAAAK,EAAAE,GAC9D,OACIL,EAACM,cAAAL,SACG,CAAAG,QAASA,EACTG,OAAQP,EAAGM,cAAA,IAAHE,EAAAA,cAAA,CAAGC,IAAI,sBAAsBC,OAAO,UAAad,KAExDD,kBAxGEK,EAAMW,YAAwC,SAczDC,EAAAA,GAAG,IAbHC,GACIA,EADJC,KAEIA,EAFJC,MAGIA,EAHJC,YAIIA,EAJJC,OAKIA,EALJC,KAMIA,EANJC,MAOIA,EAPJC,YAQIA,EARJC,WASIA,EATJC,QAUIA,GAGDC,EAFI3B,EAEJC,EAAAC,wBAAAyB,EAAAC,GAEH,MAAMC,EAAUC,EAAAA,QACVC,EAAgBD,EAAAA,QAEhBE,EAAc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8D,EAAlB7D,EAAkBC,EAAAC,wBAAA2D,EAAAC,GAC7C,OACI1D,gBAACA,EAAM2D,SAAS,CAAAC,IAAKJ,GACjBxD,EAACM,cAAAuD,8CACOjE,GADR,GAAA,CAEIkC,0BAA2BC,EAAM,QAAC+B,aAEjCnE,GAEJ6D,EAAQpC,EAAY2C,OAAS,EAAI/D,EAAAM,cAAA,OAAA,KAAA,OAAmB,SAQ5EW,GAAUW,EACP5B,EAAAM,cAAC6B,MAAI,CAAAU,UAAWd,EAAM,QAACiC,QAAS5B,QAAQ,OAAOY,IAAI,SAC7B,YAAX,MAAN/B,SAAAA,EAAQH,MAAoBd,EAACM,cAAAb,EAADe,gBAAA,GAAkBS,IAAa,KAC1C,gBAAjBA,OAAAA,EAAAA,EAAQH,MAAkBd,EAACM,cAAAJ,qBAAee,IAAa,KACvDW,GAEL"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={banner:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={banner:"a3c628a9",image:"b2cb529e",content:"_608df6ce",description:"_7d8d68de",title:"_05e2783a",secondary:"d5e077f5",icon:"dbf93d2e",closeButton:"_22f9ed25",copy:"_99ded674",inlineLink:"fe6dd094",staticContent:"e6ed6d9e",actions:"_51bd96a8"};
|
|
2
2
|
//# sourceMappingURL=banner.module.css.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js");function l(e){if(e&&e.__esModule)return e;var l=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(l,t,a.get?a:{enumerable:!0,get:function(){return e[t]}})}})),l.default=e,l}var t=l(require("react"));const a=["type"],n={info:function(l){return t.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},l),t.createElement("path",{fill:"#316FEA",fillRule:"evenodd",d:"M21 12.25a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-8-3.94a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-2.75 1.94a.75.75 0 0 0 0 1.5h1.25v3.5h-1.25a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5H13V11a.752.752 0 0 0-.75-.75h-2Z",clipRule:"evenodd"}))},upgrade:function(l){return t.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},l),t.createElement("path",{fill:"#F48318",fillRule:"evenodd",d:"M13.974 4.226a2.485 2.485 0 0 0-3.948 0 2.485 2.485 0 0 1-2.304.954A2.485 2.485 0 0 0 4.93 7.972a2.485 2.485 0 0 1-.954 2.304 2.485 2.485 0 0 0 0 3.948 2.485 2.485 0 0 1 .954 2.304 2.485 2.485 0 0 0 2.792 2.792 2.485 2.485 0 0 1 2.304.954 2.485 2.485 0 0 0 3.948 0 2.485 2.485 0 0 1 2.304-.954 2.485 2.485 0 0 0 2.792-2.792 2.485 2.485 0 0 1 .954-2.304 2.485 2.485 0 0 0 0-3.948 2.485 2.485 0 0 1-.954-2.304 2.485 2.485 0 0 0-2.792-2.792 2.485 2.485 0 0 1-2.304-.954ZM11.228 7.08c-.297-.581-1.177-.345-1.144.306l.125 2.437a.605.605 0 0 1-.635.635l-2.437-.125c-.651-.033-.887.847-.306 1.144l2.172 1.11c.32.163.428.567.233.868L7.91 15.503c-.355.548.289 1.192.837.837l2.047-1.326a.605.605 0 0 1 .868.233l1.11 2.172c.297.581 1.177.345 1.144-.306l-.125-2.437a.605.605 0 0 1 .635-.635l2.437.125c.651.033.887-.847.306-1.144l-2.172-1.11a.605.605 0 0 1-.233-.868l1.326-2.047c.355-.548-.289-1.192-.837-.837l-2.047 1.326a.605.605 0 0 1-.868-.233l-1.11-2.172Z",clipRule:"evenodd"}),t.createElement("path",{fill:"#fff",d:"M10.084 7.387c-.033-.651.847-.887 1.144-.306l1.11 2.172c.163.32.567.428.868.233l2.047-1.326c.548-.355 1.192.289.837.837l-1.326 2.047a.605.605 0 0 0 .233.868l2.172 1.11c.581.297.345 1.177-.306 1.144l-2.437-.125a.605.605 0 0 0-.635.635l.125 2.437c.033.651-.847.887-1.144.306l-1.11-2.172a.605.605 0 0 0-.868-.233L8.747 16.34c-.548.355-1.192-.289-.837-.837l1.326-2.047a.605.605 0 0 0-.233-.868l-2.172-1.11c-.581-.297-.345-1.177.306-1.144l2.437.125a.605.605 0 0 0 .635-.635l-.125-2.437Z"}))},experiment:function(l){return t.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",fill:"none"},l),t.createElement("path",{fill:"#F48318",fillRule:"evenodd",d:"M12 3.25a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-3 4.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1H14v4.333a2 2 0 0 0 .4 1.2l4.4 5.867a1 1 0 0 1-.8 1.6H6a1 1 0 0 1-.8-1.6l4.4-5.867a2 2 0 0 0 .4-1.2V8.25h-.5a.5.5 0 0 1-.5-.5Zm1.5-2.5a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1Zm4.5 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-4 3v4.333a3 3 0 0 1-.6 1.8l-.752 1.003c.11.078.245.16.403.226.41.173.985.253 1.682-.188.808-.51 1.547-.67 2.142-.674l-.275-.367a3 3 0 0 1-.6-1.8V8.25h-2Z",clipRule:"evenodd"}))},warning:function(l){return t.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},l),t.createElement("path",{fill:"#EB8909",fillRule:"evenodd",d:"m10.272 5.212-7.018 12.03a2 2 0 0 0 1.728 3.008h14.036a2 2 0 0 0 1.727-3.008l-7.018-12.03a2 2 0 0 0-3.455 0ZM13 16.75a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.014-7.014A.987.987 0 0 0 12 8.75h-.027l-.028.002a.987.987 0 0 0-.93 1.04l.236 4.25c.053.944 1.445.944 1.498 0l.236-4.25.001-.028v-.028Z",clipRule:"evenodd"}))},error:function(l){return t.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},l),t.createElement("path",{fill:"#DC4C3E",fillRule:"evenodd",d:"M12.987 2.5a2.07 2.07 0 0 0-1.974 0L4.048 6.287A1.989 1.989 0 0 0 3 8.032v7.436c0 .725.401 1.393 1.048 1.745L11.013 21a2.07 2.07 0 0 0 1.974 0l6.965-3.787A1.989 1.989 0 0 0 21 15.468V8.032c0-.725-.401-1.393-1.048-1.745L12.987 2.5ZM12 7.25a.987.987 0 0 1 .986 1.014l-.001.027-.236 4.25c-.053.945-1.445.945-1.498 0l-.236-4.25a.987.987 0 0 1 .93-1.04h.028L12 7.25Zm1 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",clipRule:"evenodd"}))},success:function(l){return t.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},l),t.createElement("path",{fill:"#058527",fillRule:"evenodd",d:"M21 12.25a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-5.555-2.99a.75.75 0 0 1 1.06 1.06l-5.303 5.303a.748.748 0 0 1-1.061 0L7.666 13.15a.75.75 0 1 1 1.06-1.06l1.945 1.944 4.774-4.773Z",clipRule:"evenodd"}))}};exports.BannerIcon=function(l){let{type:r}=l,c=e.objectWithoutProperties(l,a);const i=n[r];return i?t.createElement(i,e.objectSpread2(e.objectSpread2({},c),{},{"data-testid":"banner-icon-"+r,"aria-hidden":!0})):null};
|
|
2
|
+
//# sourceMappingURL=banner-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner-icon.js","sources":["../../src/icons/banner-icon.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { SystemBannerType } from '../banner/banner'\n\nconst bannerIconForType: Record<SystemBannerType, typeof BannerInfoIcon> = {\n info: BannerInfoIcon,\n upgrade: BannerUpgradeIcon,\n experiment: BannerExperimentIcon,\n warning: BannerWarningIcon,\n error: BannerErrorIcon,\n success: BannerSuccessIcon,\n}\n\nfunction BannerIcon({ type, ...props }: JSX.IntrinsicElements['svg'] & { type: SystemBannerType }) {\n const Icon = bannerIconForType[type]\n return Icon ? <Icon {...props} data-testid={`banner-icon-${type}`} aria-hidden /> : null\n}\n\nfunction BannerInfoIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"#316FEA\"\n fillRule=\"evenodd\"\n d=\"M21 12.25a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-8-3.94a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-2.75 1.94a.75.75 0 0 0 0 1.5h1.25v3.5h-1.25a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5H13V11a.752.752 0 0 0-.75-.75h-2Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerUpgradeIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"#F48318\"\n fillRule=\"evenodd\"\n d=\"M13.974 4.226a2.485 2.485 0 0 0-3.948 0 2.485 2.485 0 0 1-2.304.954A2.485 2.485 0 0 0 4.93 7.972a2.485 2.485 0 0 1-.954 2.304 2.485 2.485 0 0 0 0 3.948 2.485 2.485 0 0 1 .954 2.304 2.485 2.485 0 0 0 2.792 2.792 2.485 2.485 0 0 1 2.304.954 2.485 2.485 0 0 0 3.948 0 2.485 2.485 0 0 1 2.304-.954 2.485 2.485 0 0 0 2.792-2.792 2.485 2.485 0 0 1 .954-2.304 2.485 2.485 0 0 0 0-3.948 2.485 2.485 0 0 1-.954-2.304 2.485 2.485 0 0 0-2.792-2.792 2.485 2.485 0 0 1-2.304-.954ZM11.228 7.08c-.297-.581-1.177-.345-1.144.306l.125 2.437a.605.605 0 0 1-.635.635l-2.437-.125c-.651-.033-.887.847-.306 1.144l2.172 1.11c.32.163.428.567.233.868L7.91 15.503c-.355.548.289 1.192.837.837l2.047-1.326a.605.605 0 0 1 .868.233l1.11 2.172c.297.581 1.177.345 1.144-.306l-.125-2.437a.605.605 0 0 1 .635-.635l2.437.125c.651.033.887-.847.306-1.144l-2.172-1.11a.605.605 0 0 1-.233-.868l1.326-2.047c.355-.548-.289-1.192-.837-.837l-2.047 1.326a.605.605 0 0 1-.868-.233l-1.11-2.172Z\"\n clipRule=\"evenodd\"\n />\n <path\n fill=\"#fff\"\n d=\"M10.084 7.387c-.033-.651.847-.887 1.144-.306l1.11 2.172c.163.32.567.428.868.233l2.047-1.326c.548-.355 1.192.289.837.837l-1.326 2.047a.605.605 0 0 0 .233.868l2.172 1.11c.581.297.345 1.177-.306 1.144l-2.437-.125a.605.605 0 0 0-.635.635l.125 2.437c.033.651-.847.887-1.144.306l-1.11-2.172a.605.605 0 0 0-.868-.233L8.747 16.34c-.548.355-1.192-.289-.837-.837l1.326-2.047a.605.605 0 0 0-.233-.868l-2.172-1.11c-.581-.297-.345-1.177.306-1.144l2.437.125a.605.605 0 0 0 .635-.635l-.125-2.437Z\"\n />\n </svg>\n )\n}\n\nfunction BannerExperimentIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"25\" fill=\"none\" {...props}>\n <path\n fill=\"#F48318\"\n fillRule=\"evenodd\"\n d=\"M12 3.25a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-3 4.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1H14v4.333a2 2 0 0 0 .4 1.2l4.4 5.867a1 1 0 0 1-.8 1.6H6a1 1 0 0 1-.8-1.6l4.4-5.867a2 2 0 0 0 .4-1.2V8.25h-.5a.5.5 0 0 1-.5-.5Zm1.5-2.5a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1Zm4.5 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-4 3v4.333a3 3 0 0 1-.6 1.8l-.752 1.003c.11.078.245.16.403.226.41.173.985.253 1.682-.188.808-.51 1.547-.67 2.142-.674l-.275-.367a3 3 0 0 1-.6-1.8V8.25h-2Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerWarningIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"#EB8909\"\n fillRule=\"evenodd\"\n d=\"m10.272 5.212-7.018 12.03a2 2 0 0 0 1.728 3.008h14.036a2 2 0 0 0 1.727-3.008l-7.018-12.03a2 2 0 0 0-3.455 0ZM13 16.75a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.014-7.014A.987.987 0 0 0 12 8.75h-.027l-.028.002a.987.987 0 0 0-.93 1.04l.236 4.25c.053.944 1.445.944 1.498 0l.236-4.25.001-.028v-.028Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerErrorIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"#DC4C3E\"\n fillRule=\"evenodd\"\n d=\"M12.987 2.5a2.07 2.07 0 0 0-1.974 0L4.048 6.287A1.989 1.989 0 0 0 3 8.032v7.436c0 .725.401 1.393 1.048 1.745L11.013 21a2.07 2.07 0 0 0 1.974 0l6.965-3.787A1.989 1.989 0 0 0 21 15.468V8.032c0-.725-.401-1.393-1.048-1.745L12.987 2.5ZM12 7.25a.987.987 0 0 1 .986 1.014l-.001.027-.236 4.25c-.053.945-1.445.945-1.498 0l-.236-4.25a.987.987 0 0 1 .93-1.04h.028L12 7.25Zm1 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerSuccessIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"#058527\"\n fillRule=\"evenodd\"\n d=\"M21 12.25a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-5.555-2.99a.75.75 0 0 1 1.06 1.06l-5.303 5.303a.748.748 0 0 1-1.061 0L7.666 13.15a.75.75 0 1 1 1.06-1.06l1.945 1.944 4.774-4.773Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nexport { BannerIcon }\n"],"names":["bannerIconForType","info","props","React","createElement","_objectSpread","xmlns","width","height","fill","fillRule","d","clipRule","upgrade","experiment","warning","error","success","_ref","type","_objectWithoutProperties","objectWithoutProperties","_excluded","Icon","data-testid","aria-hidden"],"mappings":"ybAGMA,EAAqE,CACvEC,KAaJ,SAAwBC,GACpB,OACIC,EAAKC,cAAA,MAALC,gBAAA,CAAKC,MAAM,6BAA6BC,MAAM,KAAKC,OAAO,KAAKC,KAAK,QAAWP,GAC3EC,EAAAC,cAAA,OAAA,CACIK,KAAK,UACLC,SAAS,UACTC,EAAE,wMACFC,SAAS,cAnBrBC,QAyBJ,SAA2BX,GACvB,OACIC,EAAKC,cAAA,MAALC,gBAAA,CAAKC,MAAM,6BAA6BC,MAAM,KAAKC,OAAO,KAAKC,KAAK,QAAWP,GAC3EC,EAAAC,cAAA,OAAA,CACIK,KAAK,UACLC,SAAS,UACTC,EAAE,s7BACFC,SAAS,YAEbT,EACIC,cAAA,OAAA,CAAAK,KAAK,OACLE,EAAE,weAnCdG,WAyCJ,SAA8BZ,GAC1B,OACIC,EAAKC,cAAA,MAALC,gBAAA,CAAKC,MAAM,6BAA6BC,MAAM,KAAKC,OAAO,KAAKC,KA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