pxd 0.0.28 → 0.0.29
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/components/active-graph/index.vue.d.ts +1 -1
- package/dist/components/avatar/index.vue +7 -18
- package/dist/components/avatar-group/index.vue.d.ts +1 -1
- package/dist/components/badge/index.vue +15 -13
- package/dist/components/badge/index.vue.d.ts +1 -1
- package/dist/components/book/index.vue.d.ts +1 -1
- package/dist/components/browser/index.vue.d.ts +1 -1
- package/dist/components/button/index.vue +3 -3
- package/dist/components/button/index.vue.d.ts +1 -1
- package/dist/components/carousel/index.vue.d.ts +1 -1
- package/dist/components/carousel-group/index.vue +78 -28
- package/dist/components/carousel-group/index.vue.d.ts +8 -3
- package/dist/components/chip/index.vue +1 -1
- package/dist/components/chip/index.vue.d.ts +1 -1
- package/dist/components/choicebox/index.vue.d.ts +1 -1
- package/dist/components/choicebox-group/index.vue.d.ts +1 -1
- package/dist/components/collapse/index.vue +2 -6
- package/dist/components/collapse/index.vue.d.ts +1 -1
- package/dist/components/collapse-group/index.vue.d.ts +1 -1
- package/dist/components/config-provider/index.vue.d.ts +1 -1
- package/dist/components/description/index.vue.d.ts +1 -1
- package/dist/components/drawer/index.vue.d.ts +1 -1
- package/dist/components/empty-state/index.vue.d.ts +1 -1
- package/dist/components/error/index.vue.d.ts +1 -1
- package/dist/components/fader/index.vue +90 -0
- package/dist/components/fader/index.vue.d.ts +14 -0
- package/dist/components/gauge/index.vue.d.ts +1 -1
- package/dist/components/hold-button/index.vue.d.ts +2 -2
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/input/index.vue +134 -34
- package/dist/components/input/index.vue.d.ts +25 -25
- package/dist/components/intersection-observer/content.vue.d.ts +1 -1
- package/dist/components/intersection-observer/index.vue.d.ts +1 -1
- package/dist/components/kbd/index.vue.d.ts +1 -1
- package/dist/components/link-button/index.vue.d.ts +1 -1
- package/dist/components/loading-dots/index.vue.d.ts +1 -1
- package/dist/components/material/index.vue.d.ts +1 -1
- package/dist/components/menu/index.vue.d.ts +1 -1
- package/dist/components/menu-item/index.vue +1 -7
- package/dist/components/menu-item/index.vue.d.ts +1 -1
- package/dist/components/menu-list/index.vue.d.ts +1 -1
- package/dist/components/modal/index.vue +11 -3
- package/dist/components/modal/index.vue.d.ts +7 -6
- package/dist/components/more-button/index.vue.d.ts +1 -1
- package/dist/components/note/index.vue.d.ts +1 -1
- package/dist/components/number-input/index.vue +183 -0
- package/dist/components/number-input/index.vue.d.ts +36 -0
- package/dist/components/overlay/index.vue.d.ts +1 -1
- package/dist/components/pagination/index.vue +2 -2
- package/dist/components/pagination/index.vue.d.ts +1 -1
- package/dist/components/pin-input/index.vue.d.ts +1 -1
- package/dist/components/popover/index.vue +114 -132
- package/dist/components/popover/index.vue.d.ts +9 -2
- package/dist/components/progress/index.vue.d.ts +1 -1
- package/dist/components/radio/index.vue.d.ts +1 -1
- package/dist/components/radio-group/index.vue.d.ts +1 -1
- package/dist/components/resizable/index.vue.d.ts +4 -3
- package/dist/components/resizable-handle/index.vue +2 -2
- package/dist/components/resizable-handle/index.vue.d.ts +1 -1
- package/dist/components/resizable-panel/index.vue.d.ts +1 -1
- package/dist/components/scrollable/index.vue +22 -83
- package/dist/components/scrollable/index.vue.d.ts +3 -3
- package/dist/components/skeleton/index.vue.d.ts +1 -1
- package/dist/components/slider/index.vue.d.ts +1 -1
- package/dist/components/snippet/index.vue.d.ts +1 -1
- package/dist/components/spinner/index.vue.d.ts +1 -1
- package/dist/components/stack/index.vue.d.ts +3 -3
- package/dist/components/status-dot/index.vue.d.ts +1 -1
- package/dist/components/switch/index.vue.d.ts +1 -1
- package/dist/components/switch-group/index.vue.d.ts +1 -1
- package/dist/components/teleport/index.vue.d.ts +1 -1
- package/dist/components/text/index.vue.d.ts +1 -1
- package/dist/components/textarea/index.vue.d.ts +3 -3
- package/dist/components/theme-switcher/index.vue.d.ts +1 -1
- package/dist/components/toggle/index.vue.d.ts +1 -1
- package/dist/components/tooltip/index.vue +1 -1
- package/dist/components/tooltip/index.vue.d.ts +1 -1
- package/dist/components/virtual-list/index.vue.d.ts +1 -1
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.js +2 -0
- package/dist/composables/usePointerGesture.d.ts +174 -0
- package/dist/composables/usePointerGesture.js +397 -0
- package/dist/composables/useRepeatAction.d.ts +16 -0
- package/dist/composables/useRepeatAction.js +49 -0
- package/dist/contexts/resizable.d.ts +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles/styles.css +1 -1
- package/dist/styles/tw.css +2 -2
- package/dist/types/components/carousel.d.ts +2 -2
- package/dist/types/components/input.d.ts +27 -0
- package/dist/types/shared/props.d.ts +2 -0
- package/package.json +12 -12
|
@@ -24,7 +24,7 @@ declare var __VLS_6: {
|
|
|
24
24
|
type __VLS_Slots = {} & {
|
|
25
25
|
tooltip?: (props: typeof __VLS_6) => any;
|
|
26
26
|
};
|
|
27
|
-
declare const __VLS_component: import("vue").DefineComponent<Props,
|
|
27
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
28
|
"cell-click": (args_0: MouseEvent, args_1: string) => any;
|
|
29
29
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
30
30
|
"onCell-click"?: (args_0: MouseEvent, args_1: string) => any;
|
|
@@ -39,7 +39,7 @@ defineExpose({
|
|
|
39
39
|
|
|
40
40
|
<template>
|
|
41
41
|
<div
|
|
42
|
-
class="pxd-avatar relative inline-flex items-center justify-center rounded-full border border-background-100 select-none"
|
|
42
|
+
class="pxd-avatar relative inline-flex size-(--size) items-center justify-center rounded-full border border-background-100 select-none"
|
|
43
43
|
:style="{ '--size': computedSize }"
|
|
44
44
|
>
|
|
45
45
|
<slot>
|
|
@@ -60,7 +60,7 @@ defineExpose({
|
|
|
60
60
|
>
|
|
61
61
|
</slot>
|
|
62
62
|
|
|
63
|
-
<div v-if="loading" class="pxd-avatar--loading" />
|
|
63
|
+
<div v-if="loading" class="pxd-avatar--loading inset-0 backdrop-blur-xs absolute z-1 rounded-inherit" />
|
|
64
64
|
|
|
65
65
|
<div
|
|
66
66
|
v-if="$slots.icon"
|
|
@@ -73,9 +73,6 @@ defineExpose({
|
|
|
73
73
|
|
|
74
74
|
<style lang="postcss">
|
|
75
75
|
.pxd-avatar {
|
|
76
|
-
width: var(--size);
|
|
77
|
-
height: var(--size);
|
|
78
|
-
|
|
79
76
|
&::before,
|
|
80
77
|
&::after {
|
|
81
78
|
content: '';
|
|
@@ -96,22 +93,14 @@ defineExpose({
|
|
|
96
93
|
}
|
|
97
94
|
}
|
|
98
95
|
|
|
99
|
-
.pxd-avatar--loading {
|
|
96
|
+
.pxd-avatar--loading::after {
|
|
97
|
+
content: '';
|
|
100
98
|
position: absolute;
|
|
101
99
|
inset: 0;
|
|
102
100
|
border-radius: inherit;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
&::after {
|
|
107
|
-
content: '';
|
|
108
|
-
position: absolute;
|
|
109
|
-
inset: 0;
|
|
110
|
-
border-radius: inherit;
|
|
111
|
-
border-style: solid;
|
|
112
|
-
border-width: 2px 2px 1px 0;
|
|
113
|
-
border-color: var(--color-primary) var(--color-primary) transparent transparent;
|
|
114
|
-
}
|
|
101
|
+
border-style: solid;
|
|
102
|
+
border-width: 2px 2px 1px 0;
|
|
103
|
+
border-color: var(--color-primary) var(--color-primary) transparent transparent;
|
|
115
104
|
}
|
|
116
105
|
|
|
117
106
|
@keyframes placeholder {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AvatarGroupProps } from '../../types/components/avatar';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<AvatarGroupProps,
|
|
2
|
+
declare const _default: import("vue").DefineComponent<AvatarGroupProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarGroupProps> & Readonly<{}>, {
|
|
3
3
|
max: number;
|
|
4
4
|
options: import("../../types/components/avatar").Options[];
|
|
5
5
|
size: number | string;
|
|
@@ -42,7 +42,7 @@ const VARIANTS = {
|
|
|
42
42
|
const config = useConfigProvider();
|
|
43
43
|
const computedClass = computed(() => {
|
|
44
44
|
const classes = [
|
|
45
|
-
"pxd-badge px-2.5 font-medium h-6 font-sans gap-1 inline-flex items-center justify-center rounded-full no-underline
|
|
45
|
+
"pxd-badge px-2.5 font-medium h-6 font-sans gap-1 inline-flex items-center justify-center rounded-full !no-underline motion-safe:transition-all",
|
|
46
46
|
getFallbackValue(props.variant, VARIANTS, "gray"),
|
|
47
47
|
getFallbackValue(props.size, SIZES, config.size),
|
|
48
48
|
props.variant
|
|
@@ -69,20 +69,22 @@ const badgeAttrs = computed(() => {
|
|
|
69
69
|
</component>
|
|
70
70
|
</template>
|
|
71
71
|
|
|
72
|
-
<style>
|
|
73
|
-
.pxd-badge
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
<style lang="postcss">
|
|
73
|
+
.pxd-badge {
|
|
74
|
+
&.pill {
|
|
75
|
+
box-shadow: 0 0 0 1px var(--color-gray-300);
|
|
76
|
+
}
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
78
|
+
&.vue {
|
|
79
|
+
background: linear-gradient(315deg, #42d392 25%, #647eff);
|
|
80
|
+
}
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
82
|
+
&.trial {
|
|
83
|
+
background: linear-gradient(135deg, #0070f3, #f81ce5);
|
|
84
|
+
}
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
&.turborepo {
|
|
87
|
+
background: linear-gradient(135deg, #ff1e56, #0096ff);
|
|
88
|
+
}
|
|
87
89
|
}
|
|
88
90
|
</style>
|
|
@@ -37,7 +37,7 @@ declare var __VLS_7: {};
|
|
|
37
37
|
type __VLS_Slots = {} & {
|
|
38
38
|
default?: (props: typeof __VLS_7) => any;
|
|
39
39
|
};
|
|
40
|
-
declare const __VLS_component: import("vue").DefineComponent<Props,
|
|
40
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
41
41
|
variant: keyof typeof VARIANTS;
|
|
42
42
|
as: ComponentAs;
|
|
43
43
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -14,7 +14,7 @@ type __VLS_Slots = {} & {
|
|
|
14
14
|
} & {
|
|
15
15
|
icon?: (props: typeof __VLS_5) => any;
|
|
16
16
|
};
|
|
17
|
-
declare const __VLS_component: import("vue").DefineComponent<Props,
|
|
17
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
18
18
|
variant: "simple" | "stripe";
|
|
19
19
|
width: number;
|
|
20
20
|
textured: boolean;
|
|
@@ -5,7 +5,7 @@ declare var __VLS_38: {};
|
|
|
5
5
|
type __VLS_Slots = {} & {
|
|
6
6
|
default?: (props: typeof __VLS_38) => any;
|
|
7
7
|
};
|
|
8
|
-
declare const __VLS_component: import("vue").DefineComponent<Props,
|
|
8
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
9
9
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
10
10
|
export default _default;
|
|
11
11
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -43,9 +43,9 @@ const FONT_SIZES = {
|
|
|
43
43
|
const VARIANTS = {
|
|
44
44
|
simple: "",
|
|
45
45
|
default: "bg-background-100 text-foreground hover:bg-background-hover active:bg-background-active border-input",
|
|
46
|
-
ghost: "bg-transparent text-foreground hover:bg-
|
|
46
|
+
ghost: "bg-transparent text-foreground hover:bg-background-hover active:bg-background-active border-transparent",
|
|
47
47
|
primary: "bg-primary text-gray-100 hover:bg-primary/80 active:bg-gray-900 border-transparent",
|
|
48
|
-
error: "bg-red-800 text-white
|
|
48
|
+
error: "bg-red-800 text-white hover:bg-red-700 active:bg-red-900 border-transparent",
|
|
49
49
|
warning: "bg-amber-800 text-black hover:bg-amber-700 active:bg-amber-900 border-transparent",
|
|
50
50
|
success: "bg-green-800 text-white hover:bg-green-700 active:bg-green-900 border-transparent"
|
|
51
51
|
};
|
|
@@ -54,7 +54,7 @@ const ALIGNMENTS = {
|
|
|
54
54
|
center: "justify-center",
|
|
55
55
|
right: "justify-end"
|
|
56
56
|
};
|
|
57
|
-
const DISABLED_CLASS_NAMES = "is-disabled bg-gray-100 hover:bg-gray-100 active:bg-gray-100 cursor-not-allowed text-gray-700 border-gray-300";
|
|
57
|
+
const DISABLED_CLASS_NAMES = "is-disabled bg-gray-100 hover:bg-gray-100 active:bg-gray-100 disabled:cursor-not-allowed text-gray-700 border-gray-300";
|
|
58
58
|
const config = useConfigProvider();
|
|
59
59
|
const computedDisabled = computed(() => isTruthyProp(props.disabled) || isTruthyProp(props.loading));
|
|
60
60
|
const computedClass = computed(() => {
|
|
@@ -7,7 +7,7 @@ type __VLS_Slots = {} & {
|
|
|
7
7
|
} & {
|
|
8
8
|
suffix?: (props: typeof __VLS_19) => any;
|
|
9
9
|
};
|
|
10
|
-
declare const __VLS_component: import("vue").DefineComponent<ButtonProps,
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<ButtonProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
11
|
click: (args_0: MouseEvent) => any;
|
|
12
12
|
dblclick: (args_0: MouseEvent) => any;
|
|
13
13
|
}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{
|
|
@@ -2,7 +2,7 @@ declare var __VLS_1: {};
|
|
|
2
2
|
type __VLS_Slots = {} & {
|
|
3
3
|
default?: (props: typeof __VLS_1) => any;
|
|
4
4
|
};
|
|
5
|
-
declare const __VLS_component: import("vue").DefineComponent<{},
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
6
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
7
|
export default _default;
|
|
8
8
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import ChevronRightIcon from "@gdsicon/vue/chevron-right";
|
|
3
3
|
import { computed, nextTick, onBeforeUnmount, onMounted, ref, shallowRef } from "vue";
|
|
4
|
+
import { usePointerGesture } from "../../composables/usePointerGesture";
|
|
4
5
|
import { provideCarouselGroupContext } from "../../contexts/carousel";
|
|
5
6
|
import { getCssUnitValue } from "../../utils/format";
|
|
6
7
|
import { throttle } from "../../utils/throttle";
|
|
@@ -24,9 +25,11 @@ const props = defineProps({
|
|
|
24
25
|
const emits = defineEmits(["change"]);
|
|
25
26
|
const THROTTLE_INTERVALS = 550;
|
|
26
27
|
const TRANSITION_CLASSES = ["transition-transform", "duration-500"];
|
|
27
|
-
let
|
|
28
|
-
|
|
28
|
+
let autoPlayRafId = null;
|
|
29
|
+
let autoPlaySession = 0;
|
|
30
|
+
let isPointerEntering = false;
|
|
29
31
|
const carousels = ref([]);
|
|
32
|
+
const sliderRef = shallowRef(null);
|
|
30
33
|
const virtualIndex = shallowRef(props.index);
|
|
31
34
|
const correctIndex = computed(() => {
|
|
32
35
|
const index = virtualIndex.value;
|
|
@@ -55,15 +58,14 @@ const onToggleClick = throttle((delta) => {
|
|
|
55
58
|
if (length === 0) {
|
|
56
59
|
return;
|
|
57
60
|
}
|
|
58
|
-
onPointerEnter();
|
|
59
61
|
if (props.loop) {
|
|
60
62
|
virtualIndex.value += delta;
|
|
61
63
|
translateItems();
|
|
62
64
|
} else {
|
|
63
65
|
virtualIndex.value = Math.max(0, Math.min(virtualIndex.value + delta, length - 1));
|
|
64
66
|
}
|
|
65
|
-
nextTick(onPointerLeave);
|
|
66
67
|
emits("change", correctIndex.value);
|
|
68
|
+
nextTick(onPointerLeave);
|
|
67
69
|
}, THROTTLE_INTERVALS, { edges: ["leading"] });
|
|
68
70
|
function onWheelToggle(ev) {
|
|
69
71
|
if (!props.toggleOnWheel) {
|
|
@@ -85,7 +87,10 @@ function resetContainerPosition(resetIndex) {
|
|
|
85
87
|
containerClassList.add(...TRANSITION_CLASSES);
|
|
86
88
|
}, 0);
|
|
87
89
|
}
|
|
88
|
-
function onTransitionsEnd() {
|
|
90
|
+
function onTransitionsEnd(ev) {
|
|
91
|
+
if (ev.propertyName !== "transform" || ev.target !== sliderRef.value) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
89
94
|
if (!props.loop) {
|
|
90
95
|
return;
|
|
91
96
|
}
|
|
@@ -95,34 +100,55 @@ function onTransitionsEnd() {
|
|
|
95
100
|
resetContainerPosition(carousels.value.length - 1);
|
|
96
101
|
}
|
|
97
102
|
}
|
|
103
|
+
function clearAutoPlayTimer() {
|
|
104
|
+
autoPlaySession++;
|
|
105
|
+
if (autoPlayRafId != null) {
|
|
106
|
+
cancelAnimationFrame(autoPlayRafId);
|
|
107
|
+
autoPlayRafId = null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
98
110
|
function setAutoPlayTimer() {
|
|
111
|
+
const mySession = autoPlaySession;
|
|
99
112
|
const startTime = performance.now();
|
|
100
|
-
|
|
113
|
+
const onAnimationFrame = () => {
|
|
114
|
+
if (mySession !== autoPlaySession || isPointerEntering) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
101
117
|
const currentTime = performance.now();
|
|
102
118
|
const elapsedTime = currentTime - startTime;
|
|
103
119
|
if (elapsedTime >= props.interval) {
|
|
104
120
|
onToggleClick(1);
|
|
105
|
-
|
|
106
|
-
} else {
|
|
107
|
-
autoPlayTimer = requestAnimationFrame(onAnimationFrame);
|
|
121
|
+
return;
|
|
108
122
|
}
|
|
109
|
-
|
|
110
|
-
|
|
123
|
+
autoPlayRafId = requestAnimationFrame(onAnimationFrame);
|
|
124
|
+
};
|
|
125
|
+
autoPlayRafId = requestAnimationFrame(onAnimationFrame);
|
|
111
126
|
}
|
|
112
127
|
function onPointerEnter() {
|
|
113
|
-
|
|
128
|
+
if (props.pauseOnHover) {
|
|
129
|
+
isPointerEntering = true;
|
|
130
|
+
clearAutoPlayTimer();
|
|
131
|
+
}
|
|
114
132
|
}
|
|
115
133
|
function onPointerLeave() {
|
|
134
|
+
isPointerEntering = false;
|
|
116
135
|
if (!props.autoplay) {
|
|
117
136
|
return;
|
|
118
137
|
}
|
|
138
|
+
clearAutoPlayTimer();
|
|
119
139
|
setAutoPlayTimer();
|
|
120
140
|
}
|
|
121
141
|
function onIndicatorClick(ev) {
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
const targetIndex = Number(
|
|
125
|
-
|
|
142
|
+
clearAutoPlayTimer();
|
|
143
|
+
const targetEl = ev.target.closest("[data-index]");
|
|
144
|
+
const targetIndex = Number(targetEl?.dataset.index);
|
|
145
|
+
if (Number.isNaN(targetIndex)) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const deltaIndex = targetIndex - virtualIndex.value;
|
|
149
|
+
if (deltaIndex !== 0) {
|
|
150
|
+
onToggleClick(deltaIndex);
|
|
151
|
+
}
|
|
126
152
|
nextTick(onPointerLeave);
|
|
127
153
|
}
|
|
128
154
|
function registerCarousel(state) {
|
|
@@ -131,16 +157,38 @@ function registerCarousel(state) {
|
|
|
131
157
|
function unregisterCarousel(id) {
|
|
132
158
|
carousels.value = carousels.value.filter(({ uid }) => uid !== id);
|
|
133
159
|
}
|
|
160
|
+
usePointerGesture(sliderRef, {
|
|
161
|
+
axis: () => props.direction === "horizontal" ? "x" : "y",
|
|
162
|
+
directionGuard: (d) => {
|
|
163
|
+
if (props.direction === "horizontal") {
|
|
164
|
+
return d === "left" || d === "right";
|
|
165
|
+
}
|
|
166
|
+
return d === "up" || d === "down";
|
|
167
|
+
},
|
|
168
|
+
onRelease(hit, dir, kind) {
|
|
169
|
+
if (!hit || !dir || kind === "longpress") {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (dir === "left" || dir === "up") {
|
|
173
|
+
onToggleClick(1);
|
|
174
|
+
} else if (dir === "right" || dir === "down") {
|
|
175
|
+
onToggleClick(-1);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
});
|
|
134
179
|
provideCarouselGroupContext({
|
|
135
180
|
props,
|
|
136
181
|
carousels,
|
|
137
182
|
registerCarousel,
|
|
138
183
|
unregisterCarousel
|
|
139
184
|
});
|
|
140
|
-
onMounted(() => {
|
|
185
|
+
onMounted(async () => {
|
|
141
186
|
onPointerLeave();
|
|
187
|
+
await nextTick();
|
|
188
|
+
translateItems();
|
|
142
189
|
});
|
|
143
190
|
onBeforeUnmount(() => {
|
|
191
|
+
clearAutoPlayTimer();
|
|
144
192
|
carousels.value = [];
|
|
145
193
|
});
|
|
146
194
|
</script>
|
|
@@ -151,7 +199,7 @@ onBeforeUnmount(() => {
|
|
|
151
199
|
:data-direction="direction"
|
|
152
200
|
:data-indicator-type="indicatorType"
|
|
153
201
|
:data-indicator-position="indicatorPosition"
|
|
154
|
-
class="pxd-carousel-group group relative w-full touch-
|
|
202
|
+
class="pxd-carousel-group group relative w-full touch-none overflow-hidden"
|
|
155
203
|
:style="{ height: getCssUnitValue(height) }"
|
|
156
204
|
@pointerenter="onPointerEnter"
|
|
157
205
|
@pointerleave="onPointerLeave"
|
|
@@ -160,7 +208,7 @@ onBeforeUnmount(() => {
|
|
|
160
208
|
<div class="pxd-carousel-group--container size-full">
|
|
161
209
|
<div
|
|
162
210
|
ref="sliderRef"
|
|
163
|
-
class="pxd-carousel-group--slider translate-z-0 size-full group-
|
|
211
|
+
class="pxd-carousel-group--slider translate-z-0 size-full group-data-[direction=horizontal]:flex"
|
|
164
212
|
:style="computedStyle"
|
|
165
213
|
:class="TRANSITION_CLASSES"
|
|
166
214
|
@transitionend="onTransitionsEnd"
|
|
@@ -174,20 +222,22 @@ onBeforeUnmount(() => {
|
|
|
174
222
|
class="pxd-carousel-group--indicator gap-2 absolute flex w-max items-center group-data-[indicator-position=left]:flex-col group-data-[indicator-position=right]:flex-col"
|
|
175
223
|
@click="onIndicatorClick"
|
|
176
224
|
>
|
|
177
|
-
<
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
225
|
+
<slot name="indicator" :current="correctIndex + 1" :total="carousels.length">
|
|
226
|
+
<button
|
|
227
|
+
v-for="(_, i) in carousels.length"
|
|
228
|
+
:key="i"
|
|
229
|
+
:data-index="i"
|
|
230
|
+
class="pxd-carousel-group--indicator-item relative h-(--h) w-(--w) cursor-pointer appearance-none rounded-full bg-gray-alpha-200 self-focus-ring outline-none hover:bg-gray-alpha-400 motion-safe:transition-colors"
|
|
231
|
+
:class="{ '!bg-primary': i === correctIndex }"
|
|
232
|
+
/>
|
|
233
|
+
</slot>
|
|
184
234
|
</div>
|
|
185
235
|
|
|
186
236
|
<div v-if="arrow" class="pxd-carousel-group--toggle-buttons gap-2 absolute flex group-data-[indicator-position=left]:flex-col group-data-[indicator-position=right]:flex-col">
|
|
187
237
|
<button
|
|
188
238
|
type="button"
|
|
189
239
|
aria-label="Carousel arrow left"
|
|
190
|
-
class="pxd-carousel-group--prev-button p-1.5 cursor-pointer appearance-none rounded-md bg-gray-alpha-100 self-focus-ring outline-none group-data-[direction=vertical]:rotate-90 hover:bg-
|
|
240
|
+
class="pxd-carousel-group--prev-button p-1.5 cursor-pointer appearance-none rounded-md bg-gray-alpha-100 text-foreground-secondary self-focus-ring outline-none group-data-[direction=vertical]:rotate-90 hover:bg-background-hover active:bg-background-active disabled:pointer-events-none motion-safe:transition-colors"
|
|
191
241
|
@click="onToggleClick(-1)"
|
|
192
242
|
>
|
|
193
243
|
<ChevronRightIcon class="rotate-180" />
|
|
@@ -196,7 +246,7 @@ onBeforeUnmount(() => {
|
|
|
196
246
|
<button
|
|
197
247
|
type="button"
|
|
198
248
|
aria-label="Carousel arrow right"
|
|
199
|
-
class="pxd-carousel-group--next-button p-1.5 cursor-pointer appearance-none rounded-md bg-gray-alpha-100 self-focus-ring outline-none group-data-[direction=vertical]:rotate-90 hover:bg-
|
|
249
|
+
class="pxd-carousel-group--next-button p-1.5 cursor-pointer appearance-none rounded-md bg-gray-alpha-100 text-foreground-secondary self-focus-ring outline-none group-data-[direction=vertical]:rotate-90 hover:bg-background-hover active:bg-background-active disabled:pointer-events-none motion-safe:transition-colors"
|
|
200
250
|
@click="onToggleClick(1)"
|
|
201
251
|
>
|
|
202
252
|
<ChevronRightIcon />
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { CarouselGroupProps } from '../../types/components/carousel';
|
|
2
|
-
declare var __VLS_1: {}
|
|
2
|
+
declare var __VLS_1: {}, __VLS_3: {
|
|
3
|
+
current: number;
|
|
4
|
+
total: number;
|
|
5
|
+
};
|
|
3
6
|
type __VLS_Slots = {} & {
|
|
4
7
|
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
} & {
|
|
9
|
+
indicator?: (props: typeof __VLS_3) => any;
|
|
5
10
|
};
|
|
6
|
-
declare const __VLS_component: import("vue").DefineComponent<CarouselGroupProps,
|
|
11
|
+
declare const __VLS_component: import("vue").DefineComponent<CarouselGroupProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
12
|
change: (index: number) => any;
|
|
8
13
|
}, string, import("vue").PublicProps, Readonly<CarouselGroupProps> & Readonly<{
|
|
9
14
|
onChange?: (index: number) => any;
|
|
@@ -11,7 +16,7 @@ declare const __VLS_component: import("vue").DefineComponent<CarouselGroupProps,
|
|
|
11
16
|
index: number;
|
|
12
17
|
interval: number;
|
|
13
18
|
height: number | string;
|
|
14
|
-
direction: "
|
|
19
|
+
direction: import("../../types/shared").ComponentDirection;
|
|
15
20
|
autoplay: boolean;
|
|
16
21
|
loop: boolean;
|
|
17
22
|
arrow: boolean;
|
|
@@ -9,7 +9,7 @@ declare var __VLS_1: {};
|
|
|
9
9
|
type __VLS_Slots = {} & {
|
|
10
10
|
default?: (props: typeof __VLS_1) => any;
|
|
11
11
|
};
|
|
12
|
-
declare const __VLS_component: import("vue").DefineComponent<Props,
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
13
13
|
variant: ComponentVariant | "secondary";
|
|
14
14
|
label: ComponentLabel;
|
|
15
15
|
size: number | string;
|
|
@@ -5,7 +5,7 @@ type __VLS_Slots = {} & {
|
|
|
5
5
|
} & {
|
|
6
6
|
description?: (props: typeof __VLS_9) => any;
|
|
7
7
|
};
|
|
8
|
-
declare const __VLS_component: import("vue").DefineComponent<ChoiceboxProps,
|
|
8
|
+
declare const __VLS_component: import("vue").DefineComponent<ChoiceboxProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ChoiceboxProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
9
9
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
10
10
|
export default _default;
|
|
11
11
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -5,7 +5,7 @@ type __VLS_Slots = {} & {
|
|
|
5
5
|
} & {
|
|
6
6
|
default?: (props: typeof __VLS_8) => any;
|
|
7
7
|
};
|
|
8
|
-
declare const __VLS_component: import("vue").DefineComponent<ChoiceboxGroupProps,
|
|
8
|
+
declare const __VLS_component: import("vue").DefineComponent<ChoiceboxGroupProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
9
|
"update:modelValue": (args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[]>) => any;
|
|
10
10
|
}, string, import("vue").PublicProps, Readonly<ChoiceboxGroupProps> & Readonly<{
|
|
11
11
|
"onUpdate:modelValue"?: (args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[]>) => any;
|
|
@@ -64,7 +64,7 @@ onMounted(() => {
|
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
66
|
<template>
|
|
67
|
-
<div class="pxd-collapse border-b
|
|
67
|
+
<div class="pxd-collapse group/collapse border-b">
|
|
68
68
|
<h3 class="pxd-collapse--title">
|
|
69
69
|
<button
|
|
70
70
|
class="pxd-collapse--trigger pr-1 group/collapse flex w-full cursor-pointer appearance-none items-center justify-between border-none bg-transparent self-focus-ring outline-none"
|
|
@@ -87,7 +87,7 @@ onMounted(() => {
|
|
|
87
87
|
@before-leave="beforeLeave"
|
|
88
88
|
@leave="leave"
|
|
89
89
|
>
|
|
90
|
-
<div v-show="isExpanded" class="pxd-collapse--content">
|
|
90
|
+
<div v-show="isExpanded" class="pxd-collapse--content group-hover/collapse:will-change-[height]">
|
|
91
91
|
<slot />
|
|
92
92
|
</div>
|
|
93
93
|
</Transition>
|
|
@@ -101,10 +101,6 @@ onMounted(() => {
|
|
|
101
101
|
font-weight: var(--font-weight, 600);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
.pxd-collapse--content {
|
|
105
|
-
will-change: height;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
104
|
.pxd-transition--collapse-enter-active,
|
|
109
105
|
.pxd-transition--collapse-leave-active {
|
|
110
106
|
transition: height var(--default-transition-duration) var(--default-transition-timing-function);
|
|
@@ -8,7 +8,7 @@ type __VLS_Slots = {} & {
|
|
|
8
8
|
} & {
|
|
9
9
|
default?: (props: typeof __VLS_20) => any;
|
|
10
10
|
};
|
|
11
|
-
declare const __VLS_component: import("vue").DefineComponent<Props,
|
|
11
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
12
12
|
title: string;
|
|
13
13
|
expand: boolean;
|
|
14
14
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -7,7 +7,7 @@ declare var __VLS_1: {};
|
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
8
|
default?: (props: typeof __VLS_1) => any;
|
|
9
9
|
};
|
|
10
|
-
declare const __VLS_component: import("vue").DefineComponent<Props,
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
11
11
|
multiple: boolean;
|
|
12
12
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
13
13
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -7,7 +7,7 @@ declare var __VLS_7: {};
|
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
8
|
default?: (props: typeof __VLS_7) => any;
|
|
9
9
|
};
|
|
10
|
-
declare const __VLS_component: import("vue").DefineComponent<Props,
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
11
11
|
size: import("../../types/shared").ComponentSize;
|
|
12
12
|
as: ComponentAs;
|
|
13
13
|
locale: Record<string, any>;
|
|
@@ -9,7 +9,7 @@ type __VLS_Slots = {} & {
|
|
|
9
9
|
} & {
|
|
10
10
|
content?: (props: typeof __VLS_12) => any;
|
|
11
11
|
};
|
|
12
|
-
declare const __VLS_component: import("vue").DefineComponent<Props,
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
13
13
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
14
|
export default _default;
|
|
15
15
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -21,7 +21,7 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
} & {
|
|
22
22
|
footer?: (props: typeof __VLS_24) => any;
|
|
23
23
|
};
|
|
24
|
-
declare const __VLS_component: import("vue").DefineComponent<Props,
|
|
24
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
25
|
open: () => any;
|
|
26
26
|
close: () => any;
|
|
27
27
|
"update:modelValue": (args_0: boolean) => any;
|
|
@@ -12,7 +12,7 @@ type __VLS_Slots = {} & {
|
|
|
12
12
|
} & {
|
|
13
13
|
default?: (props: typeof __VLS_7) => any;
|
|
14
14
|
};
|
|
15
|
-
declare const __VLS_component: import("vue").DefineComponent<Props,
|
|
15
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
16
16
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
17
17
|
export default _default;
|
|
18
18
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -9,7 +9,7 @@ declare var __VLS_6: {};
|
|
|
9
9
|
type __VLS_Slots = {} & {
|
|
10
10
|
default?: (props: typeof __VLS_6) => any;
|
|
11
11
|
};
|
|
12
|
-
declare const __VLS_component: import("vue").DefineComponent<Props,
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
13
13
|
size: ComponentSizeWithXs;
|
|
14
14
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
15
15
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|