@tedi-design-system/react 19.1.0-rc.19 → 19.1.0-rc.20

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 (48) hide show
  1. package/bundle-stats.html +1 -1
  2. package/community.cjs.js +1 -1
  3. package/community.es.js +215 -230
  4. package/external/@mui/x-date-pickers/DatePicker/shared.es.js +1 -1
  5. package/external/@mui/x-date-pickers/DateTimePicker/shared.es.js +1 -1
  6. package/index.css +1 -1
  7. package/package.json +1 -1
  8. package/src/community/components/accordion/accordion.cjs.js +1 -1
  9. package/src/community/components/accordion/accordion.es.js +14 -9
  10. package/src/community/components/card/card-notification/card-notification.cjs.js +1 -1
  11. package/src/community/components/card/card-notification/card-notification.es.js +10 -8
  12. package/src/community/components/dropdown/dropdown.cjs.js +1 -1
  13. package/src/community/components/dropdown/dropdown.es.js +34 -32
  14. package/src/community/components/form/file-upload/file-upload.cjs.js +1 -1
  15. package/src/community/components/form/file-upload/file-upload.es.js +43 -41
  16. package/src/community/components/form/pickers/calendar/calendar.cjs.js +1 -1
  17. package/src/community/components/form/pickers/calendar/calendar.es.js +41 -39
  18. package/src/community/components/form/pickers/timepicker/timepicker.cjs.js +1 -1
  19. package/src/community/components/form/pickers/timepicker/timepicker.es.js +33 -31
  20. package/src/community/components/form/toggle/toggle.cjs.js +1 -1
  21. package/src/community/components/form/toggle/toggle.es.js +30 -28
  22. package/src/community/components/map-components/carousel/carousel.cjs.js +1 -1
  23. package/src/community/components/map-components/carousel/carousel.es.js +19 -17
  24. package/src/community/components/status/status.cjs.js +1 -1
  25. package/src/community/components/status/status.es.js +14 -12
  26. package/src/community/components/stepper/stepper.cjs.js +1 -1
  27. package/src/community/components/stepper/stepper.es.js +33 -31
  28. package/src/community/components/table/table.cjs.js +1 -1
  29. package/src/community/components/table/table.es.js +9 -9
  30. package/src/community/components/table-of-contents/table-of-contents.cjs.js +1 -1
  31. package/src/community/components/table-of-contents/table-of-contents.es.js +21 -19
  32. package/src/community/components/tabs/tabs/tabs.cjs.js +1 -1
  33. package/src/community/components/tabs/tabs/tabs.es.js +29 -27
  34. package/src/community/components/vertical-stepper/vertical-stepper.cjs.js +1 -1
  35. package/src/community/components/vertical-stepper/vertical-stepper.es.js +8 -6
  36. package/src/community/deprecated-exports.cjs.js +1 -0
  37. package/src/community/deprecated-exports.d.ts +19 -0
  38. package/src/community/deprecated-exports.es.js +112 -0
  39. package/src/community/index.d.ts +1 -0
  40. package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.cjs.js +1 -1
  41. package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.d.ts +1 -1
  42. package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.es.js +28 -27
  43. package/src/tedi/components/layout/mobile-nav/mobile-nav.cjs.js +1 -1
  44. package/src/tedi/components/layout/mobile-nav/mobile-nav.d.ts +1 -1
  45. package/src/tedi/components/layout/mobile-nav/mobile-nav.es.js +64 -63
  46. package/src/tedi/helpers/warn-deprecated/warn-deprecated.cjs.js +1 -0
  47. package/src/tedi/helpers/warn-deprecated/warn-deprecated.d.ts +12 -0
  48. package/src/tedi/helpers/warn-deprecated/warn-deprecated.es.js +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tedi-design-system/react",
