pukaad-ui-lib 1.397.0 → 1.399.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 +1 -1
- package/dist/runtime/components/button.d.vue.ts +1 -1
- package/dist/runtime/components/button.vue.d.ts +1 -1
- package/dist/runtime/components/display/display-video.d.vue.ts +128 -0
- package/dist/runtime/components/display/display-video.vue +267 -0
- package/dist/runtime/components/display/display-video.vue.d.ts +128 -0
- package/dist/runtime/components/image/image-cropper.d.vue.ts +3 -3
- package/dist/runtime/components/image/image-cropper.vue.d.ts +3 -3
- package/dist/runtime/components/input/input-autocomplete.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-autocomplete.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-combobox.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-combobox.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-localized-name.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-localized-name.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-suggest.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-suggest.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-tag.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-tag.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-textarea.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-textarea.vue.d.ts +1 -1
- package/dist/runtime/components/modal/modal-phone-OTP.d.vue.ts +1 -1
- package/dist/runtime/components/modal/modal-phone-OTP.vue.d.ts +1 -1
- package/dist/runtime/components/modal/suggest-edit-place/place-address.d.vue.ts +2 -2
- package/dist/runtime/components/modal/suggest-edit-place/place-address.vue.d.ts +2 -2
- package/dist/runtime/components/ui/button/index.d.ts +1 -1
- package/dist/runtime/components/ui/button/index.js +37 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes } from "vue";
|
|
|
2
2
|
import type { ButtonVariants } from "./ui/button/index.js";
|
|
3
3
|
export type ButtonType = "button" | "submit" | "reset";
|
|
4
4
|
export type ButtonVariant = "default" | "outline" | "ghost" | "link" | "text" | "icon" | "glass";
|
|
5
|
-
export type ButtonColor = "default" | "primary" | "secondary" | "destructive" | "info" | "warning" | "success";
|
|
5
|
+
export type ButtonColor = "default" | "primary" | "secondary" | "destructive" | "info" | "warning" | "success" | "dark";
|
|
6
6
|
export type ButtonSize = ButtonVariants["size"];
|
|
7
7
|
export interface ButtonProps {
|
|
8
8
|
type?: ButtonType;
|
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes } from "vue";
|
|
|
2
2
|
import type { ButtonVariants } from "./ui/button/index.js";
|
|
3
3
|
export type ButtonType = "button" | "submit" | "reset";
|
|
4
4
|
export type ButtonVariant = "default" | "outline" | "ghost" | "link" | "text" | "icon" | "glass";
|
|
5
|
-
export type ButtonColor = "default" | "primary" | "secondary" | "destructive" | "info" | "warning" | "success";
|
|
5
|
+
export type ButtonColor = "default" | "primary" | "secondary" | "destructive" | "info" | "warning" | "success" | "dark";
|
|
6
6
|
export type ButtonSize = ButtonVariants["size"];
|
|
7
7
|
export interface ButtonProps {
|
|
8
8
|
type?: ButtonType;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export interface DisplayVideoSource {
|
|
2
|
+
src: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
media?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DisplayVideoTrack {
|
|
7
|
+
src: string;
|
|
8
|
+
kind?: "subtitles" | "captions" | "descriptions" | "chapters" | "metadata";
|
|
9
|
+
srclang?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
default?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface DisplayVideoProps {
|
|
14
|
+
src?: string;
|
|
15
|
+
sources?: DisplayVideoSource[];
|
|
16
|
+
tracks?: DisplayVideoTrack[];
|
|
17
|
+
poster?: string;
|
|
18
|
+
width?: string | number;
|
|
19
|
+
height?: string | number;
|
|
20
|
+
fullWidth?: boolean;
|
|
21
|
+
fullHeight?: boolean;
|
|
22
|
+
fit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
23
|
+
controls?: boolean;
|
|
24
|
+
autoplay?: boolean;
|
|
25
|
+
loop?: boolean;
|
|
26
|
+
muted?: boolean;
|
|
27
|
+
playsinline?: boolean;
|
|
28
|
+
preload?: "none" | "metadata" | "auto";
|
|
29
|
+
crossorigin?: "anonymous" | "use-credentials";
|
|
30
|
+
controlsList?: string;
|
|
31
|
+
disablePictureInPicture?: boolean;
|
|
32
|
+
disableRemotePlayback?: boolean;
|
|
33
|
+
volume?: number;
|
|
34
|
+
playbackRate?: number;
|
|
35
|
+
startTime?: number;
|
|
36
|
+
fullscreenButton?: boolean;
|
|
37
|
+
interceptFullscreen?: boolean;
|
|
38
|
+
fullscreenHitClass?: string;
|
|
39
|
+
closeButton?: boolean;
|
|
40
|
+
playButton?: boolean;
|
|
41
|
+
playButtonAutoHide?: boolean;
|
|
42
|
+
playButtonHideDelay?: number;
|
|
43
|
+
clickToPlay?: boolean;
|
|
44
|
+
navButton?: boolean;
|
|
45
|
+
}
|
|
46
|
+
type DisplayVideoAction = {
|
|
47
|
+
video: HTMLVideoElement | null;
|
|
48
|
+
currentTime: number;
|
|
49
|
+
paused: boolean;
|
|
50
|
+
};
|
|
51
|
+
declare var __VLS_1: {
|
|
52
|
+
click: () => void;
|
|
53
|
+
}, __VLS_16: {
|
|
54
|
+
click: () => void;
|
|
55
|
+
paused: boolean;
|
|
56
|
+
}, __VLS_43: {
|
|
57
|
+
click: () => void;
|
|
58
|
+
}, __VLS_58: {
|
|
59
|
+
prev: () => void;
|
|
60
|
+
next: () => void;
|
|
61
|
+
}, __VLS_86: {};
|
|
62
|
+
type __VLS_Slots = {} & {
|
|
63
|
+
close?: (props: typeof __VLS_1) => any;
|
|
64
|
+
} & {
|
|
65
|
+
play?: (props: typeof __VLS_16) => any;
|
|
66
|
+
} & {
|
|
67
|
+
fullscreen?: (props: typeof __VLS_43) => any;
|
|
68
|
+
} & {
|
|
69
|
+
nav?: (props: typeof __VLS_58) => any;
|
|
70
|
+
} & {
|
|
71
|
+
default?: (props: typeof __VLS_86) => any;
|
|
72
|
+
};
|
|
73
|
+
declare const __VLS_base: import("vue").DefineComponent<DisplayVideoProps, {
|
|
74
|
+
videoRef: import("vue").Ref<HTMLVideoElement | null, HTMLVideoElement | null>;
|
|
75
|
+
paused: import("vue").Ref<boolean, boolean>;
|
|
76
|
+
play: () => Promise<void> | undefined;
|
|
77
|
+
pause: () => void | undefined;
|
|
78
|
+
load: () => void | undefined;
|
|
79
|
+
toggle: () => void;
|
|
80
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
81
|
+
close: (payload: DisplayVideoAction) => any;
|
|
82
|
+
prev: (payload: DisplayVideoAction) => any;
|
|
83
|
+
next: (payload: DisplayVideoAction) => any;
|
|
84
|
+
fullscreen: (payload: DisplayVideoAction) => any;
|
|
85
|
+
"play-click": (payload: DisplayVideoAction) => any;
|
|
86
|
+
}, string, import("vue").PublicProps, Readonly<DisplayVideoProps> & Readonly<{
|
|
87
|
+
onClose?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
88
|
+
onPrev?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
89
|
+
onNext?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
90
|
+
onFullscreen?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
91
|
+
"onPlay-click"?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
92
|
+
}>, {
|
|
93
|
+
src: string;
|
|
94
|
+
fullHeight: boolean;
|
|
95
|
+
fullWidth: boolean;
|
|
96
|
+
fit: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
97
|
+
poster: string;
|
|
98
|
+
autoplay: boolean;
|
|
99
|
+
muted: boolean;
|
|
100
|
+
loop: boolean;
|
|
101
|
+
controls: boolean;
|
|
102
|
+
preload: "none" | "metadata" | "auto";
|
|
103
|
+
sources: DisplayVideoSource[];
|
|
104
|
+
tracks: DisplayVideoTrack[];
|
|
105
|
+
playsinline: boolean;
|
|
106
|
+
disablePictureInPicture: boolean;
|
|
107
|
+
disableRemotePlayback: boolean;
|
|
108
|
+
volume: number;
|
|
109
|
+
playbackRate: number;
|
|
110
|
+
startTime: number;
|
|
111
|
+
fullscreenButton: boolean;
|
|
112
|
+
interceptFullscreen: boolean;
|
|
113
|
+
fullscreenHitClass: string;
|
|
114
|
+
closeButton: boolean;
|
|
115
|
+
playButton: boolean;
|
|
116
|
+
playButtonAutoHide: boolean;
|
|
117
|
+
playButtonHideDelay: number;
|
|
118
|
+
clickToPlay: boolean;
|
|
119
|
+
navButton: boolean;
|
|
120
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
121
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
122
|
+
declare const _default: typeof __VLS_export;
|
|
123
|
+
export default _default;
|
|
124
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
125
|
+
new (): {
|
|
126
|
+
$slots: S;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="relative inline-flex"
|
|
4
|
+
:class="[props.fullWidth && 'w-full', props.fullHeight && 'h-full']"
|
|
5
|
+
>
|
|
6
|
+
<!-- ปุ่มปิด -->
|
|
7
|
+
<slot v-if="props.closeButton" name="close" :click="onClose">
|
|
8
|
+
<div class="absolute top-[24px] left-[24px] z-10">
|
|
9
|
+
<Button circle color="dark" @click="onClose">
|
|
10
|
+
<Icon name="lucide:x" />
|
|
11
|
+
</Button>
|
|
12
|
+
</div>
|
|
13
|
+
</slot>
|
|
14
|
+
|
|
15
|
+
<!-- ปุ่มเล่น / หยุด -->
|
|
16
|
+
<slot
|
|
17
|
+
v-if="props.playButton"
|
|
18
|
+
name="play"
|
|
19
|
+
:click="onPlayClick"
|
|
20
|
+
:paused="paused"
|
|
21
|
+
>
|
|
22
|
+
<Transition
|
|
23
|
+
enter-active-class="transition duration-200 ease-out"
|
|
24
|
+
enter-from-class="opacity-0 scale-75"
|
|
25
|
+
enter-to-class="opacity-100 scale-100"
|
|
26
|
+
leave-active-class="transition duration-300 ease-out"
|
|
27
|
+
leave-from-class="opacity-100 scale-100"
|
|
28
|
+
leave-to-class="opacity-0 scale-150"
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
v-show="showPlayButton"
|
|
32
|
+
class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-10"
|
|
33
|
+
>
|
|
34
|
+
<Button
|
|
35
|
+
circle
|
|
36
|
+
color="dark"
|
|
37
|
+
class="w-[80px] h-[80px]"
|
|
38
|
+
:aria-label="paused ? '\u0E40\u0E25\u0E48\u0E19' : '\u0E2B\u0E22\u0E38\u0E14'"
|
|
39
|
+
@click="onPlayClick"
|
|
40
|
+
>
|
|
41
|
+
<Transition
|
|
42
|
+
mode="out-in"
|
|
43
|
+
enter-active-class="transition duration-150 ease-out"
|
|
44
|
+
enter-from-class="opacity-0 scale-75"
|
|
45
|
+
enter-to-class="opacity-100 scale-100"
|
|
46
|
+
leave-active-class="transition duration-100 ease-in"
|
|
47
|
+
leave-from-class="opacity-100 scale-100"
|
|
48
|
+
leave-to-class="opacity-0 scale-125"
|
|
49
|
+
>
|
|
50
|
+
<Icon
|
|
51
|
+
:key="paused ? 'play' : 'pause'"
|
|
52
|
+
:name="paused ? 'lucide:play' : 'lucide:pause'"
|
|
53
|
+
class="w-[56px] h-[56px]"
|
|
54
|
+
/>
|
|
55
|
+
</Transition>
|
|
56
|
+
</Button>
|
|
57
|
+
</div>
|
|
58
|
+
</Transition>
|
|
59
|
+
</slot>
|
|
60
|
+
|
|
61
|
+
<!-- ปุ่มขยายเต็มจอ -->
|
|
62
|
+
<slot v-if="props.fullscreenButton" name="fullscreen" :click="onFullscreen">
|
|
63
|
+
<div class="absolute top-[16px] right-[16px] z-10">
|
|
64
|
+
<Button circle color="dark" @click="onFullscreen">
|
|
65
|
+
<Icon name="lucide:maximize" />
|
|
66
|
+
</Button>
|
|
67
|
+
</div>
|
|
68
|
+
</slot>
|
|
69
|
+
|
|
70
|
+
<!-- พื้นที่ใส ๆ ทับปุ่มขยายของ native ให้คลิกโดนของเราก่อน -->
|
|
71
|
+
<button
|
|
72
|
+
v-if="interceptFullscreen"
|
|
73
|
+
type="button"
|
|
74
|
+
class="absolute z-10 cursor-pointer"
|
|
75
|
+
:class="props.fullscreenHitClass"
|
|
76
|
+
aria-label="ขยาย"
|
|
77
|
+
@click="onFullscreen"
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
<!-- ปุ่มเลื่อนขึ้นลงวีดีโอ -->
|
|
81
|
+
<slot
|
|
82
|
+
v-if="props.navButton"
|
|
83
|
+
name="nav"
|
|
84
|
+
:prev="onPrev"
|
|
85
|
+
:next="onNext"
|
|
86
|
+
>
|
|
87
|
+
<div class="absolute top-1/2 right-[16px] -translate-y-1/2 z-10">
|
|
88
|
+
<div class="flex flex-col gap-[32px] items-center">
|
|
89
|
+
<Button circle color="dark" class="w-[50px] h-[50px]" @click="onPrev">
|
|
90
|
+
<Icon name="lucide:chevron-up" class="w-[32px] h-[32px]" />
|
|
91
|
+
</Button>
|
|
92
|
+
<Button circle color="dark" class="w-[50px] h-[50px]" @click="onNext">
|
|
93
|
+
<Icon name="lucide:chevron-down" class="w-[32px] h-[32px]" />
|
|
94
|
+
</Button>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</slot>
|
|
98
|
+
|
|
99
|
+
<video
|
|
100
|
+
ref="videoRef"
|
|
101
|
+
v-bind="$attrs"
|
|
102
|
+
:class="[
|
|
103
|
+
surfaceClickable && 'cursor-pointer',
|
|
104
|
+
props.playButton && 'display-video-no-native-overlay'
|
|
105
|
+
]"
|
|
106
|
+
:src="props.src || void 0"
|
|
107
|
+
:poster="props.poster || void 0"
|
|
108
|
+
:preload="props.preload"
|
|
109
|
+
:controls="props.controls"
|
|
110
|
+
:autoplay="props.autoplay"
|
|
111
|
+
:loop="props.loop"
|
|
112
|
+
:muted="props.muted"
|
|
113
|
+
:playsinline="props.playsinline"
|
|
114
|
+
:crossorigin="props.crossorigin || void 0"
|
|
115
|
+
:controlslist="controlsList || void 0"
|
|
116
|
+
:disablepictureinpicture="props.disablePictureInPicture"
|
|
117
|
+
:disableremoteplayback="props.disableRemotePlayback"
|
|
118
|
+
:style="{
|
|
119
|
+
width: props.fullWidth ? '100%' : toSize(props.width),
|
|
120
|
+
height: props.fullHeight ? '100%' : toSize(props.height),
|
|
121
|
+
objectFit: props.fit
|
|
122
|
+
}"
|
|
123
|
+
@click="onSurfaceClick"
|
|
124
|
+
@play="onPaused(false)"
|
|
125
|
+
@pause="onPaused(true)"
|
|
126
|
+
@ended="onPaused(true)"
|
|
127
|
+
>
|
|
128
|
+
<source
|
|
129
|
+
v-for="(source, i_source) in props.sources"
|
|
130
|
+
:key="i_source"
|
|
131
|
+
:src="source.src"
|
|
132
|
+
:type="source.type"
|
|
133
|
+
:media="source.media"
|
|
134
|
+
/>
|
|
135
|
+
<track
|
|
136
|
+
v-for="(track, i_track) in props.tracks"
|
|
137
|
+
:key="i_track"
|
|
138
|
+
:src="track.src"
|
|
139
|
+
:kind="track.kind"
|
|
140
|
+
:srclang="track.srclang"
|
|
141
|
+
:label="track.label"
|
|
142
|
+
:default="track.default"
|
|
143
|
+
/>
|
|
144
|
+
<slot />
|
|
145
|
+
</video>
|
|
146
|
+
</div>
|
|
147
|
+
</template>
|
|
148
|
+
|
|
149
|
+
<script setup>
|
|
150
|
+
import { computed, onBeforeUnmount, onMounted, ref, watch } from "vue";
|
|
151
|
+
defineOptions({ inheritAttrs: false });
|
|
152
|
+
const emit = defineEmits(["fullscreen", "close", "play-click", "prev", "next"]);
|
|
153
|
+
const props = defineProps({
|
|
154
|
+
src: { type: String, required: false, default: "" },
|
|
155
|
+
sources: { type: Array, required: false, default: () => [] },
|
|
156
|
+
tracks: { type: Array, required: false, default: () => [] },
|
|
157
|
+
poster: { type: String, required: false, default: "" },
|
|
158
|
+
width: { type: [String, Number], required: false },
|
|
159
|
+
height: { type: [String, Number], required: false },
|
|
160
|
+
fullWidth: { type: Boolean, required: false, default: false },
|
|
161
|
+
fullHeight: { type: Boolean, required: false, default: false },
|
|
162
|
+
fit: { type: String, required: false, default: "contain" },
|
|
163
|
+
controls: { type: Boolean, required: false, default: true },
|
|
164
|
+
autoplay: { type: Boolean, required: false, default: false },
|
|
165
|
+
loop: { type: Boolean, required: false, default: false },
|
|
166
|
+
muted: { type: Boolean, required: false, default: false },
|
|
167
|
+
playsinline: { type: Boolean, required: false, default: true },
|
|
168
|
+
preload: { type: String, required: false, default: "metadata" },
|
|
169
|
+
crossorigin: { type: String, required: false },
|
|
170
|
+
controlsList: { type: String, required: false },
|
|
171
|
+
disablePictureInPicture: { type: Boolean, required: false, default: false },
|
|
172
|
+
disableRemotePlayback: { type: Boolean, required: false, default: false },
|
|
173
|
+
volume: { type: Number, required: false, default: 1 },
|
|
174
|
+
playbackRate: { type: Number, required: false, default: 1 },
|
|
175
|
+
startTime: { type: Number, required: false, default: 0 },
|
|
176
|
+
fullscreenButton: { type: Boolean, required: false, default: false },
|
|
177
|
+
interceptFullscreen: { type: Boolean, required: false, default: false },
|
|
178
|
+
fullscreenHitClass: { type: String, required: false, default: "bottom-0 right-0 w-[48px] h-[48px]" },
|
|
179
|
+
closeButton: { type: Boolean, required: false, default: false },
|
|
180
|
+
playButton: { type: Boolean, required: false, default: false },
|
|
181
|
+
playButtonAutoHide: { type: Boolean, required: false, default: true },
|
|
182
|
+
playButtonHideDelay: { type: Number, required: false, default: 600 },
|
|
183
|
+
clickToPlay: { type: Boolean, required: false, default: false },
|
|
184
|
+
navButton: { type: Boolean, required: false, default: false }
|
|
185
|
+
});
|
|
186
|
+
const videoRef = ref(null);
|
|
187
|
+
const paused = ref(true);
|
|
188
|
+
const showPlayButton = ref(true);
|
|
189
|
+
let hideTimer;
|
|
190
|
+
const clearHideTimer = () => {
|
|
191
|
+
if (hideTimer) clearTimeout(hideTimer);
|
|
192
|
+
hideTimer = void 0;
|
|
193
|
+
};
|
|
194
|
+
const surfaceClickable = computed(() => props.clickToPlay && !props.controls);
|
|
195
|
+
const interceptFullscreen = computed(
|
|
196
|
+
() => props.interceptFullscreen && props.controls
|
|
197
|
+
);
|
|
198
|
+
const controlsList = computed(() => {
|
|
199
|
+
const list = (props.controlsList ?? "").split(" ").filter(Boolean);
|
|
200
|
+
if (props.fullscreenButton && !list.includes("nofullscreen")) {
|
|
201
|
+
list.push("nofullscreen");
|
|
202
|
+
}
|
|
203
|
+
return list.join(" ");
|
|
204
|
+
});
|
|
205
|
+
const toSize = (value) => {
|
|
206
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
207
|
+
return typeof value === "number" || /^\d+(\.\d+)?$/.test(String(value)) ? `${value}px` : String(value);
|
|
208
|
+
};
|
|
209
|
+
const syncPlayback = () => {
|
|
210
|
+
const el = videoRef.value;
|
|
211
|
+
if (!el) return;
|
|
212
|
+
el.muted = props.muted;
|
|
213
|
+
el.volume = props.volume;
|
|
214
|
+
el.playbackRate = props.playbackRate;
|
|
215
|
+
};
|
|
216
|
+
onMounted(() => {
|
|
217
|
+
syncPlayback();
|
|
218
|
+
const el = videoRef.value;
|
|
219
|
+
if (!el) return;
|
|
220
|
+
if (props.startTime) el.currentTime = props.startTime;
|
|
221
|
+
onPaused(el.paused);
|
|
222
|
+
});
|
|
223
|
+
onBeforeUnmount(clearHideTimer);
|
|
224
|
+
watch(() => [props.muted, props.volume, props.playbackRate], syncPlayback);
|
|
225
|
+
const actionPayload = () => ({
|
|
226
|
+
video: videoRef.value,
|
|
227
|
+
currentTime: videoRef.value?.currentTime ?? 0,
|
|
228
|
+
paused: paused.value
|
|
229
|
+
});
|
|
230
|
+
const onPaused = (value) => {
|
|
231
|
+
paused.value = value;
|
|
232
|
+
clearHideTimer();
|
|
233
|
+
if (value || !props.playButtonAutoHide) {
|
|
234
|
+
showPlayButton.value = true;
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
showPlayButton.value = true;
|
|
238
|
+
hideTimer = setTimeout(() => {
|
|
239
|
+
showPlayButton.value = false;
|
|
240
|
+
}, props.playButtonHideDelay);
|
|
241
|
+
};
|
|
242
|
+
const onSurfaceClick = () => {
|
|
243
|
+
if (!surfaceClickable.value) return;
|
|
244
|
+
onPlayClick();
|
|
245
|
+
};
|
|
246
|
+
const onPlayClick = () => {
|
|
247
|
+
const el = videoRef.value;
|
|
248
|
+
if (el) {
|
|
249
|
+
if (el.paused) el.play();
|
|
250
|
+
else el.pause();
|
|
251
|
+
}
|
|
252
|
+
emit("play-click", actionPayload());
|
|
253
|
+
};
|
|
254
|
+
const onFullscreen = () => emit("fullscreen", actionPayload());
|
|
255
|
+
const onClose = () => emit("close", actionPayload());
|
|
256
|
+
const onPrev = () => emit("prev", actionPayload());
|
|
257
|
+
const onNext = () => emit("next", actionPayload());
|
|
258
|
+
const play = () => videoRef.value?.play();
|
|
259
|
+
const pause = () => videoRef.value?.pause();
|
|
260
|
+
const load = () => videoRef.value?.load();
|
|
261
|
+
const toggle = () => onPlayClick();
|
|
262
|
+
defineExpose({ videoRef, paused, play, pause, load, toggle });
|
|
263
|
+
</script>
|
|
264
|
+
|
|
265
|
+
<style scoped>
|
|
266
|
+
.display-video-no-native-overlay::-webkit-media-controls-overlay-play-button{display:none}
|
|
267
|
+
</style>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export interface DisplayVideoSource {
|
|
2
|
+
src: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
media?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DisplayVideoTrack {
|
|
7
|
+
src: string;
|
|
8
|
+
kind?: "subtitles" | "captions" | "descriptions" | "chapters" | "metadata";
|
|
9
|
+
srclang?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
default?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface DisplayVideoProps {
|
|
14
|
+
src?: string;
|
|
15
|
+
sources?: DisplayVideoSource[];
|
|
16
|
+
tracks?: DisplayVideoTrack[];
|
|
17
|
+
poster?: string;
|
|
18
|
+
width?: string | number;
|
|
19
|
+
height?: string | number;
|
|
20
|
+
fullWidth?: boolean;
|
|
21
|
+
fullHeight?: boolean;
|
|
22
|
+
fit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
23
|
+
controls?: boolean;
|
|
24
|
+
autoplay?: boolean;
|
|
25
|
+
loop?: boolean;
|
|
26
|
+
muted?: boolean;
|
|
27
|
+
playsinline?: boolean;
|
|
28
|
+
preload?: "none" | "metadata" | "auto";
|
|
29
|
+
crossorigin?: "anonymous" | "use-credentials";
|
|
30
|
+
controlsList?: string;
|
|
31
|
+
disablePictureInPicture?: boolean;
|
|
32
|
+
disableRemotePlayback?: boolean;
|
|
33
|
+
volume?: number;
|
|
34
|
+
playbackRate?: number;
|
|
35
|
+
startTime?: number;
|
|
36
|
+
fullscreenButton?: boolean;
|
|
37
|
+
interceptFullscreen?: boolean;
|
|
38
|
+
fullscreenHitClass?: string;
|
|
39
|
+
closeButton?: boolean;
|
|
40
|
+
playButton?: boolean;
|
|
41
|
+
playButtonAutoHide?: boolean;
|
|
42
|
+
playButtonHideDelay?: number;
|
|
43
|
+
clickToPlay?: boolean;
|
|
44
|
+
navButton?: boolean;
|
|
45
|
+
}
|
|
46
|
+
type DisplayVideoAction = {
|
|
47
|
+
video: HTMLVideoElement | null;
|
|
48
|
+
currentTime: number;
|
|
49
|
+
paused: boolean;
|
|
50
|
+
};
|
|
51
|
+
declare var __VLS_1: {
|
|
52
|
+
click: () => void;
|
|
53
|
+
}, __VLS_16: {
|
|
54
|
+
click: () => void;
|
|
55
|
+
paused: boolean;
|
|
56
|
+
}, __VLS_43: {
|
|
57
|
+
click: () => void;
|
|
58
|
+
}, __VLS_58: {
|
|
59
|
+
prev: () => void;
|
|
60
|
+
next: () => void;
|
|
61
|
+
}, __VLS_86: {};
|
|
62
|
+
type __VLS_Slots = {} & {
|
|
63
|
+
close?: (props: typeof __VLS_1) => any;
|
|
64
|
+
} & {
|
|
65
|
+
play?: (props: typeof __VLS_16) => any;
|
|
66
|
+
} & {
|
|
67
|
+
fullscreen?: (props: typeof __VLS_43) => any;
|
|
68
|
+
} & {
|
|
69
|
+
nav?: (props: typeof __VLS_58) => any;
|
|
70
|
+
} & {
|
|
71
|
+
default?: (props: typeof __VLS_86) => any;
|
|
72
|
+
};
|
|
73
|
+
declare const __VLS_base: import("vue").DefineComponent<DisplayVideoProps, {
|
|
74
|
+
videoRef: import("vue").Ref<HTMLVideoElement | null, HTMLVideoElement | null>;
|
|
75
|
+
paused: import("vue").Ref<boolean, boolean>;
|
|
76
|
+
play: () => Promise<void> | undefined;
|
|
77
|
+
pause: () => void | undefined;
|
|
78
|
+
load: () => void | undefined;
|
|
79
|
+
toggle: () => void;
|
|
80
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
81
|
+
close: (payload: DisplayVideoAction) => any;
|
|
82
|
+
prev: (payload: DisplayVideoAction) => any;
|
|
83
|
+
next: (payload: DisplayVideoAction) => any;
|
|
84
|
+
fullscreen: (payload: DisplayVideoAction) => any;
|
|
85
|
+
"play-click": (payload: DisplayVideoAction) => any;
|
|
86
|
+
}, string, import("vue").PublicProps, Readonly<DisplayVideoProps> & Readonly<{
|
|
87
|
+
onClose?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
88
|
+
onPrev?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
89
|
+
onNext?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
90
|
+
onFullscreen?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
91
|
+
"onPlay-click"?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
92
|
+
}>, {
|
|
93
|
+
src: string;
|
|
94
|
+
fullHeight: boolean;
|
|
95
|
+
fullWidth: boolean;
|
|
96
|
+
fit: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
97
|
+
poster: string;
|
|
98
|
+
autoplay: boolean;
|
|
99
|
+
muted: boolean;
|
|
100
|
+
loop: boolean;
|
|
101
|
+
controls: boolean;
|
|
102
|
+
preload: "none" | "metadata" | "auto";
|
|
103
|
+
sources: DisplayVideoSource[];
|
|
104
|
+
tracks: DisplayVideoTrack[];
|
|
105
|
+
playsinline: boolean;
|
|
106
|
+
disablePictureInPicture: boolean;
|
|
107
|
+
disableRemotePlayback: boolean;
|
|
108
|
+
volume: number;
|
|
109
|
+
playbackRate: number;
|
|
110
|
+
startTime: number;
|
|
111
|
+
fullscreenButton: boolean;
|
|
112
|
+
interceptFullscreen: boolean;
|
|
113
|
+
fullscreenHitClass: string;
|
|
114
|
+
closeButton: boolean;
|
|
115
|
+
playButton: boolean;
|
|
116
|
+
playButtonAutoHide: boolean;
|
|
117
|
+
playButtonHideDelay: number;
|
|
118
|
+
clickToPlay: boolean;
|
|
119
|
+
navButton: boolean;
|
|
120
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
121
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
122
|
+
declare const _default: typeof __VLS_export;
|
|
123
|
+
export default _default;
|
|
124
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
125
|
+
new (): {
|
|
126
|
+
$slots: S;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
@@ -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
|
-
|
|
68
|
-
modal: boolean;
|
|
67
|
+
crossorigin: "" | "anonymous" | "use-credentials";
|
|
69
68
|
responsive: boolean;
|
|
70
69
|
restore: boolean;
|
|
71
70
|
checkCrossOrigin: boolean;
|
|
72
71
|
checkOrientation: boolean;
|
|
73
|
-
|
|
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
|
-
|
|
68
|
-
modal: boolean;
|
|
67
|
+
crossorigin: "" | "anonymous" | "use-credentials";
|
|
69
68
|
responsive: boolean;
|
|
70
69
|
restore: boolean;
|
|
71
70
|
checkCrossOrigin: boolean;
|
|
72
71
|
checkOrientation: boolean;
|
|
73
|
-
|
|
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;
|
|
@@ -70,9 +70,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
70
70
|
required: boolean;
|
|
71
71
|
description: string;
|
|
72
72
|
options: AutocompleteOption[] | string[] | number[];
|
|
73
|
-
limit: number;
|
|
74
73
|
labelKey: string;
|
|
75
74
|
placeholder: string;
|
|
75
|
+
limit: number;
|
|
76
76
|
disabledErrorMessage: boolean;
|
|
77
77
|
disabledBorder: boolean;
|
|
78
78
|
showCounter: boolean;
|
|
@@ -70,9 +70,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
70
70
|
required: boolean;
|
|
71
71
|
description: string;
|
|
72
72
|
options: AutocompleteOption[] | string[] | number[];
|
|
73
|
-
limit: number;
|
|
74
73
|
labelKey: string;
|
|
75
74
|
placeholder: string;
|
|
75
|
+
limit: number;
|
|
76
76
|
disabledErrorMessage: boolean;
|
|
77
77
|
disabledBorder: boolean;
|
|
78
78
|
showCounter: boolean;
|
|
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
12
12
|
name: string;
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
14
|
options: InputSelectItem[];
|
|
15
|
-
limit: number;
|
|
16
15
|
placeholder: string;
|
|
16
|
+
limit: number;
|
|
17
17
|
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
19
19
|
removable: boolean;
|
|
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
12
12
|
name: string;
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
14
|
options: InputSelectItem[];
|
|
15
|
-
limit: number;
|
|
16
15
|
placeholder: string;
|
|
16
|
+
limit: number;
|
|
17
17
|
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
19
19
|
removable: boolean;
|
|
@@ -20,9 +20,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
20
20
|
name: string;
|
|
21
21
|
required: boolean;
|
|
22
22
|
description: string;
|
|
23
|
-
limit: number;
|
|
24
23
|
labelKey: string;
|
|
25
24
|
placeholder: string;
|
|
25
|
+
limit: number;
|
|
26
26
|
disabledErrorMessage: boolean;
|
|
27
27
|
disabledBorder: boolean;
|
|
28
28
|
showCounter: boolean;
|
|
@@ -20,9 +20,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
20
20
|
name: string;
|
|
21
21
|
required: boolean;
|
|
22
22
|
description: string;
|
|
23
|
-
limit: number;
|
|
24
23
|
labelKey: string;
|
|
25
24
|
placeholder: string;
|
|
25
|
+
limit: number;
|
|
26
26
|
disabledErrorMessage: boolean;
|
|
27
27
|
disabledBorder: boolean;
|
|
28
28
|
showCounter: boolean;
|
|
@@ -26,8 +26,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
26
26
|
}>, {
|
|
27
27
|
name: string;
|
|
28
28
|
state: "user" | "admin";
|
|
29
|
-
limit: number;
|
|
30
29
|
placeholder: string;
|
|
30
|
+
limit: number;
|
|
31
31
|
ignore: string[];
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -26,8 +26,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
26
26
|
}>, {
|
|
27
27
|
name: string;
|
|
28
28
|
state: "user" | "admin";
|
|
29
|
-
limit: number;
|
|
30
29
|
placeholder: string;
|
|
30
|
+
limit: number;
|
|
31
31
|
ignore: string[];
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -46,8 +46,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
46
46
|
resize: "none" | "both" | "horizontal" | "vertical";
|
|
47
47
|
fullHeight: boolean;
|
|
48
48
|
fullWidth: boolean;
|
|
49
|
-
limit: number;
|
|
50
49
|
rows: number;
|
|
50
|
+
limit: number;
|
|
51
51
|
disabledErrorMessage: boolean;
|
|
52
52
|
disabledBorder: boolean;
|
|
53
53
|
showCounter: boolean;
|
|
@@ -46,8 +46,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
46
46
|
resize: "none" | "both" | "horizontal" | "vertical";
|
|
47
47
|
fullHeight: boolean;
|
|
48
48
|
fullWidth: boolean;
|
|
49
|
-
limit: number;
|
|
50
49
|
rows: number;
|
|
50
|
+
limit: number;
|
|
51
51
|
disabledErrorMessage: boolean;
|
|
52
52
|
disabledBorder: boolean;
|
|
53
53
|
showCounter: boolean;
|
|
@@ -14,8 +14,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
14
14
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
15
15
|
onComplete?: ((data?: any) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
-
phone: string;
|
|
18
17
|
confirmedText: string;
|
|
18
|
+
phone: string;
|
|
19
19
|
phoneLabel: string;
|
|
20
20
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
21
|
declare const _default: typeof __VLS_export;
|
|
@@ -14,8 +14,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
14
14
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
15
15
|
onComplete?: ((data?: any) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
-
phone: string;
|
|
18
17
|
confirmedText: string;
|
|
18
|
+
phone: string;
|
|
19
19
|
phoneLabel: string;
|
|
20
20
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
21
|
declare const _default: typeof __VLS_export;
|
|
@@ -13,18 +13,18 @@ type __VLS_ModelProps = {
|
|
|
13
13
|
};
|
|
14
14
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
15
15
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
"update:editType": (value: string) => any;
|
|
16
17
|
"update:latLng": (value: {
|
|
17
18
|
lat: number;
|
|
18
19
|
lng: number;
|
|
19
20
|
} | null) => any;
|
|
20
|
-
"update:editType": (value: string) => any;
|
|
21
21
|
"update:addressValue": (value: InputAddressValue) => any;
|
|
22
22
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
+
"onUpdate:editType"?: ((value: string) => any) | undefined;
|
|
23
24
|
"onUpdate:latLng"?: ((value: {
|
|
24
25
|
lat: number;
|
|
25
26
|
lng: number;
|
|
26
27
|
} | null) => any) | undefined;
|
|
27
|
-
"onUpdate:editType"?: ((value: string) => any) | undefined;
|
|
28
28
|
"onUpdate:addressValue"?: ((value: InputAddressValue) => any) | undefined;
|
|
29
29
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
30
|
declare const _default: typeof __VLS_export;
|
|
@@ -13,18 +13,18 @@ type __VLS_ModelProps = {
|
|
|
13
13
|
};
|
|
14
14
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
15
15
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
"update:editType": (value: string) => any;
|
|
16
17
|
"update:latLng": (value: {
|
|
17
18
|
lat: number;
|
|
18
19
|
lng: number;
|
|
19
20
|
} | null) => any;
|
|
20
|
-
"update:editType": (value: string) => any;
|
|
21
21
|
"update:addressValue": (value: InputAddressValue) => any;
|
|
22
22
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
+
"onUpdate:editType"?: ((value: string) => any) | undefined;
|
|
23
24
|
"onUpdate:latLng"?: ((value: {
|
|
24
25
|
lat: number;
|
|
25
26
|
lng: number;
|
|
26
27
|
} | null) => any) | undefined;
|
|
27
|
-
"onUpdate:editType"?: ((value: string) => any) | undefined;
|
|
28
28
|
"onUpdate:addressValue"?: ((value: InputAddressValue) => any) | undefined;
|
|
29
29
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
30
|
declare const _default: typeof __VLS_export;
|
|
@@ -2,7 +2,7 @@ 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
4
|
variant?: "link" | "text" | "default" | "outline" | "ghost" | "icon" | "glass" | null | undefined;
|
|
5
|
-
color?: "default" | "primary" | "secondary" | "destructive" | "info" | "warning" | "success" | null | undefined;
|
|
5
|
+
color?: "default" | "primary" | "secondary" | "destructive" | "info" | "warning" | "success" | "dark" | null | undefined;
|
|
6
6
|
size?: "default" | "icon" | "sm" | "lg" | "icon-sm" | "icon-xs" | "icon-lg" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
export type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
@@ -20,7 +20,8 @@ export const buttonVariants = cva(
|
|
|
20
20
|
destructive: "text-destructive",
|
|
21
21
|
info: "text-info-foreground",
|
|
22
22
|
warning: "text-warning",
|
|
23
|
-
success: "text-success"
|
|
23
|
+
success: "text-success",
|
|
24
|
+
dark: "text-dark"
|
|
24
25
|
},
|
|
25
26
|
size: {
|
|
26
27
|
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
@@ -68,6 +69,11 @@ export const buttonVariants = cva(
|
|
|
68
69
|
color: "success",
|
|
69
70
|
class: "bg-success text-white hover:bg-success/90"
|
|
70
71
|
},
|
|
72
|
+
{
|
|
73
|
+
variant: "default",
|
|
74
|
+
color: "dark",
|
|
75
|
+
class: "bg-dark text-white hover:bg-dark/90"
|
|
76
|
+
},
|
|
71
77
|
{
|
|
72
78
|
variant: "outline",
|
|
73
79
|
color: "default",
|
|
@@ -103,6 +109,11 @@ export const buttonVariants = cva(
|
|
|
103
109
|
color: "success",
|
|
104
110
|
class: "border border-success text-success hover:text-success/90 bg-white"
|
|
105
111
|
},
|
|
112
|
+
{
|
|
113
|
+
variant: "outline",
|
|
114
|
+
color: "dark",
|
|
115
|
+
class: "border border-dark text-dark hover:text-dark/80 bg-white"
|
|
116
|
+
},
|
|
106
117
|
{
|
|
107
118
|
variant: "ghost",
|
|
108
119
|
color: "default",
|
|
@@ -138,6 +149,11 @@ export const buttonVariants = cva(
|
|
|
138
149
|
color: "success",
|
|
139
150
|
class: "text-success hover:bg-success/90 hover:text-white"
|
|
140
151
|
},
|
|
152
|
+
{
|
|
153
|
+
variant: "ghost",
|
|
154
|
+
color: "dark",
|
|
155
|
+
class: "text-dark hover:bg-dark hover:text-white"
|
|
156
|
+
},
|
|
141
157
|
{
|
|
142
158
|
variant: "icon",
|
|
143
159
|
color: "default",
|
|
@@ -173,12 +189,22 @@ export const buttonVariants = cva(
|
|
|
173
189
|
color: "success",
|
|
174
190
|
class: "text-success hover:bg-success/90 hover:text-white"
|
|
175
191
|
},
|
|
192
|
+
{
|
|
193
|
+
variant: "icon",
|
|
194
|
+
color: "dark",
|
|
195
|
+
class: "text-dark hover:bg-dark hover:text-white"
|
|
196
|
+
},
|
|
176
197
|
// glass variant - โปร่งบนพื้นรูป ไอคอนขาวตลอด hover ถึงเป็นสีเต็ม
|
|
177
198
|
{
|
|
178
199
|
variant: "glass",
|
|
179
200
|
color: "primary",
|
|
180
201
|
class: "bg-black/30 text-white hover:bg-primary"
|
|
181
202
|
},
|
|
203
|
+
{
|
|
204
|
+
variant: "glass",
|
|
205
|
+
color: "dark",
|
|
206
|
+
class: "bg-black/30 text-white hover:bg-dark"
|
|
207
|
+
},
|
|
182
208
|
// text variant - just plain text with color, no background or hover effects
|
|
183
209
|
{
|
|
184
210
|
variant: "text",
|
|
@@ -215,6 +241,11 @@ export const buttonVariants = cva(
|
|
|
215
241
|
color: "success",
|
|
216
242
|
class: "text-success hover:opacity-80"
|
|
217
243
|
},
|
|
244
|
+
{
|
|
245
|
+
variant: "text",
|
|
246
|
+
color: "dark",
|
|
247
|
+
class: "text-dark hover:opacity-80"
|
|
248
|
+
},
|
|
218
249
|
// link variant - inline link style, primary blue by default, no padding
|
|
219
250
|
{
|
|
220
251
|
variant: "link",
|
|
@@ -250,6 +281,11 @@ export const buttonVariants = cva(
|
|
|
250
281
|
variant: "link",
|
|
251
282
|
color: "success",
|
|
252
283
|
class: "text-success hover:opacity-80"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
variant: "link",
|
|
287
|
+
color: "dark",
|
|
288
|
+
class: "text-dark hover:opacity-80"
|
|
253
289
|
}
|
|
254
290
|
],
|
|
255
291
|
defaultVariants: {
|