pxd 0.1.3 → 0.1.4
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/_internal/dismiss-container.vue +1 -1
- package/dist/components/_internal/mention-editor.d.vue.ts +1 -1
- package/dist/components/_internal/mention-editor.vue +2 -2
- package/dist/components/_internal/step-item.vue +1 -1
- package/dist/components/_internal/tree-node.d.vue.ts +3 -0
- package/dist/components/_internal/tree-node.vue +16 -7
- package/dist/components/active-graph/index.vue +1 -1
- package/dist/components/avatar/index.d.vue.ts +2 -2
- package/dist/components/avatar/index.vue +1 -1
- package/dist/components/backtop/index.vue +1 -1
- package/dist/components/badge/index.vue +3 -3
- package/dist/components/browser/index.vue +1 -1
- package/dist/components/bubble/index.vue +5 -5
- package/dist/components/button/index.d.vue.ts +1 -1
- package/dist/components/button/index.vue +6 -5
- package/dist/components/button/types.d.ts +1 -1
- package/dist/components/button-group/types.d.ts +1 -1
- package/dist/components/calendar/index.vue +5 -5
- package/dist/components/card/index.vue +2 -2
- package/dist/components/carousel/index.d.vue.ts +0 -1
- package/dist/components/carousel/index.vue +22 -17
- package/dist/components/carousel/types.d.ts +0 -1
- package/dist/components/checkbox/index.vue +1 -1
- package/dist/components/choicebox-item/index.vue +2 -2
- package/dist/components/code-block/index.d.vue.ts +22 -0
- package/dist/components/code-block/index.vue +166 -0
- package/dist/components/code-block/types.d.ts +14 -0
- package/dist/components/command-menu/index.d.vue.ts +1 -1
- package/dist/components/command-menu/index.vue +1 -2
- package/dist/components/config-provider/index.d.vue.ts +4 -0
- package/dist/components/confirm-popover/index.d.vue.ts +7 -8
- package/dist/components/confirm-popover/index.vue +36 -10
- package/dist/components/confirm-popover/types.d.ts +2 -0
- package/dist/components/copy-button/index.vue +1 -5
- package/dist/components/date-picker/index.vue +1 -1
- package/dist/components/description/index.vue +1 -1
- package/dist/components/drawer/index.d.vue.ts +3 -3
- package/dist/components/drawer/index.vue +9 -15
- package/dist/components/ellipsis-text/index.vue +1 -1
- package/dist/components/error/index.vue +2 -2
- package/dist/components/image-preview/index.d.vue.ts +38 -0
- package/dist/components/image-preview/index.vue +351 -0
- package/dist/components/image-preview/types.d.ts +18 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/input/index.vue +5 -4
- package/dist/components/kbd/index.vue +1 -1
- package/dist/components/list-group/index.vue +7 -1
- package/dist/components/list-item/index.vue +21 -8
- package/dist/components/marquee/index.vue +6 -2
- package/dist/components/mention/index.d.vue.ts +1 -1
- package/dist/components/message/index.vue +1 -1
- package/dist/components/modal/index.d.vue.ts +2 -2
- package/dist/components/modal/index.vue +9 -15
- package/dist/components/note/index.vue +1 -1
- package/dist/components/number-input/index.vue +6 -6
- package/dist/components/overlay/index.d.vue.ts +0 -1
- package/dist/components/overlay/index.vue +2 -8
- package/dist/components/overlay/types.d.ts +1 -2
- package/dist/components/pagination/index.vue +4 -4
- package/dist/components/pin-input/index.d.vue.ts +1 -1
- package/dist/components/pin-input/index.vue +5 -1
- package/dist/components/popover/index.vue +26 -21
- package/dist/components/popover/types.d.ts +1 -0
- package/dist/components/project-banner/index.vue +22 -9
- package/dist/components/questionnaire/index.vue +1 -1
- package/dist/components/resizable/index.d.vue.ts +5 -0
- package/dist/components/resizable/index.vue +256 -107
- package/dist/components/resizable/types.d.ts +6 -0
- package/dist/components/select/index.vue +4 -2
- package/dist/components/skeleton/index.d.vue.ts +1 -1
- package/dist/components/swipe-cell/index.vue +1 -1
- package/dist/components/switch/index.vue +1 -1
- package/dist/components/tabs/index.vue +1 -1
- package/dist/components/teleport/index.vue +20 -22
- package/dist/components/textarea/index.vue +1 -0
- package/dist/components/time-picker/index.vue +4 -4
- package/dist/components/toc/index.vue +1 -1
- package/dist/components/todo-list/index.d.vue.ts +1 -1
- package/dist/components/toggle/index.vue +2 -2
- package/dist/components/toggle-button/index.vue +11 -5
- package/dist/components/toggle-button/types.d.ts +3 -2
- package/dist/components/toggle-button-group/index.vue +1 -0
- package/dist/components/toggle-button-group/types.d.ts +2 -2
- package/dist/components/tour/index.vue +3 -3
- package/dist/components/tree/index.d.vue.ts +18 -15
- package/dist/components/tree/index.vue +102 -77
- package/dist/components/tree/types.d.ts +4 -0
- package/dist/composables/_internal/use-code-highlight.d.ts +12 -0
- package/dist/composables/_internal/use-code-highlight.js +47 -0
- package/dist/composables/_internal/use-lock-scroll.js +5 -22
- package/dist/composables/_internal/use-overlay-manager.d.ts +0 -1
- package/dist/composables/_internal/use-overlay-manager.js +2 -18
- package/dist/composables/_internal/use-popover-responsive.js +9 -12
- package/dist/composables/_internal/use-swipe-gesture.d.ts +1 -1
- package/dist/composables/_internal/use-swipe-gesture.js +5 -4
- package/dist/composables/_internal/use-tailwind-variant.js +1 -1
- package/dist/composables/use-media-query.d.ts +3 -1
- package/dist/composables/use-media-query.js +33 -51
- package/dist/composables/use-outside-click.d.ts +2 -1
- package/dist/composables/use-outside-click.js +3 -7
- package/dist/composables/use-repeat-action.d.ts +1 -1
- package/dist/composables/use-repeat-action.js +3 -3
- package/dist/constants/size.d.ts +1 -0
- package/dist/constants/size.js +7 -6
- package/dist/constants/tooltip-variants.d.ts +1 -1
- package/dist/constants/tooltip-variants.js +1 -1
- package/dist/locales/en-us.d.ts +4 -0
- package/dist/locales/en-us.js +4 -0
- package/dist/locales/zh-cn.d.ts +4 -0
- package/dist/locales/zh-cn.js +4 -0
- package/dist/styles/styles.css +1 -1
- package/dist/styles/tw.css +12 -7
- package/dist/utils/_internal/cn-tables.d.ts +27 -0
- package/dist/utils/_internal/cn-tables.js +131 -0
- package/dist/utils/cn.d.ts +1 -0
- package/dist/utils/cn.js +3 -0
- package/package.json +6 -4
- package/volar.d.ts +2 -0
|
@@ -39,7 +39,7 @@ const modelValue = useModelValue(props, emits);
|
|
|
39
39
|
useSwipeGesture(containerRef, {
|
|
40
40
|
handleSelector: ".pxd-dismiss-container--handle",
|
|
41
41
|
swipeThreshold: 0,
|
|
42
|
-
|
|
42
|
+
enabled: () => !props.disabled,
|
|
43
43
|
axis: gestureAxis,
|
|
44
44
|
onPress: ({ size }) => {
|
|
45
45
|
caf(releaseAnimationId);
|
|
@@ -33,9 +33,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
33
33
|
}) => any) | undefined;
|
|
34
34
|
}>, {
|
|
35
35
|
size: ComponentSize;
|
|
36
|
+
placeholder: string;
|
|
36
37
|
disabled: boolean;
|
|
37
38
|
modelValue: string;
|
|
38
|
-
placeholder: string;
|
|
39
39
|
triggers: string[];
|
|
40
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
41
|
declare const _default: typeof __VLS_export;
|
|
@@ -44,8 +44,8 @@ const emits = defineEmits([
|
|
|
44
44
|
const editorRef = shallowRef();
|
|
45
45
|
const inputHeightClasses = computed(() => {
|
|
46
46
|
return {
|
|
47
|
-
sm: `${BASIC_MIN_HEIGHTS.sm} py-
|
|
48
|
-
md: `${BASIC_MIN_HEIGHTS.md} py-[.46875rem]`,
|
|
47
|
+
sm: `${BASIC_MIN_HEIGHTS.sm} py-[0.3125rem]`,
|
|
48
|
+
md: `${BASIC_MIN_HEIGHTS.md} py-[0.46875rem]`,
|
|
49
49
|
lg: `${BASIC_MIN_HEIGHTS.lg} py-2.75`
|
|
50
50
|
};
|
|
51
51
|
});
|
|
@@ -66,7 +66,7 @@ function onClick() {
|
|
|
66
66
|
>
|
|
67
67
|
<slot>
|
|
68
68
|
<div
|
|
69
|
-
class="pxd-steps-item--title font-medium text-(length:--steps-title-font-size)
|
|
69
|
+
class="pxd-steps-item--title font-medium text-(length:--steps-title-font-size) text-foreground-secondary group-data-[status=error]/steps-item:text-red-700 group-data-[status=process]/steps-item:text-foreground motion-safe:transition-colors"
|
|
70
70
|
>
|
|
71
71
|
{{ option.title }}
|
|
72
72
|
</div>
|
|
@@ -14,6 +14,8 @@ type __VLS_Props = {
|
|
|
14
14
|
multiple: boolean;
|
|
15
15
|
disabled: boolean;
|
|
16
16
|
selectable: boolean;
|
|
17
|
+
showSwitcher: boolean;
|
|
18
|
+
showCheckbox: boolean;
|
|
17
19
|
setSize: number;
|
|
18
20
|
indent: number;
|
|
19
21
|
id: string;
|
|
@@ -31,6 +33,7 @@ declare var __VLS_1: {
|
|
|
31
33
|
}, __VLS_23: {
|
|
32
34
|
node: TreeOption;
|
|
33
35
|
depth: number;
|
|
36
|
+
loading: boolean;
|
|
34
37
|
expanded: boolean;
|
|
35
38
|
hasChildren: boolean;
|
|
36
39
|
}, __VLS_25: {
|
|
@@ -61,6 +61,14 @@ const props = defineProps({
|
|
|
61
61
|
type: Boolean,
|
|
62
62
|
required: true
|
|
63
63
|
},
|
|
64
|
+
showSwitcher: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
required: true
|
|
67
|
+
},
|
|
68
|
+
showCheckbox: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
required: true
|
|
71
|
+
},
|
|
64
72
|
setSize: {
|
|
65
73
|
type: Number,
|
|
66
74
|
required: true
|
|
@@ -112,7 +120,7 @@ const checkboxClass = computed(() => {
|
|
|
112
120
|
}
|
|
113
121
|
return unavailable.value ? "border-gray-500 bg-gray-100 cursor-not-allowed" : "border-gray-alpha-400 bg-background-100";
|
|
114
122
|
});
|
|
115
|
-
const indentSize = computed(() => props.depth * props.indent
|
|
123
|
+
const indentSize = computed(() => Math.max(props.depth * props.indent, 8));
|
|
116
124
|
const parts = computed(() => {
|
|
117
125
|
const query = props.highlightQuery;
|
|
118
126
|
if (!query) {
|
|
@@ -169,7 +177,7 @@ function onPointerdown(event) {
|
|
|
169
177
|
:aria-posinset="index + 1"
|
|
170
178
|
:aria-disabled="disabled || void 0"
|
|
171
179
|
:style="{ paddingInlineStart: indentSize + 'px', '--node-indent': indentSize + 'px' }"
|
|
172
|
-
class="pxd-tree--node group/row min-h-8 py-1 pe-2 gap-1
|
|
180
|
+
class="pxd-tree--node group/row min-h-8 py-1 pe-2 gap-1 text-sm relative flex w-full max-w-full cursor-pointer items-center rounded-md text-foreground outline-none select-none hover:bg-gray-100"
|
|
173
181
|
:class="[
|
|
174
182
|
itemClass,
|
|
175
183
|
{
|
|
@@ -189,7 +197,7 @@ function onPointerdown(event) {
|
|
|
189
197
|
@dragstart.prevent
|
|
190
198
|
>
|
|
191
199
|
<span
|
|
192
|
-
v-if="hasChildren"
|
|
200
|
+
v-if="showSwitcher && hasChildren"
|
|
193
201
|
data-tree-switcher
|
|
194
202
|
class="pxd-tree--switcher size-4 relative inline-flex shrink-0 items-center justify-center rounded-sm motion-safe:after:transition-colors"
|
|
195
203
|
@click.stop="emits('toggle', value)"
|
|
@@ -209,10 +217,10 @@ function onPointerdown(event) {
|
|
|
209
217
|
/>
|
|
210
218
|
</slot>
|
|
211
219
|
</span>
|
|
212
|
-
<span v-else aria-hidden="true" class="pxd-tree--switcher size-4 shrink-0" />
|
|
220
|
+
<span v-else-if="showSwitcher" aria-hidden="true" class="pxd-tree--switcher size-4 shrink-0" />
|
|
213
221
|
|
|
214
222
|
<span
|
|
215
|
-
v-if="multiple"
|
|
223
|
+
v-if="multiple && showCheckbox"
|
|
216
224
|
aria-hidden="true"
|
|
217
225
|
:data-selectable="selectable"
|
|
218
226
|
class="pxd-tree--checkbox size-4 p-0.5 inline-flex shrink-0 items-center justify-center overflow-hidden rounded-sm border text-primary-foreground"
|
|
@@ -233,12 +241,13 @@ function onPointerdown(event) {
|
|
|
233
241
|
name="node-icon"
|
|
234
242
|
:node="node"
|
|
235
243
|
:depth="depth"
|
|
244
|
+
:loading="loading"
|
|
236
245
|
:expanded="expanded"
|
|
237
246
|
:has-children="hasChildren"
|
|
238
247
|
/>
|
|
239
248
|
</span>
|
|
240
249
|
|
|
241
|
-
<span class="pxd-tree--content min-w-0 flex-1 truncate">
|
|
250
|
+
<span class="pxd-tree--content min-w-0 pl-0.5 flex-1 truncate">
|
|
242
251
|
<slot
|
|
243
252
|
name="node-content"
|
|
244
253
|
:node="node"
|
|
@@ -264,5 +273,5 @@ function onPointerdown(event) {
|
|
|
264
273
|
</template>
|
|
265
274
|
|
|
266
275
|
<style>
|
|
267
|
-
.pxd-tree--switcher.relative:after{border-radius:inherit;content:"";height:
|
|
276
|
+
.pxd-tree--switcher.relative:after{border-radius:inherit;content:"";height:125%;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:125%}.pxd-tree--switcher.relative:hover:after{background-color:var(--color-gray-alpha-100)}
|
|
268
277
|
</style>
|
|
@@ -500,7 +500,7 @@ onBeforeUnmount(() => {
|
|
|
500
500
|
<Transition v-if="tooltip" name="pxd-transition--fade" mode="out-in" appear>
|
|
501
501
|
<div
|
|
502
502
|
v-if="showTooltip"
|
|
503
|
-
class="pxd-active-graph--tooltip left-0 top-0 px-2 py-1 shadow-lg pointer-events-none absolute z-1 w-max rounded-sm bg-gray-1000 text-
|
|
503
|
+
class="pxd-active-graph--tooltip left-0 top-0 px-2 py-1 shadow-lg pointer-events-none absolute z-1 w-max rounded-sm bg-gray-1000 text-13px text-gray-100"
|
|
504
504
|
:style="`transform: translate(${tooltipInfo.left}px, ${tooltipInfo.top}px);`"
|
|
505
505
|
>
|
|
506
506
|
<slot name="tooltip" :data="tooltipInfo"
|
|
@@ -9,12 +9,12 @@ type __VLS_Slots = {} & {
|
|
|
9
9
|
declare const __VLS_base: import("vue").DefineComponent<AvatarProps, {
|
|
10
10
|
getLoadingStatus: typeof getLoadingStatus;
|
|
11
11
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
-
error: (args_0: Event) => any;
|
|
13
12
|
load: (args_0: Event) => any;
|
|
13
|
+
error: (args_0: Event) => any;
|
|
14
14
|
loadstart: (args_0: Event) => any;
|
|
15
15
|
}, string, import("vue").PublicProps, Readonly<AvatarProps> & Readonly<{
|
|
16
|
-
onError?: ((args_0: Event) => any) | undefined;
|
|
17
16
|
onLoad?: ((args_0: Event) => any) | undefined;
|
|
17
|
+
onError?: ((args_0: Event) => any) | undefined;
|
|
18
18
|
onLoadstart?: ((args_0: Event) => any) | undefined;
|
|
19
19
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
20
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -58,7 +58,7 @@ defineExpose({ getLoadingStatus });
|
|
|
58
58
|
<template>
|
|
59
59
|
<div
|
|
60
60
|
data-avatar
|
|
61
|
-
class="pxd-avatar relative inline-flex size-(--avatar-size) items-center justify-center rounded-full bg-background-100 text-
|
|
61
|
+
class="pxd-avatar relative inline-flex size-(--avatar-size) items-center justify-center rounded-full bg-background-100 text-13px select-none before:default-animation-timing-function! after:border after:border-gray-alpha-300 motion-reduce:before:animate-none!"
|
|
62
62
|
:style="{ '--avatar-size': computedSize }"
|
|
63
63
|
:data-placeholder="placeholder"
|
|
64
64
|
v-bind="$attrs"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import ArrowUpIcon from "@gdsicon/vue/arrow-up";
|
|
3
3
|
import { computed, onBeforeUnmount, onMounted, shallowRef } from "vue";
|
|
4
|
-
import { useMotionReduced } from "../../composables/use-motion-reduce.js";
|
|
5
4
|
import { useTailwindVariant } from "../../composables/_internal/use-tailwind-variant.js";
|
|
5
|
+
import { useMotionReduced } from "../../composables/use-motion-reduce.js";
|
|
6
6
|
import { getScrollTarget, getScrollElement, resolveScrollBehavior } from "../../utils/dom.js";
|
|
7
7
|
import { cachedOff, cachedOn, throttleByRaf } from "../../utils/event.js";
|
|
8
8
|
import PButton from "../button/index.vue";
|
|
@@ -37,7 +37,7 @@ const iconSlotClasses = createTailwindVariant({
|
|
|
37
37
|
base: "inline-flex shrink-0 items-center justify-center",
|
|
38
38
|
variants: {
|
|
39
39
|
size: {
|
|
40
|
-
sm: "w-3 h-3 p-0.5 text-
|
|
40
|
+
sm: "w-3 h-3 p-0.5 text-11px",
|
|
41
41
|
md: "w-4 h-4 text-xs",
|
|
42
42
|
lg: "w-5 h-5 text-sm"
|
|
43
43
|
},
|
|
@@ -112,7 +112,7 @@ const { attrs, classes } = useTailwindVariant({
|
|
|
112
112
|
rounded: "rounded-full"
|
|
113
113
|
},
|
|
114
114
|
size: {
|
|
115
|
-
sm: "px-1.5 h-5 text-
|
|
115
|
+
sm: "px-1.5 h-5 text-10px",
|
|
116
116
|
md: "px-2.5 h-6 text-xs",
|
|
117
117
|
lg: "px-3 h-8 text-sm"
|
|
118
118
|
}
|
|
@@ -145,7 +145,7 @@ function onClose(ev) {
|
|
|
145
145
|
:class="iconSlotClasses({ size: computedSize, slot: 'suffix' })"
|
|
146
146
|
@click.stop="onClose"
|
|
147
147
|
>
|
|
148
|
-
<CrossIcon
|
|
148
|
+
<CrossIcon />
|
|
149
149
|
</button>
|
|
150
150
|
</Component>
|
|
151
151
|
</template>
|
|
@@ -44,7 +44,7 @@ defineProps({ address: {
|
|
|
44
44
|
>
|
|
45
45
|
<LockClosedIcon class="text-sm text-foreground-secondary" />
|
|
46
46
|
|
|
47
|
-
<div class="ps-1.5 min-w-0 flex-1 truncate text-center text-
|
|
47
|
+
<div class="ps-1.5 min-w-0 flex-1 truncate text-center text-13px text-gray-1000">
|
|
48
48
|
{{ address }}
|
|
49
49
|
</div>
|
|
50
50
|
|
|
@@ -91,17 +91,17 @@ const { classes: contentClasses } = useTailwindVariant({
|
|
|
91
91
|
<div class="pxd-bubble--wrapper text-sm gap-1 flex w-max flex-col">
|
|
92
92
|
<header
|
|
93
93
|
v-if="header || $slots.header"
|
|
94
|
-
class="pxd-bubble--header flex items-center text-
|
|
94
|
+
class="pxd-bubble--header flex items-center text-13px text-foreground-secondary group-data-[role=user]/bubble:justify-end"
|
|
95
95
|
>
|
|
96
|
-
<slot name="header">
|
|
97
|
-
{{ header }}
|
|
98
|
-
</slot>
|
|
96
|
+
<slot name="header">{{ header }}</slot>
|
|
99
97
|
</header>
|
|
100
98
|
|
|
101
99
|
<div :class="contentClasses">
|
|
102
100
|
<PSpinner v-if="loading" class="translate-y-0.5" />
|
|
103
101
|
<template v-else>
|
|
104
|
-
<slot>
|
|
102
|
+
<slot>
|
|
103
|
+
<span>{{ text }}</span>
|
|
104
|
+
</slot>
|
|
105
105
|
<div
|
|
106
106
|
v-if="$slots.reactions"
|
|
107
107
|
class="pxd-bubble--reactions mbs-1.5 gap-1.5 flex items-center"
|
|
@@ -8,9 +8,9 @@ type __VLS_Slots = {} & {
|
|
|
8
8
|
suffix?: (props: typeof __VLS_16) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_base: import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
|
|
11
|
+
icon: boolean;
|
|
11
12
|
as: import("../../types/shared/props.js").ComponentAs;
|
|
12
13
|
shape: import("../../types/shared/props.js").ComponentShape;
|
|
13
|
-
icon: boolean;
|
|
14
14
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
15
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
16
|
declare const _default: typeof __VLS_export;
|
|
@@ -66,7 +66,7 @@ const btnContentClasses = computed(() => {
|
|
|
66
66
|
right: "justify-end"
|
|
67
67
|
}[internalAlign || buttonGroupContext?.props.align || "center"];
|
|
68
68
|
return {
|
|
69
|
-
"px-1
|
|
69
|
+
"px-1": !icon,
|
|
70
70
|
[alignClasses]: true
|
|
71
71
|
};
|
|
72
72
|
});
|
|
@@ -74,10 +74,11 @@ const { attrs, classes } = useTailwindVariant({
|
|
|
74
74
|
base: "pxd-button inline-flex shrink-0 cursor-pointer touch-manipulation items-center font-inherit select-none focus-visible:z-1 motion-safe:transition-appearance within-group:not-first:rounded-l-none within-group:not-first:border-l-0 within-group:not-last:rounded-r-none",
|
|
75
75
|
variants: {
|
|
76
76
|
size: {
|
|
77
|
+
xxs: `${BASIC_HEIGHTS.xxs} px-1 rounded-sm text-11px`,
|
|
77
78
|
xs: `${BASIC_HEIGHTS.xs} px-1 text-xs rounded-sm`,
|
|
78
|
-
sm: `${BASIC_HEIGHTS.sm} px-
|
|
79
|
-
md: `${BASIC_HEIGHTS.md} px-
|
|
80
|
-
lg: `${BASIC_HEIGHTS.lg} px-
|
|
79
|
+
sm: `${BASIC_HEIGHTS.sm} px-2 text-sm rounded-md`,
|
|
80
|
+
md: `${BASIC_HEIGHTS.md} px-3 text-sm rounded-md`,
|
|
81
|
+
lg: `${BASIC_HEIGHTS.lg} px-4 text-base rounded-lg`
|
|
81
82
|
},
|
|
82
83
|
shape: {
|
|
83
84
|
square: "rounded-none",
|
|
@@ -141,7 +142,7 @@ const { attrs, classes } = useTailwindVariant({
|
|
|
141
142
|
<PSpinner v-if="loading" />
|
|
142
143
|
<slot v-else name="prefix" />
|
|
143
144
|
|
|
144
|
-
<span class="
|
|
145
|
+
<span class="min-w-0 flex flex-1 items-center" :class="btnContentClasses">
|
|
145
146
|
<slot />
|
|
146
147
|
</span>
|
|
147
148
|
|
|
@@ -11,7 +11,7 @@ export type ButtonVariant = ComponentVariantWithDefault | 'ghost' | 'simple' | '
|
|
|
11
11
|
export interface ButtonProps {
|
|
12
12
|
as?: ComponentAs
|
|
13
13
|
variant?: ButtonVariant
|
|
14
|
-
size?: ComponentSizeWithXs
|
|
14
|
+
size?: ComponentSizeWithXs | 'xxs'
|
|
15
15
|
shape?: ComponentShape
|
|
16
16
|
align?: ComponentAlign
|
|
17
17
|
icon?: boolean
|
|
@@ -2,7 +2,7 @@ import type { ComponentSizeWithXs, ComponentAlign } from '../../types/shared/pro
|
|
|
2
2
|
import type { ButtonVariant } from '../button/types'
|
|
3
3
|
|
|
4
4
|
export interface ButtonGroupProps {
|
|
5
|
-
size?: ComponentSizeWithXs
|
|
5
|
+
size?: ComponentSizeWithXs | 'xxs'
|
|
6
6
|
align?: ComponentAlign
|
|
7
7
|
variant?: ButtonVariant
|
|
8
8
|
disabled?: boolean
|
|
@@ -168,7 +168,7 @@ watch(() => props.modelValue, (value) => {
|
|
|
168
168
|
</PButton>
|
|
169
169
|
<PButton
|
|
170
170
|
icon
|
|
171
|
-
size="
|
|
171
|
+
size="xs"
|
|
172
172
|
variant="ghost"
|
|
173
173
|
class="text-foreground-secondary"
|
|
174
174
|
aria-label="Previous month"
|
|
@@ -177,13 +177,13 @@ watch(() => props.modelValue, (value) => {
|
|
|
177
177
|
<ChevronRightIcon class="size-4 rotate-180" aria-hidden="true" />
|
|
178
178
|
</PButton>
|
|
179
179
|
|
|
180
|
-
<PButton size="
|
|
180
|
+
<PButton size="xs" class="px-0" @click="selectToday">
|
|
181
181
|
{{ configProvider.locale.date.today }}
|
|
182
182
|
</PButton>
|
|
183
183
|
|
|
184
184
|
<PButton
|
|
185
185
|
icon
|
|
186
|
-
size="
|
|
186
|
+
size="xs"
|
|
187
187
|
variant="ghost"
|
|
188
188
|
class="text-foreground-secondary"
|
|
189
189
|
aria-label="Next month"
|
|
@@ -193,7 +193,7 @@ watch(() => props.modelValue, (value) => {
|
|
|
193
193
|
</PButton>
|
|
194
194
|
<PButton
|
|
195
195
|
icon
|
|
196
|
-
size="
|
|
196
|
+
size="xs"
|
|
197
197
|
variant="ghost"
|
|
198
198
|
class="text-foreground-secondary"
|
|
199
199
|
aria-label="Next year"
|
|
@@ -212,7 +212,7 @@ watch(() => props.modelValue, (value) => {
|
|
|
212
212
|
v-for="weekDay in weekDays"
|
|
213
213
|
:key="weekDay"
|
|
214
214
|
class="pxd-calendar--grid-head text-xs font-medium text-gray-800"
|
|
215
|
-
:class="compact ? '
|
|
215
|
+
:class="compact ? 'py-1 text-center' : 'p-2 border-r border-b text-right'"
|
|
216
216
|
role="columnheader"
|
|
217
217
|
>
|
|
218
218
|
{{ weekDay }}
|
|
@@ -20,7 +20,7 @@ const { attrs, classes } = useTailwindVariant({
|
|
|
20
20
|
base: "pxd-card border bg-background-100",
|
|
21
21
|
variants: {
|
|
22
22
|
shape: {
|
|
23
|
-
default: "rounded-
|
|
23
|
+
default: "rounded-lg",
|
|
24
24
|
square: "rounded-none",
|
|
25
25
|
rounded: "rounded-xl"
|
|
26
26
|
},
|
|
@@ -37,7 +37,7 @@ const { attrs, classes } = useTailwindVariant({
|
|
|
37
37
|
<div v-if="$slots.header" class="pxd-card--header text-trim-both">
|
|
38
38
|
<slot name="header" />
|
|
39
39
|
</div>
|
|
40
|
-
<div class="pxd-card--content p-
|
|
40
|
+
<div class="pxd-card--content p-3 text-trim-both">
|
|
41
41
|
<slot />
|
|
42
42
|
</div>
|
|
43
43
|
<div v-if="$slots.footer" class="pxd-card--footer text-trim-both">
|
|
@@ -25,7 +25,6 @@ declare const __VLS_base: import("vue").DefineComponent<CarouselProps, {}, {}, {
|
|
|
25
25
|
interval: number;
|
|
26
26
|
indicator: boolean;
|
|
27
27
|
direction: import("../../types/shared/props.js").ComponentDirection;
|
|
28
|
-
indicatorType: "line" | "dot";
|
|
29
28
|
indicatorPosition: "center" | import("../../types/shared/props.js").BasePosition;
|
|
30
29
|
pauseOnHover: boolean;
|
|
31
30
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -49,11 +49,6 @@ const props = defineProps({
|
|
|
49
49
|
required: false,
|
|
50
50
|
default: "horizontal"
|
|
51
51
|
},
|
|
52
|
-
indicatorType: {
|
|
53
|
-
type: String,
|
|
54
|
-
required: false,
|
|
55
|
-
default: "dot"
|
|
56
|
-
},
|
|
57
52
|
indicatorPosition: {
|
|
58
53
|
type: String,
|
|
59
54
|
required: false,
|
|
@@ -78,11 +73,12 @@ const emits = defineEmits(["change"]);
|
|
|
78
73
|
let isToggling = false;
|
|
79
74
|
let pendingDelta = null;
|
|
80
75
|
let autoPlayTimerId = null;
|
|
81
|
-
let isPointerEntering = false;
|
|
82
76
|
let maxDrag = 0;
|
|
83
77
|
const sliderRef = shallowRef();
|
|
84
78
|
const virtualIndex = shallowRef(props.index);
|
|
85
79
|
const gestureMoveOffset = shallowRef(0);
|
|
80
|
+
const isAutoPlayPaused = shallowRef(false);
|
|
81
|
+
const progressKey = shallowRef(0);
|
|
86
82
|
const slideCount = computed(() => props.options.length);
|
|
87
83
|
const displayIndex = computed(() => {
|
|
88
84
|
const length = slideCount.value;
|
|
@@ -102,7 +98,8 @@ const computedStyle = computed(() => {
|
|
|
102
98
|
const rootStyle = computed(() => {
|
|
103
99
|
return {
|
|
104
100
|
height: getCssUnitValue(props.height),
|
|
105
|
-
"--carousel-item-count": slideCount.value
|
|
101
|
+
"--carousel-item-count": slideCount.value,
|
|
102
|
+
"--carousel-progress-duration": `${props.interval}ms`
|
|
106
103
|
};
|
|
107
104
|
});
|
|
108
105
|
const loopPlacement = computed(() => {
|
|
@@ -224,21 +221,22 @@ function clearAutoPlayTimer() {
|
|
|
224
221
|
}
|
|
225
222
|
function restartAutoPlay() {
|
|
226
223
|
clearAutoPlayTimer();
|
|
227
|
-
if (!props.autoplay ||
|
|
224
|
+
if (!props.autoplay || isAutoPlayPaused.value) {
|
|
228
225
|
return;
|
|
229
226
|
}
|
|
227
|
+
progressKey.value++;
|
|
230
228
|
autoPlayTimerId = setTimeout(() => {
|
|
231
229
|
onToggleClick(1);
|
|
232
230
|
}, props.interval);
|
|
233
231
|
}
|
|
234
232
|
function onPointerEnter() {
|
|
235
233
|
if (props.pauseOnHover) {
|
|
236
|
-
|
|
234
|
+
isAutoPlayPaused.value = true;
|
|
237
235
|
clearAutoPlayTimer();
|
|
238
236
|
}
|
|
239
237
|
}
|
|
240
238
|
function onPointerLeave() {
|
|
241
|
-
|
|
239
|
+
isAutoPlayPaused.value = false;
|
|
242
240
|
restartAutoPlay();
|
|
243
241
|
}
|
|
244
242
|
function onIndicatorClick(ev) {
|
|
@@ -267,7 +265,8 @@ onBeforeUnmount(() => {
|
|
|
267
265
|
data-carousel
|
|
268
266
|
v-bind="$attrs"
|
|
269
267
|
:data-orientation="direction"
|
|
270
|
-
:data-
|
|
268
|
+
:data-autoplay="autoplay"
|
|
269
|
+
:data-autoplay-paused="isAutoPlayPaused || void 0"
|
|
271
270
|
:data-indicator-position="indicatorPosition"
|
|
272
271
|
:data-loop-placement="loopPlacement"
|
|
273
272
|
class="pxd-carousel group relative w-full touch-none overflow-hidden"
|
|
@@ -303,9 +302,15 @@ onBeforeUnmount(() => {
|
|
|
303
302
|
v-for="(_, i) in slideCount"
|
|
304
303
|
:key="i"
|
|
305
304
|
:data-index="i"
|
|
306
|
-
class="pxd-carousel--indicator-item
|
|
307
|
-
:class="
|
|
308
|
-
|
|
305
|
+
class="pxd-carousel--indicator-item h-2 relative cursor-pointer appearance-none rounded-full bg-gray-alpha-200 font-inherit self-focus-ring outline-none hover:bg-gray-alpha-400 motion-safe:transition-[width,background-color]"
|
|
306
|
+
:class="i === displayIndex ? 'w-8' : 'w-2'"
|
|
307
|
+
>
|
|
308
|
+
<span
|
|
309
|
+
v-if="i === displayIndex"
|
|
310
|
+
:key="progressKey"
|
|
311
|
+
class="pxd-carousel--indicator-progress block h-full rounded-full bg-primary"
|
|
312
|
+
/>
|
|
313
|
+
</button>
|
|
309
314
|
</slot>
|
|
310
315
|
</div>
|
|
311
316
|
|
|
@@ -317,7 +322,7 @@ onBeforeUnmount(() => {
|
|
|
317
322
|
class="pxd-carousel--prev-btn p-1.5 pointer-events-auto cursor-pointer appearance-none rounded-md bg-gray-alpha-100 font-inherit text-foreground-secondary self-focus-ring outline-none enabled:hover:bg-background-hover enabled:active:bg-background-active disabled:cursor-not-allowed disabled:opacity-50 motion-safe:transition-colors"
|
|
318
323
|
@click="onToggleClick(-1)"
|
|
319
324
|
>
|
|
320
|
-
<ChevronRightIcon class="
|
|
325
|
+
<ChevronRightIcon class="rotate-180" />
|
|
321
326
|
</button>
|
|
322
327
|
|
|
323
328
|
<button
|
|
@@ -327,12 +332,12 @@ onBeforeUnmount(() => {
|
|
|
327
332
|
class="pxd-carousel--next-btn p-1.5 pointer-events-auto cursor-pointer appearance-none rounded-md bg-gray-alpha-100 font-inherit text-foreground-secondary self-focus-ring outline-none enabled:hover:bg-background-hover enabled:active:bg-background-active disabled:cursor-not-allowed disabled:opacity-50 motion-safe:transition-colors"
|
|
328
333
|
@click="onToggleClick(1)"
|
|
329
334
|
>
|
|
330
|
-
<ChevronRightIcon
|
|
335
|
+
<ChevronRightIcon />
|
|
331
336
|
</button>
|
|
332
337
|
</div>
|
|
333
338
|
</div>
|
|
334
339
|
</template>
|
|
335
340
|
|
|
336
341
|
<style>
|
|
337
|
-
.pxd-carousel[data-indicator-
|
|
342
|
+
.pxd-carousel[data-indicator-position=top] .pxd-carousel--indicator{left:.75rem;top:.5rem}.pxd-carousel[data-indicator-position=top] .pxd-carousel--toggler{right:.5rem;top:.5rem}.pxd-carousel[data-indicator-position=bottom] .pxd-carousel--indicator{bottom:.5rem;left:.75rem}.pxd-carousel[data-indicator-position=bottom] .pxd-carousel--toggler{bottom:.5rem;right:.5rem}.pxd-carousel[data-indicator-position=left] .pxd-carousel--indicator{left:.5rem;top:.75rem}.pxd-carousel[data-indicator-position=left] .pxd-carousel--toggler{bottom:.5rem;left:.5rem}.pxd-carousel[data-indicator-position=right] .pxd-carousel--indicator{right:.5rem;top:.75rem}.pxd-carousel[data-indicator-position=right] .pxd-carousel--toggler{bottom:.5rem;right:.5rem}.pxd-carousel[data-indicator-position=center] .pxd-carousel--indicator{bottom:.5rem;left:50%;transform:translateX(-50%)}.pxd-carousel[data-indicator-position=center] .pxd-carousel--toggler{justify-content:space-between;left:0;padding-inline:1rem;top:50%;transform:translateY(-50%);width:100%}.pxd-carousel[data-indicator-position=left] .pxd-carousel--indicator,.pxd-carousel[data-indicator-position=left] .pxd-carousel--toggler,.pxd-carousel[data-indicator-position=right] .pxd-carousel--indicator,.pxd-carousel[data-indicator-position=right] .pxd-carousel--toggler{flex-direction:column}.pxd-carousel[data-orientation=horizontal] .pxd-carousel--slider{display:flex}.pxd-carousel[data-loop-placement=end] .pxd-carousel-item:first-child{transform:translateX(calc(var(--carousel-item-count)*100%))}.pxd-carousel[data-loop-placement=start] .pxd-carousel-item:last-child{transform:translateX(calc(var(--carousel-item-count)*-100%))}.pxd-carousel[data-orientation=vertical][data-loop-placement=end] .pxd-carousel-item:first-child{transform:translateY(calc(var(--carousel-item-count)*100%))}.pxd-carousel[data-orientation=vertical][data-loop-placement=start] .pxd-carousel-item:last-child{transform:translateY(calc(var(--carousel-item-count)*-100%))}.pxd-carousel[data-orientation=vertical] .pxd-carousel--next-btn,.pxd-carousel[data-orientation=vertical] .pxd-carousel--prev-btn{transform:rotate(90deg)}.pxd-carousel[data-autoplay=false] .pxd-carousel--indicator-progress{animation:none;width:100%}.pxd-carousel[data-autoplay-paused] .pxd-carousel--indicator-progress,.pxd-carousel[data-autoplay=false] .pxd-carousel--indicator-progress{animation-play-state:paused}.pxd-carousel--indicator-item:before{content:"";inset:-.25rem;position:absolute}.pxd-carousel--indicator-progress{animation:pxd-carousel-indicator-progress var(--carousel-progress-duration) linear forwards;width:0}@keyframes pxd-carousel-indicator-progress{0%{width:0}to{width:100%}}
|
|
338
343
|
</style>
|
|
@@ -66,7 +66,7 @@ const isSelected = computed(() => {
|
|
|
66
66
|
return modelValue.value === props.value;
|
|
67
67
|
});
|
|
68
68
|
const { classes } = useTailwindVariant({
|
|
69
|
-
base: "pxd-checkbox--inner size-4 p-0.5
|
|
69
|
+
base: "pxd-checkbox--inner size-4 p-0.5 inline-flex shrink-0 transform-gpu items-center justify-center overflow-hidden border text-primary-foreground peer-focus-ring motion-safe:transition-colors",
|
|
70
70
|
variants: {
|
|
71
71
|
checked: {},
|
|
72
72
|
disabled: {},
|
|
@@ -69,7 +69,7 @@ const { attrs, classes } = useTailwindVariant({
|
|
|
69
69
|
selected: isSelected.value
|
|
70
70
|
}) });
|
|
71
71
|
const { classes: innerClasses } = useTailwindVariant({
|
|
72
|
-
base: "pxd-choicebox-item--inner size-4 p-0.5
|
|
72
|
+
base: "pxd-choicebox-item--inner size-4 p-0.5 order-2 inline-flex shrink-0 transform-gpu items-center justify-center overflow-hidden border text-primary-foreground peer-focus-ring motion-safe:transition-colors",
|
|
73
73
|
variants: {
|
|
74
74
|
disabled: {},
|
|
75
75
|
multiple: {
|
|
@@ -182,5 +182,5 @@ function onInputChange(event) {
|
|
|
182
182
|
</template>
|
|
183
183
|
|
|
184
184
|
<style>
|
|
185
|
-
.pxd-choicebox-item[aria-selected=true] .pxd-choicebox-item--option{background-color:hsla(var(--primary),.
|
|
185
|
+
.pxd-choicebox-item[aria-selected=true] .pxd-choicebox-item--option{background-color:hsla(var(--primary),.1)}.pxd-choicebox-item[aria-selected=true] .pxd-choicebox-item--description,.pxd-choicebox-item[aria-selected=true] .pxd-choicebox-item--label{color:var(--color-primary)}
|
|
186
186
|
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CodeBlockProps } from './types';
|
|
2
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
header?: (props: typeof __VLS_1) => any;
|
|
5
|
+
} & {
|
|
6
|
+
actions?: (props: typeof __VLS_3) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<CodeBlockProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
copy: (args_0: string) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<CodeBlockProps> & Readonly<{
|
|
11
|
+
onCopy?: ((args_0: string) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
copyBtn: "hidden" | "always" | "hover";
|
|
14
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|