@tedi-design-system/react 18.0.0-rc.2 → 18.0.0-rc.4

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 (88) 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.es5.js +4 -2
  15. package/_virtual/index.es6.js +1 -1
  16. package/_virtual/index.es7.js +1 -1
  17. package/_virtual/index.es8.js +1 -1
  18. package/_virtual/index.es9.js +1 -1
  19. package/bundle-stats.html +1 -1
  20. package/external/@floating-ui/core/dist/floating-ui.core.cjs.js +1 -1
  21. package/external/@floating-ui/core/dist/floating-ui.core.es.js +275 -271
  22. package/external/@floating-ui/dom/dist/floating-ui.dom.cjs.js +1 -1
  23. package/external/@floating-ui/dom/dist/floating-ui.dom.es.js +189 -188
  24. package/external/@floating-ui/react/dist/floating-ui.react.cjs.js +1 -1
  25. package/external/@floating-ui/react/dist/floating-ui.react.es.js +1419 -1538
  26. package/external/@floating-ui/react/dist/floating-ui.react.utils.cjs.js +1 -1
  27. package/external/@floating-ui/react/dist/floating-ui.react.utils.es.js +348 -81
  28. package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js +1 -1
  29. package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js +113 -93
  30. package/external/@floating-ui/utils/dist/floating-ui.utils.cjs.js +1 -1
  31. package/external/@floating-ui/utils/dist/floating-ui.utils.dom.cjs.js +1 -1
  32. package/external/@floating-ui/utils/dist/floating-ui.utils.dom.es.js +97 -97
  33. package/external/@floating-ui/utils/dist/floating-ui.utils.es.js +66 -68
  34. package/external/@mui/system/colorManipulator.cjs.js +1 -1
  35. package/external/@mui/system/colorManipulator.es.js +2 -2
  36. package/external/@mui/system/createStyled.cjs.js +1 -1
  37. package/external/@mui/system/createStyled.es.js +6 -6
  38. package/external/@mui/system/useThemeWithoutDefault.cjs.js +1 -1
  39. package/external/@mui/system/useThemeWithoutDefault.es.js +1 -1
  40. package/external/lodash-es/_baseUnset.cjs.js +1 -1
  41. package/external/lodash-es/_baseUnset.es.js +12 -19
  42. package/external/tabbable/dist/index.esm.cjs.js +1 -1
  43. package/external/tabbable/dist/index.esm.es.js +72 -63
  44. package/external/toposort/index.cjs.js +1 -1
  45. package/external/toposort/index.es.js +1 -1
  46. package/index.css +1 -1
  47. package/package.json +4 -4
  48. package/src/community/components/modal/modal-closer.d.ts +6 -0
  49. package/src/community/components/modal/modal-provider.d.ts +6 -0
  50. package/src/community/components/modal/modal-trigger.d.ts +6 -0
  51. package/src/community/components/modal/modal.d.ts +6 -0
  52. package/src/tedi/components/form/time-field/time-field.es.js +3 -3
  53. package/src/tedi/components/notifications/alert/alert.cjs.js +1 -1
  54. package/src/tedi/components/notifications/alert/alert.d.ts +14 -1
  55. package/src/tedi/components/notifications/alert/alert.es.js +45 -42
  56. package/src/tedi/components/notifications/alert/alert.module.scss.cjs.js +1 -1
  57. package/src/tedi/components/notifications/alert/alert.module.scss.es.js +2 -1
  58. package/src/tedi/components/overlays/modal/index.d.ts +8 -0
  59. package/src/tedi/components/overlays/modal/modal-body/modal-body.cjs.js +1 -0
  60. package/src/tedi/components/overlays/modal/modal-body/modal-body.d.ts +22 -0
  61. package/src/tedi/components/overlays/modal/modal-body/modal-body.es.js +21 -0
  62. package/src/tedi/components/overlays/modal/modal-closer/modal-closer.cjs.js +1 -0
  63. package/src/tedi/components/overlays/modal/modal-closer/modal-closer.d.ts +15 -0
  64. package/src/tedi/components/overlays/modal/modal-closer/modal-closer.es.js +16 -0
  65. package/src/tedi/components/overlays/modal/modal-content/modal-content.cjs.js +1 -0
  66. package/src/tedi/components/overlays/modal/modal-content/modal-content.d.ts +108 -0
  67. package/src/tedi/components/overlays/modal/modal-content/modal-content.es.js +81 -0
  68. package/src/tedi/components/overlays/modal/modal-context.cjs.js +1 -0
  69. package/src/tedi/components/overlays/modal/modal-context.d.ts +59 -0
  70. package/src/tedi/components/overlays/modal/modal-context.es.js +15 -0
  71. package/src/tedi/components/overlays/modal/modal-footer/modal-footer.cjs.js +1 -0
  72. package/src/tedi/components/overlays/modal/modal-footer/modal-footer.d.ts +22 -0
  73. package/src/tedi/components/overlays/modal/modal-footer/modal-footer.es.js +25 -0
  74. package/src/tedi/components/overlays/modal/modal-header/modal-header.cjs.js +1 -0
  75. package/src/tedi/components/overlays/modal/modal-header/modal-header.d.ts +58 -0
  76. package/src/tedi/components/overlays/modal/modal-header/modal-header.es.js +25 -0
  77. package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.cjs.js +1 -0
  78. package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.d.ts +13 -0
  79. package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.es.js +14 -0
  80. package/src/tedi/components/overlays/modal/modal.cjs.js +1 -0
  81. package/src/tedi/components/overlays/modal/modal.d.ts +68 -0
  82. package/src/tedi/components/overlays/modal/modal.es.js +76 -0
  83. package/src/tedi/components/overlays/modal/modal.module.scss.cjs.js +1 -0
  84. package/src/tedi/components/overlays/modal/modal.module.scss.es.js +36 -0
  85. package/src/tedi/helpers/hooks/use-sidenav-state.d.ts +1 -1
  86. package/src/tedi/index.d.ts +1 -0
  87. package/tedi.cjs.js +1 -1
  88. package/tedi.es.js +138 -120
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.4",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@emotion/react": "^11.11.4",
41
41
  "@emotion/styled": "^11.11.0",
