@tedi-design-system/react 19.1.0 → 19.1.2-rc.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tedi-design-system/react",
|
|
3
|
-
"version": "19.1.
|
|
3
|
+
"version": "19.1.2-rc.1",
|
|
4
4
|
"description": "TEDI Design System React component library — accessible, reusable UI components. Docs & live examples: https://storybook.tedi.ee/react/rc/",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),D=require("../../../../../external/classnames/index.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),D=require("../../../../../external/classnames/index.cjs.js"),i=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"),T=i.forwardRef((k,z)=>{const{getLabel:r}=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}=k,o=`tedi-vertical-stepper-sublist-${i.useId()}`,b=i.Children.count(x)>0,j=s==="disabled",N=!j&&(c!==void 0||v!==void 0),p=L??(c?"a":"button"),[B,R]=i.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:r("stepper.completed")}):s==="error"?e.jsx(l.Icon,{name:"priority_high",size:16,color:"white",label:r("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:r("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:r("stepper.error"),className:t.default["tedi-vertical-stepper__label-icon"]}),j&&e.jsxs("span",{className:"visually-hidden",children:[" (",r("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:z,"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,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]})})]})});T.displayName="VerticalStepperItem";exports.VerticalStepperItem=T;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as i, Fragment as z } from "react/jsx-runtime";
|
|
2
2
|
import q from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import A, { forwardRef as G, useId as H, useState as J } from "react";
|
|
4
4
|
import { Icon as l } from "../../base/icon/icon.es.js";
|
|
@@ -11,7 +11,7 @@ const U = G((L, T) => {
|
|
|
11
11
|
const { getLabel: s } = Q(), { compact: a } = P(), {
|
|
12
12
|
title: c,
|
|
13
13
|
description: _,
|
|
14
|
-
state:
|
|
14
|
+
state: r = "default",
|
|
15
15
|
current: h = !1,
|
|
16
16
|
href: n,
|
|
17
17
|
onClick: v,
|
|
@@ -23,20 +23,20 @@ const U = G((L, T) => {
|
|
|
23
23
|
onToggle: o,
|
|
24
24
|
className: j,
|
|
25
25
|
index: B
|
|
26
|
-
} = L, p = `tedi-vertical-stepper-sublist-${H()}`, N = A.Children.count(b) > 0, g =
|
|
27
|
-
const
|
|
28
|
-
f === void 0 && R(
|
|
26
|
+
} = L, p = `tedi-vertical-stepper-sublist-${H()}`, N = A.Children.count(b) > 0, g = r === "disabled", x = !g && (n !== void 0 || v !== void 0), d = V ?? (n ? "a" : "button"), [E, R] = J($ ?? !1), m = f ?? E, D = () => {
|
|
27
|
+
const k = !m;
|
|
28
|
+
f === void 0 && R(k), o == null || o(k);
|
|
29
29
|
}, F = q(
|
|
30
30
|
e["tedi-vertical-stepper__item"],
|
|
31
|
-
e[`tedi-vertical-stepper__item--${
|
|
31
|
+
e[`tedi-vertical-stepper__item--${r}`],
|
|
32
32
|
{
|
|
33
33
|
[e["tedi-vertical-stepper__item--current"]]: h,
|
|
34
34
|
[e["tedi-vertical-stepper__item--has-children"]]: N
|
|
35
35
|
},
|
|
36
36
|
j
|
|
37
|
-
), M = /* @__PURE__ */ t("span", { className: e["tedi-vertical-stepper__indicator"], children: a ?
|
|
37
|
+
), M = /* @__PURE__ */ t("span", { className: e["tedi-vertical-stepper__indicator"], children: a ? r === "completed" ? /* @__PURE__ */ t(l, { name: "check", size: 16, color: "white", label: s("stepper.completed") }) : r === "error" ? /* @__PURE__ */ t(l, { name: "priority_high", size: 16, color: "white", label: s("stepper.error") }) : null : /* @__PURE__ */ t("span", { className: e["tedi-vertical-stepper__number"], children: B }) }), y = /* @__PURE__ */ i(w, { element: "span", className: e["tedi-vertical-stepper__label"], children: [
|
|
38
38
|
/* @__PURE__ */ t("span", { className: e["tedi-vertical-stepper__label-text"], children: c }),
|
|
39
|
-
!a &&
|
|
39
|
+
!a && r === "completed" && /* @__PURE__ */ t(
|
|
40
40
|
l,
|
|
41
41
|
{
|
|
42
42
|
name: "check",
|
|
@@ -47,7 +47,7 @@ const U = G((L, T) => {
|
|
|
47
47
|
className: e["tedi-vertical-stepper__label-icon"]
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
|
-
!a &&
|
|
50
|
+
!a && r === "error" && /* @__PURE__ */ t(
|
|
51
51
|
l,
|
|
52
52
|
{
|
|
53
53
|
name: "error",
|
|
@@ -58,12 +58,12 @@ const U = G((L, T) => {
|
|
|
58
58
|
className: e["tedi-vertical-stepper__label-icon"]
|
|
59
59
|
}
|
|
60
60
|
),
|
|
61
|
-
g && /* @__PURE__ */
|
|
61
|
+
g && /* @__PURE__ */ i("span", { className: "visually-hidden", children: [
|
|
62
62
|
" (",
|
|
63
63
|
s("stepper.disabled"),
|
|
64
64
|
")"
|
|
65
65
|
] })
|
|
66
|
-
] }), I = _ && /* @__PURE__ */ t(w, { element: "span", modifiers: "small", color: "tertiary", className: e["tedi-vertical-stepper__description"], children: _ }), C = u && /* @__PURE__ */ t("div", { className: e["tedi-vertical-stepper__end-slot"], children: u }), S = h ? "step" : void 0,
|
|
66
|
+
] }), I = _ && /* @__PURE__ */ t(w, { element: "span", modifiers: "small", color: "tertiary", className: e["tedi-vertical-stepper__description"], children: _ }), C = u && /* @__PURE__ */ t("div", { className: e["tedi-vertical-stepper__end-slot"], children: u }), S = h ? "step" : void 0, O = x ? /* @__PURE__ */ t(
|
|
67
67
|
d,
|
|
68
68
|
{
|
|
69
69
|
href: d === "a" ? n : void 0,
|
|
@@ -74,17 +74,16 @@ const U = G((L, T) => {
|
|
|
74
74
|
children: y
|
|
75
75
|
}
|
|
76
76
|
) : y;
|
|
77
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ i("li", { ref: T, "aria-current": x ? void 0 : S, className: F, children: [
|
|
78
78
|
M,
|
|
79
|
-
/* @__PURE__ */ t("div", { className: e["tedi-vertical-stepper__content"], children: N ? /* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
|
|
79
|
+
/* @__PURE__ */ t("div", { className: e["tedi-vertical-stepper__content"], children: N ? /* @__PURE__ */ i(z, { children: [
|
|
80
|
+
/* @__PURE__ */ i("div", { className: e["tedi-vertical-stepper__toggle"], children: [
|
|
81
|
+
O,
|
|
82
82
|
/* @__PURE__ */ t(
|
|
83
83
|
K,
|
|
84
84
|
{
|
|
85
85
|
id: `${p}-toggle`,
|
|
86
86
|
hideText: !0,
|
|
87
|
-
size: "small",
|
|
88
87
|
open: m,
|
|
89
88
|
onOpenChange: D,
|
|
90
89
|
"aria-controls": p,
|
|
@@ -96,8 +95,8 @@ const U = G((L, T) => {
|
|
|
96
95
|
I,
|
|
97
96
|
C,
|
|
98
97
|
/* @__PURE__ */ t("ul", { id: p, hidden: !m, className: e["tedi-vertical-stepper__sub-list"], children: b })
|
|
99
|
-
] }) : /* @__PURE__ */
|
|
100
|
-
|
|
98
|
+
] }) : /* @__PURE__ */ i(z, { children: [
|
|
99
|
+
O,
|
|
101
100
|
I,
|
|
102
101
|
C
|
|
103
102
|
] }) })
|