react-ecosistema-unp 1.2.2 → 1.2.3

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.
@@ -1 +1 @@
1
- .bg-unp{border-radius:6px 6px 0 0!important;background-color:#303d50!important}.tarjeta-unp{border-radius:12px!important;box-shadow:0 6px 10px #00000019;border-bottom-left-radius:12px;margin-bottom:1.5rem}.tarjeta-header-unp{border-top-left-radius:12px!important;border-top-right-radius:12px!important}
1
+ .bg-unp{border-radius:6px 6px 0 0!important;background-color:#303d50!important}.tarjeta-unp{border-radius:12px!important;box-shadow:0 6px 10px #00000019;border-bottom-left-radius:12px;margin-bottom:1.5rem}.tarjeta-header-unp{border-top-left-radius:12px!important;border-top-right-radius:12px!important}.card-close-button{background:none;border:none;font-size:1.5em;cursor:pointer;color:#fff;margin-left:auto}.card-close-button:hover{color:#d36269}
@@ -1,59 +1,64 @@
1
- import { jsxs as p, jsx as s } from "react/jsx-runtime";
1
+ import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
2
  import e from "react";
3
3
  import '../../assets/Bootstrap.css';import '../../assets/Tarjeta.css';/* empty css */
4
4
  /* empty css */
5
- import { C as j, a as g } from "../../Card-BXqmurzN.js";
6
- import { C as S } from "../../CardBody-RoDe1y90.js";
7
- import { B as x } from "../../Button-DMwpnJlD.js";
8
- const N = {
5
+ import { C as j, a as C } from "../../Card-BXqmurzN.js";
6
+ import { C as N } from "../../CardBody-RoDe1y90.js";
7
+ import { B as S } from "../../Button-DMwpnJlD.js";
8
+ const h = {
9
9
  marginBottom: "20px",
10
10
  width: "100px"
11
- }, _ = ({
12
- title: m,
13
- header: a = !1,
14
- children: n,
15
- method: i = "get",
11
+ }, L = ({
12
+ title: c,
13
+ header: s = !1,
14
+ children: i,
15
+ method: l = "get",
16
16
  validated: d = !1,
17
- onSubmit: c,
18
- hasPaddingTop: y = !0
17
+ onSubmit: u,
18
+ hasPaddingTop: y = !0,
19
+ onClose: a
19
20
  }) => {
20
- const r = e.Children.toArray(n), f = r[0] && e.isValidElement(r[0]) && r[0].type.displayName === "Subtitulo", o = r.filter(
21
+ const n = e.Children.toArray(i), f = n[0] && e.isValidElement(n[0]) && n[0].type.displayName === "Subtitulo", m = n.filter(
21
22
  (t) => e.isValidElement(t) && t.type.displayName === "SeccionTarjeta"
22
- ), u = o.length > 0, C = e.Children.map(n, (t, l) => e.isValidElement(t) && t.type.displayName === "SeccionTarjeta" ? e.cloneElement(t, {
23
- isGray: t.props.isGray ?? l % 2 === 1,
24
- isLast: t.props.isLast ?? l === o.length - 1
23
+ ), g = m.length > 0, b = e.Children.map(i, (t, p) => e.isValidElement(t) && t.type.displayName === "SeccionTarjeta" ? e.cloneElement(t, {
24
+ isGray: t.props.isGray ?? p % 2 === 1,
25
+ isLast: t.props.isLast ?? p === m.length - 1
25
26
  }) : t);
26
- return /* @__PURE__ */ p(
27
+ return /* @__PURE__ */ o(
27
28
  "form",
28
29
  {
29
- method: i,
30
+ method: l,
30
31
  noValidate: !0,
31
- onSubmit: c,
32
+ onSubmit: u,
32
33
  className: d ? "was-validated" : "",
33
34
  children: [
34
- /* @__PURE__ */ p(j, { className: "border-0 tarjeta-unp", children: [
35
- /* @__PURE__ */ s(
36
- g,
35
+ /* @__PURE__ */ o(j, { className: "border-0 tarjeta-unp", children: [
36
+ /* @__PURE__ */ o(
37
+ C,
37
38
  {
38
39
  className: "bg-unp text-light tarjeta-header-unp",
39
40
  style: {
40
- paddingTop: "1rem",
41
- paddingBottom: "1rem",
42
- fontSize: a ? "1.125rem" : "1.075rem",
43
- fontWeight: a ? 500 : "",
44
- display: a ? "flex" : "",
45
- justifyContent: a ? "center" : ""
41
+ paddingTop: a ? "0.55rem" : "1rem",
42
+ paddingBottom: a ? "0.55rem" : "1rem",
43
+ fontSize: s ? "1.125rem" : "1.075rem",
44
+ fontWeight: s ? 500 : "",
45
+ display: "flex",
46
+ justifyContent: s ? "center" : "space-between",
47
+ alignItems: "center"
46
48
  },
47
- children: m
49
+ children: [
50
+ /* @__PURE__ */ r("span", { style: { marginLeft: s && a ? "auto" : "" }, children: c }),
51
+ a && /* @__PURE__ */ r("button", { className: "card-close-button", onClick: a, type: "button", children: "×" })
52
+ ]
48
53
  }
49
54
  ),
50
- u ? C : /* @__PURE__ */ s(S, { className: `${f || !y ? "pt-0" : ""}`, children: n })
55
+ g ? b : /* @__PURE__ */ r(N, { className: `${f || !y ? "pt-0" : ""}`, children: i })
51
56
  ] }),
52
- i === "post" && /* @__PURE__ */ s("div", { style: { display: "flex", justifyContent: "end" }, children: /* @__PURE__ */ s(x, { variant: "unp_send", style: N, type: "submit", children: "Enviar" }) })
57
+ l === "post" && /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "end" }, children: /* @__PURE__ */ r(S, { variant: "unp_send", style: h, type: "submit", children: "Enviar" }) })
53
58
  ]
54
59
  }
55
60
  );
56
61
  };
57
62
  export {
58
- _ as Tarjeta
63
+ L as Tarjeta
59
64
  };
@@ -8,6 +8,7 @@ interface TarjetaProps {
8
8
  validated?: boolean;
9
9
  onSubmit?: (...args: any[]) => any;
10
10
  hasPaddingTop?: boolean;
11
+ onClose?: (...args: any[]) => any;
11
12
  }
12
13
  declare const Tarjeta: React.FC<TarjetaProps>;
13
14
  export { Tarjeta };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "react-ecosistema-unp",
3
3
  "author": "Ecosistema de Información - Unidad Nacional de Protección",
4
4
  "private": false,
5
- "version": "1.2.2",
5
+ "version": "1.2.3",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {