@tedi-design-system/react 18.0.0-rc.2 → 18.0.0-rc.3
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/_virtual/index.cjs10.js +1 -1
- package/_virtual/index.cjs11.js +1 -1
- package/_virtual/index.cjs12.js +1 -1
- package/_virtual/index.cjs13.js +1 -1
- package/_virtual/index.cjs5.js +1 -1
- package/_virtual/index.cjs6.js +1 -1
- package/_virtual/index.cjs7.js +1 -1
- package/_virtual/index.cjs8.js +1 -1
- package/_virtual/index.cjs9.js +1 -1
- package/_virtual/index.es10.js +1 -1
- package/_virtual/index.es11.js +1 -1
- package/_virtual/index.es12.js +1 -1
- package/_virtual/index.es13.js +2 -4
- package/_virtual/index.es14.js +2 -2
- package/_virtual/index.es5.js +4 -2
- package/_virtual/index.es6.js +1 -1
- package/_virtual/index.es7.js +1 -1
- package/_virtual/index.es8.js +1 -1
- package/_virtual/index.es9.js +1 -1
- package/bundle-stats.html +1 -1
- package/external/@mui/system/colorManipulator.cjs.js +1 -1
- package/external/@mui/system/colorManipulator.es.js +2 -2
- package/external/@mui/system/createStyled.cjs.js +1 -1
- package/external/@mui/system/createStyled.es.js +6 -6
- package/external/@mui/system/useThemeWithoutDefault.cjs.js +1 -1
- package/external/@mui/system/useThemeWithoutDefault.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/notifications/alert/alert.cjs.js +1 -1
- package/src/tedi/components/notifications/alert/alert.d.ts +14 -1
- package/src/tedi/components/notifications/alert/alert.es.js +45 -42
- package/src/tedi/components/notifications/alert/alert.module.scss.cjs.js +1 -1
- package/src/tedi/components/notifications/alert/alert.module.scss.es.js +2 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),N=require("../../../../../external/classnames/index.cjs.js"),S=require("react"),M=require("../../base/icon/icon.cjs.js"),P=require("../../base/typography/heading/heading.cjs.js"),k=require("../../buttons/closing-button/closing-button.cjs.js"),t=require("./alert.module.scss.cjs.js"),y=require("../../../helpers/hooks/use-is-mounted.cjs.js"),z=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),$=require("../../layout/vertical-spacing/vertical-spacing.cjs.js"),A=require("../../layout/grid/row.cjs.js"),n=require("../../layout/grid/col.cjs.js"),o=c=>{const{getCurrentBreakpointProps:h}=z.useBreakpointProps(c.defaultServerBreakpoint),{children:i,role:s="alert",title:r,className:m,type:d="info",icon:u,onClose:f,action:a,isGlobal:j=!1,noSideBorders:x=!1,titleElement:q="h3",size:v="default",..._}=h(c),B=N.default(t.default["tedi-alert"],t.default[`tedi-alert--${d}`],t.default[`tedi-alert--size-${v}`],{[t.default["tedi-alert--global"]]:j,[t.default["tedi-alert--no-side-borders"]]:x,[t.default["tedi-alert--has-action"]]:!!a},m),b=y.useIsMounted(),I=l=>{const g={size:18},C=typeof l=="string"?{...g,name:l}:{...g,...l};return e.jsx(M.Icon,{...C,className:t.default["tedi-alert__icon"]})},w=s==="alert"?"assertive":s==="status"?"polite":"off",p=S.useId();return b?e.jsx("div",{role:s,"data-name":"alert","aria-label":`${d} alert`,"aria-live":w,"aria-labelledby":r?p:void 0,..._,className:B,children:e.jsxs($.VerticalSpacing,{size:.25,children:[e.jsxs(A.Row,{gutterX:2,alignItems:r?"center":"start",children:[e.jsxs(n.Col,{grow:1,className:t.default["tedi-alert__content"],children:[u&&I(u),e.jsx("div",{className:"tedi-alert__content-wrapper",children:r?e.jsx(P.Heading,{element:q,id:p,modifiers:["h5"],children:r}):i})]}),a?e.jsx(n.Col,{width:"auto",children:a}):f&&e.jsx(n.Col,{width:"auto",children:e.jsx(k.ClosingButton,{onClick:f,iconSize:18})})]}),r&&i&&e.jsx("div",{className:"tedi-alert__content-wrapper",children:i})]})}):null};o.displayName="Alert";exports.Alert=o;exports.default=o;
|
|
@@ -54,8 +54,18 @@ export interface AlertProps extends BreakpointSupport<AlertBreakpointProps> {
|
|
|
54
54
|
* Callback function triggered when the close button is clicked.
|
|
55
55
|
* Adding this handler renders a close button in the alert.
|
|
56
56
|
* Useful for dismissible alerts.
|
|
57
|
+
*
|
|
58
|
+
* Ignored when `action` is also set — the consumer's slot wins, and is
|
|
59
|
+
* responsible for any close affordance it wants to expose.
|
|
57
60
|
*/
|
|
58
61
|
onClose?: () => void;
|
|
62
|
+
/**
|
|
63
|
+
* Custom content for the right-side slot of the alert (e.g. a CTA button,
|
|
64
|
+
* a link, or a small icon stack). Replaces the default close button when
|
|
65
|
+
* provided. Use this instead of squeezing buttons into `children` so the
|
|
66
|
+
* layout slot is reserved and aligned consistently.
|
|
67
|
+
*/
|
|
68
|
+
action?: React.ReactNode;
|
|
59
69
|
/**
|
|
60
70
|
* The ARIA role of the alert, informing screen readers about the alert's purpose.
|
|
61
71
|
* Options:
|
|
@@ -80,5 +90,8 @@ export interface AlertProps extends BreakpointSupport<AlertBreakpointProps> {
|
|
|
80
90
|
*/
|
|
81
91
|
titleElement?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
82
92
|
}
|
|
83
|
-
export declare const Alert:
|
|
93
|
+
export declare const Alert: {
|
|
94
|
+
(props: AlertProps): JSX.Element | null;
|
|
95
|
+
displayName: string;
|
|
96
|
+
};
|
|
84
97
|
export default Alert;
|
|
@@ -1,66 +1,69 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import k from "../../../../../external/classnames/index.es.js";
|
|
3
|
-
import
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Heading as
|
|
6
|
-
import { ClosingButton as
|
|
3
|
+
import P from "react";
|
|
4
|
+
import { Icon as S } from "../../base/icon/icon.es.js";
|
|
5
|
+
import { Heading as x } from "../../base/typography/heading/heading.es.js";
|
|
6
|
+
import { ClosingButton as M } from "../../buttons/closing-button/closing-button.es.js";
|
|
7
7
|
import t from "./alert.module.scss.es.js";
|
|
8
|
-
import { useIsMounted as
|
|
9
|
-
import { useBreakpointProps as
|
|
10
|
-
import { VerticalSpacing as
|
|
8
|
+
import { useIsMounted as $ } from "../../../helpers/hooks/use-is-mounted.es.js";
|
|
9
|
+
import { useBreakpointProps as j } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
10
|
+
import { VerticalSpacing as A } from "../../layout/vertical-spacing/vertical-spacing.es.js";
|
|
11
11
|
import { Row as E } from "../../layout/grid/row.es.js";
|
|
12
|
-
import { Col as
|
|
13
|
-
const
|
|
14
|
-
const { getCurrentBreakpointProps:
|
|
12
|
+
import { Col as n } from "../../layout/grid/col.es.js";
|
|
13
|
+
const R = (d) => {
|
|
14
|
+
const { getCurrentBreakpointProps: h } = j(d.defaultServerBreakpoint), {
|
|
15
15
|
children: o,
|
|
16
16
|
role: i = "alert",
|
|
17
17
|
title: r,
|
|
18
|
-
className:
|
|
19
|
-
type:
|
|
20
|
-
icon:
|
|
21
|
-
onClose:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
className: g,
|
|
19
|
+
type: c = "info",
|
|
20
|
+
icon: m,
|
|
21
|
+
onClose: p,
|
|
22
|
+
action: a,
|
|
23
|
+
isGlobal: _ = !1,
|
|
24
|
+
noSideBorders: v = !1,
|
|
25
|
+
titleElement: N = "h3",
|
|
26
|
+
size: B = "default",
|
|
27
|
+
...I
|
|
28
|
+
} = h(d), b = k(
|
|
28
29
|
t["tedi-alert"],
|
|
29
|
-
t[`tedi-alert--${
|
|
30
|
-
t[`tedi-alert--size-${
|
|
30
|
+
t[`tedi-alert--${c}`],
|
|
31
|
+
t[`tedi-alert--size-${B}`],
|
|
31
32
|
{
|
|
32
|
-
[t["tedi-alert--global"]]:
|
|
33
|
-
[t["tedi-alert--no-side-borders"]]:
|
|
33
|
+
[t["tedi-alert--global"]]: _,
|
|
34
|
+
[t["tedi-alert--no-side-borders"]]: v,
|
|
35
|
+
[t["tedi-alert--has-action"]]: !!a
|
|
34
36
|
},
|
|
35
|
-
|
|
36
|
-
),
|
|
37
|
-
const
|
|
38
|
-
return /* @__PURE__ */ e(
|
|
39
|
-
}, z = i === "alert" ? "assertive" : i === "status" ? "polite" : "off",
|
|
40
|
-
return
|
|
37
|
+
g
|
|
38
|
+
), w = $(), y = (l) => {
|
|
39
|
+
const u = { size: 18 }, C = typeof l == "string" ? { ...u, name: l } : { ...u, ...l };
|
|
40
|
+
return /* @__PURE__ */ e(S, { ...C, className: t["tedi-alert__icon"] });
|
|
41
|
+
}, z = i === "alert" ? "assertive" : i === "status" ? "polite" : "off", f = P.useId();
|
|
42
|
+
return w ? /* @__PURE__ */ e(
|
|
41
43
|
"div",
|
|
42
44
|
{
|
|
43
45
|
role: i,
|
|
44
46
|
"data-name": "alert",
|
|
45
|
-
"aria-label": `${
|
|
47
|
+
"aria-label": `${c} alert`,
|
|
46
48
|
"aria-live": z,
|
|
47
|
-
"aria-labelledby": r ?
|
|
48
|
-
...
|
|
49
|
+
"aria-labelledby": r ? f : void 0,
|
|
50
|
+
...I,
|
|
49
51
|
className: b,
|
|
50
|
-
children: /* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
/* @__PURE__ */ e("div", { className: "tedi-alert__content-wrapper", children: r ? /* @__PURE__ */ e(
|
|
52
|
+
children: /* @__PURE__ */ s(A, { size: 0.25, children: [
|
|
53
|
+
/* @__PURE__ */ s(E, { gutterX: 2, alignItems: r ? "center" : "start", children: [
|
|
54
|
+
/* @__PURE__ */ s(n, { grow: 1, className: t["tedi-alert__content"], children: [
|
|
55
|
+
m && y(m),
|
|
56
|
+
/* @__PURE__ */ e("div", { className: "tedi-alert__content-wrapper", children: r ? /* @__PURE__ */ e(x, { element: N, id: f, modifiers: ["h5"], children: r }) : o })
|
|
55
57
|
] }),
|
|
56
|
-
|
|
58
|
+
a ? /* @__PURE__ */ e(n, { width: "auto", children: a }) : p && /* @__PURE__ */ e(n, { width: "auto", children: /* @__PURE__ */ e(M, { onClick: p, iconSize: 18 }) })
|
|
57
59
|
] }),
|
|
58
60
|
r && o && /* @__PURE__ */ e("div", { className: "tedi-alert__content-wrapper", children: o })
|
|
59
61
|
] })
|
|
60
62
|
}
|
|
61
63
|
) : null;
|
|
62
64
|
};
|
|
65
|
+
R.displayName = "Alert";
|
|
63
66
|
export {
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
R as Alert,
|
|
68
|
+
R as default
|
|
66
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-alert":"tedi-alert-8ca3e7b9","tedi-alert__content":"tedi-alert__content-d480ed20","tedi-alert__icon":"tedi-alert__icon-f9ab1feb","tedi-alert--size-default":"tedi-alert--size-default-6a9ebe2c","tedi-alert--size-small":"tedi-alert--size-small-4c763cad","tedi-alert--info":"tedi-alert--info-bcd40044","tedi-alert--success":"tedi-alert--success-e6d21f49","tedi-alert--warning":"tedi-alert--warning-88456526","tedi-alert--danger":"tedi-alert--danger-b9a2aa60","tedi-alert--global":"tedi-alert--global-14ff86d0","tedi-alert--no-side-borders":"tedi-alert--no-side-borders-a15a1df0"};exports.default=e;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-alert":"tedi-alert-8ca3e7b9","tedi-alert__content":"tedi-alert__content-d480ed20","tedi-alert__icon":"tedi-alert__icon-f9ab1feb","tedi-alert--size-default":"tedi-alert--size-default-6a9ebe2c","tedi-alert--size-small":"tedi-alert--size-small-4c763cad","tedi-alert--info":"tedi-alert--info-bcd40044","tedi-alert--success":"tedi-alert--success-e6d21f49","tedi-alert--warning":"tedi-alert--warning-88456526","tedi-alert--danger":"tedi-alert--danger-b9a2aa60","tedi-alert--global":"tedi-alert--global-14ff86d0","tedi-alert--no-side-borders":"tedi-alert--no-side-borders-a15a1df0","tedi-alert--has-action":"tedi-alert--has-action-0140d06a"};exports.default=e;
|
|
@@ -9,7 +9,8 @@ const e = {
|
|
|
9
9
|
"tedi-alert--warning": "tedi-alert--warning-88456526",
|
|
10
10
|
"tedi-alert--danger": "tedi-alert--danger-b9a2aa60",
|
|
11
11
|
"tedi-alert--global": "tedi-alert--global-14ff86d0",
|
|
12
|
-
"tedi-alert--no-side-borders": "tedi-alert--no-side-borders-a15a1df0"
|
|
12
|
+
"tedi-alert--no-side-borders": "tedi-alert--no-side-borders-a15a1df0",
|
|
13
|
+
"tedi-alert--has-action": "tedi-alert--has-action-0140d06a"
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
16
|
e as default
|