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
|
@@ -20,7 +20,11 @@ const computedStyle = computed(() => ({
|
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<template>
|
|
23
|
-
<div
|
|
23
|
+
<div
|
|
24
|
+
class="pxd-dash-line relative max-w-full min-w-full"
|
|
25
|
+
:data-position="position"
|
|
26
|
+
:style="computedStyle"
|
|
27
|
+
/>
|
|
24
28
|
</template>
|
|
25
29
|
|
|
26
30
|
<style lang="postcss">
|
|
@@ -30,36 +34,38 @@ const computedStyle = computed(() => ({
|
|
|
30
34
|
--s: var(--dash-line-size, 1px);
|
|
31
35
|
--c: var(--dash-line-color, var(--color-gray-600));
|
|
32
36
|
|
|
33
|
-
&[data-position*=
|
|
34
|
-
&[data-position*=
|
|
35
|
-
&[data-position*=
|
|
36
|
-
&[data-position*=
|
|
37
|
+
&[data-position*='top']::before,
|
|
38
|
+
&[data-position*='bottom']::after,
|
|
39
|
+
&[data-position*='left']::before,
|
|
40
|
+
&[data-position*='right']::after {
|
|
37
41
|
content: '';
|
|
38
42
|
position: absolute;
|
|
39
43
|
pointer-events: none;
|
|
40
|
-
background-image: repeating-linear-gradient(
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
background-image: repeating-linear-gradient(
|
|
45
|
+
to var(--p),
|
|
46
|
+
var(--c) 0 var(--d),
|
|
47
|
+
transparent var(--d) calc(var(--d) + var(--g))
|
|
48
|
+
);
|
|
43
49
|
}
|
|
44
50
|
|
|
45
|
-
&[data-position*=
|
|
51
|
+
&[data-position*='top']::before {
|
|
46
52
|
top: 0;
|
|
47
53
|
}
|
|
48
54
|
|
|
49
|
-
&[data-position*=
|
|
55
|
+
&[data-position*='bottom']::after {
|
|
50
56
|
bottom: 0;
|
|
51
57
|
}
|
|
52
58
|
|
|
53
|
-
&[data-position*=
|
|
59
|
+
&[data-position*='left']::before {
|
|
54
60
|
left: 0;
|
|
55
61
|
}
|
|
56
62
|
|
|
57
|
-
&[data-position*=
|
|
63
|
+
&[data-position*='right']::after {
|
|
58
64
|
right: 0;
|
|
59
65
|
}
|
|
60
66
|
|
|
61
|
-
&[data-position*=
|
|
62
|
-
&[data-position*=
|
|
67
|
+
&[data-position*='top']::before,
|
|
68
|
+
&[data-position*='bottom']::after {
|
|
63
69
|
--p: right;
|
|
64
70
|
left: 0;
|
|
65
71
|
right: 0;
|
|
@@ -67,8 +73,8 @@ const computedStyle = computed(() => ({
|
|
|
67
73
|
height: var(--s);
|
|
68
74
|
}
|
|
69
75
|
|
|
70
|
-
&[data-position*=
|
|
71
|
-
&[data-position*=
|
|
76
|
+
&[data-position*='left']::before,
|
|
77
|
+
&[data-position*='right']::after {
|
|
72
78
|
--p: bottom;
|
|
73
79
|
top: 0;
|
|
74
80
|
bottom: 0;
|
|
@@ -13,12 +13,14 @@ defineProps({
|
|
|
13
13
|
|
|
14
14
|
<template>
|
|
15
15
|
<dl class="pxd-description">
|
|
16
|
-
<dt
|
|
16
|
+
<dt
|
|
17
|
+
class="pxd-description--title gap-1 text-sm mb-2 min-h-3.5 flex items-center leading-none text-nowrap text-foreground-secondary capitalize"
|
|
18
|
+
>
|
|
17
19
|
<slot name="title">
|
|
18
20
|
{{ title }}
|
|
19
21
|
</slot>
|
|
20
22
|
|
|
21
|
-
<PTooltip v-if="tooltip" :content="tooltip"
|
|
23
|
+
<PTooltip v-if="tooltip" :content="tooltip">
|
|
22
24
|
<InformationIcon class="text-base scale-125" />
|
|
23
25
|
</PTooltip>
|
|
24
26
|
</dt>
|
|
@@ -64,14 +64,17 @@ function onOverlayClick(ev) {
|
|
|
64
64
|
}
|
|
65
65
|
closeOverlayIfNeed();
|
|
66
66
|
}
|
|
67
|
-
watch(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
emits("
|
|
71
|
-
|
|
67
|
+
watch(
|
|
68
|
+
() => isVisible.value,
|
|
69
|
+
(visible) => {
|
|
70
|
+
emits("visible-change", visible);
|
|
71
|
+
if (visible) {
|
|
72
|
+
emits("show");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
emits("hide");
|
|
72
76
|
}
|
|
73
|
-
|
|
74
|
-
});
|
|
77
|
+
);
|
|
75
78
|
</script>
|
|
76
79
|
|
|
77
80
|
<template>
|
|
@@ -95,11 +98,16 @@ watch(() => isVisible.value, (visible) => {
|
|
|
95
98
|
:data-position="ensurePosition"
|
|
96
99
|
>
|
|
97
100
|
<header
|
|
98
|
-
class="pxd-drawer--header px-6 pt-4 sm:pt-6 relative shrink-0
|
|
99
|
-
:class="{
|
|
101
|
+
class="pxd-drawer--header px-6 pt-4 sm:pt-6 empty:py-3 relative shrink-0"
|
|
102
|
+
:class="{
|
|
103
|
+
'pb-4 sm:pb-6 border-b bg-background-200 dark:bg-background-100': headerStylize
|
|
104
|
+
}"
|
|
100
105
|
>
|
|
101
106
|
<slot name="header">
|
|
102
|
-
<h3
|
|
107
|
+
<h3
|
|
108
|
+
v-if="$slots.title || title"
|
|
109
|
+
class="text-lg sm:text-xl font-semibold tracking-tight m-0"
|
|
110
|
+
>
|
|
103
111
|
<slot name="title">
|
|
104
112
|
{{ title }}
|
|
105
113
|
</slot>
|
|
@@ -114,7 +122,7 @@ watch(() => isVisible.value, (visible) => {
|
|
|
114
122
|
</header>
|
|
115
123
|
|
|
116
124
|
<div
|
|
117
|
-
class="pxd-drawer--content px-6 py-4 sm:py-6 h-full flex-1 overflow-auto
|
|
125
|
+
class="pxd-drawer--content px-6 py-4 sm:py-6 empty:py-3 h-full flex-1 overflow-auto"
|
|
118
126
|
:class="contentClass"
|
|
119
127
|
>
|
|
120
128
|
<slot />
|
|
@@ -12,7 +12,9 @@ defineProps({
|
|
|
12
12
|
<div class="pxd-empty-state py-12 px-18 w-full rounded-lg border bg-background-100">
|
|
13
13
|
<div class="max-w-sm space-y-6 mx-auto flex flex-col">
|
|
14
14
|
<template v-if="$slots.icon">
|
|
15
|
-
<div
|
|
15
|
+
<div
|
|
16
|
+
class="pxd-empty-state--icon p-3.5 size-15 mx-auto flex items-center justify-center rounded-md border text-foreground-secondary"
|
|
17
|
+
>
|
|
16
18
|
<slot name="icon" />
|
|
17
19
|
</div>
|
|
18
20
|
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const errorVariant: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
size: {
|
|
3
|
+
xs: string;
|
|
4
|
+
sm: string;
|
|
5
|
+
md: string;
|
|
6
|
+
lg: string;
|
|
7
|
+
};
|
|
8
|
+
}, undefined, "pxd-error flex text-red-900", {
|
|
9
|
+
size: {
|
|
10
|
+
xs: string;
|
|
11
|
+
sm: string;
|
|
12
|
+
md: string;
|
|
13
|
+
lg: string;
|
|
14
|
+
};
|
|
15
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
16
|
+
size: {
|
|
17
|
+
xs: string;
|
|
18
|
+
sm: string;
|
|
19
|
+
md: string;
|
|
20
|
+
lg: string;
|
|
21
|
+
};
|
|
22
|
+
}, undefined, "pxd-error flex text-red-900", unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
export const errorVariant = tv({
|
|
3
|
+
base: "pxd-error flex text-red-900",
|
|
4
|
+
variants: {
|
|
5
|
+
size: {
|
|
6
|
+
xs: "text-xs [--mt:2px]",
|
|
7
|
+
sm: "text-13px [--mt:2px]",
|
|
8
|
+
md: "text-sm [--mt:2px]",
|
|
9
|
+
lg: "text-base [--mt:4px]"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
size: "md"
|
|
14
|
+
}
|
|
15
|
+
});
|
|
@@ -4,7 +4,7 @@ import StopIcon from "@gdsicon/vue/stop";
|
|
|
4
4
|
import { computed } from "vue";
|
|
5
5
|
import { useConfigProvider } from "../../composables/use-config-provider-context";
|
|
6
6
|
import { isExternalLink } from "../../utils/format";
|
|
7
|
-
import {
|
|
7
|
+
import { errorVariant } from "./cn";
|
|
8
8
|
defineOptions({
|
|
9
9
|
name: "PError"
|
|
10
10
|
});
|
|
@@ -13,31 +13,30 @@ const props = defineProps({
|
|
|
13
13
|
label: { type: [String, Number, Array, null], required: false },
|
|
14
14
|
error: { type: Object, required: false }
|
|
15
15
|
});
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
md: "text-sm [--mt:2px]",
|
|
20
|
-
lg: "text-base [--mt:4px]"
|
|
21
|
-
};
|
|
22
|
-
const config = useConfigProvider();
|
|
23
|
-
const computedClass = computed(() => {
|
|
24
|
-
const classes = ["pxd-error flex text-red-900", getFallbackValue(props.size, SIZES, config.size)];
|
|
25
|
-
return classes.join(" ");
|
|
16
|
+
const configProvider = useConfigProvider();
|
|
17
|
+
const computedClasses = computed(() => {
|
|
18
|
+
return errorVariant({ size: props.size || configProvider.size });
|
|
26
19
|
});
|
|
27
20
|
</script>
|
|
28
21
|
|
|
29
22
|
<template>
|
|
30
|
-
<div :class="
|
|
23
|
+
<div :class="computedClasses">
|
|
31
24
|
<StopIcon class="size-4 mr-2 mt-(--mt) shrink-0" />
|
|
32
25
|
|
|
33
26
|
<div class="flex-1 shrink-0">
|
|
34
|
-
<b v-if="label || error?.label" class="font-medium whitespace-nowrap"
|
|
27
|
+
<b v-if="label || error?.label" class="font-medium whitespace-nowrap"
|
|
28
|
+
>{{ label || error?.label }}:</b
|
|
29
|
+
>
|
|
35
30
|
|
|
36
31
|
<slot>
|
|
37
32
|
{{ error?.message }}
|
|
38
33
|
|
|
39
34
|
<span v-if="error?.action && error?.link">
|
|
40
|
-
<a
|
|
35
|
+
<a
|
|
36
|
+
:href="error.link"
|
|
37
|
+
class="font-medium gap-1 inline-flex items-center text-red-900 underline"
|
|
38
|
+
:target="isExternalLink(error.link) ? '_blank' : '_self'"
|
|
39
|
+
>
|
|
41
40
|
{{ error.action }}
|
|
42
41
|
|
|
43
42
|
<ExternalIcon v-if="isExternalLink(error.link)" class="text-sm" />
|
|
@@ -49,16 +49,20 @@ const onContainerScroll = throttleByRaf(() => {
|
|
|
49
49
|
};
|
|
50
50
|
});
|
|
51
51
|
useResizeObserver(() => formattedContainer.value, onContainerScroll);
|
|
52
|
-
watch(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
52
|
+
watch(
|
|
53
|
+
() => formattedContainer.value,
|
|
54
|
+
(container, oldDom) => {
|
|
55
|
+
if (oldDom) {
|
|
56
|
+
cachedOff(oldDom, "scroll", onContainerScroll);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (!container) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
cachedOn(container, "scroll", onContainerScroll);
|
|
63
|
+
},
|
|
64
|
+
{ immediate: true }
|
|
65
|
+
);
|
|
62
66
|
onBeforeUnmount(() => {
|
|
63
67
|
cachedOff(formattedContainer.value, "scroll", onContainerScroll);
|
|
64
68
|
});
|
|
@@ -70,8 +74,16 @@ onBeforeUnmount(() => {
|
|
|
70
74
|
class="pxd-fader inset-0 pointer-events-none absolute size-full rounded-inherit"
|
|
71
75
|
:style="computedStyle"
|
|
72
76
|
>
|
|
73
|
-
<div
|
|
74
|
-
|
|
77
|
+
<div
|
|
78
|
+
v-if="['both', 'horizontal'].includes(direction)"
|
|
79
|
+
class="pxd-fader--item horizontal inset-0 absolute rounded-inherit before:default-transition-duration before:default-transition-timing-function"
|
|
80
|
+
:class="{ left: fader.left, right: fader.right }"
|
|
81
|
+
/>
|
|
82
|
+
<div
|
|
83
|
+
v-if="['both', 'vertical'].includes(direction)"
|
|
84
|
+
class="pxd-fader--item vertical inset-0 absolute rounded-inherit before:default-transition-duration before:default-transition-timing-function"
|
|
85
|
+
:class="{ top: fader.top, bottom: fader.bottom }"
|
|
86
|
+
/>
|
|
75
87
|
</div>
|
|
76
88
|
</template>
|
|
77
89
|
|
|
@@ -81,8 +93,12 @@ onBeforeUnmount(() => {
|
|
|
81
93
|
position: absolute;
|
|
82
94
|
border-radius: inherit;
|
|
83
95
|
background: linear-gradient(var(--dir), transparent, var(--fader-color, var(--color-gray-100)));
|
|
84
|
-
mask-image: linear-gradient(
|
|
85
|
-
|
|
96
|
+
mask-image: linear-gradient(
|
|
97
|
+
var(--dir-revert),
|
|
98
|
+
var(--fader-color, var(--color-gray-100)) 50%,
|
|
99
|
+
transparent
|
|
100
|
+
);
|
|
101
|
+
transition-property: opacity;
|
|
86
102
|
opacity: 0;
|
|
87
103
|
}
|
|
88
104
|
|
|
@@ -33,8 +33,8 @@ const defaultColors = {
|
|
|
33
33
|
30: "var(--color-amber-800)",
|
|
34
34
|
60: "var(--color-green-700)"
|
|
35
35
|
};
|
|
36
|
-
const
|
|
37
|
-
const computedSize = computed(() => getFallbackValue(props.size, SIZES,
|
|
36
|
+
const configProvider = useConfigProvider();
|
|
37
|
+
const computedSize = computed(() => getFallbackValue(props.size, SIZES, configProvider.size));
|
|
38
38
|
const progress = computed(() => {
|
|
39
39
|
if (props.indeterminate) {
|
|
40
40
|
return 0;
|
|
@@ -99,9 +99,9 @@ const progressColors = computed(() => {
|
|
|
99
99
|
</script>
|
|
100
100
|
|
|
101
101
|
<template>
|
|
102
|
-
<div class="pxd-gauge relative size-max" :style="`--
|
|
102
|
+
<div class="pxd-gauge relative size-max" :style="`--gauge-size: ${computedSize}px`">
|
|
103
103
|
<svg
|
|
104
|
-
class="pxd-gauge--svg block size-(--
|
|
104
|
+
class="pxd-gauge--svg block size-(--gauge-size) -rotate-85 overflow-visible"
|
|
105
105
|
aria-hidden="true"
|
|
106
106
|
fill="none"
|
|
107
107
|
viewBox="0 0 100 100"
|
|
@@ -138,7 +138,7 @@ const progressColors = computed(() => {
|
|
|
138
138
|
<div
|
|
139
139
|
v-if="indeterminate"
|
|
140
140
|
class="pxd-gauge--indeterminate inset-0 font-medium absolute flex items-center justify-center text-center text-foreground-secondary"
|
|
141
|
-
style="font-size: clamp(10px, calc(var(--
|
|
141
|
+
style="font-size: clamp(10px, calc(var(--gauge-size, 48px) * 0.38), 50px)"
|
|
142
142
|
>
|
|
143
143
|
<ChartActivityIcon />
|
|
144
144
|
</div>
|
|
@@ -146,7 +146,7 @@ const progressColors = computed(() => {
|
|
|
146
146
|
<div
|
|
147
147
|
v-else-if="showValue && size !== 'xs'"
|
|
148
148
|
class="pxd-gauge--value inset-0 font-medium absolute flex items-center justify-center text-center"
|
|
149
|
-
style="font-size: calc(var(--
|
|
149
|
+
style="font-size: calc(var(--gauge-size, 48px) * 0.28)"
|
|
150
150
|
>
|
|
151
151
|
{{ progress }}
|
|
152
152
|
</div>
|
|
@@ -31,7 +31,9 @@ const formattedRows = computed(() => {
|
|
|
31
31
|
(typeof rows === "object" ? rows.xs : rows) ?? 0,
|
|
32
32
|
(acc, bp, value) => {
|
|
33
33
|
acc[`--${bp}-rows`] = `repeat(${value}, minmax(0, 1fr))`;
|
|
34
|
-
debug
|
|
34
|
+
if (debug) {
|
|
35
|
+
acc[`--${bp}-rows-count`] = value || 1;
|
|
36
|
+
}
|
|
35
37
|
}
|
|
36
38
|
);
|
|
37
39
|
});
|
|
@@ -42,15 +44,22 @@ const formattedCols = computed(() => {
|
|
|
42
44
|
(typeof columns === "object" ? columns.xs : columns) ?? 1,
|
|
43
45
|
(acc, bp, value) => {
|
|
44
46
|
acc[`--${bp}-cols`] = `repeat(${value}, minmax(0, 1fr))`;
|
|
45
|
-
debug
|
|
47
|
+
if (debug) {
|
|
48
|
+
acc[`--${bp}-cols-count`] = value || 1;
|
|
49
|
+
}
|
|
46
50
|
}
|
|
47
51
|
);
|
|
48
52
|
});
|
|
49
|
-
const
|
|
53
|
+
const computedClasses = computed(() => {
|
|
50
54
|
return [
|
|
51
|
-
|
|
52
|
-
...Object.keys(formattedRows.value).map(
|
|
53
|
-
|
|
55
|
+
"pxd-grid relative grid max-w-full",
|
|
56
|
+
...Object.keys(formattedRows.value).map(
|
|
57
|
+
(bp) => presetGridRows[bp]
|
|
58
|
+
),
|
|
59
|
+
...Object.keys(formattedCols.value).map(
|
|
60
|
+
(bp) => presetGridCols[bp]
|
|
61
|
+
),
|
|
62
|
+
props.debug ? "debug" : ""
|
|
54
63
|
].join(" ");
|
|
55
64
|
});
|
|
56
65
|
const computedStyle = computed(() => {
|
|
@@ -62,12 +71,7 @@ const computedStyle = computed(() => {
|
|
|
62
71
|
</script>
|
|
63
72
|
|
|
64
73
|
<template>
|
|
65
|
-
<div
|
|
66
|
-
class="pxd-grid relative grid max-w-full"
|
|
67
|
-
:class="computedClass"
|
|
68
|
-
:style="computedStyle"
|
|
69
|
-
v-bind="$attrs"
|
|
70
|
-
>
|
|
74
|
+
<div :class="computedClasses" :style="computedStyle" v-bind="$attrs">
|
|
71
75
|
<slot />
|
|
72
76
|
</div>
|
|
73
77
|
</template>
|
|
@@ -38,15 +38,15 @@ const formattedCol = computed(() => {
|
|
|
38
38
|
(acc, bp, value) => acc[`--${bp}-col`] = value
|
|
39
39
|
);
|
|
40
40
|
});
|
|
41
|
-
const
|
|
42
|
-
const classes = [];
|
|
41
|
+
const computedClasses = computed(() => {
|
|
42
|
+
const classes = ["pxd-grid-item overflow-hidden"];
|
|
43
43
|
classes.push(
|
|
44
44
|
...Object.keys(formattedRow.value).map((bp) => presetGridRow[bp]),
|
|
45
45
|
...Object.keys(formattedCol.value).map((bp) => presetGridCol[bp])
|
|
46
46
|
);
|
|
47
47
|
return classes.join(" ");
|
|
48
48
|
});
|
|
49
|
-
const
|
|
49
|
+
const gridItemStyle = computed(() => {
|
|
50
50
|
return {
|
|
51
51
|
...formattedRow.value,
|
|
52
52
|
...formattedCol.value
|
|
@@ -55,7 +55,7 @@ const computedStyle = computed(() => {
|
|
|
55
55
|
</script>
|
|
56
56
|
|
|
57
57
|
<template>
|
|
58
|
-
<div
|
|
58
|
+
<div :class="computedClasses" :style="gridItemStyle" v-bind="$attrs">
|
|
59
59
|
<slot />
|
|
60
60
|
</div>
|
|
61
61
|
</template>
|
|
@@ -17,19 +17,22 @@ const props = defineProps({
|
|
|
17
17
|
shape: { type: String, required: false },
|
|
18
18
|
align: { type: String, required: false },
|
|
19
19
|
icon: { type: Boolean, required: false },
|
|
20
|
-
block: { type: Boolean, required: false },
|
|
21
20
|
loading: { type: Boolean, required: false },
|
|
22
|
-
disabled: { type: Boolean, required: false }
|
|
21
|
+
disabled: { type: Boolean, required: false },
|
|
22
|
+
fullWidth: { type: Boolean, required: false }
|
|
23
23
|
});
|
|
24
24
|
const emits = defineEmits(["confirm", "canceled", "finished", "pointerup", "pointerdown"]);
|
|
25
25
|
const status = shallowRef("idle");
|
|
26
26
|
const computedAttrs = computed(() => {
|
|
27
27
|
const { scalable, durations, maskColor, cancelable, ...rest } = props;
|
|
28
28
|
return {
|
|
29
|
-
class: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
class: [
|
|
30
|
+
"pxd-hold-button relative motion-safe:transition-all",
|
|
31
|
+
{
|
|
32
|
+
scalable,
|
|
33
|
+
effective: status.value !== "canceled"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
33
36
|
...rest
|
|
34
37
|
};
|
|
35
38
|
});
|
|
@@ -136,7 +139,7 @@ onBeforeUnmount(() => {
|
|
|
136
139
|
<template #suffix>
|
|
137
140
|
<slot name="suffix" />
|
|
138
141
|
<div
|
|
139
|
-
class="pxd-hold-button--overlay pointer-events-none absolute -inset-px rounded-inherit bg-(--hold-button-mask-color)"
|
|
142
|
+
class="pxd-hold-button--overlay pointer-events-none absolute -inset-px rounded-inherit bg-(--hold-button-mask-color) default-transition-timing-function!"
|
|
140
143
|
:class="{ finished: status === 'confirmed' }"
|
|
141
144
|
:style="computedStyle"
|
|
142
145
|
@transitionend="onTransitionEnd"
|
|
@@ -148,7 +151,7 @@ onBeforeUnmount(() => {
|
|
|
148
151
|
<style lang="postcss">
|
|
149
152
|
.pxd-hold-button {
|
|
150
153
|
&.scalable:not(.is-disabled):active {
|
|
151
|
-
transform: scale(.97);
|
|
154
|
+
transform: scale(0.97);
|
|
152
155
|
}
|
|
153
156
|
|
|
154
157
|
&:hover {
|
|
@@ -158,20 +161,23 @@ onBeforeUnmount(() => {
|
|
|
158
161
|
}
|
|
159
162
|
|
|
160
163
|
.pxd-hold-button--overlay {
|
|
161
|
-
--opacity: .45;
|
|
164
|
+
--opacity: 0.45;
|
|
162
165
|
opacity: var(--opacity);
|
|
163
166
|
clip-path: inset(0 100% 0 0);
|
|
164
|
-
transition:
|
|
167
|
+
transition:
|
|
168
|
+
clip-path 0.1s,
|
|
169
|
+
opacity 0s;
|
|
165
170
|
|
|
166
171
|
&.finished {
|
|
167
|
-
--opacity: .68;
|
|
172
|
+
--opacity: 0.68;
|
|
168
173
|
}
|
|
169
174
|
}
|
|
170
175
|
|
|
171
176
|
&.effective:not(.is-disabled):active .pxd-hold-button--overlay {
|
|
172
177
|
clip-path: inset(0px);
|
|
173
|
-
transition:
|
|
174
|
-
|
|
178
|
+
transition:
|
|
179
|
+
clip-path var(--hold-button-durations),
|
|
180
|
+
opacity var(--default-transition-duration);
|
|
175
181
|
}
|
|
176
182
|
}
|
|
177
183
|
</style>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare const inputVariant: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
size: {
|
|
3
|
+
xs: string;
|
|
4
|
+
sm: string;
|
|
5
|
+
md: string;
|
|
6
|
+
lg: string;
|
|
7
|
+
};
|
|
8
|
+
align: {
|
|
9
|
+
left: string;
|
|
10
|
+
center: string;
|
|
11
|
+
right: string;
|
|
12
|
+
};
|
|
13
|
+
disabled: {
|
|
14
|
+
true: string;
|
|
15
|
+
false: string;
|
|
16
|
+
};
|
|
17
|
+
readonly: {
|
|
18
|
+
true: string;
|
|
19
|
+
false: string;
|
|
20
|
+
};
|
|
21
|
+
error: {
|
|
22
|
+
true: string;
|
|
23
|
+
false: string;
|
|
24
|
+
};
|
|
25
|
+
}, undefined, "pxd-input pxd-input--border group relative flex w-full max-w-full items-center overflow-hidden bg-background-100 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:bg-gray-100 motion-safe:transition-all", {
|
|
26
|
+
size: {
|
|
27
|
+
xs: string;
|
|
28
|
+
sm: string;
|
|
29
|
+
md: string;
|
|
30
|
+
lg: string;
|
|
31
|
+
};
|
|
32
|
+
align: {
|
|
33
|
+
left: string;
|
|
34
|
+
center: string;
|
|
35
|
+
right: string;
|
|
36
|
+
};
|
|
37
|
+
disabled: {
|
|
38
|
+
true: string;
|
|
39
|
+
false: string;
|
|
40
|
+
};
|
|
41
|
+
readonly: {
|
|
42
|
+
true: string;
|
|
43
|
+
false: string;
|
|
44
|
+
};
|
|
45
|
+
error: {
|
|
46
|
+
true: string;
|
|
47
|
+
false: string;
|
|
48
|
+
};
|
|
49
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
50
|
+
size: {
|
|
51
|
+
xs: string;
|
|
52
|
+
sm: string;
|
|
53
|
+
md: string;
|
|
54
|
+
lg: string;
|
|
55
|
+
};
|
|
56
|
+
align: {
|
|
57
|
+
left: string;
|
|
58
|
+
center: string;
|
|
59
|
+
right: string;
|
|
60
|
+
};
|
|
61
|
+
disabled: {
|
|
62
|
+
true: string;
|
|
63
|
+
false: string;
|
|
64
|
+
};
|
|
65
|
+
readonly: {
|
|
66
|
+
true: string;
|
|
67
|
+
false: string;
|
|
68
|
+
};
|
|
69
|
+
error: {
|
|
70
|
+
true: string;
|
|
71
|
+
false: string;
|
|
72
|
+
};
|
|
73
|
+
}, undefined, "pxd-input pxd-input--border group relative flex w-full max-w-full items-center overflow-hidden bg-background-100 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:bg-gray-100 motion-safe:transition-all", unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
export const inputVariant = tv({
|
|
3
|
+
base: "pxd-input pxd-input--border group relative flex w-full max-w-full items-center overflow-hidden bg-background-100 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:bg-gray-100 motion-safe:transition-all",
|
|
4
|
+
variants: {
|
|
5
|
+
size: {
|
|
6
|
+
xs: "h-6 text-xs rounded-sm",
|
|
7
|
+
sm: "h-7.5 text-sm rounded-md",
|
|
8
|
+
md: "h-9 text-sm rounded-md",
|
|
9
|
+
lg: "h-10 text-base rounded-lg"
|
|
10
|
+
},
|
|
11
|
+
align: {
|
|
12
|
+
left: "text-left",
|
|
13
|
+
center: "text-center",
|
|
14
|
+
right: "text-right"
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
true: "is-disabled",
|
|
18
|
+
false: ""
|
|
19
|
+
},
|
|
20
|
+
readonly: {
|
|
21
|
+
true: "is-readonly",
|
|
22
|
+
false: ""
|
|
23
|
+
},
|
|
24
|
+
error: {
|
|
25
|
+
true: "is-error",
|
|
26
|
+
false: ""
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
size: "md",
|
|
31
|
+
align: "left",
|
|
32
|
+
disabled: false,
|
|
33
|
+
readonly: false,
|
|
34
|
+
error: false
|
|
35
|
+
}
|
|
36
|
+
});
|