@tedi-design-system/react 19.0.0-rc.14 → 19.0.0-rc.16

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 (31) hide show
  1. package/_virtual/index.es13.js +2 -2
  2. package/_virtual/index.es14.js +2 -2
  3. package/bundle-stats.html +1 -1
  4. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
  5. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
  6. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  7. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
  8. package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
  9. package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
  10. package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
  11. package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
  12. package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  13. package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
  14. package/external/prop-types/external/react-is/index.cjs.js +1 -1
  15. package/external/prop-types/external/react-is/index.es.js +1 -1
  16. package/external/react-is/index.cjs.js +1 -1
  17. package/external/react-is/index.es.js +1 -1
  18. package/external/toposort/index.cjs.js +1 -1
  19. package/external/toposort/index.es.js +1 -1
  20. package/index.css +1 -1
  21. package/package.json +4 -3
  22. package/src/community/components/map-components/button-group/button-group.cjs.js +1 -1
  23. package/src/community/components/map-components/button-group/button-group.es.js +18 -14
  24. package/src/community/components/map-components/map-button/map-button.cjs.js +1 -1
  25. package/src/community/components/map-components/map-button/map-button.es.js +34 -33
  26. package/src/tedi/components/form/time-picker/time-picker.cjs.js +1 -1
  27. package/src/tedi/components/form/time-picker/time-picker.es.js +1 -1
  28. package/src/tedi/components/misc/timeline/timeline.cjs.js +1 -1
  29. package/src/tedi/components/misc/timeline/timeline.es.js +24 -27
  30. package/src/tedi/components/overlays/overlay/overlay.cjs.js +1 -1
  31. package/src/tedi/components/overlays/overlay/overlay.es.js +29 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tedi-design-system/react",
3
- "version": "19.0.0-rc.14",
3
+ "version": "19.0.0-rc.16",
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,
@@ -116,7 +116,7 @@
116
116
  "eslint-plugin-jsx-a11y": "^6.7.1",
117
117
  "eslint-plugin-prettier": "^4.2.1",
118
118
  "eslint-plugin-react": "^7.32.2",
119
- "eslint-plugin-react-hooks": "^4.6.0",
119
+ "eslint-plugin-react-hooks": "^7.1.1",
120
120
  "eslint-plugin-simple-import-sort": "^14.0.0",
121
121
  "eslint-plugin-storybook": "^10.4.6",
122
122
  "eslint-plugin-unused-imports": "^4.1.4",
@@ -186,6 +186,7 @@
186
186
  "access": "public"
187
187
  },
188
188
  "overrides": {
189
- "dayjs": "$dayjs"
189
+ "dayjs": "$dayjs",
190
+ "eslint-plugin-react-hooks": "$eslint-plugin-react-hooks"
190
191
  }
191
192
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("../../../../../external/classnames/index.cjs.js"),o=require("react"),j=require("../map-button/map-button.cjs.js"),e=require("./button-group.module.scss.cjs.js"),N=p=>{const{children:c,className:f,direction:m="horizontal",onSelectionChange:s,stretch:b=!1,ariaLabel:x,prefix:a,suffix:d,prefixClassName:_,suffixClassName:g}=p;return r.jsxs("div",{className:i.default(e.default["tedi-button-group"],e.default[`tedi-button-group--${m}`],{[e.default["tedi-button-group--stretch"]]:b},f),role:"group","aria-label":x,children:[a&&r.jsx("div",{className:i.default(e.default["tedi-button-group__prefix"],_),children:r.jsx("span",{children:a})}),o.Children.map(c,u=>{if(o.isValidElement(u)&&u.type===j.MapButton){const t=u;return o.cloneElement(t,{className:i.default(e.default["tedi-button-group__item"],{[e.default["tedi-button-group__item--active"]]:t.props.isActive,[e.default["tedi-button-group__item--disabled"]]:t.props.disabled}),onClick:h=>{var l,n;t.props.disabled||((n=(l=t.props).onClick)==null||n.call(l,h),s==null||s(t.props.id))}})}return u}),d&&r.jsx("div",{className:i.default(e.default["tedi-button-group__suffix"],g),children:r.jsx("span",{children:d})})]})};exports.ButtonGroup=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("../../../../../external/classnames/index.cjs.js"),o=require("react"),h=require("../map-button/map-button.cjs.js"),e=require("./button-group.module.scss.cjs.js"),j=p=>{const{children:c,className:f,direction:m="horizontal",onSelectionChange:s,stretch:b=!1,ariaLabel:x,prefix:a,suffix:l,prefixClassName:_,suffixClassName:g}=p;return r.jsxs("div",{className:i.default(e.default["tedi-button-group"],e.default[`tedi-button-group--${m}`],{[e.default["tedi-button-group--stretch"]]:b},f),role:"group","aria-label":x,children:[a&&r.jsx("div",{className:i.default(e.default["tedi-button-group__prefix"],_),children:r.jsx("span",{children:a})}),o.Children.map(c,u=>{if(o.isValidElement(u)&&u.type===h.MapButton){const t=u;return o.cloneElement(t,{className:i.default(e.default["tedi-button-group__item"],{[e.default["tedi-button-group__item--active"]]:t.props.isActive,[e.default["tedi-button-group__item--disabled"]]:t.props.disabled},t.props.className),onClick:N=>{var d,n;t.props.disabled||((n=(d=t.props).onClick)==null||n.call(d,N),s==null||s(t.props.id))}})}return u}),l&&r.jsx("div",{className:i.default(e.default["tedi-button-group__suffix"],g),children:r.jsx("span",{children:l})})]})};exports.ButtonGroup=j;
@@ -1,5 +1,5 @@
1
- import { jsxs as N, jsx as i } from "react/jsx-runtime";
2
- import o from "../../../../../external/classnames/index.es.js";
1
+ import { jsxs as g, jsx as i } from "react/jsx-runtime";
2
+ import s from "../../../../../external/classnames/index.es.js";
3
3
  import { Children as h, isValidElement as v, cloneElement as C } from "react";
