pxd 0.0.61 → 0.0.63

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 (223) hide show
  1. package/LICENSE +21 -0
  2. package/dist/components/_internal/dismiss-container.d.vue.ts +28 -0
  3. package/dist/components/_internal/dismiss-container.vue +162 -0
  4. package/dist/components/_internal/popover-arrow.d.vue.ts +9 -0
  5. package/dist/components/_internal/popover-arrow.vue +38 -0
  6. package/dist/components/active-graph/index.vue +4 -4
  7. package/dist/components/avatar/index.vue +5 -7
  8. package/dist/components/avatar-group/index.d.vue.ts +0 -1
  9. package/dist/components/avatar-group/index.vue +1 -1
  10. package/dist/components/backtop/index.vue +1 -1
  11. package/dist/components/badge/index.d.vue.ts +5 -1
  12. package/dist/components/badge/index.vue +18 -4
  13. package/dist/components/badge/types.d.ts +5 -0
  14. package/dist/components/book/index.vue +1 -1
  15. package/dist/components/browser/index.vue +1 -1
  16. package/dist/components/bubble/index.d.vue.ts +22 -0
  17. package/dist/components/bubble/index.vue +59 -0
  18. package/dist/components/bubble/types.d.ts +6 -0
  19. package/dist/components/button/index.d.vue.ts +0 -2
  20. package/dist/components/button/index.vue +30 -21
  21. package/dist/components/button/types.d.ts +3 -2
  22. package/dist/components/button-group/index.d.vue.ts +14 -0
  23. package/dist/components/button-group/index.vue +26 -0
  24. package/dist/components/button-group/types.d.ts +9 -0
  25. package/dist/components/carousel/index.d.vue.ts +3 -3
  26. package/dist/components/carousel/index.vue +146 -113
  27. package/dist/components/carousel/types.d.ts +1 -1
  28. package/dist/components/carousel-item/index.vue +22 -17
  29. package/dist/components/checkbox/index.vue +6 -6
  30. package/dist/components/checkbox-group/index.d.vue.ts +1 -1
  31. package/dist/components/chip/index.d.vue.ts +1 -5
  32. package/dist/components/chip/index.vue +4 -4
  33. package/dist/components/color-selector/index.d.vue.ts +12 -0
  34. package/dist/components/color-selector/index.vue +64 -0
  35. package/dist/components/color-selector/types.d.ts +12 -0
  36. package/dist/components/command-menu/index.d.vue.ts +6 -6
  37. package/dist/components/command-menu/index.vue +23 -32
  38. package/dist/components/command-menu/types.d.ts +1 -1
  39. package/dist/components/command-menu-group/index.vue +15 -6
  40. package/dist/components/command-menu-group/types.d.ts +1 -1
  41. package/dist/components/countdown/index.d.vue.ts +11 -11
  42. package/dist/components/drawer/index.d.vue.ts +8 -8
  43. package/dist/components/drawer/index.vue +13 -10
  44. package/dist/components/drawer/types.d.ts +4 -3
  45. package/dist/components/ellipsis-text/index.d.vue.ts +4 -1
  46. package/dist/components/ellipsis-text/index.vue +84 -107
  47. package/dist/components/ellipsis-text/types.d.ts +2 -1
  48. package/dist/components/error/index.vue +1 -1
  49. package/dist/components/fader/index.vue +5 -9
  50. package/dist/components/gauge/index.vue +34 -29
  51. package/dist/components/grid/index.vue +1 -1
  52. package/dist/components/grid-item/index.vue +1 -1
  53. package/dist/components/hold-button/index.d.vue.ts +8 -10
  54. package/dist/components/hold-button/index.vue +20 -29
  55. package/dist/components/hold-button/types.d.ts +5 -6
  56. package/dist/components/index.d.ts +7 -0
  57. package/dist/components/index.js +7 -0
  58. package/dist/components/input/index.d.vue.ts +8 -8
  59. package/dist/components/input/index.vue +5 -4
  60. package/dist/components/intersection-observer/index.vue +4 -4
  61. package/dist/components/kbd/index.vue +1 -1
  62. package/dist/components/link-button/index.d.vue.ts +4 -4
  63. package/dist/components/link-button/index.vue +9 -8
  64. package/dist/components/link-button/types.d.ts +0 -3
  65. package/dist/components/list/index.d.vue.ts +10 -15
  66. package/dist/components/list/index.vue +58 -131
  67. package/dist/components/list/types.d.ts +4 -4
  68. package/dist/components/list-item/index.d.vue.ts +2 -2
  69. package/dist/components/list-item/index.vue +44 -39
  70. package/dist/components/loading-bar/index.vue +8 -7
  71. package/dist/components/material/index.vue +24 -46
  72. package/dist/components/menu/index.d.vue.ts +6 -8
  73. package/dist/components/menu/index.vue +18 -24
  74. package/dist/components/menu/types.d.ts +1 -2
  75. package/dist/components/message/composables/use-group-expand.d.ts +13 -0
  76. package/dist/components/message/composables/use-group-expand.js +50 -0
  77. package/dist/components/message/composables/use-message-timer.d.ts +9 -0
  78. package/dist/components/message/composables/use-message-timer.js +61 -0
  79. package/dist/components/message/composables/use-promise-message.d.ts +4 -0
  80. package/dist/components/message/composables/use-promise-message.js +49 -0
  81. package/dist/components/message/index.d.vue.ts +6 -33
  82. package/dist/components/message/index.vue +33 -185
  83. package/dist/components/message/types.d.ts +2 -2
  84. package/dist/components/message-item/index.vue +26 -2
  85. package/dist/components/modal/index.d.vue.ts +7 -7
  86. package/dist/components/modal/index.vue +7 -3
  87. package/dist/components/modal/types.d.ts +7 -3
  88. package/dist/components/note/index.vue +2 -2
  89. package/dist/components/number-input/index.d.vue.ts +5 -4
  90. package/dist/components/number-input/index.vue +3 -0
  91. package/dist/components/number-input/types.d.ts +1 -0
  92. package/dist/components/overlay/index.d.vue.ts +6 -3
  93. package/dist/components/overlay/index.vue +63 -68
  94. package/dist/components/overlay/types.d.ts +5 -4
  95. package/dist/components/pagination/index.vue +2 -2
  96. package/dist/components/pin-input/index.d.vue.ts +1 -1
  97. package/dist/components/pin-input/index.vue +7 -6
  98. package/dist/components/placeholder/index.vue +1 -1
  99. package/dist/components/popover/index.d.vue.ts +7 -8
  100. package/dist/components/popover/index.vue +149 -239
  101. package/dist/components/popover/types.d.ts +5 -5
  102. package/dist/components/progress/index.vue +1 -1
  103. package/dist/components/radio/index.vue +2 -2
  104. package/dist/components/resizable/index.vue +43 -51
  105. package/dist/components/resizable/types.d.ts +1 -1
  106. package/dist/components/resizable-handle/index.d.vue.ts +4 -1
  107. package/dist/components/resizable-handle/index.vue +29 -3
  108. package/dist/components/resizable-panel/index.vue +3 -7
  109. package/dist/components/scalable-text/index.d.vue.ts +9 -0
  110. package/dist/components/scalable-text/index.vue +147 -0
  111. package/dist/components/scalable-text/types.d.ts +12 -0
  112. package/dist/components/scrollable/index.d.vue.ts +2 -2
  113. package/dist/components/scrollable/index.vue +4 -3
  114. package/dist/components/separator/index.d.vue.ts +6 -0
  115. package/dist/components/separator/index.vue +18 -0
  116. package/dist/components/separator/types.d.ts +5 -0
  117. package/dist/components/skeleton/index.d.vue.ts +1 -1
  118. package/dist/components/slider/index.d.vue.ts +1 -1
  119. package/dist/components/slider/index.vue +39 -7
  120. package/dist/components/snippet/index.vue +16 -13
  121. package/dist/components/spinner/index.vue +3 -1
  122. package/dist/components/stack/index.d.vue.ts +1 -1
  123. package/dist/components/stack/index.vue +1 -1
  124. package/dist/components/switch/index.d.vue.ts +1 -1
  125. package/dist/components/switch/index.vue +4 -3
  126. package/dist/components/switch-item/index.vue +1 -1
  127. package/dist/components/tabs/index.d.vue.ts +12 -0
  128. package/dist/components/tabs/index.vue +270 -0
  129. package/dist/components/tabs/types.d.ts +12 -0
  130. package/dist/components/tabs-item/index.d.vue.ts +4 -0
  131. package/dist/components/tabs-item/index.vue +16 -0
  132. package/dist/components/tabs-item/types.d.ts +10 -0
  133. package/dist/components/text/index.vue +1 -1
  134. package/dist/components/textarea/index.d.vue.ts +2 -2
  135. package/dist/components/textarea/index.vue +1 -1
  136. package/dist/components/time-picker/index.d.vue.ts +3 -5
  137. package/dist/components/time-picker/index.vue +53 -45
  138. package/dist/components/time-picker/types.d.ts +1 -2
  139. package/dist/components/toggle/index.d.vue.ts +0 -2
  140. package/dist/components/toggle/index.vue +6 -6
  141. package/dist/components/toggle-button/index.vue +8 -6
  142. package/dist/components/tooltip/index.d.vue.ts +1 -1
  143. package/dist/components/tooltip/index.vue +19 -11
  144. package/dist/components/tooltip/types.d.ts +2 -2
  145. package/dist/components/virtual-list/index.d.vue.ts +8 -8
  146. package/dist/components/virtual-list/index.vue +27 -5
  147. package/dist/components/virtual-list/types.d.ts +3 -0
  148. package/dist/composables/index.d.ts +4 -1
  149. package/dist/composables/index.js +4 -1
  150. package/dist/composables/use-browser-observer.js +2 -2
  151. package/dist/composables/use-client-online.js +2 -2
  152. package/dist/composables/use-color-scheme.js +2 -2
  153. package/dist/composables/use-countdown.js +3 -2
  154. package/dist/composables/use-deferred-value.js +2 -2
  155. package/dist/composables/use-delay-destroy.js +11 -6
  156. package/dist/composables/use-document-hidden.js +2 -2
  157. package/dist/composables/use-focus-trap.js +2 -2
  158. package/dist/composables/use-list-filter.d.ts +11 -0
  159. package/dist/composables/use-list-filter.js +56 -0
  160. package/dist/composables/use-list-navigation.d.ts +27 -0
  161. package/dist/composables/use-list-navigation.js +159 -0
  162. package/dist/composables/use-lock-scroll.js +12 -12
  163. package/dist/composables/use-media-query.js +2 -2
  164. package/dist/composables/use-outside-click.d.ts +1 -1
  165. package/dist/composables/use-outside-click.js +8 -11
  166. package/dist/composables/use-overlay-manager.d.ts +18 -0
  167. package/dist/composables/use-overlay-manager.js +80 -0
  168. package/dist/composables/use-popover-responsive.d.ts +6 -8
  169. package/dist/composables/use-popover-responsive.js +9 -12
  170. package/dist/composables/use-repeat-action.js +2 -2
  171. package/dist/composables/use-swipe-gesture.d.ts +65 -0
  172. package/dist/composables/use-swipe-gesture.js +99 -0
  173. package/dist/composables/use-virtual-list.d.ts +5 -3
  174. package/dist/composables/use-virtual-list.js +25 -14
  175. package/dist/composables/use-window-size.js +2 -2
  176. package/dist/constants/size.d.ts +12 -0
  177. package/dist/constants/size.js +12 -0
  178. package/dist/contexts/button.d.ts +5 -0
  179. package/dist/contexts/button.js +5 -0
  180. package/dist/contexts/carousel.d.ts +2 -1
  181. package/dist/contexts/list.d.ts +23 -3
  182. package/dist/contexts/list.js +6 -2
  183. package/dist/contexts/resizable.d.ts +3 -11
  184. package/dist/contexts/tabs.d.ts +15 -0
  185. package/dist/contexts/tabs.js +2 -0
  186. package/dist/locales/en-us.d.ts +4 -4
  187. package/dist/locales/en-us.js +4 -4
  188. package/dist/locales/zh-cn.d.ts +4 -4
  189. package/dist/locales/zh-cn.js +4 -4
  190. package/dist/plugins/dayjs-millisecond-token.js +1 -1
  191. package/dist/styles/source.css +133 -128
  192. package/dist/styles/styles.css +2 -2
  193. package/dist/styles/tw.css +133 -128
  194. package/dist/types/shared/props.d.ts +1 -0
  195. package/dist/types/shared/utils.d.ts +1 -4
  196. package/dist/utils/date.d.ts +3 -3
  197. package/dist/utils/dom.d.ts +1 -0
  198. package/dist/utils/dom.js +4 -0
  199. package/dist/utils/event.d.ts +2 -1
  200. package/dist/utils/event.js +7 -1
  201. package/dist/utils/format.d.ts +3 -3
  202. package/dist/utils/format.js +5 -4
  203. package/dist/utils/fuzzy-search.d.ts +7 -0
  204. package/dist/utils/fuzzy-search.js +61 -0
  205. package/dist/utils/get.d.ts +2 -0
  206. package/dist/utils/get.js +15 -1
  207. package/dist/utils/index.d.ts +10 -11
  208. package/dist/utils/index.js +2 -3
  209. package/dist/utils/ref.d.ts +2 -2
  210. package/dist/utils/{throttle.d.ts → timing.d.ts} +1 -0
  211. package/dist/utils/{throttle.js → timing.js} +4 -2
  212. package/package.json +40 -37
  213. package/volar.d.ts +7 -0
  214. package/dist/components/overlay/overlay-stack.d.ts +0 -3
  215. package/dist/components/overlay/overlay-stack.js +0 -17
  216. package/dist/composables/use-pointer-gesture.d.ts +0 -180
  217. package/dist/composables/use-pointer-gesture.js +0 -406
  218. package/dist/utils/debounce.d.ts +0 -1
  219. package/dist/utils/debounce.js +0 -1
  220. package/dist/utils/regexp.d.ts +0 -8
  221. package/dist/utils/regexp.js +0 -8
  222. package/dist/utils/responsive.d.ts +0 -3
  223. package/dist/utils/responsive.js +0 -14
