@tedi-design-system/react 19.0.1-rc.2 → 19.1.0-rc.2

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 (62) hide show
  1. package/bundle-stats.html +1 -1
  2. package/index.css +1 -1
  3. package/package.json +1 -1
  4. package/src/community/components/layout/sidenav/sidenav.cjs.js +1 -1
  5. package/src/community/components/layout/sidenav/sidenav.es.js +38 -40
  6. package/src/community/components/vertical-stepper/step-item/step-item.d.ts +6 -0
  7. package/src/community/components/vertical-stepper/sub-item/sub-item.d.ts +6 -0
  8. package/src/community/components/vertical-stepper/vertical-stepper.d.ts +6 -0
  9. package/src/tedi/components/content/collapse/collapse.cjs.js +1 -1
  10. package/src/tedi/components/content/collapse/collapse.d.ts +9 -0
  11. package/src/tedi/components/content/collapse/collapse.es.js +44 -35
  12. package/src/tedi/components/layout/sidenav/components/sidenav-item/sidenav-item.cjs.js +1 -1
  13. package/src/tedi/components/layout/sidenav/components/sidenav-item/sidenav-item.es.js +82 -85
  14. package/src/tedi/components/layout/sidenav/sidenav.cjs.js +1 -1
  15. package/src/tedi/components/layout/sidenav/sidenav.es.js +16 -16
  16. package/src/tedi/components/layout/top-nav/components/top-nav-item/top-nav-item.cjs.js +1 -1
  17. package/src/tedi/components/layout/top-nav/components/top-nav-item/top-nav-item.es.js +6 -7
  18. package/src/tedi/components/layout/top-nav/components/top-nav-separator/top-nav-separator.cjs.js +1 -1
  19. package/src/tedi/components/layout/top-nav/components/top-nav-separator/top-nav-separator.es.js +2 -2
  20. package/src/tedi/components/layout/top-nav/top-nav.cjs.js +1 -1
  21. package/src/tedi/components/layout/top-nav/top-nav.es.js +9 -8
  22. package/src/tedi/components/navigation/card-stepper/card-stepper-step.cjs.js +1 -0
  23. package/src/tedi/components/navigation/card-stepper/card-stepper-step.d.ts +86 -0
  24. package/src/tedi/components/navigation/card-stepper/card-stepper-step.es.js +5 -0
  25. package/src/tedi/components/navigation/card-stepper/card-stepper.cjs.js +1 -0
  26. package/src/tedi/components/navigation/card-stepper/card-stepper.d.ts +130 -0
  27. package/src/tedi/components/navigation/card-stepper/card-stepper.es.js +200 -0
  28. package/src/tedi/components/navigation/card-stepper/card-stepper.module.scss.cjs.js +1 -0
  29. package/src/tedi/components/navigation/card-stepper/card-stepper.module.scss.es.js +26 -0
  30. package/src/tedi/components/navigation/card-stepper/index.d.ts +2 -0
  31. package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-collapsible/table-of-contents-collapsible.cjs.js +1 -1
  32. package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-collapsible/table-of-contents-collapsible.es.js +36 -58
  33. package/src/tedi/components/navigation/vertical-stepper/index.d.ts +3 -0
  34. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-context.cjs.js +1 -0
  35. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-context.d.ts +10 -0
  36. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-context.es.js +8 -0
  37. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-item.cjs.js +1 -0
  38. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-item.d.ts +74 -0
  39. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-item.es.js +109 -0
  40. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-sub-item.cjs.js +1 -0
  41. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-sub-item.d.ts +47 -0
  42. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-sub-item.es.js +65 -0
  43. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.cjs.js +1 -0
  44. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.d.ts +28 -0
  45. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.es.js +32 -0
  46. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.module.scss.cjs.js +1 -0
  47. package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.module.scss.es.js +34 -0
  48. package/src/tedi/components/overlays/sheet/sheet.cjs.js +1 -0
  49. package/src/tedi/components/overlays/sheet/sheet.d.ts +65 -0
  50. package/src/tedi/components/overlays/sheet/sheet.es.js +41 -0
  51. package/src/tedi/components/overlays/sheet/sheet.module.scss.cjs.js +1 -0
  52. package/src/tedi/components/overlays/sheet/sheet.module.scss.es.js +8 -0
  53. package/src/tedi/helpers/hooks/use-safe-id.cjs.js +1 -0
  54. package/src/tedi/helpers/hooks/use-safe-id.d.ts +16 -0
  55. package/src/tedi/helpers/hooks/use-safe-id.es.js +5 -0
  56. package/src/tedi/helpers/index.d.ts +1 -0
  57. package/src/tedi/index.d.ts +2 -0
  58. package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
  59. package/src/tedi/providers/label-provider/labels-map.d.ts +42 -0
  60. package/src/tedi/providers/label-provider/labels-map.es.js +113 -71
  61. package/tedi.cjs.js +1 -1
  62. package/tedi.es.js +284 -272
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tedi-design-system/react",
3
- "version": "19.0.1-rc.2",
3
+ "version": "19.1.0-rc.2",
4
4
  "description": "TEDI Design System React component library — accessible, reusable UI components. Docs & live examples: https://storybook.tedi.ee/react/rc/",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),d=require("react"),S=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),h=require("../../../../../external/classnames/index.cjs.js"),T=require("../../../../tedi/components/base/icon/icon.cjs.js"),L=require("../../../../tedi/components/content/collapse/collapse.cjs.js"),P=require("../../../../tedi/components/misc/print/print.cjs.js"),q=require("../../../helpers/hooks/use-layout.cjs.js"),B=require("../../anchor/anchor.cjs.js"),C=require("../layout-context.cjs.js"),a=require("./sidenav.module.scss.cjs.js"),F=require("./utility.cjs.js"),A=n=>requestAnimationFrame(n),I=n=>{const{navItems:l,ariaLabel:i,linkAs:r,breakToBottomContent:c,breakToHeader:x,showDividers:u=!0,hideSubItemIcons:m=!1,className:v,..._}=n,p=q.default(["mobile","tablet"]),{menuOpen:b,context:g,getFloatingProps:f,floating:y,headerType:e,y:s}=d.useContext(C.LayoutContext),{hasSidenav:o}=F.useSidenavRendered(e,n);if(!o)return null;const N=h.default(a.default.sidenav,v,{[a.default["sidenav--has-dividers"]]:u,[a.default["sidenav--hide-subitem-icons"]]:m}),j=t.jsx(P.Print,{visibility:"hide",children:t.jsx("nav",{"data-name":"sidenav",..._,className:N,"aria-label":i,children:t.jsx("ul",{className:a.default.sidenav__list,role:"menubar","aria-label":i,children:l.map((E,M)=>d.createElement(k,{as:r,...E,key:M}))})})});return p?b?t.jsx(S.FloatingOverlay,{lockScroll:!0,className:a.default.sidenav__overlay,children:t.jsx(S.FloatingFocusManager,{context:g,order:["reference","content"],children:t.jsx("div",{...f({style:{paddingTop:s??0},className:a.default.sidenav,"aria-label":i}),ref:y,children:j})})}):null:j},k=n=>{const{icon:l,children:i,isActive:r,onClick:c,subItems:x,as:u,...m}=n,{toggleMenu:v,onHeaderSidenavToggle:_}=d.useContext(C.LayoutContext),p=q.default(["mobile","tablet"]),b=h.default(a.default.sidenav__item,{[a.default["sidenav__item--current"]]:r}),g=d.useId(),f=e=>{const o={className:h.default(a.default.sidenav__icon)},N=typeof e=="string"?{...o,name:e,color:"inherit"}:{...o,...e,className:h.default(o.className,e==null?void 0:e.className),background:void 0};return t.jsx(T.Icon,{...N})},y=e=>{c==null||c(e),e.stopPropagation(),typeof _=="function"||(p?A(()=>v()):v())};return t.jsx("li",{"data-name":"sidenav-item",className:b,role:"presentation",children:x?t.jsx(L.Collapse,{id:g,hideCollapseText:!0,open:r,title:t.jsxs("span",{...(({_href:e,...s})=>s)(m),className:a.default.sidenav__link,noStyle:!0,role:"menuitem","aria-current":r?"page":void 0,children:[l&&f(l),t.jsx("span",{className:a.default.sidenav__title,children:i})]}),children:t.jsx("ul",{className:a.default.sidenav__list,role:"menubar",children:x.map((e,s)=>d.createElement(k,{as:u,...e,key:s}))})}):t.jsxs(B.Anchor,{...m,as:u,onClick:y,className:a.default.sidenav__link,noStyle:!0,role:"menuitem","aria-current":r?"page":void 0,children:[l&&f(l),t.jsx("span",{className:a.default.sidenav__title,children:i})]})})};exports.SideNav=I;exports.default=I;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),d=require("react"),S=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),h=require("../../../../../external/classnames/index.cjs.js"),T=require("../../../../tedi/components/base/icon/icon.cjs.js"),L=require("../../../../tedi/components/content/collapse/collapse.cjs.js"),P=require("../../../../tedi/components/misc/print/print.cjs.js"),q=require("../../../helpers/hooks/use-layout.cjs.js"),A=require("../../anchor/anchor.cjs.js"),C=require("../layout-context.cjs.js"),a=require("./sidenav.module.scss.cjs.js"),B=require("./utility.cjs.js"),F=n=>requestAnimationFrame(n),I=n=>{const{navItems:l,ariaLabel:r,linkAs:i,breakToBottomContent:c,breakToHeader:x,showDividers:u=!0,hideSubItemIcons:m=!1,className:v,..._}=n,p=q.default(["mobile","tablet"]),{menuOpen:g,context:y,getFloatingProps:f,floating:N,headerType:e,y:s}=d.useContext(C.LayoutContext),{hasSidenav:o}=B.useSidenavRendered(e,n);if(!o)return null;const b=h.default(a.default.sidenav,v,{[a.default["sidenav--has-dividers"]]:u,[a.default["sidenav--hide-subitem-icons"]]:m}),j=t.jsx(P.Print,{visibility:"hide",children:t.jsx("nav",{"data-name":"sidenav",..._,className:b,"aria-label":r,children:t.jsx("ul",{className:a.default.sidenav__list,children:l.map((E,M)=>d.createElement(k,{as:i,...E,key:M}))})})});return p?g?t.jsx(S.FloatingOverlay,{lockScroll:!0,className:a.default.sidenav__overlay,children:t.jsx(S.FloatingFocusManager,{context:y,order:["reference","content"],children:t.jsx("div",{...f({style:{paddingTop:s??0},className:a.default.sidenav,"aria-label":r}),ref:N,children:j})})}):null:j},k=n=>{const{icon:l,children:r,isActive:i,onClick:c,subItems:x,as:u,...m}=n,{toggleMenu:v,onHeaderSidenavToggle:_}=d.useContext(C.LayoutContext),p=q.default(["mobile","tablet"]),g=h.default(a.default.sidenav__item,{[a.default["sidenav__item--current"]]:i}),y=d.useId(),f=e=>{const o={className:h.default(a.default.sidenav__icon)},b=typeof e=="string"?{...o,name:e,color:"inherit"}:{...o,...e,className:h.default(o.className,e==null?void 0:e.className),background:void 0};return t.jsx(T.Icon,{...b})},N=e=>{c==null||c(e),e.stopPropagation(),typeof _=="function"||(p?F(()=>v()):v())};return t.jsx("li",{"data-name":"sidenav-item",className:g,children:x?t.jsx(L.Collapse,{id:y,hideCollapseText:!0,contentAsRegion:!1,open:i,title:t.jsxs("span",{...(({_href:e,...s})=>s)(m),className:a.default.sidenav__link,"aria-current":i?"page":void 0,children:[l&&f(l),t.jsx("span",{className:a.default.sidenav__title,children:r})]}),children:t.jsx("ul",{className:a.default.sidenav__list,children:x.map((e,s)=>d.createElement(k,{as:u,...e,key:s}))})}):t.jsxs(A.Anchor,{...m,as:u,onClick:N,className:a.default.sidenav__link,noStyle:!0,"aria-current":i?"page":void 0,children:[l&&f(l),t.jsx("span",{className:a.default.sidenav__title,children:r})]})})};exports.SideNav=I;exports.default=I;
