pukaad-ui-lib 1.4.2 → 1.5.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.
Files changed (38) hide show
  1. package/dist/module.json +2 -2
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/components/button.d.vue.ts +1 -1
  4. package/dist/runtime/components/button.vue.d.ts +1 -1
  5. package/dist/runtime/components/input/input-autocomplete.vue +3 -2
  6. package/dist/runtime/components/input/input-select-province.d.vue.ts +8 -1
  7. package/dist/runtime/components/input/input-select-province.vue +104 -4
  8. package/dist/runtime/components/input/input-select-province.vue.d.ts +8 -1
  9. package/dist/runtime/components/ui/button/index.d.ts +1 -1
  10. package/dist/runtime/components/ui/button/index.js +24 -2
  11. package/dist/runtime/components/ui/carousel/Carousel.d.vue.ts +37 -0
  12. package/dist/runtime/components/ui/carousel/Carousel.vue +47 -0
  13. package/dist/runtime/components/ui/carousel/Carousel.vue.d.ts +37 -0
  14. package/dist/runtime/components/ui/carousel/CarouselContent.d.vue.ts +14 -0
  15. package/dist/runtime/components/ui/carousel/CarouselContent.vue +32 -0
  16. package/dist/runtime/components/ui/carousel/CarouselContent.vue.d.ts +14 -0
  17. package/dist/runtime/components/ui/carousel/CarouselItem.d.vue.ts +14 -0
  18. package/dist/runtime/components/ui/carousel/CarouselItem.vue +23 -0
  19. package/dist/runtime/components/ui/carousel/CarouselItem.vue.d.ts +14 -0
  20. package/dist/runtime/components/ui/carousel/CarouselNext.d.vue.ts +22 -0
  21. package/dist/runtime/components/ui/carousel/CarouselNext.vue +33 -0
  22. package/dist/runtime/components/ui/carousel/CarouselNext.vue.d.ts +22 -0
  23. package/dist/runtime/components/ui/carousel/CarouselPrevious.d.vue.ts +22 -0
  24. package/dist/runtime/components/ui/carousel/CarouselPrevious.vue +33 -0
  25. package/dist/runtime/components/ui/carousel/CarouselPrevious.vue.d.ts +22 -0
  26. package/dist/runtime/components/ui/carousel/index.d.ts +7 -0
  27. package/dist/runtime/components/ui/carousel/index.js +6 -0
  28. package/dist/runtime/components/ui/carousel/interface.d.ts +20 -0
  29. package/dist/runtime/components/ui/carousel/interface.js +0 -0
  30. package/dist/runtime/components/ui/carousel/useCarousel.d.ts +20 -0
  31. package/dist/runtime/components/ui/carousel/useCarousel.js +43 -0
  32. package/dist/runtime/components/ui/command/CommandItem.vue +16 -7
  33. package/dist/runtime/components/ui/command/CommandList.vue +6 -1
  34. package/dist/runtime/components/ui/input-group/InputGroupButton.d.vue.ts +1 -1
  35. package/dist/runtime/components/ui/input-group/InputGroupButton.vue.d.ts +1 -1
  36. package/dist/runtime/components/ui/popover/PopoverContent.vue +8 -8
  37. package/dist/runtime/components/ui/separator/Separator.vue +5 -5
  38. package/package.json +2 -1
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
- "name": "pukaad-ui",
2
+ "name": "pukaad-ui-lib",
3
3
  "configKey": "pukaadUI",
4
- "version": "1.4.2",
4
+ "version": "1.5.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -3,7 +3,7 @@ import tailwindcss from '@tailwindcss/vite';
3
3
 