@@ -4,16 +4,16 @@
4
4
  --background-100-value: 0, 0%, 100%;
5
5
  --background-200-value: 0, 0%, 97%;
6
6
 
7
- --color-gray-alpha-100-value: hsla(0, 0%, 0%, 0.05);
8
- --color-gray-alpha-200-value: hsla(0, 0%, 0%, 0.082);
9
- --color-gray-alpha-300-value: hsla(0, 0%, 0%, 0.12);
10
- --color-gray-alpha-400-value: hsla(0, 0%, 0%, 0.17);
11
- --color-gray-alpha-500-value: hsla(0, 0%, 0%, 0.21);
12
- --color-gray-alpha-600-value: hsla(0, 0%, 0%, 0.34);
13
- --color-gray-alpha-700-value: hsla(0, 0%, 0%, 0.44);
14
- --color-gray-alpha-800-value: hsla(0, 0%, 0%, 0.51);
15
- --color-gray-alpha-900-value: hsla(0, 0%, 0%, 0.61);
16
- --color-gray-alpha-1000-value: hsla(0, 0%, 0%, 0.91);
7
+ --color-gray-alpha-100-value: #0000000d;
8
+ --color-gray-alpha-200-value: #00000015;
9
+ --color-gray-alpha-300-value: #0000001f;
10
+ --color-gray-alpha-400-value: #0000002b;
11
+ --color-gray-alpha-500-value: #00000036;
12
+ --color-gray-alpha-600-value: #00000057;
13
+ --color-gray-alpha-700-value: #00000070;
14
+ --color-gray-alpha-800-value: #00000082;
15
+ --color-gray-alpha-900-value: #0000009c;
16
+ --color-gray-alpha-1000-value: #000000e8;
17
17
 
