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.
Files changed (258) hide show
  1. package/README.md +6 -3
  2. package/dist/components/active-graph/index.d.vue.ts +0 -2
  3. package/dist/components/active-graph/index.vue +35 -37
  4. package/dist/components/avatar/index.d.vue.ts +2 -2
  5. package/dist/components/avatar/index.vue +17 -16
  6. package/dist/components/avatar-group/index.d.vue.ts +1 -1
  7. package/dist/components/avatar-group/index.vue +4 -1
  8. package/dist/components/badge/cn.d.ts +90 -0
  9. package/dist/components/badge/cn.js +44 -0
  10. package/dist/components/badge/index.d.vue.ts +5 -33
  11. package/dist/components/badge/index.vue +10 -56
  12. package/dist/components/book/index.vue +90 -17
  13. package/dist/components/browser/index.vue +21 -6
  14. package/dist/components/button/cn.d.ts +121 -0
  15. package/dist/components/button/cn.js +55 -0
  16. package/dist/components/button/index.d.vue.ts +8 -14
  17. package/dist/components/button/index.vue +22 -74
  18. package/dist/components/carousel-group/index.d.vue.ts +1 -1
  19. package/dist/components/carousel-group/index.vue +32 -28
  20. package/dist/components/checkbox/cn.d.ts +67 -0
  21. package/dist/components/checkbox/cn.js +31 -0
  22. package/dist/components/checkbox/index.vue +9 -19
  23. package/dist/components/chip/cn.d.ts +49 -0
  24. package/dist/components/chip/cn.js +26 -0
  25. package/dist/components/chip/index.vue +13 -21
  26. package/dist/components/choicebox/index.vue +1 -1
  27. package/dist/components/choicebox-group/index.vue +6 -3
  28. package/dist/components/collapse/index.vue +7 -1
  29. package/dist/components/collapse-group/index.vue +7 -7
  30. package/dist/components/command-menu/index.vue +9 -8
  31. package/dist/components/command-menu-group/index.vue +4 -1
  32. package/dist/components/config-provider/index.d.vue.ts +1 -0
  33. package/dist/components/config-provider/index.vue +2 -1
  34. package/dist/components/countdown/index.vue +2 -10
  35. package/dist/components/dash-line/index.vue +22 -16
  36. package/dist/components/description/index.vue +4 -2
  37. package/dist/components/drawer/index.vue +19 -11
  38. package/dist/components/empty-state/index.vue +3 -1
  39. package/dist/components/error/cn.d.ts +22 -0
  40. package/dist/components/error/cn.js +15 -0
  41. package/dist/components/error/index.vue +13 -14
  42. package/dist/components/fader/index.vue +30 -14
  43. package/dist/components/gauge/index.vue +6 -6
  44. package/dist/components/grid/index.vue +16 -12
  45. package/dist/components/grid-item/index.vue +4 -4
  46. package/dist/components/hold-button/index.vue +19 -13
  47. package/dist/components/input/cn.d.ts +73 -0
  48. package/dist/components/input/cn.js +36 -0
  49. package/dist/components/input/index.d.vue.ts +14 -16
  50. package/dist/components/input/index.vue +74 -101
  51. package/dist/components/intersection-observer/index.vue +7 -3
  52. package/dist/components/kbd/index.vue +2 -2
  53. package/dist/components/link-button/index.d.vue.ts +8 -8
  54. package/dist/components/link-button/index.vue +17 -25
  55. package/dist/components/list/index.d.vue.ts +0 -1
  56. package/dist/components/list/index.vue +58 -57
  57. package/dist/components/list-item/cn.d.ts +22 -0
  58. package/dist/components/list-item/cn.js +15 -0
  59. package/dist/components/list-item/index.d.vue.ts +3 -3
  60. package/dist/components/list-item/index.vue +14 -25
  61. package/dist/components/loading-bar/cn.d.ts +70 -0
  62. package/dist/components/loading-bar/cn.js +32 -0
  63. package/dist/components/loading-bar/index.d.vue.ts +2 -0
  64. package/dist/components/loading-bar/index.vue +68 -61
  65. package/dist/components/loading-dots/index.vue +12 -4
  66. package/dist/components/menu/index.d.vue.ts +2 -2
  67. package/dist/components/menu/index.vue +4 -4
  68. package/dist/components/message/index.vue +82 -48
  69. package/dist/components/message-item/index.vue +7 -2
  70. package/dist/components/modal/index.vue +20 -12
  71. package/dist/components/more-button/index.d.vue.ts +1 -3
  72. package/dist/components/more-button/index.vue +7 -17
  73. package/dist/components/note/cn.d.ts +121 -0
  74. package/dist/components/note/cn.js +66 -0
  75. package/dist/components/note/index.d.vue.ts +3 -39
  76. package/dist/components/note/index.vue +18 -37
  77. package/dist/components/number-input/index.d.vue.ts +19 -10
  78. package/dist/components/number-input/index.vue +121 -75
  79. package/dist/components/overlay/index.vue +4 -20
  80. package/dist/components/pagination/index.vue +25 -8
  81. package/dist/components/pin-input/cn.d.ts +46 -0
  82. package/dist/components/pin-input/cn.js +25 -0
  83. package/dist/components/pin-input/index.vue +11 -20
  84. package/dist/components/placeholder/index.vue +11 -4
  85. package/dist/components/popover/index.d.vue.ts +4 -3
  86. package/dist/components/popover/index.vue +107 -54
  87. package/dist/components/progress/cn.d.ts +19 -0
  88. package/dist/components/progress/cn.js +14 -0
  89. package/dist/components/progress/index.d.vue.ts +1 -1
  90. package/dist/components/progress/index.vue +21 -14
  91. package/dist/components/radio/cn.d.ts +46 -0
  92. package/dist/components/radio/cn.js +42 -0
  93. package/dist/components/radio/index.vue +11 -18
  94. package/dist/components/resizable/index.vue +8 -2
  95. package/dist/components/resizable-handle/index.vue +1 -0
  96. package/dist/components/resizable-panel/index.vue +12 -11
  97. package/dist/components/skeleton/cn.d.ts +43 -0
  98. package/dist/components/skeleton/cn.js +24 -0
  99. package/dist/components/skeleton/index.d.vue.ts +4 -3
  100. package/dist/components/skeleton/index.vue +11 -20
  101. package/dist/components/slider/index.d.vue.ts +1 -1
  102. package/dist/components/slider/index.vue +14 -12
  103. package/dist/components/snippet/cn.d.ts +52 -0
  104. package/dist/components/snippet/cn.js +27 -0
  105. package/dist/components/snippet/index.vue +21 -29
  106. package/dist/components/spinner/index.vue +3 -1
  107. package/dist/components/stack/cn.d.ts +70 -0
  108. package/dist/components/stack/cn.js +33 -0
  109. package/dist/components/stack/index.d.vue.ts +2 -2
  110. package/dist/components/stack/index.vue +16 -31
  111. package/dist/components/status-dot/index.vue +5 -1
  112. package/dist/components/switch/cn.d.ts +16 -0
  113. package/dist/components/switch/cn.js +13 -0
  114. package/dist/components/switch/index.vue +5 -11
  115. package/dist/components/switch-group/index.vue +7 -4
  116. package/dist/components/text/cn.d.ts +67 -0
  117. package/dist/components/text/cn.js +34 -0
  118. package/dist/components/text/index.d.vue.ts +1 -1
  119. package/dist/components/text/index.vue +16 -25
  120. package/dist/components/textarea/cn.d.ts +58 -0
  121. package/dist/components/textarea/cn.js +30 -0
  122. package/dist/components/textarea/index.d.vue.ts +2 -0
  123. package/dist/components/textarea/index.vue +17 -24
  124. package/dist/components/theme-switcher/index.vue +6 -3
  125. package/dist/components/time-picker/index.d.vue.ts +2 -2
  126. package/dist/components/time-picker/index.vue +45 -25
  127. package/dist/components/toggle/index.vue +10 -6
  128. package/dist/components/tooltip/index.vue +3 -3
  129. package/dist/components/virtual-list/index.vue +1 -7
  130. package/dist/composables/use-browser-observer.d.ts +1 -1
  131. package/dist/composables/use-browser-observer.js +19 -15
  132. package/dist/composables/use-config-provider-context.d.ts +1 -0
  133. package/dist/composables/use-config-provider-context.js +5 -10
  134. package/dist/composables/use-countdown.js +1 -3
  135. package/dist/composables/use-deferred-value.js +1 -5
  136. package/dist/composables/use-delay-change.js +1 -4
  137. package/dist/composables/use-delay-destroy.js +1 -5
  138. package/dist/composables/use-loading-bar.d.ts +6 -14
  139. package/dist/composables/use-loading-bar.js +3 -14
  140. package/dist/composables/use-message.d.ts +9 -3
  141. package/dist/composables/use-message.js +9 -9
  142. package/dist/composables/use-model-value.d.ts +1 -0
  143. package/dist/composables/use-model-value.js +4 -2
  144. package/dist/composables/use-outside-click.js +12 -8
  145. package/dist/composables/use-pointer-gesture.js +5 -1
  146. package/dist/composables/use-toggle-value.js +1 -4
  147. package/dist/composables/use-virtual-list.js +14 -7
  148. package/dist/contexts/avatar.js +4 -4
  149. package/dist/contexts/carousel.js +1 -4
  150. package/dist/contexts/checkbox.js +1 -4
  151. package/dist/contexts/choicebox.js +2 -8
  152. package/dist/contexts/collapse.js +1 -4
  153. package/dist/contexts/list.js +5 -8
  154. package/dist/contexts/radio.js +4 -4
  155. package/dist/contexts/resizable.js +1 -4
  156. package/dist/contexts/switch.js +2 -8
  157. package/dist/index.d.ts +1 -0
  158. package/dist/styles/source.css +106 -59
  159. package/dist/styles/styles.css +1 -1
  160. package/dist/styles/tw.css +106 -59
  161. package/dist/types/components/avatar.d.ts +2 -2
  162. package/dist/types/components/button.d.ts +11 -4
  163. package/dist/types/components/index.d.ts +12 -0
  164. package/dist/types/components/input.d.ts +4 -5
  165. package/dist/types/components/list.d.ts +1 -1
  166. package/dist/types/components/switch.d.ts +1 -1
  167. package/dist/types/shared/props.d.ts +6 -4
  168. package/dist/types/shared/utils.d.ts +3 -1
  169. package/dist/utils/context.d.ts +2 -8
  170. package/dist/utils/date.d.ts +1 -1
  171. package/dist/utils/date.js +1 -5
  172. package/dist/utils/event.js +6 -18
  173. package/dist/utils/format.d.ts +1 -1
  174. package/dist/utils/format.js +1 -1
  175. package/dist/utils/is.d.ts +0 -1
  176. package/dist/utils/is.js +3 -2
  177. package/dist/utils/responsive.js +7 -4
  178. package/dist/utils/throttle.js +4 -2
  179. package/package.json +45 -43
  180. package/dist/components/_internal/fragment-container.vue.d.ts +0 -13
  181. package/dist/components/active-graph/index.vue.d.ts +0 -51
  182. package/dist/components/avatar/index.vue.d.ts +0 -34
  183. package/dist/components/avatar-group/index.vue.d.ts +0 -8
  184. package/dist/components/backtop/index.vue.d.ts +0 -21
  185. package/dist/components/badge/index.vue.d.ts +0 -52
  186. package/dist/components/book/index.vue.d.ts +0 -28
  187. package/dist/components/browser/index.vue.d.ts +0 -16
  188. package/dist/components/button/index.vue.d.ts +0 -29
  189. package/dist/components/carousel/index.vue.d.ts +0 -13
  190. package/dist/components/carousel-group/index.vue.d.ts +0 -35
  191. package/dist/components/checkbox/index.vue.d.ts +0 -26
  192. package/dist/components/checkbox-group/index.vue.d.ts +0 -28
  193. package/dist/components/chip/index.vue.d.ts +0 -24
  194. package/dist/components/choicebox/index.vue.d.ts +0 -16
  195. package/dist/components/choicebox-group/index.vue.d.ts +0 -24
  196. package/dist/components/collapse/index.vue.d.ts +0 -22
  197. package/dist/components/collapse-group/index.vue.d.ts +0 -20
  198. package/dist/components/command-menu/index.vue.d.ts +0 -42
  199. package/dist/components/command-menu-group/index.vue.d.ts +0 -17
  200. package/dist/components/command-menu-item/index.vue.d.ts +0 -13
  201. package/dist/components/config-provider/index.vue.d.ts +0 -22
  202. package/dist/components/countdown/index.vue.d.ts +0 -51
  203. package/dist/components/dash-line/index.vue.d.ts +0 -13
  204. package/dist/components/description/index.vue.d.ts +0 -20
  205. package/dist/components/drawer/index.vue.d.ts +0 -60
  206. package/dist/components/empty-state/index.vue.d.ts +0 -23
  207. package/dist/components/error/index.vue.d.ts +0 -22
  208. package/dist/components/fader/index.vue.d.ts +0 -12
  209. package/dist/components/gauge/index.vue.d.ts +0 -14
  210. package/dist/components/grid/index.vue.d.ts +0 -19
  211. package/dist/components/grid-item/index.vue.d.ts +0 -18
  212. package/dist/components/hold-button/index.vue.d.ts +0 -42
  213. package/dist/components/input/index.vue.d.ts +0 -55
  214. package/dist/components/intersection-observer/index.vue.d.ts +0 -39
  215. package/dist/components/kbd/index.vue.d.ts +0 -24
  216. package/dist/components/label/index.vue.d.ts +0 -13
  217. package/dist/components/link-button/index.vue.d.ts +0 -33
  218. package/dist/components/list/index.vue.d.ts +0 -44
  219. package/dist/components/list-item/index.vue.d.ts +0 -29
  220. package/dist/components/loading-bar/index.vue.d.ts +0 -15
  221. package/dist/components/loading-dots/index.vue.d.ts +0 -15
  222. package/dist/components/material/index.vue.d.ts +0 -18
  223. package/dist/components/menu/index.vue.d.ts +0 -33
  224. package/dist/components/message/index.vue.d.ts +0 -176
  225. package/dist/components/message-item/index.vue.d.ts +0 -15
  226. package/dist/components/modal/index.vue.d.ts +0 -58
  227. package/dist/components/more-button/index.vue.d.ts +0 -20
  228. package/dist/components/noise-background/index.vue.d.ts +0 -19
  229. package/dist/components/note/index.vue.d.ts +0 -64
  230. package/dist/components/number-input/index.vue.d.ts +0 -39
  231. package/dist/components/overlay/index.vue.d.ts +0 -35
  232. package/dist/components/pagination/index.vue.d.ts +0 -21
  233. package/dist/components/pin-input/index.vue.d.ts +0 -28
  234. package/dist/components/placeholder/index.vue.d.ts +0 -18
  235. package/dist/components/popover/index.vue.d.ts +0 -73
  236. package/dist/components/progress/index.vue.d.ts +0 -34
  237. package/dist/components/radio/index.vue.d.ts +0 -20
  238. package/dist/components/radio-group/index.vue.d.ts +0 -22
  239. package/dist/components/resizable/index.vue.d.ts +0 -19
  240. package/dist/components/resizable-handle/index.vue.d.ts +0 -3
  241. package/dist/components/resizable-panel/index.vue.d.ts +0 -20
  242. package/dist/components/scrollable/index.vue.d.ts +0 -0
  243. package/dist/components/skeleton/index.vue.d.ts +0 -26
  244. package/dist/components/slider/index.vue.d.ts +0 -26
  245. package/dist/components/snippet/index.vue.d.ts +0 -18
  246. package/dist/components/spinner/index.vue.d.ts +0 -3
  247. package/dist/components/stack/index.vue.d.ts +0 -30
  248. package/dist/components/status-dot/index.vue.d.ts +0 -11
  249. package/dist/components/switch/index.vue.d.ts +0 -20
  250. package/dist/components/switch-group/index.vue.d.ts +0 -23
  251. package/dist/components/teleport/index.vue.d.ts +0 -21
  252. package/dist/components/text/index.vue.d.ts +0 -26
  253. package/dist/components/textarea/index.vue.d.ts +0 -28
  254. package/dist/components/theme-switcher/index.vue.d.ts +0 -8
  255. package/dist/components/time-picker/index.vue.d.ts +0 -35
  256. package/dist/components/toggle/index.vue.d.ts +0 -41
  257. package/dist/components/tooltip/index.vue.d.ts +0 -32
  258. 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 presetWidthClasses = {
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 computedClass = computed(() => {
37
- const classes = ["pxd-book--container relative w-fit duration-300 transform-3d motion-safe:transition-transform"];
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) => presetWidthClasses[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="computedClass" :style="computedStyle">
48
- <div class="pxd-book--content translate-z-0 absolute flex size-full min-w-full flex-col overflow-hidden bg-background-200">
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 aria-hidden="true" class="pxd-book--spine left-0 absolute h-full mix-blend-overlay" />
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 fill="none" height="56" viewBox="0 0 36 56" width="36" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" 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" fill="#0070F3" fill-rule="evenodd" /><path clip-rule="evenodd" 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" fill="#45DEC4" fill-rule="evenodd" /><path clip-rule="evenodd" 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" fill="#E5484D" fill-rule="evenodd" /></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 v-if="textured" class="pxd-book--textured inset-0 pointer-events-none absolute bg-cover opacity-50" />
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: linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,0) 12%,rgba(255,255,255,0.25) 29.25%,rgba(255,255,255,0) 50.5%,rgba(255,255,255,0) 75.25%,rgba(255,255,255,0.25) 91%,rgba(255,255,255,0)),linear-gradient(90deg,rgba(0,0,0,0.03),rgba(0,0,0,0.1) 12%,rgba(0,0,0,0) 30%,rgba(0,0,0,0.02) 50%,rgba(0,0,0,0.2) 73.5%,rgba(0,0,0,0.5) 75.25%,rgba(0,0,0,0.15) 85.25%,rgba(0,0,0,0));
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: 0 1px 1px 0 rgba(0, 0, 0, .02), 0 4px 8px -4px rgba(0, 0, 0, .1), 0 16px 24px -8px rgba(0, 0, 0, .03);
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: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0)), hsla(0, 0%, 12%, 1);
131
- box-shadow: 0 1.8px 3.6px rgba(0, 0, 0, .05), 0 10.8px 21.6px rgba(0, 0, 0, .08), inset 0 -.9px 0 rgba(0, 0, 0, .1), inset 0 1.8px 1.8px rgba(255, 255, 255, .1), inset 3.6px 0 3.6px rgba(0, 0, 0, .1);
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: -.02em;
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) translateX(calc(var(--book-depth) / 2));
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)) translateX(var(--hover-translate-x));
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 class="gap-4 min-w-0 md:first:max-w-[140px] md:last:max-w-[140px] flex flex-1 items-center justify-center max-md:first:flex-none first:justify-start last:justify-end">
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 max-md:hidden">
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 class="gap-4 min-w-0 md:first:max-w-[140px] md:last:max-w-[140px] flex flex-1 shrink-0 items-center justify-center max-md:first:flex-none first:justify-start last:justify-end">
38
- <div 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">
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 variant="ghost" size="xs" shape="rounded" class="size-6" icon @click="copyText(address)">
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 class="gap-4 min-w-0 md:first:max-w-[140px] md:last:max-w-[140px] flex flex-1 items-center justify-center max-md:first:flex-none max-lg:hidden first:justify-start last:justify-end" />
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 __VLS_16: {}, __VLS_18: {}, __VLS_20: {};
2
+ declare var __VLS_13: {}, __VLS_15: {}, __VLS_17: {};
3
3
  type __VLS_Slots = {} & {
4
- prefix?: (props: typeof __VLS_16) => any;
4
+ prefix?: (props: typeof __VLS_13) => any;
5
5
  } & {
6
- default?: (props: typeof __VLS_18) => any;
6
+ default?: (props: typeof __VLS_15) => any;
7
7
  } & {
8
- suffix?: (props: typeof __VLS_20) => any;
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 emits = defineEmits(["click", "dblclick"]);
22
- const SIZES = {
23
- xs: "h-6 px-1",
24
- sm: "h-7.5 px-1.5",
25
- md: "h-9 px-2.5",
26
- lg: "h-10 px-3.5"
27
- };
28
- const ROUNDED = {
29
- xs: "rounded-sm",
30
- sm: "rounded-md",
31
- md: "rounded-md",
32
- lg: "rounded-lg",
33
- xl: "rounded-xl",
34
- square: "rounded-none",
35
- rounded: "rounded-full"
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="computedClass"
44
+ :class="computedClasses"
96
45
  :disabled="computedDisabled"
97
- @click="onButtonClick"
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;