pukaad-ui-lib 1.230.0 → 1.232.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.230.0",
4
+ "version": "1.232.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -40,7 +40,7 @@
40
40
  "example": "https://threads.net/@username"
41
41
  },
42
42
  {
43
- "icon": "pukaad-social:Tiktok",
43
+ "icon": "pukaad-social:TikTok",
44
44
  "name": "TikTok",
45
45
  "example": "https://tiktok.com/@username"
46
46
  },
@@ -60,7 +60,7 @@
60
60
  "example": "https://example.com"
61
61
  },
62
62
  {
63
- "icon": "pukaad-social:Whatsapp",
63
+ "icon": "pukaad-social:WhatsApp",
64
64
  "name": "WhatsApp",
65
65
  "example": "https://wa.me/1234567890"
66
66
  },
@@ -1,21 +1,13 @@
1
1
  <template>
2
- <ShadButton
3
- :class="[
2
+ <ShadButton :class="[
4
3
  'font-body-medium relative',
5
- props.variant === 'text' && '!p-0',
4
+ props.variant === 'text' || props.variant === 'link' ? '!p-0 !h-auto' : '',
6
5
  props.circle && 'rounded-full aspect-square',
7
6
  props.class
8
- ]"
9
- :variant="props.variant"
10
- :color="props.color"
11
- :type="props.type"
12
- :disabled="props.loading || props.disabled"
13
- >
7
+ ]" :variant="props.variant" :color="props.color" :type="props.type" :disabled="props.loading || props.disabled">
14
8
  <span class="inline-grid place-items-center">
15
- <span
16
- class="inline-flex items-center justify-center gap-[8px] [grid-area:1/1]"
17
- :class="{ invisible: props.loading }"
18
- >
9
+ <span class="inline-flex items-center justify-center gap-[8px] [grid-area:1/1]"
10
+ :class="{ invisible: props.loading }">
19
11
  <slot />
20
12
  </span>
21
13
  <ShadSpinner v-if="props.loading" class="[grid-area:1/1]" />
@@ -69,7 +69,7 @@ const businessHours = computed(
69
69
  );
70
70
  const socialLinks = computed(
71
71
  () => (props.item.contact_channels ?? []).filter((ch) => ch.value).map((ch) => ({
72
- name: ch.channel_type?.toLowerCase() ?? "link",
72
+ name: ch.channel_type ?? "link",
73
73
  link: ch.value
74
74
  }))
75
75
  );
@@ -21,17 +21,7 @@ type __VLS_Props = {
21
21
  id?: string;
22
22
  state?: string;
23
23
  };