18
18
  --color-gray-100-value: 0, 0%, 95%;
19
19
  --color-gray-200-value: 0, 0%, 93%;
@@ -23,7 +23,7 @@
23
23
  --color-gray-600-value: 0, 0%, 66%;
24
24
  --color-gray-700-value: 0, 0%, 56%;
25
25
  --color-gray-800-value: 0, 0%, 49%;
26
- --color-gray-900-value: 0, 0%, 40%;
26
+ --color-gray-900-value: 0, 0%, 30%;
27
27
  --color-gray-1000-value: 0, 0%, 9%;
28
28
 
29
29
  --color-blue-100-value: 212, 100%, 97%;
@@ -108,29 +108,42 @@
108
108
  --primary-active: hsla(var(--primary), 90%);
109
109
 
110
110
  --radius: 0.5rem;
111
- --duration: 0.15s;
111
+ --duration: 0.2s;
112
112
  --timing-function: ease-out;
113
113
  --ring: var(--primary);
114
114
 
115
- --shadow-border-default-value: 0 0 0 1px rgba(0, 0, 0, 0.08);
116
- --shadow-border-small-value: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
117
- --shadow-border-medium-value:
118
- 0 0 0 1px rgba(0, 0, 0, 0.08), 0px 2px 2px rgba(0, 0, 0, 0.04),
119
- 0px 8px 8px -8px rgba(0, 0, 0, 0.04);
120
- --shadow-border-large-value:
121
- 0 0 0 1px rgba(0, 0, 0, 0.08), 0px 2px 2px rgba(0, 0, 0, 0.04),
122
- 0px 8px 16px -4px rgba(0, 0, 0, 0.04);
123
- --shadow-border-tooltip-value:
124
- 0 0 0 1px rgba(0, 0, 0, 0.08), 0px 1px 1px rgba(0, 0, 0, 0.02), 0px 4px 8px rgba(0, 0, 0, 0.04);
125
- --shadow-border-menu-value:
126
- 0 0 0 1px rgba(0, 0, 0, 0.08), 0px 1px 1px rgba(0, 0, 0, 0.02),
127
- 0px 4px 8px -4px rgba(0, 0, 0, 0.04), 0px 16px 24px -8px rgba(0, 0, 0, 0.06);
128
- --shadow-border-modal-value:
129
- 0 0 0 1px rgba(0, 0, 0, 0.08), 0px 1px 1px rgba(0, 0, 0, 0.02),
130
- 0px 8px 16px -4px rgba(0, 0, 0, 0.04), 0px 24px 32px -8px rgba(0, 0, 0, 0.06);
131
- --shadow-border-fullscreen-value:
132
- 0 0 0 1px rgba(0, 0, 0, 0.08), 0px 1px 1px rgba(0, 0, 0, 0.02),
133
- 0px 8px 16px -4px rgba(0, 0, 0, 0.04), 0px 24px 32px -8px rgba(0, 0, 0, 0.06);
115
+ --shadow-background-border: 0 0 0 1px hsl(var(--background-200-value));
116
+ --shadow-border-value: 0 0 0 1px #00000014;
117
+ --shadow-small-value: 0px 2px 2px #0000000a;
118
+ --shadow-medium-value: 0px 2px 2px #0000000a, 0px 8px 8px -8px #0000000a;
119
+ --shadow-large-value: 0px 2px 2px #0000000a, 0px 8px 16px -4px #0000000a;
120
+ --shadow-tooltip-value: 0px 1px 1px #00000005, 0px 4px 8px #0000000a;
121
+ --shadow-menu-value:
122
+ 0px 1px 1px #00000005, 0px 4px 8px -4px #0000000a, 0px 16px 24px -8px #0000000f;
123
+ --shadow-modal-value:
124
+ 0px 1px 1px #00000005, 0px 8px 16px -4px #0000000a, 0px 24px 32px -8px #0000000f;
125
+ --shadow-fullscreen-value:
126
+ 0px 1px 1px #00000005, 0px 8px 16px -4px #0000000a, 0px 24px 32px -8px #0000000f;
127
+
128
+ /* component variables defaults */
129
+ --pxd-initial-index: 10;
130
+ --active-graph-item-radius: 0.125rem;
131
+ --avatar-size: 2rem;
132
+ --chip-size: 0.75rem;
133
+ --fader-size: 1rem;
134
+ --fader-color: var(--color-gray-100);
135
+ --hold-button-durations: 2000ms;
136
+ --hold-button-progress-color: var(--color-gray-alpha-600);
137
+ --popover-arrow-color: var(--color-gray-1000);
138
+ --popover-offset: 8;
139
+ --popover-scale: 0.95;
140
+ --popover-index: max(var(--pxd-initial-index), 10);
141
+ --overlay-index: calc(var(--popover-index) - 5);
142
+ --modal-index: calc(var(--overlay-index) + 5);
143
+ --modal-width: 33.75rem;
144
+ --placeholder-gap: 0.75rem;
145
+ --toggle-active-color: var(--color-primary);
146
+ --toggle-inactive-color: var(--color-gray-alpha-100);
134
147
 
