@situaction/traq-ui-ste 1.2.44 → 1.2.45
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/dist/CheckCircle.es-ILxE75_k.mjs +35 -0
- package/dist/IconBase.es-DJ1oCtpo.mjs +49 -0
- package/dist/{X.es-BEJ-zMPl.mjs → X.es-agKqByBO.mjs} +20 -65
- package/dist/components/icon/Icon.js +8700 -8725
- package/dist/components/select-multi-items/SelectMultiItems.js +1 -1
- package/dist/components/stepper/Stepper.d.ts +2 -0
- package/dist/components/stepper/Stepper.js +87 -83
- package/dist/styles/Stepper.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useState as _, useRef as h } from "react";
|
|
3
|
-
import { n as v, s as C, a as x } from "../../X.es-
|
|
3
|
+
import { n as v, s as C, a as x } from "../../X.es-agKqByBO.mjs";
|
|
4
4
|
import { Button as M } from "../button/Button.js";
|
|
5
5
|
import "../icon-button/IconButton.js";
|
|
6
6
|
import { TagCounter as w } from "../tag-counter/TagCounter.js";
|
|
@@ -26,6 +26,8 @@ export interface StepperProps {
|
|
|
26
26
|
disabledIds?: string[];
|
|
27
27
|
/** If false, render only the dots/connectors (no item.content). */
|
|
28
28
|
showContent?: boolean;
|
|
29
|
+
/** If true, completed dots display a check icon instead of a filled dot. */
|
|
30
|
+
showCompletedCheck?: boolean;
|
|
29
31
|
/** Optional accessible label for each dot. */
|
|
30
32
|
getDotAriaLabel?: (item: StepITem, index: number, status: StepStatus) => string;
|
|
31
33
|
/** Dot button margin-top to align with the content on the right (px or CSS value). */
|
|
@@ -1,92 +1,95 @@
|
|
|
1
|
-
import { jsx as _, jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"dotButton--
|
|
17
|
-
"dotButton--
|
|
18
|
-
"dotButton--
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { jsx as _, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as m, useRef as E, useState as Z, useLayoutEffect as L } from "react";
|
|
3
|
+
import { s as tt } from "../../CheckCircle.es-ILxE75_k.mjs";
|
|
4
|
+
import '../../styles/Stepper.css';const et = "_wrapper_c4wm6_30", nt = "_steps_c4wm6_35", ot = "_row_c4wm6_42", st = "_connectorAbs_c4wm6_49", ct = "_connectorProgress_c4wm6_59", rt = "_connectorGradient_c4wm6_63", dt = "_connectorDefault_c4wm6_68", it = "_dotButton_c4wm6_74", at = "_dotButtonDisabled_c4wm6_89", ut = "_dotOuter_c4wm6_95", lt = "_dotInner_c4wm6_103", pt = "_rowNoContent_c4wm6_172", _t = "_content_c4wm6_177", n = {
|
|
5
|
+
wrapper: et,
|
|
6
|
+
steps: nt,
|
|
7
|
+
row: ot,
|
|
8
|
+
connectorAbs: st,
|
|
9
|
+
connectorProgress: ct,
|
|
10
|
+
connectorGradient: rt,
|
|
11
|
+
connectorDefault: dt,
|
|
12
|
+
dotButton: it,
|
|
13
|
+
dotButtonDisabled: at,
|
|
14
|
+
dotOuter: ut,
|
|
15
|
+
dotInner: lt,
|
|
16
|
+
"dotButton--upcoming": "_dotButton--upcoming_c4wm6_108",
|
|
17
|
+
"dotButton--active": "_dotButton--active_c4wm6_120",
|
|
18
|
+
"dotButton--completed": "_dotButton--completed_c4wm6_142",
|
|
19
|
+
"dotButton--completedCheck": "_dotButton--completedCheck_c4wm6_153",
|
|
20
|
+
"dotButton--disabled": "_dotButton--disabled_c4wm6_160",
|
|
21
|
+
rowNoContent: pt,
|
|
22
|
+
content: _t
|
|
23
|
+
}, ft = (o, i) => {
|
|
24
|
+
if (o === i) return !0;
|
|
25
|
+
if (o.length !== i.length) return !1;
|
|
26
|
+
for (let a = 0; a < o.length; a++) {
|
|
27
|
+
const p = o[a], u = i[a];
|
|
28
|
+
if (p.key !== u.key || p.leftPx !== u.leftPx || p.topPx !== u.topPx || p.heightPx !== u.heightPx || p.variant !== u.variant)
|
|
27
29
|
return !1;
|
|
28
30
|
}
|
|
29
31
|
return !0;
|
|
30
|
-
},
|
|
31
|
-
items:
|
|
32
|
-
onDotClick:
|
|
33
|
-
dotOffsetPx:
|
|
32
|
+
}, gt = ({
|
|
33
|
+
items: o,
|
|
34
|
+
onDotClick: i,
|
|
35
|
+
dotOffsetPx: a = 18,
|
|
34
36
|
dotsClickable: p = !0,
|
|
35
|
-
activeId:
|
|
37
|
+
activeId: u,
|
|
36
38
|
autoStatusFromActive: y = !0,
|
|
37
|
-
disabledIds:
|
|
39
|
+
disabledIds: B = [],
|
|
38
40
|
showContent: P = !0,
|
|
39
|
-
|
|
41
|
+
showCompletedCheck: N = !1,
|
|
42
|
+
getDotAriaLabel: x,
|
|
40
43
|
dotButtonMarginTop: I = "10px"
|
|
41
44
|
}) => {
|
|
42
|
-
const
|
|
43
|
-
() => ({ "--flowline-dot-offset": `${
|
|
44
|
-
[
|
|
45
|
-
), Y =
|
|
46
|
-
var
|
|
47
|
-
const t = new Set(
|
|
48
|
-
return
|
|
49
|
-
}, [
|
|
50
|
-
|
|
51
|
-
}, []), [D,
|
|
52
|
-
return
|
|
53
|
-
const t =
|
|
45
|
+
const z = m(
|
|
46
|
+
() => ({ "--flowline-dot-offset": `${a}px` }),
|
|
47
|
+
[a]
|
|
48
|
+
), Y = m(() => B.join("|"), [B]), w = m(() => {
|
|
49
|
+
var l, r;
|
|
50
|
+
const t = new Set(B), s = u ?? ((l = o.find((e) => e.status !== "disabled" && !t.has(e.id))) == null ? void 0 : l.id) ?? ((r = o[0]) == null ? void 0 : r.id), c = o.findIndex((e) => e.id === s);
|
|
51
|
+
return o.map((e, f) => e.status === "disabled" || t.has(e.id) ? "disabled" : y ? f < c ? "completed" : f === c ? "active" : "upcoming" : e.status ?? "upcoming");
|
|
52
|
+
}, [o, u, y, Y]), k = m(() => w.join("|"), [w]), K = m(() => o.map((t) => t.id).join("|"), [o]), R = E(null), g = E(/* @__PURE__ */ new Map()), q = m(() => (t) => (s) => {
|
|
53
|
+
g.current.set(t, s);
|
|
54
|
+
}, []), [D, F] = Z([]);
|
|
55
|
+
return L(() => {
|
|
56
|
+
const t = R.current;
|
|
54
57
|
if (!t) return;
|
|
55
58
|
let s = null;
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
for (let
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
key: `${
|
|
64
|
-
leftPx:
|
|
65
|
-
topPx:
|
|
66
|
-
heightPx:
|
|
67
|
-
variant:
|
|
59
|
+
const c = () => {
|
|
60
|
+
const e = t.getBoundingClientRect(), f = [], b = o.map((d) => d.id);
|
|
61
|
+
for (let d = 0; d < b.length - 1; d++) {
|
|
62
|
+
const $ = b[d], j = b[d + 1], A = g.current.get($), O = g.current.get(j);
|
|
63
|
+
if (!A || !O) continue;
|
|
64
|
+
const h = A.getBoundingClientRect(), v = O.getBoundingClientRect(), T = Math.round(h.left + h.width / 2 - e.left), H = h.top + h.height / 2 - e.top, J = v.top + v.height / 2 - e.top, Q = h.height / 2, U = v.height / 2, G = 2, M = Math.round(H + Q + G), V = Math.round(J - U - G), W = Math.max(0, V - M), S = w[d], X = S === "completed" ? "progress" : S === "active" ? "gradient" : "default";
|
|
65
|
+
f.push({
|
|
66
|
+
key: `${$}__${j}`,
|
|
67
|
+
leftPx: T,
|
|
68
|
+
topPx: M,
|
|
69
|
+
heightPx: W,
|
|
70
|
+
variant: X
|
|
68
71
|
});
|
|
69
72
|
}
|
|
70
|
-
|
|
71
|
-
},
|
|
73
|
+
F((d) => ft(d, f) ? d : f);
|
|
74
|
+
}, l = () => {
|
|
72
75
|
s == null && (s = requestAnimationFrame(() => {
|
|
73
|
-
s = null,
|
|
76
|
+
s = null, c();
|
|
74
77
|
}));
|
|
75
78
|
};
|
|
76
|
-
|
|
77
|
-
const r = new ResizeObserver(
|
|
78
|
-
return r.observe(t),
|
|
79
|
-
|
|
80
|
-
}), window.addEventListener("resize",
|
|
81
|
-
s != null && cancelAnimationFrame(s), r.disconnect(), window.removeEventListener("resize",
|
|
79
|
+
l();
|
|
80
|
+
const r = new ResizeObserver(l);
|
|
81
|
+
return r.observe(t), g.current.forEach((e) => {
|
|
82
|
+
e && r.observe(e);
|
|
83
|
+
}), window.addEventListener("resize", l), () => {
|
|
84
|
+
s != null && cancelAnimationFrame(s), r.disconnect(), window.removeEventListener("resize", l);
|
|
82
85
|
};
|
|
83
|
-
}, [K,
|
|
86
|
+
}, [K, k]), /* @__PURE__ */ _("div", { className: n.wrapper, style: z, children: /* @__PURE__ */ C("div", { ref: R, className: n.steps, children: [
|
|
84
87
|
D.map((t) => /* @__PURE__ */ _(
|
|
85
88
|
"span",
|
|
86
89
|
{
|
|
87
90
|
className: [
|
|
88
|
-
|
|
89
|
-
t.variant === "progress" ?
|
|
91
|
+
n.connectorAbs,
|
|
92
|
+
t.variant === "progress" ? n.connectorProgress : t.variant === "gradient" ? n.connectorGradient : n.connectorDefault
|
|
90
93
|
].join(" "),
|
|
91
94
|
style: {
|
|
92
95
|
left: `${t.leftPx}px`,
|
|
@@ -97,36 +100,37 @@ import '../../styles/Stepper.css';const L = "_wrapper_lh0wd_30", tt = "_steps_lh
|
|
|
97
100
|
},
|
|
98
101
|
t.key
|
|
99
102
|
)),
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
+
o.map((t, s) => {
|
|
104
|
+
const c = w[s], r = p && !(c === "disabled") && !!i;
|
|
105
|
+
return /* @__PURE__ */ C(
|
|
103
106
|
"div",
|
|
104
107
|
{
|
|
105
108
|
className: [
|
|
106
|
-
|
|
107
|
-
P ? "" :
|
|
109
|
+
n.row,
|
|
110
|
+
P ? "" : n.rowNoContent
|
|
108
111
|
].filter(Boolean).join(" "),
|
|
109
|
-
style: { columnGap: `${
|
|
112
|
+
style: { columnGap: `${a}px` },
|
|
110
113
|
children: [
|
|
111
114
|
/* @__PURE__ */ _(
|
|
112
115
|
"button",
|
|
113
116
|
{
|
|
114
117
|
type: "button",
|
|
115
118
|
className: [
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
n.dotButton,
|
|
120
|
+
n[`dotButton--${c}`],
|
|
121
|
+
c === "completed" && N ? n["dotButton--completedCheck"] : "",
|
|
122
|
+
r ? "" : n.dotButtonDisabled
|
|
119
123
|
].filter(Boolean).join(" "),
|
|
120
124
|
style: { marginTop: I ?? "0" },
|
|
121
125
|
onClick: () => {
|
|
122
|
-
r && (
|
|
126
|
+
r && (i == null || i(t.id));
|
|
123
127
|
},
|
|
124
|
-
"aria-label": (
|
|
128
|
+
"aria-label": (x == null ? void 0 : x(t, s, c)) ?? `Open step ${t.id}`,
|
|
125
129
|
disabled: !r,
|
|
126
|
-
children: /* @__PURE__ */ _("span", { ref: q(t.id), className:
|
|
130
|
+
children: /* @__PURE__ */ _("span", { ref: q(t.id), className: n.dotOuter, children: c === "completed" && N ? /* @__PURE__ */ _(tt, { size: 14, weight: "bold" }) : /* @__PURE__ */ _("span", { className: n.dotInner }) })
|
|
127
131
|
}
|
|
128
132
|
),
|
|
129
|
-
P ? /* @__PURE__ */ _("div", { className:
|
|
133
|
+
P ? /* @__PURE__ */ _("div", { className: n.content, children: t.content }) : null
|
|
130
134
|
]
|
|
131
135
|
},
|
|
132
136
|
t.id
|
|
@@ -135,5 +139,5 @@ import '../../styles/Stepper.css';const L = "_wrapper_lh0wd_30", tt = "_steps_lh
|
|
|
135
139
|
] }) });
|
|
136
140
|
};
|
|
137
141
|
export {
|
|
138
|
-
|
|
142
|
+
gt as Stepper
|
|
139
143
|
};
|
package/dist/styles/Stepper.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._wrapper_c4wm6_30{--stepper-left-col: 20px;--stepper-dot-button: 24px}._steps_c4wm6_35{position:relative;display:flex;flex-direction:column;gap:.625rem}._row_c4wm6_42{display:grid;grid-template-columns:var(--stepper-left-col) 1fr;align-items:start}._connectorAbs_c4wm6_49{position:absolute;width:1px;transform:translate(-50%);border-radius:999px;pointer-events:none;z-index:0}._connectorProgress_c4wm6_59{background:var(--flow-point-line-active)}._connectorGradient_c4wm6_63{background:linear-gradient(to bottom,var(--flow-point-line-active),var(--flow-point-line-inactive))}._connectorDefault_c4wm6_68{background-image:linear-gradient(to bottom,var(--flow-point-line-inactive) 50%,transparent 0);background-size:2px 8px;background-repeat:repeat-y}._dotButton_c4wm6_74{width:var(--stepper-dot-button);height:var(--stepper-dot-button);padding:0;border:0;background:transparent;display:flex;align-items:center;justify-content:center;cursor:pointer;transform:translateY(var(--stepper-dot-offset-y, 0px));position:relative;z-index:1}._dotButtonDisabled_c4wm6_89{cursor:default;opacity:.5}._dotOuter_c4wm6_95{display:flex;align-items:center;justify-content:center;border-radius:999px;transform:translateY(var(--stepper-dot-offset-y, 0px))}._dotInner_c4wm6_103{border-radius:999px}._dotButton--upcoming_c4wm6_108 ._dotOuter_c4wm6_95{width:10px;height:10px;border:none;background:var(--flow-point-line-inactive)}._dotButton--upcoming_c4wm6_108 ._dotInner_c4wm6_103{display:none}._dotButton--active_c4wm6_120 ._dotOuter_c4wm6_95{width:16px;height:16px;border-radius:999px;border:1px solid var(--flow-point-line-active);background:transparent;padding:1px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}._dotButton--active_c4wm6_120 ._dotInner_c4wm6_103{width:10px;height:10px;border-radius:999px;background:var(--flow-point-line-active);display:block}._dotButton--completed_c4wm6_142 ._dotOuter_c4wm6_95{width:10px;height:10px;background:var(--flow-point-line-active)}._dotButton--completed_c4wm6_142 ._dotInner_c4wm6_103{display:none}._dotButton--completedCheck_c4wm6_153 ._dotOuter_c4wm6_95{width:16px;height:16px;color:#fff}._dotButton--disabled_c4wm6_160 ._dotOuter_c4wm6_95{width:10px;height:10px;border:none;background:var(--general-border-window);opacity:.6}._dotButton--disabled_c4wm6_160 ._dotInner_c4wm6_103{display:none}._rowNoContent_c4wm6_172{grid-template-columns:var(--stepper-left-col);column-gap:0}._rowNoContent_c4wm6_172 ._content_c4wm6_177{display:none}
|