42
- "@floating-ui/react": "^0.26.9",
42
+ "@floating-ui/react": "^0.27.19",
43
43
  "@mui/material": "^5.15.13",
44
44
  "@mui/x-date-pickers": "^5.0.20",
45
45
  "@tanstack/react-table": "^8.13.2",
@@ -48,7 +48,7 @@
48
48
  "draft-js": "^0.11.7",
49
49
  "draftjs-md-converter": "^1.5.2",
50
50
  "formik": "^2.4.5",
51
- "lodash-es": "^4.17.22",
51
+ "lodash-es": "^4.18.1",
52
52
  "react-animate-height": "^3.2.3",
53
53
  "react-day-picker": "^9.13.2",
54
54
  "react-dropzone": "^14.3.5",
@@ -133,7 +133,7 @@
133
133
  "storybook": "8.4.2",
134
134
  "storybook-addon-pseudo-states": "^4.0.2",
135
135
  "stylelint": "^16.13.2",
136
- "stylelint-config-recess-order": "^4.2.0",
136
+ "stylelint-config-recess-order": "^7.7.0",
137
137
  "stylelint-config-standard-scss": "^14.0.0",
138
138
  "stylelint-declaration-strict-value": "^1.9.2",
139
139
  "ts-jest": "29.1.2",
@@ -1,9 +1,15 @@
1
1
  import { default as React } from 'react';
