@wikicasa-dev/components 2.1.4-alpha.22 → 2.1.4-alpha.23

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,10 +1,10 @@
1
- import { ClassType } from '@wikicasa-dev/types';
1
+ import { ClassTypeProp } from '../types';
2
2
  type __VLS_Props = {
3
3
  id: string | number;
4
4
  accordionOpen: boolean;
5
- accordionOpenClasses?: ClassType;
6
- accordionClosedClasses?: ClassType;
7
- accordionContentClasses?: ClassType;
5
+ accordionOpenClasses?: ClassTypeProp;
6
+ accordionClosedClasses?: ClassTypeProp;
7
+ accordionContentClasses?: ClassTypeProp;
8
8
  };
9
9
  declare function __VLS_template(): {
10
10
  attrs: Partial<{}>;
@@ -1,19 +1,19 @@
1
- import { AccordionItem, ClassType } from '@wikicasa-dev/types';
1
+ import { AccordionItem } from '@wikicasa-dev/types';
2
+ import { ClassTypeProp } from '../types';
2
3
  type __VLS_Props = AccordionItem & {
3
4
  arrowColor?: `#${string}`;
4
5
  arrowWidth?: number;
5
6
  /** If true, when you click the container of the button and the title of the accordion, the accordion will expand */
6
7
  onContainerClickExpand?: boolean;
7
- rootClasses?: ClassType;
8
8
  dataCy?: string;
9
- btnClasses?: ClassType;
10
9
  itemProp?: string;
11
- arrowClasses?: ClassType;
12
- btnWrapperClasses?: ClassType;
13
- accordionContentClasses?: ClassType;
14
- accordionOpenClasses?: ClassType;
15
- accordionCloseClasses?: ClassType;
16
- accordionClasses?: ClassType;
10
+ btnClasses?: ClassTypeProp;
11
+ arrowClasses?: ClassTypeProp;
12
+ btnWrapperClasses?: ClassTypeProp;
13
+ accordionContentClasses?: ClassTypeProp;
14
+ accordionOpenClasses?: ClassTypeProp;
15
+ accordionCloseClasses?: ClassTypeProp;
16
+ accordionClasses?: ClassTypeProp;
17
17
  };
18
18
  declare function __VLS_template(): {
19
19
  attrs: Partial<{}>;
@@ -37,7 +37,7 @@ declare function __VLS_template(): {
37
37
  }): any;
38
38
  };
39
39
  refs: {};
40
- rootEl: any;
40
+ rootEl: HTMLDivElement;
41
41
  };
42
42
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
43
43
  declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
@@ -50,7 +50,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
50
50
  onAccordionOpened?: ((a: AccordionItem) => any) | undefined;
51
51
  onAccordionClosed?: ((a: AccordionItem) => any) | undefined;
52
52
  "onUpdate:accordionState"?: ((args_0: boolean) => any) | undefined;
53
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
53
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
54
54
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
55
55
  export default _default;
56
56
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,10 +1,9 @@
1
- import { defineComponent as h, ref as $, inject as C, watch as l, unref as d, createElementBlock as v, openBlock as u, normalizeClass as m, createBlock as y, createCommentVNode as g, renderSlot as s, createElementVNode as f, withModifiers as O, createVNode as k, withCtx as c } from "vue";
2
- import A from "./BaseAccordionBtn.vue.js";
3
- import B from "./BaseAccordionContent.vue.js";
1
+ import { defineComponent as h, ref as $, inject as p, watch as l, unref as d, createElementBlock as C, openBlock as u, createBlock as y, createCommentVNode as g, renderSlot as s, createElementVNode as v, withModifiers as O, normalizeClass as f, createVNode as k, withCtx as c } from "vue";
2
+ import B from "./BaseAccordionBtn.vue.js";
3
+ import A from "./BaseAccordionContent.vue.js";
4
4
  import { ArrowIcon as E } from "../../../../../node_modules/.pnpm/@wikicasa-dev_svg-icons@1.2.15-alpha.1_vue@3.5.16_typescript@5.8.3_/node_modules/@wikicasa-dev/svg-icons/dist/ArrowIcon.js";
