@tedi-design-system/react 14.2.0-rc.3 → 14.2.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle-stats.html +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/package.json +1 -1
- package/src/community/components/stepper/step.d.ts +6 -0
- package/src/community/components/stepper/stepper-nav.cjs.js +1 -1
- package/src/community/components/stepper/stepper-nav.d.ts +6 -0
- package/src/community/components/stepper/stepper-nav.es.js +26 -26
- package/src/community/components/stepper/stepper.cjs.js +1 -1
- package/src/community/components/stepper/stepper.es.js +25 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.cjs.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.cjs.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.cjs3.js"),r=require("./cjs/react-is.production.min.cjs.js"),o=require("./cjs/react-is.development.cjs.js");process.env.NODE_ENV==="production"?e.__module.exports=r.__require():e.__module.exports=o.__require();var t=e.__module.exports;exports.reactIsExports=t;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as r } from "../../../../_virtual/index.
|
|
1
|
+
import { __module as r } from "../../../../_virtual/index.es3.js";
|
|
2
2
|
import { __require as e } from "./cjs/react-is.production.min.es.js";
|
|
3
3
|
import { __require as o } from "./cjs/react-is.development.es.js";
|
|
4
4
|
process.env.NODE_ENV === "production" ? r.exports = e() : r.exports = o();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.cjs2.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.cjs2.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.cjs4.js"),t=require("./cjs/react-is.production.min.cjs.js"),o=require("./cjs/react-is.development.cjs.js");var r;function u(){return r||(r=1,process.env.NODE_ENV==="production"?e.__module.exports=t.__require():e.__module.exports=o.__require()),e.__module.exports}exports.__require=u;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as e } from "../../../../_virtual/index.
|
|
1
|
+
import { __module as e } from "../../../../_virtual/index.es4.js";
|
|
2
2
|
import { __require as o } from "./cjs/react-is.production.min.es.js";
|
|
3
3
|
import { __require as t } from "./cjs/react-is.development.es.js";
|
|
4
4
|
var r;
|
package/package.json
CHANGED
|
@@ -25,6 +25,12 @@ export interface StepProps {
|
|
|
25
25
|
* Mark the step as completed
|
|
26
26
|
*/
|
|
27
27
|
completed?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Show completed icon next to the step label
|
|
30
|
+
* When true, a checkmark icon is displayed next to the step label even when the step is not marked as completed.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
showCompletedIcon?: boolean;
|
|
28
34
|
}
|
|
29
35
|
export declare const Step: (props: StepProps) => JSX.Element | null;
|
|
30
36
|
export default Step;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),m=require("../../../../external/classnames/index.cjs.js"),I=require("react"),g=require("../icon/icon.cjs.js"),s=require("./stepper.module.scss.cjs.js"),w=require("./stepper-context.cjs.js"),k=require("../../../tedi/providers/label-provider/use-labels.cjs.js"),A=require("../../helpers/hooks/use-layout.cjs.js"),v=b=>{const{getLabel:p}=k.useLabels(),{items:c,ariaLabel:f,completedLabel:x=p("stepper.completed"),notCompletedLabel:_=p("stepper.not-completed")}=b,h=A.useLayout(["mobile"]),{activeStep:i,handleActiveStepChange:N,allowStepLabelClick:l}=I.useContext(w.StepperContext),j=c.filter(e=>e.completed).map(e=>e.index),S=e=>typeof l=="boolean"?!l:l==="completed"?!e.completed:!(l==="completed-or-next"&&(e.completed||e.index===i+1||e.index===Math.max(...j)+1)),L=e=>{const{label:o,completed:a,index:n,id:y,showCompletedIcon:d}=e,r=n===i,C=n<=i,u=S(e),q=m.default(s.default["stepper__nav-item"],{[s.default["stepper__nav-item--disabled"]]:u},{[s.default["stepper__nav-item--active"]]:C},{[s.default["stepper__nav-item--completed"]]:a}),M=m.default(s.default["stepper__nav-item-label"],{"visually-hidden":h&&!r});return t.jsxs("li",{className:q,children:[t.jsxs("button",{type:"button",role:"tab","aria-selected":r,"aria-controls":y,className:s.default["stepper__nav-item-inner"],onClick:()=>N(n),disabled:u,children:[t.jsxs("span",{className:s.default["stepper__nav-item-counter"],children:[(a||d)&&t.jsx(g.Icon,{name:"done",size:18}),!a&&!d&&n+1]}),t.jsx("span",{className:M,children:o}),a&&t.jsx("span",{className:"visually-hidden",children:x}),!a&&!r&&t.jsx("span",{className:"visually-hidden",children:_})]}),r&&t.jsx("span",{className:s.default["stepper__nav-item-arrow"]})]})};return t.jsx("nav",{role:"tablist","aria-label":f,children:t.jsx("ol",{className:s.default.stepper__nav,children:c.map((e,o)=>t.jsx(L,{...e},o))})})};exports.StepperNav=v;exports.default=v;
|
|
@@ -15,6 +15,12 @@ export interface StepperNavItem {
|
|
|
15
15
|
* The position of the step
|
|
16
16
|
*/
|
|
17
17
|
index: number;
|
|
18
|
+
/**
|
|
19
|
+
* Show completed icon next to the step label
|
|
20
|
+
* When true, a checkmark icon is displayed next to the step label even when the step is not marked as completed.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
showCompletedIcon?: boolean;
|
|
18
24
|
}
|
|
19
25
|
export interface StepperNavProps {
|
|
20
26
|
/**
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import { jsx as a, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import v from "../../../../external/classnames/index.es.js";
|
|
3
3
|
import g from "react";
|
|
4
4
|
import { Icon as j } from "../icon/icon.es.js";
|
|
5
5
|
import t from "./stepper.module.scss.es.js";
|
|
6
6
|
import { StepperContext as k } from "./stepper-context.es.js";
|
|
7
|
-
import { useLabels as
|
|
8
|
-
import { useLayout as
|
|
9
|
-
const
|
|
10
|
-
const { getLabel: c } =
|
|
7
|
+
import { useLabels as A } from "../../../tedi/providers/label-provider/use-labels.es.js";
|
|
8
|
+
import { useLayout as B } from "../../helpers/hooks/use-layout.es.js";
|
|
9
|
+
const J = (b) => {
|
|
10
|
+
const { getLabel: c } = A(), {
|
|
11
11
|
items: m,
|
|
12
|
-
ariaLabel:
|
|
13
|
-
completedLabel:
|
|
14
|
-
notCompletedLabel:
|
|
15
|
-
} =
|
|
16
|
-
const { label: p, completed: s, index: r, id:
|
|
12
|
+
ariaLabel: f,
|
|
13
|
+
completedLabel: _ = c("stepper.completed"),
|
|
14
|
+
notCompletedLabel: h = c("stepper.not-completed")
|
|
15
|
+
} = b, N = B(["mobile"]), { activeStep: o, handleActiveStepChange: x, allowStepLabelClick: l } = g.useContext(k), S = m.filter((e) => e.completed).map((e) => e.index), L = (e) => typeof l == "boolean" ? !l : l === "completed" ? !e.completed : !(l === "completed-or-next" && (e.completed || e.index === o + 1 || e.index === Math.max(...S) + 1)), y = (e) => {
|
|
16
|
+
const { label: p, completed: s, index: r, id: C, showCompletedIcon: d } = e, n = r === o, I = r <= o, u = L(e), M = v(
|
|
17
17
|
t["stepper__nav-item"],
|
|
18
|
-
{ [t["stepper__nav-item--disabled"]]:
|
|
19
|
-
{ [t["stepper__nav-item--active"]]:
|
|
18
|
+
{ [t["stepper__nav-item--disabled"]]: u },
|
|
19
|
+
{ [t["stepper__nav-item--active"]]: I },
|
|
20
20
|
{ [t["stepper__nav-item--completed"]]: s }
|
|
21
|
-
),
|
|
22
|
-
"visually-hidden":
|
|
21
|
+
), w = v(t["stepper__nav-item-label"], {
|
|
22
|
+
"visually-hidden": N && !n
|
|
23
23
|
});
|
|
24
|
-
return /* @__PURE__ */ i("li", { className:
|
|
24
|
+
return /* @__PURE__ */ i("li", { className: M, children: [
|
|
25
25
|
/* @__PURE__ */ i(
|
|
26
26
|
"button",
|
|
27
27
|
{
|
|
28
28
|
type: "button",
|
|
29
29
|
role: "tab",
|
|
30
30
|
"aria-selected": n,
|
|
31
|
-
"aria-controls":
|
|
31
|
+
"aria-controls": C,
|
|
32
32
|
className: t["stepper__nav-item-inner"],
|
|
33
|
-
onClick: () =>
|
|
34
|
-
disabled:
|
|
33
|
+
onClick: () => x(r),
|
|
34
|
+
disabled: u,
|
|
35
35
|
children: [
|
|
36
36
|
/* @__PURE__ */ i("span", { className: t["stepper__nav-item-counter"], children: [
|
|
37
|
-
s && /* @__PURE__ */ a(j, { name: "done", size: 18 }),
|
|
38
|
-
!s && r + 1
|
|
37
|
+
(s || d) && /* @__PURE__ */ a(j, { name: "done", size: 18 }),
|
|
38
|
+
!s && !d && r + 1
|
|
39
39
|
] }),
|
|
40
|
-
/* @__PURE__ */ a("span", { className:
|
|
41
|
-
s && /* @__PURE__ */ a("span", { className: "visually-hidden", children:
|
|
42
|
-
!s && !n && /* @__PURE__ */ a("span", { className: "visually-hidden", children:
|
|
40
|
+
/* @__PURE__ */ a("span", { className: w, children: p }),
|
|
41
|
+
s && /* @__PURE__ */ a("span", { className: "visually-hidden", children: _ }),
|
|
42
|
+
!s && !n && /* @__PURE__ */ a("span", { className: "visually-hidden", children: h })
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
),
|
|
46
46
|
n && /* @__PURE__ */ a("span", { className: t["stepper__nav-item-arrow"] })
|
|
47
47
|
] });
|
|
48
48
|
};
|
|
49
|
-
return /* @__PURE__ */ a("nav", { role: "tablist", "aria-label":
|
|
49
|
+
return /* @__PURE__ */ a("nav", { role: "tablist", "aria-label": f, children: /* @__PURE__ */ a("ol", { className: t.stepper__nav, children: m.map((e, p) => /* @__PURE__ */ a(y, { ...e }, p)) }) });
|
|
50
50
|
};
|
|
51
51
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
J as StepperNav,
|
|
53
|
+
J as default
|
|
54
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),w=require("../../../../external/classnames/index.cjs.js"),t=require("react"),q=require("./step.cjs.js"),j=require("./stepper.module.scss.cjs.js"),H=require("./stepper-context.cjs.js"),g=require("./stepper-nav.cjs.js"),I=require("../card/card-header/card-header.cjs.js"),R=require("../card/card.cjs.js"),B=require("../card/card-content/card-content.cjs.js"),h=a=>{const{activeStep:n,defaultActiveStep:N,onActiveStepChange:s,allowStepLabelClick:p=!0,children:k,className:d,ariaLabel:u,completedLabel:m,notCompletedLabel:S,card:c}=a,[v,y]=t.useState(N||0),o=t.useCallback((e=a.activeStep)=>typeof e<"u",[a.activeStep]),C=t.useCallback(e=>{s==null||s(e),o(n)||y(e)},[n,o,s]),f=t.useMemo(()=>o(n)?n:v,[n,v,o]),i=t.Children.map(k,e=>t.isValidElement(e)&&e.type===q.Step?e:null),x=i==null?void 0:i.map((e,l)=>t.cloneElement(e,{key:l,index:l,...e.props})),b=()=>t.Children.toArray(a.children).filter(e=>t.isValidElement(e)&&e.type===q.Step).map((e,l)=>{const{label:L,completed:P,id:V,showCompletedIcon:_}=e.props;return{label:L,completed:!!P,index:l,id:V,showCompletedIcon:_}}),M=t.useMemo(()=>({activeStep:f,handleActiveStepChange:C,allowStepLabelClick:p}),[p,f,C]),A=w.default(j.default.stepper,d,{[j.default["stepper--card"]]:!!c}),E=()=>{if(c){const e=c===!0?{}:c;return r.jsxs(R.Card,{padding:1.5,...e,"data-name":"stepper",className:A,children:[r.jsx(I.CardHeader,{padding:0,background:"white",children:r.jsx(g.StepperNav,{items:b(),ariaLabel:u,completedLabel:m,notCompletedLabel:S})}),r.jsx(B.CardContent,{children:x})]})}return r.jsxs("div",{"data-name":"stepper",className:d,children:[r.jsx(g.StepperNav,{items:b(),ariaLabel:u,completedLabel:m,notCompletedLabel:S}),x]})};return r.jsx(H.StepperContext.Provider,{value:M,children:E()})};exports.Stepper=h;exports.default=h;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as o, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import _ from "../../../../external/classnames/index.es.js";
|
|
3
3
|
import t from "react";
|
|
4
4
|
import { Step as k } from "./step.es.js";
|
|
5
5
|
import y from "./stepper.module.scss.es.js";
|
|
6
6
|
import { StepperContext as B } from "./stepper-context.es.js";
|
|
7
7
|
import { StepperNav as N } from "./stepper-nav.es.js";
|
|
8
8
|
import { CardHeader as H } from "../card/card-header/card-header.es.js";
|
|
9
|
-
import { Card as
|
|
10
|
-
import { CardContent as
|
|
11
|
-
const
|
|
9
|
+
import { Card as R } from "../card/card.es.js";
|
|
10
|
+
import { CardContent as q } from "../card/card-content/card-content.es.js";
|
|
11
|
+
const W = (a) => {
|
|
12
12
|
const {
|
|
13
13
|
activeStep: r,
|
|
14
14
|
defaultActiveStep: x,
|
|
15
15
|
onActiveStepChange: n,
|
|
16
|
-
allowStepLabelClick:
|
|
16
|
+
allowStepLabelClick: i = !0,
|
|
17
17
|
children: A,
|
|
18
18
|
className: m,
|
|
19
19
|
ariaLabel: d,
|
|
20
20
|
completedLabel: u,
|
|
21
21
|
notCompletedLabel: f,
|
|
22
22
|
card: p
|
|
23
|
-
} =
|
|
24
|
-
(e =
|
|
25
|
-
[
|
|
23
|
+
} = a, [C, E] = t.useState(x || 0), s = t.useCallback(
|
|
24
|
+
(e = a.activeStep) => typeof e < "u",
|
|
25
|
+
[a.activeStep]
|
|
26
26
|
), S = t.useCallback(
|
|
27
27
|
(e) => {
|
|
28
28
|
n == null || n(e), s(r) || E(e);
|
|
@@ -31,20 +31,20 @@ const U = (o) => {
|
|
|
31
31
|
), v = t.useMemo(
|
|
32
32
|
() => s(r) ? r : C,
|
|
33
33
|
[r, C, s]
|
|
34
|
-
),
|
|
35
|
-
key:
|
|
36
|
-
index:
|
|
34
|
+
), c = t.Children.map(A, (e) => t.isValidElement(e) && e.type === k ? e : null), b = c == null ? void 0 : c.map((e, l) => t.cloneElement(e, {
|
|
35
|
+
key: l,
|
|
36
|
+
index: l,
|
|
37
37
|
...e.props
|
|
38
|
-
})), h = () => t.Children.toArray(
|
|
39
|
-
const { label: V, completed: j, id:
|
|
40
|
-
return { label: V, completed: !!j, index:
|
|
38
|
+
})), h = () => t.Children.toArray(a.children).filter((e) => t.isValidElement(e) && e.type === k).map((e, l) => {
|
|
39
|
+
const { label: V, completed: j, id: w, showCompletedIcon: I } = e.props;
|
|
40
|
+
return { label: V, completed: !!j, index: l, id: w, showCompletedIcon: I };
|
|
41
41
|
}), L = t.useMemo(
|
|
42
|
-
() => ({ activeStep: v, handleActiveStepChange: S, allowStepLabelClick:
|
|
43
|
-
[
|
|
44
|
-
), M =
|
|
42
|
+
() => ({ activeStep: v, handleActiveStepChange: S, allowStepLabelClick: i }),
|
|
43
|
+
[i, v, S]
|
|
44
|
+
), M = _(y.stepper, m, {
|
|
45
45
|
[y["stepper--card"]]: !!p
|
|
46
|
-
}), P = () => p ? /* @__PURE__ */ g(
|
|
47
|
-
/* @__PURE__ */
|
|
46
|
+
}), P = () => p ? /* @__PURE__ */ g(R, { padding: 1.5, ...p === !0 ? {} : p, "data-name": "stepper", className: M, children: [
|
|
47
|
+
/* @__PURE__ */ o(H, { padding: 0, background: "white", children: /* @__PURE__ */ o(
|
|
48
48
|
N,
|
|
49
49
|
{
|
|
50
50
|
items: h(),
|
|
@@ -53,9 +53,9 @@ const U = (o) => {
|
|
|
53
53
|
notCompletedLabel: f
|
|
54
54
|
}
|
|
55
55
|
) }),
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ o(q, { children: b })
|
|
57
57
|
] }) : /* @__PURE__ */ g("div", { "data-name": "stepper", className: m, children: [
|
|
58
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ o(
|
|
59
59
|
N,
|
|
60
60
|
{
|
|
61
61
|
items: h(),
|
|
@@ -66,9 +66,9 @@ const U = (o) => {
|
|
|
66
66
|
),
|
|
67
67
|
b
|
|
68
68
|
] });
|
|
69
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ o(B.Provider, { value: L, children: P() });
|
|
70
70
|
};
|
|
71
71
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
W as Stepper,
|
|
73
|
+
W as default
|
|
74
74
|
};
|