135
148
  -webkit-tap-highlight-color: transparent;
136
149
  text-rendering: optimizeLegibility;
@@ -150,16 +163,16 @@
150
163
  --background-100-value: 0, 0%, 5%;
151
164
  --background-200-value: 0, 0%, 0%;
152
165
 
153
- --color-gray-alpha-100-value: hsla(0, 0%, 100%, 0.06);
154
- --color-gray-alpha-200-value: hsla(0, 0%, 100%, 0.09);
155
- --color-gray-alpha-300-value: hsla(0, 0%, 100%, 0.13);
156
- --color-gray-alpha-400-value: hsla(0, 0%, 100%, 0.14);
157
- --color-gray-alpha-500-value: hsla(0, 0%, 100%, 0.24);
158
- --color-gray-alpha-600-value: hsla(0, 0%, 100%, 0.51);
159
- --color-gray-alpha-700-value: hsla(0, 0%, 100%, 0.54);
160
- --color-gray-alpha-800-value: hsla(0, 0%, 100%, 0.47);
161
- --color-gray-alpha-900-value: hsla(0, 0%, 100%, 0.61);
162
- --color-gray-alpha-1000-value: hsla(0, 0%, 100%, 0.92);
166
+ --color-gray-alpha-100-value: #ffffff0f;
167
+ --color-gray-alpha-200-value: #ffffff17;
168
+ --color-gray-alpha-300-value: #ffffff21;
169
+ --color-gray-alpha-400-value: #ffffff24;
170
+ --color-gray-alpha-500-value: #ffffff3d;
171
+ --color-gray-alpha-600-value: #ffffff82;
172
+ --color-gray-alpha-700-value: #ffffff8a;
173
+ --color-gray-alpha-800-value: #ffffff78;
174
+ --color-gray-alpha-900-value: #ffffff9c;
175
+ --color-gray-alpha-1000-value: #ffffffeb;
163
176
 
164
177
  --color-gray-100-value: 0, 0%, 10%;
165
178
  --color-gray-200-value: 0, 0%, 12%;
@@ -249,27 +262,17 @@
249
262
  --color-pink-900-value: 341, 90%, 67%;
250
263
  --color-pink-1000-value: 333, 90%, 96%;
251
264
 