2
+ /**
3
+ * @deprecated Use Modal from `@tedi-design-system/react/tedi` instead.
4
+ */
2
5
  export interface ModalCloserProps {
3
6
  /**
4
7
  * The element that closes the modal.
5
8
  */
6
9
  children: React.ReactElement;
7
10
  }
11
+ /**
12
+ * @deprecated Use Modal from `@tedi-design-system/react/tedi` instead.
13
+ */
8
14
  export declare const ModalCloser: (props: ModalCloserProps) => JSX.Element;
9
15
  export default ModalCloser;
@@ -1,5 +1,8 @@
1
1
  import { FloatingContext, ReferenceType } from '@floating-ui/react';
2
2
  import { default as React } from 'react';
3
+ /**
4
+ * @deprecated Use Modal from `@tedi-design-system/react/tedi` instead.
5
+ */
3
6
  export interface ModalProviderProps {
4
7
  /**
5
8
  * ModalTrigger and Modal components
@@ -51,5 +54,8 @@ export interface IModalContext {
51
54
  outsidePress: boolean;
52
55
  }
53
56
  export declare const ModalContext: React.Context<IModalContext>;
57
+ /**
58
+ * @deprecated Use Modal from `@tedi-design-system/react/tedi` instead.
59
+ */
54
60
  export declare const ModalProvider: (props: ModalProviderProps) => JSX.Element;
55
61
  export default ModalProvider;
@@ -1,8 +1,14 @@
1
+ /**
2
+ * @deprecated Use Modal from `@tedi-design-system/react/tedi` instead.
3
+ */
1
4
  export interface ModalTriggerProps {
2
5
  /**
3
6
  * The element that opens the modal.
4
7
  */
5
8
  children: JSX.Element;
6
9
  }
10
+ /**
11
+ * @deprecated Use Modal from `@tedi-design-system/react/tedi` instead.
12
+ */
7
13
  export declare const ModalTrigger: (props: ModalTriggerProps) => JSX.Element;
8
14
  export default ModalTrigger;
@@ -1,5 +1,8 @@
1
1
  import { default as React } from 'react';
2
2
  import { CardProps } from '../card/card';
3
+ /**
4
+ * @deprecated Use Modal from `@tedi-design-system/react/tedi` instead.
5
+ */
3
6
  export interface ModalProps {
4
7
  /**
5
8
  * Content of the modal
@@ -58,5 +61,8 @@ export interface ModalProps {
58
61
  */
59
62
  overlay?: 'none';
60
63
  }
64
+ /**
65
+ * @deprecated Use Modal from `@tedi-design-system/react/tedi` instead.
66
+ */
61
67
  export declare const Modal: (props: ModalProps) => JSX.Element | null;
62
68
  export default Modal;
@@ -5,7 +5,7 @@ import ce, { useState as V, useEffect as E } from "react";
5
5
  import { TextField as U } from "../textfield/textfield.es.js";
6
6
  import { TimePicker as de } from "../time-picker/time-picker.es.js";
7
7
  import l from "./time-field.module.scss.es.js";
8
- import { TIMEPICKER_OFFSET as fe, normalizeTime as ue } from "./time-field-helpers.es.js";
8
+ import { normalizeTime as fe, TIMEPICKER_OFFSET as ue } from "./time-field-helpers.es.js";
9
9
  import { autoUpdate as me } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
10
10
  import { offset as pe, flip as ge, shift as he } from "../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
11
11
  import { useBreakpointProps as ke } from "../../../helpers/hooks/use-breakpoint-props.es.js";
@@ -33,7 +33,7 @@ const ve = (k) => {
33
33
  open: x,
34
34
  onOpenChange: _,
35
35
  placement: F ? "bottom-start" : "bottom-end",
36
- middleware: [pe(fe), ge(), he()],
36
+ middleware: [pe(ue), ge(), he()],
37
37
  whileElementsMounted: me
38
38
  }), { refs: b, context: m, x: J, y: L, strategy: Q } = H, W = ne(m), X = oe(m), Y = re(m, { role: "listbox" }), y = a && F && !d && !o, R = le([...y ? [W] : [], X, Y]), p = (e) => {
39
39
  const n = e.trim();
@@ -42,7 +42,7 @@ const ve = (k) => {
42
42
  var g;
43
43
  const n = e.target.value ?? "";
44
44
  (g = t == null ? void 0 : t.onBlur) == null || g.call(t, e);
45
- const r = ue(n);
45
+ const r = fe(n);
46
46
  r !== null && r !== n && p(r);
47
47
  };
48
48
  E(() => {
@@ -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
@@ -0,0 +1,8 @@
1
+ export * from './modal';
2
+ export * from './modal-trigger/modal-trigger';
3
+ export * from './modal-content/modal-content';
4
+ export * from './modal-header/modal-header';
5
+ export * from './modal-body/modal-body';
6
+ export * from './modal-footer/modal-footer';
7
+ export * from './modal-closer/modal-closer';
8
+ export * from './modal-context';
@@ -0,0 +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"),d=require("../modal.module.scss.cjs.js"),e=({children:o,noScroll:l=!1,className:a})=>t.jsx("div",{className:s.default(d.default["tedi-modal__body"],{[d.default["tedi-modal__body--scroll-page"]]:l},a),children:o});e.displayName="Modal.Body";exports.ModalBody=e;exports.default=e;
@@ -0,0 +1,22 @@
1
+ import { ReactNode } from 'react';
2
+ export interface ModalBodyProps {
3
+ /**
4
+ * Body content.
5
+ */
6
+ children: ReactNode;
7
+ /**
8
+ * Disable the body's internal scroll. Use when the modal is wrapped in
9
+ * `<Modal.Content scrollBehavior="page">` and overflow is handled by the page.
10
+ * @default false
11
+ */
12
+ noScroll?: boolean;
13
+ /**
14
+ * Additional class name.
15
+ */
16
+ className?: string;
17
+ }
18
+ export declare const ModalBody: {
19
+ ({ children, noScroll, className }: ModalBodyProps): JSX.Element;
20
+ displayName: string;
21
+ };
22
+ export default ModalBody;
@@ -0,0 +1,21 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import m from "../../../../../../external/classnames/index.es.js";
3
+ import o from "../modal.module.scss.es.js";
4
+ const e = ({ children: a, noScroll: d = !1, className: s }) => /* @__PURE__ */ l(
5
+ "div",
6
+ {
7
+ className: m(
8
+ o["tedi-modal__body"],
9
+ {
10
+ [o["tedi-modal__body--scroll-page"]]: d
11
+ },
12
+ s
13
+ ),
14
+ children: a
15
+ }
16
+ );
17
+ e.displayName = "Modal.Body";
18
+ export {
19
+ e as ModalBody,
20
+ e as default
21
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react"),r=require("../modal-context.cjs.js"),e=({children:o})=>{const{onOpenChange:n}=r.useModalContext();return a.cloneElement(o,{onClick:s=>{var l,t;(t=(l=o.props).onClick)==null||t.call(l,s),n(!1)}})};e.displayName="Modal.Closer";exports.ModalCloser=e;exports.default=e;
@@ -0,0 +1,15 @@
1
+ import { MouseEvent, ReactElement } from 'react';
2
+ export interface ModalCloserProps {
3
+ /**
4
+ * Element that closes the modal when clicked. The element is cloned and receives
5
+ * a wrapped `onClick` that calls the original handler first, then closes the modal.
6
+ */
7
+ children: ReactElement<{
8
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
9
+ }>;
10
+ }
11
+ export declare const ModalCloser: {
12
+ ({ children }: ModalCloserProps): JSX.Element;
13
+ displayName: string;
14
+ };
15
+ export default ModalCloser;
@@ -0,0 +1,16 @@
1
+ import { cloneElement as a } from "react";
2
+ import { useModalContext as r } from "../modal-context.es.js";
3
+ const s = ({ children: o }) => {
4
+ const { onOpenChange: n } = r();
5
+ return a(o, {
6
+ onClick: (t) => {
7
+ var e, l;
8
+ (l = (e = o.props).onClick) == null || l.call(e, t), n(!1);
9
+ }
10
+ });
11
+ };
12
+ s.displayName = "Modal.Closer";
13
+ export {
14
+ s as ModalCloser,
15
+ s as default
16
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),d=require("../../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),f=require("../../../../../../external/classnames/index.cjs.js"),e=require("../modal.module.scss.cjs.js"),N=require("../modal-context.cjs.js"),O=require("../../../../helpers/hooks/use-breakpoint-props.cjs.js"),W=require("../../../../providers/label-provider/use-labels.cjs.js"),H=["xs","sm","md","lg","xl"],T=l=>H.includes(l),r=l=>{const{getCurrentBreakpointProps:m}=O.useBreakpointProps(l.defaultServerBreakpoint),{width:t="md",maxWidth:s,position:_="center",fullscreen:o=!1}=m(l),{children:v,size:y="default",scrollBehavior:b="content",trapFocus:n=!0,returnFocus:g=!0,showOverlay:x=!0,lockScroll:h=!0,visuallyHiddenDismiss:C=!1,initialFocus:P,className:F}=l,{getLabel:p}=W.useLabels(),{open:q,floating:B,getFloatingProps:M,context:S,labelId:j,descriptionId:k}=N.useModalContext();if(!q)return null;const c=l["aria-labelledby"]??(j||void 0),L=l["aria-describedby"]??(k||void 0),w=c?void 0:l["aria-label"],u=T(t),i={};u||(i.width=t),s&&(i.maxWidth=s);const D=o===!0?e.default["tedi-modal__container--fullscreen"]:o==="edge"?e.default["tedi-modal__container--fullscreen-edge"]:void 0,I=o==="edge"?e.default["tedi-modal__overlay--fullscreen-edge"]:void 0;return a.jsx(d.FloatingPortal,{children:a.jsx(d.FloatingOverlay,{lockScroll:h,className:f.default(e.default["tedi-modal__overlay"],e.default[`tedi-modal__overlay--position-${_}`],I,{[e.default["tedi-modal__overlay--no-overlay"]]:!x,[e.default["tedi-modal__overlay--scroll-page"]]:b==="page"}),children:a.jsx(d.FloatingFocusManager,{context:S,modal:n,returnFocus:g,initialFocus:P,visuallyHiddenDismiss:C?p("modal.close"):void 0,children:a.jsx("div",{...M({ref:B,"aria-labelledby":c,"aria-describedby":L,"aria-label":w,"aria-modal":n,style:i,className:f.default(e.default["tedi-modal__container"],u&&e.default[`tedi-modal__container--${t}`],e.default[`tedi-modal--${y}`],D,F)}),children:v})})})})};r.displayName="Modal.Content";exports.ModalContent=r;exports.default=r;
@@ -0,0 +1,108 @@
1
+ import { FloatingFocusManager } from '@floating-ui/react';
2
+ import { ComponentProps, ReactNode } from 'react';
3
+ import { BreakpointSupport } from '../../../../helpers';
4
+ export type ModalWidthPreset = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+ export type ModalWidth = ModalWidthPreset | (string & Record<never, never>);
6
+ export type ModalSize = 'default' | 'small';
7
+ export type ModalPosition = 'center' | 'top' | 'right' | 'left';
8
+ export type ModalScrollBehavior = 'content' | 'page';
9
+ export type ModalFullscreen = boolean | 'edge';
10
+ type ModalContentBreakpointProps = {
11
+ /**
12
+ * Modal width — a Figma-aligned preset (`xs`–`xl`) or any CSS length.
13
+ * Use `maxWidth` when you only need to cap the width instead of set it.
14
+ * @default md
15
+ */
16
+ width?: ModalWidth;
17
+ /**
18
+ * Hard cap on width. Lightweight alternative to a custom `width`.
19
+ * @default calc(100vw - 16px * 2)
20
+ */
21
+ maxWidth?: string;
22
+ /**
23
+ * Placement on the viewport.
24
+ * @default center
25
+ */
26
+ position?: ModalPosition;
27
+ /**
28
+ * Fullscreen behaviour:
29
+ * - `false` — content-sized modal inside the 16px backdrop padding.
30
+ * - `true` — modal fills the overlay; 16px backdrop stays visible.
31
+ * - `'edge'` — edge-to-edge; overlay padding removed, no border/radius.
32
+ * @default false
33
+ */
34
+ fullscreen?: ModalFullscreen;
35
+ };
36
+ export interface ModalContentProps extends BreakpointSupport<ModalContentBreakpointProps> {
37
+ /**
38
+ * `<Modal.Header>`, `<Modal.Body>`, `<Modal.Footer>` and any other content.
39
+ */
40
+ children: ReactNode;
41
+ /**
42
+ * Size density — controls header/body/footer padding.
43
+ * @default default
44
+ */
45
+ size?: ModalSize;
46
+ /**
47
+ * Where overflow scrolls. `'content'` keeps the modal frame fixed and scrolls the body;
48
+ * `'page'` lets the modal grow with content and scrolls the overlay around it.
49
+ * @default content
50
+ */
51
+ scrollBehavior?: ModalScrollBehavior;
52
+ /**
53
+ * Trap focus inside the modal while open.
54
+ * @default true
55
+ */
56
+ trapFocus?: boolean;
57
+ /**
58
+ * Restore focus to the trigger after closing.
59
+ * @default true
60
+ */
61
+ returnFocus?: boolean;
62
+ /**
63
+ * Render the dimmed backdrop. `false` keeps portal + focus management but no overlay.
64
+ * @default true
65
+ */
66
+ showOverlay?: boolean;
67
+ /**
68
+ * Lock background scroll while open.
69
+ * @default true
70
+ */
71
+ lockScroll?: boolean;
72
+ /**
73
+ * Render visually-hidden dismiss buttons at the start and end of the dialog
74
+ * so touch screen-readers can escape without an Escape key.
75
+ * @default false
76
+ */
77
+ visuallyHiddenDismiss?: boolean;
78
+ /**
79
+ * Override the dialog's labelling element. Only needed when the label lives
80
+ * outside `<Modal.Header>` — the header wires this automatically.
81
+ */
82
+ 'aria-labelledby'?: string;
83
+ /**
84
+ * Override the dialog's describing element. Only needed when the description
85
+ * lives outside `<Modal.Header>` — the header wires this automatically.
86
+ */
87
+ 'aria-describedby'?: string;
88
+ /**
89
+ * Plain-text accessible name. Use when there's no visible title (icon-only
90
+ * confirmation, etc.). Ignored when `aria-labelledby` is set.
91
+ */
92
+ 'aria-label'?: string;
93
+ /**
94
+ * Element to focus on open. Tabbable index (`0` = first tabbable, `-1` = dialog
95
+ * container) or a ref. Override the default to focus a "Cancel" button on
96
+ * destructive prompts, or the first input on form-heavy modals.
97
+ */
98
+ initialFocus?: ComponentProps<typeof FloatingFocusManager>['initialFocus'];
99
+ /**
100
+ * Additional class name on the modal container.
101
+ */
102
+ className?: string;
103
+ }
104
+ export declare const ModalContent: {
105
+ (props: ModalContentProps): JSX.Element | null;
106
+ displayName: string;
107
+ };
108
+ export default ModalContent;
@@ -0,0 +1,81 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { FloatingPortal as M, FloatingOverlay as W, FloatingFocusManager as H } from "../../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
3
+ import c from "../../../../../../external/classnames/index.es.js";
4
+ import e from "../modal.module.scss.es.js";
5
+ import { useModalContext as O } from "../modal-context.es.js";
6
+ import { useBreakpointProps as $ } from "../../../../helpers/hooks/use-breakpoint-props.es.js";
7
+ import { useLabels as E } from "../../../../providers/label-provider/use-labels.es.js";
8
+ const T = ["xs", "sm", "md", "lg", "xl"], j = (l) => T.includes(l), z = (l) => {
9
+ const { getCurrentBreakpointProps: m } = $(l.defaultServerBreakpoint), {
10
+ width: o = "md",
11
+ maxWidth: r,
12
+ position: u = "center",
13
+ fullscreen: t = !1
14
+ } = m(l), {
15
+ children: f,
16
+ size: y = "default",
17
+ scrollBehavior: v = "content",
18
+ trapFocus: s = !0,
19
+ returnFocus: _ = !0,
20
+ showOverlay: b = !0,
21
+ lockScroll: g = !0,
22
+ visuallyHiddenDismiss: h = !1,
23
+ initialFocus: p,
24
+ className: x
25
+ } = l, { getLabel: F } = E(), { open: C, floating: P, getFloatingProps: B, context: N, labelId: S, descriptionId: k } = O();
26
+ if (!C) return null;
27
+ const d = l["aria-labelledby"] ?? (S || void 0), w = l["aria-describedby"] ?? (k || void 0), D = d ? void 0 : l["aria-label"], n = j(o), i = {};
28
+ n || (i.width = o), r && (i.maxWidth = r);
29
+ const I = t === !0 ? e["tedi-modal__container--fullscreen"] : t === "edge" ? e["tedi-modal__container--fullscreen-edge"] : void 0, L = t === "edge" ? e["tedi-modal__overlay--fullscreen-edge"] : void 0;
30
+ return /* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(
31
+ W,
32
+ {
33
+ lockScroll: g,
34
+ className: c(
35
+ e["tedi-modal__overlay"],
36
+ e[`tedi-modal__overlay--position-${u}`],
37
+ L,
38
+ {
39
+ [e["tedi-modal__overlay--no-overlay"]]: !b,
40
+ [e["tedi-modal__overlay--scroll-page"]]: v === "page"
41
+ }
42
+ ),
43
+ children: /* @__PURE__ */ a(
44
+ H,
45
+ {
46
+ context: N,
47
+ modal: s,
48
+ returnFocus: _,
49
+ initialFocus: p,
50
+ visuallyHiddenDismiss: h ? F("modal.close") : void 0,
51
+ children: /* @__PURE__ */ a(
52
+ "div",
53
+ {
54
+ ...B({
55
+ ref: P,
56
+ "aria-labelledby": d,
57
+ "aria-describedby": w,
58
+ "aria-label": D,
59
+ "aria-modal": s,
60
+ style: i,
61
+ className: c(
62
+ e["tedi-modal__container"],
63
+ n && e[`tedi-modal__container--${o}`],
64
+ e[`tedi-modal--${y}`],
65
+ I,
66
+ x
67
+ )
68
+ }),
69
+ children: f
70
+ }
71
+ )
72
+ }
73
+ )
74
+ }
75
+ ) });
76
+ };
77
+ z.displayName = "Modal.Content";
78
+ export {
79
+ z as ModalContent,
80
+ z as default
81
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),o=t.createContext(null),n=()=>{const e=t.useContext(o);if(!e)throw new Error("Modal subcomponents must be rendered inside <Modal>.");return e},l=()=>{const{open:e,onOpenChange:r,labelId:s,descriptionId:d}=n();return{open:e,onOpenChange:r,labelId:s,descriptionId:d}};exports.ModalContext=o;exports.useModal=l;exports.useModalContext=n;