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
|
@@ -11,7 +11,7 @@ const props = defineProps({
|
|
|
11
11
|
variant: { type: String, required: false, default: "stripe" },
|
|
12
12
|
textured: { type: Boolean, required: false, default: false }
|
|
13
13
|
});
|
|
14
|
-
const
|
|
14
|
+
const presetWidth = {
|
|
15
15
|
"--xs": "[--bw:var(--xs)]",
|
|
16
16
|
"--sm": "sm:[--bw:var(--sm)]",
|
|
17
17
|
"--md": "md:[--bw:var(--md)]",
|
|
@@ -33,10 +33,12 @@ const computedStyle = computed(() => {
|
|
|
33
33
|
"--book-background-color": color
|
|
34
34
|
};
|
|
35
35
|
});
|
|
36
|
-
const
|
|
37
|
-
const classes = [
|
|
36
|
+
const computedClasses = computed(() => {
|
|
37
|
+
const classes = [
|
|
38
|
+
"pxd-book--container relative w-fit duration-300 transform-3d motion-safe:transition-transform"
|
|
39
|
+
];
|
|
38
40
|
classes.push(
|
|
39
|
-
...Object.keys(formattedWidth.value).map((bp) =>
|
|
41
|
+
...Object.keys(formattedWidth.value).map((bp) => presetWidth[bp])
|
|
40
42
|
);
|
|
41
43
|
return classes.join(" ");
|
|
42
44
|
});
|
|
@@ -44,8 +46,10 @@ const computedClass = computed(() => {
|
|
|
44
46
|
|
|
45
47
|
<template>
|
|
46
48
|
<div class="pxd-book inline-flex w-fit">
|
|
47
|
-
<div :class="
|
|
48
|
-
<div
|
|
49
|
+
<div :class="computedClasses" :style="computedStyle">
|
|
50
|
+
<div
|
|
51
|
+
class="pxd-book--content translate-z-0 absolute flex size-full min-w-full flex-col overflow-hidden bg-background-200"
|
|
52
|
+
>
|
|
49
53
|
<div
|
|
50
54
|
v-if="variant === 'stripe'"
|
|
51
55
|
class="translate-z-0 relative flex w-full flex-1 shrink-0 overflow-hidden"
|
|
@@ -55,7 +59,10 @@ const computedClass = computed(() => {
|
|
|
55
59
|
<slot name="icon" />
|
|
56
60
|
</div>
|
|
57
61
|
|
|
58
|
-
<div
|
|
62
|
+
<div
|
|
63
|
+
aria-hidden="true"
|
|
64
|
+
class="pxd-book--spine left-0 absolute h-full mix-blend-overlay"
|
|
65
|
+
/>
|
|
59
66
|
</div>
|
|
60
67
|
|
|
61
68
|
<div
|
|
@@ -73,13 +80,41 @@ const computedClass = computed(() => {
|
|
|
73
80
|
|
|
74
81
|
<div v-if="variant === 'simple'" class="pxd-book--icon">
|
|
75
82
|
<slot name="icon">
|
|
76
|
-
<svg
|
|
83
|
+
<svg
|
|
84
|
+
fill="none"
|
|
85
|
+
height="56"
|
|
86
|
+
viewBox="0 0 36 56"
|
|
87
|
+
width="36"
|
|
88
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
89
|
+
>
|
|
90
|
+
<path
|
|
91
|
+
clip-rule="evenodd"
|
|
92
|
+
d="M3.03113 28.0005C6.26017 23.1765 11.7592 20.0005 18 20.0005C24.2409 20.0005 29.7399 23.1765 32.9689 28.0005C29.7399 32.8244 24.2409 36.0005 18 36.0005C11.7592 36.0005 6.26017 32.8244 3.03113 28.0005Z"
|
|
93
|
+
fill="#0070F3"
|
|
94
|
+
fill-rule="evenodd"
|
|
95
|
+
/>
|
|
96
|
+
<path
|
|
97
|
+
clip-rule="evenodd"
|
|
98
|
+
d="M32.9691 28.0012C34.8835 25.1411 36 21.7017 36 18.0015C36 8.06034 27.9411 0.00146484 18 0.00146484C8.05887 0.00146484 0 8.06034 0 18.0015C0 21.7017 1.11648 25.1411 3.03094 28.0012C6.25996 23.1771 11.7591 20.001 18 20.001C24.2409 20.001 29.74 23.1771 32.9691 28.0012Z"
|
|
99
|
+
fill="#45DEC4"
|
|
100
|
+
fill-rule="evenodd"
|
|
101
|
+
/>
|
|
102
|
+
<path
|
|
103
|
+
clip-rule="evenodd"
|
|
104
|
+
d="M32.9692 28.0005C29.7402 32.8247 24.241 36.001 18 36.001C11.759 36.001 6.25977 32.8247 3.03077 28.0005C1.11642 30.8606 0 34.2999 0 38C0 47.9411 8.05887 56 18 56C27.9411 56 36 47.9411 36 38C36 34.2999 34.8836 30.8606 32.9692 28.0005Z"
|
|
105
|
+
fill="#E5484D"
|
|
106
|
+
fill-rule="evenodd"
|
|
107
|
+
/>
|
|
108
|
+
</svg>
|
|
77
109
|
</slot>
|
|
78
110
|
</div>
|
|
79
111
|
</div>
|
|
80
112
|
</div>
|
|
81
113
|
|
|
82
|
-
<div
|
|
114
|
+
<div
|
|
115
|
+
v-if="textured"
|
|
116
|
+
class="pxd-book--textured inset-0 pointer-events-none absolute bg-cover opacity-50"
|
|
117
|
+
/>
|
|
83
118
|
</div>
|
|
84
119
|
|
|
85
120
|
<div aria-hidden="true" class="pxd-book--pages absolute" />
|
|
@@ -97,7 +132,28 @@ const computedClass = computed(() => {
|
|
|
97
132
|
--hover-scale: 1.066;
|
|
98
133
|
--hover-translate-x: -8px;
|
|
99
134
|
--aspect-ratio: 49 / 60;
|
|
100
|
-
--bg-shadow:
|
|
135
|
+
--bg-shadow:
|
|
136
|
+
linear-gradient(
|
|
137
|
+
90deg,
|
|
138
|
+
rgba(255, 255, 255, 0),
|
|
139
|
+
rgba(255, 255, 255, 0) 12%,
|
|
140
|
+
rgba(255, 255, 255, 0.25) 29.25%,
|
|
141
|
+
rgba(255, 255, 255, 0) 50.5%,
|
|
142
|
+
rgba(255, 255, 255, 0) 75.25%,
|
|
143
|
+
rgba(255, 255, 255, 0.25) 91%,
|
|
144
|
+
rgba(255, 255, 255, 0)
|
|
145
|
+
),
|
|
146
|
+
linear-gradient(
|
|
147
|
+
90deg,
|
|
148
|
+
rgba(0, 0, 0, 0.03),
|
|
149
|
+
rgba(0, 0, 0, 0.1) 12%,
|
|
150
|
+
rgba(0, 0, 0, 0) 30%,
|
|
151
|
+
rgba(0, 0, 0, 0.02) 50%,
|
|
152
|
+
rgba(0, 0, 0, 0.2) 73.5%,
|
|
153
|
+
rgba(0, 0, 0, 0.5) 75.25%,
|
|
154
|
+
rgba(0, 0, 0, 0.15) 85.25%,
|
|
155
|
+
rgba(0, 0, 0, 0)
|
|
156
|
+
);
|
|
101
157
|
|
|
102
158
|
perspective: 900px;
|
|
103
159
|
}
|
|
@@ -111,7 +167,10 @@ const computedClass = computed(() => {
|
|
|
111
167
|
|
|
112
168
|
.pxd-book--content {
|
|
113
169
|
border-radius: var(--book-border-radius);
|
|
114
|
-
box-shadow:
|
|
170
|
+
box-shadow:
|
|
171
|
+
0 1px 1px 0 rgba(0, 0, 0, 0.02),
|
|
172
|
+
0 4px 8px -4px rgba(0, 0, 0, 0.1),
|
|
173
|
+
0 16px 24px -8px rgba(0, 0, 0, 0.03);
|
|
115
174
|
|
|
116
175
|
&::after {
|
|
117
176
|
content: '';
|
|
@@ -126,9 +185,21 @@ const computedClass = computed(() => {
|
|
|
126
185
|
}
|
|
127
186
|
}
|
|
128
187
|
|
|
129
|
-
.dark .pxd-book--content{
|
|
130
|
-
background:
|
|
131
|
-
|
|
188
|
+
.dark .pxd-book--content {
|
|
189
|
+
background:
|
|
190
|
+
linear-gradient(
|
|
191
|
+
180deg,
|
|
192
|
+
rgba(255, 255, 255, 0.1),
|
|
193
|
+
rgba(255, 255, 255, 0) 50%,
|
|
194
|
+
rgba(255, 255, 255, 0)
|
|
195
|
+
),
|
|
196
|
+
hsla(0, 0%, 12%, 1);
|
|
197
|
+
box-shadow:
|
|
198
|
+
0 1.8px 3.6px rgba(0, 0, 0, 0.05),
|
|
199
|
+
0 10.8px 21.6px rgba(0, 0, 0, 0.08),
|
|
200
|
+
inset 0 -0.9px 0 rgba(0, 0, 0, 0.1),
|
|
201
|
+
inset 0 1.8px 1.8px rgba(255, 255, 255, 0.1),
|
|
202
|
+
inset 3.6px 0 3.6px rgba(0, 0, 0, 0.1);
|
|
132
203
|
}
|
|
133
204
|
|
|
134
205
|
.pxd-book--content-inner {
|
|
@@ -158,14 +229,15 @@ const computedClass = computed(() => {
|
|
|
158
229
|
.pxd-book--title {
|
|
159
230
|
line-height: 1.25em;
|
|
160
231
|
font-size: 12cqw;
|
|
161
|
-
letter-spacing:
|
|
232
|
+
letter-spacing: -0.02em;
|
|
162
233
|
}
|
|
163
234
|
|
|
164
235
|
.pxd-book--pages {
|
|
165
236
|
top: 3px;
|
|
166
237
|
height: calc(100% - 2 * 3px);
|
|
167
238
|
width: calc(var(--book-depth) - 2px);
|
|
168
|
-
transform: translateX(calc(var(--bw) * 1px - var(--book-depth) / 2 - 3px)) rotateY(90deg)
|
|
239
|
+
transform: translateX(calc(var(--bw) * 1px - var(--book-depth) / 2 - 3px)) rotateY(90deg)
|
|
240
|
+
translateX(calc(var(--book-depth) / 2));
|
|
169
241
|
background: linear-gradient(90deg, #eaeaea, transparent 70%), linear-gradient(#fff, #fafafa);
|
|
170
242
|
}
|
|
171
243
|
|
|
@@ -176,6 +248,7 @@ const computedClass = computed(() => {
|
|
|
176
248
|
|
|
177
249
|
.pxd-book:hover .pxd-book--container {
|
|
178
250
|
will-change: transform;
|
|
179
|
-
transform: rotateY(var(--hover-rotate)) scale(var(--hover-scale))
|
|
251
|
+
transform: rotateY(var(--hover-rotate)) scale(var(--hover-scale))
|
|
252
|
+
translateX(var(--hover-translate-x));
|
|
180
253
|
}
|
|
181
254
|
</style>
|
|
@@ -20,29 +20,42 @@ const renderIcon = computed(() => isCopied.value ? CheckIcon : CopyIcon);
|
|
|
20
20
|
<template>
|
|
21
21
|
<div class="pxd-browser overflow-hidden rounded-md bg-background-200 shadow-border-small">
|
|
22
22
|
<div class="py-2.5 px-5 gap-4 md:gap-6 flex justify-between bg-background-100">
|
|
23
|
-
<div
|
|
23
|
+
<div
|
|
24
|
+
class="gap-4 min-w-0 md:first:max-w-35 md:last:max-w-35 max-md:first:flex-none flex flex-1 items-center justify-center first:justify-start last:justify-end"
|
|
25
|
+
>
|
|
24
26
|
<div class="gap-2 flex items-center">
|
|
25
27
|
<div class="w-3 h-3 rounded-full bg-[#FE5F57]" />
|
|
26
28
|
<div class="w-3 h-3 rounded-full bg-[#FEBB2E]" />
|
|
27
29
|
<div class="w-3 h-3 rounded-full bg-[#26C941]" />
|
|
28
30
|
</div>
|
|
29
31
|
|
|
30
|
-
<div class="gap-4 text-sm flex items-center text-gray-900
|
|
32
|
+
<div class="gap-4 text-sm max-md:hidden flex items-center text-gray-900">
|
|
31
33
|
<ArrowLeftIcon />
|
|
32
34
|
<ArrowLeftIcon class="rotate-180" />
|
|
33
35
|
<RefreshClockwiseIcon />
|
|
34
36
|
</div>
|
|
35
37
|
</div>
|
|
36
38
|
|
|
37
|
-
<div
|
|
38
|
-
|
|
39
|
+
<div
|
|
40
|
+
class="gap-4 min-w-0 md:first:max-w-35 md:last:max-w-35 max-md:first:flex-none flex flex-1 shrink-0 items-center justify-center first:justify-start last:justify-end"
|
|
41
|
+
>
|
|
42
|
+
<div
|
|
43
|
+
class="lg:max-w-xs pl-2.5 pr-1 py-1 flex w-full items-center justify-between rounded-full border border-gray-400 bg-background-200"
|
|
44
|
+
>
|
|
39
45
|
<LockClosedIcon class="text-sm text-foreground-secondary" />
|
|
40
46
|
|
|
41
47
|
<div class="pl-1.5 min-w-0 flex-1 truncate text-center text-13px text-gray-1000">
|
|
42
48
|
{{ address }}
|
|
43
49
|
</div>
|
|
44
50
|
|
|
45
|
-
<PButton
|
|
51
|
+
<PButton
|
|
52
|
+
variant="ghost"
|
|
53
|
+
size="xs"
|
|
54
|
+
shape="rounded"
|
|
55
|
+
class="size-6"
|
|
56
|
+
icon
|
|
57
|
+
@click="copyText(address)"
|
|
58
|
+
>
|
|
46
59
|
<Transition name="pxd-transition--fade-scale" mode="out-in">
|
|
47
60
|
<Component :is="renderIcon" class="text-sm text-foreground-secondary" />
|
|
48
61
|
</Transition>
|
|
@@ -50,7 +63,9 @@ const renderIcon = computed(() => isCopied.value ? CheckIcon : CopyIcon);
|
|
|
50
63
|
</div>
|
|
51
64
|
</div>
|
|
52
65
|
|
|
53
|
-
<div
|
|
66
|
+
<div
|
|
67
|
+
class="gap-4 min-w-0 md:first:max-w-35 md:last:max-w-35 max-md:first:flex-none max-lg:hidden flex flex-1 items-center justify-center first:justify-start last:justify-end"
|
|
68
|
+
/>
|
|
54
69
|
</div>
|
|
55
70
|
|
|
56
71
|
<slot />
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
size: {
|
|
3
|
+
xs: string;
|
|
4
|
+
sm: string;
|
|
5
|
+
md: string;
|
|
6
|
+
lg: string;
|
|
7
|
+
};
|
|
8
|
+
shape: {
|
|
9
|
+
square: string;
|
|
10
|
+
rounded: string;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
align: {
|
|
14
|
+
left: string;
|
|
15
|
+
center: string;
|
|
16
|
+
right: string;
|
|
17
|
+
};
|
|
18
|
+
variant: {
|
|
19
|
+
simple: string;
|
|
20
|
+
icon: string;
|
|
21
|
+
link: string;
|
|
22
|
+
default: string;
|
|
23
|
+
ghost: string;
|
|
24
|
+
primary: string;
|
|
25
|
+
error: string;
|
|
26
|
+
warning: string;
|
|
27
|
+
success: string;
|
|
28
|
+
};
|
|
29
|
+
disabled: {
|
|
30
|
+
true: string;
|
|
31
|
+
};
|
|
32
|
+
fullWidth: {
|
|
33
|
+
true: string;
|
|
34
|
+
};
|
|
35
|
+
icon: {
|
|
36
|
+
true: string;
|
|
37
|
+
};
|
|
38
|
+
loading: {
|
|
39
|
+
true: string;
|
|
40
|
+
};
|
|
41
|
+
}, undefined, "pxd-button inline-flex shrink-0 cursor-pointer touch-manipulation items-center font-inherit select-none motion-safe:transition-all", {
|
|
42
|
+
size: {
|
|
43
|
+
xs: string;
|
|
44
|
+
sm: string;
|
|
45
|
+
md: string;
|
|
46
|
+
lg: string;
|
|
47
|
+
};
|
|
48
|
+
shape: {
|
|
49
|
+
square: string;
|
|
50
|
+
rounded: string;
|
|
51
|
+
default: string;
|
|
52
|
+
};
|
|
53
|
+
align: {
|
|
54
|
+
left: string;
|
|
55
|
+
center: string;
|
|
56
|
+
right: string;
|
|
57
|
+
};
|
|
58
|
+
variant: {
|
|
59
|
+
simple: string;
|
|
60
|
+
icon: string;
|
|
61
|
+
link: string;
|
|
62
|
+
default: string;
|
|
63
|
+
ghost: string;
|
|
64
|
+
primary: string;
|
|
65
|
+
error: string;
|
|
66
|
+
warning: string;
|
|
67
|
+
success: string;
|
|
68
|
+
};
|
|
69
|
+
disabled: {
|
|
70
|
+
true: string;
|
|
71
|
+
};
|
|
72
|
+
fullWidth: {
|
|
73
|
+
true: string;
|
|
74
|
+
};
|
|
75
|
+
icon: {
|
|
76
|
+
true: string;
|
|
77
|
+
};
|
|
78
|
+
loading: {
|
|
79
|
+
true: string;
|
|
80
|
+
};
|
|
81
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
82
|
+
size: {
|
|
83
|
+
xs: string;
|
|
84
|
+
sm: string;
|
|
85
|
+
md: string;
|
|
86
|
+
lg: string;
|
|
87
|
+
};
|
|
88
|
+
shape: {
|
|
89
|
+
square: string;
|
|
90
|
+
rounded: string;
|
|
91
|
+
default: string;
|
|
92
|
+
};
|
|
93
|
+
align: {
|
|
94
|
+
left: string;
|
|
95
|
+
center: string;
|
|
96
|
+
right: string;
|
|
97
|
+
};
|
|
98
|
+
variant: {
|
|
99
|
+
simple: string;
|
|
100
|
+
icon: string;
|
|
101
|
+
link: string;
|
|
102
|
+
default: string;
|
|
103
|
+
ghost: string;
|
|
104
|
+
primary: string;
|
|
105
|
+
error: string;
|
|
106
|
+
warning: string;
|
|
107
|
+
success: string;
|
|
108
|
+
};
|
|
109
|
+
disabled: {
|
|
110
|
+
true: string;
|
|
111
|
+
};
|
|
112
|
+
fullWidth: {
|
|
113
|
+
true: string;
|
|
114
|
+
};
|
|
115
|
+
icon: {
|
|
116
|
+
true: string;
|
|
117
|
+
};
|
|
118
|
+
loading: {
|
|
119
|
+
true: string;
|
|
120
|
+
};
|
|
121
|
+
}, undefined, "pxd-button inline-flex shrink-0 cursor-pointer touch-manipulation items-center font-inherit select-none motion-safe:transition-all", unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
export const buttonVariants = tv({
|
|
3
|
+
base: "pxd-button inline-flex shrink-0 cursor-pointer touch-manipulation items-center font-inherit select-none motion-safe:transition-all",
|
|
4
|
+
variants: {
|
|
5
|
+
size: {
|
|
6
|
+
xs: "h-6 px-1 text-sm rounded-sm",
|
|
7
|
+
sm: "h-7.5 px-1.5 text-sm rounded-md",
|
|
8
|
+
md: "h-9 px-2.5 text-sm rounded-md",
|
|
9
|
+
lg: "h-10 px-3.5 text-base rounded-lg"
|
|
10
|
+
},
|
|
11
|
+
shape: {
|
|
12
|
+
square: "rounded-none",
|
|
13
|
+
rounded: "rounded-full",
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
align: {
|
|
17
|
+
left: "justify-start",
|
|
18
|
+
center: "justify-center",
|
|
19
|
+
right: "justify-end"
|
|
20
|
+
},
|
|
21
|
+
variant: {
|
|
22
|
+
simple: "",
|
|
23
|
+
icon: "p-0! aspect-square",
|
|
24
|
+
link: "font-medium hover:underline hover:opacity-70 active:opacity-90 motion-safe:transition-opacity",
|
|
25
|
+
default: "border-input bg-background-100 text-foreground hover:bg-background-hover active:bg-background-active",
|
|
26
|
+
ghost: "border-transparent bg-transparent text-foreground hover:bg-background-hover active:bg-background-active",
|
|
27
|
+
primary: "border-transparent bg-primary text-gray-100 hover:bg-primary-hover active:bg-primary-active",
|
|
28
|
+
error: "text-white border-transparent bg-red-800 hover:bg-red-700 active:bg-red-900",
|
|
29
|
+
warning: "text-black border-transparent bg-amber-800 hover:bg-amber-700 active:bg-amber-900",
|
|
30
|
+
success: "text-white border-transparent bg-green-800 hover:bg-green-700 active:bg-green-900"
|
|
31
|
+
},
|
|
32
|
+
disabled: {
|
|
33
|
+
true: "is-disabled hover:bg-gray-100 active:bg-gray-100 disabled:cursor-not-allowed disabled:border-gray-300 disabled:bg-gray-100 disabled:text-gray-700"
|
|
34
|
+
},
|
|
35
|
+
fullWidth: {
|
|
36
|
+
true: "w-full"
|
|
37
|
+
},
|
|
38
|
+
icon: {
|
|
39
|
+
true: "p-0! aspect-square"
|
|
40
|
+
},
|
|
41
|
+
loading: {
|
|
42
|
+
true: ""
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
compoundVariants: [
|
|
46
|
+
{
|
|
47
|
+
variant: ["default", "ghost", "primary", "error", "warning", "success"],
|
|
48
|
+
class: "border self-focus-ring outline-none"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
icon: true,
|
|
52
|
+
class: "p-0! aspect-square"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
});
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import type { ButtonProps } from '../../types/components/button';
|
|
2
|
-
declare var
|
|
2
|
+
declare var __VLS_13: {}, __VLS_15: {}, __VLS_17: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
|
-
prefix?: (props: typeof
|
|
4
|
+
prefix?: (props: typeof __VLS_13) => any;
|
|
5
5
|
} & {
|
|
6
|
-
default?: (props: typeof
|
|
6
|
+
default?: (props: typeof __VLS_15) => any;
|
|
7
7
|
} & {
|
|
8
|
-
suffix?: (props: typeof
|
|
8
|
+
suffix?: (props: typeof __VLS_17) => any;
|
|
9
9
|
};
|
|
10
|
-
declare const __VLS_base: import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
-
click: (args_0: MouseEvent) => any;
|
|
12
|
-
dblclick: (args_0: MouseEvent) => any;
|
|
13
|
-
}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{
|
|
14
|
-
onClick?: ((args_0: MouseEvent) => any) | undefined;
|
|
15
|
-
onDblclick?: ((args_0: MouseEvent) => any) | undefined;
|
|
16
|
-
}>, {
|
|
17
|
-
as: import("../../types/shared").ComponentAs;
|
|
18
|
-
variant: import("../../types/shared").ComponentVariantWithDefault | "ghost" | "simple" | "icon";
|
|
19
|
-
align: "left" | "center" | "right";
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
|
|
20
11
|
icon: boolean;
|
|
12
|
+
variant: import("../../types/components/button").ButtonVariant;
|
|
13
|
+
align: "left" | "center" | "right";
|
|
14
|
+
as: import("../../types/shared").ComponentAs;
|
|
21
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
16
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
17
|
declare const _default: typeof __VLS_export;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { useConfigProvider } from "../../composables/use-config-provider-context";
|
|
4
4
|
import { isTruthyProp } from "../../utils/format";
|
|
5
|
-
import { getFallbackValue } from "../../utils/get";
|
|
6
5
|
import PSpinner from "../spinner/index.vue";
|
|
6
|
+
import { buttonVariants } from "./cn";
|
|
7
7
|
defineOptions({
|
|
8
|
-
name: "PButton"
|
|
8
|
+
name: "PButton",
|
|
9
|
+
inheritAttrs: false
|
|
9
10
|
});
|
|
10
11
|
const props = defineProps({
|
|
11
12
|
as: { type: null, required: false, default: "button" },
|
|
@@ -14,88 +15,35 @@ const props = defineProps({
|
|
|
14
15
|
shape: { type: String, required: false },
|
|
15
16
|
align: { type: String, required: false, default: "center" },
|
|
16
17
|
icon: { type: Boolean, required: false, default: false },
|
|
17
|
-
block: { type: Boolean, required: false },
|
|
18
18
|
loading: { type: Boolean, required: false },
|
|
19
|
-
disabled: { type: Boolean, required: false }
|
|
19
|
+
disabled: { type: Boolean, required: false },
|
|
20
|
+
fullWidth: { type: Boolean, required: false }
|
|
20
21
|
});
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
const FONT_SIZES = {
|
|
38
|
-
xs: "text-sm",
|
|
39
|
-
sm: "text-sm",
|
|
40
|
-
md: "text-sm",
|
|
41
|
-
lg: "text-base"
|
|
42
|
-
};
|
|
43
|
-
const VARIANTS = {
|
|
44
|
-
simple: "",
|
|
45
|
-
default: "bg-background-100 text-foreground hover:bg-background-hover active:bg-background-active border-input",
|
|
46
|
-
ghost: "bg-transparent text-foreground hover:bg-background-hover active:bg-background-active border-transparent",
|
|
47
|
-
primary: "bg-primary text-gray-100 hover:bg-primary-hover active:bg-primary-active border-transparent",
|
|
48
|
-
error: "bg-red-800 text-white hover:bg-red-700 active:bg-red-900 border-transparent",
|
|
49
|
-
warning: "bg-amber-800 text-black hover:bg-amber-700 active:bg-amber-900 border-transparent",
|
|
50
|
-
success: "bg-green-800 text-white hover:bg-green-700 active:bg-green-900 border-transparent"
|
|
51
|
-
};
|
|
52
|
-
const ALIGNMENTS = {
|
|
53
|
-
left: "justify-start",
|
|
54
|
-
center: "justify-center",
|
|
55
|
-
right: "justify-end"
|
|
56
|
-
};
|
|
57
|
-
const DISABLED_CLASS_NAMES = "is-disabled disabled:bg-gray-100 hover:bg-gray-100 active:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-700 disabled:border-gray-300";
|
|
58
|
-
const config = useConfigProvider();
|
|
59
|
-
const computedDisabled = computed(() => isTruthyProp(props.disabled) || isTruthyProp(props.loading));
|
|
60
|
-
const computedClass = computed(() => {
|
|
61
|
-
const classes = ["pxd-button shrink-0 cursor-pointer touch-manipulation items-center font-inherit select-none motion-safe:transition-all", ALIGNMENTS[props.align]];
|
|
62
|
-
const { variant, block, shape, icon } = props;
|
|
63
|
-
classes.push(
|
|
64
|
-
isTruthyProp(block) ? "flex w-full" : "inline-flex",
|
|
65
|
-
getFallbackValue(props.size, FONT_SIZES, config.size),
|
|
66
|
-
shape ? ROUNDED[shape] : getFallbackValue(props.size, ROUNDED, config.size)
|
|
67
|
-
);
|
|
68
|
-
if (isTruthyProp(icon)) {
|
|
69
|
-
classes.push("aspect-square !p-0");
|
|
70
|
-
}
|
|
71
|
-
if (variant !== "simple") {
|
|
72
|
-
classes.push(
|
|
73
|
-
"border outline-none self-focus-ring",
|
|
74
|
-
getFallbackValue(variant, VARIANTS),
|
|
75
|
-
getFallbackValue(props.size, SIZES, config.size)
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
if (computedDisabled.value) {
|
|
79
|
-
classes.push(DISABLED_CLASS_NAMES);
|
|
80
|
-
}
|
|
81
|
-
return classes.join(" ");
|
|
22
|
+
const configProvider = useConfigProvider();
|
|
23
|
+
const computedDisabled = computed(
|
|
24
|
+
() => isTruthyProp(props.disabled) || isTruthyProp(props.loading)
|
|
25
|
+
);
|
|
26
|
+
const computedClasses = computed(() => {
|
|
27
|
+
const { size = configProvider.size, shape, align, variant, fullWidth, icon } = props;
|
|
28
|
+
return buttonVariants({
|
|
29
|
+
icon,
|
|
30
|
+
size,
|
|
31
|
+
shape,
|
|
32
|
+
align,
|
|
33
|
+
variant,
|
|
34
|
+
fullWidth,
|
|
35
|
+
disabled: computedDisabled.value
|
|
36
|
+
});
|
|
82
37
|
});
|
|
83
|
-
function onButtonClick(event) {
|
|
84
|
-
emits("click", event);
|
|
85
|
-
}
|
|
86
|
-
function onButtonDblClick(event) {
|
|
87
|
-
emits("dblclick", event);
|
|
88
|
-
}
|
|
89
38
|
</script>
|
|
90
39
|
|
|
91
40
|
<template>
|
|
92
41
|
<Component
|
|
93
42
|
:is="as"
|
|
94
43
|
role="button"
|
|
95
|
-
:class="
|
|
44
|
+
:class="computedClasses"
|
|
96
45
|
:disabled="computedDisabled"
|
|
97
|
-
|
|
98
|
-
@dblclick.prevent="onButtonDblClick"
|
|
46
|
+
v-bind="$attrs"
|
|
99
47
|
>
|
|
100
48
|
<PSpinner v-if="loading" />
|
|
101
49
|
|
|
@@ -13,8 +13,8 @@ declare const __VLS_base: import("vue").DefineComponent<CarouselGroupProps, {},
|
|
|
13
13
|
}, string, import("vue").PublicProps, Readonly<CarouselGroupProps> & Readonly<{
|
|
14
14
|
onChange?: ((index: number) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
|
-
height: number | string;
|
|
17
16
|
index: number;
|
|
17
|
+
height: number | string;
|
|
18
18
|
loop: boolean;
|
|
19
19
|
arrow: boolean;
|
|
20
20
|
autoplay: boolean;
|