252
- --shadow-border-default-value: 0 0 0 1px rgba(255, 255, 255, 0.145);
253
- --shadow-border-small-value:
254
- 0 0 0 1px rgba(255, 255, 255, 0.145), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
255
- --shadow-border-medium-value:
256
- 0 0 0 1px rgba(255, 255, 255, 0.145), 0px 2px 2px rgba(0, 0, 0, 0.32),
257
- 0px 8px 8px -8px rgba(0, 0, 0, 0.16);
258
- --shadow-border-large-value:
259
- 0 0 0 1px rgba(255, 255, 255, 0.145), 0px 2px 2px rgba(0, 0, 0, 0.04),
260
- 0px 8px 16px -4px rgba(0, 0, 0, 0.04);
261
- --shadow-border-tooltip-value:
262
- 0 0 0 1px rgba(255, 255, 255, 0.145), 0px 1px 1px rgba(0, 0, 0, 0.02),
263
- 0px 4px 8px rgba(0, 0, 0, 0.04);
264
- --shadow-border-menu-value:
265
- 0 0 0 1px rgba(255, 255, 255, 0.145), 0px 1px 1px rgba(0, 0, 0, 0.02),
266
- 0px 4px 8px -4px rgba(0, 0, 0, 0.04), 0px 16px 24px -8px rgba(0, 0, 0, 0.06);
267
- --shadow-border-modal-value:
268
- 0 0 0 1px rgba(255, 255, 255, 0.145), 0px 1px 1px rgba(0, 0, 0, 0.02),
269
- 0px 8px 16px -4px rgba(0, 0, 0, 0.04), 0px 24px 32px -8px rgba(0, 0, 0, 0.06);
270
- --shadow-border-fullscreen-value:
271
- 0 0 0 1px rgba(255, 255, 255, 0.145), 0px 1px 1px rgba(0, 0, 0, 0.02),
272
- 0px 8px 16px -4px rgba(0, 0, 0, 0.04), 0px 24px 32px -8px rgba(0, 0, 0, 0.06);
265
+ --shadow-border-value: 0 0 0 1px #ffffff25;
266
+ --shadow-small-value: 0px 1px 2px #00000029;
267
+ --shadow-medium-value: 0px 2px 2px #00000052, 0px 8px 8px -8px #00000029;
268
+ --shadow-large-value: 0px 2px 2px #0000000a, 0px 8px 16px -4px #0000000a;
269
+ --shadow-tooltip-value: 0px 1px 1px #00000005, 0px 4px 8px #0000000a;
270
+ --shadow-menu-value:
271
+ 0px 1px 1px #00000005, 0px 4px 8px -4px #0000000a, 0px 16px 24px -8px #0000000f;
272
+ --shadow-modal-value:
273
+ 0px 1px 1px #00000005, 0px 8px 16px -4px #0000000a, 0px 24px 32px -8px #0000000f;
274
+ --shadow-fullscreen-value:
275
+ 0px 1px 1px #00000005, 0px 8px 16px -4px #0000000a, 0px 24px 32px -8px #0000000f;
273
276
 
274
277
  color-scheme: dark;
275
278
  }
@@ -284,15 +287,14 @@
284
287
 
285
288
  @theme inline {
286
289
  --font-sans:
287
- 'Inter', 'Inter Fallback', 'Geist', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
288
- 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
290
+ 'Inter', 'Inter Fallback', 'Geist', Arial, ui-sans-serif, system-ui, sans-serif,
291
+ 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
289
292
 
290
293
  --color-primary: hsl(var(--primary));
291
294
  --color-primary-hover: var(--primary-hover);
292
295
  --color-primary-active: var(--primary-active);
293
296
 
294
- --color-input: var(--color-gray-alpha-300);
295
- --color-border: hsl(var(--color-gray-300-value));
297
+ --color-border: var(--color-gray-alpha-300-value);
296
298
  --color-border-hover: hsl(var(--color-gray-500-value));
297
299
  --color-border-active: hsl(var(--color-gray-600-value));
298
300
 
@@ -301,7 +303,7 @@
301
303
  --color-background-100: hsl(var(--background-100-value));
302
304
  --color-background-200: hsl(var(--background-200-value));
303
305
  --color-background-hover: hsl(var(--color-gray-200-value));
304
- --color-background-active: hsl(var(--color-gray-400-value));
306
+ --color-background-active: hsl(var(--color-gray-300-value));
305
307
 
306
308
  --color-gray-alpha-100: var(--color-gray-alpha-100-value);
307
309
  --color-gray-alpha-200: var(--color-gray-alpha-200-value);
@@ -404,6 +406,7 @@
404
406
 
405
407
  --default-transition-duration: var(--duration);
406
408
  --default-transition-timing-function: var(--timing-function);
409
+ --faster-transition-duration: calc(var(--duration) * 0.7);
407
410
 
408
411
  --z-1: 1;
409
412
  --spacing-em: 1em;
@@ -415,17 +418,32 @@
415
418
  --radius-xl: calc(var(--radius) + 4px);
416
419
  --radius-inherit: inherit;
417
420
 
418
- --shadow-border-default: var(--shadow-border-default-value);
419
- --shadow-border-small: var(--shadow-border-small-value);
420
- --shadow-border-medium: var(--shadow-border-medium-value);
421
- --shadow-border-large: var(--shadow-border-large-value);
422
- --shadow-border-tooltip: var(--shadow-border-tooltip-value);
423
- --shadow-border-menu: var(--shadow-border-menu-value);
424
- --shadow-border-modal: var(--shadow-border-modal-value);
425
- --shadow-border-fullscreen: var(--shadow-border-fullscreen-value);
426
-
427
- --text-13px: 13px;
428
- --text-15px: 15px;
421
+ --shadow-small: var(--shadow-small-value);
422
+ --shadow-medium: var(--shadow-medium-value);
423
+ --shadow-large: var(--shadow-large-value);
424
+ --shadow-tooltip: var(--shadow-tooltip-value);
425
+ --shadow-menu: var(--shadow-menu-value);
426
+ --shadow-modal: var(--shadow-modal-value);
427
+ --shadow-fullscreen: var(--shadow-fullscreen-value);
428
+
429
+ --shadow-border-base: var(--shadow-border-value);
430
+ --shadow-border-small:
431
+ var(--shadow-border-value), var(--shadow-small-value), var(--shadow-background-border);
432
+ --shadow-border-medium:
433
+ var(--shadow-border-value), var(--shadow-medium-value), var(--shadow-background-border);
434
+ --shadow-border-large:
435
+ var(--shadow-border-value), var(--shadow-large-value), var(--shadow-background-border);
436
+ --shadow-border-tooltip:
437
+ var(--shadow-border-value), var(--shadow-tooltip-value), var(--shadow-background-border);
438
+ --shadow-border-menu:
439
+ var(--shadow-border-value), var(--shadow-menu-value), var(--shadow-background-border);
440
+ --shadow-border-modal:
441
+ var(--shadow-border-value), var(--shadow-modal-value), var(--shadow-background-border);
442
+ --shadow-border-fullscreen:
443
+ var(--shadow-border-value), var(--shadow-fullscreen-value), var(--shadow-background-border);
444
+
445
+ --text-13: 13px;
446
+ --text-15: 15px;
429
447
  }
