pxd 0.0.52 → 0.0.53
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/README.md +6 -3
- package/dist/components/active-graph/index.d.vue.ts +0 -2
- package/dist/components/active-graph/index.vue +35 -37
- package/dist/components/avatar/index.d.vue.ts +2 -2
- package/dist/components/avatar/index.vue +17 -16
- package/dist/components/avatar-group/index.d.vue.ts +1 -1
- package/dist/components/avatar-group/index.vue +4 -1
- package/dist/components/badge/cn.d.ts +90 -0
- package/dist/components/badge/cn.js +44 -0
- package/dist/components/badge/index.d.vue.ts +5 -33
- package/dist/components/badge/index.vue +10 -56
- package/dist/components/book/index.vue +90 -17
- package/dist/components/browser/index.vue +21 -6
- package/dist/components/button/cn.d.ts +121 -0
- package/dist/components/button/cn.js +55 -0
- package/dist/components/button/index.d.vue.ts +8 -14
- package/dist/components/button/index.vue +22 -74
- package/dist/components/carousel-group/index.d.vue.ts +1 -1
- package/dist/components/carousel-group/index.vue +32 -28
- package/dist/components/checkbox/cn.d.ts +67 -0
- package/dist/components/checkbox/cn.js +31 -0
- package/dist/components/checkbox/index.vue +9 -19
- package/dist/components/chip/cn.d.ts +49 -0
- package/dist/components/chip/cn.js +26 -0
- package/dist/components/chip/index.vue +13 -21
- package/dist/components/choicebox/index.vue +1 -1
- package/dist/components/choicebox-group/index.vue +6 -3
- package/dist/components/collapse/index.vue +7 -1
- package/dist/components/collapse-group/index.vue +7 -7
- package/dist/components/command-menu/index.vue +9 -8
- package/dist/components/command-menu-group/index.vue +4 -1
- package/dist/components/config-provider/index.d.vue.ts +1 -0
- package/dist/components/config-provider/index.vue +2 -1
- package/dist/components/countdown/index.vue +2 -10
- package/dist/components/dash-line/index.vue +22 -16
- package/dist/components/description/index.vue +4 -2
- package/dist/components/drawer/index.vue +19 -11
- package/dist/components/empty-state/index.vue +3 -1
- package/dist/components/error/cn.d.ts +22 -0
- package/dist/components/error/cn.js +15 -0
- package/dist/components/error/index.vue +13 -14
- package/dist/components/fader/index.vue +30 -14
- package/dist/components/gauge/index.vue +6 -6
- package/dist/components/grid/index.vue +16 -12
- package/dist/components/grid-item/index.vue +4 -4
- package/dist/components/hold-button/index.vue +19 -13
- package/dist/components/input/cn.d.ts +73 -0
- package/dist/components/input/cn.js +36 -0
- package/dist/components/input/index.d.vue.ts +14 -16
- package/dist/components/input/index.vue +74 -101
- package/dist/components/intersection-observer/index.vue +7 -3
- package/dist/components/kbd/index.vue +2 -2
- package/dist/components/link-button/index.d.vue.ts +8 -8
- package/dist/components/link-button/index.vue +17 -25
- package/dist/components/list/index.d.vue.ts +0 -1
- package/dist/components/list/index.vue +58 -57
- package/dist/components/list-item/cn.d.ts +22 -0
- package/dist/components/list-item/cn.js +15 -0
- package/dist/components/list-item/index.d.vue.ts +3 -3
- package/dist/components/list-item/index.vue +14 -25
- package/dist/components/loading-bar/cn.d.ts +70 -0
- package/dist/components/loading-bar/cn.js +32 -0
- package/dist/components/loading-bar/index.d.vue.ts +2 -0
- package/dist/components/loading-bar/index.vue +68 -61
- package/dist/components/loading-dots/index.vue +12 -4
- package/dist/components/menu/index.d.vue.ts +2 -2
- package/dist/components/menu/index.vue +4 -4
- package/dist/components/message/index.vue +82 -48
- package/dist/components/message-item/index.vue +7 -2
- package/dist/components/modal/index.vue +20 -12
- package/dist/components/more-button/index.d.vue.ts +1 -3
- package/dist/components/more-button/index.vue +7 -17
- package/dist/components/note/cn.d.ts +121 -0
- package/dist/components/note/cn.js +66 -0
- package/dist/components/note/index.d.vue.ts +3 -39
- package/dist/components/note/index.vue +18 -37
- package/dist/components/number-input/index.d.vue.ts +19 -10
- package/dist/components/number-input/index.vue +121 -75
- package/dist/components/overlay/index.vue +4 -20
- package/dist/components/pagination/index.vue +25 -8
- package/dist/components/pin-input/cn.d.ts +46 -0
- package/dist/components/pin-input/cn.js +25 -0
- package/dist/components/pin-input/index.vue +11 -20
- package/dist/components/placeholder/index.vue +11 -4
- package/dist/components/popover/index.d.vue.ts +4 -3
- package/dist/components/popover/index.vue +107 -54
- package/dist/components/progress/cn.d.ts +19 -0
- package/dist/components/progress/cn.js +14 -0
- package/dist/components/progress/index.d.vue.ts +1 -1
- package/dist/components/progress/index.vue +21 -14
- package/dist/components/radio/cn.d.ts +46 -0
- package/dist/components/radio/cn.js +42 -0
- package/dist/components/radio/index.vue +11 -18
- package/dist/components/resizable/index.vue +8 -2
- package/dist/components/resizable-handle/index.vue +1 -0
- package/dist/components/resizable-panel/index.vue +12 -11
- package/dist/components/skeleton/cn.d.ts +43 -0
- package/dist/components/skeleton/cn.js +24 -0
- package/dist/components/skeleton/index.d.vue.ts +4 -3
- package/dist/components/skeleton/index.vue +11 -20
- package/dist/components/slider/index.d.vue.ts +1 -1
- package/dist/components/slider/index.vue +14 -12
- package/dist/components/snippet/cn.d.ts +52 -0
- package/dist/components/snippet/cn.js +27 -0
- package/dist/components/snippet/index.vue +21 -29
- package/dist/components/spinner/index.vue +3 -1
- package/dist/components/stack/cn.d.ts +70 -0
- package/dist/components/stack/cn.js +33 -0
- package/dist/components/stack/index.d.vue.ts +2 -2
- package/dist/components/stack/index.vue +16 -31
- package/dist/components/status-dot/index.vue +5 -1
- package/dist/components/switch/cn.d.ts +16 -0
- package/dist/components/switch/cn.js +13 -0
- package/dist/components/switch/index.vue +5 -11
- package/dist/components/switch-group/index.vue +7 -4
- package/dist/components/text/cn.d.ts +67 -0
- package/dist/components/text/cn.js +34 -0
- package/dist/components/text/index.d.vue.ts +1 -1
- package/dist/components/text/index.vue +16 -25
- package/dist/components/textarea/cn.d.ts +58 -0
- package/dist/components/textarea/cn.js +30 -0
- package/dist/components/textarea/index.d.vue.ts +2 -0
- package/dist/components/textarea/index.vue +17 -24
- package/dist/components/theme-switcher/index.vue +6 -3
- package/dist/components/time-picker/index.d.vue.ts +2 -2
- package/dist/components/time-picker/index.vue +45 -25
- package/dist/components/toggle/index.vue +10 -6
- package/dist/components/tooltip/index.vue +3 -3
- package/dist/components/virtual-list/index.vue +1 -7
- package/dist/composables/use-browser-observer.d.ts +1 -1
- package/dist/composables/use-browser-observer.js +19 -15
- package/dist/composables/use-config-provider-context.d.ts +1 -0
- package/dist/composables/use-config-provider-context.js +5 -10
- package/dist/composables/use-countdown.js +1 -3
- package/dist/composables/use-deferred-value.js +1 -5
- package/dist/composables/use-delay-change.js +1 -4
- package/dist/composables/use-delay-destroy.js +1 -5
- package/dist/composables/use-loading-bar.d.ts +6 -14
- package/dist/composables/use-loading-bar.js +3 -14
- package/dist/composables/use-message.d.ts +9 -3
- package/dist/composables/use-message.js +9 -9
- package/dist/composables/use-model-value.d.ts +1 -0
- package/dist/composables/use-model-value.js +4 -2
- package/dist/composables/use-outside-click.js +12 -8
- package/dist/composables/use-pointer-gesture.js +5 -1
- package/dist/composables/use-toggle-value.js +1 -4
- package/dist/composables/use-virtual-list.js +14 -7
- package/dist/contexts/avatar.js +4 -4
- package/dist/contexts/carousel.js +1 -4
- package/dist/contexts/checkbox.js +1 -4
- package/dist/contexts/choicebox.js +2 -8
- package/dist/contexts/collapse.js +1 -4
- package/dist/contexts/list.js +5 -8
- package/dist/contexts/radio.js +4 -4
- package/dist/contexts/resizable.js +1 -4
- package/dist/contexts/switch.js +2 -8
- package/dist/index.d.ts +1 -0
- package/dist/styles/source.css +106 -59
- package/dist/styles/styles.css +1 -1
- package/dist/styles/tw.css +106 -59
- package/dist/types/components/avatar.d.ts +2 -2
- package/dist/types/components/button.d.ts +11 -4
- package/dist/types/components/index.d.ts +12 -0
- package/dist/types/components/input.d.ts +4 -5
- package/dist/types/components/list.d.ts +1 -1
- package/dist/types/components/switch.d.ts +1 -1
- package/dist/types/shared/props.d.ts +6 -4
- package/dist/types/shared/utils.d.ts +3 -1
- package/dist/utils/context.d.ts +2 -8
- package/dist/utils/date.d.ts +1 -1
- package/dist/utils/date.js +1 -5
- package/dist/utils/event.js +6 -18
- package/dist/utils/format.d.ts +1 -1
- package/dist/utils/format.js +1 -1
- package/dist/utils/is.d.ts +0 -1
- package/dist/utils/is.js +3 -2
- package/dist/utils/responsive.js +7 -4
- package/dist/utils/throttle.js +4 -2
- package/package.json +45 -43
- package/dist/components/_internal/fragment-container.vue.d.ts +0 -13
- package/dist/components/active-graph/index.vue.d.ts +0 -51
- package/dist/components/avatar/index.vue.d.ts +0 -34
- package/dist/components/avatar-group/index.vue.d.ts +0 -8
- package/dist/components/backtop/index.vue.d.ts +0 -21
- package/dist/components/badge/index.vue.d.ts +0 -52
- package/dist/components/book/index.vue.d.ts +0 -28
- package/dist/components/browser/index.vue.d.ts +0 -16
- package/dist/components/button/index.vue.d.ts +0 -29
- package/dist/components/carousel/index.vue.d.ts +0 -13
- package/dist/components/carousel-group/index.vue.d.ts +0 -35
- package/dist/components/checkbox/index.vue.d.ts +0 -26
- package/dist/components/checkbox-group/index.vue.d.ts +0 -28
- package/dist/components/chip/index.vue.d.ts +0 -24
- package/dist/components/choicebox/index.vue.d.ts +0 -16
- package/dist/components/choicebox-group/index.vue.d.ts +0 -24
- package/dist/components/collapse/index.vue.d.ts +0 -22
- package/dist/components/collapse-group/index.vue.d.ts +0 -20
- package/dist/components/command-menu/index.vue.d.ts +0 -42
- package/dist/components/command-menu-group/index.vue.d.ts +0 -17
- package/dist/components/command-menu-item/index.vue.d.ts +0 -13
- package/dist/components/config-provider/index.vue.d.ts +0 -22
- package/dist/components/countdown/index.vue.d.ts +0 -51
- package/dist/components/dash-line/index.vue.d.ts +0 -13
- package/dist/components/description/index.vue.d.ts +0 -20
- package/dist/components/drawer/index.vue.d.ts +0 -60
- package/dist/components/empty-state/index.vue.d.ts +0 -23
- package/dist/components/error/index.vue.d.ts +0 -22
- package/dist/components/fader/index.vue.d.ts +0 -12
- package/dist/components/gauge/index.vue.d.ts +0 -14
- package/dist/components/grid/index.vue.d.ts +0 -19
- package/dist/components/grid-item/index.vue.d.ts +0 -18
- package/dist/components/hold-button/index.vue.d.ts +0 -42
- package/dist/components/input/index.vue.d.ts +0 -55
- package/dist/components/intersection-observer/index.vue.d.ts +0 -39
- package/dist/components/kbd/index.vue.d.ts +0 -24
- package/dist/components/label/index.vue.d.ts +0 -13
- package/dist/components/link-button/index.vue.d.ts +0 -33
- package/dist/components/list/index.vue.d.ts +0 -44
- package/dist/components/list-item/index.vue.d.ts +0 -29
- package/dist/components/loading-bar/index.vue.d.ts +0 -15
- package/dist/components/loading-dots/index.vue.d.ts +0 -15
- package/dist/components/material/index.vue.d.ts +0 -18
- package/dist/components/menu/index.vue.d.ts +0 -33
- package/dist/components/message/index.vue.d.ts +0 -176
- package/dist/components/message-item/index.vue.d.ts +0 -15
- package/dist/components/modal/index.vue.d.ts +0 -58
- package/dist/components/more-button/index.vue.d.ts +0 -20
- package/dist/components/noise-background/index.vue.d.ts +0 -19
- package/dist/components/note/index.vue.d.ts +0 -64
- package/dist/components/number-input/index.vue.d.ts +0 -39
- package/dist/components/overlay/index.vue.d.ts +0 -35
- package/dist/components/pagination/index.vue.d.ts +0 -21
- package/dist/components/pin-input/index.vue.d.ts +0 -28
- package/dist/components/placeholder/index.vue.d.ts +0 -18
- package/dist/components/popover/index.vue.d.ts +0 -73
- package/dist/components/progress/index.vue.d.ts +0 -34
- package/dist/components/radio/index.vue.d.ts +0 -20
- package/dist/components/radio-group/index.vue.d.ts +0 -22
- package/dist/components/resizable/index.vue.d.ts +0 -19
- package/dist/components/resizable-handle/index.vue.d.ts +0 -3
- package/dist/components/resizable-panel/index.vue.d.ts +0 -20
- package/dist/components/scrollable/index.vue.d.ts +0 -0
- package/dist/components/skeleton/index.vue.d.ts +0 -26
- package/dist/components/slider/index.vue.d.ts +0 -26
- package/dist/components/snippet/index.vue.d.ts +0 -18
- package/dist/components/spinner/index.vue.d.ts +0 -3
- package/dist/components/stack/index.vue.d.ts +0 -30
- package/dist/components/status-dot/index.vue.d.ts +0 -11
- package/dist/components/switch/index.vue.d.ts +0 -20
- package/dist/components/switch-group/index.vue.d.ts +0 -23
- package/dist/components/teleport/index.vue.d.ts +0 -21
- package/dist/components/text/index.vue.d.ts +0 -26
- package/dist/components/textarea/index.vue.d.ts +0 -28
- package/dist/components/theme-switcher/index.vue.d.ts +0 -8
- package/dist/components/time-picker/index.vue.d.ts +0 -35
- package/dist/components/toggle/index.vue.d.ts +0 -41
- package/dist/components/tooltip/index.vue.d.ts +0 -32
- package/dist/components/virtual-list/index.vue.d.ts +0 -24
|
@@ -53,20 +53,24 @@ function translateItems() {
|
|
|
53
53
|
carousel.translateItem(index, virtualIndex.value);
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
const onToggleClick = throttle(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
56
|
+
const onToggleClick = throttle(
|
|
57
|
+
(delta) => {
|
|
58
|
+
const length = carousels.value.length;
|
|
59
|
+
if (length === 0) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (props.loop) {
|
|
63
|
+
virtualIndex.value += delta;
|
|
64
|
+
translateItems();
|
|
65
|
+
} else {
|
|
66
|
+
virtualIndex.value = Math.max(0, Math.min(virtualIndex.value + delta, length - 1));
|
|
67
|
+
}
|
|
68
|
+
emits("change", correctIndex.value);
|
|
69
|
+
nextTick(onPointerLeave);
|
|
70
|
+
},
|
|
71
|
+
THROTTLE_INTERVALS,
|
|
72
|
+
{ edges: ["leading"] }
|
|
73
|
+
);
|
|
70
74
|
function onWheelToggle(ev) {
|
|
71
75
|
if (!props.toggleOnWheel) {
|
|
72
76
|
return;
|
|
@@ -269,26 +273,26 @@ onBeforeUnmount(() => {
|
|
|
269
273
|
|
|
270
274
|
<style lang="postcss">
|
|
271
275
|
.pxd-carousel-group {
|
|
272
|
-
&[data-indicator-type=
|
|
276
|
+
&[data-indicator-type='dot'] {
|
|
273
277
|
--carousel-dot-width: 8px;
|
|
274
278
|
--carousel-dot-height: 8px;
|
|
275
279
|
}
|
|
276
280
|
|
|
277
|
-
&[data-indicator-type=
|
|
278
|
-
&[data-indicator-position=
|
|
279
|
-
&[data-indicator-position=
|
|
281
|
+
&[data-indicator-type='line'] {
|
|
282
|
+
&[data-indicator-position='top'],
|
|
283
|
+
&[data-indicator-position='bottom'] {
|
|
280
284
|
--carousel-dot-width: 16px;
|
|
281
285
|
--carousel-dot-height: 4px;
|
|
282
286
|
}
|
|
283
287
|
|
|
284
|
-
&[data-indicator-position=
|
|
285
|
-
&[data-indicator-position=
|
|
288
|
+
&[data-indicator-position='left'],
|
|
289
|
+
&[data-indicator-position='right'] {
|
|
286
290
|
--carousel-dot-width: 4px;
|
|
287
291
|
--carousel-dot-height: 16px;
|
|
288
292
|
}
|
|
289
293
|
}
|
|
290
294
|
|
|
291
|
-
&[data-indicator-position=
|
|
295
|
+
&[data-indicator-position='top'] {
|
|
292
296
|
.pxd-carousel-group--indicator {
|
|
293
297
|
left: 12px;
|
|
294
298
|
top: 8px;
|
|
@@ -300,7 +304,7 @@ onBeforeUnmount(() => {
|
|
|
300
304
|
}
|
|
301
305
|
}
|
|
302
306
|
|
|
303
|
-
&[data-indicator-position=
|
|
307
|
+
&[data-indicator-position='bottom'] {
|
|
304
308
|
.pxd-carousel-group--indicator {
|
|
305
309
|
left: 12px;
|
|
306
310
|
bottom: 8px;
|
|
@@ -312,7 +316,7 @@ onBeforeUnmount(() => {
|
|
|
312
316
|
}
|
|
313
317
|
}
|
|
314
318
|
|
|
315
|
-
&[data-indicator-position=
|
|
319
|
+
&[data-indicator-position='left'] {
|
|
316
320
|
.pxd-carousel-group--indicator {
|
|
317
321
|
left: 8px;
|
|
318
322
|
top: 12px;
|
|
@@ -324,7 +328,7 @@ onBeforeUnmount(() => {
|
|
|
324
328
|
}
|
|
325
329
|
}
|
|
326
330
|
|
|
327
|
-
&[data-indicator-position=
|
|
331
|
+
&[data-indicator-position='right'] {
|
|
328
332
|
.pxd-carousel-group--indicator {
|
|
329
333
|
right: 8px;
|
|
330
334
|
top: 12px;
|
|
@@ -336,19 +340,19 @@ onBeforeUnmount(() => {
|
|
|
336
340
|
}
|
|
337
341
|
}
|
|
338
342
|
|
|
339
|
-
&[data-direction=
|
|
343
|
+
&[data-direction='horizontal'] .pxd-carousel-group--slider {
|
|
340
344
|
display: flex;
|
|
341
345
|
}
|
|
342
346
|
|
|
343
|
-
&[data-direction=
|
|
347
|
+
&[data-direction='vertical'] {
|
|
344
348
|
.pxd-carousel-group--prev-btn,
|
|
345
349
|
.pxd-carousel-group--next-btn {
|
|
346
350
|
transform: rotate(90deg);
|
|
347
351
|
}
|
|
348
352
|
}
|
|
349
353
|
|
|
350
|
-
&[data-indicator-position=
|
|
351
|
-
&[data-indicator-position=
|
|
354
|
+
&[data-indicator-position='left'],
|
|
355
|
+
&[data-indicator-position='right'] {
|
|
352
356
|
.pxd-carousel-group--indicator,
|
|
353
357
|
.pxd-carousel-group--toggler {
|
|
354
358
|
flex-direction: column;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export declare const checkboxVariant: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
checked: {
|
|
3
|
+
true: {
|
|
4
|
+
inner: string;
|
|
5
|
+
};
|
|
6
|
+
false: {
|
|
7
|
+
inner: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
disabled: {
|
|
11
|
+
true: {
|
|
12
|
+
wrapper: string;
|
|
13
|
+
inner: string;
|
|
14
|
+
};
|
|
15
|
+
false: {
|
|
16
|
+
wrapper: string;
|
|
17
|
+
inner: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}, {
|
|
21
|
+
wrapper: string;
|
|
22
|
+
inner: string;
|
|
23
|
+
}, undefined, {
|
|
24
|
+
checked: {
|
|
25
|
+
true: {
|
|
26
|
+
inner: string;
|
|
27
|
+
};
|
|
28
|
+
false: {
|
|
29
|
+
inner: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
disabled: {
|
|
33
|
+
true: {
|
|
34
|
+
wrapper: string;
|
|
35
|
+
inner: string;
|
|
36
|
+
};
|
|
37
|
+
false: {
|
|
38
|
+
wrapper: string;
|
|
39
|
+
inner: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
}, {
|
|
43
|
+
wrapper: string;
|
|
44
|
+
inner: string;
|
|
45
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
46
|
+
checked: {
|
|
47
|
+
true: {
|
|
48
|
+
inner: string;
|
|
49
|
+
};
|
|
50
|
+
false: {
|
|
51
|
+
inner: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
disabled: {
|
|
55
|
+
true: {
|
|
56
|
+
wrapper: string;
|
|
57
|
+
inner: string;
|
|
58
|
+
};
|
|
59
|
+
false: {
|
|
60
|
+
wrapper: string;
|
|
61
|
+
inner: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
}, {
|
|
65
|
+
wrapper: string;
|
|
66
|
+
inner: string;
|
|
67
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
export const checkboxVariant = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
wrapper: "pxd-checkbox group/checkbox gap-2 inline-flex max-w-full cursor-pointer touch-manipulation items-center data-[disabled=true]:cursor-not-allowed",
|
|
5
|
+
inner: "pxd-checkbox--inner size-4 inline-flex shrink-0 transform-gpu items-center justify-center overflow-hidden rounded-sm border peer-focus-ring motion-safe:transition-colors"
|
|
6
|
+
},
|
|
7
|
+
variants: {
|
|
8
|
+
checked: {
|
|
9
|
+
true: {
|
|
10
|
+
inner: "border-primary bg-primary"
|
|
11
|
+
},
|
|
12
|
+
false: {
|
|
13
|
+
inner: "border-gray-alpha-400 bg-background-100 group-hover/checkbox:bg-gray-200"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
true: {
|
|
18
|
+
wrapper: "is-disabled text-gray-500",
|
|
19
|
+
inner: ""
|
|
20
|
+
},
|
|
21
|
+
false: {
|
|
22
|
+
wrapper: "",
|
|
23
|
+
inner: ""
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
compoundVariants: [
|
|
28
|
+
{ checked: true, disabled: true, inner: "border-gray-600 bg-gray-600" },
|
|
29
|
+
{ checked: false, disabled: true, inner: "border-gray-500 bg-gray-100" }
|
|
30
|
+
]
|
|
31
|
+
});
|
|
@@ -5,6 +5,7 @@ import { computed } from "vue";
|
|
|
5
5
|
import { useModelValue } from "../../composables/use-model-value";
|
|
6
6
|
import { useCheckboxGroupContext } from "../../contexts/checkbox";
|
|
7
7
|
import { getUniqueId } from "../../utils/uid";
|
|
8
|
+
import { checkboxVariant } from "./cn";
|
|
8
9
|
defineOptions({
|
|
9
10
|
name: "PCheckbox",
|
|
10
11
|
model: {
|
|
@@ -35,21 +36,11 @@ const isChecked = computed(() => {
|
|
|
35
36
|
});
|
|
36
37
|
const computedDisabled = computed(() => props.disabled || checkboxGroupContext?.disabled);
|
|
37
38
|
const computedRequired = computed(() => props.required || checkboxGroupContext?.required);
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (isChecked.value) {
|
|
44
|
-
classes.push(
|
|
45
|
-
computedDisabled.value ? "bg-gray-600 border-gray-600" : "bg-primary border-primary"
|
|
46
|
-
);
|
|
47
|
-
} else {
|
|
48
|
-
classes.push(
|
|
49
|
-
computedDisabled.value ? "bg-gray-100 border-gray-500" : "bg-background-100 border-gray-alpha-400 group-hover/checkbox:bg-gray-200"
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
return classes.join(" ");
|
|
39
|
+
const computedClasses = computed(() => {
|
|
40
|
+
return checkboxVariant({
|
|
41
|
+
checked: isChecked.value,
|
|
42
|
+
disabled: computedDisabled.value
|
|
43
|
+
});
|
|
53
44
|
});
|
|
54
45
|
function toggleChecked(isChecked2) {
|
|
55
46
|
if (Array.isArray(modelValue.value)) {
|
|
@@ -78,8 +69,7 @@ defineExpose({
|
|
|
78
69
|
role="checkbox"
|
|
79
70
|
:aria-checked="isChecked"
|
|
80
71
|
:data-disabled="computedDisabled"
|
|
81
|
-
class="
|
|
82
|
-
:class="{ 'is-disabled text-gray-500': computedDisabled }"
|
|
72
|
+
:class="computedClasses.wrapper()"
|
|
83
73
|
:for="uniqueId"
|
|
84
74
|
>
|
|
85
75
|
<input
|
|
@@ -91,9 +81,9 @@ defineExpose({
|
|
|
91
81
|
:required="computedRequired"
|
|
92
82
|
:disabled="computedDisabled"
|
|
93
83
|
@change="onInputChange"
|
|
94
|
-
|
|
84
|
+
/>
|
|
95
85
|
|
|
96
|
-
<span aria-hidden="true" :class="
|
|
86
|
+
<span aria-hidden="true" :class="computedClasses.inner()">
|
|
97
87
|
<CheckIcon v-if="isChecked" class="size-3 text-gray-100" />
|
|
98
88
|
<MinusIcon v-else-if="indeterminate" class="size-3" />
|
|
99
89
|
<span v-else class="size-3" />
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const chipVariant: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
variant: {
|
|
3
|
+
primary: string;
|
|
4
|
+
error: string;
|
|
5
|
+
warning: string;
|
|
6
|
+
success: string;
|
|
7
|
+
secondary: string;
|
|
8
|
+
};
|
|
9
|
+
inset: {
|
|
10
|
+
true: {};
|
|
11
|
+
false: string;
|
|
12
|
+
};
|
|
13
|
+
hasLabel: {
|
|
14
|
+
true: {};
|
|
15
|
+
false: string;
|
|
16
|
+
};
|
|
17
|
+
}, undefined, "pxd-chip--label text-xs top-0 right-0 absolute rounded-full border border-background-100 motion-safe:transition-all", {
|
|
18
|
+
variant: {
|
|
19
|
+
primary: string;
|
|
20
|
+
error: string;
|
|
21
|
+
warning: string;
|
|
22
|
+
success: string;
|
|
23
|
+
secondary: string;
|
|
24
|
+
};
|
|
25
|
+
inset: {
|
|
26
|
+
true: {};
|
|
27
|
+
false: string;
|
|
28
|
+
};
|
|
29
|
+
hasLabel: {
|
|
30
|
+
true: {};
|
|
31
|
+
false: string;
|
|
32
|
+
};
|
|
33
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
34
|
+
variant: {
|
|
35
|
+
primary: string;
|
|
36
|
+
error: string;
|
|
37
|
+
warning: string;
|
|
38
|
+
success: string;
|
|
39
|
+
secondary: string;
|
|
40
|
+
};
|
|
41
|
+
inset: {
|
|
42
|
+
true: {};
|
|
43
|
+
false: string;
|
|
44
|
+
};
|
|
45
|
+
hasLabel: {
|
|
46
|
+
true: {};
|
|
47
|
+
false: string;
|
|
48
|
+
};
|
|
49
|
+
}, undefined, "pxd-chip--label text-xs top-0 right-0 absolute rounded-full border border-background-100 motion-safe:transition-all", unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
export const chipVariant = tv({
|
|
3
|
+
base: "pxd-chip--label text-xs top-0 right-0 absolute rounded-full border border-background-100 motion-safe:transition-all",
|
|
4
|
+
variants: {
|
|
5
|
+
variant: {
|
|
6
|
+
primary: "bg-primary text-background-100",
|
|
7
|
+
error: "bg-red-700 text-background-100 dark:text-gray-1000",
|
|
8
|
+
warning: "bg-amber-700 text-gray-1000 dark:text-gray-100",
|
|
9
|
+
success: "bg-green-700 text-background-100 dark:text-gray-1000",
|
|
10
|
+
secondary: "bg-gray-700 text-background-100 dark:text-gray-1000"
|
|
11
|
+
},
|
|
12
|
+
inset: {
|
|
13
|
+
true: {},
|
|
14
|
+
false: "translate-x-1/2 -translate-y-1/3"
|
|
15
|
+
},
|
|
16
|
+
hasLabel: {
|
|
17
|
+
true: {},
|
|
18
|
+
false: "size-(--chip-size)"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: "primary",
|
|
23
|
+
inset: false,
|
|
24
|
+
hasLabel: false
|
|
25
|
+
}
|
|
26
|
+
});
|
|
@@ -1,31 +1,19 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import { getCssUnitValue } from "../../utils/format";
|
|
4
|
-
import {
|
|
3
|
+
import { getCssUnitValue, isTruthyProp } from "../../utils/format";
|
|
4
|
+
import { chipVariant } from "./cn";
|
|
5
5
|
const props = defineProps({
|
|
6
6
|
size: { type: [Number, String], required: false, default: 10 },
|
|
7
7
|
inset: { type: Boolean, required: false },
|
|
8
8
|
label: { type: [String, Number, Array, null], required: false, default: "" },
|
|
9
9
|
variant: { type: String, required: false, default: "primary" }
|
|
10
10
|
});
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
const computedClass = computed(() => {
|
|
19
|
-
const classes = ["pxd-chip--label text-xs top-0 right-0 absolute rounded-full border border-background-100 motion-safe:transition-all"];
|
|
20
|
-
const { variant, inset, label } = props;
|
|
21
|
-
if (!label) {
|
|
22
|
-
classes.push("size-(--chip-size)");
|
|
23
|
-
}
|
|
24
|
-
if (!inset) {
|
|
25
|
-
classes.push("translate-x-1/2 -translate-y-1/3");
|
|
26
|
-
}
|
|
27
|
-
classes.push(getFallbackValue(variant, variantPresets, "primary"));
|
|
28
|
-
return classes.join(" ");
|
|
11
|
+
const computedClasses = computed(() => {
|
|
12
|
+
return chipVariant({
|
|
13
|
+
inset: props.inset,
|
|
14
|
+
variant: props.variant,
|
|
15
|
+
hasLabel: isTruthyProp(props.label)
|
|
16
|
+
});
|
|
29
17
|
});
|
|
30
18
|
</script>
|
|
31
19
|
|
|
@@ -33,7 +21,11 @@ const computedClass = computed(() => {
|
|
|
33
21
|
<div class="pxd-chip relative inline-flex shrink-0">
|
|
34
22
|
<slot />
|
|
35
23
|
|
|
36
|
-
<span
|
|
24
|
+
<span
|
|
25
|
+
:data-label="label"
|
|
26
|
+
:class="computedClasses"
|
|
27
|
+
:style="{ '--chip-size': getCssUnitValue(size) }"
|
|
28
|
+
/>
|
|
37
29
|
</div>
|
|
38
30
|
</template>
|
|
39
31
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, markRaw, useAttrs } from "vue";
|
|
3
3
|
import { useModelValue } from "../../composables/use-model-value";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
provideChoiceboxGroupContext,
|
|
6
|
+
provideChoiceboxGroupModelValue
|
|
7
|
+
} from "../../contexts/choicebox";
|
|
5
8
|
import PCheckboxGroup from "../checkbox-group/index.vue";
|
|
6
9
|
import PChoicebox from "../choicebox/index.vue";
|
|
7
10
|
import PRadioGroup from "../radio-group/index.vue";
|
|
@@ -29,10 +32,10 @@ const computedAttrs = computed(() => {
|
|
|
29
32
|
const { disabled, multiple, required, options } = props;
|
|
30
33
|
const { class: classes, ...rest } = attrs;
|
|
31
34
|
return {
|
|
32
|
-
|
|
35
|
+
role: multiple ? "group" : "radiogroup",
|
|
33
36
|
"aria-required": required,
|
|
34
37
|
"aria-multiselectable": multiple,
|
|
35
|
-
|
|
38
|
+
gap: attrs.gap || "3",
|
|
36
39
|
disabled,
|
|
37
40
|
required,
|
|
38
41
|
options,
|
|
@@ -37,6 +37,7 @@ function onTriggerClick() {
|
|
|
37
37
|
localExpand.value = newState;
|
|
38
38
|
}
|
|
39
39
|
function beforeEnter(el) {
|
|
40
|
+
;
|
|
40
41
|
el.style.height = "0";
|
|
41
42
|
el.style.overflow = "hidden";
|
|
42
43
|
}
|
|
@@ -45,15 +46,18 @@ function enter(el) {
|
|
|
45
46
|
el.style.height = `${el.scrollHeight}px`;
|
|
46
47
|
}
|
|
47
48
|
function afterEnter(el) {
|
|
49
|
+
;
|
|
48
50
|
el.style.height = "";
|
|
49
51
|
el.style.overflow = "";
|
|
50
52
|
}
|
|
51
53
|
function beforeLeave(el) {
|
|
54
|
+
;
|
|
52
55
|
el.style.height = `${el.scrollHeight}px`;
|
|
53
56
|
el.style.overflow = "hidden";
|
|
54
57
|
void el.offsetHeight;
|
|
55
58
|
}
|
|
56
59
|
function leave(el) {
|
|
60
|
+
;
|
|
57
61
|
el.style.height = "0";
|
|
58
62
|
}
|
|
59
63
|
onMounted(() => {
|
|
@@ -75,7 +79,9 @@ onMounted(() => {
|
|
|
75
79
|
{{ title }}
|
|
76
80
|
</slot>
|
|
77
81
|
|
|
78
|
-
<ChevronDownIcon
|
|
82
|
+
<ChevronDownIcon
|
|
83
|
+
class="size-4 shrink-0 group-data-[state=open]/collapse:-rotate-180 motion-safe:transition-transform"
|
|
84
|
+
/>
|
|
79
85
|
</button>
|
|
80
86
|
</h3>
|
|
81
87
|
|
|
@@ -27,10 +27,10 @@ const SIZES = {
|
|
|
27
27
|
fontWeight: "600"
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
const
|
|
31
|
-
const
|
|
30
|
+
const configProvider = useConfigProvider();
|
|
31
|
+
const expandedItemIds = ref([]);
|
|
32
32
|
const computedStyle = computed(() => {
|
|
33
|
-
const { padding, fontSize, fontWeight } = getFallbackValue(props.size, SIZES,
|
|
33
|
+
const { padding, fontSize, fontWeight } = getFallbackValue(props.size, SIZES, configProvider.size);
|
|
34
34
|
return {
|
|
35
35
|
"--collapse-padding": padding,
|
|
36
36
|
"--collapse-font-size": fontSize,
|
|
@@ -40,15 +40,15 @@ const computedStyle = computed(() => {
|
|
|
40
40
|
function toggleItem(id, expanded) {
|
|
41
41
|
if (expanded) {
|
|
42
42
|
if (props.multiple) {
|
|
43
|
-
|
|
43
|
+
expandedItemIds.value.push(id);
|
|
44
44
|
} else {
|
|
45
|
-
|
|
45
|
+
expandedItemIds.value = [id];
|
|
46
46
|
}
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
expandedItemIds.value = expandedItemIds.value.filter((item) => item !== id);
|
|
50
50
|
}
|
|
51
|
-
const isExpanded = (id) =>
|
|
51
|
+
const isExpanded = (id) => expandedItemIds.value.includes(id);
|
|
52
52
|
provideCollapseGroupContext({
|
|
53
53
|
multiple: computed(() => props.multiple),
|
|
54
54
|
isExpanded,
|
|
@@ -27,16 +27,13 @@ const props = defineProps({
|
|
|
27
27
|
});
|
|
28
28
|
const emits = defineEmits(["update:modelValue", "select", "change", "show", "hide"]);
|
|
29
29
|
const uniqueId = getUniqueId();
|
|
30
|
-
const
|
|
30
|
+
const configProvider = useConfigProvider();
|
|
31
31
|
const modelValue = useModelValue(props, emits);
|
|
32
32
|
const isDesktop = useMediaQuery(PRESET_MEDIA_QUERIES.SM_UP);
|
|
33
33
|
const modalInitialFocus = computed(() => isDesktop.value ? `#${uniqueId}` : false);
|
|
34
34
|
const listRef = shallowRef();
|
|
35
35
|
const isEmptyResult = shallowRef(false);
|
|
36
|
-
const {
|
|
37
|
-
value: filterKeyword,
|
|
38
|
-
deferred: deferredFilterKeyword
|
|
39
|
-
} = useDeferredValue("", {
|
|
36
|
+
const { value: filterKeyword, deferred: deferredFilterKeyword } = useDeferredValue("", {
|
|
40
37
|
async valueChange(v) {
|
|
41
38
|
if (!v) {
|
|
42
39
|
return;
|
|
@@ -80,7 +77,10 @@ provideListFilterValue(deferredFilterKeyword);
|
|
|
80
77
|
@hide="hideModal"
|
|
81
78
|
>
|
|
82
79
|
<template #header>
|
|
83
|
-
<label
|
|
80
|
+
<label
|
|
81
|
+
:for="uniqueId"
|
|
82
|
+
class="py-3 px-4 -mx-6 -mt-4 sm:-mt-6 gap-3 flex items-center border-b bg-background-100"
|
|
83
|
+
>
|
|
84
84
|
<input
|
|
85
85
|
:id="uniqueId"
|
|
86
86
|
v-model="filterKeyword"
|
|
@@ -96,7 +96,7 @@ provideListFilterValue(deferredFilterKeyword);
|
|
|
96
96
|
type="text"
|
|
97
97
|
name="command-menu-filter-input"
|
|
98
98
|
class="h-7 flex-1 shrink-0 appearance-none border-none bg-transparent font-inherit text-foreground outline-none"
|
|
99
|
-
|
|
99
|
+
/>
|
|
100
100
|
|
|
101
101
|
<PButton
|
|
102
102
|
v-if="closeOnPressEscape"
|
|
@@ -120,7 +120,8 @@ provideListFilterValue(deferredFilterKeyword);
|
|
|
120
120
|
<slot />
|
|
121
121
|
|
|
122
122
|
<p v-if="isEmptyResult" class="py-7.5 text-sm text-center text-foreground-secondary">
|
|
123
|
-
{{
|
|
123
|
+
{{ configProvider.locale.empty.search }}
|
|
124
|
+
<span class="text-foreground">"{{ filterKeyword }}"</span>
|
|
124
125
|
</p>
|
|
125
126
|
</PList>
|
|
126
127
|
|
|
@@ -9,7 +9,10 @@ defineProps({
|
|
|
9
9
|
|
|
10
10
|
<template>
|
|
11
11
|
<div class="pxd-command-menu-group" role="presentation">
|
|
12
|
-
<div
|
|
12
|
+
<div
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
class="h-10 px-2 flex items-center text-13px text-foreground-secondary only:hidden empty:hidden"
|
|
15
|
+
>
|
|
13
16
|
{{ label }}
|
|
14
17
|
</div>
|
|
15
18
|
|
|
@@ -10,6 +10,7 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
11
11
|
size: import("../../types/shared").ComponentSize;
|
|
12
12
|
locale: Record<string, any>;
|
|
13
|
+
popoverShowTransition: boolean;
|
|
13
14
|
as: ComponentAs;
|
|
14
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
16
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -7,7 +7,8 @@ defineOptions({
|
|
|
7
7
|
const props = defineProps({
|
|
8
8
|
as: { type: null, required: false, default: "div" },
|
|
9
9
|
size: { type: String, required: false, default: "md" },
|
|
10
|
-
locale: { type: Object, required: false, default: () => enUS }
|
|
10
|
+
locale: { type: Object, required: false, default: () => enUS },
|
|
11
|
+
popoverShowTransition: { type: Boolean, required: false, default: true }
|
|
11
12
|
});
|
|
12
13
|
provideConfigProvider(props);
|
|
13
14
|
</script>
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, onBeforeUnmount } from "vue";
|
|
3
3
|
import { useCountdown } from "../../composables/use-countdown";
|
|
4
|
-
import {
|
|
5
|
-
dayjs,
|
|
6
|
-
dayjsDurationPlugin,
|
|
7
|
-
dayjsMillisecondTokenPlugin
|
|
8
|
-
} from "../../utils/date";
|
|
4
|
+
import { dayjs, dayjsDurationPlugin, dayjsMillisecondTokenPlugin } from "../../utils/date";
|
|
9
5
|
defineOptions({
|
|
10
6
|
name: "PCountDown"
|
|
11
7
|
});
|
|
@@ -24,11 +20,7 @@ const props = defineProps({
|
|
|
24
20
|
const emits = defineEmits(["change", "reset", "finish"]);
|
|
25
21
|
dayjs.extend(dayjsDurationPlugin);
|
|
26
22
|
dayjs.extend(dayjsMillisecondTokenPlugin);
|
|
27
|
-
const {
|
|
28
|
-
stop,
|
|
29
|
-
reset,
|
|
30
|
-
timestamp
|
|
31
|
-
} = useCountdown(props, emits);
|
|
23
|
+
const { stop, reset, timestamp } = useCountdown(props, emits);
|
|
32
24
|
const times = computed(() => {
|
|
33
25
|
const t = dayjs.duration(timestamp.value);
|
|
34
26
|
return {
|