@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.
Files changed (49) hide show
  1. package/_virtual/index.cjs10.js +1 -1
  2. package/_virtual/index.cjs11.js +1 -1
  3. package/_virtual/index.cjs12.js +1 -1
  4. package/_virtual/index.cjs13.js +1 -1
  5. package/_virtual/index.cjs5.js +1 -1
  6. package/_virtual/index.cjs6.js +1 -1
  7. package/_virtual/index.cjs7.js +1 -1
  8. package/_virtual/index.cjs8.js +1 -1
  9. package/_virtual/index.cjs9.js +1 -1
  10. package/_virtual/index.es10.js +1 -1
  11. package/_virtual/index.es11.js +1 -1
  12. package/_virtual/index.es12.js +1 -1
  13. package/_virtual/index.es13.js +2 -4
  14. package/_virtual/index.es14.js +2 -2
  15. package/_virtual/index.es5.js +4 -2
  16. package/_virtual/index.es6.js +1 -1
  17. package/_virtual/index.es7.js +1 -1
  18. package/_virtual/index.es8.js +1 -1
  19. package/_virtual/index.es9.js +1 -1
  20. package/bundle-stats.html +1 -1
  21. package/external/@mui/system/colorManipulator.cjs.js +1 -1
  22. package/external/@mui/system/colorManipulator.es.js +2 -2
  23. package/external/@mui/system/createStyled.cjs.js +1 -1
  24. package/external/@mui/system/createStyled.es.js +6 -6
  25. package/external/@mui/system/useThemeWithoutDefault.cjs.js +1 -1
  26. package/external/@mui/system/useThemeWithoutDefault.es.js +1 -1
  27. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
  28. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
  29. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  30. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
  31. package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
  32. package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
  33. package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
  34. package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
  35. package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  36. package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
  37. package/external/prop-types/external/react-is/index.cjs.js +1 -1
  38. package/external/prop-types/external/react-is/index.es.js +1 -1
  39. package/external/react-is/index.cjs.js +1 -1
  40. package/external/react-is/index.es.js +1 -1
  41. package/external/toposort/index.cjs.js +1 -1
  42. package/external/toposort/index.es.js +1 -1
  43. package/index.css +1 -1
  44. package/package.json +1 -1
  45. package/src/tedi/components/notifications/alert/alert.cjs.js +1 -1
  46. package/src/tedi/components/notifications/alert/alert.d.ts +14 -1
  47. package/src/tedi/components/notifications/alert/alert.es.js +45 -42
  48. package/src/tedi/components/notifications/alert/alert.module.scss.cjs.js +1 -1
  49. package/src/tedi/components/notifications/alert/alert.module.scss.es.js +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tedi-design-system/react",
3
- "version": "18.0.0-rc.2",
3
+ "version": "18.0.0-rc.3",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),w=require("../../../../../external/classnames/index.cjs.js"),C=require("react"),M=require("../../base/icon/icon.cjs.js"),N=require("../../base/typography/heading/heading.cjs.js"),P=require("../../buttons/closing-button/closing-button.cjs.js"),t=require("./alert.module.scss.cjs.js"),k=require("../../../helpers/hooks/use-is-mounted.cjs.js"),z=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),y=require("../../layout/vertical-spacing/vertical-spacing.cjs.js"),$=require("../../layout/grid/row.cjs.js"),f=require("../../layout/grid/col.cjs.js"),p=l=>{const{getCurrentBreakpointProps:g}=z.useBreakpointProps(l.defaultServerBreakpoint),{children:s,role:i="alert",title:r,className:m,type:n="info",icon:o,onClose:c,isGlobal:h=!1,noSideBorders:j=!1,titleElement:q="h3",size:x="default",...v}=g(l),_=w.default(t.default["tedi-alert"],t.default[`tedi-alert--${n}`],t.default[`tedi-alert--size-${x}`],{[t.default["tedi-alert--global"]]:h,[t.default["tedi-alert--no-side-borders"]]:j},m),b=k.useIsMounted(),B=a=>{const u={size:18},S=typeof a=="string"?{...u,name:a}:{...u,...a};return e.jsx(M.Icon,{...S,className:t.default["tedi-alert__icon"]})},I=i==="alert"?"assertive":i==="status"?"polite":"off",d=C.useId();return b?e.jsx("div",{role:i,"data-name":"alert","aria-label":`${n} alert`,"aria-live":I,"aria-labelledby":r?d:void 0,...v,className:_,children:e.jsxs(y.VerticalSpacing,{size:.25,children:[e.jsxs($.Row,{gutterX:2,alignItems:r?"center":"start",children:[e.jsxs(f.Col,{grow:1,className:t.default["tedi-alert__content"],children:[o&&B(o),e.jsx("div",{className:"tedi-alert__content-wrapper",children:r?e.jsx(N.Heading,{element:q,id:d,modifiers:["h5"],children:r}):s})]}),c&&e.jsx(f.Col,{width:"auto",children:e.jsx(P.ClosingButton,{onClick:c,iconSize:18})})]}),r&&s&&e.jsx("div",{className:"tedi-alert__content-wrapper",children:s})]})}):null};exports.Alert=p;exports.default=p;
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: (props: AlertProps) => JSX.Element | null;
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 l } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
2
  import k from "../../../../../external/classnames/index.es.js";