5
5
  import "../../../../../node_modules/.pnpm/@wikicasa-dev_svg-icons@1.2.15-alpha.1_vue@3.5.16_typescript@5.8.3_/node_modules/@wikicasa-dev/svg-icons/dist/PharmacyIcon.js";
6
6
  const W = { key: 0 }, I = ["id", "data-cy", "aria-expanded", "aria-controls"], M = ["itemprop", "innerHTML"], P = /* @__PURE__ */ h({
7
- inheritAttrs: !1,
8
7
  __name: "BaseAccordionItem",
9
8
  props: {
10
9
  title: {},
@@ -13,10 +12,9 @@ const W = { key: 0 }, I = ["id", "data-cy", "aria-expanded", "aria-controls"], M
13
12
  arrowColor: {},
14
13
  arrowWidth: { default: 12 },
15
14
  onContainerClickExpand: { type: Boolean, default: !1 },
16
- rootClasses: {},
17
15
  dataCy: {},
18
- btnClasses: {},
19
16
  itemProp: {},
17
+ btnClasses: {},
20
18
  arrowClasses: {},
21
19
  btnWrapperClasses: {},
22
20
  accordionContentClasses: {},
@@ -25,34 +23,34 @@ const W = { key: 0 }, I = ["id", "data-cy", "aria-expanded", "aria-controls"], M
25
23
  accordionClasses: {}
26
24
  },
27
25
  emits: ["click", "accordionOpened", "accordionClosed", "update:accordionState"],
28
- setup(i, { emit: w }) {
29
- const a = w, o = $(!1), r = C(
26
+ setup(t, { emit: w }) {
27
+ const a = w, o = $(!1), r = p(
30
28
  "accordionItems",
31
29
  () => {
32
30
  },
33
31
  !0
34
- ), b = C(
32
+ ), b = p(
35
33
  "handleClick",
36
34
  () => {
37
35
  },
38
36
  !0
39
- ), p = (e, t = !1) => {
40
- a(t ? "accordionOpened" : "accordionClosed", e), a("update:accordionState", t);
37
+ ), m = (e, i = !1) => {
38
+ a(i ? "accordionOpened" : "accordionClosed", e), a("update:accordionState", i);
41
39
  };
42
- r && (r.value[i.id] = { id: i.id, title: i.title, active: i.active }), l(
40
+ r && (r.value[t.id] = { id: t.id, title: t.title, active: t.active }), l(
43
41
  () => d(r),
44
42
  (e) => {
45
- const t = e?.[i.id];
46
- !t || o.value === t.active || (o.value = t.active ?? !1, p(
47
- { id: i.id, title: i.title, active: t.active },
48
- t.active
43
+ const i = e?.[t.id];
44
+ !i || o.value === i.active || (o.value = i.active ?? !1, m(
45
+ { id: t.id, title: t.title, active: i.active },
46
+ i.active
49
47
  ));
50
48
  },
51
49
  { deep: !0, immediate: !0 }
52
50
  ), l(o, (e) => {
53
- o.value = e, p({ id: i.id, title: i.title, active: o.value }, e);
51
+ o.value = e, m({ id: t.id, title: t.title, active: o.value }, e);
54
52
  }), l(
55
- () => i.active,
53
+ () => t.active,
56
54
  (e) => {
57
55
  o.value = e;
58
56
  },
@@ -61,36 +59,31 @@ const W = { key: 0 }, I = ["id", "data-cy", "aria-expanded", "aria-controls"], M
61
59
  const n = () => {
62
60
  o.value = !o.value;
63
61
  };
64
- return (e, t) => (u(), v("div", {
65
- class: m(e.rootClasses)
66
- }, [
67
- !e.$slots.custom_content && !e.$slots.custom_btn && !e.$slots.custom_accordion ? (u(), v("div", W, [
68
- f("button", {
62
+ return (e, i) => (u(), C("div", null, [
63
+ !e.$slots.custom_content && !e.$slots.custom_btn && !e.$slots.custom_accordion ? (u(), C("div", W, [
64
+ v("button", {
69
65
  id: `accordion-title-${e.id}`,
70
66
  type: "button",
71
- class: m(["uikit-flex uikit-w-full uikit-items-center uikit-justify-between uikit-border-0 uikit-bg-white uikit-px-[20px] uikit-py-md uikit-text-left uikit-font-semibold uikit-transition-colors active:max-sm:uikit-bg-w-cultured hover:sm:uikit-bg-w-cultured", e.btnClasses]),
67
+ class: f(["uikit-flex uikit-w-full uikit-items-center uikit-justify-between uikit-border-0 uikit-bg-white uikit-px-[20px] uikit-py-md uikit-text-left uikit-font-semibold uikit-transition-colors active:max-sm:uikit-bg-w-cultured hover:sm:uikit-bg-w-cultured", e.btnClasses]),
72
68
  "data-cy": e.dataCy,
73
69
  "aria-expanded": o.value,
74
70
  "aria-controls": `accordion-text-${e.id}`,
75
- onClick: t[0] || (t[0] = O((N) => {
71
+ onClick: i[0] || (i[0] = O((N) => {
76
72
  n(), d(b)?.({ id: e.id, title: e.title, active: o.value }), a("click");
77
73
  }, ["prevent", "stop"]))
78
74
  }, [
79
- f("span", {
75
+ v("span", {
80
76
  itemprop: e.itemProp,
81
77
  innerHTML: e.title
82
78
  }, null, 8, M),
83
79
  k(d(E), {
84
- class: m([
85
- "uikit-flex-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none",
86
- [o.value ? "uikit-rotate-180" : "", e.arrowClasses]
87
- ]),
80
+ class: f(["uikit-flex-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", [o.value ? "uikit-rotate-180" : "", e.arrowClasses]]),
88
81
  "arrow-classes": e.arrowClasses,
89
82
  width: e.arrowWidth,
90
83
  height: e.arrowWidth
91
84
  }, null, 8, ["class", "arrow-classes", "width", "height"])
92
85
  ], 10, I)
93
- ])) : (e.$slots.custom_content || e.$slots.custom_btn) && !e.$slots.custom_accordion ? (u(), y(A, {
86
+ ])) : (e.$slots.custom_content || e.$slots.custom_btn) && !e.$slots.custom_accordion ? (u(), y(B, {
94
87
  key: 1,
95
88
  id: e.id,
96
89
  "btn-wrapper-classes": e.btnWrapperClasses,
@@ -118,7 +111,7 @@ const W = { key: 0 }, I = ["id", "data-cy", "aria-expanded", "aria-controls"], M
118
111
  isOpen: o.value,
119
112
  toggleAccordion: n
120
113
  }, () => [
121
- k(B, {
114
+ k(A, {
122
115
  id: e.id,
123
116
  "accordion-open": o.value,
124
117
  "accordion-open-classes": e.accordionOpenClasses,
@@ -135,7 +128,7 @@ const W = { key: 0 }, I = ["id", "data-cy", "aria-expanded", "aria-controls"], M
135
128
  _: 3
136
129
  }, 8, ["id", "accordion-open", "accordion-open-classes", "accordion-close-classes", "accordion-content-classes", "accordion-classes"])
137
130
  ])
138
- ], 2));
131
+ ]));
139
132
  }
140
133
  });
141
134
  export {
@@ -80,7 +80,7 @@ const _ = ["onClick"], ee = ["innerHTML"], se = /* @__PURE__ */ H({
80
80
  }), (e, t) => (m(), b(R, {
81
81
  open: n.value,
82
82
  "onUpdate:open": t[3] || (t[3] = (l) => n.value = l),
83
- class: U(e.$attrs["root-classes"]),
83
+ class: U(e.$attrs.class),
84
84
  "data-cy": e.dataCy ? e.dataCy : `ac_${e.$attrs.id}`,
85
85
  "dropdown-element": "ul",
86
86
  "dropdown-classes": ["!uikit-max-h-[210px] uikit-z-30", e.dropdownClasses],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.1.4-alpha.22",
3
+ "version": "2.1.4-alpha.23",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",