@tedi-design-system/react 18.0.0-rc.1 → 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 (54) 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/buttons/collapse/collapse.cjs.js +1 -1
  46. package/src/tedi/components/buttons/collapse/collapse.d.ts +8 -0
  47. package/src/tedi/components/buttons/collapse/collapse.es.js +48 -46
  48. package/src/tedi/components/buttons/collapse/collapse.module.scss.cjs.js +1 -1
  49. package/src/tedi/components/buttons/collapse/collapse.module.scss.es.js +2 -1
  50. package/src/tedi/components/notifications/alert/alert.cjs.js +1 -1
  51. package/src/tedi/components/notifications/alert/alert.d.ts +14 -1
  52. package/src/tedi/components/notifications/alert/alert.es.js +45 -42
  53. package/src/tedi/components/notifications/alert/alert.module.scss.cjs.js +1 -1
  54. 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.1",
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 t=require("react/jsx-runtime"),s=require("../../../../../external/classnames/index.cjs.js"),_=require("react"),K=require("../../../../../external/react-animate-height/dist/esm/index.cjs.js"),A=require("../../../providers/printing-provider/printing-provider.cjs.js"),F=require("../../base/icon/icon.cjs.js"),G=require("../../base/typography/text/text.cjs.js"),H=require("../../misc/print/print.cjs.js"),e=require("./collapse.module.scss.cjs.js"),J=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),Q=require("../../../providers/label-provider/use-labels.cjs.js"),v=require("../../layout/grid/row.cjs.js"),o=require("../../layout/grid/col.cjs.js"),N=x=>{const{getCurrentBreakpointProps:P}=J.useBreakpointProps(x.defaultServerBreakpoint),{getLabel:h}=Q.useLabels(),{id:r,children:w,className:k,openText:j=h("open"),closeText:g=h("close"),hideCollapseText:I=!1,title:c,titleRowProps:O,defaultOpen:$,open:d,onToggle:u,arrowType:n="default",size:i="default",underline:S=!0,toggleLabel:y,iconOnly:B=!1,...M}=P(x),p=`${r}__trigger`,f=`${r}__content`,R=`${r}__animate`,[b,T]=_.useState(()=>$),m=A.usePrint(),a=_.useMemo(()=>m||(d!==void 0?d:b),[m,d,b]),L=B===!0&&!c,D=s.default(e.default["tedi-collapse"],i==="small"&&e.default["tedi-collapse--small"],a&&e.default["tedi-collapse--is-open"],L&&e.default["tedi-collapse--icon-only"],e.default[`tedi-collapse--arrow-${n}`],k),q=()=>{const l=!a;T(l),u==null||u(l)},z=l=>{(l.key==="Enter"||l.key===" ")&&!l.repeat&&(l.preventDefault(),q())},E=y||(a?g:j),C=_.useMemo(()=>t.jsx("div",{id:f,role:"region","aria-labelledby":p,className:e.default["tedi-collapse__content"],children:w}),[w,f,p]);return t.jsxs("div",{"data-name":"collapse",...M,className:D,children:[t.jsx("button",{id:p,type:"button","data-name":"collapse-trigger",className:e.default["tedi-collapse__title"],"aria-label":E,"aria-expanded":a,"aria-controls":f,onKeyDown:z,onClick:q,children:t.jsxs(v.Row,{justifyContent:"between",alignItems:"center",wrap:"nowrap",...O,element:"span",children:[c&&t.jsx(o.Col,{"aria-hidden":"true",children:c}),t.jsx(o.Col,{width:"auto",children:t.jsxs(v.Row,{element:"span",alignItems:"center",gutter:0,wrap:"nowrap",children:[t.jsx(H.Print,{visibility:"hide",children:t.jsx(o.Col,{width:"auto",className:s.default({"visually-hidden":I}),children:t.jsx(G.Text,{element:"span",className:s.default(e.default["tedi-collapse__text"],{[e.default["tedi-collapse__text--underline"]]:S}),children:a?g:j})})}),t.jsx(o.Col,{width:"auto",children:t.jsx("div",{className:s.default(e.default["tedi-collapse__icon-wrapper"],e.default[`tedi-collapse__icon-wrapper--${n}`],i==="small"&&e.default["tedi-collapse__icon-wrapper--small"]),children:t.jsx(F.Icon,{className:s.default(e.default["tedi-collapse__icon"],e.default[`tedi-collapse__icon--${n}`],i==="small"&&e.default["tedi-collapse__icon--small"]),name:"expand_more",size:i==="small"||n==="secondary"?18:24})})})]})})]})}),m?C:t.jsx(K.default,{id:R,duration:300,height:a?"auto":0,"data-testid":"collapse-inner",children:C})]})};exports.Collapse=N;exports.default=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),n=require("../../../../../external/classnames/index.cjs.js"),_=require("react"),F=require("../../../../../external/react-animate-height/dist/esm/index.cjs.js"),G=require("../../../providers/printing-provider/printing-provider.cjs.js"),H=require("../../base/icon/icon.cjs.js"),J=require("../../base/typography/text/text.cjs.js"),Q=require("../../misc/print/print.cjs.js"),e=require("./collapse.module.scss.cjs.js"),U=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),V=require("../../../providers/label-provider/use-labels.cjs.js"),C=require("../../layout/grid/row.cjs.js"),o=require("../../layout/grid/col.cjs.js"),I=x=>{const{getCurrentBreakpointProps:N}=U.useBreakpointProps(x.defaultServerBreakpoint),{getLabel:h}=V.useLabels(),{id:r,children:w,className:P,openText:j=h("open"),closeText:g=h("close"),hideCollapseText:k=!1,title:d,titleRowProps:O,defaultOpen:$,open:c,onToggle:u,arrowType:s="default",size:i="default",underline:S=!0,toggleLabel:y,iconOnly:B=!1,inverted:M=!1,...R}=N(x),p=`${r}__trigger`,f=`${r}__content`,T=`${r}__animate`,[b,L]=_.useState(()=>$),m=G.usePrint(),a=_.useMemo(()=>m||(c!==void 0?c:b),[m,c,b]),D=B===!0&&!d,z=M&&s!=="secondary",E=n.default(e.default["tedi-collapse"],i==="small"&&e.default["tedi-collapse--small"],a&&e.default["tedi-collapse--is-open"],D&&e.default["tedi-collapse--icon-only"],z&&e.default["tedi-collapse--inverted"],e.default[`tedi-collapse--arrow-${s}`],P),v=()=>{const l=!a;L(l),u==null||u(l)},K=l=>{(l.key==="Enter"||l.key===" ")&&!l.repeat&&(l.preventDefault(),v())},A=y||(a?g:j),q=_.useMemo(()=>t.jsx("div",{id:f,role:"region","aria-labelledby":p,className:e.default["tedi-collapse__content"],children:w}),[w,f,p]);return t.jsxs("div",{"data-name":"collapse",...R,className:E,children:[t.jsx("button",{id:p,type:"button","data-name":"collapse-trigger",className:e.default["tedi-collapse__title"],"aria-label":A,"aria-expanded":a,"aria-controls":f,onKeyDown:K,onClick:v,children:t.jsxs(C.Row,{justifyContent:"between",alignItems:"center",wrap:"nowrap",...O,element:"span",children:[d&&t.jsx(o.Col,{"aria-hidden":"true",children:d}),t.jsx(o.Col,{width:"auto",children:t.jsxs(C.Row,{element:"span",alignItems:"center",gutter:0,wrap:"nowrap",children:[t.jsx(Q.Print,{visibility:"hide",children:t.jsx(o.Col,{width:"auto",className:n.default({"visually-hidden":k}),children:t.jsx(J.Text,{element:"span",className:n.default(e.default["tedi-collapse__text"],{[e.default["tedi-collapse__text--underline"]]:S}),children:a?g:j})})}),t.jsx(o.Col,{width:"auto",children:t.jsx("div",{className:n.default(e.default["tedi-collapse__icon-wrapper"],e.default[`tedi-collapse__icon-wrapper--${s}`],i==="small"&&e.default["tedi-collapse__icon-wrapper--small"]),children:t.jsx(H.Icon,{className:n.default(e.default["tedi-collapse__icon"],e.default[`tedi-collapse__icon--${s}`],i==="small"&&e.default["tedi-collapse__icon--small"]),name:"expand_more",size:i==="small"||s==="secondary"?18:24})})})]})})]})}),m?q:t.jsx(F.default,{id:T,duration:300,height:a?"auto":0,"data-testid":"collapse-inner",children:q})]})};exports.Collapse=I;exports.default=I;
@@ -40,6 +40,14 @@ type CollapseBreakpointProps = {
40
40
  * @default false
41
41
  */
42
42
  iconOnly?: boolean;
43
+ /**
44
+ * Inverted color palette — flips the link / icon colors to their
45
+ * inverted-surface equivalents (white text + icon), for use on top of dark
46
+ * backgrounds. Pairs with both the with-text and icon-only variants; the
47
+ * secondary-arrow style has no inverted form in the design.
48
+ * @default false
49
+ */
50
+ inverted?: boolean;
43
51
  };