@@ -1,98 +1,96 @@
1
1
  import { jsx as t, jsxs as x } from "react/jsx-runtime";
2
- import y, { createElement as C } from "react";
3
- import { FloatingOverlay as F, FloatingFocusManager as L } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
4
- import v from "../../../../../external/classnames/index.es.js";
5
- import { Icon as P } from "../../../../tedi/components/base/icon/icon.es.js";
6
- import { Collapse as A } from "../../../../tedi/components/content/collapse/collapse.es.js";
7
- import { Print as j } from "../../../../tedi/components/misc/print/print.es.js";
2
+ import b, { createElement as C } from "react";
3
+ import { FloatingOverlay as B, FloatingFocusManager as F } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
4
+ import p from "../../../../../external/classnames/index.es.js";
5
+ import { Icon as L } from "../../../../tedi/components/base/icon/icon.es.js";
6
+ import { Collapse as P } from "../../../../tedi/components/content/collapse/collapse.es.js";
7
+ import { Print as R } from "../../../../tedi/components/misc/print/print.es.js";
8
8
  import k from "../../../helpers/hooks/use-layout.es.js";
9
- import { Anchor as H } from "../../anchor/anchor.es.js";
9
+ import { Anchor as j } from "../../anchor/anchor.es.js";
10
10
  import { LayoutContext as E } from "../layout-context.es.js";