3
- import y from "react";
4
- import { Icon as P } from "../../base/icon/icon.es.js";
5
- import { Heading as S } from "../../base/typography/heading/heading.es.js";
6
- import { ClosingButton as x } from "../../buttons/closing-button/closing-button.es.js";
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 M } from "../../../helpers/hooks/use-is-mounted.es.js";
9
- import { useBreakpointProps as $ } from "../../../helpers/hooks/use-breakpoint-props.es.js";
10
- import { VerticalSpacing as j } from "../../layout/vertical-spacing/vertical-spacing.es.js";
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 f } from "../../layout/grid/col.es.js";
13
- const O = (s) => {
14
- const { getCurrentBreakpointProps: u } = $(s.defaultServerBreakpoint), {
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: h,
19
- type: n = "info",
20
- icon: d,
21
- onClose: c,
22
- isGlobal: g = !1,
23
- noSideBorders: _ = !1,
24
- titleElement: v = "h3",
25
- size: I = "default",
26
- ...N
27
- } = u(s), b = k(
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--${n}`],
30
- t[`tedi-alert--size-${I}`],
30
+ t[`tedi-alert--${c}`],
31
+ t[`tedi-alert--size-${B}`],
31
32
  {
32
- [t["tedi-alert--global"]]: g,
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
- h
36
- ), B = M(), w = (a) => {
37
- const p = { size: 18 }, C = typeof a == "string" ? { ...p, name: a } : { ...p, ...a };
38
- return /* @__PURE__ */ e(P, { ...C, className: t["tedi-alert__icon"] });
39
- }, z = i === "alert" ? "assertive" : i === "status" ? "polite" : "off", m = y.useId();
40
- return B ? /* @__PURE__ */ e(
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": `${n} alert`,
47
+ "aria-label": `${c} alert`,
46
48
  "aria-live": z,
47
- "aria-labelledby": r ? m : void 0,
48
- ...N,
49
+ "aria-labelledby": r ? f : void 0,
50
+ ...I,
49
51
  className: b,
50
- children: /* @__PURE__ */ l(j, { size: 0.25, children: [
51
- /* @__PURE__ */ l(E, { gutterX: 2, alignItems: r ? "center" : "start", children: [
52
- /* @__PURE__ */ l(f, { grow: 1, className: t["tedi-alert__content"], children: [
53
- d && w(d),
54
- /* @__PURE__ */ e("div", { className: "tedi-alert__content-wrapper", children: r ? /* @__PURE__ */ e(S, { element: v, id: m, modifiers: ["h5"], children: r }) : o })
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
- c && /* @__PURE__ */ e(f, { width: "auto", children: /* @__PURE__ */ e(x, { onClick: c, iconSize: 18 }) })
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
- O as Alert,
65
- O as default
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