@blofin/blofin-ui 0.7.58 → 0.7.59

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 (293) hide show
  1. package/dist/Badge.es.js +8 -10
  2. package/dist/Button.es.js +125 -127
  3. package/dist/Dialog.es.js +10 -180
  4. package/dist/Divider.es.js +10 -12
  5. package/dist/Drawer.es.js +51 -44
  6. package/dist/Form.d.ts +1 -0
  7. package/dist/Form.es.js +752 -0
  8. package/dist/ProTable-63e2c020.js +3444 -0
  9. package/dist/ProTable.es.js +6 -9
  10. package/dist/Slider.es.js +140 -141
  11. package/dist/Sort.es.js +10 -144
  12. package/dist/blofin.css +1 -1
  13. package/dist/{close-0df24351.js → close-c67ec245.js} +0 -1
  14. package/dist/clsx.m-b14a941b.js +32 -0
  15. package/dist/components/Alert/Alert.d.ts +3 -3
  16. package/dist/components/Alert/styles.d.ts +2 -2
  17. package/dist/components/Badge/Badge.d.ts +2 -2
  18. package/dist/components/Button/Button.d.ts +2 -2
  19. package/dist/components/Button/Loading/index.d.ts +2 -2
  20. package/dist/components/Button/index.d.ts +0 -2
  21. package/dist/components/Button/styles.d.ts +1 -1
  22. package/dist/components/Checkbox/styles.d.ts +1 -1
  23. package/dist/components/CssDropdown/CssDropdown.d.ts +3 -3
  24. package/dist/components/DatePickerRange/styles.d.ts +1 -0
  25. package/dist/components/DateTimePicker/ScrollableList.d.ts +1 -1
  26. package/dist/components/Dialog/Dialog.d.ts +2 -5
  27. package/dist/components/Dialog/index.d.ts +2 -4
  28. package/dist/components/Dialog/styles.d.ts +2 -2
  29. package/dist/components/Drawer/Drawer.d.ts +1 -1
  30. package/dist/components/Dropdown/Dropdown.d.ts +2 -2
  31. package/dist/components/Empty/index.d.ts +5 -2
  32. package/dist/components/Form/Control.d.ts +13 -0
  33. package/dist/components/Form/Form.d.ts +4 -0
  34. package/dist/components/Form/FormItem.d.ts +4 -0
  35. package/dist/components/Form/FormLabel.d.ts +4 -0
  36. package/dist/components/Form/context.d.ts +6 -0
  37. package/dist/components/Form/index.d.ts +8 -0
  38. package/dist/components/Form/interface.d.ts +48 -0
  39. package/dist/components/Form/store.d.ts +16 -0
  40. package/dist/components/Form/styles/item.d.ts +5 -0
  41. package/dist/components/Form/useForm.d.ts +3 -0
  42. package/dist/components/LabelTextField/LabelTextField.d.ts +6 -6
  43. package/dist/components/MonthPicker/index.d.ts +17 -2
  44. package/dist/components/MultiSelect/MultiSelect.d.ts +4 -4
  45. package/dist/components/Notification/Notification.d.ts +1 -1
  46. package/dist/components/Pagination/PageOptions.d.ts +1 -1
  47. package/dist/components/Pagination/Pagination.d.ts +2 -2
  48. package/dist/components/Picker/hooks/usePickerMethod.d.ts +1 -1
  49. package/dist/components/Picker/index.d.ts +10 -2
  50. package/dist/components/Popover/Popover.d.ts +1 -1
  51. package/dist/components/Popup/index.d.ts +15 -4
  52. package/dist/components/RadioButton/RadioButton.d.ts +4 -4
  53. package/dist/components/RadioButton/styles.d.ts +1 -1
  54. package/dist/components/Select/Select.d.ts +9 -6
  55. package/dist/components/Slider/Slider.d.ts +2 -2
  56. package/dist/components/Sort/SortButton.d.ts +5 -5
  57. package/dist/components/Sort/SortGroup.d.ts +4 -4
  58. package/dist/components/Sort/index.d.ts +6 -5
  59. package/dist/components/Sortable/SortItem.d.ts +4 -4
  60. package/dist/components/Sortable/index.d.ts +11 -3
  61. package/dist/components/Switch/Switch.d.ts +2 -2
  62. package/dist/components/Switch/styles.d.ts +3 -3
  63. package/dist/components/Tab/Tab.d.ts +2 -2
  64. package/dist/components/Tab/styles.d.ts +1 -1
  65. package/dist/components/Table/Pagination/index.d.ts +2 -2
  66. package/dist/components/Table/Table.d.ts +2 -2
  67. package/dist/components/Table/Tbody/index.d.ts +3 -3
  68. package/dist/components/Table/Thead/index.d.ts +3 -3
  69. package/dist/components/Table/context.d.ts +3 -3
  70. package/dist/components/Table/hooks/useStickyOffset.d.ts +3 -3
  71. package/dist/components/Table/index.d.ts +3 -3
  72. package/dist/components/Table/interface.d.ts +4 -4
  73. package/dist/components/TextField/TextField.d.ts +4 -4
  74. package/dist/components/TextField/index.d.ts +0 -2
  75. package/dist/components/TextSelect/TextSelect.d.ts +8 -8
  76. package/dist/components/Textarea/index.d.ts +15 -2
  77. package/dist/components/Toast/Toast.d.ts +13 -2
  78. package/dist/components/Toast/styles.d.ts +1 -1
  79. package/dist/components/Tooltip/Tooltip.d.ts +5 -4
  80. package/dist/components/Typography/Typography.d.ts +2 -2
  81. package/dist/components/Typography/styles.d.ts +1 -1
  82. package/dist/hooks/useLatest.d.ts +1 -1
  83. package/dist/hooks/useNotification.d.ts +7 -5
  84. package/dist/hooks/useToast.d.ts +1 -1
  85. package/dist/{index-4f94d7fa.js → index-001dd0f7.js} +39 -24
  86. package/dist/{index-29d37c73.js → index-003572ca.js} +67 -52
  87. package/dist/{index-57a163fd.js → index-0330bc93.js} +28 -13
  88. package/dist/{index-d81e15f3.js → index-05bf2879.js} +34 -19
  89. package/dist/{index-b54ef52a.js → index-0773f9b5.js} +31 -16
  90. package/dist/{index-6856be22.js → index-0c50dcda.js} +38 -23
  91. package/dist/{index-7cf9b111.js → index-0e6d56f6.js} +33 -18
  92. package/dist/{index-a89abb42.js → index-0eb53476.js} +19 -4
  93. package/dist/{index-0230b5a9.js → index-0f855a91.js} +4 -5
  94. package/dist/{index-cbc0d36b.js → index-10144af4.js} +30 -15
  95. package/dist/{index-06d0f2f7.js → index-11dc8e91.js} +28 -13
  96. package/dist/{index-c6371af1.js → index-14eba896.js} +25 -10
  97. package/dist/{index-c1381bca.js → index-18869ac6.js} +35 -20
  98. package/dist/{index-1b2a64df.js → index-189196e6.js} +46 -31
  99. package/dist/{index-898678dc.js → index-198ccc85.js} +45 -30
  100. package/dist/{index-e2b960e4.js → index-1b087231.js} +38 -23
  101. package/dist/{index-f40f45fb.js → index-204cbb23.js} +30 -15
  102. package/dist/{index-4df0c3e4.js → index-220ed10a.js} +31 -16
  103. package/dist/{index-67678963.js → index-28a6835c.js} +48 -33
  104. package/dist/{index-e98ef24f.js → index-2d400fe1.js} +32 -17
  105. package/dist/{index-e8fb69e0.js → index-2e0c8d16.js} +37 -22
  106. package/dist/{index-cc1cd309.js → index-2e784550.js} +28 -13
  107. package/dist/index-304d7874.js +64 -0
  108. package/dist/{index-12d32536.js → index-3375e2e3.js} +28 -13
  109. package/dist/{index-954d3973.js → index-36521981.js} +28 -13
  110. package/dist/{index-cfee583b.js → index-377dc190.js} +36 -21
  111. package/dist/{index-4f94900a.js → index-390505ce.js} +34 -19
  112. package/dist/index-40626e62.js +174 -0
  113. package/dist/{index-b0da3dfd.js → index-41bebee7.js} +39 -24
  114. package/dist/{index-5fb7b3bc.js → index-45cfa2f3.js} +27 -12
  115. package/dist/{index-80cc70e4.js → index-47408940.js} +41 -26
  116. package/dist/{index-141cec17.js → index-4b9249fc.js} +29 -14
  117. package/dist/index-543e2f77.js +65 -0
  118. package/dist/index-563cafee.js +64 -0
  119. package/dist/index-5956ed9f.js +11569 -0
  120. package/dist/{index-b103ed31.js → index-59c7d611.js} +27 -12
  121. package/dist/{index-d2f2742e.js → index-5bc791c5.js} +30 -15
  122. package/dist/{index-03513979.js → index-5f3da225.js} +26 -11
  123. package/dist/{index-8aa9b1be.js → index-603f0f2a.js} +39 -24
  124. package/dist/{index-4bc493f0.js → index-636a6216.js} +19 -4
  125. package/dist/{index-2334248a.js → index-640dc4ab.js} +24 -9
  126. package/dist/{index-73bfc020.js → index-64ba8d88.js} +47 -32
  127. package/dist/{index-2ae0474b.js → index-65986673.js} +39 -24
  128. package/dist/{index-6f728206.js → index-65df0a7b.js} +24 -9
  129. package/dist/{index-02f669c4.js → index-6e4d9a19.js} +1 -2
  130. package/dist/{index-360aaaac.js → index-7241c703.js} +46 -31
  131. package/dist/index-7272669e.js +36 -0
  132. package/dist/{index-9c73c442.js → index-73673cf3.js} +60 -45
  133. package/dist/{index-08a64465.js → index-74676234.js} +31 -16
  134. package/dist/{index-7edb6aec.js → index-770fe605.js} +34 -19
  135. package/dist/{index-5beeed26.js → index-772d6529.js} +38 -23
  136. package/dist/{index-6e969585.js → index-797b8f6c.js} +52 -37
  137. package/dist/{index-a6fa33ce.js → index-7c12aa98.js} +28 -13
  138. package/dist/{index-5e6ffc2f.js → index-7e7cdd81.js} +1 -2
  139. package/dist/{index-03169373.js → index-81072b24.js} +37 -22
  140. package/dist/{index-75190b99.js → index-8684e896.js} +22 -7
  141. package/dist/{index-7bb9ffdf.js → index-89f184f3.js} +2 -3
  142. package/dist/{index-40710f09.js → index-8a7c46ae.js} +41 -26
  143. package/dist/{index-117d018c.js → index-8cec0e82.js} +37 -22
  144. package/dist/{index-094d2a65.js → index-91062be2.js} +34 -19
  145. package/dist/{index-d3419554.js → index-9253a5ce.js} +30 -15
  146. package/dist/index-95c68eda.js +152 -0
  147. package/dist/{index-956b36a6.js → index-9eaebb69.js} +45 -30
  148. package/dist/{index-63a66f13.js → index-a4077786.js} +45 -30
  149. package/dist/{index-e9a1ff7f.js → index-ad2acfd2.js} +19 -4
  150. package/dist/{index-fdffd6e6.js → index-af60bed6.js} +29 -14
  151. package/dist/{index-fda88eb4.js → index-b5ff5e93.js} +45 -30
  152. package/dist/{index-11268759.js → index-bba889fc.js} +33 -18
  153. package/dist/{index-b7941b97.js → index-c002eb57.js} +23 -8
  154. package/dist/{index-4c6ad36c.js → index-c73b6cc3.js} +47 -32
  155. package/dist/{index-60fe7f16.js → index-c81a4a2a.js} +32 -17
  156. package/dist/{index-f7c4ae83.js → index-c8690f0a.js} +48 -33
  157. package/dist/{index-79e7317f.js → index-cdaffd70.js} +27 -12
  158. package/dist/{index-4d780cf4.js → index-cf872561.js} +37 -22
  159. package/dist/{index-cb1218d8.js → index-dafac81d.js} +25 -10
  160. package/dist/{index-19d177fe.js → index-db7c7495.js} +31 -16
  161. package/dist/{index-f1726c63.js → index-dbd4bd27.js} +29 -14
  162. package/dist/{index-ceae4147.js → index-dc23eb8b.js} +27 -12
  163. package/dist/{index-9e5efc0a.js → index-dc69cdd8.js} +45 -30
  164. package/dist/{index-c69f6dfc.js → index-e6091315.js} +36 -21
  165. package/dist/{index-06ef2e10.js → index-e869e999.js} +28 -13
  166. package/dist/{index-03d6aef0.js → index-f0c42ec9.js} +33 -18
  167. package/dist/{index-f64eddcc.js → index-f16b36a5.js} +31 -16
  168. package/dist/{index-e1a6a03d.js → index-f4d65525.js} +24 -9
  169. package/dist/index-f53123c7.js +64 -0
  170. package/dist/{index-770e5f53.js → index-f753119c.js} +27 -12
  171. package/dist/{index-8585c2f3.js → index-f83dab77.js} +38 -23
  172. package/dist/{index-6f963c6a.js → index-f852d9b6.js} +35 -20
  173. package/dist/{index-3ee2bafa.js → index-fa51b278.js} +30 -15
  174. package/dist/{index-e169373b.js → index-fc135912.js} +25 -10
  175. package/dist/{index-ef31f5f8.js → index-fcb1ec65.js} +1 -2
  176. package/dist/{index-d86842c8.js → index-ff943066.js} +34 -19
  177. package/dist/index.d.ts +48 -36
  178. package/dist/index.es.js +56 -223
  179. package/dist/isObjectLike-1b8bbac2.js +44 -0
  180. package/dist/jsx-runtime-82a9ddf6.js +646 -0
  181. package/dist/provider/NoticeProvider.d.ts +1 -1
  182. package/dist/provider/ThemeProvider.d.ts +3 -7
  183. package/dist/provider/useTheme.d.ts +1 -1
  184. package/dist/types/component.d.ts +1 -1
  185. package/dist/utils/helper.d.ts +1 -1
  186. package/dist/{utils-071abd68.js → utils-cacf528c.js} +1 -2
  187. package/package.json +3 -2
  188. package/dist/Calendar.d.ts +0 -1
  189. package/dist/Calendar.es.js +0 -210
  190. package/dist/Checkbox.d.ts +0 -1
  191. package/dist/Checkbox.es.js +0 -138
  192. package/dist/CssDropdown.d.ts +0 -1
  193. package/dist/CssDropdown.es.js +0 -38
  194. package/dist/DatePickerRange.d.ts +0 -1
  195. package/dist/DatePickerRange.es.js +0 -410
  196. package/dist/DateTimePicker.d.ts +0 -1
  197. package/dist/DateTimePicker.es.js +0 -519
  198. package/dist/Dropdown.d.ts +0 -1
  199. package/dist/Dropdown.es.js +0 -134
  200. package/dist/Empty.d.ts +0 -1
  201. package/dist/Empty.es.js +0 -11
  202. package/dist/LabelTextField.d.ts +0 -1
  203. package/dist/LabelTextField.es.js +0 -100
  204. package/dist/MonthPicker.d.ts +0 -1
  205. package/dist/MonthPicker.es.js +0 -16
  206. package/dist/MultiSelect.d.ts +0 -1
  207. package/dist/MultiSelect.es.js +0 -425
  208. package/dist/Notification.d.ts +0 -1
  209. package/dist/Notification.es.js +0 -12
  210. package/dist/Pagination.d.ts +0 -1
  211. package/dist/Pagination.es.js +0 -219
  212. package/dist/Picker.d.ts +0 -1
  213. package/dist/Picker.es.js +0 -224
  214. package/dist/Popover.d.ts +0 -1
  215. package/dist/Popover.es.js +0 -107
  216. package/dist/Popup.d.ts +0 -1
  217. package/dist/Popup.es.js +0 -62
  218. package/dist/ProTable-7a07d8b6.js +0 -565
  219. package/dist/RadioButton.d.ts +0 -1
  220. package/dist/RadioButton.es.js +0 -152
  221. package/dist/Select.d.ts +0 -1
  222. package/dist/Select.es.js +0 -316
  223. package/dist/Sortable.d.ts +0 -1
  224. package/dist/Sortable.es.js +0 -39
  225. package/dist/Switch.d.ts +0 -1
  226. package/dist/Switch.es.js +0 -64
  227. package/dist/Tab.d.ts +0 -1
  228. package/dist/Tab.es.js +0 -101
  229. package/dist/Table.d.ts +0 -1
  230. package/dist/Table.es.js +0 -359
  231. package/dist/TextField.d.ts +0 -1
  232. package/dist/TextField.es.js +0 -64
  233. package/dist/TextSelect.d.ts +0 -1
  234. package/dist/TextSelect.es.js +0 -17
  235. package/dist/Textarea.d.ts +0 -1
  236. package/dist/Textarea.es.js +0 -106
  237. package/dist/Toast.d.ts +0 -1
  238. package/dist/Toast.es.js +0 -12
  239. package/dist/Tooltip.d.ts +0 -1
  240. package/dist/Tooltip.es.js +0 -144
  241. package/dist/Typography.d.ts +0 -1
  242. package/dist/Typography.es.js +0 -74
  243. package/dist/_commonjsHelpers-1d52fb73.js +0 -9
  244. package/dist/arrow-down-011b02c7.js +0 -6
  245. package/dist/arrow-down-l-line-97e4fe24.js +0 -6
  246. package/dist/arrow-fill-70becd96.js +0 -6
  247. package/dist/arrow-right-l-line-87881b4d.js +0 -7
  248. package/dist/close-bg-6d2211ef.js +0 -6
  249. package/dist/clsx.m-e965ef18.js +0 -22
  250. package/dist/components/CssDropdown/index.d.ts +0 -2
  251. package/dist/components/DatePickerRange/index.d.ts +0 -4
  252. package/dist/components/DateTimePicker/index.d.ts +0 -4
  253. package/dist/components/Dropdown/index.d.ts +0 -2
  254. package/dist/components/Empty/Empty.d.ts +0 -5
  255. package/dist/components/MonthPicker/MonthPicker.d.ts +0 -17
  256. package/dist/components/MultiSelect/index.d.ts +0 -2
  257. package/dist/components/Notification/index.d.ts +0 -2
  258. package/dist/components/Pagination/index.d.ts +0 -3
  259. package/dist/components/Picker/Picker.d.ts +0 -10
  260. package/dist/components/Popover/index.d.ts +0 -5
  261. package/dist/components/Popup/Popup.d.ts +0 -15
  262. package/dist/components/Sortable/Sortable.d.ts +0 -11
  263. package/dist/components/Switch/index.d.ts +0 -2
  264. package/dist/components/Tab/index.d.ts +0 -4
  265. package/dist/components/TextSelect/index.d.ts +0 -2
  266. package/dist/components/Textarea/Textarea.d.ts +0 -15
  267. package/dist/components/Toast/index.d.ts +0 -2
  268. package/dist/components/Tooltip/index.d.ts +0 -2
  269. package/dist/components/Typography/index.d.ts +0 -4
  270. package/dist/enum-0398044b.js +0 -17
  271. package/dist/helper-221987f8.js +0 -7
  272. package/dist/index-293f8244.js +0 -49
  273. package/dist/index-40023d52.js +0 -5322
  274. package/dist/index-4528ba11.js +0 -49
  275. package/dist/index-596c785d.js +0 -50
  276. package/dist/index-67554651.js +0 -49
  277. package/dist/index-9349bf2d.js +0 -345
  278. package/dist/index-b7027a1d.js +0 -1295
  279. package/dist/index-c57db938.js +0 -37
  280. package/dist/index-eea69add.js +0 -71
  281. package/dist/index.esm-71578db5.js +0 -1198
  282. package/dist/index.module-1d7bbdf8.js +0 -7
  283. package/dist/index.module-86edc823.js +0 -15
  284. package/dist/index.module-b4239ff5.js +0 -9
  285. package/dist/index.module-fb41ba3b.js +0 -39
  286. package/dist/locales-776f0072.js +0 -440
  287. package/dist/search-b79a3be5.js +0 -6
  288. package/dist/sortable.esm-1c13d908.js +0 -2896
  289. package/dist/sortable.esm-8d31c120.js +0 -1275
  290. package/dist/styles-85a9fe64.js +0 -136
  291. package/dist/useAlign-916ed3be.js +0 -44
  292. package/dist/useDelayEvent-f577f6a3.js +0 -1082
  293. package/dist/useTheme-0688f238.js +0 -16
