@iress-oss/ids-components 6.0.0-alpha.18 → 6.0.0-alpha.19
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/components/Badge/Badge.d.ts +2 -6
- package/dist/components/Badge/Badge.js +27 -40
- package/dist/components/Badge/Badge.styles.d.ts +1 -17
- package/dist/components/Badge/Badge.styles.js +3 -24
- package/dist/components/Input/Input.styles.d.ts +3 -0
- package/dist/components/Input/Input.styles.js +3 -0
- package/dist/components/Progress/Progress.js +1 -1
- package/dist/components/Slideout/hooks/usePushElement.js +1 -1
- package/dist/components/TabSet/Tab/Tab.js +98 -84
- package/dist/components/TabSet/Tab/Tab.styles.d.ts +3 -0
- package/dist/components/TabSet/Tab/Tab.styles.js +5 -2
- package/dist/components/TabSet/TabSet.js +84 -66
- package/dist/components/TabSet/TabSet.styles.d.ts +30 -1
- package/dist/components/TabSet/TabSet.styles.js +75 -16
- package/dist/{index-Bm5rQqn5.js → index-0AvnPY9d.js} +15 -15
- package/dist/patterns/Shadow/Shadow.js +176 -139
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { IressStyledProps, Statuses } from '../../types';
|
|
3
3
|
export interface IressBadgeProps extends IressStyledProps<'span'> {
|
|
4
4
|
/**
|
|
5
5
|
* Content of the badge.
|
|
6
6
|
*/
|
|
7
7
|
children?: ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Element to attach the badge to.
|
|
10
|
-
*/
|
|
11
|
-
host?: ReactElement;
|
|
12
8
|
/**
|
|
13
9
|
* Style of the badge.
|
|
14
10
|
*/
|
|
@@ -19,6 +15,6 @@ export interface IressBadgeProps extends IressStyledProps<'span'> {
|
|
|
19
15
|
pill?: boolean;
|
|
20
16
|
}
|
|
21
17
|
export declare const IressBadge: {
|
|
22
|
-
({ children, mode, pill, className,
|
|
18
|
+
({ children, mode, pill, className, ...restProps }: IressBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
23
19
|
displayName: string;
|
|
24
20
|
};
|
|
@@ -1,48 +1,35 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { s as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
host: s,
|
|
15
|
-
...a
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "../../css-DNdLYQld.js";
|
|
3
|
+
import { c as i } from "../../cx-DN21T1EH.js";
|
|
4
|
+
import { badge as n } from "./Badge.styles.js";
|
|
5
|
+
import { s as d } from "../../factory-CsinCTPr.js";
|
|
6
|
+
import { s as f } from "../../is-valid-prop-DweT-eOL.js";
|
|
7
|
+
import { GlobalCSSClass as g } from "../../enums.js";
|
|
8
|
+
const y = ({
|
|
9
|
+
children: o,
|
|
10
|
+
mode: r = "neutral",
|
|
11
|
+
pill: a,
|
|
12
|
+
className: t,
|
|
13
|
+
...e
|
|
16
14
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
mode:
|
|
19
|
-
pill:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
const s = n.raw({
|
|
16
|
+
mode: r,
|
|
17
|
+
pill: a
|
|
18
|
+
}), [m, p] = f(e);
|
|
19
|
+
return /* @__PURE__ */ l(
|
|
20
|
+
d.span,
|
|
23
21
|
{
|
|
24
|
-
...
|
|
25
|
-
className:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
...p,
|
|
23
|
+
className: i(
|
|
24
|
+
c(s.root, s.badge, m),
|
|
25
|
+
t,
|
|
26
|
+
g.Badge
|
|
29
27
|
),
|
|
30
|
-
children:
|
|
28
|
+
children: o
|
|
31
29
|
}
|
|
32
30
|
);
|
|
33
|
-
return s ? /* @__PURE__ */ n(
|
|
34
|
-
"div",
|
|
35
|
-
{
|
|
36
|
-
className: r(o.host),
|
|
37
|
-
"data-testid": f(a["data-testid"], "host"),
|
|
38
|
-
children: [
|
|
39
|
-
s,
|
|
40
|
-
t
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
) : t;
|
|
44
31
|
};
|
|
45
|
-
|
|
32
|
+
y.displayName = "IressBadge";
|
|
46
33
|
export {
|
|
47
|
-
|
|
34
|
+
y as IressBadge
|
|
48
35
|
};
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
export declare const badge: import('../../styled-system/types').SlotRecipeRuntimeFn<"badge" | "root"
|
|
2
|
-
host: {
|
|
3
|
-
true: {
|
|
4
|
-
badge: {
|
|
5
|
-
position: "absolute";
|
|
6
|
-
insetBlockStart: "spacing.0";
|
|
7
|
-
insetInlineEnd: "spacing.0";
|
|
8
|
-
zIndex: "100";
|
|
9
|
-
transformOrigin: "100% 0";
|
|
10
|
-
borderRadius: "radius.100";
|
|
11
|
-
transform: {
|
|
12
|
-
base: "translate(50%, -50%)";
|
|
13
|
-
_rtl: "translate(-50%, -50%)";
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
1
|
+
export declare const badge: import('../../styled-system/types').SlotRecipeRuntimeFn<"badge" | "root", {
|
|
18
2
|
pill: {
|
|
19
3
|
true: {
|
|
20
4
|
badge: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as o } from "../../sva-B7kca5XO.js";
|
|
2
2
|
const r = o({
|
|
3
|
-
slots: ["root", "badge"
|
|
3
|
+
slots: ["root", "badge"],
|
|
4
4
|
base: {
|
|
5
5
|
root: {
|
|
6
6
|
// Performance: CSS containment limits style recalculation scope
|
|
@@ -14,7 +14,7 @@ const r = o({
|
|
|
14
14
|
whiteSpace: "nowrap",
|
|
15
15
|
textDecoration: "none",
|
|
16
16
|
minHeight: "[1.35em]",
|
|
17
|
-
minWidth: "[1.
|
|
17
|
+
minWidth: "[1.5em]"
|
|
18
18
|
},
|
|
19
19
|
badge: {
|
|
20
20
|
alignItems: "center",
|
|
@@ -26,29 +26,9 @@ const r = o({
|
|
|
26
26
|
lineHeight: 1,
|
|
27
27
|
display: "inline-block"
|
|
28
28
|
}
|
|
29
|
-
},
|
|
30
|
-
host: {
|
|
31
|
-
position: "relative",
|
|
32
|
-
height: "auto"
|
|
33
29
|
}
|
|
34
30
|
},
|
|
35
31
|
variants: {
|
|
36
|
-
host: {
|
|
37
|
-
true: {
|
|
38
|
-
badge: {
|
|
39
|
-
position: "absolute",
|
|
40
|
-
insetBlockStart: "spacing.0",
|
|
41
|
-
insetInlineEnd: "spacing.0",
|
|
42
|
-
zIndex: "100",
|
|
43
|
-
transformOrigin: "100% 0",
|
|
44
|
-
borderRadius: "radius.100",
|
|
45
|
-
transform: {
|
|
46
|
-
base: "translate(50%, -50%)",
|
|
47
|
-
_rtl: "translate(-50%, -50%)"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
32
|
pill: {
|
|
53
33
|
true: {
|
|
54
34
|
badge: {
|
|
@@ -151,8 +131,7 @@ const r = o({
|
|
|
151
131
|
},
|
|
152
132
|
defaultVariants: {
|
|
153
133
|
mode: "neutral",
|
|
154
|
-
pill: !1
|
|
155
|
-
host: !1
|
|
134
|
+
pill: !1
|
|
156
135
|
}
|
|
157
136
|
});
|
|
158
137
|
export {
|
|
@@ -6,7 +6,7 @@ import { progress as b } from "./Progress.styles.js";
|
|
|
6
6
|
import { s as p } from "../../factory-CsinCTPr.js";
|
|
7
7
|
import { s as x } from "../../is-valid-prop-DweT-eOL.js";
|
|
8
8
|
import { GlobalCSSClass as C } from "../../enums.js";
|
|
9
|
-
import { t as N } from "../../index-
|
|
9
|
+
import { t as N } from "../../index-0AvnPY9d.js";
|
|
10
10
|
const h = ({
|
|
11
11
|
backgroundImage: e,
|
|
12
12
|
borderRadius: t,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef as m, useEffect as y } from "react";
|
|
2
2
|
import { GlobalCSSClass as e } from "../../../enums.js";
|
|
3
|
-
import { t as p } from "../../../index-
|
|
3
|
+
import { t as p } from "../../../index-0AvnPY9d.js";
|
|
4
4
|
import { useBreakpoint as S } from "../../../hooks/useBreakpoint.js";
|
|
5
5
|
function h({
|
|
6
6
|
element: r,
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { idsLogger as
|
|
4
|
-
import { useIdIfNeeded as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { s as
|
|
7
|
-
import { tab as
|
|
8
|
-
import { c as
|
|
9
|
-
import { a as
|
|
10
|
-
import { focusableElements as
|
|
11
|
-
import { GlobalCSSClass as
|
|
12
|
-
import { TabSetContext as
|
|
13
|
-
const
|
|
14
|
-
const t =
|
|
15
|
-
t?.removeAttribute("id"),
|
|
16
|
-
},
|
|
17
|
-
activate:
|
|
1
|
+
import { jsxs as L, Fragment as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as D, useRef as S, useContext as R, useImperativeHandle as $, useLayoutEffect as j, useEffect as F, useCallback as C, useMemo as H } from "react";
|
|
3
|
+
import { idsLogger as K } from "../../../helpers/utility/idsLogger.js";
|
|
4
|
+
import { useIdIfNeeded as q } from "../../../hooks/useIdIfNeeded.js";
|
|
5
|
+
import { createPortal as G } from "react-dom";
|
|
6
|
+
import { s as U } from "../../../factory-CsinCTPr.js";
|
|
7
|
+
import { tab as V } from "./Tab.styles.js";
|
|
8
|
+
import { c as W } from "../../../cx-DN21T1EH.js";
|
|
9
|
+
import { a as Y } from "../../../floating-ui.react-BlU6Nz_4.js";
|
|
10
|
+
import { focusableElements as z } from "../../../helpers/dom/focusableElements.js";
|
|
11
|
+
import { GlobalCSSClass as B } from "../../../enums.js";
|
|
12
|
+
import { TabSetContext as J } from "../TabSetProvider.js";
|
|
13
|
+
const O = (n, e, c, a) => {
|
|
14
|
+
const t = n.querySelector("[id]"), r = t?.getAttribute("id");
|
|
15
|
+
t?.removeAttribute("id"), n.removeAttribute("tabindex"), n.removeAttribute("data-active"), n.removeAttribute("aria-selected"), c.ref?.(e), e.tabIndex = a ? 0 : -1, a ? e.setAttribute("data-active", "") : e.removeAttribute("data-active"), r && e.setAttribute("id", r), e.setAttribute("aria-selected", String(a));
|
|
16
|
+
}, k = ({
|
|
17
|
+
activate: n,
|
|
18
18
|
children: e,
|
|
19
|
-
selected:
|
|
20
|
-
...
|
|
19
|
+
selected: c,
|
|
20
|
+
...a
|
|
21
21
|
}) => /* @__PURE__ */ u(
|
|
22
|
-
|
|
22
|
+
Y,
|
|
23
23
|
{
|
|
24
24
|
render: (t) => /* @__PURE__ */ u(
|
|
25
25
|
"div",
|
|
26
26
|
{
|
|
27
|
-
...
|
|
27
|
+
...a,
|
|
28
28
|
...t,
|
|
29
|
-
"aria-selected":
|
|
30
|
-
onClick: () =>
|
|
31
|
-
onKeyDown: (r) => ["Space", "Enter"].includes(r.key) &&
|
|
29
|
+
"aria-selected": c,
|
|
30
|
+
onClick: () => n(),
|
|
31
|
+
onKeyDown: (r) => ["Space", "Enter"].includes(r.key) && n(),
|
|
32
32
|
ref: (r) => {
|
|
33
33
|
if (!r) return;
|
|
34
|
-
const
|
|
35
|
-
|
|
34
|
+
const l = z(r)[0];
|
|
35
|
+
l && O(
|
|
36
36
|
r,
|
|
37
|
-
|
|
37
|
+
l,
|
|
38
38
|
t,
|
|
39
|
-
|
|
39
|
+
c
|
|
40
40
|
);
|
|
41
41
|
},
|
|
42
42
|
children: e
|
|
@@ -44,105 +44,119 @@ const J = (a, e, s, i) => {
|
|
|
44
44
|
)
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
active:
|
|
47
|
+
k.displayName = "TabInsideTabSet";
|
|
48
|
+
const P = ({
|
|
49
|
+
active: n,
|
|
50
50
|
children: e,
|
|
51
|
-
className:
|
|
52
|
-
"data-testid":
|
|
51
|
+
className: c,
|
|
52
|
+
"data-testid": a,
|
|
53
53
|
href: t,
|
|
54
54
|
label: r,
|
|
55
|
-
type:
|
|
55
|
+
type: l = "button",
|
|
56
56
|
value: v,
|
|
57
|
-
...
|
|
58
|
-
},
|
|
59
|
-
const d =
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
return A?.(
|
|
57
|
+
...f
|
|
58
|
+
}, x) => {
|
|
59
|
+
const d = q({ id: f.id }), s = S(null), o = R(J), { register: A, unregister: g, setHover: p } = o ?? {}, { onMouseEnter: w, onMouseLeave: y } = f, I = S(!0);
|
|
60
|
+
$(x, () => s.current), j(() => {
|
|
61
|
+
const i = s.current;
|
|
62
|
+
if (i)
|
|
63
|
+
return A?.(i, v), () => g?.(i);
|
|
64
64
|
}, [A, g, v]);
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
const m = o ? o.isActive(s.current) : n;
|
|
66
|
+
F(() => {
|
|
67
|
+
if (m && s.current && o) {
|
|
68
|
+
if (I.current) {
|
|
69
|
+
I.current = !1;
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
s.current.scrollIntoView?.({
|
|
73
|
+
behavior: "smooth",
|
|
74
|
+
block: "nearest",
|
|
75
|
+
inline: "center"
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}, [m, o]);
|
|
79
|
+
const T = W(
|
|
80
|
+
c,
|
|
81
|
+
V({ active: m, insideTabSet: !!o }),
|
|
82
|
+
B.Tab
|
|
83
|
+
), E = C(
|
|
84
|
+
(i) => {
|
|
85
|
+
w?.(i), p?.(i.currentTarget);
|
|
72
86
|
},
|
|
73
|
-
[
|
|
74
|
-
),
|
|
75
|
-
(
|
|
76
|
-
|
|
87
|
+
[w, p]
|
|
88
|
+
), M = C(
|
|
89
|
+
(i) => {
|
|
90
|
+
y?.(i), p?.();
|
|
77
91
|
},
|
|
78
|
-
[
|
|
79
|
-
),
|
|
80
|
-
() =>
|
|
92
|
+
[y, p]
|
|
93
|
+
), h = H(
|
|
94
|
+
() => U(t ? "a" : "button"),
|
|
81
95
|
[t]
|
|
82
96
|
);
|
|
83
|
-
if (e && t &&
|
|
97
|
+
if (e && t && K(
|
|
84
98
|
"IressTab: You should not use `children` with `href` prop, as the `children` will be seen before the page navigates."
|
|
85
|
-
),
|
|
86
|
-
const
|
|
87
|
-
return /* @__PURE__ */
|
|
99
|
+
), o) {
|
|
100
|
+
const i = e && m;
|
|
101
|
+
return /* @__PURE__ */ L(N, { children: [
|
|
88
102
|
/* @__PURE__ */ u(
|
|
89
|
-
|
|
103
|
+
k,
|
|
90
104
|
{
|
|
91
|
-
activate: () =>
|
|
92
|
-
selected:
|
|
105
|
+
activate: () => o.activate(s.current),
|
|
106
|
+
selected: m,
|
|
93
107
|
children: /* @__PURE__ */ u(
|
|
94
|
-
|
|
108
|
+
h,
|
|
95
109
|
{
|
|
96
|
-
className:
|
|
110
|
+
className: T,
|
|
97
111
|
"aria-controls": e ? `${d}--panel` : void 0,
|
|
98
112
|
role: "tab",
|
|
99
|
-
"data-testid":
|
|
100
|
-
...
|
|
113
|
+
"data-testid": a,
|
|
114
|
+
...f,
|
|
101
115
|
href: t,
|
|
102
116
|
id: d,
|
|
103
|
-
onMouseEnter:
|
|
104
|
-
onMouseLeave:
|
|
105
|
-
ref:
|
|
106
|
-
type:
|
|
117
|
+
onMouseEnter: E,
|
|
118
|
+
onMouseLeave: M,
|
|
119
|
+
ref: s,
|
|
120
|
+
type: l,
|
|
107
121
|
children: r
|
|
108
122
|
}
|
|
109
123
|
)
|
|
110
124
|
}
|
|
111
125
|
),
|
|
112
|
-
|
|
126
|
+
o.panel && G(
|
|
113
127
|
/* @__PURE__ */ u(
|
|
114
128
|
"div",
|
|
115
129
|
{
|
|
116
130
|
"aria-labelledby": d,
|
|
117
131
|
id: `${d}--panel`,
|
|
118
132
|
role: "tabpanel",
|
|
119
|
-
onKeyDown: (
|
|
120
|
-
(
|
|
133
|
+
onKeyDown: (b) => {
|
|
134
|
+
(b.key === "ArrowLeft" || b.key === "ArrowRight" || b.key === "ArrowUp" || b.key === "ArrowDown") && b.stopPropagation();
|
|
121
135
|
},
|
|
122
|
-
hidden: !
|
|
136
|
+
hidden: !i,
|
|
123
137
|
children: e
|
|
124
138
|
}
|
|
125
139
|
),
|
|
126
|
-
|
|
140
|
+
o.panel,
|
|
127
141
|
`${d}--panel`
|
|
128
142
|
)
|
|
129
143
|
] });
|
|
130
144
|
}
|
|
131
145
|
return /* @__PURE__ */ u(
|
|
132
|
-
|
|
146
|
+
h,
|
|
133
147
|
{
|
|
134
|
-
className:
|
|
135
|
-
"data-testid":
|
|
136
|
-
...
|
|
148
|
+
className: T,
|
|
149
|
+
"data-testid": a,
|
|
150
|
+
...f,
|
|
137
151
|
href: t,
|
|
138
152
|
id: d,
|
|
139
|
-
ref:
|
|
140
|
-
type:
|
|
153
|
+
ref: s,
|
|
154
|
+
type: l,
|
|
141
155
|
children: r
|
|
142
156
|
}
|
|
143
157
|
);
|
|
144
|
-
},
|
|
145
|
-
|
|
158
|
+
}, Q = D(P);
|
|
159
|
+
Q.displayName = "IressTab";
|
|
146
160
|
export {
|
|
147
|
-
|
|
161
|
+
Q as IressTab
|
|
148
162
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as t } from "../../../cva-DtPMccE9.js";
|
|
2
|
-
const
|
|
2
|
+
const o = t({
|
|
3
3
|
base: {
|
|
4
4
|
alignItems: "center",
|
|
5
5
|
borderBottom: "[2px solid transparent]",
|
|
@@ -39,11 +39,14 @@ const e = t({
|
|
|
39
39
|
borderBottomWidth: "0px",
|
|
40
40
|
_hover: {
|
|
41
41
|
bg: "[none]"
|
|
42
|
+
},
|
|
43
|
+
_focusVisible: {
|
|
44
|
+
layerStyle: "elevation.focusCompact"
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
});
|
|
47
50
|
export {
|
|
48
|
-
|
|
51
|
+
o as tab
|
|
49
52
|
};
|