3
- "version": "19.1.0-rc.19",
3
+ "version": "19.1.0-rc.20",
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.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),S=require("../../../../external/classnames/index.cjs.js"),i=require("react"),y=require("./accordion.module.scss.cjs.js"),A=require("../../../tedi/components/layout/vertical-spacing/vertical-spacing.cjs.js"),s=i.createContext({isOpen:()=>!0,onToggle:()=>null}),C=c=>{const{children:u,className:l,openItem:n,gutter:a=.5,onToggleItem:t,defaultOpenItem:d=[],...m}=c,f=n||d,[g,p]=i.useState(f),x=(e=c.openItem)=>!!t&&typeof e<"u",I=e=>{if(t)return t(e);x(n)||p(o=>o.includes(e)?o.filter(q=>q!==e):[...o,e])},O=()=>t&&typeof n<"u"?n:g,j=e=>O().includes(e);return r.jsx(s.Provider,{value:{isOpen:j,onToggle:I},children:r.jsx("div",{"data-name":"accordion",...m,className:S.default(y.default.accordion,l),children:r.jsx(A.VerticalSpacing,{size:a,children:u})})})};exports.Accordion=C;exports.AccordionContext=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),O=require("../../../../external/classnames/index.cjs.js"),i=require("react"),j=require("../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),C=require("./accordion.module.scss.cjs.js"),S=require("../../../tedi/components/layout/vertical-spacing/vertical-spacing.cjs.js"),s=i.createContext({isOpen:()=>!0,onToggle:()=>null}),T=c=>{j.warnDeprecated("Community Accordion","Use the TEDI-Ready `Accordion` from `@tedi-design-system/react/tedi` instead.");const{children:d,className:u,openItem:t,gutter:a=.5,onToggleItem:n,defaultOpenItem:l=[],...m}=c,f=t||l,[g,p]=i.useState(f),x=(e=c.openItem)=>!!n&&typeof e<"u",I=e=>{if(n)return n(e);x(t)||p(o=>o.includes(e)?o.filter(A=>A!==e):[...o,e])},y=()=>n&&typeof t<"u"?t:g,q=e=>y().includes(e);return r.jsx(s.Provider,{value:{isOpen:q,onToggle:I},children:r.jsx("div",{"data-name":"accordion",...m,className:O.default(C.default.accordion,u),children:r.jsx(S.VerticalSpacing,{size:a,children:d})})})};exports.Accordion=T;exports.AccordionContext=s;
@@ -1,20 +1,25 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import y from "../../../../external/classnames/index.es.js";
3
- import c from "react";
2
+ import x from "../../../../external/classnames/index.es.js";
3
+ import s from "react";
4
+ import { warnDeprecated as A } from "../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
4
5
  import C from "./accordion.module.scss.es.js";
5
- import { VerticalSpacing as N } from "../../../tedi/components/layout/vertical-spacing/vertical-spacing.es.js";
6
- const T = c.createContext({
6
+ import { VerticalSpacing as T } from "../../../tedi/components/layout/vertical-spacing/vertical-spacing.es.js";
7
+ const N = s.createContext({
7
8
  isOpen: () => !0,
8
9
  onToggle: () => null
9
- }), v = (s) => {
10
- const { children: i, className: l, openItem: t, gutter: m = 0.5, onToggleItem: n, defaultOpenItem: a = [], ...u } = s, d = t || a, [f, p] = c.useState(d), g = (e = s.openItem) => !!n && typeof e < "u", I = (e) => {
10
+ }), v = (c) => {
11
+ A(
12
+ "Community Accordion",
13
+ "Use the TEDI-Ready `Accordion` from `@tedi-design-system/react/tedi` instead."
14
+ );
15
+ const { children: i, className: m, openItem: t, gutter: a = 0.5, onToggleItem: n, defaultOpenItem: d = [], ...l } = c, u = t || d, [f, p] = s.useState(u), g = (e = c.openItem) => !!n && typeof e < "u", I = (e) => {
11
16
  if (n)
12
17
  return n(e);
13
18
  g(t) || p((o) => o.includes(e) ? o.filter((h) => h !== e) : [...o, e]);
14
- }, O = () => n && typeof t < "u" ? t : f, x = (e) => O().includes(e);
15
- return /* @__PURE__ */ r(T.Provider, { value: { isOpen: x, onToggle: I }, children: /* @__PURE__ */ r("div", { "data-name": "accordion", ...u, className: y(C.accordion, l), children: /* @__PURE__ */ r(N, { size: m, children: i }) }) });
19
+ }, y = () => n && typeof t < "u" ? t : f, O = (e) => y().includes(e);
20
+ return /* @__PURE__ */ r(N.Provider, { value: { isOpen: O, onToggle: I }, children: /* @__PURE__ */ r("div", { "data-name": "accordion", ...l, className: x(C.accordion, m), children: /* @__PURE__ */ r(T, { size: a, children: i }) }) });
16
21
  };
17
22
  export {
18
23
  v as Accordion,
19
- T as AccordionContext
24
+ N as AccordionContext
20
25
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),d=require("../../../../../external/classnames/index.cjs.js"),s=require("../../../../tedi/components/notifications/alert/alert.cjs.js"),l=require("../card-content/card-content.cjs.js"),e=require("./card-notification.module.scss.cjs.js"),u=n=>{const{children:i,padding:a,className:r,...o}=n,c=d.default(e.default.card__notification,r);return t.jsx(l.CardContent,{"data-name":"card-notification",padding:a,className:e.default["card__notification-content"],children:t.jsx(s.Alert,{className:c,...o,children:i})})};exports.CardNotification=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),d=require("../../../../../external/classnames/index.cjs.js"),s=require("../../../../tedi/components/notifications/alert/alert.cjs.js"),u=require("../../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),l=require("../card-content/card-content.cjs.js"),e=require("./card-notification.module.scss.cjs.js"),f=i=>{u.warnDeprecated("Community CardNotification","Use `CardNotification` from `@tedi-design-system/react/tedi` instead.");const{children:a,padding:n,className:r,...o}=i,c=d.default(e.default.card__notification,r);return t.jsx(l.CardContent,{"data-name":"card-notification",padding:n,className:e.default["card__notification-content"],children:t.jsx(s.Alert,{className:c,...o,children:a})})};exports.CardNotification=f;
@@ -1,12 +1,14 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import s from "../../../../../external/classnames/index.es.js";
3
- import { Alert as e } from "../../../../tedi/components/notifications/alert/alert.es.js";
4
- import { CardContent as d } from "../card-content/card-content.es.js";
5
- import o from "./card-notification.module.scss.es.js";
6
- const C = (r) => {
7
- const { children: a, padding: i, className: n, ...c } = r, m = s(o.card__notification, n);
8
- return /* @__PURE__ */ t(d, { "data-name": "card-notification", padding: i, className: o["card__notification-content"], children: /* @__PURE__ */ t(e, { className: m, ...c, children: a }) });
2
+ import m from "../../../../../external/classnames/index.es.js";
3
+ import { Alert as s } from "../../../../tedi/components/notifications/alert/alert.es.js";
4
+ import { warnDeprecated as d } from "../../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
5
+ import { CardContent as f } from "../card-content/card-content.es.js";
6
+ import i from "./card-notification.module.scss.es.js";
7
+ const g = (o) => {
8
+ d("Community CardNotification", "Use `CardNotification` from `@tedi-design-system/react/tedi` instead.");
9
+ const { children: r, padding: a, className: n, ...e } = o, c = m(i.card__notification, n);
10
+ return /* @__PURE__ */ t(f, { "data-name": "card-notification", padding: a, className: i["card__notification-content"], children: /* @__PURE__ */ t(s, { className: c, ...e, children: r }) });
9
11
  };
10
12
  export {
11
- C as CardNotification
13
+ g as CardNotification
12
14
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),B=require("../../../../external/classnames/index.cjs.js"),c=require("react"),K=require("../button/button.cjs.js"),a=require("./dropdown.module.scss.cjs.js"),T=require("../../../tedi/providers/label-provider/use-labels.cjs.js"),H=require("../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),D=require("../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),$=d=>{const{getLabel:F}=T.useLabels(),{button:_,items:u,onItemClick:l,closeMenuOnClick:h=!0,...q}=d,{initialFocus:v=-1,modal:f=!1,...p}=d.focusManager??{},{visuallyHiddenDismiss:j=f?F("close"):!1}=p??{},R=o.useFloatingNodeId(),g=c.useRef([]),[b,i]=c.useState(!1),[x,M]=c.useState(null),{x:y,y:C,strategy:N,refs:w,placement:O,context:r}=o.useFloating({placement:"bottom-start",nodeId:R,open:b,onOpenChange:i,middleware:[D.flip(),D.shift()],whileElementsMounted:H.autoUpdate}),P=u.findIndex(e=>e.isActive),{getReferenceProps:S,getFloatingProps:L,getItemProps:U}=o.useInteractions([o.useClick(r),o.useListNavigation(r,{listRef:g,activeIndex:x,selectedIndex:P,onNavigate:M,loop:!0}),o.useRole(r,{role:"listbox"}),o.useDismiss(r)]),A=()=>{const e=s.jsx(o.FloatingFocusManager,{context:r,initialFocus:v,visuallyHiddenDismiss:j,modal:f,...p,children:s.jsx("div",{...L({ref:w.setFloating,style:{position:N,left:y??0,top:C??0},className:a.default.dropdown,onKeyDown(t){t.key==="Tab"&&i(!1)}}),"data-placement":O,children:u.map((t,n)=>k(t,n))})});return b?e:null},E=e=>B.default(a.default.dropdown__item,{[a.default["dropdown__item--active"]]:e.isActive,[a.default["dropdown__item--disabled"]]:e.isDisabled}),I=(e,t,n)=>{var m;l==null||l(e,t,n),(m=e==null?void 0:e.onClick)==null||m.call(e,n),h&&i(!1)},k=(e,t)=>s.jsx("button",{...U({disabled:e.isDisabled,tabIndex:x===t?0:-1,role:"option",className:E(e),onClick:n=>I(e,t,n),onKeyDown(n){n.key==="Enter"&&I(e,t,n)},ref(n){g.current[t]=n}}),children:e.children},t);return s.jsxs(s.Fragment,{children:[s.jsx(K.Button,{"data-name":"dropdown",...q,..._,...S({ref:w.setReference,tabIndex:0})}),s.jsx(o.FloatingPortal,{children:A()})]})};exports.Dropdown=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),B=require("../../../../external/classnames/index.cjs.js"),l=require("react"),K=require("../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),T=require("../button/button.cjs.js"),a=require("./dropdown.module.scss.cjs.js"),H=require("../../../tedi/providers/label-provider/use-labels.cjs.js"),$=require("../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),I=require("../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),z=c=>{K.warnDeprecated("Community Dropdown","Use `Dropdown` from `@tedi-design-system/react/tedi` instead.");const{getLabel:q}=H.useLabels(),{button:F,items:u,onItemClick:i,closeMenuOnClick:_=!0,...h}=c,{initialFocus:v=-1,modal:f=!1,...p}=c.focusManager??{},{visuallyHiddenDismiss:j=f?q("close"):!1}=p??{},y=o.useFloatingNodeId(),g=l.useRef([]),[w,d]=l.useState(!1),[b,R]=l.useState(null),{x:M,y:C,strategy:N,refs:x,placement:O,context:r}=o.useFloating({placement:"bottom-start",nodeId:y,open:w,onOpenChange:d,middleware:[I.flip(),I.shift()],whileElementsMounted:$.autoUpdate}),P=u.findIndex(e=>e.isActive),{getReferenceProps:S,getFloatingProps:U,getItemProps:L}=o.useInteractions([o.useClick(r),o.useListNavigation(r,{listRef:g,activeIndex:b,selectedIndex:P,onNavigate:R,loop:!0}),o.useRole(r,{role:"listbox"}),o.useDismiss(r)]),A=()=>{const e=s.jsx(o.FloatingFocusManager,{context:r,initialFocus:v,visuallyHiddenDismiss:j,modal:f,...p,children:s.jsx("div",{...U({ref:x.setFloating,style:{position:N,left:M??0,top:C??0},className:a.default.dropdown,onKeyDown(t){t.key==="Tab"&&d(!1)}}),"data-placement":O,children:u.map((t,n)=>k(t,n))})});return w?e:null},E=e=>B.default(a.default.dropdown__item,{[a.default["dropdown__item--active"]]:e.isActive,[a.default["dropdown__item--disabled"]]:e.isDisabled}),m=(e,t,n)=>{var D;i==null||i(e,t,n),(D=e==null?void 0:e.onClick)==null||D.call(e,n),_&&d(!1)},k=(e,t)=>s.jsx("button",{...L({disabled:e.isDisabled,tabIndex:b===t?0:-1,role:"option",className:E(e),onClick:n=>m(e,t,n),onKeyDown(n){n.key==="Enter"&&m(e,t,n)},ref(n){g.current[t]=n}}),children:e.children},t);return s.jsxs(s.Fragment,{children:[s.jsx(T.Button,{"data-name":"dropdown",...h,...F,...S({ref:x.setReference,tabIndex:0})}),s.jsx(o.FloatingPortal,{children:A()})]})};exports.Dropdown=z;
@@ -1,27 +1,29 @@
1
1
  import { jsxs as B, Fragment as K, jsx as s } from "react/jsx-runtime";
2
- import { useFloatingNodeId as H, useFloating as T, useInteractions as U, useClick as q, useListNavigation as z, useRole as G, useDismiss as J, FloatingPortal as Q, FloatingFocusManager as V } from "../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
2
+ import { useFloatingNodeId as U, useFloating as H, useInteractions as T, useClick as q, useListNavigation as z, useRole as G, useDismiss as J, FloatingPortal as Q, FloatingFocusManager as V } from "../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
3
3
  import W from "../../../../external/classnames/index.es.js";
4
- import i from "react";
5
- import { Button as X } from "../button/button.es.js";
4
+ import l from "react";
5
+ import { warnDeprecated as X } from "../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
6
+ import { Button as Y } from "../button/button.es.js";
6
7
  import r from "./dropdown.module.scss.es.js";
7
- import { useLabels as Y } from "../../../tedi/providers/label-provider/use-labels.es.js";
8
- import { autoUpdate as Z } from "../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
9
- import { flip as $, shift as ee } from "../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
10
- const de = (c) => {
11
- const { getLabel: x } = Y(), { button: D, items: d, onItemClick: a, closeMenuOnClick: F = !0, ...h } = c, { initialFocus: v = -1, modal: p = !1, ...f } = c.focusManager ?? {}, { visuallyHiddenDismiss: _ = p ? x("close") : !1 } = f ?? {}, R = H(), u = i.useRef([]), [m, l] = i.useState(!1), [g, M] = i.useState(null), { x: N, y, strategy: C, refs: I, placement: O, context: n } = T({
8
+ import { useLabels as Z } from "../../../tedi/providers/label-provider/use-labels.es.js";
9
+ import { autoUpdate as $ } from "../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
10
+ import { flip as ee, shift as oe } from "../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
11
+ const fe = (d) => {
12
+ X("Community Dropdown", "Use `Dropdown` from `@tedi-design-system/react/tedi` instead.");
13
+ const { getLabel: x } = Z(), { button: D, items: c, onItemClick: a, closeMenuOnClick: F = !0, ...h } = d, { initialFocus: v = -1, modal: p = !1, ...f } = d.focusManager ?? {}, { visuallyHiddenDismiss: _ = p ? x("close") : !1 } = f ?? {}, y = U(), m = l.useRef([]), [u, i] = l.useState(!1), [g, R] = l.useState(null), { x: C, y: M, strategy: N, refs: w, placement: O, context: n } = H({
12
14
  placement: "bottom-start",
13
- nodeId: R,
14
- open: m,
15
- onOpenChange: l,
16
- middleware: [$(), ee()],
17
- whileElementsMounted: Z
18
- }), P = d.findIndex((e) => e.isActive), { getReferenceProps: A, getFloatingProps: E, getItemProps: L } = U([
15
+ nodeId: y,
16
+ open: u,
17
+ onOpenChange: i,
18
+ middleware: [ee(), oe()],
19
+ whileElementsMounted: $
20
+ }), P = c.findIndex((e) => e.isActive), { getReferenceProps: A, getFloatingProps: E, getItemProps: L } = T([
19
21
  q(n),
20
22
  z(n, {
21
- listRef: u,
23
+ listRef: m,
22
24
  activeIndex: g,
23
25
  selectedIndex: P,
24
- onNavigate: M,
26
+ onNavigate: R,
25
27
  loop: !0
26
28
  }),
27
29
  G(n, { role: "listbox" }),
@@ -39,30 +41,30 @@ const de = (c) => {
39
41
  "div",
40
42
  {
41
43
  ...E({
42
- ref: I.setFloating,
44
+ ref: w.setFloating,
43
45
  style: {
44
- position: C,
45
- left: N ?? 0,
46
- top: y ?? 0
46
+ position: N,
47
+ left: C ?? 0,
48
+ top: M ?? 0
47
49
  },
48
50
  className: r.dropdown,
49
51
  onKeyDown(o) {
50
- o.key === "Tab" && l(!1);
52
+ o.key === "Tab" && i(!1);
51
53
  }
52
54
  }),
53
55
  "data-placement": O,
54
- children: d.map((o, t) => k(o, t))
56
+ children: c.map((o, t) => k(o, t))
55
57
  }
56
58
  )
57
59
  }
58
60
  );
59
- return m ? e : null;
61
+ return u ? e : null;
60
62
  }, j = (e) => W(r.dropdown__item, {
61
63
  [r["dropdown__item--active"]]: e.isActive,
62
64
  [r["dropdown__item--disabled"]]: e.isDisabled
63
- }), b = (e, o, t) => {
64
- var w;
65
- a == null || a(e, o, t), (w = e == null ? void 0 : e.onClick) == null || w.call(e, t), F && l(!1);
65
+ }), I = (e, o, t) => {
66
+ var b;
67
+ a == null || a(e, o, t), (b = e == null ? void 0 : e.onClick) == null || b.call(e, t), F && i(!1);
66
68
  }, k = (e, o) => /* @__PURE__ */ s(
67
69
  "button",
68
70
  {
@@ -71,12 +73,12 @@ const de = (c) => {
71
73
  tabIndex: g === o ? 0 : -1,
72
74
  role: "option",
73
75
  className: j(e),
74
- onClick: (t) => b(e, o, t),
76
+ onClick: (t) => I(e, o, t),
75
77
  onKeyDown(t) {
76
- t.key === "Enter" && b(e, o, t);
78
+ t.key === "Enter" && I(e, o, t);
77
79
  },
78
80
  ref(t) {
79
- u.current[o] = t;
81
+ m.current[o] = t;
80
82
  }
81
83
  }),
82
84
  children: e.children
@@ -85,13 +87,13 @@ const de = (c) => {
85
87
  );
86
88
  return /* @__PURE__ */ B(K, { children: [
87
89
  /* @__PURE__ */ s(
88
- X,
90
+ Y,
89
91
  {
90
92
  "data-name": "dropdown",
91
93
  ...h,
92
94
  ...D,
93
95
  ...A({
94
- ref: I.setReference,
96
+ ref: w.setReference,
95
97
  tabIndex: 0
96
98
  })
97
99
  }
@@ -100,5 +102,5 @@ const de = (c) => {
100
102
  ] });
101
103
  };
102
104
  export {
103
- de as Dropdown
105
+ fe as Dropdown
104
106
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),z=require("../../../../../external/classnames/index.cjs.js"),g=require("react"),A=require("../../../../tedi/components/form/feedback-text/feedback-text.cjs.js"),I=require("../../../../tedi/components/form/form-label/form-label.cjs.js"),O=require("../../../../tedi/components/tags/tag/tag.cjs.js"),D=require("../../button/button.cjs.js"),c=require("./file-upload.module.scss.cjs.js"),P=require("../../../../tedi/providers/label-provider/use-labels.cjs.js"),W=require("../../card/card.cjs.js"),Y=require("../../card/card-content/card-content.cjs.js"),G=require("../../../../tedi/components/layout/grid/row.cjs.js"),M=require("../../../../tedi/components/layout/grid/col.cjs.js"),J=({accept:a,maxSize:i},n)=>{if(!a&&!i)return;const s=[a&&`${n("file-upload.accept")} ${a.replaceAll(",",", ")}`,i&&`${n("file-upload.max-size")} ${i}MB`].filter(Boolean).join(". ");return s.length?{text:s}:void 0},K=(a,i)=>{const n=a.reduce((s,{type:r,file:p})=>(s[r].push(p.name),s),{extension:[],size:[]});return Object.entries(n).filter(([s,r])=>r.length).map(([s,r])=>{const p=r.map(y=>`'${y}'`).join(", ");return i(`file-upload.${s}-rejected`,p)}).join(". ")},Q=a=>{const{getLabel:i}=P.useLabels(),{id:n,name:s,accept:r,multiple:p,onChange:o,className:y,defaultFiles:N,onDelete:F,files:f,readOnly:b,disabled:m=!1,maxSize:h,helper:d=J({accept:r,maxSize:h},i),...$}=a,q=d?(d==null?void 0:d.id)??`${n}-helper`:void 0,[k,L]=g.useState(!1),[_,T]=g.useState(N||[]),[C,w]=g.useState(),U=z.default(c.default["file-upload"],{[c.default["file-upload-disabled"]]:m}),B=e=>{var x;if(!r)return!0;const l=(r==null?void 0:r.replace(/,/g,"").split("."))||[],u=(x=e.name.split(".").pop())==null?void 0:x.toLowerCase();return!!u&&l.includes(u)},v=g.useMemo(()=>f&&o?f:_,[f,_,o]),H=e=>{if(e.target.files){const l=[],u=[...Array.from(e.target.files)].filter(j=>B(j)?!0:(l.push({type:"extension",file:j}),!1)).filter(j=>!h||j.size<=h*1048576?!0:(l.push({type:"size",file:j}),!1)),x=[...v,...u];typeof f>"u"&&T(x),o==null||o(x),e.target.value="",l.length?w({type:"error",text:K(l,i)}):w(void 0)}},R=e=>{const l=[...v].filter(u=>u!==e);F&&F(e),typeof f>"u"&&T(l),o==null||o(l)},S=(e,l)=>t.jsx("li",{children:t.jsx(O.Tag,{color:"secondary",onClose:!e.isLoading&&!m&&!b?()=>R(e):void 0,isLoading:e.isLoading,children:e.name})},l),E=()=>t.jsx("ul",{className:c.default["file-upload__items"],children:v.map((e,l)=>S(e,l))});return t.jsxs("div",{children:[t.jsx("div",{onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),className:c.default["file-upload__label-wrapper"],children:t.jsx(I.FormLabel,{id:n,...$,renderWithoutLabel:b,className:c.default["file-upload__label"]})}),b?E():t.jsx(W.Card,{padding:.5,background:m?"bg-disabled":void 0,className:c.default["file-upload__card"],children:t.jsx(Y.CardContent,{children:t.jsxs(G.Row,{gutterY:2,children:[t.jsx(M.Col,{children:E()}),t.jsx(M.Col,{xs:12,md:"auto",align:"center",children:t.jsxs("div",{className:U,children:[t.jsx("input",{id:n,type:"file",name:s,accept:r,onChange:H,multiple:p,disabled:m}),t.jsx(D.Button,{visualType:"link",iconLeft:"file_upload","aria-describedby":q,isActive:k,disabled:m,onClick:()=>{var e;return(e=document.getElementById(n))==null?void 0:e.click()},children:i("file-upload.add")})]})})]})})}),(C||d)&&t.jsx(A.FeedbackText,{...C||d,id:q})]})};exports.FileUpload=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),S=require("../../../../../external/classnames/index.cjs.js"),j=require("react"),z=require("../../../../tedi/components/form/feedback-text/feedback-text.cjs.js"),A=require("../../../../tedi/components/form/form-label/form-label.cjs.js"),I=require("../../../../tedi/components/tags/tag/tag.cjs.js"),O=require("../../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),P=require("../../button/button.cjs.js"),c=require("./file-upload.module.scss.cjs.js"),W=require("../../../../tedi/providers/label-provider/use-labels.cjs.js"),Y=require("../../card/card.cjs.js"),G=require("../../card/card-content/card-content.cjs.js"),J=require("../../../../tedi/components/layout/grid/row.cjs.js"),E=require("../../../../tedi/components/layout/grid/col.cjs.js"),K=({accept:a,maxSize:i},n)=>{if(!a&&!i)return;const s=[a&&`${n("file-upload.accept")} ${a.replaceAll(",",", ")}`,i&&`${n("file-upload.max-size")} ${i}MB`].filter(Boolean).join(". ");return s.length?{text:s}:void 0},Q=(a,i)=>{const n=a.reduce((s,{type:r,file:p})=>(s[r].push(p.name),s),{extension:[],size:[]});return Object.entries(n).filter(([s,r])=>r.length).map(([s,r])=>{const p=r.map(F=>`'${F}'`).join(", ");return i(`file-upload.${s}-rejected`,p)}).join(". ")},V=a=>{O.warnDeprecated("Community FileUpload","Use `FileUpload` from `@tedi-design-system/react/tedi` instead.");const{getLabel:i}=W.useLabels(),{id:n,name:s,accept:r,multiple:p,onChange:o,className:F,defaultFiles:M,onDelete:v,files:f,readOnly:b,disabled:m=!1,maxSize:h,helper:d=K({accept:r,maxSize:h},i),...N}=a,q=d?(d==null?void 0:d.id)??`${n}-helper`:void 0,[$,L]=j.useState(!1),[_,w]=j.useState(M||[]),[C,T]=j.useState(),k=S.default(c.default["file-upload"],{[c.default["file-upload-disabled"]]:m}),B=e=>{var x;if(!r)return!0;const l=(r==null?void 0:r.replace(/,/g,"").split("."))||[],u=(x=e.name.split(".").pop())==null?void 0:x.toLowerCase();return!!u&&l.includes(u)},y=j.useMemo(()=>f&&o?f:_,[f,_,o]),H=e=>{if(e.target.files){const l=[],u=[...Array.from(e.target.files)].filter(g=>B(g)?!0:(l.push({type:"extension",file:g}),!1)).filter(g=>!h||g.size<=h*1048576?!0:(l.push({type:"size",file:g}),!1)),x=[...y,...u];typeof f>"u"&&w(x),o==null||o(x),e.target.value="",l.length?T({type:"error",text:Q(l,i)}):T(void 0)}},D=e=>{const l=[...y].filter(u=>u!==e);v&&v(e),typeof f>"u"&&w(l),o==null||o(l)},R=(e,l)=>t.jsx("li",{children:t.jsx(I.Tag,{color:"secondary",onClose:!e.isLoading&&!m&&!b?()=>D(e):void 0,isLoading:e.isLoading,children:e.name})},l),U=()=>t.jsx("ul",{className:c.default["file-upload__items"],children:y.map((e,l)=>R(e,l))});return t.jsxs("div",{children:[t.jsx("div",{onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),className:c.default["file-upload__label-wrapper"],children:t.jsx(A.FormLabel,{id:n,...N,renderWithoutLabel:b,className:c.default["file-upload__label"]})}),b?U():t.jsx(Y.Card,{padding:.5,background:m?"bg-disabled":void 0,className:c.default["file-upload__card"],children:t.jsx(G.CardContent,{children:t.jsxs(J.Row,{gutterY:2,children:[t.jsx(E.Col,{children:U()}),t.jsx(E.Col,{xs:12,md:"auto",align:"center",children:t.jsxs("div",{className:k,children:[t.jsx("input",{id:n,type:"file",name:s,accept:r,onChange:H,multiple:p,disabled:m}),t.jsx(P.Button,{visualType:"link",iconLeft:"file_upload","aria-describedby":q,isActive:$,disabled:m,onClick:()=>{var e;return(e=document.getElementById(n))==null?void 0:e.click()},children:i("file-upload.add")})]})})]})})}),(C||d)&&t.jsx(z.FeedbackText,{...C||d,id:q})]})};exports.FileUpload=V;
@@ -1,24 +1,25 @@
1
1
  import { jsxs as _, jsx as l } from "react/jsx-runtime";
2
- import D from "../../../../../external/classnames/index.es.js";
3
- import b from "react";
2
+ import R from "../../../../../external/classnames/index.es.js";
3
+ import y from "react";
4
4
  import { FeedbackText as O } from "../../../../tedi/components/form/feedback-text/feedback-text.es.js";
5
5
  import { FormLabel as S } from "../../../../tedi/components/form/form-label/form-label.es.js";
6
6
  import { Tag as W } from "../../../../tedi/components/tags/tag/tag.es.js";
7
- import { Button as Y } from "../../button/button.es.js";
7
+ import { warnDeprecated as Y } from "../../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
8
+ import { Button as q } from "../../button/button.es.js";
8
9
  import c from "./file-upload.module.scss.es.js";
9
- import { useLabels as q } from "../../../../tedi/providers/label-provider/use-labels.es.js";
10
- import { Card as G } from "../../card/card.es.js";
11
- import { CardContent as J } from "../../card/card-content/card-content.es.js";
12
- import { Row as K } from "../../../../tedi/components/layout/grid/row.es.js";
13
- import { Col as M } from "../../../../tedi/components/layout/grid/col.es.js";
14
- const P = ({ accept: a, maxSize: i }, s) => {
10
+ import { useLabels as G } from "../../../../tedi/providers/label-provider/use-labels.es.js";
11
+ import { Card as J } from "../../card/card.es.js";
12
+ import { CardContent as K } from "../../card/card-content/card-content.es.js";
13
+ import { Row as P } from "../../../../tedi/components/layout/grid/row.es.js";
14
+ import { Col as $ } from "../../../../tedi/components/layout/grid/col.es.js";
15
+ const Q = ({ accept: a, maxSize: i }, s) => {
15
16
  if (!a && !i) return;
16
17
  const o = [
17
18
  a && `${s("file-upload.accept")} ${a.replaceAll(",", ", ")}`,
18
19
  i && `${s("file-upload.max-size")} ${i}MB`
19
20
  ].filter(Boolean).join(". ");
20
21
  return o.length ? { text: o } : void 0;
21
- }, Q = (a, i) => {
22
+ }, V = (a, i) => {
22
23
  const s = a.reduce(
23
24
  (o, { type: r, file: u }) => (o[r].push(u.name), o),
24
25
  { extension: [], size: [] }
@@ -27,45 +28,46 @@ const P = ({ accept: a, maxSize: i }, s) => {
27
28
  const u = r.map((x) => `'${x}'`).join(", ");
28
29
  return i(`file-upload.${o}-rejected`, u);
29
30
  }).join(". ");
30
- }, pe = (a) => {
31
- const { getLabel: i } = q(), {
31
+ }, ue = (a) => {
32
+ Y("Community FileUpload", "Use `FileUpload` from `@tedi-design-system/react/tedi` instead.");
33
+ const { getLabel: i } = G(), {
32
34
  id: s,
33
35
  name: o,
34
36
  accept: r,
35
37
  multiple: u,
36
38
  onChange: n,
37
39
  className: x,
38
- defaultFiles: k,
40
+ defaultFiles: M,
39
41
  onDelete: j,
40
- files: f,
41
- readOnly: v,
42
- disabled: m = !1,
43
- maxSize: y,
44
- helper: d = P({ accept: r, maxSize: y }, i),
45
- ...B
46
- } = a, L = d ? (d == null ? void 0 : d.id) ?? `${s}-helper` : void 0, [H, N] = b.useState(!1), [E, T] = b.useState(k || []), [$, w] = b.useState(), U = D(c["file-upload"], { [c["file-upload-disabled"]]: m }), z = (e) => {
47
- var h;
42
+ files: m,
43
+ readOnly: F,
44
+ disabled: f = !1,
45
+ maxSize: b,
46
+ helper: d = Q({ accept: r, maxSize: b }, i),
47
+ ...k
48
+ } = a, L = d ? (d == null ? void 0 : d.id) ?? `${s}-helper` : void 0, [B, N] = y.useState(!1), [w, C] = y.useState(M || []), [E, T] = y.useState(), H = R(c["file-upload"], { [c["file-upload-disabled"]]: f }), z = (e) => {
49
+ var g;
48
50
  if (!r)
49
51
  return !0;
50
- const t = (r == null ? void 0 : r.replace(/,/g, "").split(".")) || [], p = (h = e.name.split(".").pop()) == null ? void 0 : h.toLowerCase();
52
+ const t = (r == null ? void 0 : r.replace(/,/g, "").split(".")) || [], p = (g = e.name.split(".").pop()) == null ? void 0 : g.toLowerCase();
51
53
  return !!p && t.includes(p);
52
- }, F = b.useMemo(() => f && n ? f : E, [f, E, n]), A = (e) => {
54
+ }, v = y.useMemo(() => m && n ? m : w, [m, w, n]), A = (e) => {
53
55
  if (e.target.files) {
54
- const t = [], p = [...Array.from(e.target.files)].filter((g) => z(g) ? !0 : (t.push({ type: "extension", file: g }), !1)).filter((g) => !y || g.size <= y * 1048576 ? !0 : (t.push({ type: "size", file: g }), !1)), h = [...F, ...p];
55
- typeof f > "u" && T(h), n == null || n(h), e.target.value = "", t.length ? w({ type: "error", text: Q(t, i) }) : w(void 0);
56
+ const t = [], p = [...Array.from(e.target.files)].filter((h) => z(h) ? !0 : (t.push({ type: "extension", file: h }), !1)).filter((h) => !b || h.size <= b * 1048576 ? !0 : (t.push({ type: "size", file: h }), !1)), g = [...v, ...p];
57
+ typeof m > "u" && C(g), n == null || n(g), e.target.value = "", t.length ? T({ type: "error", text: V(t, i) }) : T(void 0);
56
58
  }
57
- }, I = (e) => {
58
- const t = [...F].filter((p) => p !== e);
59
- j && j(e), typeof f > "u" && T(t), n == null || n(t);
60
- }, R = (e, t) => /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(
59
+ }, D = (e) => {
60
+ const t = [...v].filter((p) => p !== e);
61
+ j && j(e), typeof m > "u" && C(t), n == null || n(t);
62
+ }, I = (e, t) => /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(
61
63
  W,
62
64
  {
63
65
  color: "secondary",
64
- onClose: !e.isLoading && !m && !v ? () => I(e) : void 0,
66
+ onClose: !e.isLoading && !f && !F ? () => D(e) : void 0,
65
67
  isLoading: e.isLoading,
66
68
  children: e.name
67
69
  }
68
- ) }, t), C = () => /* @__PURE__ */ l("ul", { className: c["file-upload__items"], children: F.map((e, t) => R(e, t)) });
70
+ ) }, t), U = () => /* @__PURE__ */ l("ul", { className: c["file-upload__items"], children: v.map((e, t) => I(e, t)) });
69
71
  return /* @__PURE__ */ _("div", { children: [
70
72
  /* @__PURE__ */ l(
71
73
  "div",
@@ -73,12 +75,12 @@ const P = ({ accept: a, maxSize: i }, s) => {
73
75
  onMouseEnter: () => N(!0),
74
76
  onMouseLeave: () => N(!1),
75
77
  className: c["file-upload__label-wrapper"],
76
- children: /* @__PURE__ */ l(S, { id: s, ...B, renderWithoutLabel: v, className: c["file-upload__label"] })
78
+ children: /* @__PURE__ */ l(S, { id: s, ...k, renderWithoutLabel: F, className: c["file-upload__label"] })
77
79
  }
78
80
  ),
79
- v ? C() : /* @__PURE__ */ l(G, { padding: 0.5, background: m ? "bg-disabled" : void 0, className: c["file-upload__card"], children: /* @__PURE__ */ l(J, { children: /* @__PURE__ */ _(K, { gutterY: 2, children: [
80
- /* @__PURE__ */ l(M, { children: C() }),
81
- /* @__PURE__ */ l(M, { xs: 12, md: "auto", align: "center", children: /* @__PURE__ */ _("div", { className: U, children: [
81
+ F ? U() : /* @__PURE__ */ l(J, { padding: 0.5, background: f ? "bg-disabled" : void 0, className: c["file-upload__card"], children: /* @__PURE__ */ l(K, { children: /* @__PURE__ */ _(P, { gutterY: 2, children: [
82
+ /* @__PURE__ */ l($, { children: U() }),
83
+ /* @__PURE__ */ l($, { xs: 12, md: "auto", align: "center", children: /* @__PURE__ */ _("div", { className: H, children: [
82
84
  /* @__PURE__ */ l(
83
85
  "input",
84
86
  {
@@ -88,17 +90,17 @@ const P = ({ accept: a, maxSize: i }, s) => {
88
90
  accept: r,
89
91
  onChange: A,
90
92
  multiple: u,
91
- disabled: m
93
+ disabled: f
92
94
  }
93
95
  ),
94
96
  /* @__PURE__ */ l(
95
- Y,
97
+ q,
96
98
  {
97
99
  visualType: "link",
98
100
  iconLeft: "file_upload",
99
101
  "aria-describedby": L,
100
- isActive: H,
101
- disabled: m,
102
+ isActive: B,
103
+ disabled: f,
102
104
  onClick: () => {
103
105
  var e;
104
106
  return (e = document.getElementById(s)) == null ? void 0 : e.click();
@@ -108,9 +110,9 @@ const P = ({ accept: a, maxSize: i }, s) => {
108
110
  )
109
111
  ] }) })
110
112
  ] }) }) }),
111
- ($ || d) && /* @__PURE__ */ l(O, { ...$ || d, id: L })
113
+ (E || d) && /* @__PURE__ */ l(O, { ...E || d, id: L })
112
114
  ] });
113
115
  };
114
116
  export {
115
- pe as FileUpload
117
+ ue as FileUpload
116
118
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),H=require("../../../../../../external/classnames/index.cjs.js"),d=require("react"),S=require("./calendar.module.scss.cjs.js"),T=require("../../../../../../external/@mui/x-date-pickers/CalendarPicker/CalendarPicker.cjs.js"),B=require("../../../../../../external/@mui/x-date-pickers/PickersDay/PickersDay.cjs.js"),E=t=>{const{value:r,defaultValue:l,onChange:a,disabled:y,disableFuture:c,disableHighlightToday:f,disablePast:b,loading:g,minDate:h,maxDate:m,readOnly:q,view:C="day",views:M=["day"],showDaysOutsideCurrentMonth:P=!1,shouldHighlightDate:e,shouldDisableDate:x,shouldDisableMonth:j,shouldDisableYear:k,shouldShowStatusOnDate:i}=t,[s,v]=d.useState(l||null),_=d.useMemo(()=>a&&typeof r<"u"?r:s,[s,a,r]),p=n=>{!(n!=null&&n.isValid())&&n!==null||(typeof r>"u"&&v(n),!(n!=null&&n.isSame(s))&&(a==null||a(n)))},O=(n,F,R)=>{const V=e==null?void 0:e(n),u=i==null?void 0:i(n),w=H.default({"Mui-highlighted":V},{[S.default[`calendar__day--status-${u}`]]:u});return o.jsx(B.PickersDay,{className:w,...R})};return o.jsx(T.CalendarPicker,{"data-name":"calendar",date:_,onChange:p,disabled:y,disableFuture:c,disableHighlightToday:f,disablePast:b,loading:g,minDate:h,maxDate:m,readOnly:q,renderDay:O,shouldDisableDate:x,shouldDisableMonth:j,shouldDisableYear:k,showDaysOutsideCurrentMonth:P,view:C,views:M})};exports.Calendar=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),D=require("../../../../../../external/classnames/index.cjs.js"),d=require("react"),H=require("../../../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),S=require("./calendar.module.scss.cjs.js"),T=require("../../../../../../external/@mui/x-date-pickers/CalendarPicker/CalendarPicker.cjs.js"),B=require("../../../../../../external/@mui/x-date-pickers/PickersDay/PickersDay.cjs.js"),E=o=>{H.warnDeprecated("Community Calendar","Use `Calendar` from `@tedi-design-system/react/tedi` instead.");const{value:e,defaultValue:l,onChange:a,disabled:c,disableFuture:y,disableHighlightToday:f,disablePast:m,loading:g,minDate:b,maxDate:h,readOnly:C,view:q="day",views:M=["day"],showDaysOutsideCurrentMonth:P=!1,shouldHighlightDate:r,shouldDisableDate:p,shouldDisableMonth:x,shouldDisableYear:j,shouldShowStatusOnDate:i}=o,[s,k]=d.useState(l||null),v=d.useMemo(()=>a&&typeof e<"u"?e:s,[s,a,e]),w=n=>{!(n!=null&&n.isValid())&&n!==null||(typeof e>"u"&&k(n),!(n!=null&&n.isSame(s))&&(a==null||a(n)))},_=(n,F,O)=>{const R=r==null?void 0:r(n),t=i==null?void 0:i(n),V=D.default({"Mui-highlighted":R},{[S.default[`calendar__day--status-${t}`]]:t});return u.jsx(B.PickersDay,{className:V,...O})};return u.jsx(T.CalendarPicker,{"data-name":"calendar",date:v,onChange:w,disabled:c,disableFuture:y,disableHighlightToday:f,disablePast:m,loading:g,minDate:b,maxDate:h,readOnly:C,renderDay:_,shouldDisableDate:p,shouldDisableMonth:x,shouldDisableYear:j,showDaysOutsideCurrentMonth:P,view:q,views:M})};exports.Calendar=E;
@@ -1,60 +1,62 @@
1
- import { jsx as u } from "react/jsx-runtime";
1
+ import { jsx as d } from "react/jsx-runtime";
2
2
  import N from "../../../../../../external/classnames/index.es.js";
3
- import e from "react";
4
- import O from "./calendar.module.scss.es.js";
5
- import { CalendarPicker as j } from "../../../../../../external/@mui/x-date-pickers/CalendarPicker/CalendarPicker.es.js";
6
- import { PickersDay as B } from "../../../../../../external/@mui/x-date-pickers/PickersDay/PickersDay.es.js";
7
- const G = (t) => {
3
+ import t from "react";
4
+ import { warnDeprecated as O } from "../../../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
5
+ import j from "./calendar.module.scss.es.js";
6
+ import { CalendarPicker as B } from "../../../../../../external/@mui/x-date-pickers/CalendarPicker/CalendarPicker.es.js";
7
+ import { PickersDay as E } from "../../../../../../external/@mui/x-date-pickers/PickersDay/PickersDay.es.js";
8
+ const G = (m) => {
9
+ O("Community Calendar", "Use `Calendar` from `@tedi-design-system/react/tedi` instead.");
8
10
  const {
9
- value: r,
10
- defaultValue: l,
11
- onChange: n,
12
- disabled: m,
11
+ value: n,
12
+ defaultValue: u,
13
+ onChange: r,
14
+ disabled: l,
13
15
  disableFuture: f,
14
16
  disableHighlightToday: y,
15
- disablePast: h,
16
- loading: p,
17
+ disablePast: p,
18
+ loading: h,
17
19
  minDate: g,
18
- maxDate: b,
19
- readOnly: C,
20
- view: M = "day",
21
- views: _ = ["day"],
22
- showDaysOutsideCurrentMonth: c = !1,
20
+ maxDate: C,
21
+ readOnly: b,
22
+ view: c = "day",
23
+ views: M = ["day"],
24
+ showDaysOutsideCurrentMonth: _ = !1,
23
25
  shouldHighlightDate: i,
24
26
  shouldDisableDate: v,
25
- shouldDisableMonth: x,
26
- shouldDisableYear: H,
27
+ shouldDisableMonth: w,
28
+ shouldDisableYear: x,
27
29
  shouldShowStatusOnDate: o
28
- } = t, [s, P] = e.useState(l || null), R = e.useMemo(() => n && typeof r < "u" ? r : s, [s, n, r]);
29
- return /* @__PURE__ */ u(
30
- j,
30
+ } = m, [e, H] = t.useState(u || null), P = t.useMemo(() => r && typeof n < "u" ? n : e, [e, r, n]);
31
+ return /* @__PURE__ */ d(
32
+ B,
31
33
  {
32
34
  "data-name": "calendar",
33
- date: R,
35
+ date: P,
34
36
  onChange: (a) => {
35
- !(a != null && a.isValid()) && a !== null || (typeof r > "u" && P(a), !(a != null && a.isSame(s)) && (n == null || n(a)));
37
+ !(a != null && a.isValid()) && a !== null || (typeof n > "u" && H(a), !(a != null && a.isSame(e)) && (r == null || r(a)));
36
38
  },
37
- disabled: m,
39
+ disabled: l,
38
40
  disableFuture: f,
39
41
  disableHighlightToday: y,
40
- disablePast: h,
41
- loading: p,
42
+ disablePast: p,
43
+ loading: h,
42
44
  minDate: g,
43
- maxDate: b,
44
- readOnly: C,
45
- renderDay: (a, I, V) => {
46
- const k = i == null ? void 0 : i(a), d = o == null ? void 0 : o(a), w = N(
47
- { "Mui-highlighted": k },
48
- { [O[`calendar__day--status-${d}`]]: d }
45
+ maxDate: C,
46
+ readOnly: b,
47
+ renderDay: (a, T, R) => {
48
+ const V = i == null ? void 0 : i(a), s = o == null ? void 0 : o(a), k = N(
49
+ { "Mui-highlighted": V },
50
+ { [j[`calendar__day--status-${s}`]]: s }
49
51
  );
50
- return /* @__PURE__ */ u(B, { className: w, ...V });
52
+ return /* @__PURE__ */ d(E, { className: k, ...R });
51
53
  },
52
54
  shouldDisableDate: v,
53
- shouldDisableMonth: x,
54
- shouldDisableYear: H,
55
- showDaysOutsideCurrentMonth: c,
56
- view: M,
57
- views: _
55
+ shouldDisableMonth: w,
56
+ shouldDisableYear: x,
57
+ showDaysOutsideCurrentMonth: _,
58
+ view: c,
59
+ views: M
58
60
  }
59
61
  );
60
62
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),s=require("react"),I=require("../mui-input-transition/mui-input-transition.cjs.js"),O=require("../../../../../../external/@mui/x-date-pickers/TimePicker/TimePicker.cjs.js"),h=d=>{const{defaultValue:m,onChange:n,value:t,disabled:p,readOnly:u,inputFormat:l="HH:mm",toolbarTitle:f,maxTime:T,minTime:P,minutesStep:k=1,onError:x,shouldDisableTime:y,views:b=["hours","minutes"],ampm:v=!1,onClose:r,...S}=d,[a,g]=s.useState(m||null),[j,i]=s.useState(!1),q=s.useMemo(()=>n&&typeof t<"u"?t:a,[a,n,t]),o=e=>{!(e!=null&&e.isValid())&&e!==null||(typeof t>"u"&&g(e),n==null||n(e))},C=()=>{i(!1),r==null||r()};return c.jsx(O.TimePicker,{"data-name":"timepicker",value:q,onChange:o,open:j,onOpen:()=>i(!0),onClose:C,renderInput:e=>c.jsx(I.default,{muiTextfieldProps:e,inputFormat:l,onChangeHandler:o,textfieldProps:{...S,onClear:()=>o(null),onIconClick:u?void 0:()=>i(H=>!H)},type:"time"}),disabled:p,readOnly:u,inputFormat:l,toolbarTitle:f,maxTime:T,minTime:P,minutesStep:k,onError:x,shouldDisableTime:y,views:b,ampm:v})};exports.TimePicker=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),o=require("react"),I=require("../../../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),O=require("../mui-input-transition/mui-input-transition.cjs.js"),h=require("../../../../../../external/@mui/x-date-pickers/TimePicker/TimePicker.cjs.js"),w=c=>{I.warnDeprecated("Community TimePicker","Use `TimeField` from `@tedi-design-system/react/tedi` instead.");const{defaultValue:m,onChange:n,value:t,disabled:p,readOnly:u,inputFormat:a="HH:mm",toolbarTitle:f,maxTime:T,minTime:y,minutesStep:P=1,onError:k,shouldDisableTime:x,views:b=["hours","minutes"],ampm:g=!1,onClose:r,...q}=c,[l,v]=o.useState(m||null),[C,i]=o.useState(!1),S=o.useMemo(()=>n&&typeof t<"u"?t:l,[l,n,t]),s=e=>{!(e!=null&&e.isValid())&&e!==null||(typeof t>"u"&&v(e),n==null||n(e))},j=()=>{i(!1),r==null||r()};return d.jsx(h.TimePicker,{"data-name":"timepicker",value:S,onChange:s,open:C,onOpen:()=>i(!0),onClose:j,renderInput:e=>d.jsx(O.default,{muiTextfieldProps:e,inputFormat:a,onChangeHandler:s,textfieldProps:{...q,onClear:()=>s(null),onIconClick:u?void 0:()=>i(H=>!H)},type:"time"}),disabled:p,readOnly:u,inputFormat:a,toolbarTitle:f,maxTime:T,minTime:y,minutesStep:P,onError:k,shouldDisableTime:x,views:b,ampm:g})};exports.TimePicker=w;