44
52
  export interface CollapseProps extends BreakpointSupport<CollapseBreakpointProps> {
45
53
  /**
@@ -1,55 +1,57 @@
1
- import { jsx as t, jsxs as h } from "react/jsx-runtime";
2
- import o from "../../../../../external/classnames/index.es.js";
3
- import f from "react";
4
- import A from "../../../../../external/react-animate-height/dist/esm/index.es.js";
5
- import { usePrint as H } from "../../../providers/printing-provider/printing-provider.es.js";
6
- import { Icon as q } from "../../base/icon/icon.es.js";
7
- import { Text as F } from "../../base/typography/text/text.es.js";
8
- import { Print as G } from "../../misc/print/print.es.js";
1
+ import { jsx as t, jsxs as f } from "react/jsx-runtime";
2
+ import n from "../../../../../external/classnames/index.es.js";
3
+ import h from "react";
4
+ import q from "../../../../../external/react-animate-height/dist/esm/index.es.js";
5
+ import { usePrint as F } from "../../../providers/printing-provider/printing-provider.es.js";
6
+ import { Icon as G } from "../../base/icon/icon.es.js";
7
+ import { Text as J } from "../../base/typography/text/text.es.js";
8
+ import { Print as Q } from "../../misc/print/print.es.js";
9
9
  import e from "./collapse.module.scss.es.js";
10
- import { useBreakpointProps as J } from "../../../helpers/hooks/use-breakpoint-props.es.js";
11
- import { useLabels as Q } from "../../../providers/label-provider/use-labels.es.js";
10
+ import { useBreakpointProps as U } from "../../../helpers/hooks/use-breakpoint-props.es.js";
11
+ import { useLabels as V } from "../../../providers/label-provider/use-labels.es.js";
12
12
  import { Row as k } from "../../layout/grid/row.es.js";
13
13
  import { Col as s } from "../../layout/grid/col.es.js";
14
- const se = (w) => {
15
- const { getCurrentBreakpointProps: O } = J(w.defaultServerBreakpoint), { getLabel: y } = Q(), {
14
+ const ce = (w) => {
15
+ const { getCurrentBreakpointProps: O } = U(w.defaultServerBreakpoint), { getLabel: y } = V(), {
16
16
  id: r,
17
17
  children: g,
18
18
  className: P,
19
19
  openText: b = y("open"),
20
- closeText: x = y("close"),
20
+ closeText: v = y("close"),
21
21
  hideCollapseText: $ = !1,
22
22
  title: c,
23
23
  titleRowProps: B,
24
24
  defaultOpen: S,
25
25
  open: d,
26
26
  onToggle: p,
27
- arrowType: n = "default",
27
+ arrowType: o = "default",
28
28
  size: i = "default",
29
29
  underline: T = !0,
30
- toggleLabel: N,
30
+ toggleLabel: x,
31
31
  iconOnly: j = !1,
32
- ...D
33
- } = O(w), m = `${r}__trigger`, u = `${r}__content`, L = `${r}__animate`, [C, M] = f.useState(() => S), _ = H(), a = f.useMemo(
34
- () => _ || (d !== void 0 ? d : C),
35
- [_, d, C]
36
- ), R = j === !0 && !c, z = o(
32
+ inverted: D = !1,
33
+ ...L
34
+ } = O(w), m = `${r}__trigger`, u = `${r}__content`, M = `${r}__animate`, [N, R] = h.useState(() => S), _ = F(), a = h.useMemo(
35
+ () => _ || (d !== void 0 ? d : N),
36
+ [_, d, N]
37
+ ), z = j === !0 && !c, E = D && o !== "secondary", K = n(
37
38
  e["tedi-collapse"],
38
39
  i === "small" && e["tedi-collapse--small"],
39
40
  a && e["tedi-collapse--is-open"],
40
- R && e["tedi-collapse--icon-only"],
41
- e[`tedi-collapse--arrow-${n}`],
41
+ z && e["tedi-collapse--icon-only"],
42
+ E && e["tedi-collapse--inverted"],
43
+ e[`tedi-collapse--arrow-${o}`],
42
44
  P
43
- ), v = () => {
45
+ ), C = () => {
44
46
  const l = !a;
45
- M(l), p == null || p(l);
46
- }, E = (l) => {
47
- (l.key === "Enter" || l.key === " ") && !l.repeat && (l.preventDefault(), v());
48
- }, K = N || (a ? x : b), I = f.useMemo(
47
+ R(l), p == null || p(l);
48
+ }, A = (l) => {
49
+ (l.key === "Enter" || l.key === " ") && !l.repeat && (l.preventDefault(), C());
50
+ }, H = x || (a ? v : b), I = h.useMemo(
49
51
  () => /* @__PURE__ */ t("div", { id: u, role: "region", "aria-labelledby": m, className: e["tedi-collapse__content"], children: g }),
50
52
  [g, u, m]
51
53
  );
