react-ecosistema-unp 1.7.12 → 1.7.13

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,80 +1,89 @@
1
- import { jsxs as s, Fragment as h, jsx as i } from "react/jsx-runtime";
2
- import { useState as p, useRef as y, useEffect as g } from "react";
1
+ import { jsxs as s, Fragment as g, jsx as i } from "react/jsx-runtime";
2
+ import { useState as v, useRef as b, useEffect as N } from "react";
3
3
  import '../../assets/Bootstrap.css';import '../../assets/Paginador.css';/* empty css */
4
4
  /* empty css */
5
- import { C as v } from "../../Card-DAsInpjB.js";
5
+ import { C as k } from "../../Card-DAsInpjB.js";
6
6
  import { B as f } from "../../Button-B87TJYml.js";
7
- const w = ({ stepContent: t, onSubmit: d, canJump: c = !0 }) => {
8
- const [e, a] = p(0), o = y(null);
9
- return g(() => {
7
+ const E = ({
8
+ stepContent: a,
9
+ onSubmit: d,
10
+ canJump: c = !0,
11
+ sendButtonLabel: p = "Enviar",
12
+ isSendButtonDisabled: y = !1,
13
+ extraButton: u
14
+ }) => {
15
+ const [e, t] = v(0), o = b(null);
16
+ return N(() => {
10
17
  o.current && e > 0 && o.current.scrollIntoView({
11
18
  behavior: "smooth"
12
19
  });
13
- }, [e]), /* @__PURE__ */ s(h, { children: [
14
- /* @__PURE__ */ i(v, { ref: o, className: "border-0 paginador-card", children: /* @__PURE__ */ i("ul", { id: "progressbar", children: t.map((n, r) => /* @__PURE__ */ s(
20
+ }, [e]), /* @__PURE__ */ s(g, { children: [
21
+ /* @__PURE__ */ i(k, { ref: o, className: "border-0 paginador-card", children: /* @__PURE__ */ i("ul", { id: "progressbar", children: a.map((l, r) => /* @__PURE__ */ s(
15
22
  "li",
16
23
  {
17
24
  className: r <= e ? "active" : "",
18
25
  onClick: async () => {
19
- if (t[e].handleNextClick && !c) {
20
- const l = t[e].handleNextClick;
21
- let u = !0;
22
- if (l) {
23
- const m = await l();
24
- typeof m == "boolean" && (u = m);
26
+ if (a[e].handleNextClick && !c) {
27
+ const n = a[e].handleNextClick;
28
+ let m = !0;
29
+ if (n) {
30
+ const h = await n();
31
+ typeof h == "boolean" && (m = h);
25
32
  }
26
- u && a(e + 1);
27
- } else c ? c && a(r) : (r === e + 1 || r < e) && a(r);
33
+ m && (r >= e + 1 ? t(e + 1) : r < e && t(r));
34
+ } else c ? c && t(r) : (r === e + 1 || r < e) && t(r);
28
35
  },
29
36
  children: [
30
- /* @__PURE__ */ i("div", { className: `step ${r <= e ? "active" : ""}`, children: /* @__PURE__ */ i(n.icon, { size: 18 }) }),
31
- /* @__PURE__ */ i("strong", { children: n.label })
37
+ /* @__PURE__ */ i("div", { className: `step ${r <= e ? "active" : ""}`, children: /* @__PURE__ */ i(l.icon, { size: 18 }) }),
38
+ /* @__PURE__ */ i("strong", { children: l.label })
32
39
  ]
33
40
  },
34
41
  r
35
42
  )) }) }),
36
- /* @__PURE__ */ i("div", { className: "paginador-content", children: t[e].content }),
43
+ /* @__PURE__ */ i("div", { className: "paginador-content", children: a[e].content }),
37
44
  /* @__PURE__ */ s("div", { className: "paginador-buttons", style: { display: "flex", justifyContent: "end" }, children: [
38
45
  e > 0 && /* @__PURE__ */ i(
39
46
  f,
40
47
  {
41
48
  type: "button",
42
49
  variant: "unp_secondary",
43
- onClick: () => a(e - 1),
50
+ onClick: () => t(e - 1),
44
51
  children: "Anterior"
45
52
  }
46
53
  ),
47
- e < t.length - 1 && /* @__PURE__ */ i(
54
+ e < a.length - 1 && /* @__PURE__ */ i(
48
55
  f,
49
56
  {
50
57
  type: "button",
51
58
  variant: "unp_primary",
52
59
  style: { justifySelf: "end", marginLeft: "1rem" },
53
60
  onClick: async () => {
54
- const n = t[e].handleNextClick;
61
+ const l = a[e].handleNextClick;
55
62
  let r = !0;
56
- if (n) {
57
- const l = await n();
58
- typeof l == "boolean" && (r = l);
63
+ if (l) {
64
+ const n = await l();
65
+ typeof n == "boolean" && (r = n);
59
66
  }
60
- r && a(e + 1);
67
+ r && t(e + 1);
61
68
  },
62
69
  children: "Siguiente"
63
70
  }
64
71
  ),
65
- e === t.length - 1 && d && /* @__PURE__ */ i(
72
+ e === a.length - 1 && d && /* @__PURE__ */ i(
66
73
  f,
67
74
  {
68
- type: "submit",
75
+ type: "button",
69
76
  variant: "unp_send",
70
77
  onClick: d,
71
78
  style: { marginLeft: "1rem" },
72
- children: "Enviar"
79
+ disabled: y,
80
+ children: p
73
81
  }
74
- )
82
+ ),
83
+ u && /* @__PURE__ */ i("div", { children: u })
75
84
  ] })
76
85
  ] });
77
86
  };
78
87
  export {
79
- w as Paginador
88
+ E as Paginador
80
89
  };
package/package.json CHANGED
@@ -1,113 +1,113 @@
1
- {
2
- "name": "react-ecosistema-unp",
3
- "author": "Ecosistema de Información - Unidad Nacional de Protección",
4
- "private": false,
5
- "version": "1.7.12",
6
- "type": "module",
7
- "exports": {
8
- ".": {
9
- "types": "./dist/lib/main.d.ts",
10
- "default": "./dist/main.js"
11
- },
12
- "./shared": {
13
- "types": "./dist/lib/shared.d.ts",
14
- "default": "./dist/shared.js"
15
- },
16
- "./ui": {
17
- "types": "./dist/lib/ui.d.ts",
18
- "default": "./dist/ui.js"
19
- },
20
- "./cards": {
21
- "types": "./dist/lib/cards.d.ts",
22
- "default": "./dist/cards.js"
23
- },
24
- "./tables": {
25
- "types": "./dist/lib/tables.d.ts",
26
- "default": "./dist/tables.js"
27
- },
28
- "./utils": {
29
- "types": "./dist/lib/utils.d.ts",
30
- "default": "./dist/utils.js"
31
- },
32
- "./accessibility": {
33
- "types": "./dist/lib/accessibility.d.ts",
34
- "default": "./dist/accessibility.js"
35
- },
36
- "./data": {
37
- "types": "./dist/lib/data.d.ts",
38
- "default": "./dist/data.js"
39
- },
40
- "./styles/EcoStyles.css": "./dist/assets/Bootstrap.css",
41
- "./utils/fetchInterceptor.js": "./dist/utils/fetch-interceptor/fetchInterceptor.js"
42
- },
43
- "files": [
44
- "dist"
45
- ],
46
- "repository": {
47
- "type": "git",
48
- "url": "https://github.com/EcosistemaUNP/react-ecosistema-unp"
49
- },
50
- "sideEffects": [
51
- "**/*.css"
52
- ],
53
- "scripts": {
54
- "dev": "vite",
55
- "build": "tsc -b ./tsconfig.lib.json && vite build",
56
- "prepublishOnly": "npm run build",
57
- "lint": "eslint .",
58
- "preview": "vite preview",
59
- "storybook": "storybook dev -p 6006",
60
- "build-storybook": "storybook build --output-dir .storybook/.storybook-build",
61
- "predeploy": "npm run build-storybook",
62
- "deploy:storybook": "gh-pages -d .storybook-build -b gh-pages -t"
63
- },
64
- "peerDependencies": {
65
- "react": ">=18.0.0 <=20.0.0",
66
- "react-dom": ">=18.0.0 <=20.0.0",
67
- "react-router-dom": ">=6.0.0 <=8.0.0"
68
- },
69
- "dependencies": {
70
- "@marsidev/react-turnstile": "^1.1.0",
71
- "bootstrap": "^5.3.3",
72
- "jwt-decode": "^4.0.0",
73
- "lottie-react": "^2.4.1",
74
- "react-bootstrap": "^2.10.9",
75
- "react-icons": "^5.4.0",
76
- "react-select": "^5.10.1",
77
- "react-toastify": "^11.0.3",
78
- "sweetalert2": "^11.16.1"
79
- },
80
- "devDependencies": {
81
- "@chromatic-com/storybook": "^3.2.4",
82
- "@eslint/js": "^9.17.0",
83
- "@storybook/addon-essentials": "^8.5.5",
84
- "@storybook/addon-interactions": "^8.5.5",
85
- "@storybook/addon-onboarding": "^8.5.5",
86
- "@storybook/blocks": "^8.5.5",
87
- "@storybook/react": "^8.5.5",
88
- "@storybook/react-vite": "^8.5.5",
89
- "@storybook/test": "^8.5.5",
90
- "@types/node": "^22.10.10",
91
- "@types/react": "^18.3.18",
92
- "@types/react-dom": "^18.3.5",
93
- "@vitejs/plugin-react": "^4.3.4",
94
- "eslint": "^9.17.0",
95
- "eslint-plugin-react-hooks": "^5.0.0",
96
- "eslint-plugin-react-refresh": "^0.4.16",
97
- "eslint-plugin-storybook": "^0.11.2",
98
- "gh-pages": "^6.3.0",
99
- "glob": "^11.0.1",
100
- "globals": "^15.14.0",
101
- "storybook": "^8.5.5",
102
- "typescript": "~5.6.2",
103
- "typescript-eslint": "^8.18.2",
104
- "vite": "^6.1.0",
105
- "vite-plugin-dts": "^4.5.0",
106
- "vite-plugin-lib-inject-css": "^2.2.1"
107
- },
108
- "eslintConfig": {
109
- "extends": [
110
- "plugin:storybook/recommended"
111
- ]
112
- }
113
- }
1
+ {
2
+ "name": "react-ecosistema-unp",
3
+ "author": "Ecosistema de Información - Unidad Nacional de Protección",
4
+ "private": false,
5
+ "version": "1.7.13",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/lib/main.d.ts",
10
+ "default": "./dist/main.js"
11
+ },
12
+ "./shared": {
13
+ "types": "./dist/lib/shared.d.ts",
14
+ "default": "./dist/shared.js"
15
+ },
16
+ "./ui": {
17
+ "types": "./dist/lib/ui.d.ts",
18
+ "default": "./dist/ui.js"
19
+ },
20
+ "./cards": {
21
+ "types": "./dist/lib/cards.d.ts",
22
+ "default": "./dist/cards.js"
23
+ },
24
+ "./tables": {
25
+ "types": "./dist/lib/tables.d.ts",
26
+ "default": "./dist/tables.js"
27
+ },
28
+ "./utils": {
29
+ "types": "./dist/lib/utils.d.ts",
30
+ "default": "./dist/utils.js"
31
+ },
32
+ "./accessibility": {
33
+ "types": "./dist/lib/accessibility.d.ts",
34
+ "default": "./dist/accessibility.js"
35
+ },
36
+ "./data": {
37
+ "types": "./dist/lib/data.d.ts",
38
+ "default": "./dist/data.js"
39
+ },
40
+ "./styles/EcoStyles.css": "./dist/assets/Bootstrap.css",
41
+ "./utils/fetchInterceptor.js": "./dist/utils/fetch-interceptor/fetchInterceptor.js"
42
+ },
43
+ "files": [
44
+ "dist"
45
+ ],
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "https://github.com/EcosistemaUNP/react-ecosistema-unp"
49
+ },
50
+ "sideEffects": [
51
+ "**/*.css"
52
+ ],
53
+ "scripts": {
54
+ "dev": "vite",
55
+ "build": "tsc -b ./tsconfig.lib.json && vite build",
56
+ "prepublishOnly": "npm run build",
57
+ "lint": "eslint .",
58
+ "preview": "vite preview",
59
+ "storybook": "storybook dev -p 6006",
60
+ "build-storybook": "storybook build --output-dir .storybook/.storybook-build",
61
+ "predeploy": "npm run build-storybook",
62
+ "deploy:storybook": "gh-pages -d .storybook-build -b gh-pages -t"
63
+ },
64
+ "peerDependencies": {
65
+ "react": ">=18.0.0 <=20.0.0",
66
+ "react-dom": ">=18.0.0 <=20.0.0",
67
+ "react-router-dom": ">=6.0.0 <=8.0.0"
68
+ },
69
+ "dependencies": {
70
+ "@marsidev/react-turnstile": "^1.1.0",
71
+ "bootstrap": "^5.3.3",
72
+ "jwt-decode": "^4.0.0",
73
+ "lottie-react": "^2.4.1",
74
+ "react-bootstrap": "^2.10.9",
75
+ "react-icons": "^5.4.0",
76
+ "react-select": "^5.10.1",
77
+ "react-toastify": "^11.0.3",
78
+ "sweetalert2": "^11.16.1"
79
+ },
80
+ "devDependencies": {
81
+ "@chromatic-com/storybook": "^3.2.4",
82
+ "@eslint/js": "^9.17.0",
83
+ "@storybook/addon-essentials": "^8.5.5",
84
+ "@storybook/addon-interactions": "^8.5.5",
85
+ "@storybook/addon-onboarding": "^8.5.5",
86
+ "@storybook/blocks": "^8.5.5",
87
+ "@storybook/react": "^8.5.5",
88
+ "@storybook/react-vite": "^8.5.5",
89
+ "@storybook/test": "^8.5.5",
90
+ "@types/node": "^22.10.10",
91
+ "@types/react": "^18.3.18",
92
+ "@types/react-dom": "^18.3.5",
93
+ "@vitejs/plugin-react": "^4.3.4",
94
+ "eslint": "^9.17.0",
95
+ "eslint-plugin-react-hooks": "^5.0.0",
96
+ "eslint-plugin-react-refresh": "^0.4.16",
97
+ "eslint-plugin-storybook": "^0.11.2",
98
+ "gh-pages": "^6.3.0",
99
+ "glob": "^11.0.1",
100
+ "globals": "^15.14.0",
101
+ "storybook": "^8.5.5",
102
+ "typescript": "~5.6.2",
103
+ "typescript-eslint": "^8.18.2",
104
+ "vite": "^6.1.0",
105
+ "vite-plugin-dts": "^4.5.0",
106
+ "vite-plugin-lib-inject-css": "^2.2.1"
107
+ },
108
+ "eslintConfig": {
109
+ "extends": [
110
+ "plugin:storybook/recommended"
111
+ ]
112
+ }
113
+ }