energy-components 1.0.2

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.
Files changed (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +94 -0
  3. package/dist/.empty +0 -0
  4. package/dist/components/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  5. package/dist/components/accordion.es.js +121 -0
  6. package/dist/components/accordionGroup.es.js +32 -0
  7. package/dist/components/actionButton.es.js +64 -0
  8. package/dist/components/breadcrumbs.es.js +90 -0
  9. package/dist/components/button.es.js +144 -0
  10. package/dist/components/checkbox.es.js +130 -0
  11. package/dist/components/divider.es.js +35 -0
  12. package/dist/components/dropdown.es.js +331 -0
  13. package/dist/components/floatingActionButton.es.js +97 -0
  14. package/dist/components/functions-DIHwdgF0.js +18 -0
  15. package/dist/components/icon-svg-Cpx09myr.js +10818 -0
  16. package/dist/components/iconList.es.js +49 -0
  17. package/dist/components/iconSvg.es.js +5 -0
  18. package/dist/components/index.es.js +81 -0
  19. package/dist/components/indicator.es.js +175 -0
  20. package/dist/components/link.es.js +147 -0
  21. package/dist/components/multiselect.es.js +1039 -0
  22. package/dist/components/pagination.es.js +138 -0
  23. package/dist/components/radioButton.es.js +111 -0
  24. package/dist/components/style/accordion.css +1 -0
  25. package/dist/components/style/accordionGroup.css +1 -0
  26. package/dist/components/style/actionButton.css +1 -0
  27. package/dist/components/style/breadcrumbs.css +1 -0
  28. package/dist/components/style/button.css +1 -0
  29. package/dist/components/style/checkbox.css +1 -0
  30. package/dist/components/style/divider.css +1 -0
  31. package/dist/components/style/dropdown.css +1 -0
  32. package/dist/components/style/floatingActionButton.css +1 -0
  33. package/dist/components/style/icon-svg.css +1 -0
  34. package/dist/components/style/iconList.css +1 -0
  35. package/dist/components/style/indicator.css +1 -0
  36. package/dist/components/style/link.css +1 -0
  37. package/dist/components/style/multiselect.css +1 -0
  38. package/dist/components/style/pagination.css +1 -0
  39. package/dist/components/style/radioButton.css +1 -0
  40. package/dist/components/style/switch.css +1 -0
  41. package/dist/components/style/tabBar.css +1 -0
  42. package/dist/components/style/tag.css +1 -0
  43. package/dist/components/style/textArea.css +1 -0
  44. package/dist/components/style/textField.css +1 -0
  45. package/dist/components/style/tooltip.css +1 -0
  46. package/dist/components/switch.es.js +96 -0
  47. package/dist/components/tabBar.es.js +181 -0
  48. package/dist/components/tag.es.js +91 -0
  49. package/dist/components/textArea.es.js +259 -0
  50. package/dist/components/textField.es.js +254 -0
  51. package/dist/components/tooltip.es.js +1082 -0
  52. package/dist/energy-components.es.js +15368 -0
  53. package/dist/energy-components.umd.js +1 -0
  54. package/dist/style.css +1 -0
  55. package/dist/types/src/components/buttons/action-button/action-button.vue.d.ts +100 -0
  56. package/dist/types/src/components/buttons/button/button.vue.d.ts +196 -0
  57. package/dist/types/src/components/buttons/constants/buttonDocs.d.ts +1 -0
  58. package/dist/types/src/components/buttons/constants/buttonPosition.d.ts +1 -0
  59. package/dist/types/src/components/buttons/constants/socialMedia.d.ts +1 -0
  60. package/dist/types/src/components/buttons/floating-action-button/floating-action-button.vue.d.ts +136 -0
  61. package/dist/types/src/components/content/accordion/accordion.vue.d.ts +122 -0
  62. package/dist/types/src/components/content/acordion-group/accordion-group.d.ts +6 -0
  63. package/dist/types/src/components/content/acordion-group/accordion-group.vue.d.ts +33 -0
  64. package/dist/types/src/components/content/divider/divider.vue.d.ts +35 -0
  65. package/dist/types/src/components/content/tag/tag.vue.d.ts +105 -0
  66. package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +100 -0
  67. package/dist/types/src/components/icon-svg/icon-list.d.ts +11 -0
  68. package/dist/types/src/components/icon-svg/icon-list.vue.d.ts +2 -0
  69. package/dist/types/src/components/icon-svg/icon-svg.vue.d.ts +68 -0
  70. package/dist/types/src/components/index.d.ts +20 -0
  71. package/dist/types/src/components/input/checkbox/checkbox.vue.d.ts +151 -0
  72. package/dist/types/src/components/input/dropdown/Multiselect/Multiselect.vue.d.ts +2 -0
  73. package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +270 -0
  74. package/dist/types/src/components/input/radio-button/radio-button.vue.d.ts +114 -0
  75. package/dist/types/src/components/input/switch/switch.vue.d.ts +104 -0
  76. package/dist/types/src/components/input/text-area/text-area.vue.d.ts +281 -0
  77. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +271 -0
  78. package/dist/types/src/components/navigation/breadcrumbs/breadcrumbs.vue.d.ts +63 -0
  79. package/dist/types/src/components/navigation/link/link.types.d.ts +15 -0
  80. package/dist/types/src/components/navigation/link/link.vue.d.ts +175 -0
  81. package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +67 -0
  82. package/dist/types/src/components/navigation/tab-bar/tab-bar.vue.d.ts +132 -0
  83. package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +118 -0
  84. package/dist/types/src/helpers/functions.d.ts +3 -0
  85. package/dist/types/src/helpers/stories.helpers.d.ts +1 -0
  86. package/dist/types/src/helpers/validation.d.ts +1 -0
  87. package/dist/types/src/index.d.ts +8 -0
  88. package/dist/types/tsconfig.tsbuildinfo +1 -0
  89. package/package.json +156 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Chroma Software Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,94 @@
1
+ # Energy Components:
2
+
3
+ energy-components is a library of atomic components implemented using Vue3 + TypeScript technologies.
4
+
5
+ For its functionality, energy-components also integrates another library developed by the Webbap Platforms team:
6
+ [energy-foundations](https://www.npmjs.com/package/energy-foundations),
7
+ which is also available for use.
8
+
9
+ ## Installation
10
+
11
+ You need Vue.js version 3.2+ to use this library.
12
+ It's also necessary to install energy-foundations >= [0.0.10 or the latest](https://www.npmjs.com/package/energy-foundations?activeTab=versions).
13
+
14
+ **Yarn**
15
+
16
+ ```bash
17
+ yarn add energy-components
18
+ ```
19
+
20
+ If you use Yarn, you may see a `warning` indicating that the `energy-foundations` library is required.
21
+ This is the moment to install it if you haven't done so already.
22
+
23
+ ```bash
24
+ yarn add energy-foundations
25
+ ```
26
+
27
+ **NPM**
28
+
29
+ ```bash
30
+ npm i energy-components
31
+ ```
32
+
33
+ If you use npm version >=7.0.0, it will automatically install the `energy-foundations` library.
34
+
35
+ ## Usage
36
+
37
+ ### Before You Begin:
38
+
39
+ You need to import the energy-foundations styles in your application. If you haven't installed the library yet, follow
40
+ this [documentation](https://www.npmjs.com/package/energy-foundations?activeTab=readme).
41
+
42
+ ### Recommended: Independent Components (tree-shaking)
43
+
44
+ This approach includes only the components you use in the final bundle of your application.
45
+ There's no need to import styles, as each component imports its own.
46
+
47
+ Although you can customize the component names, we recommend using the same names as in the library to maintain
48
+ consistency.
49
+
50
+ ```
51
+ <div class="doc-notification">
52
+ <div class="doc-notification__body">
53
+ <p>Important: remember to import components from <b>'energy-components/components'</b> as shown below</p>
54
+ </div>
55
+ </div>
56
+ ```
57
+
58
+ ### Declaring Components Globally
59
+
60
+ ```vue
61
+ // main.ts import { RDSButton, RDSTextField } from 'energy-components/components'; const app =
62
+ createApp(App); app.component('RDSButton', RDSButton); app.component('RDSTextField', RDSTextField);
63
+ app.mount('#app');
64
+ ```
65
+
66
+ ### Declaring Components Locally
67
+
68
+ With this approach, you'll also only use the components you import.
69
+ However, they will only be available within the component where you do the `import`.
70
+
71
+ ```vue
72
+ // *.vue
73
+ <script setup lang="ts">
74
+ import { RDSButton } from 'energy-components/components'
75
+ </script>
76
+ ```
77
+
78
+ ### Not Recommended: Entire Library
79
+
80
+ Due to the large number of components available in the library,
81
+ using this approach may significantly increase your bundle size,
82
+ affecting the performance of your application.
83
+
84
+ ```vue
85
+ // main.ts import RDSLibrary from 'energy-components'; const app = createApp(App);
86
+ app.use(RDSLibrary);
87
+ ```
88
+
89
+ **Important:** If you choose this method of importing the library, you must add an additional CSS file in main.css,
90
+ below the energy-foundations CSS.
91
+
92
+ ```vue
93
+ // main.scss @import 'energy-foundations/dist/style.css'; @import 'energy-components/style';
94
+ ```
package/dist/.empty ADDED
File without changes
@@ -0,0 +1,9 @@
1
+ const s = (t, r) => {
2
+ const o = t.__vccOpts || t;
3
+ for (const [c, e] of r)
4
+ o[c] = e;
5
+ return o;
6
+ };
7
+ export {
8
+ s as _
9
+ };
@@ -0,0 +1,121 @@
1
+ import { defineComponent as R, toRefs as D, ref as l, watch as B, nextTick as q, inject as v, onMounted as N, onBeforeUnmount as V, openBlock as _, createElementBlock as w, createElementVNode as r, toDisplayString as h, unref as d, createBlock as A, mergeProps as H, createCommentVNode as P, createVNode as T, normalizeClass as y, renderSlot as j, createTextVNode as E } from "vue";
2
+ import { R as I } from "./icon-svg-Cpx09myr.js";
3
+ import O from "./tag.es.js";
4
+ import { _ as $ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ import './style/accordion.css';const b = { class: "rds-accordion" }, z = { class: "rds-accordion-title" }, L = { class: "rds-accordion-title_right" }, M = /* @__PURE__ */ R({
6
+ __name: "accordion",
7
+ props: {
8
+ /**
9
+ * El identificador único del elemento.
10
+ */
11
+ id: {
12
+ type: String,
13
+ required: !0,
14
+ validator: (o) => !o || o.trim().length > 0 ? (console.error("[RDSAccordion]: La propiedad id es requerida."), !1) : !0
15
+ },
16
+ /**
17
+ * El título del acordeón.
18
+ */
19
+ title: {
20
+ type: String,
21
+ required: !0
22
+ },
23
+ /**
24
+ * El contenido del acordeón.
25
+ * Texto simple a mostrar si no tiene nada mas, si no se utiliza el slot por defecto.
26
+ */
27
+ content: {
28
+ type: String,
29
+ required: !1
30
+ },
31
+ /**
32
+ * Indica si el acordeón está abierto o cerrado.
33
+ */
34
+ open: {
35
+ type: Boolean,
36
+ default: !1
37
+ },
38
+ /**
39
+ * La etiqueta del acordeón, mostrada a la derecha del panel.
40
+ */
41
+ tag: {
42
+ type: Object,
43
+ default: null
44
+ }
45
+ },
46
+ emits: ["update:open"],
47
+ setup(o, { expose: C, emit: S }) {
48
+ const n = o, k = S, { tag: a } = D(n), t = l(n.open), c = l(null), s = l(null), x = () => {
49
+ if (!c.value || !s.value) return;
50
+ const e = s.value.scrollHeight;
51
+ c.value.style.maxHeight = t.value ? `${e}px` : "0px";
52
+ }, i = (e) => {
53
+ e === void 0 ? t.value = !t.value : t.value = e, k("update:open", t.value), x();
54
+ }, u = () => {
55
+ i(!0);
56
+ }, p = () => {
57
+ i(!1);
58
+ };
59
+ B(
60
+ () => n.open,
61
+ (e) => q(() => {
62
+ i(e);
63
+ }),
64
+ { immediate: !0 }
65
+ );
66
+ const f = v("registerRDSAccordionChild"), m = v("unregisterRDSAccordionChild");
67
+ return N(() => {
68
+ f && f({
69
+ id: n.id,
70
+ open: u,
71
+ close: p
72
+ });
73
+ }), V(() => {
74
+ m && m(n.id);
75
+ }), C({
76
+ /**
77
+ * Abre el panel.
78
+ */
79
+ openPanel: u,
80
+ /**
81
+ * Cierra el panel.
82
+ */
83
+ closePanel: p
84
+ }), (e, g) => (_(), w("div", b, [
85
+ r("div", {
86
+ class: "rds-accordion-title_container",
87
+ onClick: g[0] || (g[0] = () => i())
88
+ }, [
89
+ r("span", z, h(o.title), 1),
90
+ r("div", L, [
91
+ d(a) && d(a).icon ? (_(), A(O, H({
92
+ key: 0,
93
+ class: "rds-accordion-title_tag"
94
+ }, d(a), { small: "" }), null, 16)) : P("", !0),
95
+ T(I, {
96
+ class: y(["rds-accordion-title_icon", { "rds-accordion-title_icon--open": t.value }]),
97
+ name: "arrow_down"
98
+ }, null, 8, ["class"])
99
+ ])
100
+ ]),
101
+ r("div", {
102
+ ref_key: "panel",
103
+ ref: c,
104
+ class: y(["rds-accordion-panel", { "rds-accordion-panel--open": t.value }])
105
+ }, [
106
+ r("div", {
107
+ ref_key: "panelContent",
108
+ ref: s,
109
+ class: "rds-accordion-panel_content"
110
+ }, [
111
+ j(e.$slots, "default", {}, () => [
112
+ E(h(o.content), 1)
113
+ ], !0)
114
+ ], 512)
115
+ ], 2)
116
+ ]));
117
+ }
118
+ }), K = /* @__PURE__ */ $(M, [["__scopeId", "data-v-1a4408f9"]]);
119
+ export {
120
+ K as default
121
+ };
@@ -0,0 +1,32 @@
1
+ import { defineComponent as s, ref as t, provide as r, openBlock as d, createElementBlock as i, renderSlot as a } from "vue";
2
+ import { _ as p } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ import './style/accordionGroup.css';const u = { class: "rds-accordion-group" }, _ = /* @__PURE__ */ s({
4
+ __name: "accordion-group",
5
+ setup(f, { expose: n }) {
6
+ const e = t([]);
7
+ return r("registerRDSAccordionChild", (o) => {
8
+ e.value.push(o);
9
+ }), r("unregisterRDSAccordionChild", (o) => {
10
+ const c = e.value.findIndex((l) => l.id === o);
11
+ c > -1 && e.value.splice(c, 1);
12
+ }), n({
13
+ /**
14
+ * Abre todos los paneles del acordeón
15
+ */
16
+ openAll: () => {
17
+ e.value.forEach((o) => o.open());
18
+ },
19
+ /**
20
+ * Cierra todos los paneles del acordeón
21
+ */
22
+ closeAll: () => {
23
+ e.value.forEach((o) => o.close());
24
+ }
25
+ }), (o, c) => (d(), i("div", u, [
26
+ a(o.$slots, "default", {}, void 0, !0)
27
+ ]));
28
+ }
29
+ }), x = /* @__PURE__ */ p(_, [["__scopeId", "data-v-a9d0f19c"]]);
30
+ export {
31
+ x as default
32
+ };
@@ -0,0 +1,64 @@
1
+ import { defineComponent as o, openBlock as a, createBlock as r, mergeProps as n } from "vue";
2
+ import s from "./button.es.js";
3
+ import { _ as l } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import './style/actionButton.css';const p = /* @__PURE__ */ o({
5
+ __name: "action-button",
6
+ props: {
7
+ /**
8
+ * <span>Icono a mostrar en el botón</span>
9
+ */
10
+ icon: {
11
+ type: String,
12
+ required: !0
13
+ },
14
+ /**
15
+ * <span>Variante del botón</span>
16
+ * <br>
17
+ *`['primary', 'secondary']`
18
+ */
19
+ variant: {
20
+ type: String,
21
+ default: "primary",
22
+ validator(e) {
23
+ return ["primary", "secondary"].includes(e);
24
+ }
25
+ },
26
+ /**
27
+ * <span>Indica si el botón es inverso</span>
28
+ */
29
+ inverse: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ /**
34
+ * <span>Indica si el botón es pequeño</span>
35
+ */
36
+ small: {
37
+ type: Boolean,
38
+ default: !1
39
+ },
40
+ /**
41
+ * <span>Añade una clase por encima de opacidad <br>Los eventos funcionan</span>
42
+ */
43
+ disabled: {
44
+ type: Boolean,
45
+ default: !1
46
+ },
47
+ /**
48
+ * <span>Cambia el estado del botón a cargando</span>
49
+ */
50
+ loading: {
51
+ type: Boolean,
52
+ default: !1
53
+ }
54
+ },
55
+ setup(e) {
56
+ return (t, i) => (a(), r(s, n({ class: "rds-btn--action" }, { ...t.$props, ...t.$attrs }, {
57
+ text: "",
58
+ "is-action": ""
59
+ }), null, 16));
60
+ }
61
+ }), f = /* @__PURE__ */ l(p, [["__scopeId", "data-v-3d4e563b"]]);
62
+ export {
63
+ f as default
64
+ };
@@ -0,0 +1,90 @@
1
+ import { defineComponent as g, toRefs as h, ref as y, watchEffect as C, onMounted as L, openBlock as c, createElementBlock as l, Fragment as I, renderList as w, normalizeClass as x, unref as B, createVNode as j, mergeProps as E, toHandlers as P, withCtx as T, createCommentVNode as D } from "vue";
2
+ import N from "./link.es.js";
3
+ import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import './style/breadcrumbs.css';const R = { key: 0 }, V = /* @__PURE__ */ g({
5
+ __name: "breadcrumbs",
6
+ props: {
7
+ /**
8
+ * <span>Lista de items a mostrar en el breadcrumb</span>
9
+ */
10
+ items: {
11
+ type: Array,
12
+ required: !0
13
+ },
14
+ /**
15
+ * <span>Indica si el breadcrumb se mostrará en modo inverso. En modo inverso, el texto es claro sobre un fondo oscuro.</span>
16
+ */
17
+ inverse: {
18
+ type: Boolean,
19
+ default: !1
20
+ },
21
+ /**
22
+ * <span>Indica si el breadcrumb debe ser recortado en el medio, y mostrar un botón en su lugar.</span>
23
+ */
24
+ trimItems: {
25
+ type: Boolean,
26
+ default: !1
27
+ }
28
+ },
29
+ emits: ["onClickTrimmedList"],
30
+ setup(d, { emit: p }) {
31
+ const s = d, f = p, {
32
+ items: t,
33
+ inverse: o
34
+ } = h(s), n = y(), v = () => {
35
+ f("onClickTrimmedList", t.value.slice(1, -1));
36
+ }, m = () => {
37
+ n.value = [
38
+ t.value[0],
39
+ {
40
+ text: "...",
41
+ active: !1,
42
+ tag: "router-link",
43
+ to: "",
44
+ clickable: !0
45
+ },
46
+ t.value[t.value.length - 1]
47
+ ];
48
+ }, u = () => {
49
+ s.trimItems && t.value.length > 3 ? m() : typeof s.items == "object" ? n.value = s.items : console.error("energy-components: The prop is not an Object");
50
+ }, _ = (e, a) => {
51
+ const r = {
52
+ ...e,
53
+ inverse: o.value
54
+ };
55
+ return a !== n.value.length - 1 && Object.assign(r, {
56
+ arrow: !0,
57
+ right: !0
58
+ }), r;
59
+ }, b = (e) => ({
60
+ click: (r) => {
61
+ r.preventDefault(), r.stopPropagation(), e != null && e.clickable && v();
62
+ }
63
+ }), k = (e) => [
64
+ "rds-breadcrumbs__link",
65
+ e != null && e.active ? "rds-breadcrumbs__link--active" : "",
66
+ o.value && (e != null && e.active) ? "rds-breadcrumbs__link--inverse-active" : ""
67
+ ];
68
+ return C(() => {
69
+ u();
70
+ }), L(() => {
71
+ u();
72
+ }), (e, a) => (c(!0), l(I, null, w(n.value, (r, i) => (c(), l("ul", {
73
+ key: i,
74
+ class: x(["rds-breadcrumbs", `${B(o) ? "rds-breadcrumbs--inverse" : ""}`])
75
+ }, [
76
+ j(N, E({
77
+ class: k(r),
78
+ ref_for: !0
79
+ }, _(r, i), P(b(r))), {
80
+ default: T(() => [
81
+ r != null && r.clickable ? (c(), l("span", R, "...")) : D("", !0)
82
+ ]),
83
+ _: 2
84
+ }, 1040, ["class"])
85
+ ], 2))), 128));
86
+ }
87
+ }), F = /* @__PURE__ */ O(V, [["__scopeId", "data-v-f010c3a0"]]);
88
+ export {
89
+ F as default
90
+ };
@@ -0,0 +1,144 @@
1
+ import { defineComponent as B, toRefs as S, computed as l, openBlock as b, createElementBlock as x, unref as s, normalizeClass as m, createBlock as I, createCommentVNode as k, createElementVNode as $, renderSlot as C, createTextVNode as N, toDisplayString as R } from "vue";
2
+ import { R as V } from "./icon-svg-Cpx09myr.js";
3
+ import { _ as D } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import './style/button.css';const E = ["type", "disabled"], L = { class: "rds-btn__text" }, w = /* @__PURE__ */ B({
5
+ __name: "button",
6
+ props: {
7
+ /**
8
+ * <span>Texto a mostrar en el botón</span>
9
+ */
10
+ text: {
11
+ type: String,
12
+ default: "",
13
+ validator(e, t) {
14
+ return !e && !t.icon ? (console.info("No se han pasado ni texto ni icono al botón"), !1) : !0;
15
+ }
16
+ },
17
+ /**
18
+ * <span>Icono a mostrar en el botón</span>
19
+ */
20
+ icon: {
21
+ type: String,
22
+ default: "",
23
+ validator(e, t) {
24
+ return !e && !t.text ? (console.info("No se han pasado ni texto ni icono al botón"), !1) : !0;
25
+ }
26
+ },
27
+ /**
28
+ * <span>Tipo de botón</span>
29
+ * <br>
30
+ * `['button', 'submit', 'reset']`
31
+ */
32
+ type: {
33
+ type: String,
34
+ default: "button",
35
+ validator(e) {
36
+ const t = ["button", "submit", "reset"].includes(e);
37
+ return t || console.info(
38
+ `El tipo ${e} no es válido. Los tipos válidos son: button, submit, reset`
39
+ ), t;
40
+ }
41
+ },
42
+ /**
43
+ * <span>Variante del botón</span>
44
+ * <br>
45
+ *`['primary', 'secondary', 'ghost']`
46
+ */
47
+ variant: {
48
+ type: String,
49
+ default: "primary",
50
+ required: !0,
51
+ validator(e) {
52
+ const t = ["primary", "secondary", "ghost"].includes(e);
53
+ return t || console.info(
54
+ `La variante ${e} no es válida. Las variantes válidas son: primary, secondary, ghost`
55
+ ), t;
56
+ }
57
+ },
58
+ /**
59
+ * Indica si el boton ocupara el ancho completo del contenedor en dispositivos móviles.
60
+ */
61
+ mobileWidth: {
62
+ type: Boolean,
63
+ default: !1
64
+ },
65
+ /**
66
+ * <span>Indica si el botón es inverso</span>
67
+ */
68
+ inverse: {
69
+ type: Boolean,
70
+ default: !1
71
+ },
72
+ /**
73
+ * <span>Indica si el botón es pequeño</span>
74
+ */
75
+ small: {
76
+ type: Boolean,
77
+ default: !1
78
+ },
79
+ /**
80
+ * <span>Añade una clase por encima de opacidad <br>Los eventos funcionan</span>
81
+ */
82
+ disabled: {
83
+ type: Boolean,
84
+ default: !1
85
+ },
86
+ /**
87
+ * <span>Cambia la posicion del icono al lado derecho</span>
88
+ */
89
+ revertIcon: {
90
+ type: Boolean,
91
+ default: !1
92
+ },
93
+ /**
94
+ * <span>Cambia el estado del botón a cargando</span>
95
+ */
96
+ loading: {
97
+ type: Boolean,
98
+ default: !1
99
+ }
100
+ },
101
+ setup(e) {
102
+ const t = e, {
103
+ text: o,
104
+ icon: n,
105
+ type: r,
106
+ variant: i,
107
+ small: f,
108
+ disabled: u,
109
+ mobileWidth: y,
110
+ inverse: d,
111
+ revertIcon: _,
112
+ loading: p
113
+ } = S(t), c = l(() => p.value ? "loading" : n != null && n.value ? n == null ? void 0 : n.value : ""), h = l(() => r.value && ["button", "submit", "reset"].includes(r.value) ? r.value : "button"), v = l(() => ["primary", "secondary", "ghost"].includes(i.value) ? i.value : "primary"), g = l(() => {
114
+ const a = ["rds-btn"];
115
+ return i.value && a.push(`rds-btn--${v.value}`), d.value && a.push(`rds-btn--${v.value}-inverse`), c.value && a.push(
116
+ o != null && o.value ? "rds-btn--with-icon" : "rds-btn--icon"
117
+ ), f.value && a.push("rds-btn--small"), _.value && a.push("rds-btn--revert"), u.value && a.push("rds-style-state-disabled"), p.value && a.push("rds-btn--loading"), y.value && a.push("rds-btn--mobile-width"), a.join(" ");
118
+ });
119
+ return (a, W) => (b(), x("button", {
120
+ type: h.value,
121
+ disabled: s(u),
122
+ class: m(g.value)
123
+ }, [
124
+ c.value ? (b(), I(V, {
125
+ key: 0,
126
+ name: c.value,
127
+ small: s(f),
128
+ class: m(["rds-btn__icon", [
129
+ s(d) ? `rds-btn__icon--${s(d)}` : "",
130
+ s(u) ? "rds-btn__icon--disabled" : ""
131
+ ]]),
132
+ "aria-hidden": "true"
133
+ }, null, 8, ["name", "small", "class"])) : k("", !0),
134
+ $("span", L, [
135
+ C(a.$slots, "default", {}, () => [
136
+ N(R(s(o)), 1)
137
+ ], !0)
138
+ ])
139
+ ], 10, E));
140
+ }
141
+ }), F = /* @__PURE__ */ D(w, [["__scopeId", "data-v-238a49e9"]]);
142
+ export {
143
+ F as default
144
+ };