11
11
  import a from "./sidenav.module.scss.es.js";
12
- import { useSidenavRendered as O } from "./utility.es.js";
13
- const R = (s) => requestAnimationFrame(s), Y = (s) => {
12
+ import { useSidenavRendered as H } from "./utility.es.js";
13
+ const O = (n) => requestAnimationFrame(n), Y = (n) => {
14
14
  const {
15
15
  navItems: i,
16
- ariaLabel: o,
17
- linkAs: r,
16
+ ariaLabel: r,
17
+ linkAs: o,
18
18
  breakToBottomContent: c,
19
19
  breakToHeader: f,
20
20
  showDividers: d = !0,
21
21
  hideSubItemIcons: m = !1,
22
22
  className: u,
23
23
  ...h
24
- } = s, _ = k(["mobile", "tablet"]), { menuOpen: N, context: b, getFloatingProps: p, floating: S, headerType: e, y: n } = y.useContext(E), { hasSidenav: l } = O(e, s);
24
+ } = n, _ = k(["mobile", "tablet"]), { menuOpen: N, context: g, getFloatingProps: v, floating: S, headerType: e, y: s } = b.useContext(E), { hasSidenav: l } = H(e, n);
25
25
  if (!l)
26
26
  return null;
27
- const g = v(a.sidenav, u, {
27
+ const y = p(a.sidenav, u, {
28
28
  [a["sidenav--has-dividers"]]: d,
29
29
  [a["sidenav--hide-subitem-icons"]]: m
30
- }), I = /* @__PURE__ */ t(j, { visibility: "hide", children: /* @__PURE__ */ t("nav", { "data-name": "sidenav", ...h, className: g, "aria-label": o, children: /* @__PURE__ */ t("ul", { className: a.sidenav__list, role: "menubar", "aria-label": o, children: i.map((T, B) => /* @__PURE__ */ C(M, { as: r, ...T, key: B })) }) }) });
31
- return _ ? N ? /* @__PURE__ */ t(F, { lockScroll: !0, className: a.sidenav__overlay, children: /* @__PURE__ */ t(L, { context: b, order: ["reference", "content"], children: /* @__PURE__ */ t(
30
+ }), I = /* @__PURE__ */ t(R, { visibility: "hide", children: /* @__PURE__ */ t("nav", { "data-name": "sidenav", ...h, className: y, "aria-label": r, children: /* @__PURE__ */ t("ul", { className: a.sidenav__list, children: i.map((T, A) => /* @__PURE__ */ C(M, { as: o, ...T, key: A })) }) }) });
31
+ return _ ? N ? /* @__PURE__ */ t(B, { lockScroll: !0, className: a.sidenav__overlay, children: /* @__PURE__ */ t(F, { context: g, order: ["reference", "content"], children: /* @__PURE__ */ t(
32
32
  "div",
33
33
  {
34
- ...p({
34
+ ...v({
35
35
  style: {
36
- paddingTop: n ?? 0
36
+ paddingTop: s ?? 0
37
37
  },
38
38
  className: a.sidenav,
39
- "aria-label": o
39
+ "aria-label": r
40
40
  }),
41
41
  ref: S,
42
42
  children: I
43
43
  }
44
44
  ) }) }) : null : I;
45
- }, M = (s) => {
46
- const { icon: i, children: o, isActive: r, onClick: c, subItems: f, as: d, ...m } = s, { toggleMenu: u, onHeaderSidenavToggle: h } = y.useContext(E), _ = k(["mobile", "tablet"]), N = v(a.sidenav__item, { [a["sidenav__item--current"]]: r }), b = y.useId(), p = (e) => {
47
- const l = { className: v(a.sidenav__icon) }, g = typeof e == "string" ? { ...l, name: e, color: "inherit" } : {
45
+ }, M = (n) => {
46
+ const { icon: i, children: r, isActive: o, onClick: c, subItems: f, as: d, ...m } = n, { toggleMenu: u, onHeaderSidenavToggle: h } = b.useContext(E), _ = k(["mobile", "tablet"]), N = p(a.sidenav__item, { [a["sidenav__item--current"]]: o }), g = b.useId(), v = (e) => {
47
+ const l = { className: p(a.sidenav__icon) }, y = typeof e == "string" ? { ...l, name: e, color: "inherit" } : {
48
48
  ...l,
49
49
  ...e,
50
- className: v(l.className, e == null ? void 0 : e.className),
50
+ className: p(l.className, e == null ? void 0 : e.className),
51
51
  background: void 0
52
52
  };
53
- return /* @__PURE__ */ t(P, { ...g });
53
+ return /* @__PURE__ */ t(L, { ...y });
54
54
  };
55
- return /* @__PURE__ */ t("li", { "data-name": "sidenav-item", className: N, role: "presentation", children: f ? /* @__PURE__ */ t(
56
- A,
55
+ return /* @__PURE__ */ t("li", { "data-name": "sidenav-item", className: N, children: f ? /* @__PURE__ */ t(
56
+ P,
57
57
  {
58
- id: b,
58
+ id: g,
59
59
  hideCollapseText: !0,
60
- open: r,
60
+ contentAsRegion: !1,
61
+ open: o,
61
62
  title: /* @__PURE__ */ x(
62
63
  "span",
63
64
  {
64
- ...(({ _href: e, ...n }) => n)(m),
65
+ ...(({ _href: e, ...s }) => s)(m),
65
66
  className: a.sidenav__link,
66
- noStyle: !0,
67
- role: "menuitem",
68
- "aria-current": r ? "page" : void 0,
67
+ "aria-current": o ? "page" : void 0,
69
68
  children: [
70
- i && p(i),
71
- /* @__PURE__ */ t("span", { className: a.sidenav__title, children: o })
69
+ i && v(i),
70
+ /* @__PURE__ */ t("span", { className: a.sidenav__title, children: r })
72
71
  ]
73
72
  }
74
73
  ),
75
- children: /* @__PURE__ */ t("ul", { className: a.sidenav__list, role: "menubar", children: f.map((e, n) => /* @__PURE__ */ C(M, { as: d, ...e, key: n })) })
74
+ children: /* @__PURE__ */ t("ul", { className: a.sidenav__list, children: f.map((e, s) => /* @__PURE__ */ C(M, { as: d, ...e, key: s })) })
76
75
  }
77
76
  ) : (
78
77
  // // TODO: Remove ts-ignore
79
78
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
80
79
  // @ts-ignore
81
80
  /* @__PURE__ */ x(
82
- H,
81
+ j,
83
82
  {
84
83
  ...m,
85
84
  as: d,
86
85
  onClick: (e) => {
87
- c == null || c(e), e.stopPropagation(), typeof h == "function" || (_ ? R(() => u()) : u());
86
+ c == null || c(e), e.stopPropagation(), typeof h == "function" || (_ ? O(() => u()) : u());
88
87
  },
89
88
  className: a.sidenav__link,
90
89
  noStyle: !0,
91
- role: "menuitem",
92
- "aria-current": r ? "page" : void 0,
90
+ "aria-current": o ? "page" : void 0,
93
91
  children: [
94
- i && p(i),
95
- /* @__PURE__ */ t("span", { className: a.sidenav__title, children: o })
92
+ i && v(i),
93
+ /* @__PURE__ */ t("span", { className: a.sidenav__title, children: r })
96
94
  ]
97
95
  }
98
96
  )
@@ -1,4 +1,7 @@
1
1
  import { default as React } from 'react';
2
+ /**
3
+ * @deprecated Use `VerticalStepper.Item` from `@tedi-design-system/react/tedi` instead.
4
+ */
2
5
  export interface StepItemProps {
3
6
  /**
4
7
  * SubItems
@@ -26,4 +29,7 @@ export interface StepItemProps {
26
29
  /** Called when collapse is toggled */
27
30
  onToggle?: (isOpen: boolean) => void;
28
31
  }
32
+ /**
33
+ * @deprecated Use `VerticalStepper.Item` from `@tedi-design-system/react/tedi` instead.
34
+ */
29
35
  export declare const StepItem: ({ children, className, isSelected, hasIcon, title, href, onClick, state, info, isOpen, onToggle, }: StepItemProps) => JSX.Element;
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @deprecated Use `VerticalStepper.SubItem` from `@tedi-design-system/react/tedi` instead.
3
+ */
1
4
  export interface SubItemProps {
2
5
  /**
3
6
  * Additional info components like StatusBadge, Button, Link or Text.
@@ -15,4 +18,7 @@ export interface SubItemProps {
15
18
  onClick?: () => void;
16
19
  as?: 'a' | 'button';
17
20
  }
21
+ /**
22
+ * @deprecated Use `VerticalStepper.SubItem` from `@tedi-design-system/react/tedi` instead.
23
+ */
18
24
  export declare const SubItem: ({ children, className, state, isSelected, hasIcon, title, href, as, onClick, }: SubItemProps) => JSX.Element;
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @deprecated Use `VerticalStepper` from `@tedi-design-system/react/tedi` instead.
3
+ */
1
4
  export interface VerticalStepperProps {
2
5
  /**
3
6
  * SubItem or Separator
@@ -10,5 +13,8 @@ export interface VerticalStepperProps {
10
13
  /** Compact version of the stepper */
11
14
  isCompact?: boolean;
12
15
  }
16
+ /**
17
+ * @deprecated Use `VerticalStepper` from `@tedi-design-system/react/tedi` instead.
18
+ */
13
19
  export declare const VerticalStepper: (props: VerticalStepperProps) => JSX.Element;
14
20
  export default VerticalStepper;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),q=require("../../../../../external/classnames/index.cjs.js"),n=require("react"),J=require("../../../../../external/react-animate-height/dist/esm/index.cjs.js"),K=require("../../../providers/printing-provider/printing-provider.cjs.js"),Q=require("../../buttons/collapse-button/collapse-button.cjs.js"),U=require("../../misc/print/print.cjs.js"),s=require("./collapse.module.scss.cjs.js"),V=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),W=require("../../layout/grid/row.cjs.js"),R=require("../../layout/grid/col.cjs.js"),w=d=>{const{getCurrentBreakpointProps:O}=V.useBreakpointProps(d.defaultServerBreakpoint),{id:l,children:P,className:k,openText:y,closeText:I,hideCollapseText:T=!1,title:o,titleRowProps:B,defaultOpen:S,open:u,onToggle:i,arrowType:E="default",size:N="default",underline:$=!0,toggleLabel:p,iconOnly:L=!1,controlsId:f,inverted:M=!1,fullRowToggle:a=!1,...z}=O(d),g=f!==void 0,h=`${l}__trigger`,x=`${l}__content`,A=`${l}__animate`,[D,F]=n.useState(()=>S??!1),v=K.usePrint(),r=v||(u!==void 0?u:D),G=L===!0&&!o,_=n.useRef(null),c=t=>{F(t),i==null||i(t)},m=n.useRef(c);m.current=c;const j=n.useRef(r);j.current=r,n.useEffect(()=>{const t=_.current;if(!a||!t)return;const b=H=>{H.target.closest("a, button, input, select, textarea, label")||m.current(!j.current)};return t.addEventListener("click",b),()=>t.removeEventListener("click",b)},[a]);const C=e.jsx("div",{id:x,role:"region","aria-labelledby":h,className:s.default["tedi-collapse__content"],children:P});return e.jsxs("div",{"data-name":"collapse",...z,className:q.default(s.default["tedi-collapse"],k),children:[e.jsx("div",{ref:_,className:q.default(s.default["tedi-collapse__header"],{[s.default["tedi-collapse__header--clickable"]]:a}),children:e.jsxs(W.Row,{justifyContent:"between",alignItems:"center",wrap:"nowrap",...B,children:[o&&e.jsx(R.Col,{children:o}),e.jsx(R.Col,{width:"auto",children:e.jsx(U.Print,{visibility:"hide",children:e.jsx(Q.CollapseButton,{id:h,open:r,onOpenChange:c,openText:y,closeText:I,hideText:T||G,arrowType:E,size:N,inverted:M,underline:$,"aria-controls":g?f:x,...p?{"aria-label":p}:{}})})})]})}),!g&&(v?C:e.jsx(J.default,{id:A,duration:300,height:r?"auto":0,"data-testid":"collapse-inner",children:C}))]})};exports.Collapse=w;exports.default=w;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),b=require("../../../../../external/classnames/index.cjs.js"),n=require("react"),K=require("../../../../../external/react-animate-height/dist/esm/index.cjs.js"),Q=require("../../../providers/printing-provider/printing-provider.cjs.js"),U=require("../../buttons/collapse-button/collapse-button.cjs.js"),V=require("../../misc/print/print.cjs.js"),s=require("./collapse.module.scss.cjs.js"),W=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),X=require("../../layout/grid/row.cjs.js"),q=require("../../layout/grid/col.cjs.js"),w=d=>{const{getCurrentBreakpointProps:O}=W.useBreakpointProps(d.defaultServerBreakpoint),{id:l,children:P,className:k,openText:y,closeText:I,hideCollapseText:T=!1,title:o,titleRowProps:B,defaultOpen:S,open:u,onToggle:i,arrowType:E="default",size:N="default",underline:$=!0,toggleLabel:p,iconOnly:L=!1,controlsId:f,inverted:M=!1,fullRowToggle:a=!1,contentAsRegion:z=!0,...A}=O(d),g=f!==void 0,h=`${l}__trigger`,x=`${l}__content`,D=`${l}__animate`,[F,G]=n.useState(()=>S??!1),v=Q.usePrint(),r=v||(u!==void 0?u:F),H=L===!0&&!o,_=n.useRef(null),c=t=>{G(t),i==null||i(t)},m=n.useRef(c);m.current=c;const j=n.useRef(r);j.current=r,n.useEffect(()=>{const t=_.current;if(!a||!t)return;const R=J=>{J.target.closest("a, button, input, select, textarea, label")||m.current(!j.current)};return t.addEventListener("click",R),()=>t.removeEventListener("click",R)},[a]);const C=e.jsx("div",{id:x,...z?{role:"region","aria-labelledby":h}:{},className:s.default["tedi-collapse__content"],children:P});return e.jsxs("div",{"data-name":"collapse",...A,className:b.default(s.default["tedi-collapse"],k),children:[e.jsx("div",{ref:_,className:b.default(s.default["tedi-collapse__header"],{[s.default["tedi-collapse__header--clickable"]]:a}),children:e.jsxs(X.Row,{justifyContent:"between",alignItems:"center",wrap:"nowrap",...B,children:[o&&e.jsx(q.Col,{children:o}),e.jsx(q.Col,{width:"auto",children:e.jsx(V.Print,{visibility:"hide",children:e.jsx(U.CollapseButton,{id:h,open:r,onOpenChange:c,openText:y,closeText:I,hideText:T||H,arrowType:E,size:N,inverted:M,underline:$,"aria-controls":g?f:x,...p?{"aria-label":p}:{}})})})]})}),!g&&(v?C:e.jsx(K.default,{id:D,duration:300,height:r?"auto":0,"data-testid":"collapse-inner",children:C}))]})};exports.Collapse=w;exports.default=w;
@@ -116,6 +116,15 @@ export interface CollapseProps extends BreakpointSupport<CollapseBreakpointProps
116
116
  * built-in `role="region"` panel.
117
117
  */
118
118
  controlsId?: string;
119
+ /**
120
+ * Whether the disclosed content panel is exposed as a `region` landmark
121
+ * (`role="region"` + `aria-labelledby`). Turn this **off** for repeated or
122
+ * nested disclosures such as navigation sub-menus, where many labelled regions
123
+ * pollute the landmark map and collide (axe `landmark-unique`); the
124
+ * `aria-expanded` toggle already conveys the relationship.
125
+ * @default true
126
+ */
127
+ contentAsRegion?: boolean;
119
128
  }
120
129
  export declare const Collapse: (props: CollapseProps) => JSX.Element;
121
130
  export default Collapse;
@@ -1,16 +1,16 @@
1
1
  import { jsxs as x, jsx as e } from "react/jsx-runtime";
2
2
  import y from "../../../../../external/classnames/index.es.js";
3
- import r from "react";
4
- import K from "../../../../../external/react-animate-height/dist/esm/index.es.js";
5
- import { usePrint as M } from "../../../providers/printing-provider/printing-provider.es.js";
6
- import { CollapseButton as Q } from "../../buttons/collapse-button/collapse-button.es.js";
7
- import { Print as U } from "../../misc/print/print.es.js";
3
+ import n from "react";
4
+ import M from "../../../../../external/react-animate-height/dist/esm/index.es.js";
5
+ import { usePrint as Q } from "../../../providers/printing-provider/printing-provider.es.js";
6
+ import { CollapseButton as U } from "../../buttons/collapse-button/collapse-button.es.js";
7
+ import { Print as V } from "../../misc/print/print.es.js";
8
8
  import o from "./collapse.module.scss.es.js";
9
- import { useBreakpointProps as V } from "../../../helpers/hooks/use-breakpoint-props.es.js";
10
- import { Row as W } from "../../layout/grid/row.es.js";
9
+ import { useBreakpointProps as W } from "../../../helpers/hooks/use-breakpoint-props.es.js";
10
+ import { Row as X } from "../../layout/grid/row.es.js";
11
11
  import { Col as O } from "../../layout/grid/col.es.js";
12
- const ae = (d) => {
13
- const { getCurrentBreakpointProps: k } = V(d.defaultServerBreakpoint), {
12
+ const ce = (d) => {
13
+ const { getCurrentBreakpointProps: k } = W(d.defaultServerBreakpoint), {
14
14
  id: i,
15
15
  children: I,
16
16
  className: P,
@@ -25,27 +25,36 @@ const ae = (d) => {
25
25
  arrowType: L = "default",
26
26
  size: S = "default",
27
27
  underline: $ = !0,
28
- toggleLabel: f,
29
- iconOnly: z = !1,
30
- controlsId: u,
31
- inverted: A = !1,
28
+ toggleLabel: u,
29
+ iconOnly: A = !1,
30
+ controlsId: f,
31
+ inverted: z = !1,
32
32
  fullRowToggle: a = !1,
33
- ...H
34
- } = k(d), m = u !== void 0, h = `${i}__trigger`, g = `${i}__content`, q = `${i}__animate`, [D, F] = r.useState(() => j ?? !1), _ = M(), n = _ || (p !== void 0 ? p : D), G = z === !0 && !l, v = r.useRef(null), c = (t) => {
35
- F(t), s == null || s(t);
36
- }, C = r.useRef(c);
37
- C.current = c;
38
- const R = r.useRef(n);
39
- R.current = n, r.useEffect(() => {
33
+ contentAsRegion: H = !0,
34
+ ...q
35
+ } = k(d), m = f !== void 0, h = `${i}__trigger`, g = `${i}__content`, D = `${i}__animate`, [F, G] = n.useState(() => j ?? !1), _ = Q(), r = _ || (p !== void 0 ? p : F), J = A === !0 && !l, v = n.useRef(null), c = (t) => {
36
+ G(t), s == null || s(t);
37
+ }, R = n.useRef(c);
38
+ R.current = c;
39
+ const C = n.useRef(r);
40
+ C.current = r, n.useEffect(() => {
40
41
  const t = v.current;
41
42
  if (!a || !t) return;
42
- const w = (J) => {
43
- J.target.closest("a, button, input, select, textarea, label") || C.current(!R.current);
43
+ const w = (K) => {
44
+ K.target.closest("a, button, input, select, textarea, label") || R.current(!C.current);
44
45
  };
45
46
  return t.addEventListener("click", w), () => t.removeEventListener("click", w);
46
47
  }, [a]);
47
- const b = /* @__PURE__ */ e("div", { id: g, role: "region", "aria-labelledby": h, className: o["tedi-collapse__content"], children: I });
48
- return /* @__PURE__ */ x("div", { "data-name": "collapse", ...H, className: y(o["tedi-collapse"], P), children: [
48
+ const b = /* @__PURE__ */ e(
49
+ "div",
50
+ {
51
+ id: g,
52
+ ...H ? { role: "region", "aria-labelledby": h } : {},
53
+ className: o["tedi-collapse__content"],
54
+ children: I
55
+ }
56
+ );
57
+ return /* @__PURE__ */ x("div", { "data-name": "collapse", ...q, className: y(o["tedi-collapse"], P), children: [
49
58
  /* @__PURE__ */ e(
50
59
  "div",
51
60
  {
@@ -53,32 +62,32 @@ const ae = (d) => {
53
62
  className: y(o["tedi-collapse__header"], {
54
63
  [o["tedi-collapse__header--clickable"]]: a
55
64
  }),
56
- children: /* @__PURE__ */ x(W, { justifyContent: "between", alignItems: "center", wrap: "nowrap", ...E, children: [
65
+ children: /* @__PURE__ */ x(X, { justifyContent: "between", alignItems: "center", wrap: "nowrap", ...E, children: [
57
66
  l && /* @__PURE__ */ e(O, { children: l }),
58
- /* @__PURE__ */ e(O, { width: "auto", children: /* @__PURE__ */ e(U, { visibility: "hide", children: /* @__PURE__ */ e(
59
- Q,
67
+ /* @__PURE__ */ e(O, { width: "auto", children: /* @__PURE__ */ e(V, { visibility: "hide", children: /* @__PURE__ */ e(
68
+ U,
60
69
  {
61
70
  id: h,
62
- open: n,
71
+ open: r,
63
72
  onOpenChange: c,
64
73
  openText: T,
65
74
  closeText: N,
66
- hideText: B || G,
75
+ hideText: B || J,
67
76
  arrowType: L,
68
77
  size: S,
69
- inverted: A,
78
+ inverted: z,
70
79
  underline: $,
71
- "aria-controls": m ? u : g,
72
- ...f ? { "aria-label": f } : {}
80
+ "aria-controls": m ? f : g,
81
+ ...u ? { "aria-label": u } : {}
73
82
  }
74
83
  ) }) })
75
84
  ] })
76
85
  }
77
86
  ),
78
- !m && (_ ? b : /* @__PURE__ */ e(K, { id: q, duration: 300, height: n ? "auto" : 0, "data-testid": "collapse-inner", children: b }))
87
+ !m && (_ ? b : /* @__PURE__ */ e(M, { id: D, duration: 300, height: r ? "auto" : 0, "data-testid": "collapse-inner", children: b }))
79
88
  ] });
80
89
  };
81
90
  export {
82
- ae as Collapse,
83
- ae as default
91
+ ce as Collapse,
92
+ ce as default
84
93
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("react"),n=require("../../../../../../../external/classnames/index.cjs.js"),P=require("../../../../base/icon/icon.cjs.js"),y=require("../../../../content/collapse/collapse.cjs.js"),k=require("../../../../navigation/link/link.cjs.js"),s=require("../../sidenav.module.scss.cjs.js"),J=require("../sidenav-dropdown/sidenav-dropdown.cjs.js"),K=require("../../../../../providers/label-provider/use-labels.cjs.js"),h=require("../../../../overlays/tooltip/tooltip.cjs.js"),D=M=>{const{icon:t,children:i,isActive:g,onClick:x,subItems:C,subItemGroups:O,as:j,onItemClick:v,className:E,level:d=1,isCollapsed:c=!1,isDefaultOpen:R=!1,sideNavItemSize:B="default",...u}=M,{getLabel:T}=K.useLabels(),[o,$]=f.useState(R??!1),[S,z]=f.useState(!1),N=f.useId(),m=O??(C?[{subItems:C}]:null),l=!!m,F=d>1&&l,H=n.default(s.default["tedi-sidenav__item"],s.default[`tedi-sidenav__item--${B}`],{[s.default[`tedi-sidenav__item--level-${d}`]]:d>1,[s.default["tedi-sidenav__item--current"]]:g,[s.default["tedi-sidenav__item--has-children"]]:l,[s.default["tedi-sidenav__item--with-tree"]]:F},E),_=a=>{const r={color:"white",className:n.default(s.default["tedi-sidenav__icon"])},p=typeof a=="string"?{...r,name:a}:{...r,...a,className:n.default(r.className,a==null?void 0:a.className)};return e.jsx(P.Icon,{...p})},A=a=>{x==null||x(a),l||v==null||v()},w=a=>{$(a)},G=l&&(u.href||u.to),b={...u,as:j,onClick:A,className:n.default(s.default["tedi-sidenav__link"],G&&s.default["tedi-sidenav__link--has-children-link"]),noStyle:!0,role:"menuitem","aria-current":g?"page":void 0,"aria-label":c&&typeof i=="string"?i:void 0,...l?{"aria-haspopup":"true","aria-expanded":o,"aria-controls":N}:{}},I=()=>!c&&(m==null?void 0:m.map((a,L)=>{var r;return e.jsxs("div",{children:[(a==null?void 0:a.subHeading)&&e.jsx("div",{className:s.default["tedi-sidenav__subheading"],children:a.subHeading}),e.jsx("ul",{className:s.default["tedi-sidenav__list"],role:"menu",children:(r=a.subItems)==null?void 0:r.map((p,W)=>f.createElement(D,{as:j,...p,key:W,level:d+1,onItemClick:v,isCollapsed:c,className:n.default(s.default["tedi-sidenav__sub-item"],p.className)}))})]},L)})),q=e.jsx("li",{"data-name":"sidenav-item",className:H,children:l&&c?e.jsx(J.SideNavDropdown,{trigger:e.jsx(h.Tooltip.Trigger,{children:e.jsxs("span",{className:n.default(s.default["tedi-sidenav__link"],S&&s.default["tedi-sidenav__link--active"]),children:[t&&_(t),e.jsx(P.Icon,{name:S?"chevron_right":"expand_more",color:"white",className:s.default["tedi-sidenav__toggle-icon"],size:18}),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i})]})}),as:j,groups:m,onOpenChange:z}):l&&d===1?u.href||u.to?e.jsxs(e.Fragment,{children:[e.jsxs(k.Link,{...b,children:[t&&_(t),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i})]}),e.jsx("div",{className:s.default["tedi-sidenav__link-collapse-wrapper"],children:e.jsx(y.Collapse,{id:N,hideCollapseText:!0,inverted:!0,open:o,onToggle:w,toggleLabel:T("sidenav.toggleSubmenuChildren",{isCollapsedInternal:o,children:i}),className:s.default["tedi-sidenav__collapse"],titleRowProps:{element:"span"},children:I()})})]}):e.jsx(y.Collapse,{id:N,hideCollapseText:!0,inverted:!0,fullRowToggle:!0,open:o,onToggle:w,className:s.default["tedi-sidenav__collapse"],titleRowProps:{element:"span"},toggleLabel:T("sidenav.toggleSubmenuChildren",{isCollapsedInternal:o,children:i}),title:e.jsxs("span",{className:n.default(s.default["tedi-sidenav__link"],o&&s.default["tedi-sidenav__link--active"]),"aria-current":g?"page":void 0,children:[t&&_(t),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i})]}),children:I()}):l?e.jsxs(e.Fragment,{children:[e.jsxs(k.Link,{...b,children:[t&&_(t),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i}),e.jsx("i",{className:s.default["tedi-sidenav__bullet"]})]}),I()]}):e.jsx(h.Tooltip.Trigger,{children:e.jsxs(k.Link,{...b,children:[t&&_(t),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i})]})})});return d===1&&c?e.jsxs(h.Tooltip,{placement:"right",focusManager:void 0,children:[e.jsx(h.Tooltip.Content,{maxWidth:"medium",children:i}),q]}):q};exports.SideNavItem=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("react"),n=require("../../../../../../../external/classnames/index.cjs.js"),P=require("../../../../base/icon/icon.cjs.js"),R=require("../../../../content/collapse/collapse.cjs.js"),I=require("../../../../navigation/link/link.cjs.js"),s=require("../../sidenav.module.scss.cjs.js"),J=require("../sidenav-dropdown/sidenav-dropdown.cjs.js"),K=require("../../../../../providers/label-provider/use-labels.cjs.js"),Q=require("../../../../../helpers/hooks/use-safe-id.cjs.js"),p=require("../../../../overlays/tooltip/tooltip.cjs.js"),y=D=>{const{icon:a,children:i,isActive:h,onClick:g,subItems:k,subItemGroups:M,as:x,onItemClick:v,className:O,level:d=1,isCollapsed:r=!1,isDefaultOpen:E=!1,sideNavItemSize:A="default",...c}=D,{getLabel:C}=K.useLabels(),[u,B]=b.useState(E??!1),[S,$]=b.useState(!1),T=Q.useSafeId("sidenav-collapse"),m=M??(k?[{subItems:k}]:null),l=!!m,z=d>1&&l,F=n.default(s.default["tedi-sidenav__item"],s.default[`tedi-sidenav__item--${A}`],{[s.default[`tedi-sidenav__item--level-${d}`]]:d>1,[s.default["tedi-sidenav__item--current"]]:h,[s.default["tedi-sidenav__item--has-children"]]:l,[s.default["tedi-sidenav__item--with-tree"]]:z},O),_=t=>{const o={color:"white",className:n.default(s.default["tedi-sidenav__icon"])},f=typeof t=="string"?{...o,name:t}:{...o,...t,className:n.default(o.className,t==null?void 0:t.className)};return e.jsx(P.Icon,{...f})},H=t=>{g==null||g(t),l||v==null||v()},q=t=>{B(t)},G=l&&(c.href||c.to),j={...c,as:x,onClick:H,className:n.default(s.default["tedi-sidenav__link"],G&&s.default["tedi-sidenav__link--has-children-link"]),noStyle:!0,"aria-current":h?"page":void 0,"aria-label":r&&typeof i=="string"?i:void 0},N=()=>!r&&(m==null?void 0:m.map((t,L)=>{var o;return e.jsxs("div",{children:[(t==null?void 0:t.subHeading)&&e.jsx("div",{className:s.default["tedi-sidenav__subheading"],children:t.subHeading}),e.jsx("ul",{className:s.default["tedi-sidenav__list"],children:(o=t.subItems)==null?void 0:o.map((f,W)=>b.createElement(y,{as:x,...f,key:W,level:d+1,onItemClick:v,isCollapsed:r,className:n.default(s.default["tedi-sidenav__sub-item"],f.className)}))})]},L)})),w=e.jsx("li",{"data-name":"sidenav-item",className:F,children:l&&r?e.jsx(J.SideNavDropdown,{trigger:e.jsx(p.Tooltip.Trigger,{children:e.jsxs("span",{className:n.default(s.default["tedi-sidenav__link"],S&&s.default["tedi-sidenav__link--active"]),children:[a&&_(a),e.jsx(P.Icon,{name:S?"chevron_right":"expand_more",color:"white",className:s.default["tedi-sidenav__toggle-icon"],size:18}),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i})]})}),as:x,groups:m,onOpenChange:$}):l&&d===1?c.href||c.to?e.jsxs(e.Fragment,{children:[e.jsxs(I.Link,{...j,children:[a&&_(a),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i})]}),e.jsx("div",{className:s.default["tedi-sidenav__link-collapse-wrapper"],children:e.jsx(R.Collapse,{id:T,hideCollapseText:!0,inverted:!0,contentAsRegion:!1,open:u,onToggle:q,toggleLabel:C("sidenav.toggleSubmenuChildren",{isCollapsedInternal:u,children:i}),className:s.default["tedi-sidenav__collapse"],titleRowProps:{element:"span"},children:N()})})]}):e.jsx(R.Collapse,{id:T,hideCollapseText:!0,inverted:!0,fullRowToggle:!0,contentAsRegion:!1,open:u,onToggle:q,className:s.default["tedi-sidenav__collapse"],titleRowProps:{element:"span"},toggleLabel:C("sidenav.toggleSubmenuChildren",{isCollapsedInternal:u,children:i}),title:e.jsxs("span",{className:n.default(s.default["tedi-sidenav__link"],u&&s.default["tedi-sidenav__link--active"]),"aria-current":h?"page":void 0,children:[a&&_(a),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i})]}),children:N()}):l?e.jsxs(e.Fragment,{children:[e.jsxs(I.Link,{...j,children:[a&&_(a),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i}),e.jsx("i",{className:s.default["tedi-sidenav__bullet"]})]}),N()]}):e.jsx(p.Tooltip.Trigger,{children:e.jsxs(I.Link,{...j,children:[a&&_(a),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i})]})})});return d===1&&r?e.jsxs(p.Tooltip,{placement:"right",focusManager:void 0,children:[e.jsx(p.Tooltip.Content,{maxWidth:"medium",children:i}),w]}):w};exports.SideNavItem=y;