430
448
 
431
449
  @utility default-animation-duration {
@@ -456,20 +474,30 @@
456
474
  }
457
475
  }
458
476
 
477
+ @utility self-focus-ring {
478
+ & {
479
+ outline-offset: 2px;
480
+ }
481
+ &:focus-visible {
482
+ outline: 2px solid hsl(var(--ring));
483
+ }
484
+ }
485
+
459
486
  @utility peer-focus-ring {
487
+ & {
488
+ outline-offset: 2px;
489
+ }
490
+
460
491
  .peer:focus-visible ~ & {
461
- box-shadow:
462
- 0 0 0 2px var(--color-background-100),
463
- 0 0 0 4px hsl(var(--ring));
492
+ outline: 2px solid hsl(var(--ring));
464
493
  }
465
494
  }
466
495
 
467
- @utility self-focus-ring {
468
- &:focus-visible {
469
- box-shadow:
470
- 0 0 0 2px var(--color-background-100),
471
- 0 0 0 4px hsl(var(--ring));
472
- }
496
+ @utility transition-appearance {
497
+ transition-property:
498
+ opacity, transform, translate, background-color, box-shadow, font-size, border, color;
499
+ transition-duration: var(--default-transition-duration);
500
+ transition-timing-function: var(--default-transition-timing-function);
473
501
  }
474
502
 
475
503
  @utility visually-hidden {
@@ -481,7 +509,6 @@
481
509
  overflow: hidden;
482
510
  clip: rect(0, 0, 0, 0);
483
511
  white-space: nowrap;
484
- visibility: hidden;
485
512
  border-width: 0;
486
513
  opacity: 0;
487
514
  }
@@ -498,39 +525,24 @@
498
525
  font-family: inherit;
499
526
  }
500
527
 
501
- @utility dvh-* {
502
- height: calc(--value(integer) * 1vh);
503
-
504
- @supports (height: 1dvh) {
505
- height: calc(--value(integer) * 1dvh);
506
- }
507
- }
508
-
509
- @utility max-dvh-* {
510
- max-height: calc(--value(integer) * 1vh);
511
-
512
- @supports (height: 1dvh) {
513
- max-height: calc(--value(integer) * 1dvh);
514
- }
515
- }
516
-
517
528
  @layer base {
518
529
  * {
519
- @apply border-border;
530
+ border-color: var(--color-gray-300);
520
531
  }
521
532
  }
522
533
 
523
534
  @layer components {
524
535
  .pxd-input--border {
525
- border: 1px solid var(--border-color, var(--color-gray-alpha-300));
536
+ border-width: 1px;
537
+ border-style: solid;
526
538
 
527
539
  &:not(.is-disabled, .is-readonly):hover {
528
- --border-color: hsla(var(--primary), 0.5);
540
+ border-color: hsla(var(--primary), 0.5);
529
541
  }
530
542
 
531
543
  &:not(.is-disabled, .is-readonly)[data-focusing='true'],
532
544
  &:not(.is-disabled, .is-readonly):focus-within {
533
- --border-color: var(--color-primary);
545
+ border-color: var(--color-primary);
534
546
  box-shadow: 0 0 0 3px hsla(var(--primary), 0.2);
535
547
  }
536
548
 
@@ -542,43 +554,28 @@
542
554
  &,
543
555
  &:focus-within,
544
556
  &[data-focusing='true'] {
545
- --border-color: hsl(var(--color-red-900-value));
557
+ border-color: hsl(var(--color-red-900-value));
546
558
  box-shadow: 0 0 0 3px hsl(var(--color-red-300-value));
547
559
  }
548
560
 
549
561
  &:focus-within,
550
562
  &[data-focusing='true'],
551
563
  &:not(.is-disabled, .is-readonly):hover {
552
- --border-color: hsl(var(--color-red-900-value));
564
+ border-color: hsl(var(--color-red-900-value));
553
565
  box-shadow: 0 0 0 3px hsl(var(--color-red-500-value));
554
566
  }
555
567
  }
556
568
  }
557
569
  }
558
570
 
559
- .pxd-container-mask::after {
560
- content: '';
561
- position: absolute;
562
- inset: 0;
563
- background: rgba(0, 0, 0, 0.4);
564
- transition: opacity var(--default-transition-duration) var(--default-transition-timing-function);
565
- pointer-events: none;
566
- will-change: opacity;
567
- z-index: 0;
568
- }
569
-
570
- [class*='pxd-transition--'] {
571
- transition-duration: var(--default-transition-duration);
572
- transition-timing-function: var(--default-transition-timing-function);
573
- }
574
-
575
571
  .pxd-transition--fade-enter-active,
576
572
  .pxd-transition--fade-leave-active {
577
573
  transition-property: opacity;
574
+ transition-duration: var(--default-transition-duration);
575
+ transition-timing-function: var(--default-transition-timing-function);
578
576
  will-change: opacity;
579
577
  }
580
578
 
581
- .pxd-container-mask[data-visible='false']::after,
582
579
  .pxd-transition--fade-enter-from,