4
4
  const module$1 = defineNuxtModule({
5
5
  meta: {
6
- name: "pukaad-ui",
6
+ name: "pukaad-ui-lib",
7
7
  configKey: "pukaadUI"
8
8
  },
9
9
  defaults: {},
@@ -1,6 +1,6 @@
1
1
  import type { HTMLAttributes } from "vue";
2
2
  export type ButtonType = "button" | "submit" | "reset";
3
- export type ButtonVariant = "default" | "outline" | "ghost" | "link";
3
+ export type ButtonVariant = "default" | "outline" | "ghost" | "link" | "text";
4
4
  export type ButtonColor = "default" | "primary" | "secondary" | "destructive";
5
5
  export interface ButtonProps {
6
6
  type?: ButtonType;
@@ -1,6 +1,6 @@
1
1
  import type { HTMLAttributes } from "vue";
2
2
  export type ButtonType = "button" | "submit" | "reset";
3
- export type ButtonVariant = "default" | "outline" | "ghost" | "link";
3
+ export type ButtonVariant = "default" | "outline" | "ghost" | "link" | "text";
4
4
  export type ButtonColor = "default" | "primary" | "secondary" | "destructive";
5
5
  export interface ButtonProps {
6
6
  type?: ButtonType;
@@ -12,12 +12,13 @@
12
12
  </template>
13
13
  </InputTextField>
14
14
  </ShadPopoverAnchor>
15
- <ShadPopoverContent @openAutoFocus.prevent @closeAutoFocus.prevent align="start">
15
+ <ShadPopoverContent @openAutoFocus.prevent @closeAutoFocus.prevent align="start"
16
+ class="max-h-[312px] overflow-auto">
16
17
  <div v-if="filteredOptions.length === 0" class="flex flex-col gap-[8px] items-center justify-center h-[192px]">
17
18
  <Icon name="pukaad:page-not-found" class="w-[77px] h-[64px]" />
18
19
  <div class="font-body-medium text-center text-gray">ไม่พบข้อมูล</div>
19
20
  </div>
20
- <div v-else class="max-h-[312px] ">
21
+ <div v-else>
21
22
  <div v-for="option in filteredOptions" :key="option.value"
22
23
  class="cursor-pointer hover:bg-smoke flex items-center gap-[8px] px-[8px] py-[6px]"
23
24
  @mousedown.prevent="selectOption(option)">
@@ -1,3 +1,10 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ type __VLS_ModelProps = {
2
+ modelValue?: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ "update:modelValue": (value: string | undefined) => any;
6
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
7
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
8
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
2
9
  declare const _default: typeof __VLS_export;
3
10
  export default _default;
@@ -1,4 +1,104 @@
1
- <template>
2
- <div>dwdw</div>
3
- </template>
4
- <script setup lang="ts"></script>
1
+ <template>
2
+ <ShadPopover v-model:open="open">
3
+ <ShadPopoverTrigger as-child>
4
+ <div class="flex items-center gap-[8px] cursor-pointer w-fit">
5
+ <div>{{ selectedLabel || "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E08\u0E31\u0E07\u0E2B\u0E27\u0E31\u0E14" }}</div>
6
+ <Icon name="lucide:chevron-down" />
7
+ </div>
8
+ </ShadPopoverTrigger>
9
+ <ShadPopoverContent class="flex p-[24px] w-[425px]">
10
+ <ShadCommand>
11
+ <div class="space-y-[22px]">
12
+ <div class="font-title-medium-prominent">เลือกจังหวัด</div>
13
+ <div class="flex flex-col gap-[16px]">
14
+ <InputTextField placeholder="ค้นหาจังหวัด..." v-model="search">
15
+ <template #append>
16
+ <Icon name="lucide:search" />
17
+ </template>
18
+ </InputTextField>
19
+ <ShadCommandList>
20
+ <div class="flex flex-col gap-[16px]">
21
+ <div class="flex flex-col gap-[8px]">
22
+ <div>ปลายทางยอดนิยม</div>
23
+ <ShadCarousel>
24
+ <ShadCarouselContent>
25
+ <ShadCarouselItem
26
+ v-for="province in provinces"
27
+ :key="province.value"
28
+ @select="selectProvince(province.value)"
29
+ >
30
+ <img
31
+ :src="
32
+ province.image_cover_url || 'https://placehold.co/292x164?text=Place+Photo'
33
+ "
34
+ />
35
+ <div>{{ province.label }}</div>
36
+ </ShadCarouselItem>
37
+ </ShadCarouselContent>
38
+ </ShadCarousel>
39
+ </div>
40
+ <ShadCommandGroup>
41
+ <ShadCommandItem
42
+ v-for="province in provinces"
43
+ :key="province.value"
44
+ :value="province.label"
45
+ @select="selectProvince(province.value)"
46
+ class="flex items-center justify-between"
47
+ >
48
+ <span>
49
+ {{ province.label }}
50
+ </span>
51
+ <Icon
52
+ v-if="modelValue === province.value"
53
+ name="lucide:check"
54
+ class="h-4 w-4"
55
+ />
56
+ </ShadCommandItem>
57
+ </ShadCommandGroup>
58
+ </div>
59
+ <ShadCommandEmpty />
60
+ </ShadCommandList>
61
+ </div>
62
+ </div>
63
+ </ShadCommand>
64
+ </ShadPopoverContent>
65
+ </ShadPopover>
66
+ </template>
67
+
68
+ <script setup>
69
+ import { ref, computed, onMounted } from "vue";
70
+ import { useFetch, useNuxtApp, useRuntimeConfig } from "nuxt/app";
71
+ const { BASE_URL_API } = useRuntimeConfig().public;
72
+ const modelValue = defineModel({ type: String });
73
+ const open = ref(false);
74
+ const search = ref("");
75
+ const provinces = ref([]);
76
+ const fetchProvinces = async () => {
77
+ try {
78
+ const response = await $fetch(
79
+ `${BASE_URL_API}/api/master/address/provinces`
80
+ );
81
+ const data = response.data ?? response;
82
+ if (data && Array.isArray(data)) {
83
+ provinces.value = data.map((p) => ({
84
+ value: String(p.id),
85
+ label: p.name_th,
86
+ image_cover_url: p.image_cover_url ?? ""
87
+ }));
88
+ }
89
+ } catch (error) {
90
+ console.error("Failed to fetch provinces:", error);
91
+ }
92
+ };
93
+ const selectedLabel = computed(() => {
94
+ const found = provinces.value.find((p) => p.value === modelValue.value);
95
+ return found?.label || "";
96
+ });
97
+ const selectProvince = (value) => {
98
+ modelValue.value = value;
99
+ open.value = false;
100
+ };
101
+ onMounted(() => {
102
+ fetchProvinces();
103
+ });
104
+ </script>
@@ -1,3 +1,10 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ type __VLS_ModelProps = {
2
+ modelValue?: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ "update:modelValue": (value: string | undefined) => any;
6
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
7
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
8
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
2
9
  declare const _default: typeof __VLS_export;
3
10
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import type { VariantProps } from "class-variance-authority";
2
2
  export { default as Button } from "./Button.vue.js";
3
3
  export declare const buttonVariants: (props?: ({
4
- variant?: "default" | "outline" | "ghost" | "link" | null | undefined;
4
+ variant?: "default" | "outline" | "ghost" | "link" | "text" | null | undefined;
5
5
  color?: "default" | "primary" | "secondary" | "destructive" | null | undefined;
6
6
  size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -1,14 +1,15 @@
1
1
  import { cva } from "class-variance-authority";
2
2
  export { default as Button } from "./Button.vue";
3
3
  export const buttonVariants = cva(
4
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
4
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
5
5
  {
6
6
  variants: {
7
7
  variant: {
8
8
  default: "shadow-sm",
9
9
  outline: "shadow-sm",
10
10
  ghost: "",
11
- link: "underline-offset-4 hover:underline"
11
+ link: "underline-offset-4 hover:underline",
12
+ text: ""
12
13
  },
13
14
  color: {
14
15
  default: "text-foreground",
@@ -85,6 +86,27 @@ export const buttonVariants = cva(
85
86
  variant: "ghost",
86
87
  color: "destructive",
87
88
  class: "text-destructive hover:bg-destructive/90 hover:text-destructive-foreground"
89
+ },
90
+ // text variant - just plain text with color, no background or hover effects
91
+ {
92
+ variant: "text",
93
+ color: "default",
94
+ class: "text-foreground hover:opacity-80"
95
+ },
96
+ {
97
+ variant: "text",
98
+ color: "primary",
99
+ class: "text-primary hover:opacity-80"
100
+ },
101
+ {
102
+ variant: "text",
103
+ color: "secondary",
104
+ class: "text-secondary hover:opacity-80"
105
+ },
106
+ {
107
+ variant: "text",
108
+ color: "destructive",
109
+ class: "text-destructive hover:opacity-80"
88
110
  }
89
111
  ],
90
112
  defaultVariants: {
@@ -0,0 +1,37 @@
1
+ import type { CarouselProps, WithClassAsProps } from "./interface.js";
2
+ type __VLS_Props = CarouselProps & WithClassAsProps;
3
+ declare var __VLS_1: {
4
+ canScrollNext: any;
5
+ canScrollPrev: any;
6
+ carouselApi: any;
7
+ carouselRef: any;
8
+ orientation: any;
9
+ scrollNext: any;
10
+ scrollPrev: any;
11
+ };
12
+ type __VLS_Slots = {} & {
13
+ default?: (props: typeof __VLS_1) => any;
14
+ };
15
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
16
+ canScrollNext: import("vue").Ref<boolean, boolean>;
17
+ canScrollPrev: import("vue").Ref<boolean, boolean>;
18
+ carouselApi: import("vue").Ref<import("embla-carousel").EmblaCarouselType | undefined, import("embla-carousel").EmblaCarouselType | undefined>;
19
+ carouselRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
20
+ orientation: "vertical" | "horizontal" | undefined;
21
+ scrollNext: () => void;
22
+ scrollPrev: () => void;
23
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
24
+ "init-api": (payload: import("embla-carousel").EmblaCarouselType | undefined) => any;
25
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
26
+ "onInit-api"?: ((payload: import("embla-carousel").EmblaCarouselType | undefined) => any) | undefined;
27
+ }>, {
28
+ orientation: "horizontal" | "vertical";
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
+ declare const _default: typeof __VLS_export;
32
+ export default _default;
33
+ type __VLS_WithSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
37
+ };
@@ -0,0 +1,47 @@
1
+ <script setup>
2
+ import { cn } from "@/runtime/plugins/shadcn";
3
+ import { useProvideCarousel } from "./useCarousel";
4
+ const props = defineProps({
5
+ opts: { type: null, required: false },
6
+ plugins: { type: null, required: false },
7
+ orientation: { type: String, required: false, default: "horizontal" },
8
+ class: { type: null, required: false }
9
+ });
10
+ const emits = defineEmits(["init-api"]);
11
+ const { canScrollNext, canScrollPrev, carouselApi, carouselRef, orientation, scrollNext, scrollPrev } = useProvideCarousel(props, emits);
12
+ defineExpose({
13
+ canScrollNext,
14
+ canScrollPrev,
15
+ carouselApi,
16
+ carouselRef,
17
+ orientation,
18
+ scrollNext,
19
+ scrollPrev
20
+ });
21
+ function onKeyDown(event) {
22
+ const prevKey = props.orientation === "vertical" ? "ArrowUp" : "ArrowLeft";
23
+ const nextKey = props.orientation === "vertical" ? "ArrowDown" : "ArrowRight";
24
+ if (event.key === prevKey) {
25
+ event.preventDefault();
26
+ scrollPrev();
27
+ return;
28
+ }
29
+ if (event.key === nextKey) {
30
+ event.preventDefault();
31
+ scrollNext();
32
+ }
33
+ }
34
+ </script>
35
+
36
+ <template>
37
+ <div
38
+ data-slot="carousel"
39
+ :class="cn('relative', props.class)"
40
+ role="region"
41
+ aria-roledescription="carousel"
42
+ tabindex="0"
43
+ @keydown="onKeyDown"
44
+ >
45
+ <slot :can-scroll-next :can-scroll-prev :carousel-api :carousel-ref :orientation :scroll-next :scroll-prev />
46
+ </div>
47
+ </template>
@@ -0,0 +1,37 @@
1
+ import type { CarouselProps, WithClassAsProps } from "./interface.js";
2
+ type __VLS_Props = CarouselProps & WithClassAsProps;
3
+ declare var __VLS_1: {
4
+ canScrollNext: any;
5
+ canScrollPrev: any;
6
+ carouselApi: any;
7
+ carouselRef: any;
8
+ orientation: any;
9
+ scrollNext: any;
10
+ scrollPrev: any;
11
+ };
12
+ type __VLS_Slots = {} & {
13
+ default?: (props: typeof __VLS_1) => any;
14
+ };
15
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
16
+ canScrollNext: import("vue").Ref<boolean, boolean>;
17
+ canScrollPrev: import("vue").Ref<boolean, boolean>;
18
+ carouselApi: import("vue").Ref<import("embla-carousel").EmblaCarouselType | undefined, import("embla-carousel").EmblaCarouselType | undefined>;
19
+ carouselRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
20
+ orientation: "vertical" | "horizontal" | undefined;
21
+ scrollNext: () => void;
22
+ scrollPrev: () => void;
23
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
24
+ "init-api": (payload: import("embla-carousel").EmblaCarouselType | undefined) => any;
25
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
26
+ "onInit-api"?: ((payload: import("embla-carousel").EmblaCarouselType | undefined) => any) | undefined;
27
+ }>, {
28
+ orientation: "horizontal" | "vertical";
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
+ declare const _default: typeof __VLS_export;
32
+ export default _default;
33
+ type __VLS_WithSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
37
+ };
@@ -0,0 +1,14 @@
1
+ import type { WithClassAsProps } from "./interface.js";
2
+ declare var __VLS_1: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_1) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<WithClassAsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<WithClassAsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
10
+ type __VLS_WithSlots<T, S> = T & {
11
+ new (): {
12
+ $slots: S;
13
+ };
14
+ };
@@ -0,0 +1,32 @@
1
+ <script setup>
2
+ import { cn } from "@/runtime/plugins/shadcn";
3
+ import { useCarousel } from "./useCarousel";
4
+ defineOptions({
5
+ inheritAttrs: false
6
+ });
7
+ const props = defineProps({
8
+ class: { type: null, required: false }
9
+ });
10
+ const { carouselRef, orientation } = useCarousel();
11
+ </script>
12
+
13
+ <template>
14
+ <div
15
+ ref="carouselRef"
16
+ data-slot="carousel-content"
17
+ class="overflow-hidden"
18
+ >
19
+ <div
20
+ :class="
21
+ cn(
22
+ 'flex',
23
+ orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',
24
+ props.class
25
+ )
26
+ "
27
+ v-bind="$attrs"
28
+ >
29
+ <slot />
30
+ </div>
31
+ </div>
32
+ </template>
@@ -0,0 +1,14 @@
1
+ import type { WithClassAsProps } from "./interface.js";
2
+ declare var __VLS_1: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_1) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<WithClassAsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<WithClassAsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
10
+ type __VLS_WithSlots<T, S> = T & {
11
+ new (): {
12
+ $slots: S;
13
+ };
14
+ };
@@ -0,0 +1,14 @@
1
+ import type { WithClassAsProps } from "./interface.js";
2
+ declare var __VLS_1: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_1) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<WithClassAsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<WithClassAsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
10
+ type __VLS_WithSlots<T, S> = T & {
11
+ new (): {
12
+ $slots: S;
13
+ };
14
+ };
@@ -0,0 +1,23 @@
1
+ <script setup>
2
+ import { cn } from "@/runtime/plugins/shadcn";
3
+ import { useCarousel } from "./useCarousel";
4
+ const props = defineProps({
5
+ class: { type: null, required: false }
6
+ });
7
+ const { orientation } = useCarousel();
8
+ </script>
9
+
10
+ <template>
11
+ <div
12
+ data-slot="carousel-item"
13
+ role="group"
14
+ aria-roledescription="slide"
15
+ :class="cn(
16
+ 'min-w-0 shrink-0 grow-0 basis-full',
17
+ orientation === 'horizontal' ? 'pl-4' : 'pt-4',
18
+ props.class
19
+ )"
20
+ >
21
+ <slot />
22
+ </div>
23
+ </template>
@@ -0,0 +1,14 @@
1
+ import type { WithClassAsProps } from "./interface.js";
2
+ declare var __VLS_1: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_1) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<WithClassAsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<WithClassAsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
10
+ type __VLS_WithSlots<T, S> = T & {
11
+ new (): {
12
+ $slots: S;
13
+ };
14
+ };
@@ -0,0 +1,22 @@
1
+ import type { WithClassAsProps } from "./interface.js";
2
+ import type { ButtonVariants } from "@/runtime/components/ui/button";
3
+ type __VLS_Props = {
4
+ variant?: ButtonVariants["variant"];
5
+ size?: ButtonVariants["size"];
6
+ } & WithClassAsProps;
7
+ declare var __VLS_10: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_10) => any;
10
+ };
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
12
+ variant: "default" | "outline" | "ghost" | "link" | "text" | null;
13
+ size: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,33 @@
1
+ <script setup>
2
+ import { cn } from "@/runtime/plugins/shadcn";
3
+ import { Button } from "@/runtime/components/ui/button";
4
+ import { useCarousel } from "./useCarousel";
5
+ const props = defineProps({
6
+ variant: { type: null, required: false, default: "outline" },
7
+ size: { type: null, required: false, default: "icon" },
8
+ class: { type: null, required: false }
9
+ });
10
+ const { orientation, canScrollNext, scrollNext } = useCarousel();
11
+ </script>
12
+
13
+ <template>
14
+ <Button
15
+ data-slot="carousel-next"
16
+ :disabled="!canScrollNext"
17
+ :class="
18
+ cn(
19
+ 'absolute size-8 rounded-full',
20
+ orientation === 'horizontal' ? 'top-1/2 -right-12 -translate-y-1/2' : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
21
+ props.class
22
+ )
23
+ "
24
+ :variant="variant"
25
+ :size="size"
26
+ @click="scrollNext"
27
+ >
28
+ <slot>
29
+ <Icon name="lucide:chevron-right" />
30
+ <span class="sr-only">Next Slide</span>
31
+ </slot>
32
+ </Button>
33
+ </template>
@@ -0,0 +1,22 @@
1
+ import type { WithClassAsProps } from "./interface.js";
2
+ import type { ButtonVariants } from "@/runtime/components/ui/button";
3
+ type __VLS_Props = {
4
+ variant?: ButtonVariants["variant"];
5
+ size?: ButtonVariants["size"];
6
+ } & WithClassAsProps;
7
+ declare var __VLS_10: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_10) => any;
10
+ };
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
12
+ variant: "default" | "outline" | "ghost" | "link" | "text" | null;
13
+ size: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,22 @@
1
+ import type { WithClassAsProps } from "./interface.js";
2
+ import type { ButtonVariants } from "@/runtime/components/ui/button";
3
+ type __VLS_Props = {
4
+ variant?: ButtonVariants["variant"];
5
+ size?: ButtonVariants["size"];
6
+ } & WithClassAsProps;
7
+ declare var __VLS_10: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_10) => any;
10
+ };
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
12
+ variant: "default" | "outline" | "ghost" | "link" | "text" | null;
13
+ size: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,33 @@
1
+ <script setup>
2
+ import { cn } from "@/runtime/plugins/shadcn";
3
+ import { Button } from "@/runtime/components/ui/button";
4
+ import { useCarousel } from "./useCarousel";
5
+ const props = defineProps({
6
+ variant: { type: null, required: false, default: "outline" },
7
+ size: { type: null, required: false, default: "icon" },
8
+ class: { type: null, required: false }
9
+ });
10
+ const { orientation, canScrollPrev, scrollPrev } = useCarousel();
11
+ </script>
12
+
13
+ <template>
14
+ <Button
15
+ data-slot="carousel-previous"
16
+ :disabled="!canScrollPrev"
17
+ :class="
18
+ cn(
19
+ 'absolute size-8 rounded-full',
20
+ orientation === 'horizontal' ? 'top-1/2 -left-12 -translate-y-1/2' : '-top-12 left-1/2 -translate-x-1/2 rotate-90',
21
+ props.class
22
+ )
23
+ "
24
+ :variant="variant"
25
+ :size="size"
26
+ @click="scrollPrev"
27
+ >
28
+ <slot>
29
+ <Icon name="lucide:chevron-left" />
30
+ <span class="sr-only">Previous Slide</span>
31
+ </slot>
32
+ </Button>
33
+ </template>
@@ -0,0 +1,22 @@
1
+ import type { WithClassAsProps } from "./interface.js";
2
+ import type { ButtonVariants } from "@/runtime/components/ui/button";
3
+ type __VLS_Props = {
4
+ variant?: ButtonVariants["variant"];
5
+ size?: ButtonVariants["size"];
6
+ } & WithClassAsProps;
7
+ declare var __VLS_10: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_10) => any;
10
+ };
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
12
+ variant: "default" | "outline" | "ghost" | "link" | "text" | null;
13
+ size: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,7 @@
1
+ export { default as Carousel } from "./Carousel.vue.js";
2
+ export { default as CarouselContent } from "./CarouselContent.vue.js";
3
+ export { default as CarouselItem } from "./CarouselItem.vue.js";
4
+ export { default as CarouselNext } from "./CarouselNext.vue.js";
5
+ export { default as CarouselPrevious } from "./CarouselPrevious.vue.js";
6
+ export type { UnwrapRefCarouselApi as CarouselApi, } from "./interface.js";
7
+ export { useCarousel } from "./useCarousel.js";
@@ -0,0 +1,6 @@
1
+ export { default as Carousel } from "./Carousel.vue";
2
+ export { default as CarouselContent } from "./CarouselContent.vue";
3
+ export { default as CarouselItem } from "./CarouselItem.vue";
4
+ export { default as CarouselNext } from "./CarouselNext.vue";
5
+ export { default as CarouselPrevious } from "./CarouselPrevious.vue";
6
+ export { useCarousel } from "./useCarousel.js";
@@ -0,0 +1,20 @@
1
+ import type useEmblaCarousel from "embla-carousel-vue";
2
+ import type { EmblaCarouselVueType } from "embla-carousel-vue";
3
+ import type { HTMLAttributes, UnwrapRef } from "vue";
4
+ type CarouselApi = EmblaCarouselVueType[1];
5
+ type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
6
+ type CarouselOptions = UseCarouselParameters[0];
7
+ type CarouselPlugin = UseCarouselParameters[1];
8
+ export type UnwrapRefCarouselApi = UnwrapRef<CarouselApi>;
9
+ export interface CarouselProps {
10
+ opts?: CarouselOptions;
11
+ plugins?: CarouselPlugin;
12
+ orientation?: "horizontal" | "vertical";
13
+ }
14
+ export interface CarouselEmits {
15
+ (e: "init-api", payload: UnwrapRefCarouselApi): void;
16
+ }
17
+ export interface WithClassAsProps {
18
+ class?: HTMLAttributes["class"];
19
+ }
20
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { CarouselEmits, CarouselProps } from "./interface.js";
2
+ declare const useProvideCarousel: (args_0: CarouselProps, emits: CarouselEmits) => {
3
+ carouselRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
4
+ carouselApi: import("vue").Ref<import("embla-carousel").EmblaCarouselType | undefined, import("embla-carousel").EmblaCarouselType | undefined>;
5
+ canScrollPrev: import("vue").Ref<boolean, boolean>;
6
+ canScrollNext: import("vue").Ref<boolean, boolean>;
7
+ scrollPrev: () => void;
8
+ scrollNext: () => void;
9
+ orientation: "vertical" | "horizontal" | undefined;
10
+ };
11
+ declare function useCarousel(): {
12
+ carouselRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
13
+ carouselApi: import("vue").Ref<import("embla-carousel").EmblaCarouselType | undefined, import("embla-carousel").EmblaCarouselType | undefined>;
14
+ canScrollPrev: import("vue").Ref<boolean, boolean>;
15
+ canScrollNext: import("vue").Ref<boolean, boolean>;
16
+ scrollPrev: () => void;
17
+ scrollNext: () => void;
18
+ orientation: "vertical" | "horizontal" | undefined;
19
+ };
20
+ export { useCarousel, useProvideCarousel };
@@ -0,0 +1,43 @@
1
+ import { createInjectionState } from "@vueuse/core";
2
+ import emblaCarouselVue from "embla-carousel-vue";
3
+ import { onMounted, ref } from "vue";
4
+ const [useProvideCarousel, useInjectCarousel] = createInjectionState(
5
+ ({
6
+ opts,
7
+ orientation,
8
+ plugins
9
+ }, emits) => {
10
+ const [emblaNode, emblaApi] = emblaCarouselVue({
11
+ ...opts,
12
+ axis: orientation === "horizontal" ? "x" : "y"
13
+ }, plugins);
14
+ function scrollPrev() {
15
+ emblaApi.value?.scrollPrev();
16
+ }
17
+ function scrollNext() {
18
+ emblaApi.value?.scrollNext();
19
+ }
20
+ const canScrollNext = ref(false);
21
+ const canScrollPrev = ref(false);
22
+ function onSelect(api) {
23
+ canScrollNext.value = api?.canScrollNext() || false;
24
+ canScrollPrev.value = api?.canScrollPrev() || false;
25
+ }
26
+ onMounted(() => {
27
+ if (!emblaApi.value)
28
+ return;
29
+ emblaApi.value?.on("init", onSelect);
30
+ emblaApi.value?.on("reInit", onSelect);
31
+ emblaApi.value?.on("select", onSelect);
32
+ emits("init-api", emblaApi.value);
33
+ });
34
+ return { carouselRef: emblaNode, carouselApi: emblaApi, canScrollPrev, canScrollNext, scrollPrev, scrollNext, orientation };
35
+ }
36
+ );
37
+ function useCarousel() {
38
+ const carouselState = useInjectCarousel();
39
+ if (!carouselState)
40
+ throw new Error("useCarousel must be used within a <Carousel />");
41
+ return carouselState;
42
+ }
43
+ export { useCarousel, useProvideCarousel };
@@ -31,9 +31,11 @@ const isRender = computed(() => {
31
31
  const itemRef = ref();
32
32
  const currentElement = useCurrentElement(itemRef);
33
33
  onMounted(() => {
34
- if (!(currentElement.value instanceof HTMLElement))
35
- return;
36
- allItems.value.set(id, currentElement.value.textContent ?? (props.value?.toString() ?? ""));
34
+ if (!(currentElement.value instanceof HTMLElement)) return;
35
+ allItems.value.set(
36
+ id,
37
+ currentElement.value.textContent ?? props.value?.toString() ?? ""
38
+ );
37
39
  const groupId = groupContext?.id;
38
40
  if (groupId) {
39
41
  if (!allGroups.value.has(groupId)) {
@@ -55,10 +57,17 @@ onUnmounted(() => {
55
57
  :id="id"
56
58
  ref="itemRef"
57
59
  data-slot="command-item"
58
- :class="cn('data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg:not([class*=\'text-\'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4', props.class)"
59
- @select="() => {
60
- filterState.search = '';
61
- }"
60
+ :class="
61
+ cn(
62
+ 'data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg:not([class*=\'text-\'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
63
+ props.class
64
+ )
65
+ "
66
+ @select="
67
+ () => {
68
+ filterState.search = '';
69
+ }
70
+ "
62
71
  >
63
72
  <slot />
64
73
  </ListboxItem>
@@ -15,7 +15,12 @@ const forwarded = useForwardProps(delegatedProps);
15
15
  <ListboxContent
16
16
  data-slot="command-list"
17
17
  v-bind="forwarded"
18
- :class="cn('max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto', props.class)"
18
+ :class="
19
+ cn(
20
+ 'max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto',
21
+ props.class
22
+ )
23
+ "
19
24
  >
20
25
  <div role="presentation">
21
26
  <slot />
@@ -4,7 +4,7 @@ type __VLS_Slots = {} & {
4
4
  default?: (props: typeof __VLS_7) => any;
5
5
  };
6
6
  declare const __VLS_base: import("vue").DefineComponent<InputGroupButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<InputGroupButtonProps> & Readonly<{}>, {
7
- variant: "default" | "outline" | "ghost" | "link" | null;
7
+ variant: "default" | "outline" | "ghost" | "link" | "text" | null;
8
8
  size: "icon-xs" | "sm" | "icon-sm" | "xs" | null;
9
9
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
10
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -4,7 +4,7 @@ type __VLS_Slots = {} & {
4
4
  default?: (props: typeof __VLS_7) => any;
5
5
  };
6
6
  declare const __VLS_base: import("vue").DefineComponent<InputGroupButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<InputGroupButtonProps> & Readonly<{}>, {
7
- variant: "default" | "outline" | "ghost" | "link" | null;
7
+ variant: "default" | "outline" | "ghost" | "link" | "text" | null;
8
8
  size: "icon-xs" | "sm" | "icon-sm" | "xs" | null;
9
9
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
10
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,10 +1,6 @@
1
1
  <script setup>
2
2
  import { reactiveOmit } from "@vueuse/core";
3
- import {
4
- PopoverContent,
5
- PopoverPortal,
6
- useForwardPropsEmits
7
- } from "reka-ui";
3
+ import { PopoverContent, PopoverPortal, useForwardPropsEmits } from "reka-ui";
8
4
  import { cn } from "@/runtime/plugins/shadcn";
9
5
  defineOptions({
10
6
  inheritAttrs: false
@@ -40,12 +36,16 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
40
36
 
41
37
  <template>
42
38
  <PopoverPortal>
43
- <PopoverContent data-slot="popover-content" v-bind="{ ...$attrs, ...forwarded }" :class="
39
+ <PopoverContent
40
+ data-slot="popover-content"
41
+ v-bind="{ ...$attrs, ...forwarded }"
42
+ :class="
44
43
  cn(
45
- 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border shadow-md origin-(--reka-popover-content-transform-origin) outline-hidden max-h-[312px] overflow-auto w-[var(--reka-popover-trigger-width)]',
44
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border shadow-md origin-(--reka-popover-content-transform-origin) outline-hidden w-[var(--reka-popover-trigger-width)]',
46
45
  props.class
47
46
  )
48
- ">
47
+ "
48
+ >
49
49
  <slot />
50
50
  </PopoverContent>
51
51
  </PopoverPortal>
@@ -13,14 +13,14 @@ const delegatedProps = reactiveOmit(props, "class");
13
13
  </script>
14
14
 
15
15
  <template>
16
- <Separator
17
- data-slot="separator"
18
- v-bind="delegatedProps"
16
+ <Separator
17
+ data-slot="separator"
18
+ v-bind="delegatedProps"
19
19
  :class="
20
20
  cn(
21
21
  'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',
22
22
  props.class
23
23
  )
24
- "
25
- />
24
+ "
25
+ />
26
26
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",
@@ -47,6 +47,7 @@
47
47
  "clsx": "^2.1.1",
48
48
  "cropperjs": "^1.6.2",
49
49
  "dayjs": "^1.11.13",
50
+ "embla-carousel-vue": "^8.6.0",
50
51
  "input-otp": "^1.4.2",
51
52
  "lodash": "^4.17.21",
52
53
  "nuxt": "^4.0.3",