52
- return /* @__PURE__ */ h("div", { "data-name": "collapse", ...D, className: z, children: [
54
+ return /* @__PURE__ */ f("div", { "data-name": "collapse", ...L, className: K, children: [
53
55
  /* @__PURE__ */ t(
54
56
  "button",
55
57
  {
@@ -57,42 +59,42 @@ const se = (w) => {
57
59
  type: "button",
58
60
  "data-name": "collapse-trigger",
59
61
  className: e["tedi-collapse__title"],
60
- "aria-label": K,
62
+ "aria-label": H,
61
63
  "aria-expanded": a,
62
64
  "aria-controls": u,
63
- onKeyDown: E,
64
- onClick: v,
65
- children: /* @__PURE__ */ h(k, { justifyContent: "between", alignItems: "center", wrap: "nowrap", ...B, element: "span", children: [
65
+ onKeyDown: A,
66
+ onClick: C,
67
+ children: /* @__PURE__ */ f(k, { justifyContent: "between", alignItems: "center", wrap: "nowrap", ...B, element: "span", children: [
66
68
  c && /* @__PURE__ */ t(s, { "aria-hidden": "true", children: c }),
67
- /* @__PURE__ */ t(s, { width: "auto", children: /* @__PURE__ */ h(k, { element: "span", alignItems: "center", gutter: 0, wrap: "nowrap", children: [
68
- /* @__PURE__ */ t(G, { visibility: "hide", children: /* @__PURE__ */ t(s, { width: "auto", className: o({ "visually-hidden": $ }), children: /* @__PURE__ */ t(
69
- F,
69
+ /* @__PURE__ */ t(s, { width: "auto", children: /* @__PURE__ */ f(k, { element: "span", alignItems: "center", gutter: 0, wrap: "nowrap", children: [
70
+ /* @__PURE__ */ t(Q, { visibility: "hide", children: /* @__PURE__ */ t(s, { width: "auto", className: n({ "visually-hidden": $ }), children: /* @__PURE__ */ t(
71
+ J,
70
72
  {
71
73
  element: "span",
72
- className: o(e["tedi-collapse__text"], {
74
+ className: n(e["tedi-collapse__text"], {
73
75
  [e["tedi-collapse__text--underline"]]: T
74
76
  }),
75
- children: a ? x : b
77
+ children: a ? v : b
76
78
  }
77
79
  ) }) }),
78
80
  /* @__PURE__ */ t(s, { width: "auto", children: /* @__PURE__ */ t(
79
81
  "div",
80
82
  {
81
- className: o(
83
+ className: n(
82
84
  e["tedi-collapse__icon-wrapper"],
83
- e[`tedi-collapse__icon-wrapper--${n}`],
85
+ e[`tedi-collapse__icon-wrapper--${o}`],
84
86
  i === "small" && e["tedi-collapse__icon-wrapper--small"]
85
87
  ),
86
88
  children: /* @__PURE__ */ t(
87
- q,
89
+ G,
88
90
  {
89
- className: o(
91
+ className: n(
90
92
  e["tedi-collapse__icon"],
91
- e[`tedi-collapse__icon--${n}`],
93
+ e[`tedi-collapse__icon--${o}`],
92
94
  i === "small" && e["tedi-collapse__icon--small"]
93
95
  ),
94
96
  name: "expand_more",
95
- size: i === "small" || n === "secondary" ? 18 : 24
97
+ size: i === "small" || o === "secondary" ? 18 : 24
96
98
  }
97
99
  )
98
100
  }
@@ -101,10 +103,10 @@ const se = (w) => {
101
103
  ] })
102
104
  }
103
105
  ),
104
- _ ? I : /* @__PURE__ */ t(A, { id: L, duration: 300, height: a ? "auto" : 0, "data-testid": "collapse-inner", children: I })
106
+ _ ? I : /* @__PURE__ */ t(q, { id: M, duration: 300, height: a ? "auto" : 0, "data-testid": "collapse-inner", children: I })
105
107
  ] });
106
108
  };
107
109
  export {
108
- se as Collapse,
109
- se as default
110
+ ce as Collapse,
111
+ ce as default
110
112
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-collapse__title":"tedi-collapse__title-3e140e5c","tedi-collapse__text":"tedi-collapse__text-d150fea1","tedi-collapse__text--underline":"tedi-collapse__text--underline-73ca86bd","tedi-collapse__icon-wrapper":"tedi-collapse__icon-wrapper-d2b036ea","tedi-collapse__icon":"tedi-collapse__icon-5156e480","tedi-collapse__icon-wrapper--secondary":"tedi-collapse__icon-wrapper--secondary-3321348a","tedi-collapse__icon--secondary":"tedi-collapse__icon--secondary-f0f3125f","tedi-collapse__icon--default":"tedi-collapse__icon--default-9c7e19e4","tedi-collapse__icon-wrapper--default":"tedi-collapse__icon-wrapper--default-450808b2","tedi-collapse__icon-wrapper--small":"tedi-collapse__icon-wrapper--small-65e6d09a","tedi-collapse--icon-only":"tedi-collapse--icon-only-335962f8","tedi-collapse__content":"tedi-collapse__content-350b91f8","tedi-collapse--is-open":"tedi-collapse--is-open-b34b11c3"};exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-collapse__title":"tedi-collapse__title-3e140e5c","tedi-collapse__text":"tedi-collapse__text-d150fea1","tedi-collapse__text--underline":"tedi-collapse__text--underline-73ca86bd","tedi-collapse__icon-wrapper":"tedi-collapse__icon-wrapper-d2b036ea","tedi-collapse__icon":"tedi-collapse__icon-5156e480","tedi-collapse__icon-wrapper--secondary":"tedi-collapse__icon-wrapper--secondary-3321348a","tedi-collapse__icon--secondary":"tedi-collapse__icon--secondary-f0f3125f","tedi-collapse__icon--default":"tedi-collapse__icon--default-9c7e19e4","tedi-collapse__icon-wrapper--default":"tedi-collapse__icon-wrapper--default-450808b2","tedi-collapse__icon-wrapper--small":"tedi-collapse__icon-wrapper--small-65e6d09a","tedi-collapse--icon-only":"tedi-collapse--icon-only-335962f8","tedi-collapse__content":"tedi-collapse__content-350b91f8","tedi-collapse--is-open":"tedi-collapse--is-open-b34b11c3","tedi-collapse--inverted":"tedi-collapse--inverted-bd2d0e21"};exports.default=e;
@@ -11,7 +11,8 @@ const e = {
11
11
  "tedi-collapse__icon-wrapper--small": "tedi-collapse__icon-wrapper--small-65e6d09a",
12
12
  "tedi-collapse--icon-only": "tedi-collapse--icon-only-335962f8",
13
13
  "tedi-collapse__content": "tedi-collapse__content-350b91f8",
14
- "tedi-collapse--is-open": "tedi-collapse--is-open-b34b11c3"
14
+ "tedi-collapse--is-open": "tedi-collapse--is-open-b34b11c3",
15
+ "tedi-collapse--inverted": "tedi-collapse--inverted-bd2d0e21"
15
16
  };
16
17
  export {
17
18
  e as default
@@ -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