583
580
  .pxd-transition--fade-leave-to {
584
581
  opacity: 0;
@@ -588,13 +585,21 @@
588
585
  .pxd-transition--fade-scale-enter-active,
589
586
  .pxd-transition--fade-scale-leave-active {
590
587
  transition-property: opacity, transform, filter;
588
+ transition-duration: var(--default-transition-duration);
589
+ transition-timing-function: var(--default-transition-timing-function);
591
590
  will-change: opacity, transform, filter;
592
591
  }
593
592
 
594
593
  .pxd-transition--fade-scale-enter-from,
595
594
  .pxd-transition--fade-scale-leave-to {
596
595
  opacity: 0;
597
- transform: scale(var(--scale, 0.95));
596
+ filter: blur(5px);
597
+ transform: scale(0.75);
598
+ }
599
+
600
+ /* Make exit faster than enter */
601
+ [class*='pxd-transition--'][class*='-leave-active'] {
602
+ transition-duration: var(--faster-transition-duration) !important;
598
603
  }
599
604
 
600
605
  /*
@@ -16,6 +16,7 @@ export type ComponentValue = string | number | boolean
16
16
 
17
17
  export type ComponentClass = string | any[] | Record<string, any>
18
18
 
19
+ export type ComponentAlign = 'left' | 'center' | 'right'
19
20
  export type ComponentDirection = 'horizontal' | 'vertical'
20
21
 
21
22
  export type BasePosition = 'top' | 'bottom' | 'left' | 'right'
@@ -3,10 +3,7 @@ import type { ComponentPublicInstance, MaybeRefOrGetter } from 'vue'
3
3
  export type Awaitable<T> = T | PromiseLike<T>
4
4
  export type Callback = (...args: any[]) => any
5
5
  export type Nullable<T> = T | null | undefined
6
- export type Numeric = number | `${number}`
7
-
8
- // e.g.: 10 | '10' | '10px' | '-10px'
9
- export type CSSValue = Numeric | CSSUnitValue
6
+ // export type Numeric = number | `${number}`
10
7
 
11
8
  export type MaybeElement = Nullable<HTMLElement | SVGElement | ComponentPublicInstance>
12
9
  export type MaybeElementRef<T extends MaybeElement = MaybeElement> = MaybeRefOrGetter<Nullable<T>>
@@ -20,7 +20,7 @@ export declare function getAllDatesBetween(startDate: Date | string, endDate: Da
20
20
  * @returns 天数、第一天是周几、最后一天是周几
21
21
  */
22
22
  export declare function getMonthDays(year: number, month: number): {
23
- days: any;
24
- firstDay: any;
25
- lastDay: any;
23
+ days: number;
24
+ firstDay: 0 | 1 | 2 | 3 | 4 | 5 | 6;
25
+ lastDay: 0 | 1 | 2 | 3 | 4 | 5 | 6;
26
26
  };
@@ -39,3 +39,4 @@ export interface ScrollbarSize {
39
39
  export declare function getScrollbarSize(element?: HTMLElement): ScrollbarSize;
40
40
  export declare function getViewportRect(): DOMRect;
41
41
  export declare function isOverflowScrollable(ele: Element): boolean;
42
+ export declare function awaitAnimationEnd(element?: Element): Promise<void>;
package/dist/utils/dom.js CHANGED
@@ -113,3 +113,7 @@ export function isOverflowScrollable(ele) {
113
113
  }
114
114
  return isOverflowScrollable(parent);
115
115
  }
116
+ export async function awaitAnimationEnd(element) {
117
+ const animations = element?.getAnimations?.() ?? [];
118
+ await Promise.allSettled(animations.map((a) => a.finished));
119
+ }
@@ -9,5 +9,6 @@ export declare function cachedOff<E extends Event = Event>(el: Nullable<EventTar
9
9
  export declare function sleep(ms: number): Promise<unknown>;
10
10
  export declare function preventDefaultScroll(ev: Event): boolean;
11
11
  export declare function raf(fn: FrameRequestCallback): number;
12
- export declare function doubleRaf(fn: FrameRequestCallback): void;
12
+ export declare function caf(id: number): void;
13
+ export declare function doubleRaf(fn: FrameRequestCallback): number;
13
14
  export {};
@@ -103,6 +103,12 @@ export function preventDefaultScroll(ev) {
103
103
  export function raf(fn) {
104
104
  return isServer() ? -1 : requestAnimationFrame(fn);
105
105
  }
106
+ export function caf(id) {
107
+ if (isServer()) {
108
+ return;
109
+ }
110
+ cancelAnimationFrame(id);
111
+ }
106
112
  export function doubleRaf(fn) {
107
- raf(() => raf(fn));
113
+ return raf(() => raf(fn));
108
114
  }
@@ -1,4 +1,4 @@
1
- import type { CSSValue, Nullable } from '../types/shared/utils';
1
+ import type { Nullable } from '../types/shared/utils';
2
2
  /** string -> String */
3
3
  export declare function capitalize(text: string): string;
4
4
  /** kabab-case -> kababCase */
@@ -12,8 +12,8 @@ export declare function humanize(text: string): string;
12
12
  export declare function isTruthyProp(value: unknown): boolean;
13
13
  export declare function clampValue(n: number, min: number, max: number): number;
14
14
  export declare function isExternalLink(href: string): boolean;
15
- export declare function toArray(value: unknown | unknown[]): any[];
16
- export declare function getCssUnitValue(value: Nullable<CSSValue | string>, fallbackValue?: string): string;
15
+ export declare function toArray(value: unknown): any[];
16
+ export declare function getCssUnitValue(value: Nullable<string | number>, fallbackValue?: string): string;
17
17
  /**
18
18
  * Increase string a value with unit
19
19
  *
@@ -1,4 +1,5 @@
1
- import { FLOATING_REGEX, INTEGER_REGEX } from "./regexp.js";
1
+ const INTEGER_REGEX = /^-?\d+$/;
2
+ const FLOATING_REGEX = /^-?\d+\.?\d*/;
2
3
  export function capitalize(text) {
3
4
  return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();
4
5
  }
@@ -47,10 +48,10 @@ export function getCssUnitValue(value, fallbackValue) {
47
48
  if (value == null || value === "") {
48
49
  return fallbackValue;
49
50
  }
50
- if (typeof value === "number" || INTEGER_REGEX.test(value)) {
51
- return `${value}px`;
51
+ if (typeof value === "number" || INTEGER_REGEX.test(String(value))) {
52
+ return `${String(value)}px`;
52
53
  }
53
- return value;
54
+ return String(value);
54
55
  }
55
56
  export function increaseWithUnit(target, delta) {
56
57
  if (typeof target === "number") {
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Returns whether `text` or `keywords` matches a user-typed `search` query.
3
+ *
4
+ * Matching is intentionally order-preserving: this helper is used only to
5
+ * decide visibility, not ranking.
6
+ */
7
+ export declare function isMatch(text: string, search: string, keywords?: string[]): boolean;
@@ -0,0 +1,61 @@
1
+ export function isMatch(text, search, keywords) {
2
+ if (!search) {
3
+ return true;
4
+ }
5
+ const needle = search.toLowerCase().trim();
6
+ if (!needle) {
7
+ return true;
8
+ }
9
+ if (text && matchesOne(text.toLowerCase(), needle)) {
10
+ return true;
11
+ }
12
+ if (keywords && keywords.length > 0) {
13
+ for (const kw of keywords) {
14
+ if (kw && matchesOne(kw.toLowerCase(), needle)) {
15
+ return true;
16
+ }
17
+ }
18
+ }
19
+ return false;
20
+ }
21
+ function matchesOne(haystack, needle) {
22
+ if (!haystack) {
23
+ return false;
24
+ }
25
+ if (haystack === needle) {
26
+ return true;
27
+ }
28
+ if (haystack.startsWith(needle)) {
29
+ return true;
30
+ }
31
+ if (hasWordBoundaryMatch(haystack, needle)) {
32
+ return true;
33
+ }
34
+ if (haystack.includes(needle)) {
35
+ return true;
36
+ }
37
+ return hasFuzzySubsequenceMatch(haystack, needle);
38
+ }
39
+ function hasWordBoundaryMatch(haystack, needle) {
40
+ let from = 0;
41
+ while (from <= haystack.length) {
42
+ const idx = haystack.indexOf(needle, from);
43
+ if (idx === -1) {
44
+ return false;
45
+ }
46
+ if (idx === 0 || /\W/.test(haystack[idx - 1])) {
47
+ return true;
48
+ }
49
+ from = idx + 1;
50
+ }
51
+ return false;
52
+ }
53
+ function hasFuzzySubsequenceMatch(haystack, needle) {
54
+ let ni = 0;
55
+ for (let hi = 0; hi < haystack.length && ni < needle.length; hi++) {
56
+ if (haystack[hi] === needle[ni]) {
57
+ ni++;
58
+ }
59
+ }
60
+ return ni >= needle.length;
61
+ }
@@ -1,7 +1,9 @@
1
+ import type { ResponsiveValue } from '../types/shared/props';
1
2
  import type { Nullable } from '../types/shared/utils';
2
3
  export declare function getFallbackValue<Variants extends Record<string, any>>(variant: Nullable<string>, variants: Variants, defaultVariant?: keyof Variants): any;
3
4
  export declare function getColorByThreshold(value: number, colors: Record<string, string>): string;
4
5
  type DocumentDirection = 'rtl' | 'ltr' | 'auto';
5
6
  export declare function getDocumentDirection(): DocumentDirection;
6
7
  export declare function getPlatform(): "linux" | "mac" | "windows";
8
+ export declare function getResponsiveValue<V extends string | number>(prop: ResponsiveValue<V> | undefined, xsValue: Nullable<V>, valueSetter: (acc: Record<string, V>, bp: any, v: V) => void): Record<string, V>;
7
9
  export {};
package/dist/utils/get.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { isNil } from "es-toolkit";
1
2
  import { isServer } from "./is.js";
2
3
  export function getFallbackValue(variant, variants, defaultVariant = "default") {
3
4
  return (variant ? variants[variant] : null) ?? variants[defaultVariant];
@@ -13,7 +14,7 @@ export function getColorByThreshold(value, colors) {
13
14
  return colors[keys[i - 1]];
14
15
  }
15
16
  }
16
- return colors[keys[keyLength - 1]];
17
+ return colors[keys.at(-1)];
17
18
  }
18
19
  export function getDocumentDirection() {
19
20
  if (isServer()) {
@@ -39,3 +40,16 @@ export function getPlatform() {
39
40
  }
40
41
  return "linux";
41
42
  }
43
+ export function getResponsiveValue(prop, xsValue, valueSetter) {
44
+ const formatted = Object.assign(
45
+ isNil(xsValue) ? {} : { xs: xsValue },
46
+ typeof prop === "object" ? prop : {}
47
+ );
48
+ return Object.entries(formatted).reduce(
49
+ (acc, [bp, value]) => {
50
+ valueSetter(acc, bp, value);
51
+ return acc;
52
+ },
53
+ {}
54
+ );
55
+ }
@@ -1,11 +1,10 @@
1
- export * from './context';
2
- export * from './date';
3
- export * from './debounce';
4
- export * from './dom';
5
- export * from './event';
6
- export * from './format';
7
- export * from './get';
8
- export * from './is';
9
- export * from './regexp';
10
- export * from './throttle';
11
- export * from './uid';
1
+ export * from './context.js';
2
+ export * from './date.js';
3
+ export * from './dom.js';
4
+ export * from './event.js';
5
+ export * from './format.js';
6
+ export * from './get.js';
7
+ export * from './is.js';
8
+ export * from './fuzzy-search.js';
9
+ export * from './uid.js';
10
+ export * from './timing.js';
@@ -1,11 +1,10 @@
1
1
  export * from "./context.js";
2
2
  export * from "./date.js";
3
- export * from "./debounce.js";
4
3
  export * from "./dom.js";
5
4
  export * from "./event.js";
6
5
  export * from "./format.js";
7
6
  export * from "./get.js";
8
7
  export * from "./is.js";
9
- export * from "./regexp.js";
10
- export * from "./throttle.js";
8
+ export * from "./fuzzy-search.js";
11
9
  export * from "./uid.js";
10
+ export * from "./timing.js";