react-ecosistema-unp 0.9.6 → 0.9.7

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.
@@ -3,6 +3,7 @@ interface TarjetaProps {
3
3
  title: string;
4
4
  children: React.ReactNode;
5
5
  method?: string;
6
+ validated?: boolean;
6
7
  onSubmit?: (...args: any[]) => any;
7
8
  }
8
9
  declare const Tarjeta: React.FC<TarjetaProps>;
@@ -1,33 +1,42 @@
1
- import { jsxs as l, Fragment as u, jsx as a } from "react/jsx-runtime";
2
- import e from "react";
1
+ import { jsxs as l, Fragment as f, jsx as a } from "react/jsx-runtime";
2
+ import t from "react";
3
3
  import '../../assets/Bootstrap.css';import '../../assets/Tarjeta.css';/* empty css */
4
4
  /* empty css */
5
- import { C as f, a as C } from "../../Card-BXqmurzN.js";
6
- import { C as j } from "../../CardBody-RoDe1y90.js";
7
- import { B as S } from "../../Button-DMwpnJlD.js";
8
- const b = {
5
+ import { C, a as j } from "../../Card-BXqmurzN.js";
6
+ import { C as S } from "../../CardBody-RoDe1y90.js";
7
+ import { B as b } from "../../Button-DMwpnJlD.js";
8
+ const g = {
9
9
  marginBottom: "20px",
10
10
  width: "100px"
11
- }, v = ({
11
+ }, V = ({
12
12
  title: p,
13
13
  children: s,
14
14
  method: n,
15
- onSubmit: m
15
+ validated: m = !1,
16
+ onSubmit: d
16
17
  }) => {
17
- const r = e.Children.toArray(s), c = r[0] && e.isValidElement(r[0]) && r[0].type.displayName === "Subtitulo", i = r.filter(
18
- (t) => e.isValidElement(t) && t.type.displayName === "SeccionTarjeta"
19
- ), d = i.length > 0, y = e.Children.map(s, (t, o) => e.isValidElement(t) && t.type.displayName === "SeccionTarjeta" ? e.cloneElement(t, {
20
- isGray: t.props.isGray ?? o % 2 === 1,
21
- isLast: t.props.isLast ?? o === i.length - 1
22
- }) : t);
23
- return /* @__PURE__ */ l(u, { children: [
24
- /* @__PURE__ */ l(f, { className: "border-0 mb-4 tarjeta-unp", children: [
25
- /* @__PURE__ */ a(C, { className: "d-flex justify-content-between align-items-center bg-unp text-light py-3 tarjeta-header-unp", children: p }),
26
- d ? y : /* @__PURE__ */ a(j, { className: `${c ? "pt-0" : ""}`, children: s })
18
+ const r = t.Children.toArray(s), c = r[0] && t.isValidElement(r[0]) && r[0].type.displayName === "Subtitulo", i = r.filter(
19
+ (e) => t.isValidElement(e) && e.type.displayName === "SeccionTarjeta"
20
+ ), y = i.length > 0, u = t.Children.map(s, (e, o) => t.isValidElement(e) && e.type.displayName === "SeccionTarjeta" ? t.cloneElement(e, {
21
+ isGray: e.props.isGray ?? o % 2 === 1,
22
+ isLast: e.props.isLast ?? o === i.length - 1
23
+ }) : e);
24
+ return /* @__PURE__ */ l(f, { children: [
25
+ /* @__PURE__ */ l(C, { className: "border-0 mb-4 tarjeta-unp", children: [
26
+ /* @__PURE__ */ a(j, { className: "d-flex justify-content-between align-items-center bg-unp text-light py-3 tarjeta-header-unp", children: p }),
27
+ /* @__PURE__ */ a(
28
+ "form",
29
+ {
30
+ method: n,
31
+ noValidate: !0,
32
+ className: m ? "was-validated" : "",
33
+ children: y ? u : /* @__PURE__ */ a(S, { className: `${c ? "pt-0" : ""}`, children: s })
34
+ }
35
+ )
27
36
  ] }),
28
- n === "POST" || n === "post" && /* @__PURE__ */ a("div", { style: { display: "flex", justifyContent: "end" }, children: /* @__PURE__ */ a(S, { variant: "unp_send", style: b, onClick: m, children: "Enviar" }) })
37
+ n === "POST" || n === "post" && /* @__PURE__ */ a("div", { style: { display: "flex", justifyContent: "end" }, children: /* @__PURE__ */ a(b, { variant: "unp_send", style: g, onClick: d, children: "Enviar" }) })
29
38
  ] });
30
39
  };
31
40
  export {
32
- v as Tarjeta
41
+ V as Tarjeta
33
42
  };
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": "0.9.6",
5
+ "version": "0.9.7",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {