@tedi-design-system/react 18.0.0-rc.13 → 18.0.0-rc.15
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/_virtual/index.es13.js +2 -2
- package/_virtual/index.es14.js +2 -2
- package/bundle-stats.html +1 -1
- package/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/community/components/stepper/step.d.ts +6 -0
- package/src/community/components/stepper/stepper-nav.d.ts +6 -0
- package/src/community/components/stepper/stepper.d.ts +6 -0
- package/src/tedi/components/loaders/progress-bar/index.d.ts +1 -0
- package/src/tedi/components/loaders/progress-bar/progress-bar.cjs.js +1 -0
- package/src/tedi/components/loaders/progress-bar/progress-bar.d.ts +65 -0
- package/src/tedi/components/loaders/progress-bar/progress-bar.es.js +75 -0
- package/src/tedi/components/loaders/progress-bar/progress-bar.module.scss.cjs.js +1 -0
- package/src/tedi/components/loaders/progress-bar/progress-bar.module.scss.es.js +17 -0
- package/src/tedi/components/navigation/horizontal-stepper/horizontal-stepper-context.cjs.js +1 -0
- package/src/tedi/components/navigation/horizontal-stepper/horizontal-stepper-context.d.ts +2 -0
- package/src/tedi/components/navigation/horizontal-stepper/horizontal-stepper-context.es.js +5 -0
- package/src/tedi/components/navigation/horizontal-stepper/horizontal-stepper-item.cjs.js +1 -0
- package/src/tedi/components/navigation/horizontal-stepper/horizontal-stepper-item.d.ts +45 -0
- package/src/tedi/components/navigation/horizontal-stepper/horizontal-stepper-item.es.js +50 -0
- package/src/tedi/components/navigation/horizontal-stepper/horizontal-stepper.cjs.js +1 -0
- package/src/tedi/components/navigation/horizontal-stepper/horizontal-stepper.d.ts +36 -0
- package/src/tedi/components/navigation/horizontal-stepper/horizontal-stepper.es.js +38 -0
- package/src/tedi/components/navigation/horizontal-stepper/horizontal-stepper.module.scss.cjs.js +1 -0
- package/src/tedi/components/navigation/horizontal-stepper/horizontal-stepper.module.scss.es.js +24 -0
- package/src/tedi/components/navigation/horizontal-stepper/index.d.ts +2 -0
- package/src/tedi/index.d.ts +2 -0
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +7 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +7 -0
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +184 -178
package/package.json
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `HorizontalStepper` from `@tedi-design-system/react/tedi` instead.
|
|
4
|
+
*/
|
|
2
5
|
export interface StepProps {
|
|
3
6
|
/**
|
|
4
7
|
* ID of step
|
|
@@ -32,5 +35,8 @@ export interface StepProps {
|
|
|
32
35
|
*/
|
|
33
36
|
showCompletedIcon?: boolean;
|
|
34
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `HorizontalStepper` from `@tedi-design-system/react/tedi` instead.
|
|
40
|
+
*/
|
|
35
41
|
export declare const Step: (props: StepProps) => JSX.Element | null;
|
|
36
42
|
export default Step;
|
|
@@ -22,6 +22,9 @@ export interface StepperNavItem {
|
|
|
22
22
|
*/
|
|
23
23
|
showCompletedIcon?: boolean;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use `HorizontalStepper` from `@tedi-design-system/react/tedi` instead.
|
|
27
|
+
*/
|
|
25
28
|
export interface StepperNavProps {
|
|
26
29
|
/**
|
|
27
30
|
* Navigation items
|
|
@@ -42,5 +45,8 @@ export interface StepperNavProps {
|
|
|
42
45
|
*/
|
|
43
46
|
notCompletedLabel?: string;
|
|
44
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated Use `HorizontalStepper` from `@tedi-design-system/react/tedi` instead.
|
|
50
|
+
*/
|
|
45
51
|
export declare const StepperNav: (props: StepperNavProps) => JSX.Element;
|
|
46
52
|
export default StepperNav;
|
|
@@ -2,6 +2,9 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { CardProps } from '../card';
|
|
3
3
|
import { StepProps } from './step';
|
|
4
4
|
import { AllowStepLabelClick } from './stepper-context';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use `HorizontalStepper` from `@tedi-design-system/react/tedi` instead.
|
|
7
|
+
*/
|
|
5
8
|
export interface StepperProps {
|
|
6
9
|
/**
|
|
7
10
|
* The activeStep index that should be open by default (zero based index).
|
|
@@ -60,5 +63,8 @@ export interface StepperProps {
|
|
|
60
63
|
*/
|
|
61
64
|
card?: CardProps | boolean;
|
|
62
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Use `HorizontalStepper` from `@tedi-design-system/react/tedi` instead.
|
|
68
|
+
*/
|
|
63
69
|
export declare const Stepper: (props: StepperProps) => JSX.Element;
|
|
64
70
|
export default Stepper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './progress-bar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),h=require("../../../../../external/classnames/index.cjs.js"),$=require("react"),z=require("../../form/feedback-text/feedback-text.cjs.js"),R=require("../../form/form-label/form-label.cjs.js"),e=require("./progress-bar.module.scss.cjs.js"),M=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),S=r=>r===void 0||Number.isNaN(r)||r<0?0:r>100?100:r,d=r=>{const{getCurrentBreakpointProps:x}=M.useBreakpointProps(r.defaultServerBreakpoint),{id:N,value:j,small:B=!1,label:l,labelPosition:n="top",required:P=!1,showValue:u=!0,valuePosition:c="horizontal",valueLabel:b,ariaLabel:p,helper:s,className:q}=x(r),k=$.useId(),t=N??`tedi-progress-bar-${k.replace(/[^a-zA-Z0-9-]/g,"")}`,i=`${t}__label`,_=s?s.id??`${t}__helper`:void 0,o=S(j),m=b??`${Math.round(o)}%`,f=l?a.jsx(R.FormLabel,{id:t,label:l,required:P,renderWithoutLabel:!0,className:e.default["tedi-progress-bar__label"]}):null,L=u&&c==="horizontal"?a.jsx("span",{className:e.default["tedi-progress-bar__value"],children:m}):null,w=a.jsx("div",{id:t,role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":b,"aria-labelledby":l&&!p?i:void 0,"aria-label":p||void 0,"aria-describedby":_,className:e.default["tedi-progress-bar__track"],children:a.jsx("div",{className:e.default["tedi-progress-bar__fill"],style:{width:`${o}%`}})}),g=u&&c==="bottom",y=a.jsxs("div",{className:e.default["tedi-progress-bar__row"],children:[w,L]}),I=s||g?a.jsxs("div",{className:e.default["tedi-progress-bar__hint-row"],children:[s?a.jsx(z.FeedbackText,{...s,id:_,className:h.default(e.default["tedi-progress-bar__hint"],s.className)}):null,g?a.jsx("span",{className:e.default["tedi-progress-bar__value"],children:m}):null]}):null,v=a.jsxs("div",{className:e.default["tedi-progress-bar__group"],children:[y,I]}),V=l&&n==="horizontal";return a.jsxs("div",{className:h.default(e.default["tedi-progress-bar"],{[e.default["tedi-progress-bar--small"]]:B},q),"data-name":"progress-bar",children:[l&&n==="top"?a.jsx("div",{id:i,className:e.default["tedi-progress-bar__label-wrapper"],children:f}):null,V?a.jsxs("div",{className:e.default["tedi-progress-bar__main"],children:[a.jsx("div",{id:i,className:e.default["tedi-progress-bar__inline-label"],children:f}),v]}):v]})};d.displayName="ProgressBar";exports.ProgressBar=d;exports.default=d;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BreakpointSupport } from '../../../helpers';
|
|
2
|
+
import { FeedbackTextProps } from '../../form/feedback-text/feedback-text';
|
|
3
|
+
export type ProgressBarLabelPosition = 'top' | 'horizontal';
|
|
4
|
+
export type ProgressBarValuePosition = 'horizontal' | 'bottom';
|
|
5
|
+
type ProgressBarBreakpointProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Use the 4px bar height instead of the 8px default.
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
small?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Label placement. Ignored without `label`.
|
|
13
|
+
* @default top
|
|
14
|
+
*/
|
|
15
|
+
labelPosition?: ProgressBarLabelPosition;
|
|
16
|
+
/**
|
|
17
|
+
* Show the percentage value.
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
showValue?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Where the percentage sits relative to the bar / hint row.
|
|
23
|
+
* @default horizontal
|
|
24
|
+
*/
|
|
25
|
+
valuePosition?: ProgressBarValuePosition;
|
|
26
|
+
/**
|
|
27
|
+
* Override the rendered value text (e.g. `"1 / 5"`) without affecting the fill.
|
|
28
|
+
*/
|
|
29
|
+
valueLabel?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Hint or error text rendered below the bar via `FeedbackText`.
|
|
32
|
+
*/
|
|
33
|
+
helper?: FeedbackTextProps;
|
|
34
|
+
/** Class on the root wrapper. */
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
37
|
+
export interface ProgressBarProps extends BreakpointSupport<ProgressBarBreakpointProps> {
|
|
38
|
+
/**
|
|
39
|
+
* Id forwarded to the bar element so external `<label htmlFor>` can target it.
|
|
40
|
+
*/
|
|
41
|
+
id?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Progress value, clamped to `0..100`. `NaN` is treated as `0`.
|
|
44
|
+
* @default 0
|
|
45
|
+
*/
|
|
46
|
+
value?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Label rendered above or inline with the bar.
|
|
49
|
+
*/
|
|
50
|
+
label?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Renders a required indicator on the label. Ignored without `label`.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
required?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Accessible name. Falls back to `label`.
|
|
58
|
+
*/
|
|
59
|
+
ariaLabel?: string;
|
|
60
|
+
}
|
|
61
|
+
export declare const ProgressBar: {
|
|
62
|
+
(props: ProgressBarProps): JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
export default ProgressBar;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import N from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useId as j } from "react";
|
|
4
|
+
import { FeedbackText as F } from "../../form/feedback-text/feedback-text.es.js";
|
|
5
|
+
import { FormLabel as R } from "../../form/form-label/form-label.es.js";
|
|
6
|
+
import e from "./progress-bar.module.scss.es.js";
|
|
7
|
+
import { useBreakpointProps as q } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
8
|
+
const A = (r) => r === void 0 || Number.isNaN(r) || r < 0 ? 0 : r > 100 ? 100 : r, C = (r) => {
|
|
9
|
+
const { getCurrentBreakpointProps: f } = q(r.defaultServerBreakpoint), {
|
|
10
|
+
id: w,
|
|
11
|
+
value: x,
|
|
12
|
+
small: y = !1,
|
|
13
|
+
label: l,
|
|
14
|
+
labelPosition: n = "top",
|
|
15
|
+
required: B = !1,
|
|
16
|
+
showValue: c = !0,
|
|
17
|
+
valuePosition: p = "horizontal",
|
|
18
|
+
valueLabel: b,
|
|
19
|
+
ariaLabel: m,
|
|
20
|
+
helper: s,
|
|
21
|
+
className: I
|
|
22
|
+
} = f(r), L = j(), o = w ?? `tedi-progress-bar-${L.replace(/[^a-zA-Z0-9-]/g, "")}`, t = `${o}__label`, u = s ? s.id ?? `${o}__helper` : void 0, d = A(x), _ = b ?? `${Math.round(d)}%`, v = l ? /* @__PURE__ */ a(
|
|
23
|
+
R,
|
|
24
|
+
{
|
|
25
|
+
id: o,
|
|
26
|
+
label: l,
|
|
27
|
+
required: B,
|
|
28
|
+
renderWithoutLabel: !0,
|
|
29
|
+
className: e["tedi-progress-bar__label"]
|
|
30
|
+
}
|
|
31
|
+
) : null, P = c && p === "horizontal" ? /* @__PURE__ */ a("span", { className: e["tedi-progress-bar__value"], children: _ }) : null, V = /* @__PURE__ */ a(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
id: o,
|
|
35
|
+
role: "progressbar",
|
|
36
|
+
"aria-valuenow": d,
|
|
37
|
+
"aria-valuemin": 0,
|
|
38
|
+
"aria-valuemax": 100,
|
|
39
|
+
"aria-valuetext": b,
|
|
40
|
+
"aria-labelledby": l && !m ? t : void 0,
|
|
41
|
+
"aria-label": m || void 0,
|
|
42
|
+
"aria-describedby": u,
|
|
43
|
+
className: e["tedi-progress-bar__track"],
|
|
44
|
+
children: /* @__PURE__ */ a("div", { className: e["tedi-progress-bar__fill"], style: { width: `${d}%` } })
|
|
45
|
+
}
|
|
46
|
+
), g = c && p === "bottom", k = /* @__PURE__ */ i("div", { className: e["tedi-progress-bar__row"], children: [
|
|
47
|
+
V,
|
|
48
|
+
P
|
|
49
|
+
] }), $ = s || g ? /* @__PURE__ */ i("div", { className: e["tedi-progress-bar__hint-row"], children: [
|
|
50
|
+
s ? /* @__PURE__ */ a(F, { ...s, id: u, className: N(e["tedi-progress-bar__hint"], s.className) }) : null,
|
|
51
|
+
g ? /* @__PURE__ */ a("span", { className: e["tedi-progress-bar__value"], children: _ }) : null
|
|
52
|
+
] }) : null, h = /* @__PURE__ */ i("div", { className: e["tedi-progress-bar__group"], children: [
|
|
53
|
+
k,
|
|
54
|
+
$
|
|
55
|
+
] }), z = l && n === "horizontal";
|
|
56
|
+
return /* @__PURE__ */ i(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: N(e["tedi-progress-bar"], { [e["tedi-progress-bar--small"]]: y }, I),
|
|
60
|
+
"data-name": "progress-bar",
|
|
61
|
+
children: [
|
|
62
|
+
l && n === "top" ? /* @__PURE__ */ a("div", { id: t, className: e["tedi-progress-bar__label-wrapper"], children: v }) : null,
|
|
63
|
+
z ? /* @__PURE__ */ i("div", { className: e["tedi-progress-bar__main"], children: [
|
|
64
|
+
/* @__PURE__ */ a("div", { id: t, className: e["tedi-progress-bar__inline-label"], children: v }),
|
|
65
|
+
h
|
|
66
|
+
] }) : h
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
C.displayName = "ProgressBar";
|
|
72
|
+
export {
|
|
73
|
+
C as ProgressBar,
|
|
74
|
+
C as default
|
|
75
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r={"tedi-progress-bar":"tedi-progress-bar-770f14b0","tedi-progress-bar__main":"tedi-progress-bar__main-e6d028ee","tedi-progress-bar__inline-label":"tedi-progress-bar__inline-label-92e2bcb6","tedi-progress-bar__group":"tedi-progress-bar__group-03a58869","tedi-progress-bar__row":"tedi-progress-bar__row-89a78ec6","tedi-progress-bar__label":"tedi-progress-bar__label-af2d533b","tedi-progress-bar__track":"tedi-progress-bar__track-519efc0e","tedi-progress-bar__fill":"tedi-progress-bar__fill-5eaa3943","tedi-progress-bar__value":"tedi-progress-bar__value-f105b0d1","tedi-progress-bar__hint-row":"tedi-progress-bar__hint-row-7e6ce05b","tedi-progress-bar__hint":"tedi-progress-bar__hint-886a36f5","tedi-progress-bar--small":"tedi-progress-bar--small-fbdb4f60"};exports.default=r;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
"tedi-progress-bar": "tedi-progress-bar-770f14b0",
|
|
3
|
+
"tedi-progress-bar__main": "tedi-progress-bar__main-e6d028ee",
|
|
4
|
+
"tedi-progress-bar__inline-label": "tedi-progress-bar__inline-label-92e2bcb6",
|
|
5
|
+
"tedi-progress-bar__group": "tedi-progress-bar__group-03a58869",
|
|
6
|
+
"tedi-progress-bar__row": "tedi-progress-bar__row-89a78ec6",
|
|
7
|
+
"tedi-progress-bar__label": "tedi-progress-bar__label-af2d533b",
|
|
8
|
+
"tedi-progress-bar__track": "tedi-progress-bar__track-519efc0e",
|
|
9
|
+
"tedi-progress-bar__fill": "tedi-progress-bar__fill-5eaa3943",
|
|
10
|
+
"tedi-progress-bar__value": "tedi-progress-bar__value-f105b0d1",
|
|
11
|
+
"tedi-progress-bar__hint-row": "tedi-progress-bar__hint-row-7e6ce05b",
|
|
12
|
+
"tedi-progress-bar__hint": "tedi-progress-bar__hint-886a36f5",
|
|
13
|
+
"tedi-progress-bar--small": "tedi-progress-bar--small-fbdb4f60"
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
r as default
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext(0);exports.HorizontalStepperStepNumberContext=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),_=require("../../../../../external/classnames/index.cjs.js"),f=require("react"),d=require("../../base/icon/icon.cjs.js"),e=require("./horizontal-stepper.module.scss.cjs.js"),x=require("./horizontal-stepper-context.cjs.js"),j=require("../../../providers/label-provider/use-labels.cjs.js"),l=c=>{const{label:u,description:a,completed:m,error:r,selected:i,disabled:s,onSelect:o,className:h}=c,{getLabel:n}=j.useLabels(),z=f.useContext(x.HorizontalStepperStepNumberContext),p=!!m&&!r,b=()=>{i||s||o==null||o()};return t.jsx("li",{"data-name":"horizontal-stepper-item",className:_.default(e.default["tedi-horizontal-stepper-item"],{[e.default["tedi-horizontal-stepper-item--selected"]]:i,[e.default["tedi-horizontal-stepper-item--completed"]]:p,[e.default["tedi-horizontal-stepper-item--error"]]:r,[e.default["tedi-horizontal-stepper-item--disabled"]]:s},h),children:t.jsxs("button",{type:"button",className:e.default["tedi-horizontal-stepper-item__step"],disabled:s,"aria-current":i?"step":void 0,onClick:b,children:[t.jsx("span",{className:e.default["tedi-horizontal-stepper-item__indicator"],children:p?t.jsx(d.Icon,{name:"check",color:"white",size:18,label:n("stepper.completed")}):r?t.jsx(d.Icon,{name:"priority_high",color:"white",size:18,label:n("stepper.error")}):t.jsx("span",{className:e.default["tedi-horizontal-stepper-item__number"],children:z})}),t.jsxs("span",{className:e.default["tedi-horizontal-stepper-item__content"],children:[t.jsx("span",{className:e.default["tedi-horizontal-stepper-item__label"],children:u}),a&&t.jsx("span",{className:e.default["tedi-horizontal-stepper-item__description"],children:a})]})]})})};l.displayName="HorizontalStepperItem";exports.HorizontalStepperItem=l;exports.default=l;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface HorizontalStepperItemProps {
|
|
2
|
+
/**
|
|
3
|
+
* Step label shown next to the indicator.
|
|
4
|
+
*/
|
|
5
|
+
label: string;
|
|
6
|
+
/**
|
|
7
|
+
* Secondary text rendered below the label.
|
|
8
|
+
*/
|
|
9
|
+
description?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Marks the step as completed — the indicator shows a check glyph. Ignored
|
|
12
|
+
* while `error` is set.
|
|
13
|
+
*/
|
|
14
|
+
completed?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Marks the step as invalid — the indicator shows a warning glyph and the
|
|
17
|
+
* step uses the danger colours. Takes precedence over `completed`.
|
|
18
|
+
*/
|
|
19
|
+
error?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Marks the step as the current one. Sets `aria-current="step"` and renders
|
|
22
|
+
* the selected (filled) treatment; the step is not clickable while selected.
|
|
23
|
+
*/
|
|
24
|
+
selected?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Prevents the step from being clicked or focused. Use for future steps the
|
|
27
|
+
* user shouldn't reach yet (e.g. when validation runs step-by-step). Leave
|
|
28
|
+
* completed steps enabled so users can navigate back to them.
|
|
29
|
+
*/
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Fired when the user activates the step. Does not fire when the step is
|
|
33
|
+
* `selected` (already current) or `disabled`.
|
|
34
|
+
*/
|
|
35
|
+
onSelect?: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Additional class name on the item's root element.
|
|
38
|
+
*/
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare const HorizontalStepperItem: {
|
|
42
|
+
(props: HorizontalStepperItemProps): JSX.Element;
|
|
43
|
+
displayName: string;
|
|
44
|
+
};
|
|
45
|
+
export default HorizontalStepperItem;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import N from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useContext as u } from "react";
|
|
4
|
+
import { Icon as m } from "../../base/icon/icon.es.js";
|
|
5
|
+
import e from "./horizontal-stepper.module.scss.es.js";
|
|
6
|
+
import { HorizontalStepperStepNumberContext as f } from "./horizontal-stepper-context.es.js";
|
|
7
|
+
import { useLabels as x } from "../../../providers/label-provider/use-labels.es.js";
|
|
8
|
+
const C = (c) => {
|
|
9
|
+
const { label: d, description: p, completed: h, error: r, selected: i, disabled: o, onSelect: s, className: z } = c, { getLabel: a } = x(), b = u(f), l = !!h && !r, _ = () => {
|
|
10
|
+
i || o || s == null || s();
|
|
11
|
+
};
|
|
12
|
+
return /* @__PURE__ */ t(
|
|
13
|
+
"li",
|
|
14
|
+
{
|
|
15
|
+
"data-name": "horizontal-stepper-item",
|
|
16
|
+
className: N(
|
|
17
|
+
e["tedi-horizontal-stepper-item"],
|
|
18
|
+
{
|
|
19
|
+
[e["tedi-horizontal-stepper-item--selected"]]: i,
|
|
20
|
+
[e["tedi-horizontal-stepper-item--completed"]]: l,
|
|
21
|
+
[e["tedi-horizontal-stepper-item--error"]]: r,
|
|
22
|
+
[e["tedi-horizontal-stepper-item--disabled"]]: o
|
|
23
|
+
},
|
|
24
|
+
z
|
|
25
|
+
),
|
|
26
|
+
children: /* @__PURE__ */ n(
|
|
27
|
+
"button",
|
|
28
|
+
{
|
|
29
|
+
type: "button",
|
|
30
|
+
className: e["tedi-horizontal-stepper-item__step"],
|
|
31
|
+
disabled: o,
|
|
32
|
+
"aria-current": i ? "step" : void 0,
|
|
33
|
+
onClick: _,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ t("span", { className: e["tedi-horizontal-stepper-item__indicator"], children: l ? /* @__PURE__ */ t(m, { name: "check", color: "white", size: 18, label: a("stepper.completed") }) : r ? /* @__PURE__ */ t(m, { name: "priority_high", color: "white", size: 18, label: a("stepper.error") }) : /* @__PURE__ */ t("span", { className: e["tedi-horizontal-stepper-item__number"], children: b }) }),
|
|
36
|
+
/* @__PURE__ */ n("span", { className: e["tedi-horizontal-stepper-item__content"], children: [
|
|
37
|
+
/* @__PURE__ */ t("span", { className: e["tedi-horizontal-stepper-item__label"], children: d }),
|
|
38
|
+
p && /* @__PURE__ */ t("span", { className: e["tedi-horizontal-stepper-item__description"], children: p })
|
|
39
|
+
] })
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
C.displayName = "HorizontalStepperItem";
|
|
47
|
+
export {
|
|
48
|
+
C as HorizontalStepperItem,
|
|
49
|
+
C as default
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),f=require("../../../../../external/classnames/index.cjs.js"),a=require("react"),e=require("./horizontal-stepper.module.scss.cjs.js"),S=require("./horizontal-stepper-context.cjs.js"),i=require("./horizontal-stepper-item.cjs.js"),l=a.forwardRef(({children:s,"aria-label":u,background:d="default",compact:r="sm",className:m},z)=>{let n=0;const c=a.Children.map(s,t=>a.isValidElement(t)&&t.type===i.HorizontalStepperItem?(n+=1,o.jsx(S.HorizontalStepperStepNumberContext.Provider,{value:n,children:t})):t);return o.jsx("nav",{ref:z,"aria-label":u,"data-name":"horizontal-stepper",className:f.default(e.default["tedi-horizontal-stepper"],{[e.default["tedi-horizontal-stepper--transparent"]]:d==="transparent",[e.default["tedi-horizontal-stepper--compact"]]:r===!0},typeof r=="string"&&e.default[`tedi-horizontal-stepper--compact-${r}`],m),children:o.jsx("ol",{className:e.default["tedi-horizontal-stepper__list"],children:c})})});l.displayName="HorizontalStepper";const p=Object.assign(l,{Item:i.HorizontalStepperItem});exports.HorizontalStepper=p;exports.default=p;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type HorizontalStepperBackground = 'default' | 'transparent';
|
|
3
|
+
export type HorizontalStepperCompact = boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
4
|
+
export interface HorizontalStepperProps {
|
|
5
|
+
/**
|
|
6
|
+
* `HorizontalStepper.Item` elements, one per step.
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Accessible name for the navigation landmark.
|
|
11
|
+
*/
|
|
12
|
+
'aria-label'?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Background style of the stepper track.
|
|
15
|
+
* @default default
|
|
16
|
+
*/
|
|
17
|
+
background?: HorizontalStepperBackground;
|
|
18
|
+
/**
|
|
19
|
+
* Collapse labels so only the indicators plus the selected step's label are
|
|
20
|
+
* visible. `true` collapses at every width; a breakpoint (`'sm'`, `'md'`,
|
|
21
|
+
* `'lg'`, `'xl'`, `'xxl'`) collapses only below that breakpoint.
|
|
22
|
+
* @default sm
|
|
23
|
+
*/
|
|
24
|
+
compact?: HorizontalStepperCompact;
|
|
25
|
+
/**
|
|
26
|
+
* Additional class name on the root element.
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare const HorizontalStepper: import('react').ForwardRefExoticComponent<HorizontalStepperProps & import('react').RefAttributes<HTMLElement>> & {
|
|
31
|
+
Item: {
|
|
32
|
+
(props: import('./horizontal-stepper-item').HorizontalStepperItemProps): JSX.Element;
|
|
33
|
+
displayName: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export default HorizontalStepper;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import z from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { forwardRef as u, Children as c, isValidElement as h } from "react";
|
|
4
|
+
import e from "./horizontal-stepper.module.scss.es.js";
|
|
5
|
+
import { HorizontalStepperStepNumberContext as N } from "./horizontal-stepper-context.es.js";
|
|
6
|
+
import { HorizontalStepperItem as p } from "./horizontal-stepper-item.es.js";
|
|
7
|
+
const i = u(
|
|
8
|
+
({ children: n, "aria-label": s, background: l = "default", compact: r = "sm", className: m }, d) => {
|
|
9
|
+
let a = 0;
|
|
10
|
+
const f = c.map(n, (t) => h(t) && t.type === p ? (a += 1, /* @__PURE__ */ o(N.Provider, { value: a, children: t })) : t);
|
|
11
|
+
return /* @__PURE__ */ o(
|
|
12
|
+
"nav",
|
|
13
|
+
{
|
|
14
|
+
ref: d,
|
|
15
|
+
"aria-label": s,
|
|
16
|
+
"data-name": "horizontal-stepper",
|
|
17
|
+
className: z(
|
|
18
|
+
e["tedi-horizontal-stepper"],
|
|
19
|
+
{
|
|
20
|
+
[e["tedi-horizontal-stepper--transparent"]]: l === "transparent",
|
|
21
|
+
[e["tedi-horizontal-stepper--compact"]]: r === !0
|
|
22
|
+
},
|
|
23
|
+
typeof r == "string" && e[`tedi-horizontal-stepper--compact-${r}`],
|
|
24
|
+
m
|
|
25
|
+
),
|
|
26
|
+
children: /* @__PURE__ */ o("ol", { className: e["tedi-horizontal-stepper__list"], children: f })
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
i.displayName = "HorizontalStepper";
|
|
32
|
+
const C = Object.assign(i, {
|
|
33
|
+
Item: p
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
C as HorizontalStepper,
|
|
37
|
+
C as default
|
|
38
|
+
};
|
package/src/tedi/components/navigation/horizontal-stepper/horizontal-stepper.module.scss.cjs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-horizontal-stepper":"tedi-horizontal-stepper-36325c11","tedi-horizontal-stepper--transparent":"tedi-horizontal-stepper--transparent-71968b15","tedi-horizontal-stepper--compact":"tedi-horizontal-stepper--compact-82fea631","tedi-horizontal-stepper-item":"tedi-horizontal-stepper-item-3e2a41ca","tedi-horizontal-stepper-item--selected":"tedi-horizontal-stepper-item--selected-490ca638","tedi-horizontal-stepper-item__step":"tedi-horizontal-stepper-item__step-615ed27d","tedi-horizontal-stepper-item__content":"tedi-horizontal-stepper-item__content-8f33417f","tedi-horizontal-stepper--compact-sm":"tedi-horizontal-stepper--compact-sm-326a14fe","tedi-horizontal-stepper--compact-md":"tedi-horizontal-stepper--compact-md-aa582376","tedi-horizontal-stepper--compact-lg":"tedi-horizontal-stepper--compact-lg-1520fc41","tedi-horizontal-stepper--compact-xl":"tedi-horizontal-stepper--compact-xl-242fb9b8","tedi-horizontal-stepper--compact-xxl":"tedi-horizontal-stepper--compact-xxl-c032d0fd","tedi-horizontal-stepper__list":"tedi-horizontal-stepper__list-6cdbd337","tedi-horizontal-stepper-item__indicator":"tedi-horizontal-stepper-item__indicator-ae18c372","tedi-horizontal-stepper-item__number":"tedi-horizontal-stepper-item__number-d8803c85","tedi-horizontal-stepper-item__label":"tedi-horizontal-stepper-item__label-002ac63e","tedi-horizontal-stepper-item__description":"tedi-horizontal-stepper-item__description-3c4a57e8","tedi-horizontal-stepper-item--completed":"tedi-horizontal-stepper-item--completed-e9724250","tedi-horizontal-stepper-item--error":"tedi-horizontal-stepper-item--error-8a7b6bbb"};exports.default=e;
|
package/src/tedi/components/navigation/horizontal-stepper/horizontal-stepper.module.scss.es.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
"tedi-horizontal-stepper": "tedi-horizontal-stepper-36325c11",
|
|
3
|
+
"tedi-horizontal-stepper--transparent": "tedi-horizontal-stepper--transparent-71968b15",
|
|
4
|
+
"tedi-horizontal-stepper--compact": "tedi-horizontal-stepper--compact-82fea631",
|
|
5
|
+
"tedi-horizontal-stepper-item": "tedi-horizontal-stepper-item-3e2a41ca",
|
|
6
|
+
"tedi-horizontal-stepper-item--selected": "tedi-horizontal-stepper-item--selected-490ca638",
|
|
7
|
+
"tedi-horizontal-stepper-item__step": "tedi-horizontal-stepper-item__step-615ed27d",
|
|
8
|
+
"tedi-horizontal-stepper-item__content": "tedi-horizontal-stepper-item__content-8f33417f",
|
|
9
|
+
"tedi-horizontal-stepper--compact-sm": "tedi-horizontal-stepper--compact-sm-326a14fe",
|
|
10
|
+
"tedi-horizontal-stepper--compact-md": "tedi-horizontal-stepper--compact-md-aa582376",
|
|
11
|
+
"tedi-horizontal-stepper--compact-lg": "tedi-horizontal-stepper--compact-lg-1520fc41",
|
|
12
|
+
"tedi-horizontal-stepper--compact-xl": "tedi-horizontal-stepper--compact-xl-242fb9b8",
|
|
13
|
+
"tedi-horizontal-stepper--compact-xxl": "tedi-horizontal-stepper--compact-xxl-c032d0fd",
|
|
14
|
+
"tedi-horizontal-stepper__list": "tedi-horizontal-stepper__list-6cdbd337",
|
|
15
|
+
"tedi-horizontal-stepper-item__indicator": "tedi-horizontal-stepper-item__indicator-ae18c372",
|
|
16
|
+
"tedi-horizontal-stepper-item__number": "tedi-horizontal-stepper-item__number-d8803c85",
|
|
17
|
+
"tedi-horizontal-stepper-item__label": "tedi-horizontal-stepper-item__label-002ac63e",
|
|
18
|
+
"tedi-horizontal-stepper-item__description": "tedi-horizontal-stepper-item__description-3c4a57e8",
|
|
19
|
+
"tedi-horizontal-stepper-item--completed": "tedi-horizontal-stepper-item--completed-e9724250",
|
|
20
|
+
"tedi-horizontal-stepper-item--error": "tedi-horizontal-stepper-item--error-8a7b6bbb"
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
t as default
|
|
24
|
+
};
|
package/src/tedi/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './components/content/text-group';
|
|
|
11
11
|
export * from './components/content/calendar/calendar';
|
|
12
12
|
export * from './components/loaders/spinner/spinner';
|
|
13
13
|
export * from './components/loaders/skeleton';
|
|
14
|
+
export * from './components/loaders/progress-bar';
|
|
14
15
|
export * from './components/tags/tag/tag';
|
|
15
16
|
export * from './components/tags/status-badge/status-badge';
|
|
16
17
|
export * from './components/tags/status-indicator/status-indicator';
|
|
@@ -30,6 +31,7 @@ export * from './components/notifications/toast/toast';
|
|
|
30
31
|
export * from './components/cards/card';
|
|
31
32
|
export * from './components/navigation/breadcrumbs';
|
|
32
33
|
export * from './components/navigation/hash-trigger/hash-trigger';
|
|
34
|
+
export * from './components/navigation/horizontal-stepper';
|
|
33
35
|
export * from './components/navigation/link/link';
|
|
34
36
|
export * from './components/navigation/pagination';
|
|
35
37
|
export * from './components/navigation/tabs';
|