4
4
  import { MapButton as y } from "../map-button/map-button.es.js";
5
5
  import t from "./button-group.module.scss.es.js";
@@ -8,7 +8,7 @@ const A = (d) => {
8
8
  children: u,
9
9
  className: m,
10
10
  direction: c = "horizontal",
11
- onSelectionChange: s,
11
+ onSelectionChange: o,
12
12
  stretch: f = !1,
13
13
  ariaLabel: b,
14
14
  prefix: p,
@@ -16,10 +16,10 @@ const A = (d) => {
16
16
  prefixClassName: _,
17
17
  suffixClassName: x
18
18
  } = d;
19
- return /* @__PURE__ */ N(
19
+ return /* @__PURE__ */ g(
20
20
  "div",
21
21
  {
22
- className: o(
22
+ className: s(
23
23
  t["tedi-button-group"],
24
24
  t[`tedi-button-group--${c}`],
25
25
  {
@@ -30,24 +30,28 @@ const A = (d) => {
30
30
  role: "group",
31
31
  "aria-label": b,
32
32
  children: [
33
- p && /* @__PURE__ */ i("div", { className: o(t["tedi-button-group__prefix"], _), children: /* @__PURE__ */ i("span", { children: p }) }),
33
+ p && /* @__PURE__ */ i("div", { className: s(t["tedi-button-group__prefix"], _), children: /* @__PURE__ */ i("span", { children: p }) }),
34
34
  h.map(u, (r) => {
35
35
  if (v(r) && r.type === y) {
36
36
  const e = r;
37
37
  return C(e, {
38
- className: o(t["tedi-button-group__item"], {
39
- [t["tedi-button-group__item--active"]]: e.props.isActive,
40
- [t["tedi-button-group__item--disabled"]]: e.props.disabled
41
- }),
42
- onClick: (g) => {
43
- var n, l;
44
- e.props.disabled || ((l = (n = e.props).onClick) == null || l.call(n, g), s == null || s(e.props.id));
38
+ className: s(
39
+ t["tedi-button-group__item"],
40
+ {
41
+ [t["tedi-button-group__item--active"]]: e.props.isActive,
42
+ [t["tedi-button-group__item--disabled"]]: e.props.disabled
43
+ },
44
+ e.props.className
45
+ ),
46
+ onClick: (N) => {
47
+ var l, n;
48
+ e.props.disabled || ((n = (l = e.props).onClick) == null || n.call(l, N), o == null || o(e.props.id));
45
49
  }
46
50
  });
47
51
  }
48
52
  return r;
49
53
  }),
50
- a && /* @__PURE__ */ i("div", { className: o(t["tedi-button-group__suffix"], x), children: /* @__PURE__ */ i("span", { children: a }) })
54
+ a && /* @__PURE__ */ i("div", { className: s(t["tedi-button-group__suffix"], x), children: /* @__PURE__ */ i("span", { children: a }) })
51
55
  ]
52
56
  }
53
57
  );
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),m=require("../../../../../external/classnames/index.cjs.js"),B=require("react"),S=require("../../../../tedi/components/base/icon/icon.cjs.js"),N=require("../../../../tedi/components/loaders/spinner/spinner.cjs.js"),O=require("../../../../tedi/components/buttons/button/button.cjs.js"),d=require("../map-dropdown/map-dropdown.cjs.js"),t=require("./map-button.module.scss.cjs.js"),l=require("../../../../tedi/components/overlays/tooltip/tooltip.cjs.js"),b=f=>{const{size:n="default",icon:r,selected:h=!1,className:x,children:u,hideLabel:c=!1,tooltipContent:p=u,dropdownItems:o,isActive:j,isHovered:g,underline:q,isLoading:i,..._}=f,[w,D]=B.useState(!1),M=h||w,v=m.default(t.default["tedi-map-button"],t.default[`tedi-map-button--${n}`],M&&t.default["tedi-map-button--selected"],o&&t.default["tedi-map-button--dropdown"],j&&t.default["tedi-map-button--is-active"],g&&t.default["tedi-map-button--is-hovered"],q&&t.default["tedi-map-button--underline"],i&&t.default["tedi-map-button--loading"],x),C=e.jsxs(e.Fragment,{children:[i?e.jsx(N.Spinner,{size:n==="small"?16:18,className:t.default["tedi-map-button__icon"]}):r&&e.jsx(S.Icon,{name:r,className:t.default["tedi-map-button__icon"],size:n==="small"?24:18}),!c&&e.jsx("div",{className:m.default(t.default["tedi-map-button__text"]),children:u})]}),s=e.jsx(O.Button,{noStyle:!0,isLoading:i,className:v,size:n,..._,children:C}),T=c&&p?e.jsxs(l.Tooltip,{placement:"right",children:[e.jsx(l.Tooltip.Trigger,{children:s}),e.jsx(l.Tooltip.Content,{children:p})]}):s;return o?e.jsxs(d.MapDropdown,{onOpenChange:D,placement:"right-start",children:[e.jsx(d.MapDropdown.Trigger,{children:s}),e.jsx(d.MapDropdown.Content,{items:o.map(a=>({children:a.children,onClick:a.onClick,isDisabled:a.isDisabled}))})]}):T};exports.MapButton=b;exports.default=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),m=require("../../../../../external/classnames/index.cjs.js"),B=require("react"),S=require("../../../../tedi/components/base/icon/icon.cjs.js"),N=require("../../../../tedi/components/loaders/spinner/spinner.cjs.js"),O=require("../../../../tedi/components/buttons/button/button.cjs.js"),d=require("../map-dropdown/map-dropdown.cjs.js"),t=require("./map-button.module.scss.cjs.js"),l=require("../../../../tedi/components/overlays/tooltip/tooltip.cjs.js"),b=f=>{const{size:n="default",icon:r,selected:h=!1,className:x,children:u,hideLabel:c=!1,tooltipContent:p=u,dropdownItems:i,isActive:j,isHovered:g,underline:q,isLoading:s,...v}=f,[_,w]=B.useState(!1),D=h||_,M=m.default(t.default["tedi-map-button"],t.default[`tedi-map-button--${n}`],D&&t.default["tedi-map-button--selected"],i&&t.default["tedi-map-button--dropdown"],j&&t.default["tedi-map-button--is-active"],g&&t.default["tedi-map-button--is-hovered"],q&&t.default["tedi-map-button--underline"],s&&t.default["tedi-map-button--loading"],x),C=e.jsxs(e.Fragment,{children:[s?e.jsx(N.Spinner,{size:n==="small"?16:18,className:t.default["tedi-map-button__icon"]}):r&&e.jsx(S.Icon,{name:r,className:t.default["tedi-map-button__icon"],size:n==="small"?24:18}),!c&&e.jsx("div",{className:m.default(t.default["tedi-map-button__text"]),children:u})]}),a=e.jsx(O.Button,{noStyle:!0,isLoading:s,className:M,size:n,...v,children:C}),T=c&&p?e.jsxs(l.Tooltip,{placement:"right",children:[e.jsx(l.Tooltip.Trigger,{children:a}),e.jsx(l.Tooltip.Content,{children:p})]}):a;return i?e.jsxs(d.MapDropdown,{onOpenChange:w,placement:"right-start",children:[e.jsx(d.MapDropdown.Trigger,{children:a}),e.jsx(d.MapDropdown.Content,{items:i.map(o=>({children:o.children,onClick:o.onClick,isActive:o.isActive,isDisabled:o.isDisabled}))})]}):T};exports.MapButton=b;exports.default=b;
@@ -1,53 +1,54 @@
1
1
  import { jsxs as a, Fragment as z, jsx as e } from "react/jsx-runtime";
2
2
  import b from "../../../../../external/classnames/index.es.js";
3
- import { useState as I } from "react";
4
- import { Icon as M } from "../../../../tedi/components/base/icon/icon.es.js";
5
- import { Spinner as O } from "../../../../tedi/components/loaders/spinner/spinner.es.js";
6
- import { Button as j } from "../../../../tedi/components/buttons/button/button.es.js";
3
+ import { useState as A } from "react";
4
+ import { Icon as I } from "../../../../tedi/components/base/icon/icon.es.js";
5
+ import { Spinner as M } from "../../../../tedi/components/loaders/spinner/spinner.es.js";
6
+ import { Button as O } from "../../../../tedi/components/buttons/button/button.es.js";
7
7
  import { MapDropdown as l } from "../map-dropdown/map-dropdown.es.js";
8
8
  import t from "./map-button.module.scss.es.js";
9
- import { Tooltip as m } from "../../../../tedi/components/overlays/tooltip/tooltip.es.js";
9
+ import { Tooltip as d } from "../../../../tedi/components/overlays/tooltip/tooltip.es.js";
10
10
  const q = (h) => {
11
11
  const {
12
12
  size: o = "default",
13
- icon: d,
13
+ icon: m,
14
14
  selected: f = !1,
15
15
  className: g,
16
- children: p,
17
- hideLabel: c = !1,
18
- tooltipContent: u = p,
19
- dropdownItems: n,
20
- isActive: C,
21
- isHovered: N,
22
- underline: _,
23
- isLoading: i,
24
- ...v
25
- } = h, [w, D] = I(!1), x = f || w, B = b(
16
+ children: c,
17
+ hideLabel: p = !1,
18
+ tooltipContent: u = c,
19
+ dropdownItems: i,
20
+ isActive: v,
21
+ isHovered: C,
22
+ underline: N,
23
+ isLoading: s,
24
+ ..._
25
+ } = h, [w, D] = A(!1), x = f || w, B = b(
26
26
  t["tedi-map-button"],
27
27
  t[`tedi-map-button--${o}`],
28
28
  x && t["tedi-map-button--selected"],
29
- n && t["tedi-map-button--dropdown"],
30
- C && t["tedi-map-button--is-active"],
31
- N && t["tedi-map-button--is-hovered"],
32
- _ && t["tedi-map-button--underline"],
33
- i && t["tedi-map-button--loading"],
29
+ i && t["tedi-map-button--dropdown"],
30
+ v && t["tedi-map-button--is-active"],
31
+ C && t["tedi-map-button--is-hovered"],
32
+ N && t["tedi-map-button--underline"],
33
+ s && t["tedi-map-button--loading"],
34
34
  g
35
35
  ), S = /* @__PURE__ */ a(z, { children: [
36
- i ? /* @__PURE__ */ e(O, { size: o === "small" ? 16 : 18, className: t["tedi-map-button__icon"] }) : d && /* @__PURE__ */ e(M, { name: d, className: t["tedi-map-button__icon"], size: o === "small" ? 24 : 18 }),
37
- !c && /* @__PURE__ */ e("div", { className: b(t["tedi-map-button__text"]), children: p })
38
- ] }), s = /* @__PURE__ */ e(j, { noStyle: !0, isLoading: i, className: B, size: o, ...v, children: S }), T = c && u ? /* @__PURE__ */ a(m, { placement: "right", children: [
39
- /* @__PURE__ */ e(m.Trigger, { children: s }),
40
- /* @__PURE__ */ e(m.Content, { children: u })
41
- ] }) : s;
42
- return n ? /* @__PURE__ */ a(l, { onOpenChange: D, placement: "right-start", children: [
43
- /* @__PURE__ */ e(l.Trigger, { children: s }),
36
+ s ? /* @__PURE__ */ e(M, { size: o === "small" ? 16 : 18, className: t["tedi-map-button__icon"] }) : m && /* @__PURE__ */ e(I, { name: m, className: t["tedi-map-button__icon"], size: o === "small" ? 24 : 18 }),
37
+ !p && /* @__PURE__ */ e("div", { className: b(t["tedi-map-button__text"]), children: c })
38
+ ] }), r = /* @__PURE__ */ e(O, { noStyle: !0, isLoading: s, className: B, size: o, ..._, children: S }), T = p && u ? /* @__PURE__ */ a(d, { placement: "right", children: [
39
+ /* @__PURE__ */ e(d.Trigger, { children: r }),
40
+ /* @__PURE__ */ e(d.Content, { children: u })
41
+ ] }) : r;
42
+ return i ? /* @__PURE__ */ a(l, { onOpenChange: D, placement: "right-start", children: [
43
+ /* @__PURE__ */ e(l.Trigger, { children: r }),
44
44
  /* @__PURE__ */ e(
45
45
  l.Content,
46
46
  {
47
- items: n.map((r) => ({
48
- children: r.children,
49
- onClick: r.onClick,
50
- isDisabled: r.isDisabled
47
+ items: i.map((n) => ({
48
+ children: n.children,
49
+ onClick: n.onClick,
50
+ isActive: n.isActive,
51
+ isDisabled: n.isDisabled
51
52
  }))
52
53
  }
53
54
  )
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react/jsx-runtime"),n=require("react"),t=require("../time-field/time-field-helpers.cjs.js"),H=require("./components/time-grid/time-grid.cjs.js"),x=require("./components/time-wheel/time-wheel.cjs.js"),T=({value:s,defaultValue:f="",onChange:r,stepMinutes:o=1,availableTimes:i,gridVariant:h="button",className:u,bordered:c=!0})=>{const[j,P]=n.useState(f),l=s!==void 0,m=l?s:j,d=e=>{l||P(e),r==null||r(e)},a=n.useMemo(t.generateHours,[]),q=n.useMemo(()=>t.generateMinutes(o),[o]),{hour:y,minute:S}=t.parseTime(m||"12:00"),g=a.includes(y)?y:"12",k=t.findClosestMinute(S,q);return Array.isArray(i)&&i.length>0?M.jsx(H.TimeGrid,{times:i,value:m,variant:h,onSelect:d,className:u,bordered:c}):M.jsx(x.TimeWheel,{hours:a,minutes:q,selectedHour:g,selectedMinute:k,onChange:(e,p)=>d(`${e}:${p}`),className:u,bordered:c})};T.displayName="TimePicker";exports.TimePicker=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react/jsx-runtime"),n=require("react"),t=require("../time-field/time-field-helpers.cjs.js"),H=require("./components/time-grid/time-grid.cjs.js"),x=require("./components/time-wheel/time-wheel.cjs.js"),T=({value:s,defaultValue:f="",onChange:r,stepMinutes:o=1,availableTimes:i,gridVariant:h="button",className:u,bordered:c=!0})=>{const[j,P]=n.useState(f),l=s!==void 0,m=l?s:j,d=e=>{l||P(e),r==null||r(e)},a=n.useMemo(()=>t.generateHours(),[]),q=n.useMemo(()=>t.generateMinutes(o),[o]),{hour:y,minute:S}=t.parseTime(m||"12:00"),g=a.includes(y)?y:"12",k=t.findClosestMinute(S,q);return Array.isArray(i)&&i.length>0?M.jsx(H.TimeGrid,{times:i,value:m,variant:h,onSelect:d,className:u,bordered:c}):M.jsx(x.TimeWheel,{hours:a,minutes:q,selectedHour:g,selectedMinute:k,onChange:(e,p)=>d(`${e}:${p}`),className:u,bordered:c})};T.displayName="TimePicker";exports.TimePicker=T;
@@ -15,7 +15,7 @@ const I = ({
15
15
  }) => {
16
16
  const [M, T] = S.useState(h), c = o !== void 0, m = c ? o : M, u = (t) => {
17
17
  c || T(t), e == null || e(t);
18
- }, f = a(_, []), l = a(() => $(n), [n]), { hour: d, minute: k } = g(m || "12:00"), A = f.includes(d) ? d : "12", H = j(k, l);
18
+ }, f = a(() => _(), []), l = a(() => $(n), [n]), { hour: d, minute: k } = g(m || "12:00"), A = f.includes(d) ? d : "12", H = j(k, l);
19
19
  return Array.isArray(r) && r.length > 0 ? /* @__PURE__ */ p(
20
20
  x,
21
21
  {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react/jsx-runtime"),y=require("../../../../../external/classnames/index.cjs.js"),n=require("react"),I=require("./components/timeline-description/timeline-description.cjs.js"),d=require("./components/timeline-item/timeline-item.cjs.js"),g=require("./components/timeline-title/timeline-title.cjs.js"),u=require("./timeline.module.scss.cjs.js"),c=e=>n.isValidElement(e)&&e.type===d.TimelineItem,j=(e,t)=>t===void 0?"future":e===t?"current":e<t?"past":"future",i=({children:e,activeIndex:t,variant:l="default",cardPadding:s,className:a})=>{const f=n.Children.toArray(e).filter(c).length;let m=-1;const T=n.Children.map(e,r=>{if(!c(r))return r;m+=1;const o=m;return n.cloneElement(r,{state:j(o,t),isLast:o===f-1})}),p=l==="card"&&s!==void 0?{"--tedi-timeline-card-padding":`${s}rem`}:void 0;return q.jsx("div",{className:y.default(u.default["tedi-timeline"],{[u.default["tedi-timeline--card"]]:l==="card"},a),style:p,children:T})};i.displayName="Timeline";i.Item=d.TimelineItem;i.Title=g.TimelineTitle;i.Description=I.TimelineDescription;exports.Timeline=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),v=require("../../../../../external/classnames/index.cjs.js"),s=require("react"),D=require("./components/timeline-description/timeline-description.cjs.js"),p=require("./components/timeline-item/timeline-item.cjs.js"),E=require("./components/timeline-title/timeline-title.cjs.js"),a=require("./timeline.module.scss.cjs.js"),d=e=>s.isValidElement(e)&&e.type===p.TimelineItem,I=(e,i)=>i===void 0?"future":e===i?"current":e<i?"past":"future",r=({children:e,activeIndex:i,variant:l="default",cardPadding:o,className:f})=>{const m=s.Children.toArray(e),u=m.flatMap((t,n)=>d(t)?[n]:[]),T=u.length,y=new Map(u.map((t,n)=>[t,n])),q=m.map((t,n)=>{if(!d(t))return t;const c=y.get(n)??0;return s.cloneElement(t,{state:I(c,i),isLast:c===T-1})}),g=l==="card"&&o!==void 0?{"--tedi-timeline-card-padding":`${o}rem`}:void 0;return j.jsx("div",{className:v.default(a.default["tedi-timeline"],{[a.default["tedi-timeline--card"]]:l==="card"},f),style:g,children:q})};r.displayName="Timeline";r.Item=p.TimelineItem;r.Title=E.TimelineTitle;r.Description=D.TimelineDescription;exports.Timeline=r;
@@ -1,38 +1,35 @@
1
- import { jsx as y } from "react/jsx-runtime";
2
- import E from "../../../../../external/classnames/index.es.js";
3
- import { Children as l, cloneElement as N, isValidElement as v } from "react";
4
- import { TimelineDescription as C } from "./components/timeline-description/timeline-description.es.js";
5
- import { TimelineItem as a } from "./components/timeline-item/timeline-item.es.js";
6
- import { TimelineTitle as D } from "./components/timeline-title/timeline-title.es.js";
1
+ import { jsx as N } from "react/jsx-runtime";
2
+ import g from "../../../../../external/classnames/index.es.js";
3
+ import { Children as v, cloneElement as A, isValidElement as C } from "react";
4
+ import { TimelineDescription as D } from "./components/timeline-description/timeline-description.es.js";
5
+ import { TimelineItem as f } from "./components/timeline-item/timeline-item.es.js";
6
+ import { TimelineTitle as M } from "./components/timeline-title/timeline-title.es.js";
7
7
  import p from "./timeline.module.scss.es.js";
8
- const f = (e) => v(e) && e.type === a, I = (e, t) => t === void 0 ? "future" : e === t ? "current" : e < t ? "past" : "future", i = ({
9
- children: e,
10
- activeIndex: t,
8
+ const c = (t) => C(t) && t.type === f, h = (t, i) => i === void 0 ? "future" : t === i ? "current" : t < i ? "past" : "future", o = ({
9
+ children: t,
10
+ activeIndex: i,
11
11
  variant: m = "default",
12
- cardPadding: o,
12
+ cardPadding: n,
13
13
  className: u
14
14
  }) => {
15
- const c = l.toArray(e).filter(f).length;
16
- let n = -1;
17
- const d = l.map(e, (r) => {
18
- if (!f(r)) return r;
19
- n += 1;
20
- const s = n;
21
- return N(r, { state: I(s, t), isLast: s === c - 1 });
22
- }), T = m === "card" && o !== void 0 ? { "--tedi-timeline-card-padding": `${o}rem` } : void 0;
23
- return /* @__PURE__ */ y(
15
+ const s = v.toArray(t), l = s.flatMap((e, r) => c(e) ? [r] : []), d = l.length, y = new Map(l.map((e, r) => [e, r])), T = s.map((e, r) => {
16
+ if (!c(e)) return e;
17
+ const a = y.get(r) ?? 0;
18
+ return A(e, { state: h(a, i), isLast: a === d - 1 });
19
+ }), E = m === "card" && n !== void 0 ? { "--tedi-timeline-card-padding": `${n}rem` } : void 0;
20
+ return /* @__PURE__ */ N(
24
21
  "div",
25
22
  {
26
- className: E(p["tedi-timeline"], { [p["tedi-timeline--card"]]: m === "card" }, u),
27
- style: T,
28
- children: d
23
+ className: g(p["tedi-timeline"], { [p["tedi-timeline--card"]]: m === "card" }, u),
24
+ style: E,
25
+ children: T
29
26
  }
30
27
  );
31
28
  };
32
- i.displayName = "Timeline";
33
- i.Item = a;
34
- i.Title = D;
35
- i.Description = C;
29
+ o.displayName = "Timeline";
30
+ o.Item = f;
31
+ o.Title = M;
32
+ o.Description = D;
36
33
  export {
37
- i as Timeline
34
+ o as Timeline
38
35
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const Q=require("react/jsx-runtime"),t=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),n=require("react"),X=require("./overlay-content.cjs.js"),Y=require("./overlay-trigger.cjs.js"),Z=require("../../../helpers/hooks/use-is-touch-device.cjs.js"),$=require("../../../helpers/hooks/use-is-mounted.cjs.js"),S=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"),D=3,E=n.createContext({open:!1,onOpenChange:()=>{},isMounted:!1,openWith:"hover",reference:()=>{},floating:()=>{},focusManager:{},arrowRef:{current:null},x:0,y:0,strategy:"absolute",getReferenceProps:()=>({}),getFloatingProps:()=>({}),arrow:{width:0,height:0,x:0,y:0,centerOffset:0},placement:"top",context:{},scrollLock:void 0,contentId:""}),u=H=>{const L=Z.useIsTouchDevice(),{children:W,placement:A="top",openWith:s=L?"click":"hover",defaultOpen:G=!1,open:a,onToggle:r,role:d="tooltip",ariaHidden:f=!1,arrowDimensions:e,offset:V=D+((e==null?void 0:e.height)??0),arrowPadding:z=4,focusManager:g,dismissible:O,scrollLock:M,trackReferencePosition:B=!1}=H,{order:m=["reference","content"],initialFocus:x,modal:p,...C}=g??{},F=x!==void 0?x:p?0:void 0,[P,R]=n.useState(G),h=n.useRef(null),b=$.useIsMounted(),v=n.useMemo(()=>r&&typeof a<"u"?a:P,[r,a,P]),y=n.useCallback(l=>{typeof a>"u"&&R(l),r==null||r(l)},[a,R,r]),{x:q,y:I,refs:c,strategy:w,context:o,middlewareData:k,placement:T}=t.useFloating({placement:A,open:v,onOpenChange:y,middleware:[i.offset(V),i.flip(),i.shift({padding:8}),i.arrow({element:h,padding:z})],whileElementsMounted:B?(l,K,N)=>S.autoUpdate(l,K,N,{animationFrame:!0}):S.autoUpdate}),{getReferenceProps:U,getFloatingProps:_}=t.useInteractions([t.useHover(o,{enabled:s==="hover",handleClose:t.safePolygon()}),t.useClick(o,{toggle:O}),t.useFocus(o,{enabled:s==="hover"}),t.useRole(o,{role:d,enabled:!f}),t.useDismiss(o,{enabled:O,outsidePressEvent:s==="click"?"mousedown":"pointerdown"})]),j=n.useId(),J=n.useMemo(()=>({open:v,onOpenChange:y,isMounted:b,openWith:s,focusManager:g?{order:m,modal:p,initialFocus:F,...C}:void 0,reference:c.setReference,floating:c.setFloating,arrowRef:h,x:q,y:I,strategy:w,getReferenceProps:U,getFloatingProps:_,arrow:{width:e==null?void 0:e.width,height:e==null?void 0:e.height,...k.arrow},context:o,placement:T,scrollLock:M,role:d,ariaHidden:f,contentId:j}),[v,y,b,s,g,c.setReference,c.setFloating,h,q,I,w,U,_,e==null?void 0:e.width,e==null?void 0:e.height,k.arrow,o,T,M,d,f,j,p,m,F,C]);return Q.jsx(E.Provider,{value:J,children:W})};u.Trigger=Y.OverlayTrigger;u.Content=X.OverlayContent;exports.Overlay=u;exports.OverlayContext=E;exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const Q=require("react/jsx-runtime"),t=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),n=require("react"),X=require("./overlay-content.cjs.js"),Y=require("./overlay-trigger.cjs.js"),Z=require("../../../helpers/hooks/use-is-touch-device.cjs.js"),$=require("../../../helpers/hooks/use-is-mounted.cjs.js"),S=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"),D=3,E=n.createContext({open:!1,onOpenChange:()=>{},isMounted:!1,openWith:"hover",reference:()=>{},floating:()=>{},focusManager:{},arrowRef:{current:null},x:0,y:0,strategy:"absolute",getReferenceProps:()=>({}),getFloatingProps:()=>({}),arrow:{width:0,height:0,x:0,y:0,centerOffset:0},placement:"top",context:{},scrollLock:void 0,contentId:""}),u=H=>{const L=Z.useIsTouchDevice(),{children:W,placement:A="top",openWith:r=L?"click":"hover",defaultOpen:G=!1,open:a,onToggle:s,role:d="tooltip",ariaHidden:f=!1,arrowDimensions:e,offset:V=D+((e==null?void 0:e.height)??0),arrowPadding:z=4,focusManager:g,dismissible:O,scrollLock:M,trackReferencePosition:B=!1}=H,{order:m=["reference","content"],initialFocus:x,modal:p,...C}=g??{},F=x!==void 0?x:p?0:void 0,[P,R]=n.useState(G),h=n.useRef(null),b=$.useIsMounted(),v=n.useMemo(()=>s&&typeof a<"u"?a:P,[s,a,P]),y=n.useCallback(l=>{typeof a>"u"&&R(l),s==null||s(l)},[a,R,s]),{x:q,y:I,refs:c,strategy:k,context:o,middlewareData:w,placement:T}=t.useFloating({placement:A,open:v,onOpenChange:y,middleware:[i.offset(V),i.flip(),i.shift({padding:8}),i.arrow({element:h,padding:z})],whileElementsMounted:B?(l,K,N)=>S.autoUpdate(l,K,N,{animationFrame:!0}):S.autoUpdate}),{getReferenceProps:U,getFloatingProps:_}=t.useInteractions([t.useHover(o,{enabled:r==="hover",handleClose:t.safePolygon()}),t.useClick(o,{enabled:r==="click",toggle:O}),t.useFocus(o,{enabled:r==="hover"}),t.useRole(o,{role:d,enabled:!f}),t.useDismiss(o,{enabled:O,outsidePressEvent:r==="click"?"mousedown":"pointerdown"})]),j=n.useId(),J=n.useMemo(()=>({open:v,onOpenChange:y,isMounted:b,openWith:r,focusManager:g?{order:m,modal:p,initialFocus:F,...C}:void 0,reference:c.setReference,floating:c.setFloating,arrowRef:h,x:q,y:I,strategy:k,getReferenceProps:U,getFloatingProps:_,arrow:{width:e==null?void 0:e.width,height:e==null?void 0:e.height,...w.arrow},context:o,placement:T,scrollLock:M,role:d,ariaHidden:f,contentId:j}),[v,y,b,r,g,c.setReference,c.setFloating,h,q,I,k,U,_,e==null?void 0:e.width,e==null?void 0:e.height,w.arrow,o,T,M,d,f,j,p,m,F,C]);return Q.jsx(E.Provider,{value:J,children:W})};u.Trigger=Y.OverlayTrigger;u.Content=X.OverlayContent;exports.Overlay=u;exports.OverlayContext=E;exports.default=u;
@@ -1,8 +1,8 @@
1
1
  import { jsx as K } from "react/jsx-runtime";
2
2
  import { useFloating as N, useInteractions as Q, useHover as X, safePolygon as Y, useClick as Z, useFocus as _, useRole as $, useDismiss as D } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
3
3
  import { useState as ee, useRef as te, useMemo as E, useCallback as oe, useId as ne, createContext as re } from "react";
4
- import { OverlayContent as se } from "./overlay-content.es.js";
5
- import { OverlayTrigger as ae } from "./overlay-trigger.es.js";
4
+ import { OverlayContent as ae } from "./overlay-content.es.js";
5
+ import { OverlayTrigger as se } from "./overlay-trigger.es.js";
6
6
  import { useIsTouchDevice as le } from "../../../helpers/hooks/use-is-touch-device.es.js";
7
7
  import { useIsMounted as ce } from "../../../helpers/hooks/use-is-mounted.es.js";
8
8
  import { autoUpdate as H } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
@@ -39,10 +39,10 @@ const pe = 3, ge = re({
39
39
  const j = le(), {
40
40
  children: A,
41
41
  placement: G = "top",
42
- openWith: n = j ? "click" : "hover",
42
+ openWith: o = j ? "click" : "hover",
43
43
  defaultOpen: S = !1,
44
44
  open: r,
45
- onToggle: o,
45
+ onToggle: n,
46
46
  role: l = "tooltip",
47
47
  ariaHidden: c = !1,
48
48
  arrowDimensions: e,
@@ -52,12 +52,12 @@ const pe = 3, ge = re({
52
52
  dismissible: g,
53
53
  scrollLock: h,
54
54
  trackReferencePosition: q = !1
55
- } = W, { order: m = ["reference", "content"], initialFocus: v, modal: f, ...y } = i ?? {}, O = v !== void 0 ? v : f ? 0 : void 0, [x, F] = ee(S), d = te(null), P = ce(), u = E(() => o && typeof r < "u" ? r : x, [o, r, x]), p = oe(
56
- (a) => {
57
- typeof r > "u" && F(a), o == null || o(a);
55
+ } = W, { order: m = ["reference", "content"], initialFocus: v, modal: f, ...y } = i ?? {}, O = v !== void 0 ? v : f ? 0 : void 0, [x, F] = ee(S), d = te(null), P = ce(), u = E(() => n && typeof r < "u" ? r : x, [n, r, x]), p = oe(
56
+ (s) => {
57
+ typeof r > "u" && F(s), n == null || n(s);
58
58
  },
59
- [r, F, o]
60
- ), { x: C, y: M, refs: s, strategy: R, context: t, middlewareData: w, placement: b } = N({
59
+ [r, F, n]
60
+ ), { x: C, y: M, refs: a, strategy: R, context: t, middlewareData: b, placement: k } = N({
61
61
  placement: G,
62
62
  open: u,
63
63
  onOpenChange: p,
@@ -70,50 +70,51 @@ const pe = 3, ge = re({
70
70
  padding: V
71
71
  })
72
72
  ],
73
- whileElementsMounted: q ? (a, B, J) => H(a, B, J, { animationFrame: !0 }) : H
74
- }), { getReferenceProps: k, getFloatingProps: I } = Q([
73
+ whileElementsMounted: q ? (s, B, J) => H(s, B, J, { animationFrame: !0 }) : H
74
+ }), { getReferenceProps: w, getFloatingProps: I } = Q([
75
75
  X(t, {
76
- enabled: n === "hover",
76
+ enabled: o === "hover",
77
77
  handleClose: Y()
78
78
  }),
79
79
  Z(t, {
80
+ enabled: o === "click",
80
81
  toggle: g
81
82
  }),
82
83
  _(t, {
83
- enabled: n === "hover"
84
+ enabled: o === "hover"
84
85
  }),
85
86
  $(t, { role: l, enabled: !c }),
86
87
  D(t, {
87
88
  enabled: g,
88
- outsidePressEvent: n === "click" ? "mousedown" : "pointerdown"
89
+ outsidePressEvent: o === "click" ? "mousedown" : "pointerdown"
89
90
  })
90
91
  ]), T = ne(), z = E(
91
92
  () => ({
92
93
  open: u,
93
94
  onOpenChange: p,
94
95
  isMounted: P,
95
- openWith: n,
96
+ openWith: o,
96
97
  focusManager: i ? {
97
98
  order: m,
98
99
  modal: f,
99
100
  initialFocus: O,
100
101
  ...y
101
102
  } : void 0,
102
- reference: s.setReference,
103
- floating: s.setFloating,
103
+ reference: a.setReference,
104
+ floating: a.setFloating,
104
105
  arrowRef: d,
105
106
  x: C,
106
107
  y: M,
107
108
  strategy: R,
108
- getReferenceProps: k,
109
+ getReferenceProps: w,
109
110
  getFloatingProps: I,
110
111
  arrow: {
111
112
  width: e == null ? void 0 : e.width,
112
113
  height: e == null ? void 0 : e.height,
113
- ...w.arrow
114
+ ...b.arrow
114
115
  },
115
116
  context: t,
116
- placement: b,
117
+ placement: k,
117
118
  scrollLock: h,
118
119
  role: l,
119
120
  ariaHidden: c,
@@ -123,21 +124,21 @@ const pe = 3, ge = re({
123
124
  u,
124
125
  p,
125
126
  P,
126
- n,
127
+ o,
127
128
  i,
128
- s.setReference,
129
- s.setFloating,
129
+ a.setReference,
130
+ a.setFloating,
130
131
  d,
131
132
  C,
132
133
  M,
133
134
  R,
134
- k,
135
+ w,
135
136
  I,
136
137
  e == null ? void 0 : e.width,
137
138
  e == null ? void 0 : e.height,
138
- w.arrow,
139
+ b.arrow,
139
140
  t,
140
- b,
141
+ k,
141
142
  h,
142
143
  l,
143
144
  c,
@@ -150,8 +151,8 @@ const pe = 3, ge = re({
150
151
  );
151
152
  return /* @__PURE__ */ K(ge.Provider, { value: z, children: A });
152
153
  };
153
- L.Trigger = ae;
154
- L.Content = se;
154
+ L.Trigger = se;
155
+ L.Content = ae;
155
156
  export {
156
157
  L as Overlay,
157
158
  ge as OverlayContext,