@tedi-design-system/react 19.0.1-rc.2 → 19.1.0-rc.2
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/index.css +1 -1
- package/package.json +1 -1
- package/src/community/components/layout/sidenav/sidenav.cjs.js +1 -1
- package/src/community/components/layout/sidenav/sidenav.es.js +38 -40
- package/src/community/components/vertical-stepper/step-item/step-item.d.ts +6 -0
- package/src/community/components/vertical-stepper/sub-item/sub-item.d.ts +6 -0
- package/src/community/components/vertical-stepper/vertical-stepper.d.ts +6 -0
- package/src/tedi/components/content/collapse/collapse.cjs.js +1 -1
- package/src/tedi/components/content/collapse/collapse.d.ts +9 -0
- package/src/tedi/components/content/collapse/collapse.es.js +44 -35
- package/src/tedi/components/layout/sidenav/components/sidenav-item/sidenav-item.cjs.js +1 -1
- package/src/tedi/components/layout/sidenav/components/sidenav-item/sidenav-item.es.js +82 -85
- package/src/tedi/components/layout/sidenav/sidenav.cjs.js +1 -1
- package/src/tedi/components/layout/sidenav/sidenav.es.js +16 -16
- package/src/tedi/components/layout/top-nav/components/top-nav-item/top-nav-item.cjs.js +1 -1
- package/src/tedi/components/layout/top-nav/components/top-nav-item/top-nav-item.es.js +6 -7
- package/src/tedi/components/layout/top-nav/components/top-nav-separator/top-nav-separator.cjs.js +1 -1
- package/src/tedi/components/layout/top-nav/components/top-nav-separator/top-nav-separator.es.js +2 -2
- package/src/tedi/components/layout/top-nav/top-nav.cjs.js +1 -1
- package/src/tedi/components/layout/top-nav/top-nav.es.js +9 -8
- package/src/tedi/components/navigation/card-stepper/card-stepper-step.cjs.js +1 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper-step.d.ts +86 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper-step.es.js +5 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.cjs.js +1 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.d.ts +130 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.es.js +200 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.module.scss.cjs.js +1 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.module.scss.es.js +26 -0
- package/src/tedi/components/navigation/card-stepper/index.d.ts +2 -0
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-collapsible/table-of-contents-collapsible.cjs.js +1 -1
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-collapsible/table-of-contents-collapsible.es.js +36 -58
- package/src/tedi/components/navigation/vertical-stepper/index.d.ts +3 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-context.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-context.d.ts +10 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-context.es.js +8 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-item.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-item.d.ts +74 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-item.es.js +109 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-sub-item.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-sub-item.d.ts +47 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-sub-item.es.js +65 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.d.ts +28 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.es.js +32 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.module.scss.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.module.scss.es.js +34 -0
- package/src/tedi/components/overlays/sheet/sheet.cjs.js +1 -0
- package/src/tedi/components/overlays/sheet/sheet.d.ts +65 -0
- package/src/tedi/components/overlays/sheet/sheet.es.js +41 -0
- package/src/tedi/components/overlays/sheet/sheet.module.scss.cjs.js +1 -0
- package/src/tedi/components/overlays/sheet/sheet.module.scss.es.js +8 -0
- package/src/tedi/helpers/hooks/use-safe-id.cjs.js +1 -0
- package/src/tedi/helpers/hooks/use-safe-id.d.ts +16 -0
- package/src/tedi/helpers/hooks/use-safe-id.es.js +5 -0
- package/src/tedi/helpers/index.d.ts +1 -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 +42 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +113 -71
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +284 -272
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CardStepperStepProps } from './card-stepper-step';
|
|
3
|
+
/**
|
|
4
|
+
* Per-instance label overrides. When omitted, each label comes from the
|
|
5
|
+
* `LabelProvider` (`stepper.previous`, `stepper.next`, `stepper.open-steps`,
|
|
6
|
+
* `stepper.steps`, `stepper.status`).
|
|
7
|
+
*/
|
|
8
|
+
export interface CardStepperLabels {
|
|
9
|
+
/** Accessible label for the previous-step button. Defaults to the `stepper.previous` label. */
|
|
10
|
+
previous?: string;
|
|
11
|
+
/** Accessible label for the next-step button. Defaults to the `stepper.next` label. */
|
|
12
|
+
next?: string;
|
|
13
|
+
/** Accessible label for the button that opens the step list. Defaults to the `stepper.open-steps` label. */
|
|
14
|
+
openSteps?: string;
|
|
15
|
+
/** Heading of the step-list modal. Defaults to the `stepper.steps` label. */
|
|
16
|
+
modalHeading?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Screen-reader phrasing for the `N / M` counter (the visible "N / M" is hidden
|
|
19
|
+
* from assistive tech, since "N slash M" reads poorly). Defaults to the
|
|
20
|
+
* `stepper.status` label.
|
|
21
|
+
*/
|
|
22
|
+
status?: (current: number, total: number) => string;
|
|
23
|
+
}
|
|
24
|
+
export interface CardStepperProps {
|
|
25
|
+
/**
|
|
26
|
+
* `CardStepper.Step` elements (compound API) — the active step shows on the
|
|
27
|
+
* card, all steps in the modal. Alternative to the `steps` data prop.
|
|
28
|
+
*/
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Steps as data (alternative to `CardStepper.Step` children). Ignored when
|
|
32
|
+
* `children` contains `CardStepper.Step` elements.
|
|
33
|
+
*/
|
|
34
|
+
steps?: CardStepperStepProps[];
|
|
35
|
+
/**
|
|
36
|
+
* Active step index (0-based), controlled. Pair with `onStepChange`.
|
|
37
|
+
*/
|
|
38
|
+
activeStep?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Initial active step index for uncontrolled usage.
|
|
41
|
+
* @default 0
|
|
42
|
+
*/
|
|
43
|
+
defaultActiveStep?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Fired with the new index when the user navigates (arrows) or picks a step
|
|
46
|
+
* in the modal.
|
|
47
|
+
*/
|
|
48
|
+
onStepChange?: (index: number) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Show the active step's number in a ring indicator on the left. Ignored when
|
|
51
|
+
* `showNavigation` is set — the back arrow occupies the left slot instead.
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
showStepNumber?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Show a status icon next to the active step's title — a success check when the
|
|
57
|
+
* step's `state` is `'completed'`, a danger icon when it's `'error'`. Nothing is
|
|
58
|
+
* shown for other states.
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
showStatusIcon?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Where the active step's `description` sits relative to its title:
|
|
64
|
+
* - `'bottom'` (default) — below the title.
|
|
65
|
+
* - `'top'` — above the title, as a small secondary line.
|
|
66
|
+
* @default bottom
|
|
67
|
+
*/
|
|
68
|
+
descriptionPosition?: 'top' | 'bottom';
|
|
69
|
+
/**
|
|
70
|
+
* Where the `N / M` step counter sits:
|
|
71
|
+
* - `'inline'` (default) — in the trailing controls, next to the list / next button.
|
|
72
|
+
* - `'top'` — above the title (and removed from the trailing controls).
|
|
73
|
+
* @default inline
|
|
74
|
+
*/
|
|
75
|
+
counterPosition?: 'inline' | 'top';
|
|
76
|
+
/**
|
|
77
|
+
* Show the segmented progress bar below the row.
|
|
78
|
+
* @default true
|
|
79
|
+
*/
|
|
80
|
+
showProgress?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Show previous / next arrow buttons on the edges. They move sequentially and
|
|
83
|
+
* skip `disabled` steps.
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
showNavigation?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Show the list button and the step-list modal. Turn off for a read-only
|
|
89
|
+
* progress tracker or an arrows-only flow.
|
|
90
|
+
* @default true
|
|
91
|
+
*/
|
|
92
|
+
showStepList?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Which steps can be jumped to from the step-list modal:
|
|
95
|
+
* - `true` — any step
|
|
96
|
+
* - `false` — none (the list is read-only)
|
|
97
|
+
* - `'completed'` — only completed steps
|
|
98
|
+
* - `'completed-or-next'` — completed steps and the one immediately after the active step
|
|
99
|
+
*
|
|
100
|
+
* A per-step `disabled` always wins. The prev/next arrows are sequential and are
|
|
101
|
+
* **not** gated by this.
|
|
102
|
+
* @default true
|
|
103
|
+
*/
|
|
104
|
+
allowJump?: boolean | 'completed' | 'completed-or-next';
|
|
105
|
+
/**
|
|
106
|
+
* Heading element for the active step's title — set it to fit the surrounding
|
|
107
|
+
* page's heading hierarchy. The visual size is unchanged.
|
|
108
|
+
* @default h4
|
|
109
|
+
*/
|
|
110
|
+
headingElement?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
111
|
+
/**
|
|
112
|
+
* Accessible label overrides. Otherwise sourced from the `LabelProvider`.
|
|
113
|
+
*/
|
|
114
|
+
labels?: CardStepperLabels;
|
|
115
|
+
/**
|
|
116
|
+
* Accessible name for the card region.
|
|
117
|
+
*/
|
|
118
|
+
'aria-label'?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Additional class name applied to the card root.
|
|
121
|
+
*/
|
|
122
|
+
className?: string;
|
|
123
|
+
}
|
|
124
|
+
export declare const CardStepper: React.ForwardRefExoticComponent<CardStepperProps & React.RefAttributes<HTMLDivElement>> & {
|
|
125
|
+
Step: {
|
|
126
|
+
(_props: CardStepperStepProps): null;
|
|
127
|
+
displayName: string;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
export default CardStepper;
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { jsx as s, Fragment as le, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import _ from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import D, { forwardRef as me, useState as F, useId as ue } from "react";
|
|
4
|
+
import { Icon as he } from "../../base/icon/icon.es.js";
|
|
5
|
+
import { Text as V } from "../../base/typography/text/text.es.js";
|
|
6
|
+
import { Button as y } from "../../buttons/button/button.es.js";
|
|
7
|
+
import { Sheet as _e } from "../../overlays/sheet/sheet.es.js";
|
|
8
|
+
import { VerticalStepper as I } from "../vertical-stepper/vertical-stepper.es.js";
|
|
9
|
+
import t from "./card-stepper.module.scss.es.js";
|
|
10
|
+
import { CardStepperStep as z } from "./card-stepper-step.es.js";
|
|
11
|
+
import { useLabels as fe } from "../../../providers/label-provider/use-labels.es.js";
|
|
12
|
+
const J = me((q, G) => {
|
|
13
|
+
const {
|
|
14
|
+
children: K,
|
|
15
|
+
steps: Q,
|
|
16
|
+
activeStep: k,
|
|
17
|
+
defaultActiveStep: U = 0,
|
|
18
|
+
onStepChange: N,
|
|
19
|
+
showStepNumber: W = !0,
|
|
20
|
+
showStatusIcon: X = !1,
|
|
21
|
+
descriptionPosition: w = "bottom",
|
|
22
|
+
counterPosition: b = "inline",
|
|
23
|
+
showProgress: T = !0,
|
|
24
|
+
showNavigation: f = !1,
|
|
25
|
+
showStepList: L = !0,
|
|
26
|
+
allowJump: C = !0,
|
|
27
|
+
headingElement: Y = "h4",
|
|
28
|
+
labels: a,
|
|
29
|
+
"aria-label": Z,
|
|
30
|
+
className: $
|
|
31
|
+
} = q, { getLabel: m } = fe(), u = {
|
|
32
|
+
previous: (a == null ? void 0 : a.previous) ?? m("stepper.previous"),
|
|
33
|
+
next: (a == null ? void 0 : a.next) ?? m("stepper.next"),
|
|
34
|
+
openSteps: (a == null ? void 0 : a.openSteps) ?? m("stepper.open-steps"),
|
|
35
|
+
modalHeading: (a == null ? void 0 : a.modalHeading) ?? m("stepper.steps"),
|
|
36
|
+
status: (a == null ? void 0 : a.status) ?? ((e, r) => m("stepper.status", e, r))
|
|
37
|
+
}, x = D.Children.toArray(K).filter(
|
|
38
|
+
(e) => D.isValidElement(e) && e.type === z
|
|
39
|
+
).map((e) => e.props), n = x.length > 0 ? x : Q ?? [], j = k !== void 0, [ee, te] = F(U), h = n.length, d = Math.min(Math.max(j ? k : ee, 0), Math.max(h - 1, 0)), [A, v] = F(!1), re = ue(), o = n[d], E = W && !f, se = f || E, S = (e) => {
|
|
40
|
+
var r;
|
|
41
|
+
e < 0 || e >= h || e === d || (r = n[e]) != null && r.disabled || (j || te(e), N == null || N(e));
|
|
42
|
+
}, ae = (e) => {
|
|
43
|
+
const r = n[e];
|
|
44
|
+
return !r || r.disabled ? !1 : C === !0 ? !0 : C === !1 ? !1 : C === "completed" ? r.state === "completed" : r.state === "completed" || e === d + 1;
|
|
45
|
+
}, H = (e, r) => {
|
|
46
|
+
for (let p = e; p >= 0 && p < h; p += r)
|
|
47
|
+
if (!n[p].disabled) return p;
|
|
48
|
+
return -1;
|
|
49
|
+
}, M = H(d - 1, -1), O = H(d + 1, 1);
|
|
50
|
+
if (!o) return /* @__PURE__ */ s(le, {});
|
|
51
|
+
const oe = T && !o.bottomSlot, P = /* @__PURE__ */ c("span", { className: t["tedi-card-stepper__counter"], children: [
|
|
52
|
+
/* @__PURE__ */ c("span", { "aria-hidden": "true", children: [
|
|
53
|
+
d + 1,
|
|
54
|
+
" / ",
|
|
55
|
+
h
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ s("span", { className: "visually-hidden", children: u.status(d + 1, h) })
|
|
58
|
+
] }), g = o.description ? /* @__PURE__ */ s(V, { modifiers: "small", color: "tertiary", className: t["tedi-card-stepper__description"], children: o.description }) : null, R = w === "top" && g, ie = b === "top" || R, de = w === "bottom" && n.some((e) => e.description);
|
|
59
|
+
return /* @__PURE__ */ c(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
ref: G,
|
|
63
|
+
role: "group",
|
|
64
|
+
"aria-label": Z,
|
|
65
|
+
className: _(
|
|
66
|
+
t["tedi-card-stepper"],
|
|
67
|
+
{
|
|
68
|
+
[t["tedi-card-stepper--progress-flush"]]: oe,
|
|
69
|
+
[t["tedi-card-stepper--reserve-description"]]: de
|
|
70
|
+
},
|
|
71
|
+
$
|
|
72
|
+
),
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ c(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: _(t["tedi-card-stepper__main"], {
|
|
78
|
+
[t["tedi-card-stepper__main--no-lead"]]: !se
|
|
79
|
+
}),
|
|
80
|
+
children: [
|
|
81
|
+
f && /* @__PURE__ */ s(
|
|
82
|
+
y,
|
|
83
|
+
{
|
|
84
|
+
visualType: "neutral",
|
|
85
|
+
icon: "arrow_back",
|
|
86
|
+
className: _(t["tedi-card-stepper__lead"], t["tedi-card-stepper__nav-prev"]),
|
|
87
|
+
disabled: M === -1,
|
|
88
|
+
onClick: () => S(M),
|
|
89
|
+
children: u.previous
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
E && /* @__PURE__ */ s(
|
|
93
|
+
"span",
|
|
94
|
+
{
|
|
95
|
+
className: _(t["tedi-card-stepper__indicator"], t["tedi-card-stepper__lead"]),
|
|
96
|
+
"aria-hidden": "true",
|
|
97
|
+
children: d + 1
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ c("div", { className: t["tedi-card-stepper__body"], children: [
|
|
101
|
+
ie && /* @__PURE__ */ c("div", { className: t["tedi-card-stepper__top"], children: [
|
|
102
|
+
b === "top" && P,
|
|
103
|
+
R && g
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ c(V, { element: Y, id: re, modifiers: "h4", className: t["tedi-card-stepper__title"], children: [
|
|
106
|
+
o.title,
|
|
107
|
+
X && (o.state === "completed" || o.state === "error") && /* @__PURE__ */ s(
|
|
108
|
+
he,
|
|
109
|
+
{
|
|
110
|
+
name: o.state === "completed" ? "check" : "error",
|
|
111
|
+
color: o.state === "completed" ? "success" : "danger",
|
|
112
|
+
size: 18,
|
|
113
|
+
display: "block",
|
|
114
|
+
label: m(o.state === "completed" ? "stepper.completed" : "stepper.error"),
|
|
115
|
+
className: t["tedi-card-stepper__status-icon"]
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] }),
|
|
119
|
+
w === "bottom" && g && /* @__PURE__ */ s("div", { className: t["tedi-card-stepper__description-bottom"], children: g })
|
|
120
|
+
] }),
|
|
121
|
+
/* @__PURE__ */ c("div", { className: t["tedi-card-stepper__trail"], children: [
|
|
122
|
+
b === "inline" && P,
|
|
123
|
+
L && /* @__PURE__ */ s(
|
|
124
|
+
y,
|
|
125
|
+
{
|
|
126
|
+
visualType: "neutral",
|
|
127
|
+
icon: "list",
|
|
128
|
+
"aria-haspopup": "dialog",
|
|
129
|
+
"aria-expanded": A,
|
|
130
|
+
onClick: () => v(!0),
|
|
131
|
+
children: u.openSteps
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
f && /* @__PURE__ */ s(
|
|
135
|
+
y,
|
|
136
|
+
{
|
|
137
|
+
visualType: "neutral",
|
|
138
|
+
icon: "arrow_forward",
|
|
139
|
+
className: t["tedi-card-stepper__nav-next"],
|
|
140
|
+
disabled: O === -1,
|
|
141
|
+
onClick: () => S(O),
|
|
142
|
+
children: u.next
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
] })
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
T && /* @__PURE__ */ s("ol", { className: t["tedi-card-stepper__progress"], "aria-hidden": "true", children: n.map((e, r) => /* @__PURE__ */ s(
|
|
150
|
+
"li",
|
|
151
|
+
{
|
|
152
|
+
className: _(t["tedi-card-stepper__segment"], {
|
|
153
|
+
[t["tedi-card-stepper__segment--done"]]: r <= d
|
|
154
|
+
})
|
|
155
|
+
},
|
|
156
|
+
e.id ?? r
|
|
157
|
+
)) }),
|
|
158
|
+
o.bottomSlot && /* @__PURE__ */ s("div", { className: t["tedi-card-stepper__bottom-slot"], children: o.bottomSlot }),
|
|
159
|
+
L && /* @__PURE__ */ s(_e, { open: A, onToggle: v, title: u.modalHeading, children: /* @__PURE__ */ s(I, { "aria-label": u.modalHeading, children: n.map((e, r) => {
|
|
160
|
+
const p = ae(r), l = e.subSteps, ne = !!(l != null && l.some((i) => i.current));
|
|
161
|
+
return /* @__PURE__ */ s(
|
|
162
|
+
I.Item,
|
|
163
|
+
{
|
|
164
|
+
title: e.title,
|
|
165
|
+
description: e.description,
|
|
166
|
+
state: e.disabled ? "disabled" : e.state,
|
|
167
|
+
current: r === d && !ne,
|
|
168
|
+
onClick: p ? () => {
|
|
169
|
+
S(r), v(!1);
|
|
170
|
+
} : void 0,
|
|
171
|
+
defaultOpen: l ? e.defaultExpanded ?? r === d : void 0,
|
|
172
|
+
children: l == null ? void 0 : l.map((i, ce) => /* @__PURE__ */ s(
|
|
173
|
+
I.SubItem,
|
|
174
|
+
{
|
|
175
|
+
title: i.title,
|
|
176
|
+
state: i.disabled ? "disabled" : i.state,
|
|
177
|
+
current: i.current,
|
|
178
|
+
href: i.href,
|
|
179
|
+
onClick: i.onClick ? (pe) => {
|
|
180
|
+
var B;
|
|
181
|
+
(B = i.onClick) == null || B.call(i, pe), v(!1);
|
|
182
|
+
} : void 0
|
|
183
|
+
},
|
|
184
|
+
i.id ?? ce
|
|
185
|
+
))
|
|
186
|
+
},
|
|
187
|
+
e.id ?? r
|
|
188
|
+
);
|
|
189
|
+
}) }) })
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
});
|
|
194
|
+
J.displayName = "CardStepper";
|
|
195
|
+
const xe = Object.assign(J, {
|
|
196
|
+
Step: z
|
|
197
|
+
});
|
|
198
|
+
export {
|
|
199
|
+
xe as CardStepper
|
|
200
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-card-stepper":"tedi-card-stepper-990b287a","tedi-card-stepper--progress-flush":"tedi-card-stepper--progress-flush-23f58416","tedi-card-stepper__main":"tedi-card-stepper__main-ab70da77","tedi-card-stepper__main--no-lead":"tedi-card-stepper__main--no-lead-f358c4e9","tedi-card-stepper__body":"tedi-card-stepper__body-0df6ee92","tedi-card-stepper__trail":"tedi-card-stepper__trail-010e8317","tedi-card-stepper__lead":"tedi-card-stepper__lead-da7d326b","tedi-card-stepper__nav-prev":"tedi-card-stepper__nav-prev-274e6ce5","tedi-card-stepper__nav-next":"tedi-card-stepper__nav-next-697bbe17","tedi-card-stepper__indicator":"tedi-card-stepper__indicator-11d120ee","tedi-card-stepper__title":"tedi-card-stepper__title-93be7e94","tedi-card-stepper__status-icon":"tedi-card-stepper__status-icon-97374a76","tedi-card-stepper__top":"tedi-card-stepper__top-e92ed5ba","tedi-card-stepper__description":"tedi-card-stepper__description-f836d668","tedi-card-stepper__description-bottom":"tedi-card-stepper__description-bottom-c12f5c13","tedi-card-stepper--reserve-description":"tedi-card-stepper--reserve-description-ba59f2f8","tedi-card-stepper__bottom-slot":"tedi-card-stepper__bottom-slot-289c98d6","tedi-card-stepper__counter":"tedi-card-stepper__counter-6790f2c1","tedi-card-stepper__progress":"tedi-card-stepper__progress-05cbf5f8","tedi-card-stepper__segment":"tedi-card-stepper__segment-8303dffb","tedi-card-stepper__segment--done":"tedi-card-stepper__segment--done-332dd1fd"};exports.default=e;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
"tedi-card-stepper": "tedi-card-stepper-990b287a",
|
|
3
|
+
"tedi-card-stepper--progress-flush": "tedi-card-stepper--progress-flush-23f58416",
|
|
4
|
+
"tedi-card-stepper__main": "tedi-card-stepper__main-ab70da77",
|
|
5
|
+
"tedi-card-stepper__main--no-lead": "tedi-card-stepper__main--no-lead-f358c4e9",
|
|
6
|
+
"tedi-card-stepper__body": "tedi-card-stepper__body-0df6ee92",
|
|
7
|
+
"tedi-card-stepper__trail": "tedi-card-stepper__trail-010e8317",
|
|
8
|
+
"tedi-card-stepper__lead": "tedi-card-stepper__lead-da7d326b",
|
|
9
|
+
"tedi-card-stepper__nav-prev": "tedi-card-stepper__nav-prev-274e6ce5",
|
|
10
|
+
"tedi-card-stepper__nav-next": "tedi-card-stepper__nav-next-697bbe17",
|
|
11
|
+
"tedi-card-stepper__indicator": "tedi-card-stepper__indicator-11d120ee",
|
|
12
|
+
"tedi-card-stepper__title": "tedi-card-stepper__title-93be7e94",
|
|
13
|
+
"tedi-card-stepper__status-icon": "tedi-card-stepper__status-icon-97374a76",
|
|
14
|
+
"tedi-card-stepper__top": "tedi-card-stepper__top-e92ed5ba",
|
|
15
|
+
"tedi-card-stepper__description": "tedi-card-stepper__description-f836d668",
|
|
16
|
+
"tedi-card-stepper__description-bottom": "tedi-card-stepper__description-bottom-c12f5c13",
|
|
17
|
+
"tedi-card-stepper--reserve-description": "tedi-card-stepper--reserve-description-ba59f2f8",
|
|
18
|
+
"tedi-card-stepper__bottom-slot": "tedi-card-stepper__bottom-slot-289c98d6",
|
|
19
|
+
"tedi-card-stepper__counter": "tedi-card-stepper__counter-6790f2c1",
|
|
20
|
+
"tedi-card-stepper__progress": "tedi-card-stepper__progress-05cbf5f8",
|
|
21
|
+
"tedi-card-stepper__segment": "tedi-card-stepper__segment-8303dffb",
|
|
22
|
+
"tedi-card-stepper__segment--done": "tedi-card-stepper__segment--done-332dd1fd"
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
e as default
|
|
26
|
+
};
|
|
@@ -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"),N=require("../../../../../../../external/classnames/index.cjs.js"),s=require("react"),x=require("../../../../base/typography/text/text.cjs.js"),C=require("../../../../buttons/collapse-button/collapse-button.cjs.js"),E=require("../../../../overlays/sheet/sheet.cjs.js"),c=require("../../table-of-contents.cjs.js"),t=require("../../table-of-contents.module.scss.cjs.js"),S=require("../table-of-contents-list/table-of-contents-list.cjs.js"),y=require("../../../../../providers/label-provider/use-labels.cjs.js"),p=g=>{const{children:d,heading:u,ariaLabel:_,activeId:l,numbered:b=!1,sticky:j=!0,className:L}=g,{getLabel:f}=y.useLabels(),[n,a]=s.useState(!1),[o,O]=s.useState(null);s.useEffect(()=>{if(!n||!o)return;const v=q=>{q.target.closest("a, button")&&a(!1)};return o.addEventListener("click",v),()=>o.removeEventListener("click",v)},[n,o]);const i=(u===void 0?f("table-of-contents.title"):u)??f("table-of-contents.title"),h=_||i,r=s.useMemo(()=>c.childrenToNodes(d),[d]),m=s.useMemo(()=>c.buildActiveTrail(r,l),[r,l]),T=s.useMemo(()=>({activeId:l,numbered:b,ariaLabel:h,activeTrail:m}),[l,b,h,m]);return e.jsxs(c.TableOfContentsContext.Provider,{value:T,children:[e.jsxs("div",{className:N.default(t.default["tedi-table-of-contents__bar"],{[t.default["tedi-table-of-contents__bar--static"]]:!j},L),children:[e.jsx(x.Text,{modifiers:"bold",className:t.default["tedi-table-of-contents__bar-title"],children:i}),e.jsx(C.CollapseButton,{open:n,onOpenChange:a,underline:!1,"aria-haspopup":"dialog"})]}),e.jsx(E.Sheet,{open:n,onToggle:a,ariaLabel:i,className:t.default["tedi-table-of-contents__sheet"],header:e.jsxs("div",{className:t.default["tedi-table-of-contents__sheet-header"],children:[e.jsx(x.Text,{modifiers:"bold",className:t.default["tedi-table-of-contents__bar-title"],children:i}),e.jsx(C.CollapseButton,{open:n,onOpenChange:a,underline:!1})]}),children:e.jsx("div",{ref:O,className:t.default["tedi-table-of-contents"],children:e.jsx(S.TableOfContentsList,{nodes:r,heading:null})})})]})};p.displayName="TableOfContentsCollapsible";exports.TableOfContentsCollapsible=p;
|
|
@@ -1,80 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import k from "../../../../../../../external/classnames/index.es.js";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Text as
|
|
3
|
+
import { useState as v, useEffect as y, useMemo as c } from "react";
|
|
4
|
+
import { Text as g } from "../../../../base/typography/text/text.es.js";
|
|
5
5
|
import { CollapseButton as _ } from "../../../../buttons/collapse-button/collapse-button.es.js";
|
|
6
|
-
import {
|
|
6
|
+
import { Sheet as j } from "../../../../overlays/sheet/sheet.es.js";
|
|
7
|
+
import { childrenToNodes as H, buildActiveTrail as S, TableOfContentsContext as A } from "../../table-of-contents.es.js";
|
|
7
8
|
import t from "../../table-of-contents.module.scss.es.js";
|
|
8
|
-
import { TableOfContentsList as
|
|
9
|
+
import { TableOfContentsList as B } from "../table-of-contents-list/table-of-contents-list.es.js";
|
|
9
10
|
import { useLabels as I } from "../../../../../providers/label-provider/use-labels.es.js";
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const g = (y) => {
|
|
17
|
-
y.target.closest("a, button") && s(!1);
|
|
11
|
+
const M = (N) => {
|
|
12
|
+
const { children: d, heading: m, ariaLabel: C, activeId: n, numbered: f = !1, sticky: L = !0, className: T } = N, { getLabel: b } = I(), [o, a] = v(!1), [s, O] = v(null);
|
|
13
|
+
y(() => {
|
|
14
|
+
if (!o || !s) return;
|
|
15
|
+
const u = (E) => {
|
|
16
|
+
E.target.closest("a, button") && a(!1);
|
|
18
17
|
};
|
|
19
|
-
return
|
|
20
|
-
}, [
|
|
21
|
-
const
|
|
22
|
-
() => ({ activeId:
|
|
23
|
-
[
|
|
18
|
+
return s.addEventListener("click", u), () => s.removeEventListener("click", u);
|
|
19
|
+
}, [o, s]);
|
|
20
|
+
const l = (m === void 0 ? b("table-of-contents.title") : m) ?? b("table-of-contents.title"), p = C || l, i = c(() => H(d), [d]), h = c(() => S(i, n), [i, n]), x = c(
|
|
21
|
+
() => ({ activeId: n, numbered: f, ariaLabel: p, activeTrail: h }),
|
|
22
|
+
[n, f, p, h]
|
|
24
23
|
);
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ r(A.Provider, { value: x, children: [
|
|
25
|
+
/* @__PURE__ */ r(
|
|
27
26
|
"div",
|
|
28
27
|
{
|
|
29
28
|
className: k(
|
|
30
29
|
t["tedi-table-of-contents__bar"],
|
|
31
|
-
{ [t["tedi-table-of-contents__bar--static"]]: !
|
|
32
|
-
|
|
30
|
+
{ [t["tedi-table-of-contents__bar--static"]]: !L },
|
|
31
|
+
T
|
|
33
32
|
),
|
|
34
33
|
children: [
|
|
35
|
-
/* @__PURE__ */ e(
|
|
36
|
-
/* @__PURE__ */ e(
|
|
37
|
-
_,
|
|
38
|
-
{
|
|
39
|
-
open: n,
|
|
40
|
-
onOpenChange: s,
|
|
41
|
-
openText: o("open"),
|
|
42
|
-
closeText: o("close"),
|
|
43
|
-
underline: !1,
|
|
44
|
-
"aria-haspopup": "dialog"
|
|
45
|
-
}
|
|
46
|
-
)
|
|
34
|
+
/* @__PURE__ */ e(g, { modifiers: "bold", className: t["tedi-table-of-contents__bar-title"], children: l }),
|
|
35
|
+
/* @__PURE__ */ e(_, { open: o, onOpenChange: a, underline: !1, "aria-haspopup": "dialog" })
|
|
47
36
|
]
|
|
48
37
|
}
|
|
49
38
|
),
|
|
50
|
-
/* @__PURE__ */ e(
|
|
51
|
-
|
|
39
|
+
/* @__PURE__ */ e(
|
|
40
|
+
j,
|
|
52
41
|
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
open: o,
|
|
43
|
+
onToggle: a,
|
|
44
|
+
ariaLabel: l,
|
|
56
45
|
className: t["tedi-table-of-contents__sheet"],
|
|
57
|
-
children: [
|
|
58
|
-
/* @__PURE__ */ e(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
{
|
|
63
|
-
open: n,
|
|
64
|
-
onOpenChange: s,
|
|
65
|
-
openText: o("open"),
|
|
66
|
-
closeText: o("close"),
|
|
67
|
-
underline: !1
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
] }) }),
|
|
71
|
-
/* @__PURE__ */ e(r.Body, { children: /* @__PURE__ */ e("div", { ref: u, className: t["tedi-table-of-contents"], children: /* @__PURE__ */ e(A, { nodes: c, heading: null }) }) })
|
|
72
|
-
]
|
|
46
|
+
header: /* @__PURE__ */ r("div", { className: t["tedi-table-of-contents__sheet-header"], children: [
|
|
47
|
+
/* @__PURE__ */ e(g, { modifiers: "bold", className: t["tedi-table-of-contents__bar-title"], children: l }),
|
|
48
|
+
/* @__PURE__ */ e(_, { open: o, onOpenChange: a, underline: !1 })
|
|
49
|
+
] }),
|
|
50
|
+
children: /* @__PURE__ */ e("div", { ref: O, className: t["tedi-table-of-contents"], children: /* @__PURE__ */ e(B, { nodes: i, heading: null }) })
|
|
73
51
|
}
|
|
74
|
-
)
|
|
52
|
+
)
|
|
75
53
|
] });
|
|
76
54
|
};
|
|
77
|
-
|
|
55
|
+
M.displayName = "TableOfContentsCollapsible";
|
|
78
56
|
export {
|
|
79
|
-
|
|
57
|
+
M as TableOfContentsCollapsible
|
|
80
58
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext({compact:!1}),r=()=>e.useContext(t);exports.VerticalStepperContext=t;exports.useVerticalStepperContext=r;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface VerticalStepperContextValue {
|
|
3
|
+
/**
|
|
4
|
+
* Compact density — smaller indicators and tighter rows. Provided by the
|
|
5
|
+
* parent `VerticalStepper` so items and sub-items render in the same size.
|
|
6
|
+
*/
|
|
7
|
+
compact: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const VerticalStepperContext: React.Context<VerticalStepperContextValue>;
|
|
10
|
+
export declare const useVerticalStepperContext: () => VerticalStepperContextValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),D=require("../../../../../external/classnames/index.cjs.js"),r=require("react"),l=require("../../base/icon/icon.cjs.js"),O=require("../../base/typography/text/text.cjs.js"),P=require("../../buttons/collapse-button/collapse-button.cjs.js"),t=require("./vertical-stepper.module.scss.cjs.js"),A=require("./vertical-stepper-context.cjs.js"),G=require("../../../providers/label-provider/use-labels.cjs.js"),z=r.forwardRef((T,k)=>{const{getLabel:i}=G.useLabels(),{compact:a}=A.useVerticalStepperContext(),{title:n,description:m,state:s="default",current:_=!1,href:c,onClick:v,as:L,endSlot:h,children:x,open:f,defaultOpen:V,onToggle:d,className:$,index:w}=T,o=`tedi-vertical-stepper-sublist-${r.useId()}`,b=r.Children.count(x)>0,j=s==="disabled",N=!j&&(c!==void 0||v!==void 0),p=L??(c?"a":"button"),[B,R]=r.useState(V??!1),u=f??B,E=()=>{const C=!u;f===void 0&&R(C),d==null||d(C)},F=D.default(t.default["tedi-vertical-stepper__item"],t.default[`tedi-vertical-stepper__item--${s}`],{[t.default["tedi-vertical-stepper__item--current"]]:_,[t.default["tedi-vertical-stepper__item--has-children"]]:b},$),M=e.jsx("span",{className:t.default["tedi-vertical-stepper__indicator"],children:a?s==="completed"?e.jsx(l.Icon,{name:"check",size:16,color:"white",label:i("stepper.completed")}):s==="error"?e.jsx(l.Icon,{name:"priority_high",size:16,color:"white",label:i("stepper.error")}):null:e.jsx("span",{className:t.default["tedi-vertical-stepper__number"],children:w})}),g=e.jsxs(O.Text,{element:"span",className:t.default["tedi-vertical-stepper__label"],children:[e.jsx("span",{className:t.default["tedi-vertical-stepper__label-text"],children:n}),!a&&s==="completed"&&e.jsx(l.Icon,{name:"check",color:"success",size:16,display:"inline",label:i("stepper.completed"),className:t.default["tedi-vertical-stepper__label-icon"]}),!a&&s==="error"&&e.jsx(l.Icon,{name:"error",color:"danger",size:16,display:"inline",label:i("stepper.error"),className:t.default["tedi-vertical-stepper__label-icon"]}),j&&e.jsxs("span",{className:"visually-hidden",children:[" (",i("stepper.disabled"),")"]})]}),I=m&&e.jsx(O.Text,{element:"span",modifiers:"small",color:"tertiary",className:t.default["tedi-vertical-stepper__description"],children:m}),S=h&&e.jsx("div",{className:t.default["tedi-vertical-stepper__end-slot"],children:h}),y=_?"step":void 0,q=N?e.jsx(p,{href:p==="a"?c:void 0,type:p==="button"?"button":void 0,onClick:v,"aria-current":y,className:t.default["tedi-vertical-stepper__link"],children:g}):g;return e.jsxs("li",{ref:k,"aria-current":N?void 0:y,className:F,children:[M,e.jsx("div",{className:t.default["tedi-vertical-stepper__content"],children:b?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:t.default["tedi-vertical-stepper__toggle"],children:[q,e.jsx(P.CollapseButton,{id:`${o}-toggle`,hideText:!0,size:"small",open:u,onOpenChange:E,"aria-controls":o,"aria-label":typeof n=="string"?n:void 0,className:t.default["tedi-vertical-stepper__toggle-button"]})]}),I,S,e.jsx("ul",{id:o,hidden:!u,className:t.default["tedi-vertical-stepper__sub-list"],children:x})]}):e.jsxs(e.Fragment,{children:[q,I,S]})})]})});z.displayName="VerticalStepperItem";exports.VerticalStepperItem=z;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type VerticalStepperItemState = 'default' | 'completed' | 'error' | 'disabled';
|
|
3
|
+
export interface VerticalStepperItemProps {
|
|
4
|
+
/**
|
|
5
|
+
* Step title.
|
|
6
|
+
*/
|
|
7
|
+
title: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Optional secondary line rendered under the title.
|
|
10
|
+
*/
|
|
11
|
+
description?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Visual / semantic state of the step.
|
|
14
|
+
* - `completed` — green indicator + check icon
|
|
15
|
+
* - `error` — red indicator + error icon
|
|
16
|
+
* - `disabled` — muted, non-interactive
|
|
17
|
+
* @default default
|
|
18
|
+
*/
|
|
19
|
+
state?: VerticalStepperItemState;
|
|
20
|
+
/**
|
|
21
|
+
* Marks the step as the active one — blue indicator, bold blue title and
|
|
22
|
+
* `aria-current="step"`. Independent from `state`.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
current?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Navigates when set; renders the title as an anchor. Works for steps with
|
|
28
|
+
* sub-steps too — the title navigates and a separate toggle expands the list.
|
|
29
|
+
*/
|
|
30
|
+
href?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Click handler. Without `href` the title renders as a `<button>`. Works for
|
|
33
|
+
* steps with sub-steps too (alongside the expand toggle).
|
|
34
|
+
*/
|
|
35
|
+
onClick?: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Element used for the interactive title. Defaults to `'a'` when `href` is set,
|
|
38
|
+
* otherwise `'button'`. Ignored for `disabled` steps.
|
|
39
|
+
*/
|
|
40
|
+
as?: 'a' | 'button';
|
|
41
|
+
/**
|
|
42
|
+
* Content rendered at the end of the item, below the title / description — a
|
|
43
|
+
* `StatusBadge`, `Link`, `Button`, `Text`, etc. (Figma: "related assets".)
|
|
44
|
+
*/
|
|
45
|
+
endSlot?: React.ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* `VerticalStepper.SubItem` elements. When present the step becomes an
|
|
48
|
+
* expandable section: the title toggles the (collapsible) sub-step list.
|
|
49
|
+
*/
|
|
50
|
+
children?: React.ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Controlled open state of the sub-step list. Use with `onToggle`.
|
|
53
|
+
*/
|
|
54
|
+
open?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Initial open state of the sub-step list (uncontrolled).
|
|
57
|
+
*/
|
|
58
|
+
defaultOpen?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Fired when the sub-step list is toggled.
|
|
61
|
+
*/
|
|
62
|
+
onToggle?: (open: boolean) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Additional class name applied to the `<li>`.
|
|
65
|
+
*/
|
|
66
|
+
className?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Step number, injected automatically by `VerticalStepper`. Do not set manually.
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
index?: number;
|
|
72
|
+
}
|
|
73
|
+
export declare const VerticalStepperItem: React.ForwardRefExoticComponent<VerticalStepperItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
74
|
+
export default VerticalStepperItem;
|