24
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
25
- comment: () => any;
26
- like: (liked: boolean) => any;
27
- bookmark: (bookmarked: boolean) => any;
28
- share: () => any;
29
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
30
- onComment?: (() => any) | undefined;
31
- onLike?: ((liked: boolean) => any) | undefined;
32
- onBookmark?: ((bookmarked: boolean) => any) | undefined;
33
- onShare?: (() => any) | undefined;
34
- }>, {
24
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
35
25
  disabled: boolean;
36
26
  id: string;
37
27
  disabledPadding: boolean;
@@ -35,7 +35,6 @@ import { computed, reactive, ref, watch } from "vue";
35
35
  import { useApi } from "../../composables/useApi";
36
36
  const api = useApi();
37
37
  const isOpenModalShare = ref(false);
38
- const emit = defineEmits(["like", "bookmark", "comment", "share"]);
39
38
  const props = defineProps({
40
39
  itemCount: { type: Object, required: false, default: () => ({
41
40
  liked: 0,
@@ -119,7 +118,6 @@ async function toggleLike() {
119
118
  const previousLiked = reaction.liked;
120
119
  reaction.liked = !previousLiked;
121
120
  counts.liked += reaction.liked ? 1 : -1;
122
- emit("like", !!reaction.liked);
123
121
  if (props.state === "blog" && props.id) {
124
122
  try {
125
123
  await api(`/blogs/${props.id}/like`, {
@@ -135,14 +133,11 @@ async function toggleLike() {
135
133
  function toggleBookmark() {
136
134
  reaction.bookmarked = !reaction.bookmarked;
137
135
  counts.bookmarked += reaction.bookmarked ? 1 : -1;
138
- emit("bookmark", !!reaction.bookmarked);
139
136
  }
140
137
  function toggleComment() {
141
138
  console.log("comment ");
142
- emit("comment");
143
139
  }
144
140
  function toggleShared() {
145
141
  isOpenModalShare.value = !isOpenModalShare.value;
146
- emit("share");
147
142
  }
148
143
  </script>
@@ -21,17 +21,7 @@ type __VLS_Props = {
21
21
  id?: string;
22
22
  state?: string;
23
23
  };
24
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
25
- comment: () => any;
26
- like: (liked: boolean) => any;
27
- bookmark: (bookmarked: boolean) => any;
28
- share: () => any;
29
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
30
- onComment?: (() => any) | undefined;
31
- onLike?: ((liked: boolean) => any) | undefined;
32
- onBookmark?: ((bookmarked: boolean) => any) | undefined;
33
- onShare?: (() => any) | undefined;
34
- }>, {
24
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
35
25
  disabled: boolean;
36
26
  id: string;
37
27
  disabledPadding: boolean;
@@ -24,14 +24,8 @@ type __VLS_Props = {
24
24
  isMyProfile?: boolean;
25
25
  };
26
26
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
27
- comment: () => any;
28
- like: (liked: boolean) => any;
29
- share: () => any;
30
27
  "blog-edit": (item: CardUserBlogProps) => any;
31
28
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
32
- onComment?: (() => any) | undefined;
33
- onLike?: ((liked: boolean) => any) | undefined;
34
- onShare?: (() => any) | undefined;
35
29
  "onBlog-edit"?: ((item: CardUserBlogProps) => any) | undefined;
36
30
  }>, {
37
31
  isMyProfile: boolean;
@@ -62,6 +62,7 @@
62
62
  <CardReaction
63
63
  disabled-divider-top
64
64
  disabled-divider-bottom
65
+ :id="props.item.id"
65
66
  :item-count="{
66
67
  liked: props.item.like_count,
67
68
  commented: props.item.comment_count,
@@ -70,9 +71,7 @@
70
71
  :itemActive="{
71
72
  liked: props.item.liked
72
73
  }"
73
- @like="emit('like', $event)"
74
- @comment="emit('comment')"
75
- @share="emit('share')"
74
+ state="blog"
76
75
  />
77
76
  </div>
78
77
  </template>
@@ -87,7 +86,7 @@ const props = defineProps({
87
86
  isMyProfile: { type: Boolean, required: false, default: false }
88
87
  });
89
88
  const router = useRouter();
90
- const emit = defineEmits(["blog-edit", "like", "comment", "share"]);
89
+ const emit = defineEmits(["blog-edit"]);
91
90
  const isPinned = ref(props.item.ispinned);
92
91
  watch(
93
92
  () => props.item.ispinned,
@@ -24,14 +24,8 @@ type __VLS_Props = {
24
24
  isMyProfile?: boolean;
25
25
  };
26
26
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
27
- comment: () => any;
28
- like: (liked: boolean) => any;
29
- share: () => any;
30
27
  "blog-edit": (item: CardUserBlogProps) => any;
31
28
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
32
- onComment?: (() => any) | undefined;
33
- onLike?: ((liked: boolean) => any) | undefined;
34
- onShare?: (() => any) | undefined;
35
29
  "onBlog-edit"?: ((item: CardUserBlogProps) => any) | undefined;
36
30
  }>, {
37
31
  isMyProfile: boolean;
@@ -1,37 +1,13 @@
1
1
  <template>
2
- <Drawer
3
- class="w-[748px]"
4
- :title="drawerTitle"
5
- @close="onClose"
6
- disabled-auto-close
7
- @submit="onSubmit"
8
- v-model="isOpen"
9
- >
2
+ <Drawer class="w-[748px]" :title="drawerTitle" @close="onClose" disabled-auto-close @submit="onSubmit"
3
+ v-model="isOpen">
10
4
  <div class="flex flex-col gap-[16px]">
11
- <InputTextField
12
- name="title"
13
- label="หัวข้อ"
14
- placeholder="ตั้งชื่อบทความให้น่าสนใจ"
15
- showCounter
16
- :limit="180"
17
- v-model="form.title"
18
- disabled-border
19
- required
20
- />
5
+ <InputTextField name="title" label="หัวข้อ" placeholder="ตั้งชื่อบทความให้น่าสนใจ" showCounter :limit="180"
6
+ v-model="form.title" disabled-border required />
21
7
 
22
- <InputContent
23
- placeholder="อยากเล่าอะไร"
24
- :height="288"
25
- v-model="form.content"
26
- />
8
+ <InputContent placeholder="อยากเล่าอะไร" :height="288" v-model="form.content" />
27
9
 
28
- <InputTag
29
- v-model="form.tags"
30
- name="tags"
31
- label="แท็ก"
32
- placeholder="เพิ่มแท็ก"
33
- :limit="5"
34
- />
10
+ <InputTag v-model="form.tags" name="tags" label="แท็ก" placeholder="เพิ่มแท็ก" :limit="5" />
35
11
 
36
12
  <!-- <InputCheckbox
37
13
  name="disableComment"
@@ -41,12 +17,8 @@
41
17
 
42
18
  <div class="flex flex-col gap-[8px]">
43
19
  <div class="text-gray font-body-large">ภาพหน้าปก</div>
44
- <InputFile
45
- :limit="1"
46
- name="coverImage"
47
- accept="image/jpeg,image/png,image/webp,image/bmp,image/gif"
48
- v-model="form.coverImage"
49
- />
20
+ <InputFile :limit="1" name="coverImage" accept="image/jpeg,image/png,image/webp,image/bmp,image/gif"
21
+ v-model="form.coverImage" />
50
22
  <div class="flex flex-col text-gray font-body-small">
51
23
  <div>รองรับไฟล์ *.jpg *.jpeg *.png *.webp *.bmp *.gif</div>
52
24
  <div>ขนาดไม่เกิน 30 mb</div>
@@ -58,11 +30,7 @@
58
30
  <div class="flex justify-end gap-[16px] items-center">
59
31
  <Button variant="outline" @click="onClose">ยกเลิก</Button>
60
32
  <Button @click="onSaveDraft"> บันทึกแบบร่าง </Button>
61
- <Button
62
- type="submit"
63
- color="primary"
64
- :disabled="!meta.valid || isLoading"
65
- >
33
+ <Button type="submit" color="primary" :disabled="!meta.valid || isLoading">
66
34
  <span v-if="isLoading">กำลังบันทึก...</span>
67
35
  <span v-else>เผยแพร่</span>
68
36
  </Button>
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
64
64
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
65
65
  src: string;
66
66
  center: boolean;
67
- background: boolean;
68
- modal: boolean;
69
67
  responsive: boolean;
70
68
  restore: boolean;
71
69
  checkCrossOrigin: boolean;
72
70
  checkOrientation: boolean;
73
71
  crossorigin: "" | "anonymous" | "use-credentials";
72
+ modal: boolean;
74
73
  guides: boolean;
75
74
  highlight: boolean;
75
+ background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
64
64
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
65
65
  src: string;
66
66
  center: boolean;
67
- background: boolean;
68
- modal: boolean;
69
67
  responsive: boolean;
70
68
  restore: boolean;
71
69
  checkCrossOrigin: boolean;
72
70
  checkOrientation: boolean;
73
71
  crossorigin: "" | "anonymous" | "use-credentials";
72
+ modal: boolean;
74
73
  guides: boolean;
75
74
  highlight: boolean;
75
+ background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
@@ -114,7 +114,7 @@ const listSocial = [
114
114
  },
115
115
  {
116
116
  name: "WhatsApp",
117
- icon: "Whatsapp",
117
+ icon: "WhatsApp",
118
118
  example: "https://wa.me/1234567890",
119
119
  regex: /(?:https?:\/\/)?(?:wa\.me|api\.whatsapp\.com)\/.+/i
120
120
  },
@@ -1,10 +1,5 @@
1
1
  <template>
2
- <Modal
3
- title="ป้อนรหัสรักษาความปลอดภัย (OTP)"
4
- @close="emit('close')"
5
- @submit="onVerifyOTP"
6
- v-model="isOpen"
7
- >
2
+ <Modal title="ป้อนรหัสรักษาความปลอดภัย (OTP)" @close="emit('close')" @submit="onVerifyOTP" v-model="isOpen">
8
3
  <div class="space-y-[16px]">
9
4
  <div class="text-center font-body-large">
10
5
  <div>
@@ -15,26 +10,23 @@
15
10
  </div>
16
11
 
17
12
  <div class="flex justify-center">
18
- <InputOTP
19
- name="otp"
20
- columnGap="auto"
21
- v-model="valueOTP"
22
- :error="otpError"
23
- />
13
+ <InputOTP name="otp" columnGap="auto" v-model="valueOTP" :error="otpError" />
24
14
  </div>
25
15
 
26
16
  <div class="text-center font-body-large">
27
- กรุณารอ <span class="text-primary">04.59</span> นาที
28
- จะส่งรหัสยืนยันอีกครั้ง
17
+ <template v-if="countdown !== '00:00'">
18
+ กรุณารอ <span class="text-primary">{{ countdown }}</span> นาที
19
+ จะส่งรหัสยืนยันอีกครั้ง
20
+ </template>
21
+ <template v-else>
22
+ ไม่ได้รับรหัส?
23
+ <Button variant="link" color="primary" @click="onResend">ส่งรหัสอีกครั้ง</Button>
24
+ </template>
29
25
  </div>
30
26
  </div>
27
+
31
28
  <template #footer="{ meta }">
32
- <Button
33
- type="submit"
34
- color="primary"
35
- :disabled="!meta.valid"
36
- class="w-full"
37
- >
29
+ <Button type="submit" color="primary" :disabled="!meta.valid" class="w-full">
38
30
  {{ props.confirmedText }}
39
31
  </Button>
40
32
  </template>
@@ -43,6 +35,7 @@
43
35
 
44
36
  <script setup>
45
37
  import { ref, watch } from "vue";
38
+ import { useCountDown } from "../../composables/useCountDown";
46
39
  const emit = defineEmits(["complete", "close"]);
47
40
  const props = defineProps({
48
41
  phoneLabel: { type: String, required: false, default: "" },
@@ -55,13 +48,21 @@ const props = defineProps({
55
48
  disabled: { type: Boolean, required: false },
56
49
  placeholder: { type: String, required: false }
57
50
  });
58
- const isOpen = defineModel({ type: Boolean, ...{
59
- default: false
60
- } });
51
+ const isOpen = defineModel({ type: Boolean, ...{ default: false } });
61
52
  const textRef = ref("");
62
53
  const valueOTP = ref("");
63
54
  const otpError = ref("");
64
- const loadingModal = ref(false);
55
+ const { CountdownTime } = useCountDown();
56
+ const expireAt = ref("");
57
+ const countdown = CountdownTime(expireAt);
58
+ const resetCountdown = () => {
59
+ expireAt.value = new Date(Date.now() + 5 * 60 * 1e3).toISOString();
60
+ };
61
+ const onResend = () => {
62
+ valueOTP.value = "";
63
+ otpError.value = "";
64
+ resetCountdown();
65
+ };
65
66
  const onVerifyOTP = () => {
66
67
  if (valueOTP.value === "123456") {
67
68
  otpError.value = "";
@@ -75,5 +76,6 @@ watch(isOpen, (value) => {
75
76
  textRef.value = "";
76
77
  valueOTP.value = "";
77
78
  otpError.value = "";
79
+ if (value) resetCountdown();
78
80
  });
79
81
  </script>
@@ -1,156 +1,69 @@
1
1
  <template>
2
- <Modal
3
- width="468"
4
- title="โปรไฟล์"
5
- title-position="center"
6
- @close="onClose"
7
- v-model="modelValue"
8
- >
2
+ <Modal class="w-[425px]" title="โปรไฟล์" @close="onClose" v-model="modelValue">
9
3
  <template #header>
10
- <div v-if="step !== 'menu'">
4
+ <div v-if="step !== 'menu'" class="flex flex-col gap-[8px]">
11
5
  <div class="flex gap-[8px] items-center w-full">
12
6
  <Button variant="text" @click="step = 'menu'">
13
7
  <Icon name="lucide:chevron-left" :size="24" />
14
8
  </Button>
15
9
  <div class="font-title-medium-prominent">
16
10
  <div v-if="step === 'profile-name'">แก้ไขชื่อโปรไฟล์</div>
17
- <div v-if="step === 'premium-id'">พรีเมียม ID</div>
18
11
  <div v-if="step === 'category'">หมวดหมู่</div>
19
12
  </div>
20
13
  </div>
14
+ <div v-if="step === 'profile-name'" class="font-body-large">
15
+ หากคุณเปลี่ยนชื่อ คุณจะไม่สามารถเปลี่ยนชื่อได้อีกเป็นเวลา 60 วัน
16
+ <Button variant="link" color="primary" @click="goToHelpCenter">เรียนรู้เพิ่มเติม</Button>
17
+ </div>
18
+ <div v-if="step === 'category'" class="font-body-large">
19
+ เลือกหมวดหมู่ที่สอดคล้องกับโปรไฟล์
20
+ </div>
21
+ </div>
22
+ <div v-if="step === 'menu'" class="flex flex-col gap-[8px]">
23
+ <div class="font-title-medium-prominent">โปรไฟล์</div>
24
+ <div class="font-body-large">
25
+ จัดการชื่อโปรไฟล์และชื่อผู้ใช้ของคุณสำหรับการแสดงผลในระบบ และการเข้าถึงโปรไฟล์
26
+ <Button variant="link" color="primary" @click="goToHelpCenter">เรียนรู้เพิ่มเติม</Button>
27
+ </div>
21
28
  </div>
22
29
  </template>
23
30
 
24
31
  <div v-if="step === 'menu'" class="flex flex-col gap-[16px]">
25
- <div class="font-body-large">
26
- จัดการชื่อโปรไฟล์และชื่อผู้ใช้ของคุณสำหรับการแสดงผลในระบบ
27
- และการเข้าถึงโปรไฟล์
28
- <span class="text-primary cursor-pointer"> เรียนรู้เพิ่มเติม</span>
29
- </div>
30
- <div class="flex flex-col border border-mercury rounded-[8px]">
31
- <div
32
- v-for="(menu, i) in listMenu"
33
- :key="menu.label"
34
- @click="handleMenuClick(menu)"
35
- :class="[
36
- 'flex p-[16px] justify-between items-center',
37
- isMenuClickable(menu) ? 'cursor-pointer hover:bg-smoke' : '',
38
- i < listMenu.length - 1 ? 'border-b border-mercury' : isMenuClickable(menu) ? 'hover:rounded-b-[8px]' : ''
39
- ]"
40
- >
41
- <div class="flex flex-col min-w-[378px]">
42
- <div class="font-body-large-prominent">{{ menu.label }}</div>
43
- <div class="font-body-large text-gray">{{ menu.value || "-" }}</div>
32
+ <div class="flex flex-col gap-[4px]">
33
+ <template v-for="(menu, i) in listMenu" :key="menu.label">
34
+ <div @click="handleMenuClick(menu)" :class="[
35
+ 'flex justify-between items-center',
36
+ isMenuClickable(menu) ? 'cursor-pointer ' : ''
37
+ ]">
38
+ <div class="flex flex-col w-full">
39
+ <div class="font-body-large-prominent">{{ menu.label }}</div>
40
+ <div class="font-body-large text-gray">{{ menu.value || "-" }}</div>
41
+ </div>
42
+ <Icon v-if="isMenuClickable(menu)" name="lucide:chevron-right" :size="24" class="text-black" />
44
43
  </div>
45
- <Button
46
- v-if="isMenuClickable(menu)"
47
- variant="text"
48
- size="small"
49
- color="black"
50
- icon-size="18"
51
- prepend-icon="lucide:chevron-right"
52
- />
53
- </div>
44
+ <Divider v-if="i < listMenu.length - 1" />
45
+ </template>
54
46
  </div>
55
47
  </div>
56
48
 
57
49
  <div v-else class="flex flex-col gap-[16px]">
58
50
  <template v-if="step === 'profile-name'">
59
- <div class="flex flex-col gap-[16px]">
60
- <div class="font-body-large">
61
- หากคุณเปลี่ยนชื่อ คุณจะไม่สามารถเปลี่ยนชื่อได้อีกเป็นเวลา 60 วัน
62
- <Button
63
- variant="text"
64
- color="primary"
65
- disabled-padding
66
- @click="goToHelpCenter"
67
- >
68
- เรียนรู้เพิ่มเติม
69
- </Button>
70
- </div>
71
- </div>
72
- <Form
73
- v-slot="{ meta }"
74
- class="flex flex-col gap-[16px]"
75
- @submit="saveProfileName"
76
- >
77
- <InputTextField
78
- name="profileName"
79
- label="ชื่อโปรไฟล์"
80
- :placeholder="listMenu[0]?.value || '-'"
81
- full-width
82
- validate-on-input
83
- :rules="ruleProfileName"
84
- v-model="profileName"
85
- />
86
- <Button
87
- type="submit"
88
- color="primary"
89
- full-width
90
- :disabled="!meta.valid || isLoading"
91
- >
51
+ <Form v-slot="{ meta }" class="flex flex-col gap-[16px]" @submit="saveProfileName">
52
+ <InputTextField name="profileName" label="ชื่อโปรไฟล์" :placeholder="listMenu[0]?.value || '-'" full-width
53
+ validate-on-input :rules="ruleProfileName" v-model="profileName" />
54
+ <Button type="submit" color="primary" full-width :disabled="!meta.valid || isLoading">
92
55
  <span v-if="isLoading">กำลังบันทึก...</span>
93
56
  <span v-else>บันทึก</span>
94
57
  </Button>
95
58
  </Form>
96
59
  </template>
97
60
 
98
- <template v-if="step === 'premium-id'">
99
- <div class="flex flex-col gap-[16px]">
100
- <div class="font-body-large">
101
- ดูรายละเอียดเกี่ยวกับการใช้พรีเมียม ID และซื้อพรีเมียม ID ได้ที่นี่
102
61
 
103
- <Button
104
- variant="text"
105
- color="primary"
106
- disabled-padding
107
- @click="goToDetailPremiumID"
108
- >
109
- ดูรายละเอียดเกี่ยวกับพรีเมียม ID
110
- </Button>
111
- </div>
112
- <div class="flex gap-[40px]">
113
- <div class="font-body-large w-[140px]">พรีเมียม ID</div>
114
- <div class="font-body-large text-gray">ไม่มี</div>
115
- </div>
116
- <div class="flex gap-[40px]">
117
- <div class="font-body-large w-[140px]">วันชำระเงินครั้งต่อไป</div>
118
- <div class="font-body-large text-gray">ไม่มี</div>
119
- </div>
120
- <Divider :height="0" />
121
- <div class="font-body-large-prominent">
122
- ค่าบริการรายปีของพรีเมียม ID
123
- </div>
124
- <div class="flex gap-[40px]">
125
- <div class="font-body-large w-[140px]">ราคา (ไม่รวมภาษี)</div>
126
- <div class="font-body-large text-gray">฿444</div>
127
- </div>
128
- <Divider :height="0" />
129
- <InputTextField
130
- v-model="namePremiumID"
131
- label="ซื้อพรีเมียม ID"
132
- show-counter
133
- :limit="18"
134
- prepend-icon="lucide:at-sign"
135
- />
136
- <Button
137
- color="primary"
138
- :disabled="!namePremiumID || namePremiumID.length > 18"
139
- >ซื้อพรีเมียม ID</Button
140
- >
141
- </div>
142
- </template>
143
62
 
144
63
  <template v-if="step === 'category'">
145
64
  <div class="flex flex-col gap-[16px]">
146
- <div class="font-body-large">เลือกหมวดหมู่ที่สอดคล้องกับโปรไฟล์</div>
147
- <InputAutocomplete
148
- v-model="profileCategory"
149
- :options="profileCategoryItems"
150
- name="profileCategory"
151
- placeholder="ค้นหาหรือเลือกหมวดหมู่ที่เกี่ยวข้อง"
152
- label="หมวดหมู่"
153
- />
65
+ <InputAutocomplete v-model="profileCategory" :options="profileCategoryItems" name="profileCategory"
66
+ placeholder="ค้นหาหรือเลือกหมวดหมู่ที่เกี่ยวข้อง" label="หมวดหมู่" />
154
67
  <Button color="primary" :disabled="!profileCategory">บันทึก</Button>
155
68
  </div>
156
69
  </template>
@@ -179,10 +92,6 @@ const modelValue = defineModel({ type: Boolean, ...{
179
92
  } });
180
93
  const step = ref("menu");
181
94
  const profileName = ref();
182
- const premiumId = ref();
183
- const category = ref();
184
- const namePremiumID = ref();
185
- const isOpenDropdown = ref(false);
186
95
  const profileCategory = ref();
187
96
  const profileCategoryItems = ref([]);
188
97
  const isLoading = ref(false);
@@ -277,9 +186,6 @@ const saveProfileName = async (values, { setErrors }) => {
277
186
  const goToHelpCenter = () => {
278
187
  console.log("go to help center");
279
188
  };
280
- const goToDetailPremiumID = () => {
281
- console.log("go to detail premium id");
282
- };
283
189
  const getProfile = () => {
284
190
  const commonMenus = [
285
191
  {
@@ -299,15 +205,6 @@ const getProfile = () => {
299
205
  }
300
206
  }
301
207
  ];
302
- const businessMenus = [
303
- {
304
- label: "\u0E1E\u0E23\u0E35\u0E40\u0E21\u0E35\u0E22\u0E21 ID",
305
- value: props.profileDetail?.premiumId || "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14",
306
- action: () => {
307
- step.value = "premium-id";
308
- }
309
- }
310
- ];
311
208
  const profileMenus = [
312
209
  {
313
210
  label: "\u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48",
@@ -317,15 +214,10 @@ const getProfile = () => {
317
214
  }
318
215
  }
319
216
  ];
320
- if (props.state === "business") {
321
- listMenu.value = [...commonMenus, ...businessMenus, ...profileMenus];
322
- } else {
323
- listMenu.value = [...commonMenus, ...profileMenus];
324
- }
217
+ listMenu.value = [...commonMenus, ...profileMenus];
325
218
  };
326
219
  const reset = () => {
327
220
  profileName.value = "";
328
- premiumId.value = "";
329
221
  };
330
222
  const onClose = () => {
331
223
  reset();
@@ -1,25 +1,21 @@
1
1
  <template>
2
- <Modal title="แชร์" width="396" v-model="isOpen" :loading="true">
3
- <div class="flex justify-between">
4
- <div
5
- v-for="(share, i) of listShares"
6
- :key="i"
7
- @click="share.action()"
8
- class="flex flex-col gap-[4px] items-center cursor-pointer w-[73px]"
9
- >
10
- <Icon :name="share.icon" size="40" />
11
- <div class="font-body-large text-gray">
12
- {{ share.label }}
2
+ <Modal title="แชร์" class="w-[426px]" v-model="isOpen" :loading="false">
3
+ <div class="flex flex-col gap-[16px]">
4
+ <Divider />
5
+ <div class="flex justify-between">
6
+ <div v-for="(share, i) of listShares" :key="i" @click="share.action()"
7
+ class="flex flex-col gap-[4px] items-center cursor-pointer w-[73px]">
8
+ <Icon :name="share.icon" size="40" />
9
+ <div class="font-body-large text-gray">
10
+ {{ share.label }}
11
+ </div>
12
+ </div>
13
+ <div class="flex flex-col gap-[4px] items-center cursor-pointer w-[73px]" @click="onCopyLink">
14
+ <div class="w-[40px] h-[40px] rounded-full bg-dark text-white flex items-center justify-center">
15
+ <Icon name="fa6-solid:link" size="20" />
16
+ </div>
17
+ <div class="font-body-large text-gray text-nowrap">คัดลอกลิงค์</div>
13
18
  </div>
14
- </div>
15
- <div
16
- class="flex flex-col gap-[4px] items-center cursor-pointer w-[73px]"
17
- @click="onCopyLink"
18
- >
19
- <ShadAvatar size="40">
20
- <Icon name="fa6-solid:link" size="40" />
21
- </ShadAvatar>
22
- <div class="font-body-large text-gray text-nowrap">คัดลอกลิงค์</div>
23
19
  </div>
24
20
  </div>
25
21
  </Modal>
@@ -8,7 +8,7 @@ export const buttonVariants = cva(
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 p-0 h-auto",
12
12
  text: "",
13
13
  icon: "has-[>svg]:px-0"
14
14
  },
@@ -129,6 +129,27 @@ export const buttonVariants = cva(
129
129
  variant: "text",
130
130
  color: "destructive",
131
131
  class: "text-destructive hover:opacity-80"
132
+ },
133
+ // link variant - inline link style, primary blue by default, no padding
134
+ {
135
+ variant: "link",
136
+ color: "default",
137
+ class: "text-foreground hover:opacity-80"
138
+ },
139
+ {
140
+ variant: "link",
141
+ color: "primary",
142
+ class: "text-primary hover:opacity-80"
143
+ },
144
+ {
145
+ variant: "link",
146
+ color: "secondary",
147
+ class: "text-secondary hover:opacity-80"
148
+ },
149
+ {
150
+ variant: "link",
151
+ color: "destructive",
152
+ class: "text-destructive hover:opacity-80"
132
153
  }
133
154
  ],
134
155
  defaultVariants: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.230.0",
3
+ "version": "1.232.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",