qaema-ui 0.0.55 → 0.0.56
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/_virtual/index7.js +3 -2
- package/dist/_virtual/index8.js +2 -3
- package/dist/components/Badge.d.ts +2 -1
- package/dist/components/Badge.js +20 -13
- package/dist/components/NavItem.d.ts +7 -0
- package/dist/components/NavItem.js +58 -30
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
- package/package.json +1 -1
package/dist/_virtual/index7.js
CHANGED
package/dist/_virtual/index8.js
CHANGED
|
@@ -9,6 +9,7 @@ export type BadgeProps = {
|
|
|
9
9
|
variant?: BadgeVariant;
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
onClose?: () => void;
|
|
12
|
+
image?: string;
|
|
12
13
|
};
|
|
13
|
-
declare const Badge: ({ bgColor, color, label, weight, variant, onClose, children }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const Badge: ({ bgColor, color, label, weight, variant, onClose, children, image }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export default Badge;
|
package/dist/components/Badge.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { IoClose as
|
|
1
|
+
import { j as e } from "../_virtual/jsx-runtime.js";
|
|
2
|
+
import { IoClose as p } from "../node_modules/react-icons/io5/index.js";
|
|
3
3
|
import i from "styled-components";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
4
|
+
import m from "../hooks/useBadgeVariant.js";
|
|
5
|
+
import g from "./Typography.js";
|
|
6
|
+
const u = i.div`
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: center;
|
|
9
9
|
justify-content: space-between;
|
|
@@ -12,7 +12,7 @@ const g = i.div`
|
|
|
12
12
|
background-color: ${({ bgColor: r, $variantStyles: o }) => r ?? o.backgroundColor};
|
|
13
13
|
gap: ${({ theme: r }) => r.spacing.xs};
|
|
14
14
|
height: 1.5rem;
|
|
15
|
-
`,
|
|
15
|
+
`, f = i.div`
|
|
16
16
|
display: flex;
|
|
17
17
|
align-items: center;
|
|
18
18
|
justify-content: center;
|
|
@@ -23,14 +23,21 @@ const g = i.div`
|
|
|
23
23
|
&:hover {
|
|
24
24
|
opacity: 0.8;
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
`, x = i.img`
|
|
27
|
+
width: 1.25rem;
|
|
28
|
+
height: 1.25rem;
|
|
29
|
+
border-radius: ${({ theme: r }) => r.borderRadius.circle};
|
|
30
|
+
object-fit: cover;
|
|
31
|
+
flex-shrink: 0;
|
|
32
|
+
`, v = ({ bgColor: r, color: o, label: s, weight: n, variant: d, onClose: a, children: l, image: c }) => {
|
|
33
|
+
const t = m(d ?? "default");
|
|
34
|
+
return /* @__PURE__ */ e.jsxs(u, { bgColor: r, $variantStyles: t, children: [
|
|
35
|
+
c && /* @__PURE__ */ e.jsx(x, { src: c, alt: "badge-image" }),
|
|
36
|
+
s && /* @__PURE__ */ e.jsx(g, { variant: "span", color: o ?? t.color, weight: n, children: s }),
|
|
37
|
+
l,
|
|
38
|
+
a && /* @__PURE__ */ e.jsx(f, { onClick: a, $variantStyles: t, children: /* @__PURE__ */ e.jsx(p, { color: o ?? t.color, size: "0.75rem" }) })
|
|
32
39
|
] });
|
|
33
40
|
};
|
|
34
41
|
export {
|
|
35
|
-
|
|
42
|
+
v as default
|
|
36
43
|
};
|
|
@@ -17,6 +17,13 @@ export type NavItemType = {
|
|
|
17
17
|
onClick?: (value: unknown) => void;
|
|
18
18
|
linkComponent?: React.ElementType;
|
|
19
19
|
active?: boolean;
|
|
20
|
+
badge?: {
|
|
21
|
+
label?: string;
|
|
22
|
+
variant?: string;
|
|
23
|
+
color?: string;
|
|
24
|
+
bgColor?: string;
|
|
25
|
+
image?: string;
|
|
26
|
+
};
|
|
20
27
|
};
|
|
21
28
|
export type NavItemProps = {
|
|
22
29
|
item: NavItemType;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { j as r } from "../_virtual/jsx-runtime.js";
|
|
2
|
-
import
|
|
3
|
-
import { useNavItemVariant as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
2
|
+
import a, { useTheme as h, css as c } from "styled-components";
|
|
3
|
+
import { useNavItemVariant as v } from "../hooks/useNavItemVariant.js";
|
|
4
|
+
import x from "./Badge.js";
|
|
5
|
+
import u from "./Link.js";
|
|
6
|
+
import $ from "./Typography.js";
|
|
7
|
+
const f = {
|
|
7
8
|
bullet: c`
|
|
8
9
|
border-radius: ${({ theme: o }) => o.borderRadius.circle};
|
|
9
10
|
background-color: ${({ theme: o }) => o.colors.secondary.pink.n450};
|
|
@@ -13,18 +14,16 @@ const b = {
|
|
|
13
14
|
border-radius: ${({ theme: o }) => o.borderRadius.sm};
|
|
14
15
|
background-color: ${({ theme: o }) => o.colors.primary.purple.n450};
|
|
15
16
|
`
|
|
16
|
-
},
|
|
17
|
+
}, y = a.div`
|
|
17
18
|
display: flex;
|
|
18
19
|
flex-direction: row;
|
|
19
20
|
align-items: center;
|
|
20
21
|
gap: ${({ theme: o }) => o.spacing.xs};
|
|
21
|
-
border: none;
|
|
22
22
|
|
|
23
|
-
background-color: transparent;
|
|
24
|
-
cursor: pointer;
|
|
25
23
|
svg {
|
|
26
24
|
width: 1.5rem;
|
|
27
25
|
height: 1.5rem;
|
|
26
|
+
flex-shrink: 0;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
p {
|
|
@@ -32,7 +31,11 @@ const b = {
|
|
|
32
31
|
margin: 0;
|
|
33
32
|
white-space: nowrap;
|
|
34
33
|
}
|
|
35
|
-
`,
|
|
34
|
+
`, p = a.div`
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: ${({ theme: o }) => o.spacing.xs};
|
|
38
|
+
`, C = a.div`
|
|
36
39
|
display: flex;
|
|
37
40
|
flex-direction: row;
|
|
38
41
|
justify-content: space-between;
|
|
@@ -53,48 +56,73 @@ const b = {
|
|
|
53
56
|
border-radius: ${o.theme.borderRadius.sm};
|
|
54
57
|
background-color: ${o.$activeBgColor};
|
|
55
58
|
`}
|
|
56
|
-
`,
|
|
59
|
+
`, j = a.div`
|
|
57
60
|
width: 1.5rem;
|
|
58
61
|
height: 1.5rem;
|
|
59
62
|
text-align: center;
|
|
60
63
|
color: ${({ theme: o }) => o.colors.grey.n50};
|
|
61
64
|
font-weight: ${({ theme: o }) => o.typography.weights.semiBold};
|
|
62
|
-
${({ $variant: o }) =>
|
|
63
|
-
`,
|
|
64
|
-
const e = o == null ? void 0 : o.icon, n =
|
|
65
|
-
/* @__PURE__ */ r.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
${({ $variant: o }) => f[o]}
|
|
66
|
+
`, R = ({ item: o }) => {
|
|
67
|
+
const e = o == null ? void 0 : o.icon, n = h(), { color: l, bgColor: b, activeBgColor: s, activeColor: t } = v(o == null ? void 0 : o.variant), d = /* @__PURE__ */ r.jsxs(y, { children: [
|
|
68
|
+
e && /* @__PURE__ */ r.jsx(e, { color: o.active ? t : l, size: 20 }),
|
|
69
|
+
/* @__PURE__ */ r.jsx($, { component: "p", variant: "smText", color: o.active ? t : l, children: o == null ? void 0 : o.title })
|
|
70
|
+
] }), i = o != null && o.badge ? /* @__PURE__ */ r.jsx(
|
|
71
|
+
x,
|
|
72
|
+
{
|
|
73
|
+
label: o.badge.label,
|
|
74
|
+
variant: o.badge.variant,
|
|
75
|
+
color: o.badge.color,
|
|
76
|
+
bgColor: o.badge.bgColor,
|
|
77
|
+
image: o.badge.image
|
|
78
|
+
}
|
|
79
|
+
) : o != null && o.count ? /* @__PURE__ */ r.jsx(j, { $variant: (o == null ? void 0 : o.notificationVariant) ?? "badge", children: /* @__PURE__ */ r.jsx("span", { children: o.count }) }) : null, g = {
|
|
71
80
|
padding: `${n.spacing.xs} ${n.spacing.sm}`,
|
|
72
81
|
width: "100%",
|
|
73
|
-
hoverBgColor:
|
|
74
|
-
activeBgColor:
|
|
82
|
+
hoverBgColor: s,
|
|
83
|
+
activeBgColor: s
|
|
75
84
|
};
|
|
76
85
|
return /* @__PURE__ */ r.jsx(
|
|
77
|
-
|
|
86
|
+
C,
|
|
78
87
|
{
|
|
79
88
|
$variant: (o == null ? void 0 : o.variant) ?? "normal",
|
|
80
|
-
$bgColor:
|
|
81
|
-
$activeBgColor:
|
|
89
|
+
$bgColor: b,
|
|
90
|
+
$activeBgColor: s ?? "",
|
|
82
91
|
$active: !!(o != null && o.active),
|
|
83
|
-
children: (o == null ? void 0 : o.component) === "link" && o.path ? /* @__PURE__ */ r.jsx(
|
|
92
|
+
children: (o == null ? void 0 : o.component) === "link" && o.path ? /* @__PURE__ */ r.jsx(u, { to: o.path, state: o.state, component: o.linkComponent, ...g, children: /* @__PURE__ */ r.jsxs(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
style: {
|
|
96
|
+
display: "flex",
|
|
97
|
+
justifyContent: "space-between",
|
|
98
|
+
alignItems: "center",
|
|
99
|
+
width: "100%",
|
|
100
|
+
gap: n.spacing.sm
|
|
101
|
+
},
|
|
102
|
+
children: [
|
|
103
|
+
d,
|
|
104
|
+
/* @__PURE__ */ r.jsx(p, { children: i })
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
) }) : /* @__PURE__ */ r.jsxs(
|
|
84
108
|
"button",
|
|
85
109
|
{
|
|
86
110
|
onClick: o.onClick,
|
|
87
111
|
style: {
|
|
88
|
-
...
|
|
112
|
+
...g,
|
|
89
113
|
border: "none",
|
|
90
114
|
background: "transparent",
|
|
91
115
|
cursor: "pointer",
|
|
92
116
|
display: "flex",
|
|
93
117
|
justifyContent: "space-between",
|
|
94
118
|
alignItems: "center",
|
|
95
|
-
width: "100%"
|
|
119
|
+
width: "100%",
|
|
120
|
+
gap: n.spacing.sm
|
|
96
121
|
},
|
|
97
|
-
children:
|
|
122
|
+
children: [
|
|
123
|
+
d,
|
|
124
|
+
/* @__PURE__ */ r.jsx(p, { children: i })
|
|
125
|
+
]
|
|
98
126
|
}
|
|
99
127
|
)
|
|
100
128
|
},
|
|
@@ -102,5 +130,5 @@ const b = {
|
|
|
102
130
|
);
|
|
103
131
|
};
|
|
104
132
|
export {
|
|
105
|
-
|
|
133
|
+
R as default
|
|
106
134
|
};
|
|
@@ -4,7 +4,7 @@ import P from "../../../../_virtual/isString.js";
|
|
|
4
4
|
import D from "../../../../_virtual/isFunction.js";
|
|
5
5
|
import j from "../../../../_virtual/isObject.js";
|
|
6
6
|
import { Children as p, isValidElement as w } from "react";
|
|
7
|
-
import { r as B } from "../../../../_virtual/
|
|
7
|
+
import { r as B } from "../../../../_virtual/index7.js";
|
|
8
8
|
import { isNumber as b } from "./DataUtils.js";
|
|
9
9
|
import { shallowEqual as d } from "./ShallowEqual.js";
|
|
10
10
|
import { SVGElementPropKeys as G, EventKeys as F, FilteredElementKeyMap as s } from "./types.js";
|