pukaad-ui-lib 1.170.0 → 1.171.0

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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
3
  "configKey": "pukaadUI",
4
- "version": "1.170.0",
4
+ "version": "1.171.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -18,10 +18,14 @@ type __VLS_Props = {
18
18
  disabledDividerBottom?: boolean;
19
19
  disabled?: boolean;
20
20
  iconSize?: number | string;
21
+ id?: string;
22
+ state?: string;
21
23
  };
22
24
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
25
+ id: string;
23
26
  disabled: boolean;
24
27
  disabledPadding: boolean;
28
+ state: string;
25
29
  itemCount: Count;
26
30
  itemActive: Reacted;
27
31
  padding: string | number;
@@ -32,6 +32,7 @@
32
32
 
33
33
  <script setup>
34
34
  import { computed, reactive, ref, watch } from "vue";
35
+ import { useApi } from "../../composables/useApi";
35
36
  const isOpenModalShare = ref(false);
36
37
  const props = defineProps({
37
38
  itemCount: { type: Object, required: false, default: () => ({
@@ -50,7 +51,9 @@ const props = defineProps({
50
51
  disabledDividerTop: { type: Boolean, required: false, default: false },
51
52
  disabledDividerBottom: { type: Boolean, required: false, default: false },
52
53
  disabled: { type: Boolean, required: false, default: false },
53
- iconSize: { type: [Number, String], required: false, default: 20 }
54
+ iconSize: { type: [Number, String], required: false, default: 20 },
55
+ id: { type: String, required: false, default: "" },
56
+ state: { type: String, required: false, default: "" }
54
57
  });
55
58
  const computedPadding = computed(
56
59
  () => props.disabledPadding ? 0 : props.padding
@@ -110,9 +113,22 @@ const reactions = [
110
113
  action: toggleShared
111
114
  }
112
115
  ];
113
- function toggleLike() {
114
- reaction.liked = !reaction.liked;
116
+ async function toggleLike() {
117
+ const previousLiked = reaction.liked;
118
+ reaction.liked = !previousLiked;
115
119
  counts.liked += reaction.liked ? 1 : -1;
120
+ if (props.state === "blog" && props.id) {
121
+ try {
122
+ const api = useApi();
123
+ await api(`/blogs/${props.id}/like`, {
124
+ method: reaction.liked ? "POST" : "DELETE"
125
+ });
126
+ } catch (error) {
127
+ console.error(error);
128
+ reaction.liked = previousLiked;
129
+ counts.liked += previousLiked ? 1 : -1;
130
+ }
131
+ }
116
132
  }
117
133
  function toggleBookmark() {
118
134
  reaction.bookmarked = !reaction.bookmarked;
@@ -18,10 +18,14 @@ type __VLS_Props = {
18
18
  disabledDividerBottom?: boolean;
19
19
  disabled?: boolean;
20
20
  iconSize?: number | string;
21
+ id?: string;
22
+ state?: string;
21
23
  };
22
24
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
25
+ id: string;
23
26
  disabled: boolean;
24
27
  disabledPadding: boolean;
28
+ state: string;
25
29
  itemCount: Count;
26
30
  itemActive: Reacted;
27
31
  padding: string | number;
@@ -0,0 +1,21 @@
1
+ import type { AccordionRootProps } from "reka-ui";
2
+ type __VLS_Props = AccordionRootProps;
3
+ declare var __VLS_8: {
4
+ modelValue: import("reka-ui").AcceptableValue | import("reka-ui").AcceptableValue[] | undefined;
5
+ };
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_8) => any;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ "update:modelValue": (value: string | string[] | undefined) => any;
11
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
+ "onUpdate:modelValue"?: ((value: string | string[] | undefined) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
17
+ type __VLS_WithSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -0,0 +1,26 @@
1
+ <script setup>
2
+ import {
3
+ AccordionRoot,
4
+ useForwardPropsEmits
5
+ } from "reka-ui";
6
+ const props = defineProps({
7
+ collapsible: { type: Boolean, required: false },
8
+ disabled: { type: Boolean, required: false },
9
+ dir: { type: String, required: false },
10
+ orientation: { type: String, required: false },
11
+ unmountOnHide: { type: Boolean, required: false },
12
+ asChild: { type: Boolean, required: false },
13
+ as: { type: null, required: false },
14
+ type: { type: String, required: false },
15
+ modelValue: { type: null, required: false },
16
+ defaultValue: { type: null, required: false }
17
+ });
18
+ const emits = defineEmits(["update:modelValue"]);
19
+ const forwarded = useForwardPropsEmits(props, emits);
20
+ </script>
21
+
22
+ <template>
23
+ <AccordionRoot v-slot="slotProps" data-slot="accordion" v-bind="forwarded">
24
+ <slot v-bind="slotProps" />
25
+ </AccordionRoot>
26
+ </template>
@@ -0,0 +1,21 @@
1
+ import type { AccordionRootProps } from "reka-ui";
2
+ type __VLS_Props = AccordionRootProps;
3
+ declare var __VLS_8: {
4
+ modelValue: import("reka-ui").AcceptableValue | import("reka-ui").AcceptableValue[] | undefined;
5
+ };
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_8) => any;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ "update:modelValue": (value: string | string[] | undefined) => any;
11
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
+ "onUpdate:modelValue"?: ((value: string | string[] | undefined) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
17
+ type __VLS_WithSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -0,0 +1,18 @@
1
+ import type { AccordionContentProps } from "reka-ui";
2
+ import type { HTMLAttributes } from "vue";
3
+ type __VLS_Props = AccordionContentProps & {
4
+ class?: HTMLAttributes["class"];
5
+ };
6
+ declare var __VLS_8: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_8) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -0,0 +1,24 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { AccordionContent } from "reka-ui";
4
+ import { cn } from "@/runtime/plugins/shadcn";
5
+ const props = defineProps({
6
+ forceMount: { type: Boolean, required: false },
7
+ asChild: { type: Boolean, required: false },
8
+ as: { type: null, required: false },
9
+ class: { type: null, required: false }
10
+ });
11
+ const delegatedProps = reactiveOmit(props, "class");
12
+ </script>
13
+
14
+ <template>
15
+ <AccordionContent
16
+ data-slot="accordion-content"
17
+ v-bind="delegatedProps"
18
+ class="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
19
+ >
20
+ <div :class="cn('pt-0 pb-4', props.class)">
21
+ <slot />
22
+ </div>
23
+ </AccordionContent>
24
+ </template>
@@ -0,0 +1,18 @@
1
+ import type { AccordionContentProps } from "reka-ui";
2
+ import type { HTMLAttributes } from "vue";
3
+ type __VLS_Props = AccordionContentProps & {
4
+ class?: HTMLAttributes["class"];
5
+ };
6
+ declare var __VLS_8: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_8) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -0,0 +1,20 @@
1
+ import type { AccordionItemProps } from "reka-ui";
2
+ import type { HTMLAttributes } from "vue";
3
+ type __VLS_Props = AccordionItemProps & {
4
+ class?: HTMLAttributes["class"];
5
+ };
6
+ declare var __VLS_8: {
7
+ open: boolean;
8
+ };
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_8) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,26 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { AccordionItem, useForwardProps } from "reka-ui";
4
+ import { cn } from "@/runtime/plugins/shadcn";
5
+ const props = defineProps({
6
+ disabled: { type: Boolean, required: false },
7
+ value: { type: String, required: true },
8
+ unmountOnHide: { type: Boolean, required: false },
9
+ asChild: { type: Boolean, required: false },
10
+ as: { type: null, required: false },
11
+ class: { type: null, required: false }
12
+ });
13
+ const delegatedProps = reactiveOmit(props, "class");
14
+ const forwardedProps = useForwardProps(delegatedProps);
15
+ </script>
16
+
17
+ <template>
18
+ <AccordionItem
19
+ v-slot="slotProps"
20
+ data-slot="accordion-item"
21
+ v-bind="forwardedProps"
22
+ :class="cn('border-b last:border-b-0', props.class)"
23
+ >
24
+ <slot v-bind="slotProps" />
25
+ </AccordionItem>
26
+ </template>
@@ -0,0 +1,20 @@
1
+ import type { AccordionItemProps } from "reka-ui";
2
+ import type { HTMLAttributes } from "vue";
3
+ type __VLS_Props = AccordionItemProps & {
4
+ class?: HTMLAttributes["class"];
5
+ };
6
+ declare var __VLS_8: {
7
+ open: boolean;
8
+ };
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_8) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,20 @@
1
+ import type { AccordionTriggerProps } from "reka-ui";
2
+ import type { HTMLAttributes } from "vue";
3
+ type __VLS_Props = AccordionTriggerProps & {
4
+ class?: HTMLAttributes["class"];
5
+ };
6
+ declare var __VLS_14: {}, __VLS_16: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_14) => any;
9
+ } & {
10
+ icon?: (props: typeof __VLS_16) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,35 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { ChevronDownIcon } from "@radix-icons/vue";
4
+ import {
5
+ AccordionHeader,
6
+ AccordionTrigger
7
+ } from "reka-ui";
8
+ import { cn } from "@/runtime/plugins/shadcn";
9
+ const props = defineProps({
10
+ asChild: { type: Boolean, required: false },
11
+ as: { type: null, required: false },
12
+ class: { type: null, required: false }
13
+ });
14
+ const delegatedProps = reactiveOmit(props, "class");
15
+ </script>
16
+
17
+ <template>
18
+ <AccordionHeader class="flex">
19
+ <AccordionTrigger
20
+ data-slot="accordion-trigger"
21
+ v-bind="delegatedProps"
22
+ :class="
23
+ cn(
24
+ 'focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180',
25
+ props.class
26
+ )
27
+ "
28
+ >
29
+ <slot />
30
+ <slot name="icon">
31
+ <ChevronDownIcon class="text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" />
32
+ </slot>
33
+ </AccordionTrigger>
34
+ </AccordionHeader>
35
+ </template>
@@ -0,0 +1,20 @@
1
+ import type { AccordionTriggerProps } from "reka-ui";
2
+ import type { HTMLAttributes } from "vue";
3
+ type __VLS_Props = AccordionTriggerProps & {
4
+ class?: HTMLAttributes["class"];
5
+ };
6
+ declare var __VLS_14: {}, __VLS_16: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_14) => any;
9
+ } & {
10
+ icon?: (props: typeof __VLS_16) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,4 @@
1
+ export { default as Accordion } from "./Accordion.vue.js";
2
+ export { default as AccordionContent } from "./AccordionContent.vue.js";
3
+ export { default as AccordionItem } from "./AccordionItem.vue.js";
4
+ export { default as AccordionTrigger } from "./AccordionTrigger.vue.js";
@@ -0,0 +1,4 @@
1
+ export { default as Accordion } from "./Accordion.vue";
2
+ export { default as AccordionContent } from "./AccordionContent.vue";
3
+ export { default as AccordionItem } from "./AccordionItem.vue";
4
+ export { default as AccordionTrigger } from "./AccordionTrigger.vue";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.170.0",
3
+ "version": "1.171.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,7 +40,7 @@
40
40
  "@vee-validate/yup": "^4.15.0",
41
41
  "@vee-validate/zod": "^4.15.1",
42
42
  "@vueup/vue-quill": "^1.2.0",
43
- "@vueuse/core": "^14.1.0",
43
+ "@vueuse/core": "^14.2.1",
44
44
  "@vueuse/nuxt": "^12.7.0",
45
45
  "changelogen": "^0.5.7",
46
46
  "class-variance-authority": "^0.7.1",
@@ -89,4 +89,4 @@
89
89
  "@types/vue-cropperjs": "^4.1.6",
90
90
  "@vue/compiler-sfc": "^3.5.24"
91
91
  }
92
- }
92
+ }