@@ -1,219 +0,0 @@
1
- "use client";
2
- import { jsx as a, jsxs as g } from "react/jsx-runtime";
3
- import * as p from "react";
4
- import { c as O } from "./clsx.m-e965ef18.js";
5
- import { u as A } from "./useTheme-0688f238.js";
6
- import { T as D, S as N } from "./index-9349bf2d.js";
7
- import { c as L } from "./index-c57db938.js";
8
- import "react-dom";
9
- import "./TextField.es.js";
10
- import "./utils-071abd68.js";
11
- import "./styles-85a9fe64.js";
12
- import "./useAlign-916ed3be.js";
13
- import "./arrow-down-011b02c7.js";
14
- import "./search-b79a3be5.js";
15
- const E = L(
16
- "bu-min-w-[24px] bu-cursor-pointer bu-rounded-[4px] bu-px-[4px] bu-py-[2px] bu-text-center bu-text-md bu-leading-[20px] bu-transition-colors",
17
- {
18
- variants: {
19
- theme: {
20
- dark: "bu-text-dark-label data-[current='true']:bu-bg-dark-primary data-[current='true']:bu-text-light-second",
21
- light: "bu-text-light-label data-[current='true']:bu-bg-light-primary data-[current='true']:bu-text-dark-second"
22
- }
23
- }
24
- }
25
- ), T = L(
26
- "bu-h-[24px] bu-cursor-pointer data-[disabled='true']:bu-cursor-not-allowed",
27
- {
28
- variants: {
29
- theme: {
30
- dark: "bu-text-dark-label data-[disabled='true']:bu-text-dark-label-40",
31
- light: "bu-text-light-label data-[disabled='true']:bu-text-light-label-40"
32
- }
33
- }
34
- }
35
- ), W = () => {
36
- }, q = [10, 20, 30, 40, 50];
37
- function B(t) {
38
- const e = p.useRef(null), { theme: d } = A(), {
39
- sizeCanChange: m = !1,
40
- onPageSizeChange: n = W,
41
- sizeOptions: l = q,
42
- pageSize: i = 10,
43
- disabled: h,
44
- theme: u = d,
45
- countPerPage: b
46
- } = t;
47
- return m ? /* @__PURE__ */ a("div", { className: "bu-h-[34px] bu-w-[97px]", children: /* @__PURE__ */ a(
48
- D,
49
- {
50
- ref: e,
51
- options: l.map((s) => ({
52
- value: String(s),
53
- label: String(s)
54
- })),
55
- defaultValue: l.indexOf(i) !== -1 ? String(i) : String(l[0]),
56
- onChange: (s) => {
57
- n(Number(s) || 10);
58
- },
59
- className: "bu-max-h-[150px] bu-overflow-y-scroll",
60
- base: "div",
61
- inputDisabled: h,
62
- selectItemClassName: `!bu-px-[8px] !bu-leading-[18px] ${u === "light" ? "!bu-bg-light-background hover:!bu-bg-light-hover-fill-primary" : "!bu-bg-dark-background hover:!bu-bg-dark-hover-fill-primary"}`,
63
- valueClassName: "!bu-h-[34px]",
64
- inputClassName: "!bu-h-[34px]",
65
- customSelectItems: (s) => {
66
- const v = l.indexOf(i) !== -1 ? String(i) : String(l[0]);
67
- return /* @__PURE__ */ g(
68
- "div",
69
- {
70
- className: v === s.value ? u === "light" ? "!bu-text-light-primary" : "!bu-text-dark-primary" : "",
71
- children: [
72
- s.label,
73
- " / ",
74
- b
75
- ]
76
- }
77
- );
78
- },
79
- customLabel: (s) => /* @__PURE__ */ g(
80
- "div",
81
- {
82
- className: `${u === "light" ? "!bu-text-light-label" : "!bu-text-dark-label"}`,
83
- children: [
84
- s.label,
85
- " / ",
86
- b
87
- ]
88
- }
89
- ),
90
- auto: !1
91
- }
92
- ) }) : null;
93
- }
94
- const R = 10;
95
- function x(t = R, e) {
96
- return Math.ceil(e / t);
97
- }
98
- function G(t) {
99
- return t && t.length ? t[0] : R;
100
- }
101
- function te({
102
- totalPages: t,
103
- currentPage: e,
104
- onChange: d,
105
- className: m,
106
- theme: n,
107
- activeStyle: l,
108
- total: i,
109
- sizeOptions: h,
110
- sizeCanChange: u,
111
- onPageChange: b,
112
- pageSizeChangeResetCurrent: s = !0,
113
- countPerPage: v = "Page",
114
- pageSize: y
115
- }) {
116
- const [c, $] = p.useState(
117
- y || G(h)
118
- ), [_, V] = p.useState(
119
- () => j(
120
- e,
121
- u ? x(c, i) : t
122
- )
123
- ), w = p.useRef(!0), { theme: S } = A(), F = e === 1, I = p.useMemo(() => {
124
- const r = u ? x(c, i) : t;
125
- return e === r;
126
- }, [e, t, u, c, i]), k = (r) => () => {
127
- const o = (f) => {
128
- u ? b && b(f, c) : d && d(f);
129
- };
130
- if (r === "prev")
131
- return e > 1 && o(e - 1);
132
- if (r === "next") {
133
- const f = u ? x(c, i) : t;
134
- return e < f && o(e + 1);
135
- }
136
- r !== e && o(r);
137
- }, M = (r) => {
138
- const o = x(r, i);
139
- $(r), b && b(
140
- s ? 1 : e > o ? o : e,
141
- r
142
- );
143
- };
144
- return p.useEffect(() => {
145
- w.current ? w.current = !1 : V(
146
- j(
147
- e,
148
- u ? x(c, i) : t
149
- )
150
- );
151
- }, [t, e, u, c, i]), !u && (!e || !t || t < e) ? null : (u && !b && console.error(
152
- "Warning: you have provide current prop for pagination but without onPageSizeChange handler , this will cause no-change when you change page. "
153
- ), /* @__PURE__ */ g("div", { className: `bu-flex bu-items-center bu-justify-center bu-gap-[16px] ${m}`, children: [
154
- /* @__PURE__ */ g(
155
- "ul",
156
- {
157
- className: O(
158
- "bu-flex bu-items-center bu-justify-center bu-gap-[16px] bu-text-dark-label md:bu-gap-[24px]"
159
- ),
160
- children: [
161
- /* @__PURE__ */ a(
162
- "li",
163
- {
164
- className: T({ theme: n || S }),
165
- "data-disabled": F,
166
- onClick: k("prev"),
167
- children: /* @__PURE__ */ a(N, { className: "bu-h-[24px] bu-w-[24px] bu-rotate-90" })
168
- }
169
- ),
170
- _.map((r, o) => /* @__PURE__ */ a(
171
- "li",
172
- {
173
- ...e === r ? { "data-current": !0, style: l } : { "data-current": !1 },
174
- className: E({ theme: n || S }),
175
- children: typeof r == "string" ? /* @__PURE__ */ a("span", { children: r }) : /* @__PURE__ */ a("button", { onClick: k(r), children: r })
176
- },
177
- `${r}-${o}`
178
- )),
179
- /* @__PURE__ */ a(
180
- "li",
181
- {
182
- className: T({ theme: n || S }),
183
- "data-disabled": I,
184
- onClick: k("next"),
185
- children: /* @__PURE__ */ a(N, { className: "bu-h-[24px] bu-w-[24px] -bu-rotate-90" })
186
- }
187
- )
188
- ]
189
- }
190
- ),
191
- /* @__PURE__ */ a(
192
- B,
193
- {
194
- theme: n,
195
- sizeCanChange: u,
196
- sizeOptions: h,
197
- onPageSizeChange: M,
198
- pageSize: c,
199
- countPerPage: v
200
- }
201
- )
202
- ] }));
203
- }
204
- function j(t, e) {
205
- if (e <= 4)
206
- return Array.from({ length: e }, (l, i) => i + 1);
207
- if (t === 1)
208
- return [1, 2, 3, "...", e];
209
- if (t === e)
210
- return [1, "...", e - 2, e - 1, e];
211
- const d = Array.from({ length: 3 }, (l, i) => t + i - 1).filter(
212
- (l) => l > 1 && l < e
213
- ), m = t - 2 > 1 ? [1, "..."] : [1], n = t + 2 >= e ? [e] : ["...", e];
214
- return [...m, ...d, ...n];
215
- }
216
- export {
217
- B as PageOption,
218
- te as Pagination
219
- };
package/dist/Picker.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components/Picker/index'
package/dist/Picker.es.js DELETED
@@ -1,224 +0,0 @@
1
- "use client";
2
- import { jsx as p, jsxs as A } from "react/jsx-runtime";
3
- import * as $ from "react";
4
- import { useRef as y, useState as B, useCallback as F, useEffect as R } from "react";
5
- import { g as D } from "./_commonjsHelpers-1d52fb73.js";
6
- import { _ as P, a as Y, s as v } from "./index.module-fb41ba3b.js";
7
- import { u as H } from "./useTheme-0688f238.js";
8
- import { c as G } from "./index-c57db938.js";
9
- import "./clsx.m-e965ef18.js";
10
- function U(e) {
11
- var t = typeof e;
12
- return e != null && (t == "object" || t == "function");
13
- }
14
- var S = U, X = P, q = function() {
15
- return X.Date.now();
16
- }, z = q, J = /\s/;
17
- function K(e) {
18
- for (var t = e.length; t-- && J.test(e.charAt(t)); )
19
- ;
20
- return t;
21
- }
22
- var Q = K, Z = Q, V = /^\s+/;
23
- function ee(e) {
24
- return e && e.slice(0, Z(e) + 1).replace(V, "");
25
- }
26
- var te = ee;
27
- function ne(e) {
28
- return e != null && typeof e == "object";
29
- }
30
- var re = ne, ie = Y, ce = re, ae = "[object Symbol]";
31
- function se(e) {
32
- return typeof e == "symbol" || ce(e) && ie(e) == ae;
33
- }
34
- var oe = se, ue = te, O = S, le = oe, N = 0 / 0, fe = /^[-+]0x[0-9a-f]+$/i, me = /^0b[01]+$/i, de = /^0o[0-7]+$/i, he = parseInt;
35
- function be(e) {
36
- if (typeof e == "number")
37
- return e;
38
- if (le(e))
39
- return N;
40
- if (O(e)) {
41
- var t = typeof e.valueOf == "function" ? e.valueOf() : e;
42
- e = O(t) ? t + "" : t;
43
- }
44
- if (typeof e != "string")
45
- return e === 0 ? e : +e;
46
- e = ue(e);
47
- var r = me.test(e);
48
- return r || de.test(e) ? he(e.slice(2), r ? 2 : 8) : fe.test(e) ? N : +e;
49
- }
50
- var ge = be, ve = S, I = z, L = ge, pe = "Expected a function", xe = Math.max, ke = Math.min;
51
- function ye(e, t, r) {
52
- var i, c, h, f, a, m, l = 0, u = !1, d = !1, s = !0;
53
- if (typeof e != "function")
54
- throw new TypeError(pe);
55
- t = L(t) || 0, ve(r) && (u = !!r.leading, d = "maxWait" in r, h = d ? xe(L(r.maxWait) || 0, t) : h, s = "trailing" in r ? !!r.trailing : s);
56
- function n(o) {
57
- var b = i, x = c;
58
- return i = c = void 0, l = o, f = e.apply(x, b), f;
59
- }
60
- function g(o) {
61
- return l = o, a = setTimeout(k, t), u ? n(o) : f;
62
- }
63
- function E(o) {
64
- var b = o - m, x = o - l, j = t - b;
65
- return d ? ke(j, h - x) : j;
66
- }
67
- function _(o) {
68
- var b = o - m, x = o - l;
69
- return m === void 0 || b >= t || b < 0 || d && x >= h;
70
- }
71
- function k() {
72
- var o = I();
73
- if (_(o))
74
- return C(o);
75
- a = setTimeout(k, E(o));
76
- }
77
- function C(o) {
78
- return a = void 0, s && i ? n(o) : (i = c = void 0, f);
79
- }
80
- function W() {
81
- a !== void 0 && clearTimeout(a), l = 0, i = m = c = a = void 0;
82
- }
83
- function w() {
84
- return a === void 0 ? f : C(I());
85
- }
86
- function T() {
87
- var o = I(), b = _(o);
88
- if (i = arguments, c = this, m = o, b) {
89
- if (a === void 0)
90
- return g(m);
91
- if (d)
92
- return clearTimeout(a), a = setTimeout(k, t), n(m);
93
- }
94
- return a === void 0 && (a = setTimeout(k, t)), f;
95
- }
96
- return T.cancel = W, T.flush = w, T;
97
- }
98
- var M = ye;
99
- const Ee = /* @__PURE__ */ D(M);
100
- var Te = M, $e = S, Ie = "Expected a function";
101
- function Se(e, t, r) {
102
- var i = !0, c = !0;
103
- if (typeof e != "function")
104
- throw new TypeError(Ie);
105
- return $e(r) && (i = "leading" in r ? !!r.leading : i, c = "trailing" in r ? !!r.trailing : c), Te(e, t, {
106
- leading: i,
107
- maxWait: t,
108
- trailing: c
109
- });
110
- }
111
- var _e = Se;
112
- const Ce = /* @__PURE__ */ D(_e), je = (e) => {
113
- R(e, []);
114
- }, Oe = (e, t) => {
115
- const r = y(null);
116
- y(0);
117
- const i = y(0), c = y(30), [h, f] = B(t), a = F(
118
- (s) => {
119
- let n = -(s / c.current);
120
- const g = Math.floor(n);
121
- n - g > 0.5 ? n = g + 1 : n = g, n < 0 && (n = 0);
122
- const E = e[n].value;
123
- return f(E), { currentIndex: n };
124
- },
125
- [e]
126
- ), m = Ce((s) => {
127
- s.preventDefault();
128
- const n = r.current, g = s.deltaY;
129
- i.current += -g * 4, i.current > 0 && (i.current = 0), i.current < -((e.length - 1) * c.current) && (i.current = -((e.length - 1) * c.current)), n && (n.style.transition = "transform 0.2s", n.style.transform = `translateY(${i.current}px)`), l();
130
- }), l = Ee(() => {
131
- const { currentIndex: s } = a(i.current);
132
- i.current = -(c.current * s);
133
- const n = r.current;
134
- n && (n.style.transform = `translateY(${i.current}px)`);
135
- }, 16.7);
136
- R(() => {
137
- const s = r.current;
138
- if (s && s.firstElementChild) {
139
- const n = s.firstElementChild.getBoundingClientRect().height;
140
- c.current = n;
141
- }
142
- if (s !== null)
143
- return s.addEventListener("wheel", m, !1), () => {
144
- s.removeEventListener("wheel", m);
145
- };
146
- }, [e.length, a, r.current]);
147
- const u = () => {
148
- e.forEach((s, n) => {
149
- s.value === t && d(n);
150
- }), t || d(0);
151
- }, d = (s) => {
152
- const n = r.current;
153
- i.current = -(c.current * s), n && (n.style.transform = `translate3D(0, ${i.current}px, 0)`);
154
- };
155
- return je(() => {
156
- u();
157
- }), { pickerColumnsEl: r, selected: h, setSelected: f, selectIndex: d };
158
- }, Ne = G("", {
159
- variants: {
160
- intent: {
161
- select: "bu-text-md",
162
- unSelect: "bu-text-base"
163
- },
164
- theme: {
165
- light: "bu-text-light-label",
166
- dark: "bu-text-dark-label"
167
- }
168
- },
169
- compoundVariants: [
170
- {
171
- intent: "unSelect",
172
- theme: "light",
173
- class: "bu-text-light-label"
174
- },
175
- {
176
- intent: "unSelect",
177
- theme: "dark",
178
- class: "bu-text-dark-label-40"
179
- }
180
- ]
181
- }), Be = ({ list: e, selectedValue: t, setValue: r }) => {
182
- const { pickerColumnsEl: i, selected: c, setSelected: h, selectIndex: f } = Oe(
183
- e,
184
- t
185
- ), { theme: a } = H(), m = $.useMemo(() => {
186
- const l = [];
187
- for (let u = 0; u < e.length; u++)
188
- l.push(
189
- /* @__PURE__ */ p("div", { children: /* @__PURE__ */ p(
190
- "div",
191
- {
192
- className: v["picker-list"],
193
- onClick: () => {
194
- h(e[u].value), f(u);
195
- },
196
- children: /* @__PURE__ */ p(
197
- "span",
198
- {
199
- className: `${Ne({
200
- intent: c === e[u].value ? "select" : "unSelect",
201
- theme: a
202
- })}`,
203
- children: e[u].label
204
- }
205
- )
206
- }
207
- ) }, t + "_" + u)
208
- );
209
- return l;
210
- }, [e, c]);
211
- return $.useEffect(() => {
212
- r(c);
213
- }, [c]), $.useEffect(() => {
214
- const l = e.findIndex((d) => d.value === t), u = l > -1 ? l : e.length - 1;
215
- f(u), h(e[u].value);
216
- }, [e]), /* @__PURE__ */ A("div", { className: v["picker-column"], children: [
217
- /* @__PURE__ */ p("div", { className: v.up + " " + v[`up-${a || "light"}`] }),
218
- /* @__PURE__ */ p("div", { className: v.down + " " + v[`down-${a || "light"}`] }),
219
- /* @__PURE__ */ p("div", { className: v["picker-column-wheel"], ref: i, children: m })
220
- ] });
221
- };
222
- export {
223
- Be as Picker
224
- };
package/dist/Popover.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components/Popover/index'
@@ -1,107 +0,0 @@
1
- "use client";
2
- import { jsxs as N, jsx as _ } from "react/jsx-runtime";
3
- import * as t from "react";
4
- import { useEffect as w } from "react";
5
- import { createPortal as $ } from "react-dom";
6
- import { u as j, a as O, b as S } from "./useDelayEvent-f577f6a3.js";
7
- import "./_commonjsHelpers-1d52fb73.js";
8
- const D = (l, p, c, n, e) => {
9
- const r = (i) => {
10
- n && n.contains(i.target) || e && e.contains(i.target) || p(!1);
11
- };
12
- w(() => {
13
- if (!c)
14
- return n && (document.removeEventListener("click", r), document.addEventListener("click", r)), () => {
15
- document.removeEventListener("click", r);
16
- };
17
- }, [l, c]);
18
- }, v = {
19
- "popover-content": "_popover-content_1iu3o_1",
20
- "popover-content-visible": "_popover-content-visible_1iu3o_7",
21
- "popover-content-hidden": "_popover-content-hidden_1iu3o_12"
22
- }, B = t.forwardRef((l, p) => {
23
- t.useImperativeHandle(p, () => ({
24
- close: x
25
- }));
26
- const {
27
- label: c,
28
- content: n,
29
- trigger: e,
30
- y: r,
31
- x: i,
32
- placement: P = "bottom-start",
33
- flipPlacement: d,
34
- afterClose: h,
35
- contentClassName: y,
36
- className: M,
37
- onVisibleChange: a
38
- } = l, k = t.useMemo(() => e !== "click", [e]), [o, s] = j(!1, 100, k), u = t.useRef(null), f = t.useRef(null);
39
- D(
40
- o,
41
- s,
42
- k,
43
- u.current,
44
- f.current
45
- );
46
- const { isClient: g } = O(), { styles: C, attributes: L, update: m } = S(u.current, f.current, {
47
- placement: P,
48
- strategy: "fixed",
49
- modifiers: [
50
- {
51
- name: "offset",
52
- options: {
53
- offset: [i, r]
54
- }
55
- },
56
- {
57
- name: "flip",
58
- options: {
59
- fallbackPlacements: d || []
60
- }
61
- }
62
- ]
63
- }), x = () => {
64
- s(!1);
65
- };
66
- t.useEffect(() => {
67
- m && m();
68
- }, [o, m]);
69
- const R = () => {
70
- e === "click" && s(!o);
71
- }, b = () => {
72
- e !== "click" && s(!0);
73
- }, E = () => {
74
- e !== "click" && s(!1);
75
- };
76
- return t.useEffect(() => {
77
- o || h && h(), a == null || a(o);
78
- }, [o]), /* @__PURE__ */ N("div", { ref: u, onClick: R, className: M, children: [
79
- /* @__PURE__ */ _(
80
- "label",
81
- {
82
- className: "bu-cursor-pointer",
83
- onMouseEnter: b,
84
- onMouseLeave: E,
85
- children: c
86
- }
87
- ),
88
- g && $(
89
- /* @__PURE__ */ _(
90
- "div",
91
- {
92
- onMouseEnter: b,
93
- onMouseLeave: E,
94
- ref: f,
95
- style: C.popper,
96
- ...L.popper,
97
- className: `${v["popover-content"]} ${o ? v["popover-content-visible"] : v["popover-content-hidden"]} ${y}`,
98
- children: n
99
- }
100
- ),
101
- document.body
102
- )
103
- ] });
104
- });
105
- export {
106
- B as Popover
107
- };
package/dist/Popup.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components/Popup/index'
package/dist/Popup.es.js DELETED
@@ -1,62 +0,0 @@
1
- "use client";
2
- import { jsxs as N, jsx as R } from "react/jsx-runtime";
3
- import * as e from "react";
4
- import { useRef as T } from "react";
5
- import { c as W } from "./index-c57db938.js";
6
- import "./clsx.m-e965ef18.js";
7
- const f = {
8
- "popup-container": "_popup-container_1lnwv_1",
9
- "popup-title": "_popup-title_1lnwv_5",
10
- "popup-content": "_popup-content_1lnwv_9"
11
- }, j = W("", {
12
- variants: {
13
- show: {
14
- true: "bu-opacity-1 bu-z-[1]",
15
- false: "bu-z-[1] bu-opacity-0"
16
- }
17
- }
18
- });
19
- function z(o) {
20
- const r = T(o);
21
- return r.current = o, r;
22
- }
23
- const q = e.forwardRef((o, r) => {
24
- e.useImperativeHandle(r, () => ({
25
- open: () => {
26
- s(!0);
27
- },
28
- close: () => {
29
- s(!1);
30
- }
31
- }));
32
- const { title: w, content: v, cancel: _, distance: d = 10, disabled: b = !1, auto: m } = o, [t, s] = e.useState(!1), [E, l] = e.useState(!1), [H, g] = e.useState(!1), n = e.useRef(null), [h, S] = e.useState(0), i = e.useRef(null), a = e.useRef(null), u = z(_), p = (c) => {
33
- i.current && document.contains(c.target) && c.target && !i.current.contains(c.target) && t && (s(!1), u.current && u.current());
34
- }, k = () => {
35
- b || (s(!t), t && u.current && u.current());
36
- };
37
- return e.useEffect(() => {
38
- if (n.current && S(n.current.clientHeight), n.current && a.current && t) {
39
- const c = window.innerHeight || document.documentElement.clientHeight, x = window.innerWidth || document.documentElement.clientWidth, { bottom: y, right: C } = n.current.getBoundingClientRect(), { height: L, width: I } = a.current.getBoundingClientRect();
40
- C + I >= x ? g(!0) : g(!1), m && y + L > c ? l(!1) : l(!0);
41
- }
42
- }, [t, m]), e.useEffect(() => (i.current && (document.removeEventListener("click", p), document.addEventListener("click", p)), () => {
43
- document.removeEventListener("click", p);
44
- }), [t]), /* @__PURE__ */ N("div", { ref: i, className: f["popup-container"], children: [
45
- /* @__PURE__ */ R("div", { ref: n, className: f["popup-title"], onClick: k, children: w }),
46
- /* @__PURE__ */ R(
47
- "div",
48
- {
49
- ref: a,
50
- className: `${j({ show: t })} ${f["popup-content"]}`,
51
- style: {
52
- ...E ? { top: d + h + "px" } : { bottom: d + h + "px" },
53
- ...H ? { right: 0 } : { left: 0 }
54
- },
55
- children: t && v
56
- }
57
- )
58
- ] });
59
- });
60
- export {
61
- q as Popup
62
- };