@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.
- package/bundle-stats.html +1 -1
- package/community.cjs.js +1 -1
- package/community.es.js +215 -230
- package/external/@mui/x-date-pickers/DatePicker/shared.es.js +1 -1
- package/external/@mui/x-date-pickers/DateTimePicker/shared.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/community/components/accordion/accordion.cjs.js +1 -1
- package/src/community/components/accordion/accordion.es.js +14 -9
- package/src/community/components/card/card-notification/card-notification.cjs.js +1 -1
- package/src/community/components/card/card-notification/card-notification.es.js +10 -8
- package/src/community/components/dropdown/dropdown.cjs.js +1 -1
- package/src/community/components/dropdown/dropdown.es.js +34 -32
- package/src/community/components/form/file-upload/file-upload.cjs.js +1 -1
- package/src/community/components/form/file-upload/file-upload.es.js +43 -41
- package/src/community/components/form/pickers/calendar/calendar.cjs.js +1 -1
- package/src/community/components/form/pickers/calendar/calendar.es.js +41 -39
- package/src/community/components/form/pickers/timepicker/timepicker.cjs.js +1 -1
- package/src/community/components/form/pickers/timepicker/timepicker.es.js +33 -31
- package/src/community/components/form/toggle/toggle.cjs.js +1 -1
- package/src/community/components/form/toggle/toggle.es.js +30 -28
- package/src/community/components/map-components/carousel/carousel.cjs.js +1 -1
- package/src/community/components/map-components/carousel/carousel.es.js +19 -17
- package/src/community/components/status/status.cjs.js +1 -1
- package/src/community/components/status/status.es.js +14 -12
- package/src/community/components/stepper/stepper.cjs.js +1 -1
- package/src/community/components/stepper/stepper.es.js +33 -31
- package/src/community/components/table/table.cjs.js +1 -1
- package/src/community/components/table/table.es.js +9 -9
- package/src/community/components/table-of-contents/table-of-contents.cjs.js +1 -1
- package/src/community/components/table-of-contents/table-of-contents.es.js +21 -19
- package/src/community/components/tabs/tabs/tabs.cjs.js +1 -1
- package/src/community/components/tabs/tabs/tabs.es.js +29 -27
- package/src/community/components/vertical-stepper/vertical-stepper.cjs.js +1 -1
- package/src/community/components/vertical-stepper/vertical-stepper.es.js +8 -6
- package/src/community/deprecated-exports.cjs.js +1 -0
- package/src/community/deprecated-exports.d.ts +19 -0
- package/src/community/deprecated-exports.es.js +112 -0
- package/src/community/index.d.ts +1 -0
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.cjs.js +1 -1
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.d.ts +1 -1
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.es.js +28 -27
- package/src/tedi/components/layout/mobile-nav/mobile-nav.cjs.js +1 -1
- package/src/tedi/components/layout/mobile-nav/mobile-nav.d.ts +1 -1
- package/src/tedi/components/layout/mobile-nav/mobile-nav.es.js +64 -63
- package/src/tedi/helpers/warn-deprecated/warn-deprecated.cjs.js +1 -0
- package/src/tedi/helpers/warn-deprecated/warn-deprecated.d.ts +12 -0
- package/src/tedi/helpers/warn-deprecated/warn-deprecated.es.js +11 -0
|
@@ -1,67 +1,69 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import s from "react";
|
|
3
|
+
import { warnDeprecated as O } from "../../../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
3
4
|
import S from "../mui-input-transition/mui-input-transition.es.js";
|
|
4
5
|
import { TimePicker as V } from "../../../../../../external/@mui/x-date-pickers/TimePicker/TimePicker.es.js";
|
|
5
|
-
const
|
|
6
|
+
const E = (d) => {
|
|
7
|
+
O("Community TimePicker", "Use `TimeField` from `@tedi-design-system/react/tedi` instead.");
|
|
6
8
|
const {
|
|
7
9
|
defaultValue: p,
|
|
8
10
|
onChange: n,
|
|
9
|
-
value:
|
|
11
|
+
value: t,
|
|
10
12
|
disabled: f,
|
|
11
|
-
readOnly:
|
|
12
|
-
inputFormat:
|
|
13
|
+
readOnly: a,
|
|
14
|
+
inputFormat: l = "HH:mm",
|
|
13
15
|
toolbarTitle: c,
|
|
14
16
|
maxTime: T,
|
|
15
17
|
minTime: k,
|
|
16
|
-
minutesStep:
|
|
18
|
+
minutesStep: y = 1,
|
|
17
19
|
onError: C,
|
|
18
|
-
shouldDisableTime:
|
|
19
|
-
views:
|
|
20
|
-
ampm:
|
|
20
|
+
shouldDisableTime: P,
|
|
21
|
+
views: x = ["hours", "minutes"],
|
|
22
|
+
ampm: H = !1,
|
|
21
23
|
onClose: r,
|
|
22
|
-
...
|
|
23
|
-
} = d, [
|
|
24
|
-
!(e != null && e.isValid()) && e !== null || (typeof
|
|
24
|
+
...v
|
|
25
|
+
} = d, [m, I] = s.useState(p || null), [b, i] = s.useState(!1), g = s.useMemo(() => n && typeof t < "u" ? t : m, [m, n, t]), o = (e) => {
|
|
26
|
+
!(e != null && e.isValid()) && e !== null || (typeof t > "u" && I(e), n == null || n(e));
|
|
25
27
|
};
|
|
26
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ u(
|
|
27
29
|
V,
|
|
28
30
|
{
|
|
29
31
|
"data-name": "timepicker",
|
|
30
|
-
value:
|
|
31
|
-
onChange:
|
|
32
|
+
value: g,
|
|
33
|
+
onChange: o,
|
|
32
34
|
open: b,
|
|
33
|
-
onOpen: () =>
|
|
35
|
+
onOpen: () => i(!0),
|
|
34
36
|
onClose: () => {
|
|
35
|
-
|
|
37
|
+
i(!1), r == null || r();
|
|
36
38
|
},
|
|
37
|
-
renderInput: (e) => /* @__PURE__ */
|
|
39
|
+
renderInput: (e) => /* @__PURE__ */ u(
|
|
38
40
|
S,
|
|
39
41
|
{
|
|
40
42
|
muiTextfieldProps: e,
|
|
41
|
-
inputFormat:
|
|
42
|
-
onChangeHandler:
|
|
43
|
+
inputFormat: l,
|
|
44
|
+
onChangeHandler: o,
|
|
43
45
|
textfieldProps: {
|
|
44
|
-
...
|
|
45
|
-
onClear: () =>
|
|
46
|
-
onIconClick:
|
|
46
|
+
...v,
|
|
47
|
+
onClear: () => o(null),
|
|
48
|
+
onIconClick: a ? void 0 : () => i((h) => !h)
|
|
47
49
|
},
|
|
48
50
|
type: "time"
|
|
49
51
|
}
|
|
50
52
|
),
|
|
51
53
|
disabled: f,
|
|
52
|
-
readOnly:
|
|
53
|
-
inputFormat:
|
|
54
|
+
readOnly: a,
|
|
55
|
+
inputFormat: l,
|
|
54
56
|
toolbarTitle: c,
|
|
55
57
|
maxTime: T,
|
|
56
58
|
minTime: k,
|
|
57
|
-
minutesStep:
|
|
59
|
+
minutesStep: y,
|
|
58
60
|
onError: C,
|
|
59
|
-
shouldDisableTime:
|
|
60
|
-
views:
|
|
61
|
-
ampm:
|
|
61
|
+
shouldDisableTime: P,
|
|
62
|
+
views: x,
|
|
63
|
+
ampm: H
|
|
62
64
|
}
|
|
63
65
|
);
|
|
64
66
|
};
|
|
65
67
|
export {
|
|
66
|
-
|
|
68
|
+
E as TimePicker
|
|
67
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),x=require("../../../../../external/classnames/index.cjs.js"),i=require("react")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),x=require("../../../../../external/classnames/index.cjs.js"),i=require("react"),$=require("../../../../tedi/components/base/icon/icon.cjs.js"),z=require("../../../../tedi/components/loaders/spinner/spinner.cjs.js"),B=require("../../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),k=require("../../button/button.cjs.js"),e=require("./toggle.module.scss.cjs.js"),y=i.forwardRef((c,C)=>{B.warnDeprecated("Community Toggle","Use `Toggle` from `@tedi-design-system/react/tedi` instead.");const{ariaLabel:j,className:N,checked:n,defaultChecked:q,onChange:a,size:r=c.icon?"large":"medium",color:T="default",type:g,icon:w,disabled:u=!1,isLoading:d=!1,extraContent:f,label:m,...l}=c,[p,S]=i.useState(q||!1),o=i.useMemo(()=>a&&typeof n<"u"?n:p,[a,p,n]),v=x.default(e.default.toggle,e.default[`toggle--${r}`],e.default[`toggle--${T}`],{[e.default["toggle--active"]]:o,[e.default["toggle--disabled"]]:u,[e.default[`toggle--${g}`]]:g},N),_=()=>{if(d)return;const s=!o;typeof n>"u"&&S(s),a==null||a(s)},h={noStyle:!0,type:"button","aria-label":j,"aria-pressed":o,disabled:u,"aria-disabled":d,...l,onClick:_};return t.jsxs("div",{className:e.default["toggle-wrapper"],children:[t.jsx(k.Button,{...h,onClick:s=>{var b;(b=l==null?void 0:l.onClick)==null||b.call(l,s),_()},ref:C,"data-name":"toggle",className:v,children:t.jsx("span",{className:e.default.toggle__dot,children:d?t.jsx(z.Spinner,{size:r==="large"?16:10,className:x.default(e.default.toggle__icon,e.default.toggle__spinner)}):w?t.jsx($.Icon,{className:e.default.toggle__icon,name:o?"lock_open_right":"lock",size:16}):null})}),m&&t.jsx(k.Button,{...h,className:e.default.toggle__label,"aria-hidden":!0,tabIndex:-1,children:m}),f&&t.jsx("div",{className:e.default["toggle__extra-content"],children:f})]})});y.displayName="Toggle";exports.Toggle=y;
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as S, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import k from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import b, { forwardRef as $ } from "react";
|
|
4
4
|
import { Icon as j } from "../../../../tedi/components/base/icon/icon.es.js";
|
|
5
5
|
import { Spinner as B } from "../../../../tedi/components/loaders/spinner/spinner.es.js";
|
|
6
|
-
import {
|
|
6
|
+
import { warnDeprecated as L } from "../../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
7
|
+
import { Button as C } from "../../button/button.es.js";
|
|
7
8
|
import e from "./toggle.module.scss.es.js";
|
|
8
|
-
const
|
|
9
|
+
const M = $((r, N) => {
|
|
10
|
+
L("Community Toggle", "Use `Toggle` from `@tedi-design-system/react/tedi` instead.");
|
|
9
11
|
const {
|
|
10
12
|
ariaLabel: y,
|
|
11
13
|
className: x,
|
|
12
|
-
checked:
|
|
13
|
-
defaultChecked:
|
|
14
|
-
onChange:
|
|
14
|
+
checked: l,
|
|
15
|
+
defaultChecked: T,
|
|
16
|
+
onChange: a,
|
|
15
17
|
size: c = r.icon ? "large" : "medium",
|
|
16
18
|
color: w = "default",
|
|
17
19
|
type: g,
|
|
18
|
-
icon:
|
|
20
|
+
icon: v,
|
|
19
21
|
disabled: d = !1,
|
|
20
|
-
isLoading:
|
|
22
|
+
isLoading: s = !1,
|
|
21
23
|
extraContent: m,
|
|
22
24
|
label: f,
|
|
23
|
-
...
|
|
24
|
-
} = r, [p,
|
|
25
|
+
...t
|
|
26
|
+
} = r, [p, z] = b.useState(T || !1), n = b.useMemo(() => a && typeof l < "u" ? l : p, [a, p, l]), I = k(
|
|
25
27
|
e.toggle,
|
|
26
28
|
e[`toggle--${c}`],
|
|
27
29
|
e[`toggle--${w}`],
|
|
@@ -32,46 +34,46 @@ const L = $((r, C) => {
|
|
|
32
34
|
},
|
|
33
35
|
x
|
|
34
36
|
), u = () => {
|
|
35
|
-
if (
|
|
37
|
+
if (s)
|
|
36
38
|
return;
|
|
37
|
-
const
|
|
38
|
-
typeof
|
|
39
|
+
const i = !n;
|
|
40
|
+
typeof l > "u" && z(i), a == null || a(i);
|
|
39
41
|
}, _ = {
|
|
40
42
|
noStyle: !0,
|
|
41
43
|
type: "button",
|
|
42
44
|
"aria-label": y,
|
|
43
45
|
"aria-pressed": n,
|
|
44
46
|
disabled: d,
|
|
45
|
-
"aria-disabled":
|
|
46
|
-
...
|
|
47
|
+
"aria-disabled": s,
|
|
48
|
+
...t,
|
|
47
49
|
onClick: u
|
|
48
50
|
};
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
51
|
+
return /* @__PURE__ */ S("div", { className: e["toggle-wrapper"], children: [
|
|
52
|
+
/* @__PURE__ */ o(
|
|
53
|
+
C,
|
|
52
54
|
{
|
|
53
55
|
..._,
|
|
54
|
-
onClick: (
|
|
56
|
+
onClick: (i) => {
|
|
55
57
|
var h;
|
|
56
|
-
(h =
|
|
58
|
+
(h = t == null ? void 0 : t.onClick) == null || h.call(t, i), u();
|
|
57
59
|
},
|
|
58
|
-
ref:
|
|
60
|
+
ref: N,
|
|
59
61
|
"data-name": "toggle",
|
|
60
|
-
className:
|
|
61
|
-
children: /* @__PURE__ */
|
|
62
|
+
className: I,
|
|
63
|
+
children: /* @__PURE__ */ o("span", { className: e.toggle__dot, children: s ? /* @__PURE__ */ o(
|
|
62
64
|
B,
|
|
63
65
|
{
|
|
64
66
|
size: c === "large" ? 16 : 10,
|
|
65
67
|
className: k(e.toggle__icon, e.toggle__spinner)
|
|
66
68
|
}
|
|
67
|
-
) :
|
|
69
|
+
) : v ? /* @__PURE__ */ o(j, { className: e.toggle__icon, name: n ? "lock_open_right" : "lock", size: 16 }) : null })
|
|
68
70
|
}
|
|
69
71
|
),
|
|
70
|
-
f && /* @__PURE__ */
|
|
71
|
-
m && /* @__PURE__ */
|
|
72
|
+
f && /* @__PURE__ */ o(C, { ..._, className: e.toggle__label, "aria-hidden": !0, tabIndex: -1, children: f }),
|
|
73
|
+
m && /* @__PURE__ */ o("div", { className: e["toggle__extra-content"], children: m })
|
|
72
74
|
] });
|
|
73
75
|
});
|
|
74
|
-
|
|
76
|
+
M.displayName = "Toggle";
|
|
75
77
|
export {
|
|
76
|
-
|
|
78
|
+
M as Toggle
|
|
77
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("../../../../../external/classnames/index.cjs.js"),c=require("react"),d=require("../../../../tedi/components/buttons/floating-button/floating-button.cjs.js"),e=require("./carousel.module.scss.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("../../../../../external/classnames/index.cjs.js"),c=require("react"),d=require("../../../../tedi/components/buttons/floating-button/floating-button.cjs.js"),y=require("../../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),e=require("./carousel.module.scss.cjs.js"),p=u=>{y.warnDeprecated("Community Carousel","Use `Carousel` from `@tedi-design-system/react/tedi` instead.");const{itemCountShown:l,children:m,className:f}=u,[s,r]=c.useState(0),n=c.Children.toArray(m),o=n.length,_=()=>{s+l<o&&r(a=>a+1)},x=()=>{s>0&&r(a=>a-1)},v=`translateX(-${100/l*s}%)`;return t.jsxs("div",{className:`${e.default["tedi-carousel__wrapper"]} ${f??""}`,children:[t.jsx(d.FloatingButton,{className:i.default(e.default["tedi-carousel__navigation-button"],e.default["tedi-carousel__prev"]),onClick:x,visualType:"secondary",disabled:s===0,icon:"west",children:"Prev"}),t.jsx("div",{className:e.default["tedi-carousel__viewport"],children:t.jsx("div",{className:e.default["tedi-carousel__carousel-track"],style:{transform:v},children:n.map((a,h)=>t.jsx("div",{className:e.default["tedi-carousel__item"],style:{flex:`0 0 ${100/l}%`},children:a},h))})}),t.jsx(d.FloatingButton,{className:i.default(e.default["tedi-carousel__navigation-button"],e.default["tedi-carousel__next"]),onClick:_,visualType:"secondary",disabled:s+l>=o,icon:"east",children:"Next"})]})};exports.Carousel=p;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { FloatingButton as
|
|
1
|
+
import { jsxs as v, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import n from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import y, { useState as N } from "react";
|
|
4
|
+
import { FloatingButton as c } from "../../../../tedi/components/buttons/floating-button/floating-button.es.js";
|
|
5
|
+
import { warnDeprecated as x } from "../../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
5
6
|
import e from "./carousel.module.scss.es.js";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const I = (d) => {
|
|
8
|
+
x("Community Carousel", "Use `Carousel` from `@tedi-design-system/react/tedi` instead.");
|
|
9
|
+
const { itemCountShown: r, children: m, className: u } = d, [t, o] = N(0), i = y.Children.toArray(m), l = i.length, _ = () => {
|
|
10
|
+
t + r < l && o((s) => s + 1);
|
|
9
11
|
}, p = () => {
|
|
10
|
-
t > 0 &&
|
|
11
|
-
},
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
t > 0 && o((s) => s - 1);
|
|
13
|
+
}, f = `translateX(-${100 / r * t}%)`;
|
|
14
|
+
return /* @__PURE__ */ v("div", { className: `${e["tedi-carousel__wrapper"]} ${u ?? ""}`, children: [
|
|
13
15
|
/* @__PURE__ */ a(
|
|
14
|
-
|
|
16
|
+
c,
|
|
15
17
|
{
|
|
16
|
-
className:
|
|
18
|
+
className: n(e["tedi-carousel__navigation-button"], e["tedi-carousel__prev"]),
|
|
17
19
|
onClick: p,
|
|
18
20
|
visualType: "secondary",
|
|
19
21
|
disabled: t === 0,
|
|
@@ -21,14 +23,14 @@ const $ = (d) => {
|
|
|
21
23
|
children: "Prev"
|
|
22
24
|
}
|
|
23
25
|
),
|
|
24
|
-
/* @__PURE__ */ a("div", { className: e["tedi-carousel__viewport"], children: /* @__PURE__ */ a("div", { className: e["tedi-carousel__carousel-track"], style: { transform:
|
|
26
|
+
/* @__PURE__ */ a("div", { className: e["tedi-carousel__viewport"], children: /* @__PURE__ */ a("div", { className: e["tedi-carousel__carousel-track"], style: { transform: f }, children: i.map((s, h) => /* @__PURE__ */ a("div", { className: e["tedi-carousel__item"], style: { flex: `0 0 ${100 / r}%` }, children: s }, h)) }) }),
|
|
25
27
|
/* @__PURE__ */ a(
|
|
26
|
-
|
|
28
|
+
c,
|
|
27
29
|
{
|
|
28
|
-
className:
|
|
30
|
+
className: n(e["tedi-carousel__navigation-button"], e["tedi-carousel__next"]),
|
|
29
31
|
onClick: _,
|
|
30
32
|
visualType: "secondary",
|
|
31
|
-
disabled: t +
|
|
33
|
+
disabled: t + r >= l,
|
|
32
34
|
icon: "east",
|
|
33
35
|
children: "Next"
|
|
34
36
|
}
|
|
@@ -36,5 +38,5 @@ const $ = (d) => {
|
|
|
36
38
|
] });
|
|
37
39
|
};
|
|
38
40
|
export {
|
|
39
|
-
|
|
41
|
+
I as Carousel
|
|
40
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("../../../../external/classnames/index.cjs.js"),d=require("../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),e=require("./status.module.scss.cjs.js"),l=require("../tooltip/tooltip-provider.cjs.js"),m=require("../tooltip/tooltip-trigger.cjs.js"),p=require("../tooltip/tooltip.cjs.js"),j=r=>{d.warnDeprecated("Community Status","Use `StatusIndicator` from `@tedi-design-system/react/tedi` instead.");const{children:a,type:i,className:o,tooltipContent:s,...u}=r,c=n.default(e.default.status,o,e.default[`status--${i}`]);return t.jsxs("div",{"data-name":"status",...u,className:c,children:[s?t.jsxs(l.TooltipProvider,{children:[t.jsx(m.TooltipTrigger,{children:t.jsx("div",{className:e.default.status__circle})}),t.jsx(p.Tooltip,{children:s})]}):t.jsx("div",{className:e.default.status__circle}),t.jsx("div",{className:e.default.status__content,children:a})]})};exports.Status=j;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import l from "../../../../external/classnames/index.es.js";
|
|
3
|
+
import { warnDeprecated as d } from "../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
3
4
|
import s from "./status.module.scss.es.js";
|
|
4
5
|
import { TooltipProvider as p } from "../tooltip/tooltip-provider.es.js";
|
|
5
|
-
import { TooltipTrigger as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/* @__PURE__ */ t(u, { children:
|
|
6
|
+
import { TooltipTrigger as u } from "../tooltip/tooltip-trigger.es.js";
|
|
7
|
+
import { Tooltip as f } from "../tooltip/tooltip.es.js";
|
|
8
|
+
const g = (o) => {
|
|
9
|
+
d("Community Status", "Use `StatusIndicator` from `@tedi-design-system/react/tedi` instead.");
|
|
10
|
+
const { children: a, type: i, className: m, tooltipContent: r, ...c } = o, n = l(s.status, m, s[`status--${i}`]);
|
|
11
|
+
return /* @__PURE__ */ e("div", { "data-name": "status", ...c, className: n, children: [
|
|
12
|
+
r ? /* @__PURE__ */ e(p, { children: [
|
|
13
|
+
/* @__PURE__ */ t(u, { children: /* @__PURE__ */ t("div", { className: s.status__circle }) }),
|
|
14
|
+
/* @__PURE__ */ t(f, { children: r })
|
|
13
15
|
] }) : /* @__PURE__ */ t("div", { className: s.status__circle }),
|
|
14
|
-
/* @__PURE__ */ t("div", { className: s.status__content, children:
|
|
16
|
+
/* @__PURE__ */ t("div", { className: s.status__content, children: a })
|
|
15
17
|
] });
|
|
16
18
|
};
|
|
17
19
|
export {
|
|
18
|
-
|
|
20
|
+
g as Status
|
|
19
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),P=require("../../../../external/classnames/index.cjs.js"),t=require("react"),V=require("../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),b=require("./step.cjs.js"),g=require("./stepper.module.scss.cjs.js"),D=require("./stepper-context.cjs.js"),j=require("./stepper-nav.cjs.js"),I=require("../card/card.cjs.js"),R=require("../card/card-header/card-header.cjs.js"),z=require("../card/card-content/card-content.cjs.js"),B=a=>{V.warnDeprecated("Community Stepper","Use `HorizontalStepper` from `@tedi-design-system/react/tedi` instead.");const{activeStep:n,defaultActiveStep:h,onActiveStepChange:s,allowStepLabelClick:d=!0,children:y,className:l,ariaLabel:u,completedLabel:m,notCompletedLabel:S,card:c}=a,[C,N]=t.useState(h||0),o=t.useCallback((e=a.activeStep)=>typeof e<"u",[a.activeStep]),v=t.useCallback(e=>{s==null||s(e),o(n)||N(e)},[n,o,s]),f=t.useMemo(()=>o(n)?n:C,[n,C,o]),p=t.Children.map(y,e=>t.isValidElement(e)&&e.type===b.Step?e:null),q=p==null?void 0:p.map((e,i)=>t.cloneElement(e,{key:i,index:i,...e.props})),x=()=>t.Children.toArray(a.children).filter(e=>t.isValidElement(e)&&e.type===b.Step).map((e,i)=>{const{label:E,completed:L,id:M,showCompletedIcon:H}=e.props;return{label:E,completed:!!L,index:i,id:M,showCompletedIcon:H}}),k=t.useMemo(()=>({activeStep:f,handleActiveStepChange:v,allowStepLabelClick:d}),[d,f,v]),w=P.default(g.default.stepper,l,{[g.default["stepper--card"]]:!!c}),A=()=>{if(c){const e=c===!0?{}:c;return r.jsxs(I.Card,{padding:1.5,...e,"data-name":"stepper",className:w,children:[r.jsx(R.CardHeader,{padding:0,background:"white",children:r.jsx(j.StepperNav,{items:x(),ariaLabel:u,completedLabel:m,notCompletedLabel:S})}),r.jsx(z.CardContent,{children:q})]})}return r.jsxs("div",{"data-name":"stepper",className:l,children:[r.jsx(j.StepperNav,{items:x(),ariaLabel:u,completedLabel:m,notCompletedLabel:S}),q]})};return r.jsx(D.StepperContext.Provider,{value:k,children:A()})};exports.Stepper=B;
|
|
@@ -1,50 +1,52 @@
|
|
|
1
1
|
import { jsx as o, jsxs as g } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import I from "../../../../external/classnames/index.es.js";
|
|
3
3
|
import t from "react";
|
|
4
|
-
import {
|
|
5
|
-
import y from "./
|
|
6
|
-
import
|
|
4
|
+
import { warnDeprecated as _ } from "../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
5
|
+
import { Step as y } from "./step.es.js";
|
|
6
|
+
import k from "./stepper.module.scss.es.js";
|
|
7
|
+
import { StepperContext as z } from "./stepper-context.es.js";
|
|
7
8
|
import { StepperNav as N } from "./stepper-nav.es.js";
|
|
8
|
-
import { Card as
|
|
9
|
-
import { CardHeader as
|
|
10
|
-
import { CardContent as
|
|
11
|
-
const
|
|
9
|
+
import { Card as B } from "../card/card.es.js";
|
|
10
|
+
import { CardHeader as D } from "../card/card-header/card-header.es.js";
|
|
11
|
+
import { CardContent as R } from "../card/card-content/card-content.es.js";
|
|
12
|
+
const Y = (a) => {
|
|
13
|
+
_("Community Stepper", "Use `HorizontalStepper` from `@tedi-design-system/react/tedi` instead.");
|
|
12
14
|
const {
|
|
13
15
|
activeStep: r,
|
|
14
16
|
defaultActiveStep: x,
|
|
15
17
|
onActiveStepChange: n,
|
|
16
|
-
allowStepLabelClick:
|
|
18
|
+
allowStepLabelClick: c = !0,
|
|
17
19
|
children: A,
|
|
18
|
-
className:
|
|
20
|
+
className: l,
|
|
19
21
|
ariaLabel: d,
|
|
20
22
|
completedLabel: u,
|
|
21
23
|
notCompletedLabel: f,
|
|
22
24
|
card: p
|
|
23
|
-
} = a, [C, E] = t.useState(x || 0),
|
|
25
|
+
} = a, [C, E] = t.useState(x || 0), i = t.useCallback(
|
|
24
26
|
(e = a.activeStep) => typeof e < "u",
|
|
25
27
|
[a.activeStep]
|
|
26
28
|
), S = t.useCallback(
|
|
27
29
|
(e) => {
|
|
28
|
-
n == null || n(e),
|
|
30
|
+
n == null || n(e), i(r) || E(e);
|
|
29
31
|
},
|
|
30
|
-
[r,
|
|
32
|
+
[r, i, n]
|
|
31
33
|
), v = t.useMemo(
|
|
32
|
-
() =>
|
|
33
|
-
[r, C,
|
|
34
|
-
),
|
|
35
|
-
key:
|
|
36
|
-
index:
|
|
34
|
+
() => i(r) ? r : C,
|
|
35
|
+
[r, C, i]
|
|
36
|
+
), m = t.Children.map(A, (e) => t.isValidElement(e) && e.type === y ? e : null), b = m == null ? void 0 : m.map((e, s) => t.cloneElement(e, {
|
|
37
|
+
key: s,
|
|
38
|
+
index: s,
|
|
37
39
|
...e.props
|
|
38
|
-
})), h = () => t.Children.toArray(a.children).filter((e) => t.isValidElement(e) && e.type ===
|
|
39
|
-
const { label:
|
|
40
|
-
return { label:
|
|
40
|
+
})), h = () => t.Children.toArray(a.children).filter((e) => t.isValidElement(e) && e.type === y).map((e, s) => {
|
|
41
|
+
const { label: P, completed: V, id: j, showCompletedIcon: H } = e.props;
|
|
42
|
+
return { label: P, completed: !!V, index: s, id: j, showCompletedIcon: H };
|
|
41
43
|
}), L = t.useMemo(
|
|
42
|
-
() => ({ activeStep: v, handleActiveStepChange: S, allowStepLabelClick:
|
|
43
|
-
[
|
|
44
|
-
),
|
|
45
|
-
[
|
|
46
|
-
}),
|
|
47
|
-
/* @__PURE__ */ o(
|
|
44
|
+
() => ({ activeStep: v, handleActiveStepChange: S, allowStepLabelClick: c }),
|
|
45
|
+
[c, v, S]
|
|
46
|
+
), w = I(k.stepper, l, {
|
|
47
|
+
[k["stepper--card"]]: !!p
|
|
48
|
+
}), M = () => p ? /* @__PURE__ */ g(B, { padding: 1.5, ...p === !0 ? {} : p, "data-name": "stepper", className: w, children: [
|
|
49
|
+
/* @__PURE__ */ o(D, { padding: 0, background: "white", children: /* @__PURE__ */ o(
|
|
48
50
|
N,
|
|
49
51
|
{
|
|
50
52
|
items: h(),
|
|
@@ -53,8 +55,8 @@ const W = (a) => {
|
|
|
53
55
|
notCompletedLabel: f
|
|
54
56
|
}
|
|
55
57
|
) }),
|
|
56
|
-
/* @__PURE__ */ o(
|
|
57
|
-
] }) : /* @__PURE__ */ g("div", { "data-name": "stepper", className:
|
|
58
|
+
/* @__PURE__ */ o(R, { children: b })
|
|
59
|
+
] }) : /* @__PURE__ */ g("div", { "data-name": "stepper", className: l, children: [
|
|
58
60
|
/* @__PURE__ */ o(
|
|
59
61
|
N,
|
|
60
62
|
{
|
|
@@ -66,8 +68,8 @@ const W = (a) => {
|
|
|
66
68
|
),
|
|
67
69
|
b
|
|
68
70
|
] });
|
|
69
|
-
return /* @__PURE__ */ o(
|
|
71
|
+
return /* @__PURE__ */ o(z.Provider, { value: L, children: M() });
|
|
70
72
|
};
|
|
71
73
|
export {
|
|
72
|
-
|
|
74
|
+
Y as Stepper
|
|
73
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),We=require("../../../../external/@tanstack/react-table/build/lib/index.cjs.js"),Ze=require("../../../../external/classnames/index.cjs.js"),o=require("react"),Je=require("./components/pagination/pagination.cjs.js"),i=require("./components/table-filter/filter-fn.cjs.js"),Qe=require("./components/table-layout/table-layout.cjs.js"),u=require("./table.module.scss.cjs.js"),Xe=require("./table-context.cjs.js"),Ye=require("../../../tedi/providers/label-provider/use-labels.cjs.js"),en=require("../../../tedi/providers/printing-provider/printing-provider.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),We=require("../../../../external/@tanstack/react-table/build/lib/index.cjs.js"),Ze=require("../../../../external/classnames/index.cjs.js"),o=require("react"),Je=require("./components/pagination/pagination.cjs.js"),i=require("./components/table-filter/filter-fn.cjs.js"),Qe=require("./components/table-layout/table-layout.cjs.js"),u=require("./table.module.scss.cjs.js"),Xe=require("./table-context.cjs.js"),Ye=require("../../../tedi/providers/label-provider/use-labels.cjs.js"),en=require("../../../tedi/providers/printing-provider/printing-provider.cjs.js"),d=require("../../../../external/@tanstack/table-core/build/lib/index.cjs.js"),nn=require("../card/card.cjs.js"),tn=require("../card/card-content/card-content.cjs.js"),J=1e4,Z=[];function on(c){const{getLabel:y}=Ye.useLabels(),{id:Q,data:l,columns:X,caption:Y,columnFilters:h,onColumnFiltersChange:R,cardProps:{padding:ee=0,...ne}={},hidePagination:g,defaultPagination:te={pageIndex:0,pageSize:g?J:10},pagination:a,manualPagination:oe=!!c.pagination,manualSorting:ie=!!c.sorting,manualFiltering:re=!!c.columnFilters,sorting:C,defaultSorting:le=[],defaultExpanded:ae={},autoResetPageIndex:se,onPaginationChange:x,onSortingChange:M,rowSelection:f,onRowSelectionChange:q,enableRowSelection:ue,defaultColumnVisibility:de={},columnVisibility:w,onColumnVisibilityChange:G,columnPinning:b,onColumnPinningChange:I,getRowId:ce,onRowClick:ge,defaultRowSelection:me,totalRows:P,renderSubComponent:pe,getRowCanExpand:he,groupRowsBy:s,renderGroupHeading:Ce,isLoading:fe=!1,isError:we=!1,placeholder:be,errorPlaceholder:Pe,loadingLabel:Fe=y("table.loading"),verticalAlign:Se="middle",enableFilters:ye=!1,enableSorting:Re=!0,hideRowBorder:E=!1,size:T="medium",hideCardBorder:V,...xe}=c,m=o.useMemo(()=>(l!=null&&l.length?l:Z)??Z,[l]),O=en.usePrint(),[{pageIndex:v,pageSize:j},Me]=o.useState(te),[D,qe]=o.useState(le),[K,Ge]=o.useState(ae),[N,Ie]=o.useState(me||{}),[A,Ee]=o.useState([]),[B,Te]=o.useState(de),[L,Ve]=o.useState({left:[],right:[]}),Oe=o.useMemo(()=>O?!0:K,[K,O]),_=o.useMemo(()=>a||{pageIndex:v,pageSize:j},[v,j,a]),$=o.useMemo(()=>C||D,[D,C]),k=o.useMemo(()=>h||A,[A,h]),z=o.useMemo(()=>f||N,[N,f]),H=o.useMemo(()=>w||B,[B,w]),U=o.useMemo(()=>b||L,[L,b]),ve=n=>{if(typeof n!="function")return;const e=n(_);a&&x?x(e):Me(e)},je=n=>{if(typeof n!="function")return;const e=n($);C&&M?M(e):qe(e)},De=n=>{if(typeof n!="function")return;const e=n(z);f&&q?q(e):Ie(e)},Ke=n=>{if(typeof n!="function")return;const e=n(k);h&&R?R(e):Ee(e)},Ne=n=>{if(typeof n!="function")return;const e=n(H);w&&G?G(e):Te(e)},Ae=n=>{if(typeof n!="function")return;const e=n(U);b&&I?I(e):Ve(e)},Be=o.useMemo(()=>{const n=(m==null?void 0:m.map(e=>typeof s=="string"?{...e,rowGroupKey:e[s]}:s?{...e,rowGroupKey:s(e)}:e))??[];return n.reduce((e,t)=>(t.rowGroupKey&&e.keys.includes(t.rowGroupKey)||(t.rowGroupKey?(e.keys=[...e.keys,t.rowGroupKey],e.list=[...e.list,...n.filter(S=>S.rowGroupKey===t.rowGroupKey)]):e.list=[...e.list,t]),e),{keys:[],list:[]}).list},[m,s]),p=We.useReactTable({data:Be,columns:X,state:{rowSelection:z,columnFilters:k,pagination:_,sorting:$,expanded:Oe,columnVisibility:H,columnPinning:U},manualSorting:ie,manualFiltering:re,pageCount:a&&P?Math.ceil(P/a.pageSize):void 0,autoResetPageIndex:se,onRowSelectionChange:De,enableRowSelection:ue,onExpandedChange:Ge,onPaginationChange:ve,onSortingChange:je,onColumnFiltersChange:Ke,onColumnVisibilityChange:Ne,onColumnPinningChange:Ae,getCoreRowModel:d.getCoreRowModel(),getSortedRowModel:d.getSortedRowModel(),getPaginationRowModel:d.getPaginationRowModel(),getFilteredRowModel:d.getFilteredRowModel(),getExpandedRowModel:d.getExpandedRowModel(),getRowCanExpand:he,getSubRows:n=>n.subRows,manualPagination:oe,enableFilters:ye,enableSorting:Re,getRowId:ce,filterFns:{text:(n,e,t)=>i.mapFilterFn(n,e,t,i.textFilterFn),select:(n,e,t)=>i.mapFilterFn(n,e,t,i.selectFilterFn),"multi-select":(n,e,t)=>i.mapFilterFn(n,e,t,i.multiSelectFilterFn),"date-range":(n,e,t)=>i.mapFilterFn(n,e,t,i.dateRangeFilterFn),"date-range-period":(n,e,t)=>i.mapFilterFn(n,e,t,i.dateRangePeriodFilterFn)}}),F=!!p.getFooterGroups().find(n=>!!n.headers.find(e=>e.column.columnDef.footer)),Le=!!(!V&&g&&!F),_e=!E&&F&&!g,$e=Ze.default(u.default.table,u.default[`table--vertical-align-${Se}`],u.default[`table--${T}`],{[u.default["table--hidden-bottom-border"]]:Le,[u.default["table--footer-bottom-border"]]:_e}),W=(n,e)=>{const{children:t=y(`table.${n}`),isNested:S=!0,icon:ke=n==="error"?"error":void 0,cardProps:{padding:ze=1,...He}={},...Ue}=e||{cardProps:{}};return{children:t,isNested:S,icon:ke,cardProps:{padding:ze,...He},...Ue}};return r.jsx(Xe.TableContext.Provider,{value:{table:p,id:Q,caption:Y,onRowClick:ge,renderSubComponent:pe,isFooterVisible:F,renderGroupHeading:Ce,placeholder:W("empty",be),errorPlaceholder:W("error",Pe),loadingLabel:Fe,isLoading:fe,isError:we,hideRowBorder:E,size:T},children:r.jsx(nn.Card,{"data-name":"table",...xe,borderless:V,padding:ee,...ne,children:r.jsxs(tn.CardContent,{children:[r.jsx("div",{className:$e,children:r.jsx(Qe.default,{})}),!g&&p&&r.jsx(Je.default,{totalRows:P||p.getFilteredRowModel().rows.length})]})})})}exports.PAGE_SIZE_WITHOUT_PAGINATION=J;exports.Table=on;
|
|
@@ -9,9 +9,9 @@ import d from "./table.module.scss.es.js";
|
|
|
9
9
|
import { TableContext as no } from "./table-context.es.js";
|
|
10
10
|
import { useLabels as to } from "../../../tedi/providers/label-provider/use-labels.es.js";
|
|
11
11
|
import { usePrint as io } from "../../../tedi/providers/printing-provider/printing-provider.es.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { getExpandedRowModel as ro, getFilteredRowModel as lo, getPaginationRowModel as ao, getSortedRowModel as so, getCoreRowModel as uo } from "../../../../external/@tanstack/table-core/build/lib/index.es.js";
|
|
13
|
+
import { Card as go } from "../card/card.es.js";
|
|
14
|
+
import { CardContent as co } from "../card/card-content/card-content.es.js";
|
|
15
15
|
const mo = 1e4, Z = [];
|
|
16
16
|
function Eo(u) {
|
|
17
17
|
const { getLabel: y } = to(), {
|
|
@@ -123,11 +123,11 @@ function Eo(u) {
|
|
|
123
123
|
onColumnFiltersChange: Ne,
|
|
124
124
|
onColumnVisibilityChange: Oe,
|
|
125
125
|
onColumnPinningChange: Te,
|
|
126
|
-
getCoreRowModel:
|
|
127
|
-
getSortedRowModel:
|
|
128
|
-
getPaginationRowModel:
|
|
129
|
-
getFilteredRowModel:
|
|
130
|
-
getExpandedRowModel:
|
|
126
|
+
getCoreRowModel: uo(),
|
|
127
|
+
getSortedRowModel: so(),
|
|
128
|
+
getPaginationRowModel: ao(),
|
|
129
|
+
getFilteredRowModel: lo(),
|
|
130
|
+
getExpandedRowModel: ro(),
|
|
131
131
|
getRowCanExpand: me,
|
|
132
132
|
getSubRows: (o) => o.subRows,
|
|
133
133
|
manualPagination: oe,
|
|
@@ -181,7 +181,7 @@ function Eo(u) {
|
|
|
181
181
|
hideRowBorder: V,
|
|
182
182
|
size: I
|
|
183
183
|
},
|
|
184
|
-
children: /* @__PURE__ */ a(
|
|
184
|
+
children: /* @__PURE__ */ a(go, { "data-name": "table", ...Re, borderless: D, padding: X, ...Y, children: /* @__PURE__ */ Ue(co, { children: [
|
|
185
185
|
/* @__PURE__ */ a("div", { className: ze, children: /* @__PURE__ */ a(oo, {}) }),
|
|
186
186
|
!g && m && /* @__PURE__ */ a(qe, { totalRows: P || m.getFilteredRowModel().rows.length })
|
|
187
187
|
] }) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),b=require("../../../tedi/components/misc/affix/affix.cjs.js"),f=require("../../../tedi/components/misc/scroll-visibility/scroll-visibility.cjs.js"),C=require("../../../tedi/components/misc/stretch-content/stretch-content.cjs.js"),x=require("../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),h=require("./table-of-contents-items.cjs.js"),m=require("./table-of-contents-modal.cjs.js"),q=require("../../../tedi/providers/label-provider/use-labels.cjs.js"),O=require("../../helpers/hooks/use-layout.cjs.js"),j=require("../card/card.cjs.js"),T=require("../card/card-content/card-content.cjs.js"),r=u.createContext({openItems:void 0,showIcons:void 0}),y=n=>{x.warnDeprecated("Community TableOfContents","Use TableOfContents from `@tedi-design-system/react/tedi` instead.");const{getLabel:i}=q.useLabels(),{breakToMobile:c=["mobile"],heading:o=i("table-of-contents.title"),hideOnScroll:l=!0}=n,t=O.default(c),{showIcons:a,openItems:d,...s}=n;return e.jsx(r.Provider,{value:{openItems:d,showIcons:a},children:e.jsx(b.Affix,{right:0,left:0,bottom:t?0:1.5,top:t?"unset":1.5,position:t?"fixed":"sticky",children:e.jsx(C.StretchContent,{children:t?e.jsx(f.ScrollVisibility,{animationDirection:"down",enabled:l,children:e.jsx(m.TableOfContentsModal,{...s,heading:o})}):e.jsx(j.Card,{children:e.jsx(T.CardContent,{children:e.jsx(h.TableOfContentsItems,{...s,heading:o})})})})})})};exports.TableOfContents=y;exports.TableOfContentsContext=r;
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Affix as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
|
+
import { Affix as c } from "../../../tedi/components/misc/affix/affix.es.js";
|
|
4
4
|
import { ScrollVisibility as d } from "../../../tedi/components/misc/scroll-visibility/scroll-visibility.es.js";
|
|
5
5
|
import { StretchContent as b } from "../../../tedi/components/misc/stretch-content/stretch-content.es.js";
|
|
6
|
-
import {
|
|
6
|
+
import { warnDeprecated as p } from "../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
7
|
+
import { TableOfContentsItems as C } from "./table-of-contents-items.es.js";
|
|
7
8
|
import { TableOfContentsModal as h } from "./table-of-contents-modal.es.js";
|
|
8
|
-
import { useLabels as
|
|
9
|
-
import
|
|
10
|
-
import { Card as
|
|
11
|
-
import { CardContent as
|
|
12
|
-
const
|
|
9
|
+
import { useLabels as u } from "../../../tedi/providers/label-provider/use-labels.es.js";
|
|
10
|
+
import O from "../../helpers/hooks/use-layout.es.js";
|
|
11
|
+
import { Card as T } from "../card/card.es.js";
|
|
12
|
+
import { CardContent as x } from "../card/card-content/card-content.es.js";
|
|
13
|
+
const y = f.createContext({
|
|
13
14
|
openItems: void 0,
|
|
14
15
|
showIcons: void 0
|
|
15
|
-
}),
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
}), P = (e) => {
|
|
17
|
+
p("Community TableOfContents", "Use TableOfContents from `@tedi-design-system/react/tedi` instead.");
|
|
18
|
+
const { getLabel: i } = u(), { breakToMobile: m = ["mobile"], heading: n = i("table-of-contents.title"), hideOnScroll: s = !0 } = e, o = O(m), { showIcons: l, openItems: a, ...r } = e;
|
|
19
|
+
return /* @__PURE__ */ t(y.Provider, { value: { openItems: a, showIcons: l }, children: /* @__PURE__ */ t(
|
|
20
|
+
c,
|
|
19
21
|
{
|
|
20
22
|
right: 0,
|
|
21
23
|
left: 0,
|
|
22
|
-
bottom:
|
|
23
|
-
top:
|
|
24
|
-
position:
|
|
25
|
-
children: /* @__PURE__ */
|
|
24
|
+
bottom: o ? 0 : 1.5,
|
|
25
|
+
top: o ? "unset" : 1.5,
|
|
26
|
+
position: o ? "fixed" : "sticky",
|
|
27
|
+
children: /* @__PURE__ */ t(b, { children: o ? /* @__PURE__ */ t(d, { animationDirection: "down", enabled: s, children: /* @__PURE__ */ t(h, { ...r, heading: n }) }) : /* @__PURE__ */ t(T, { children: /* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(C, { ...r, heading: n }) }) }) })
|
|
26
28
|
}
|
|
27
29
|
) });
|
|
28
30
|
};
|
|
29
31
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
P as TableOfContents,
|
|
33
|
+
y as TableOfContentsContext
|
|
32
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),k=require("../../../../../external/classnames/index.cjs.js"),m=require("react"),D=require("../../../../tedi/components/misc/print/print.cjs.js"),N=require("../../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),P=require("../tabs-context.cjs.js"),A=require("../tabs-item/tabs-item.cjs.js"),p=require("../tabs-nav/tabs-nav.cjs.js"),x=require("./tabs.module.scss.cjs.js"),E=require("../../../../tedi/providers/printing-provider/printing-provider.cjs.js"),R=n=>{N.warnDeprecated("Community Tabs","Use Tabs from `@tedi-design-system/react/tedi` instead.");const y=E.usePrint(),{defaultCurrentTab:I,onTabChange:o,className:f,children:g,hideNavOnPrint:h="show"}=n,[C,q]=m.useState(I||""),v=(e=n.currentTab)=>!!n.onTabChange&&typeof e<"u",a=v(n.currentTab)?n.currentTab:C,u=e=>{a!==e&&(v()||q(e),o==null||o(e))},s=m.Children.toArray(n.children).filter(e=>m.isValidElement(e)&&e.type===A.TabsItem).map(e=>e.props),w=e=>{var r,d;const l=s.findIndex(b=>{var T;return b.id===((T=e.currentTarget)==null?void 0:T.id)}),i=l!==-1?l:0;let t=-1;switch(e.key){case" ":e.preventDefault(),u((r=e.currentTarget)==null?void 0:r.id);break;case"ArrowLeft":i===0?t=s.length-1:t=i-1;break;case"ArrowRight":i===s.length-1?t=0:t=i+1;break;case"Home":t=0;break;case"End":t=s.length-1;break}t!==-1&&(e.preventDefault(),(d=document.getElementById(s[t].id))==null||d.focus())},j=s.map((e,l)=>{const{children:i,label:t,id:r,...d}=e;return{...d,id:r,isActive:a===r,onClick:b=>{b.preventDefault(),u(r)},onKeyDown:w,children:t,href:`#${r}`,role:"tab",tabIndex:!a&&l===0||a===r?void 0:-1,"aria-controls":`${r}-panel`,"aria-label":t,"aria-selected":a===r}});return c.jsx(P.TabsContext.Provider,{value:{currentTab:a,setCurrentTab:u},children:c.jsxs("div",{"data-name":"tabs",className:y&&h==="hide"?f:k.default(x.default.tabs,f),children:[c.jsx(D.Print,{visibility:h,children:c.jsx(p.TabsNav,{items:j,"aria-labelledby":n["aria-labelledby"]})}),c.jsx("div",{className:x.default.tabs__content,children:g})]})})};exports.Tabs=R;
|