@gustavo-valsechi/client 1.4.318 → 1.4.319
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/src/components/types/badge/index.js +7 -1
- package/dist/src/components/types/badge/index.mjs +8 -2
- package/dist/src/components/types/badge/styles.js +42 -19
- package/dist/src/components/types/badge/styles.mjs +42 -19
- package/dist/src/components/types/table/index.js +8 -5
- package/dist/src/components/types/table/index.mjs +8 -5
- package/dist/src/interfaces/components/badge/index.d.ts +4 -0
- package/dist/src/interfaces/components/table/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -37,7 +37,13 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
37
37
|
var import_styles = require("./styles");
|
|
38
38
|
var import_lodash = __toESM(require("lodash"));
|
|
39
39
|
function Badge(props) {
|
|
40
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { ...props, children: [
|
|
41
|
+
(!!props.icon || !!props.img) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "badge-identifier", children: [
|
|
42
|
+
!!props.icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: props.icon }),
|
|
43
|
+
!props.icon && !!props.img && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "badge-image" })
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: import_lodash.default.lowerCase(props.value) })
|
|
46
|
+
] });
|
|
41
47
|
}
|
|
42
48
|
// Annotate the CommonJS export names for ESM import in node:
|
|
43
49
|
0 && (module.exports = {
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Container } from "./styles";
|
|
5
5
|
import _ from "lodash";
|
|
6
6
|
function Badge(props) {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ jsxs(Container, { ...props, children: [
|
|
8
|
+
(!!props.icon || !!props.img) && /* @__PURE__ */ jsxs("div", { className: "badge-identifier", children: [
|
|
9
|
+
!!props.icon && /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: props.icon }),
|
|
10
|
+
!props.icon && !!props.img && /* @__PURE__ */ jsx("div", { className: "badge-image" })
|
|
11
|
+
] }),
|
|
12
|
+
/* @__PURE__ */ jsx("span", { children: _.lowerCase(props.value) })
|
|
13
|
+
] });
|
|
8
14
|
}
|
|
9
15
|
export {
|
|
10
16
|
Badge
|
|
@@ -35,35 +35,58 @@ __export(styles_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(styles_exports);
|
|
36
36
|
var import_styled_components = __toESM(require("styled-components"));
|
|
37
37
|
const Container = import_styled_components.default.div`
|
|
38
|
-
.content {
|
|
39
38
|
display: inline-flex;
|
|
40
39
|
align-items: center;
|
|
41
40
|
justify-content: center;
|
|
42
41
|
height: 1.8rem;
|
|
43
|
-
padding: 0
|
|
42
|
+
padding: ${(props) => props.icon || props.img ? "0 .8rem 0 .3rem" : "0 .8rem"};
|
|
44
43
|
position: relative;
|
|
44
|
+
gap: .7rem;
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
.badge-identifier {
|
|
47
|
+
width: 1.3rem;
|
|
48
|
+
height: 1.3rem;
|
|
49
|
+
border-radius: 5px;
|
|
50
|
+
background: ${(props) => props.theme.t05};
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
|
|
55
|
+
i {
|
|
56
|
+
font-size: .7rem;
|
|
57
|
+
color: ${({ theme, textColor = "t6", color }) => theme[color || textColor]};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.badge-image {
|
|
61
|
+
width: .8rem;
|
|
62
|
+
height: .8rem;
|
|
63
|
+
background-image: url(${(props) => props.img});
|
|
64
|
+
background-size: contain;
|
|
65
|
+
background-repeat: no-repeat;
|
|
66
|
+
background-position: center;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
span {
|
|
71
|
+
position: relative;
|
|
72
|
+
z-index: 1;
|
|
73
|
+
color: ${({ theme, textColor = "t6", color }) => theme[color || textColor]};
|
|
74
|
+
font-size: .8rem;
|
|
75
|
+
font-weight: 500;
|
|
76
|
+
text-transform: capitalize;
|
|
53
77
|
}
|
|
54
78
|
|
|
55
79
|
&:before {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
80
|
+
content: "";
|
|
81
|
+
position: absolute;
|
|
82
|
+
top: 0;
|
|
83
|
+
left: 0;
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 100%;
|
|
86
|
+
border-radius: 5px;
|
|
87
|
+
background: ${({ theme, backgroundColor = "t2", color }) => theme[color || backgroundColor]};
|
|
88
|
+
opacity: .2;
|
|
65
89
|
}
|
|
66
|
-
}
|
|
67
90
|
`;
|
|
68
91
|
// Annotate the CommonJS export names for ESM import in node:
|
|
69
92
|
0 && (module.exports = {
|
|
@@ -2,35 +2,58 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
const Container = styled.div`
|
|
5
|
-
.content {
|
|
6
5
|
display: inline-flex;
|
|
7
6
|
align-items: center;
|
|
8
7
|
justify-content: center;
|
|
9
8
|
height: 1.8rem;
|
|
10
|
-
padding: 0
|
|
9
|
+
padding: ${(props) => props.icon || props.img ? "0 .8rem 0 .3rem" : "0 .8rem"};
|
|
11
10
|
position: relative;
|
|
11
|
+
gap: .7rem;
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
.badge-identifier {
|
|
14
|
+
width: 1.3rem;
|
|
15
|
+
height: 1.3rem;
|
|
16
|
+
border-radius: 5px;
|
|
17
|
+
background: ${(props) => props.theme.t05};
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
|
|
22
|
+
i {
|
|
23
|
+
font-size: .7rem;
|
|
24
|
+
color: ${({ theme, textColor = "t6", color }) => theme[color || textColor]};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.badge-image {
|
|
28
|
+
width: .8rem;
|
|
29
|
+
height: .8rem;
|
|
30
|
+
background-image: url(${(props) => props.img});
|
|
31
|
+
background-size: contain;
|
|
32
|
+
background-repeat: no-repeat;
|
|
33
|
+
background-position: center;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
span {
|
|
38
|
+
position: relative;
|
|
39
|
+
z-index: 1;
|
|
40
|
+
color: ${({ theme, textColor = "t6", color }) => theme[color || textColor]};
|
|
41
|
+
font-size: .8rem;
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
text-transform: capitalize;
|
|
20
44
|
}
|
|
21
45
|
|
|
22
46
|
&:before {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
47
|
+
content: "";
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0;
|
|
50
|
+
left: 0;
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 100%;
|
|
53
|
+
border-radius: 5px;
|
|
54
|
+
background: ${({ theme, backgroundColor = "t2", color }) => theme[color || backgroundColor]};
|
|
55
|
+
opacity: .2;
|
|
32
56
|
}
|
|
33
|
-
}
|
|
34
57
|
`;
|
|
35
58
|
export {
|
|
36
59
|
Container
|
|
@@ -65,17 +65,20 @@ function Table(props) {
|
|
|
65
65
|
modal.setProps("table", { content });
|
|
66
66
|
};
|
|
67
67
|
const renderRowContainer = (data, option) => {
|
|
68
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g;
|
|
68
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i;
|
|
69
|
+
const style = import_lodash.default.isFunction((_a2 = option.row) == null ? void 0 : _a2.style) ? option.row.style(data, option) : (_b2 = option.row) == null ? void 0 : _b2.style;
|
|
70
|
+
const color = import_lodash.default.isFunction((_c2 = option.row) == null ? void 0 : _c2.color) ? option.row.color(data, option) : (_d2 = option.row) == null ? void 0 : _d2.color;
|
|
71
|
+
if (color) style.color = theme.content[color] || color;
|
|
69
72
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
73
|
"div",
|
|
71
74
|
{
|
|
72
75
|
className: `
|
|
73
76
|
table-content item
|
|
74
|
-
${((
|
|
75
|
-
${((
|
|
77
|
+
${((_e2 = option.row) == null ? void 0 : _e2.actions) ? "table-action" : ""}
|
|
78
|
+
${((_f2 = option.row) == null ? void 0 : _f2.icon) ? "table-identifier" : ""}
|
|
76
79
|
`,
|
|
77
|
-
style
|
|
78
|
-
"data-tooltip": !((
|
|
80
|
+
style,
|
|
81
|
+
"data-tooltip": !((_g = option.row) == null ? void 0 : _g.actions) ? import_lodash.default.isFunction((_h = option.row) == null ? void 0 : _h.info) ? option.row.info(data, option) : (_i = option.row) == null ? void 0 : _i.info : "",
|
|
79
82
|
"data-tooltip-props": '{"position":"bottom"}',
|
|
80
83
|
children: renderRowContent(data, option)
|
|
81
84
|
}
|
|
@@ -31,17 +31,20 @@ function Table(props) {
|
|
|
31
31
|
modal.setProps("table", { content });
|
|
32
32
|
};
|
|
33
33
|
const renderRowContainer = (data, option) => {
|
|
34
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g;
|
|
34
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i;
|
|
35
|
+
const style = _.isFunction((_a2 = option.row) == null ? void 0 : _a2.style) ? option.row.style(data, option) : (_b2 = option.row) == null ? void 0 : _b2.style;
|
|
36
|
+
const color = _.isFunction((_c2 = option.row) == null ? void 0 : _c2.color) ? option.row.color(data, option) : (_d2 = option.row) == null ? void 0 : _d2.color;
|
|
37
|
+
if (color) style.color = theme.content[color] || color;
|
|
35
38
|
return /* @__PURE__ */ jsx(
|
|
36
39
|
"div",
|
|
37
40
|
{
|
|
38
41
|
className: `
|
|
39
42
|
table-content item
|
|
40
|
-
${((
|
|
41
|
-
${((
|
|
43
|
+
${((_e2 = option.row) == null ? void 0 : _e2.actions) ? "table-action" : ""}
|
|
44
|
+
${((_f2 = option.row) == null ? void 0 : _f2.icon) ? "table-identifier" : ""}
|
|
42
45
|
`,
|
|
43
|
-
style
|
|
44
|
-
"data-tooltip": !((
|
|
46
|
+
style,
|
|
47
|
+
"data-tooltip": !((_g = option.row) == null ? void 0 : _g.actions) ? _.isFunction((_h = option.row) == null ? void 0 : _h.info) ? option.row.info(data, option) : (_i = option.row) == null ? void 0 : _i.info : "",
|
|
45
48
|
"data-tooltip-props": '{"position":"bottom"}',
|
|
46
49
|
children: renderRowContent(data, option)
|
|
47
50
|
}
|