@ogcio/design-system-react 1.15.1 → 1.15.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/dist/autocomplete/autocomplete.d.ts +5 -4
- package/dist/autocomplete/autocomplete.js +174 -138
- package/dist/autocomplete/types.d.ts +1 -0
- package/dist/autocomplete/use-autocomplete-controller.d.ts +3 -2
- package/dist/autocomplete/use-autocomplete-controller.js +90 -88
- package/dist/header/header.d.ts +1 -1
- package/dist/header/header.js +53 -56
- package/dist/header/types.d.ts +1 -0
- package/dist/hooks/use-aria-hider.js +1 -1
- package/dist/hooks/use-focus-trap.js +247 -242
- package/dist/input-text/input-text.d.ts +4 -4
- package/dist/input-text/input-text.js +68 -61
- package/dist/input-text/type.d.ts +4 -2
- package/dist/modal/modal.js +76 -75
- package/dist/progress-stepper/progress-stepper.d.ts +4 -2
- package/dist/progress-stepper/progress-stepper.js +103 -100
- package/dist/progress-stepper/types.d.ts +5 -0
- package/dist/select/select-menu.js +16 -14
- package/dist/select/select-next.js +187 -153
- package/dist/select/select-search.d.ts +12 -3
- package/dist/select/select-search.js +29 -21
- package/dist/styles.css +1 -1
- package/dist/text-input/text-input.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1,111 +1,113 @@
|
|
|
1
|
-
import { jsxs as v, jsx as
|
|
2
|
-
import { Children as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { ProgressStepperIndicator as
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as v, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Children as k } from "react";
|
|
3
|
+
import { cn as H } from "../cn.js";
|
|
4
|
+
import { Icon as L } from "../icon/icon.js";
|
|
5
|
+
import { ProgressStepperIndicator as u } from "./types.js";
|
|
6
|
+
const V = (e) => `calc(100% + ${e * 4 - 36}px)`, B = ({
|
|
7
7
|
isNextStep: e,
|
|
8
8
|
orientation: t = "horizontal",
|
|
9
|
-
isCurrentStep:
|
|
10
|
-
isCompleted:
|
|
9
|
+
isCurrentStep: a,
|
|
10
|
+
isCompleted: c,
|
|
11
11
|
verticalGap: l
|
|
12
12
|
}) => {
|
|
13
|
-
const
|
|
13
|
+
const s = t === "vertical" ? { height: V(l) } : void 0;
|
|
14
14
|
return /* @__PURE__ */ v(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
17
17
|
"data-orientation": t,
|
|
18
18
|
"data-next": e,
|
|
19
|
-
"data-completed":
|
|
20
|
-
"data-current":
|
|
19
|
+
"data-completed": c,
|
|
20
|
+
"data-current": a,
|
|
21
21
|
className: "gi-progress-stepper-step-connector",
|
|
22
22
|
"aria-hidden": "true",
|
|
23
|
-
style:
|
|
23
|
+
style: s,
|
|
24
24
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
25
|
+
/* @__PURE__ */ o("span", {}),
|
|
26
|
+
a ? /* @__PURE__ */ o("span", {}) : null
|
|
27
27
|
]
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
|
-
},
|
|
31
|
-
[
|
|
32
|
-
completed: /* @__PURE__ */
|
|
30
|
+
}, I = (e) => ({
|
|
31
|
+
[u.Hashtag]: {
|
|
32
|
+
completed: /* @__PURE__ */ o(L, { icon: "check" }),
|
|
33
33
|
current: () => "#",
|
|
34
34
|
next: () => "#"
|
|
35
35
|
},
|
|
36
|
-
[
|
|
37
|
-
completed: /* @__PURE__ */
|
|
38
|
-
current: (
|
|
39
|
-
next: (
|
|
36
|
+
[u.Number]: {
|
|
37
|
+
completed: /* @__PURE__ */ o(L, { icon: "check" }),
|
|
38
|
+
current: (a) => a,
|
|
39
|
+
next: (a) => a
|
|
40
40
|
}
|
|
41
|
-
})[e],
|
|
42
|
-
const { current: l, completed:
|
|
43
|
-
e ||
|
|
41
|
+
})[e], q = (e, t, a, c) => {
|
|
42
|
+
const { current: l, completed: s, next: i } = I(
|
|
43
|
+
e || u.Hashtag
|
|
44
44
|
);
|
|
45
|
-
return
|
|
46
|
-
},
|
|
45
|
+
return a ? s : c ? l(t) : i(t);
|
|
46
|
+
}, x = ({
|
|
47
47
|
isCurrentStep: e,
|
|
48
48
|
isCompleted: t,
|
|
49
|
-
isLastStep:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
isLastStep: a,
|
|
50
|
+
isDisabled: c = !1,
|
|
51
|
+
stepNumber: l,
|
|
52
|
+
orientation: s,
|
|
53
|
+
children: i,
|
|
54
|
+
indicator: d,
|
|
54
55
|
verticalSlot: n,
|
|
55
|
-
defaultOpen:
|
|
56
|
-
dataTestId:
|
|
57
|
-
ariaLabel:
|
|
58
|
-
verticalGap:
|
|
56
|
+
defaultOpen: g,
|
|
57
|
+
dataTestId: b,
|
|
58
|
+
ariaLabel: h,
|
|
59
|
+
verticalGap: m
|
|
59
60
|
}) => {
|
|
60
|
-
const
|
|
61
|
-
return /* @__PURE__ */ v("div", { className:
|
|
61
|
+
const f = !t && !e, r = s === "vertical" && (e || g || t), p = !!i;
|
|
62
|
+
return /* @__PURE__ */ v("div", { className: `gi-relative ${c ? "gi-disabled" : ""}`, children: [
|
|
62
63
|
/* @__PURE__ */ v(
|
|
63
64
|
"div",
|
|
64
65
|
{
|
|
65
66
|
className: "gi-progress-stepper-step-container",
|
|
66
|
-
"data-orientation":
|
|
67
|
+
"data-orientation": s,
|
|
67
68
|
"data-current": e,
|
|
68
69
|
"data-completed": t,
|
|
69
|
-
"data-
|
|
70
|
-
"data-
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
70
|
+
"data-disabled": c,
|
|
71
|
+
"data-next": f,
|
|
72
|
+
"data-indicator": d,
|
|
73
|
+
"aria-labelledby": `step-label-${l}`,
|
|
74
|
+
"data-testid": b || `step-label-${l}`,
|
|
75
|
+
"aria-label": p ? void 0 : h,
|
|
74
76
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
/* @__PURE__ */ o("div", { className: "gi-progress-stepper-step", "data-indicator": d, children: q(
|
|
78
|
+
d || u.Hashtag,
|
|
79
|
+
l,
|
|
78
80
|
t,
|
|
79
81
|
e
|
|
80
82
|
) }),
|
|
81
|
-
p && /* @__PURE__ */
|
|
83
|
+
p && /* @__PURE__ */ o(
|
|
82
84
|
"div",
|
|
83
85
|
{
|
|
84
86
|
className: "gi-progress-stepper-step-label",
|
|
85
|
-
"data-orientation":
|
|
86
|
-
id: `step-label-${
|
|
87
|
-
children:
|
|
87
|
+
"data-orientation": s,
|
|
88
|
+
id: `step-label-${l}`,
|
|
89
|
+
children: i
|
|
88
90
|
}
|
|
89
91
|
)
|
|
90
92
|
]
|
|
91
93
|
}
|
|
92
94
|
),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
a ? null : /* @__PURE__ */ o(
|
|
96
|
+
B,
|
|
95
97
|
{
|
|
96
98
|
isCurrentStep: e,
|
|
97
|
-
isNextStep:
|
|
99
|
+
isNextStep: f,
|
|
98
100
|
isCompleted: t,
|
|
99
|
-
orientation:
|
|
100
|
-
stepNumber:
|
|
101
|
-
verticalGap:
|
|
101
|
+
orientation: s,
|
|
102
|
+
stepNumber: l,
|
|
103
|
+
verticalGap: m
|
|
102
104
|
}
|
|
103
105
|
),
|
|
104
|
-
|
|
106
|
+
r && n && /* @__PURE__ */ o(
|
|
105
107
|
"div",
|
|
106
108
|
{
|
|
107
|
-
"data-testid": `vertical-step-slot-${
|
|
108
|
-
className:
|
|
109
|
+
"data-testid": `vertical-step-slot-${l - 1}`,
|
|
110
|
+
className: H("gi-ml-10", {
|
|
109
111
|
"gi-pt-5": p,
|
|
110
112
|
"-gi-mt-[34px]": !p && n
|
|
111
113
|
}),
|
|
@@ -113,78 +115,79 @@ const j = (e) => `calc(100% + ${e * 4 - 36}px)`, k = ({
|
|
|
113
115
|
}
|
|
114
116
|
)
|
|
115
117
|
] });
|
|
116
|
-
},
|
|
118
|
+
}, M = () => null, Q = ({
|
|
117
119
|
children: e,
|
|
118
120
|
currentStepIndex: t = 0,
|
|
119
|
-
orientation:
|
|
120
|
-
indicator:
|
|
121
|
+
orientation: a = "horizontal",
|
|
122
|
+
indicator: c = "number",
|
|
121
123
|
completeAll: l,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
stepStates: s,
|
|
125
|
+
dataTestId: i,
|
|
126
|
+
className: d,
|
|
124
127
|
verticalGap: n = 14
|
|
125
128
|
}) => {
|
|
126
|
-
var
|
|
127
|
-
const
|
|
129
|
+
var h, m;
|
|
130
|
+
const g = (m = (h = e[t]) == null ? void 0 : h.props) == null ? void 0 : m.children, b = a === "horizontal" && g;
|
|
128
131
|
return /* @__PURE__ */ v(
|
|
129
132
|
"div",
|
|
130
133
|
{
|
|
131
134
|
role: "presentation",
|
|
132
|
-
className:
|
|
133
|
-
"gi-flex":
|
|
135
|
+
className: H("gi-w-full", {
|
|
136
|
+
"gi-flex": a === "vertical"
|
|
134
137
|
}),
|
|
135
138
|
children: [
|
|
136
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ o(
|
|
137
140
|
"div",
|
|
138
141
|
{
|
|
139
142
|
"data-testid": "progress-stepper",
|
|
140
|
-
className:
|
|
143
|
+
className: H(
|
|
141
144
|
"gi-progress-stepper",
|
|
142
145
|
{
|
|
143
|
-
[`gi-gap-${n}`]:
|
|
146
|
+
[`gi-gap-${n}`]: a === "vertical"
|
|
144
147
|
},
|
|
145
|
-
|
|
148
|
+
d
|
|
146
149
|
),
|
|
147
|
-
"data-orientation":
|
|
150
|
+
"data-orientation": a,
|
|
148
151
|
role: "list",
|
|
149
152
|
"aria-live": "polite",
|
|
150
|
-
children:
|
|
151
|
-
var
|
|
153
|
+
children: k.map(e, (f, r) => {
|
|
154
|
+
var w, y;
|
|
152
155
|
const {
|
|
153
156
|
label: p = "",
|
|
154
|
-
defaultOpen:
|
|
155
|
-
ariaLabel:
|
|
156
|
-
} =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
B,
|
|
157
|
+
defaultOpen: O,
|
|
158
|
+
ariaLabel: P
|
|
159
|
+
} = f.props;
|
|
160
|
+
let $, N, z;
|
|
161
|
+
s && s[r] ? ($ = !!s[r].current, N = !!s[r].completed, z = !!s[r].disabled) : ($ = !l && t === r, N = l || r < t, z = !1);
|
|
162
|
+
const j = r === e.length - 1;
|
|
163
|
+
return /* @__PURE__ */ o("div", { className: "gi-w-full", role: "listitem", children: /* @__PURE__ */ o(
|
|
164
|
+
x,
|
|
163
165
|
{
|
|
164
|
-
stepNumber:
|
|
165
|
-
isCurrentStep:
|
|
166
|
-
isCompleted:
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
166
|
+
stepNumber: r + 1,
|
|
167
|
+
isCurrentStep: $,
|
|
168
|
+
isCompleted: N,
|
|
169
|
+
isDisabled: z,
|
|
170
|
+
orientation: a,
|
|
171
|
+
isLastStep: j,
|
|
172
|
+
verticalSlot: (y = (w = e[r]) == null ? void 0 : w.props) == null ? void 0 : y.children,
|
|
173
|
+
defaultOpen: O,
|
|
174
|
+
indicator: c,
|
|
175
|
+
dataTestId: i,
|
|
176
|
+
ariaLabel: P,
|
|
174
177
|
verticalGap: n,
|
|
175
178
|
children: p
|
|
176
179
|
},
|
|
177
|
-
|
|
180
|
+
i || `progress-stepper-step-${r}`
|
|
178
181
|
) });
|
|
179
182
|
})
|
|
180
183
|
}
|
|
181
184
|
),
|
|
182
|
-
|
|
185
|
+
b && /* @__PURE__ */ o(
|
|
183
186
|
"div",
|
|
184
187
|
{
|
|
185
188
|
className: "gi-h-full",
|
|
186
189
|
"data-testid": `horizontal-step-slot-${t}`,
|
|
187
|
-
children:
|
|
190
|
+
children: g
|
|
188
191
|
}
|
|
189
192
|
)
|
|
190
193
|
]
|
|
@@ -192,7 +195,7 @@ const j = (e) => `calc(100% + ${e * 4 - 36}px)`, k = ({
|
|
|
192
195
|
);
|
|
193
196
|
};
|
|
194
197
|
export {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
+
Q as ProgressStepper,
|
|
199
|
+
x as Step,
|
|
200
|
+
M as StepItem
|
|
198
201
|
};
|
|
@@ -23,6 +23,11 @@ export type ProgressStepperProps = {
|
|
|
23
23
|
indicator?: ProgressStepperIndicatorType;
|
|
24
24
|
className?: string;
|
|
25
25
|
verticalGap?: number;
|
|
26
|
+
stepStates?: {
|
|
27
|
+
completed?: boolean;
|
|
28
|
+
current?: boolean;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
}[];
|
|
26
31
|
};
|
|
27
32
|
export type InnerStepProps = {
|
|
28
33
|
children: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as b, jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as H, useState as
|
|
3
|
+
import { forwardRef as H, useState as N, useEffect as A, Children as K, isValidElement as P, cloneElement as v } from "react";
|
|
4
4
|
import { cn as F } from "../cn.js";
|
|
5
5
|
import { translate as B } from "../i18n/utility.js";
|
|
6
6
|
import { Icon as J } from "../icon/icon.js";
|
|
@@ -9,12 +9,12 @@ import { Label as U } from "../label/label.js";
|
|
|
9
9
|
import { Spinner as W } from "../spinner/spinner.js";
|
|
10
10
|
const se = H(
|
|
11
11
|
({ children: o, className: i, onChange: s, enableSearch: r, isLoading: c, showNoData: m }, g) => {
|
|
12
|
-
const [l, y] =
|
|
13
|
-
|
|
12
|
+
const [l, y] = N(""), [O, f] = N(!1), [S, w] = N([]);
|
|
13
|
+
A(() => {
|
|
14
14
|
f(!1), m && setTimeout(() => f(!0), 0);
|
|
15
|
-
}, [m]),
|
|
16
|
-
const R =
|
|
17
|
-
(a) =>
|
|
15
|
+
}, [m]), A(() => {
|
|
16
|
+
const R = K.toArray(o).filter(
|
|
17
|
+
(a) => P(a)
|
|
18
18
|
).map((a) => {
|
|
19
19
|
var L, M, T, I, k, E;
|
|
20
20
|
const q = (L = a == null ? void 0 : a.type) == null ? void 0 : L.componentType, D = l.toLowerCase();
|
|
@@ -24,7 +24,7 @@ const se = H(
|
|
|
24
24
|
if (typeof e.props.value == "string") {
|
|
25
25
|
const G = ((I = (T = (M = e == null ? void 0 : e.props) == null ? void 0 : M.children) == null ? void 0 : T.toString()) == null ? void 0 : I.toLowerCase()) || "", j = (E = (k = e == null ? void 0 : e.props) == null ? void 0 : k.value) == null ? void 0 : E.toLowerCase();
|
|
26
26
|
if (G.includes(D) || j.includes(D))
|
|
27
|
-
return
|
|
27
|
+
return v(e, {
|
|
28
28
|
onChange: s,
|
|
29
29
|
enableSearch: r
|
|
30
30
|
});
|
|
@@ -32,19 +32,19 @@ const se = H(
|
|
|
32
32
|
break;
|
|
33
33
|
}
|
|
34
34
|
case "SelectMenuGroupItem": {
|
|
35
|
-
const e = a, C =
|
|
35
|
+
const e = a, C = K.toArray(
|
|
36
36
|
e.props.children
|
|
37
|
-
).filter((t) =>
|
|
37
|
+
).filter((t) => P(t)).map((t) => {
|
|
38
38
|
var p;
|
|
39
|
-
return ((p = t == null ? void 0 : t.type) == null ? void 0 : p.componentType) === "SelectMenuOption" ?
|
|
39
|
+
return ((p = t == null ? void 0 : t.type) == null ? void 0 : p.componentType) === "SelectMenuOption" ? v(t, { onChange: s }) : null;
|
|
40
40
|
}).filter(
|
|
41
41
|
(t) => t !== null
|
|
42
42
|
).filter((t) => {
|
|
43
|
-
var $, z
|
|
44
|
-
const p = ((
|
|
43
|
+
var V, $, z;
|
|
44
|
+
const p = (($ = (V = t.props.children) == null ? void 0 : V.toString()) == null ? void 0 : $.toLowerCase()) || "", d = ((z = t.props.value) == null ? void 0 : z.toLowerCase()) || "";
|
|
45
45
|
return (p == null ? void 0 : p.includes(l.toLowerCase())) || (d == null ? void 0 : d.includes(l.toLowerCase()));
|
|
46
46
|
});
|
|
47
|
-
return C.length > 0 || l === "" ?
|
|
47
|
+
return C.length > 0 || l === "" ? v(e, {
|
|
48
48
|
children: C
|
|
49
49
|
}) : null;
|
|
50
50
|
}
|
|
@@ -56,7 +56,9 @@ const se = H(
|
|
|
56
56
|
}, [o, l, s]);
|
|
57
57
|
const h = (x) => {
|
|
58
58
|
y(x.target.value);
|
|
59
|
-
}, u = () => c ? /* @__PURE__ */ n("div", { className: "gi-select-menu-loading", children: /* @__PURE__ */ n(W, { size: "md" }) }) : O ? /* @__PURE__ */ n("div", { className: "gi-select-menu-option-not-found", children: B("autocomplete.noData"
|
|
59
|
+
}, u = () => c ? /* @__PURE__ */ n("div", { className: "gi-select-menu-loading", children: /* @__PURE__ */ n(W, { size: "md" }) }) : O ? /* @__PURE__ */ n("div", { className: "gi-select-menu-option-not-found", children: B("autocomplete.noData", {
|
|
60
|
+
defaultValue: "No data found."
|
|
61
|
+
}) }) : /* @__PURE__ */ n("ul", { children: S });
|
|
60
62
|
return /* @__PURE__ */ b("div", { ref: g, className: F("gi-select-menu-container", i), children: [
|
|
61
63
|
r && /* @__PURE__ */ n("div", { className: "gi-select-menu-input-container", children: /* @__PURE__ */ n(
|
|
62
64
|
Q,
|