@blofin/blofin-ui 0.7.57 → 0.7.58

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 (292) hide show
  1. package/dist/Badge.es.js +23 -20
  2. package/dist/Button.es.js +126 -123
  3. package/dist/Calendar.d.ts +1 -0
  4. package/dist/Calendar.es.js +210 -0
  5. package/dist/Checkbox.d.ts +1 -0
  6. package/dist/Checkbox.es.js +138 -0
  7. package/dist/CssDropdown.d.ts +1 -0
  8. package/dist/CssDropdown.es.js +38 -0
  9. package/dist/DatePickerRange.d.ts +1 -0
  10. package/dist/DatePickerRange.es.js +410 -0
  11. package/dist/DateTimePicker.d.ts +1 -0
  12. package/dist/DateTimePicker.es.js +519 -0
  13. package/dist/Dialog.es.js +180 -9
  14. package/dist/Divider.es.js +11 -8
  15. package/dist/Drawer.es.js +43 -49
  16. package/dist/Dropdown.d.ts +1 -0
  17. package/dist/Dropdown.es.js +134 -0
  18. package/dist/Empty.d.ts +1 -0
  19. package/dist/Empty.es.js +11 -0
  20. package/dist/LabelTextField.d.ts +1 -0
  21. package/dist/LabelTextField.es.js +100 -0
  22. package/dist/MonthPicker.d.ts +1 -0
  23. package/dist/MonthPicker.es.js +16 -0
  24. package/dist/MultiSelect.d.ts +1 -0
  25. package/dist/MultiSelect.es.js +425 -0
  26. package/dist/Notification.d.ts +1 -0
  27. package/dist/Notification.es.js +12 -0
  28. package/dist/Pagination.d.ts +1 -0
  29. package/dist/Pagination.es.js +219 -0
  30. package/dist/Picker.d.ts +1 -0
  31. package/dist/Picker.es.js +224 -0
  32. package/dist/Popover.d.ts +1 -0
  33. package/dist/Popover.es.js +107 -0
  34. package/dist/Popup.d.ts +1 -0
  35. package/dist/Popup.es.js +62 -0
  36. package/dist/ProTable-7a07d8b6.js +565 -0
  37. package/dist/ProTable.es.js +9 -5
  38. package/dist/RadioButton.d.ts +1 -0
  39. package/dist/RadioButton.es.js +152 -0
  40. package/dist/Select.d.ts +1 -0
  41. package/dist/Select.es.js +316 -0
  42. package/dist/Slider.es.js +141 -139
  43. package/dist/Sort.d.ts +1 -0
  44. package/dist/Sort.es.js +146 -0
  45. package/dist/Sortable.d.ts +1 -0
  46. package/dist/Sortable.es.js +39 -0
  47. package/dist/Switch.d.ts +1 -0
  48. package/dist/Switch.es.js +64 -0
  49. package/dist/Tab.d.ts +1 -0
  50. package/dist/Tab.es.js +101 -0
  51. package/dist/Table.d.ts +1 -0
  52. package/dist/Table.es.js +359 -0
  53. package/dist/TextField.d.ts +1 -0
  54. package/dist/TextField.es.js +64 -0
  55. package/dist/TextSelect.d.ts +1 -0
  56. package/dist/TextSelect.es.js +17 -0
  57. package/dist/Textarea.d.ts +1 -0
  58. package/dist/Textarea.es.js +106 -0
  59. package/dist/Toast.d.ts +1 -0
  60. package/dist/Toast.es.js +12 -0
  61. package/dist/Tooltip.d.ts +1 -0
  62. package/dist/Tooltip.es.js +144 -0
  63. package/dist/Typography.d.ts +1 -0
  64. package/dist/Typography.es.js +74 -0
  65. package/dist/_commonjsHelpers-1d52fb73.js +9 -0
  66. package/dist/arrow-down-011b02c7.js +6 -0
  67. package/dist/arrow-down-l-line-97e4fe24.js +6 -0
  68. package/dist/arrow-fill-70becd96.js +6 -0
  69. package/dist/arrow-right-l-line-87881b4d.js +7 -0
  70. package/dist/blofin.css +1 -1
  71. package/dist/{close-c67ec245.js → close-0df24351.js} +1 -0
  72. package/dist/close-bg-6d2211ef.js +6 -0
  73. package/dist/clsx.m-e965ef18.js +22 -0
  74. package/dist/components/Alert/Alert.d.ts +3 -3
  75. package/dist/components/Alert/styles.d.ts +2 -2
  76. package/dist/components/Badge/Badge.d.ts +2 -2
  77. package/dist/components/Button/Button.d.ts +2 -2
  78. package/dist/components/Button/Loading/index.d.ts +2 -2
  79. package/dist/components/Button/index.d.ts +2 -0
  80. package/dist/components/Button/styles.d.ts +1 -1
  81. package/dist/components/Checkbox/styles.d.ts +1 -1
  82. package/dist/components/CssDropdown/CssDropdown.d.ts +3 -3
  83. package/dist/components/CssDropdown/index.d.ts +2 -0
  84. package/dist/components/DatePickerRange/index.d.ts +4 -0
  85. package/dist/components/DatePickerRange/styles.d.ts +0 -1
  86. package/dist/components/DateTimePicker/ScrollableList.d.ts +1 -1
  87. package/dist/components/DateTimePicker/index.d.ts +4 -0
  88. package/dist/components/Dialog/Dialog.d.ts +5 -2
  89. package/dist/components/Dialog/index.d.ts +4 -2
  90. package/dist/components/Dialog/styles.d.ts +2 -2
  91. package/dist/components/Drawer/Drawer.d.ts +1 -1
  92. package/dist/components/Dropdown/Dropdown.d.ts +2 -2
  93. package/dist/components/Dropdown/index.d.ts +2 -0
  94. package/dist/components/Empty/Empty.d.ts +5 -0
  95. package/dist/components/Empty/index.d.ts +2 -5
  96. package/dist/components/LabelTextField/LabelTextField.d.ts +6 -6
  97. package/dist/components/MonthPicker/MonthPicker.d.ts +17 -0
  98. package/dist/components/MonthPicker/index.d.ts +2 -17
  99. package/dist/components/MultiSelect/MultiSelect.d.ts +4 -4
  100. package/dist/components/MultiSelect/index.d.ts +2 -0
  101. package/dist/components/Notification/Notification.d.ts +1 -1
  102. package/dist/components/Notification/index.d.ts +2 -0
  103. package/dist/components/Pagination/PageOptions.d.ts +1 -1
  104. package/dist/components/Pagination/Pagination.d.ts +2 -2
  105. package/dist/components/Pagination/index.d.ts +3 -0
  106. package/dist/components/Picker/Picker.d.ts +10 -0
  107. package/dist/components/Picker/hooks/usePickerMethod.d.ts +1 -1
  108. package/dist/components/Picker/index.d.ts +2 -10
  109. package/dist/components/Popover/Popover.d.ts +1 -1
  110. package/dist/components/Popover/index.d.ts +5 -0
  111. package/dist/components/Popup/Popup.d.ts +15 -0
  112. package/dist/components/Popup/index.d.ts +4 -15
  113. package/dist/components/RadioButton/RadioButton.d.ts +4 -4
  114. package/dist/components/RadioButton/styles.d.ts +1 -1
  115. package/dist/components/Select/Select.d.ts +6 -9
  116. package/dist/components/Slider/Slider.d.ts +2 -2
  117. package/dist/components/Sort/SortButton.d.ts +5 -5
  118. package/dist/components/Sort/SortGroup.d.ts +4 -4
  119. package/dist/components/Sort/index.d.ts +5 -0
  120. package/dist/components/Sortable/SortItem.d.ts +4 -4
  121. package/dist/components/Sortable/Sortable.d.ts +11 -0
  122. package/dist/components/Sortable/index.d.ts +3 -11
  123. package/dist/components/Switch/Switch.d.ts +2 -2
  124. package/dist/components/Switch/index.d.ts +2 -0
  125. package/dist/components/Switch/styles.d.ts +3 -3
  126. package/dist/components/Tab/Tab.d.ts +2 -2
  127. package/dist/components/Tab/index.d.ts +4 -0
  128. package/dist/components/Tab/styles.d.ts +1 -1
  129. package/dist/components/Table/Pagination/index.d.ts +2 -2
  130. package/dist/components/Table/Table.d.ts +2 -2
  131. package/dist/components/Table/Tbody/index.d.ts +3 -3
  132. package/dist/components/Table/Thead/index.d.ts +3 -3
  133. package/dist/components/Table/context.d.ts +3 -3
  134. package/dist/components/Table/hooks/useStickyOffset.d.ts +2 -2
  135. package/dist/components/Table/index.d.ts +3 -3
  136. package/dist/components/Table/interface.d.ts +4 -4
  137. package/dist/components/TextField/TextField.d.ts +4 -4
  138. package/dist/components/TextField/index.d.ts +2 -0
  139. package/dist/components/TextSelect/TextSelect.d.ts +8 -8
  140. package/dist/components/TextSelect/index.d.ts +2 -0
  141. package/dist/components/Textarea/Textarea.d.ts +15 -0
  142. package/dist/components/Textarea/index.d.ts +2 -15
  143. package/dist/components/Toast/Toast.d.ts +2 -13
  144. package/dist/components/Toast/index.d.ts +2 -0
  145. package/dist/components/Toast/styles.d.ts +1 -1
  146. package/dist/components/Tooltip/Tooltip.d.ts +4 -5
  147. package/dist/components/Tooltip/index.d.ts +2 -0
  148. package/dist/components/Typography/Typography.d.ts +2 -2
  149. package/dist/components/Typography/index.d.ts +4 -0
  150. package/dist/components/Typography/styles.d.ts +1 -1
  151. package/dist/enum-0398044b.js +17 -0
  152. package/dist/helper-221987f8.js +7 -0
  153. package/dist/hooks/useLatest.d.ts +1 -1
  154. package/dist/hooks/useNotification.d.ts +5 -7
  155. package/dist/hooks/useToast.d.ts +1 -1
  156. package/dist/{index-0f855a91.js → index-0230b5a9.js} +5 -4
  157. package/dist/{index-c17e103a.js → index-02f669c4.js} +2 -1
  158. package/dist/{index-6fc4d1f4.js → index-03169373.js} +12 -25
  159. package/dist/{index-4ccb3e9c.js → index-03513979.js} +11 -24
  160. package/dist/{index-d5de8c20.js → index-03d6aef0.js} +13 -26
  161. package/dist/{index-a132ac63.js → index-06d0f2f7.js} +13 -26
  162. package/dist/{index-64f4d194.js → index-06ef2e10.js} +11 -24
  163. package/dist/{index-55a7fad3.js → index-08a64465.js} +11 -24
  164. package/dist/{index-659243c0.js → index-094d2a65.js} +19 -32
  165. package/dist/{index-e3570fb6.js → index-11268759.js} +18 -31
  166. package/dist/{index-0ab7162c.js → index-117d018c.js} +22 -35
  167. package/dist/{index-2e69928d.js → index-12d32536.js} +13 -26
  168. package/dist/{index-3c7614e3.js → index-141cec17.js} +14 -27
  169. package/dist/{index-207ff1e4.js → index-19d177fe.js} +16 -29
  170. package/dist/{index-cd93af19.js → index-1b2a64df.js} +26 -39
  171. package/dist/{index-b42b7f2a.js → index-2334248a.js} +9 -22
  172. package/dist/index-293f8244.js +49 -0
  173. package/dist/{index-d907bed0.js → index-29d37c73.js} +52 -65
  174. package/dist/{index-0228f85e.js → index-2ae0474b.js} +24 -37
  175. package/dist/{index-7f2a6d68.js → index-360aaaac.js} +28 -41
  176. package/dist/{index-789ea179.js → index-3ee2bafa.js} +15 -28
  177. package/dist/index-40023d52.js +5322 -0
  178. package/dist/{index-15cca5fd.js → index-40710f09.js} +17 -30
  179. package/dist/index-4528ba11.js +49 -0
  180. package/dist/{index-2ee3d9fd.js → index-4bc493f0.js} +4 -17
  181. package/dist/{index-2acdfe81.js → index-4c6ad36c.js} +32 -45
  182. package/dist/{index-f27785e7.js → index-4d780cf4.js} +22 -35
  183. package/dist/{index-87b93a08.js → index-4df0c3e4.js} +16 -29
  184. package/dist/{index-122d1ca2.js → index-4f94900a.js} +19 -32
  185. package/dist/{index-693a21bb.js → index-4f94d7fa.js} +22 -35
  186. package/dist/{index-1810cc68.js → index-57a163fd.js} +11 -24
  187. package/dist/index-596c785d.js +50 -0
  188. package/dist/{index-94ca2048.js → index-5beeed26.js} +23 -36
  189. package/dist/{index-54cbdaa4.js → index-5e6ffc2f.js} +2 -1
  190. package/dist/{index-9c669079.js → index-5fb7b3bc.js} +12 -25
  191. package/dist/{index-d914889d.js → index-60fe7f16.js} +13 -26
  192. package/dist/{index-7dfec241.js → index-63a66f13.js} +30 -43
  193. package/dist/index-67554651.js +49 -0
  194. package/dist/{index-b69e64e6.js → index-67678963.js} +22 -35
  195. package/dist/{index-523acf7a.js → index-6856be22.js} +21 -34
  196. package/dist/{index-0be486a6.js → index-6e969585.js} +27 -40
  197. package/dist/{index-cb3b96c6.js → index-6f728206.js} +9 -22
  198. package/dist/{index-2add17c1.js → index-6f963c6a.js} +20 -33
  199. package/dist/{index-a5251ade.js → index-73bfc020.js} +31 -44
  200. package/dist/{index-721120f3.js → index-75190b99.js} +7 -20
  201. package/dist/{index-70099dad.js → index-770e5f53.js} +12 -25
  202. package/dist/{index-f0b0c5fc.js → index-79e7317f.js} +12 -25
  203. package/dist/{index-312ee80f.js → index-7bb9ffdf.js} +3 -2
  204. package/dist/{index-013c5769.js → index-7cf9b111.js} +18 -31
  205. package/dist/{index-8d34dc76.js → index-7edb6aec.js} +19 -32
  206. package/dist/{index-0fa20e69.js → index-80cc70e4.js} +26 -39
  207. package/dist/{index-24112094.js → index-8585c2f3.js} +23 -36
  208. package/dist/{index-c1206eaf.js → index-898678dc.js} +21 -34
  209. package/dist/{index-fd4e070b.js → index-8aa9b1be.js} +24 -37
  210. package/dist/index-9349bf2d.js +345 -0
  211. package/dist/{index-dc3cd1ef.js → index-954d3973.js} +13 -26
  212. package/dist/{index-f5df4eec.js → index-956b36a6.js} +37 -50
  213. package/dist/{index-31004470.js → index-9c73c442.js} +45 -58
  214. package/dist/{index-887b08f6.js → index-9e5efc0a.js} +29 -42
  215. package/dist/{index-584c1de8.js → index-a6fa33ce.js} +13 -26
  216. package/dist/{index-2c3346b8.js → index-a89abb42.js} +4 -17
  217. package/dist/{index-0333ccf9.js → index-b0da3dfd.js} +14 -27
  218. package/dist/{index-fcb10f63.js → index-b103ed31.js} +12 -25
  219. package/dist/{index-9c3f8d80.js → index-b54ef52a.js} +16 -29
  220. package/dist/index-b7027a1d.js +1295 -0
  221. package/dist/{index-81a64a31.js → index-b7941b97.js} +8 -21
  222. package/dist/{index-b8e94395.js → index-c1381bca.js} +20 -33
  223. package/dist/index-c57db938.js +37 -0
  224. package/dist/{index-051b64c8.js → index-c6371af1.js} +10 -23
  225. package/dist/{index-a9c0f025.js → index-c69f6dfc.js} +19 -32
  226. package/dist/{index-e1f19bc5.js → index-cb1218d8.js} +10 -23
  227. package/dist/{index-c1b82aa9.js → index-cbc0d36b.js} +13 -26
  228. package/dist/{index-3b42042f.js → index-cc1cd309.js} +13 -26
  229. package/dist/{index-abb9f006.js → index-ceae4147.js} +12 -25
  230. package/dist/{index-b4116538.js → index-cfee583b.js} +21 -34
  231. package/dist/{index-7b28ddea.js → index-d2f2742e.js} +10 -23
  232. package/dist/{index-00d6276c.js → index-d3419554.js} +15 -28
  233. package/dist/{index-30f61bdc.js → index-d81e15f3.js} +19 -32
  234. package/dist/{index-40958da3.js → index-d86842c8.js} +17 -30
  235. package/dist/{index-46e4bfa3.js → index-e169373b.js} +10 -23
  236. package/dist/{index-aa5e48ef.js → index-e1a6a03d.js} +9 -22
  237. package/dist/{index-a45e1710.js → index-e2b960e4.js} +23 -36
  238. package/dist/{index-5648e9fa.js → index-e8fb69e0.js} +21 -34
  239. package/dist/{index-3b632a87.js → index-e98ef24f.js} +14 -27
  240. package/dist/{index-c6a5236d.js → index-e9a1ff7f.js} +4 -17
  241. package/dist/index-eea69add.js +71 -0
  242. package/dist/{index-9864c94e.js → index-ef31f5f8.js} +2 -1
  243. package/dist/{index-2e09190f.js → index-f1726c63.js} +11 -24
  244. package/dist/{index-d15a69b6.js → index-f40f45fb.js} +13 -26
  245. package/dist/{index-88d32101.js → index-f64eddcc.js} +16 -29
  246. package/dist/{index-44ed585d.js → index-f7c4ae83.js} +22 -35
  247. package/dist/{index-44b988bb.js → index-fda88eb4.js} +23 -36
  248. package/dist/{index-c58b598e.js → index-fdffd6e6.js} +14 -27
  249. package/dist/index.d.ts +36 -48
  250. package/dist/index.es.js +223 -53
  251. package/dist/index.esm-71578db5.js +1198 -0
  252. package/dist/index.module-1d7bbdf8.js +7 -0
  253. package/dist/index.module-86edc823.js +15 -0
  254. package/dist/index.module-b4239ff5.js +9 -0
  255. package/dist/index.module-fb41ba3b.js +39 -0
  256. package/dist/locales-776f0072.js +440 -0
  257. package/dist/provider/NoticeProvider.d.ts +1 -1
  258. package/dist/provider/ThemeProvider.d.ts +7 -3
  259. package/dist/provider/useTheme.d.ts +1 -1
  260. package/dist/search-b79a3be5.js +6 -0
  261. package/dist/sortable.esm-1c13d908.js +2896 -0
  262. package/dist/sortable.esm-8d31c120.js +1275 -0
  263. package/dist/styles-85a9fe64.js +136 -0
  264. package/dist/types/component.d.ts +1 -1
  265. package/dist/useAlign-916ed3be.js +44 -0
  266. package/dist/useDelayEvent-f577f6a3.js +1082 -0
  267. package/dist/useTheme-0688f238.js +16 -0
  268. package/dist/utils/helper.d.ts +1 -1
  269. package/dist/{utils-19b44377.js → utils-071abd68.js} +2 -1
  270. package/package.json +1 -1
  271. package/dist/Form.d.ts +0 -1
  272. package/dist/Form.es.js +0 -752
  273. package/dist/ProTable-079d6c86.js +0 -3443
  274. package/dist/components/Form/Control.d.ts +0 -13
  275. package/dist/components/Form/Form.d.ts +0 -4
  276. package/dist/components/Form/FormItem.d.ts +0 -4
  277. package/dist/components/Form/FormLabel.d.ts +0 -4
  278. package/dist/components/Form/context.d.ts +0 -6
  279. package/dist/components/Form/index.d.ts +0 -8
  280. package/dist/components/Form/interface.d.ts +0 -48
  281. package/dist/components/Form/store.d.ts +0 -16
  282. package/dist/components/Form/styles/item.d.ts +0 -5
  283. package/dist/components/Form/useForm.d.ts +0 -3
  284. package/dist/index-0b47cbae.js +0 -173
  285. package/dist/index-14c3a4d7.js +0 -62
  286. package/dist/index-6ffbeca8.js +0 -65
  287. package/dist/index-7be8731d.js +0 -62
  288. package/dist/index-b5974e22.js +0 -62
  289. package/dist/index-e102400f.js +0 -11706
  290. package/dist/index-fb1f3ef1.js +0 -63
  291. package/dist/isObjectLike-1b8bbac2.js +0 -44
  292. package/dist/jsx-runtime-82a9ddf6.js +0 -646
@@ -0,0 +1,519 @@
1
+ "use client";
2
+ import { jsxs as v, jsx as a, Fragment as V } from "react/jsx-runtime";
3
+ import * as r from "react";
4
+ import { Typography as I } from "./Typography.es.js";
5
+ import { S as ee } from "./arrow-down-l-line-97e4fe24.js";
6
+ import { a as te, S as re } from "./arrow-right-l-line-87881b4d.js";
7
+ import { u as ae, D as ue } from "./index.esm-71578db5.js";
8
+ import { c as d } from "./index-c57db938.js";
9
+ import { u as X } from "./useTheme-0688f238.js";
10
+ import { i as ne, h as Z } from "./index-b7027a1d.js";
11
+ import { f as oe, M as se } from "./index-eea69add.js";
12
+ import { Button as ie } from "./Button.es.js";
13
+ import { Divider as be } from "./Divider.es.js";
14
+ import { u as J, l as le, S as ce } from "./locales-776f0072.js";
15
+ import { s as de } from "./index.module-1d7bbdf8.js";
16
+ import "./utils-071abd68.js";
17
+ import "./clsx.m-e965ef18.js";
18
+ import "./Picker.es.js";
19
+ import "./_commonjsHelpers-1d52fb73.js";
20
+ import "./index.module-fb41ba3b.js";
21
+ const q = d("", {
22
+ variants: {
23
+ theme: {
24
+ light: "bu-text-light-label",
25
+ dark: "bu-text-dark-label"
26
+ }
27
+ }
28
+ }), he = d("", {
29
+ variants: {
30
+ theme: {
31
+ light: "bu-text-light-label-40",
32
+ dark: "bu-text-dark-label-40"
33
+ }
34
+ }
35
+ }), K = d("", {
36
+ variants: {
37
+ theme: {
38
+ light: "bu-bg-light-background bu-border-light-line-secondary",
39
+ dark: "bu-bg-dark-background bu-border-dark-line-secondary"
40
+ }
41
+ }
42
+ }), me = d("", {
43
+ variants: {
44
+ theme: {
45
+ light: "bu-bg-light-background hover:bu-bg-light-fill-quaternary hover:bu-text-light-label",
46
+ dark: "bu-bg-dark-background hover:bu-bg-dark-fill-quaternary hover:bu-text-dark-label"
47
+ }
48
+ }
49
+ }), G = d("", {
50
+ variants: {
51
+ theme: {
52
+ light: "bu-border-light-line-secondary bu-text-light-label-40",
53
+ dark: "bu-border-dark-line-secondary bu-text-dark-label-40"
54
+ }
55
+ }
56
+ }), ge = d("", {
57
+ variants: {
58
+ theme: {
59
+ light: "[&:has([aria-selected])]:bu-text-light-second [&:has([aria-selected].day-outside)]:!bu-bg-light-background [&:has([disabled])]:bu-bg-light-line-primary",
60
+ dark: "[&:has([aria-selected])]:bu-text-dark-second [&:has([aria-selected].day-outside)]:!bu-bg-dark-background [&:has([disabled])]:bu-bg-dark-line-primary"
61
+ }
62
+ }
63
+ }), pe = d("", {
64
+ variants: {
65
+ theme: {
66
+ light: "bu-text-light-label hover:bu-bg-light-primary-14 hover:bu-text-light-primary",
67
+ dark: "bu-text-dark-label hover:bu-bg-dark-primary-14 hover:bu-text-dark-primary"
68
+ }
69
+ }
70
+ }), fe = d("", {
71
+ variants: {
72
+ theme: {
73
+ light: "bu-bg-light-fill-quaternary bu-text-light-label aria-selected:bu-bg-light-primary aria-selected:bu-text-light-second",
74
+ dark: "bu-bg-dark-fill-quaternary bu-text-dark-label aria-selected:bu-bg-dark-primary aria-selected:bu-text-dark-second"
75
+ }
76
+ }
77
+ }), xe = d("", {
78
+ variants: {
79
+ theme: {
80
+ light: "bu-bg-light-primary hover:bu-bg-light-primary hover:bu-text-light-second focus:bu-bg-light-primary focus:bu-text-light-second",
81
+ dark: "bu-bg-dark-primary hover:bu-bg-dark-primary hover:bu-text-dark-second focus:bu-bg-dark-primary focus:bu-text-dark-second"
82
+ }
83
+ }
84
+ }), ye = d("", {
85
+ variants: {
86
+ theme: {
87
+ light: "bu-text-light-label-40 hover:!bu-bg-light-primary-14 hover:!bu-text-light-primary aria-selected:!bu-bg-light-background aria-selected:!bu-text-light-label-40",
88
+ dark: "bu-text-dark-label-40 hover:!bu-bg-dark-primary-14 hover:!bu-text-dark-primary aria-selected:!bu-bg-dark-background aria-selected:!bu-text-dark-label-40"
89
+ }
90
+ }
91
+ }), ke = d("", {
92
+ variants: {
93
+ theme: {
94
+ light: "bu-text-light-label-40",
95
+ dark: "bu-text-dark-label-40"
96
+ }
97
+ }
98
+ }), we = d("", {
99
+ variants: {
100
+ theme: {
101
+ light: "hover:!bu-bg-light-primary-14 hover:!bu-text-light-primary",
102
+ dark: "hover:!bu-bg-dark-primary-14 hover:!bu-text-dark-primary"
103
+ }
104
+ }
105
+ }), ve = d("", {
106
+ variants: {
107
+ theme: {
108
+ light: "bu-bg-light-primary-14",
109
+ dark: "bu-bg-dark-primary-14"
110
+ }
111
+ }
112
+ }), De = ({
113
+ className: n = "",
114
+ classNames: h,
115
+ showOutsideDays: i = !0,
116
+ month: b,
117
+ date: S,
118
+ startMonthShow: m,
119
+ setStartMonthShow: o,
120
+ setStartMonth: D,
121
+ locale: x,
122
+ hideHoursAndMinutes: $,
123
+ ...u
124
+ }) => {
125
+ const { theme: e } = X(), p = r.useCallback(
126
+ (g) => {
127
+ const { goToMonth: s, nextMonth: H, previousMonth: f } = ae(), y = () => {
128
+ o(!m), D(g.displayMonth);
129
+ };
130
+ return r.useEffect(() => {
131
+ b && s(b);
132
+ }, [b, S]), /* @__PURE__ */ v("div", { className: "bu-flex bu-h-[40px] bu-w-[333px] bu-items-center bu-justify-between bu-py-[8px]", children: [
133
+ /* @__PURE__ */ v(
134
+ "div",
135
+ {
136
+ className: "bu-flex bu-h-[12px] bu-cursor-pointer bu-items-center bu-gap-1",
137
+ onClick: y,
138
+ children: [
139
+ /* @__PURE__ */ a(I, { variant: "body2", weight: "medium", children: ne(g.displayMonth, "MMM yyy", { locale: x }) }),
140
+ /* @__PURE__ */ a(
141
+ ee,
142
+ {
143
+ className: `bu-h-[20px] bu-w-[20px] bu-cursor-pointer ${q({
144
+ theme: e
145
+ })}`
146
+ }
147
+ )
148
+ ]
149
+ }
150
+ ),
151
+ /* @__PURE__ */ v("div", { className: "bu-flex bu-gap-6", children: [
152
+ /* @__PURE__ */ a(
153
+ te,
154
+ {
155
+ className: `bu-h-[24px] bu-w-[24px] bu-cursor-pointer ${q({ theme: e })}`,
156
+ onClick: () => f && s(f)
157
+ }
158
+ ),
159
+ /* @__PURE__ */ a(
160
+ re,
161
+ {
162
+ className: `bu-h-[24px] bu-w-[24px] bu-cursor-pointer ${q({ theme: e })}`,
163
+ onClick: () => H && s(H)
164
+ }
165
+ )
166
+ ] })
167
+ ] });
168
+ },
169
+ [b, S]
170
+ );
171
+ return /* @__PURE__ */ a(
172
+ ue,
173
+ {
174
+ showOutsideDays: i,
175
+ className: n,
176
+ classNames: {
177
+ months: "bu-flex bu-flex-col sm:bu-flex-row bu-space-y-4 sm:bu-space-x-4 sm:bu-space-y-0",
178
+ month: "bu-space-y-4",
179
+ caption: "bu-flex bu-justify-center bu-pt-1 bu-relative bu-items-center",
180
+ caption_label: "bu-text-base bu-font-medium",
181
+ caption_start: `bu-pt-[16px] ${m ? "bu-hidden" : ""}`,
182
+ nav: "bu-space-x-1 bu-flex bu-items-center",
183
+ nav_button: `${me({
184
+ theme: e
185
+ })} bu-inline-flex bu-items-center bu-justify-center bu-whitespace-nowrap bu-rounded-md bu-text-base bu-font-medium bu-ring-offset-background bu-transition-colors disabled:bu-pointer-events-none bu-h-7 bu-w-7 bu-bg-transparent bu-p-0 hover:bu-opacity-100 bu-border bu-border-input`,
186
+ nav_button_previous: "bu-absolute bu-left-1",
187
+ nav_button_next: "bu-absolute bu-right-1",
188
+ table: "bu-border-collapse !bu-my-[8px]",
189
+ tbody: "bu-pt-[8px]",
190
+ head_row: "bu-flex",
191
+ head_cell: `${$ ? "!bu-w-[50px]" : "!bu-w-[32px]"} !bu-h-[28px] bu-font-normal bu-text-[12px] bu-pb-[8px] bu-border-b ${G({
192
+ theme: e
193
+ })}`,
194
+ row: "bu-flex bu-w-full bu-mt-[8px]",
195
+ cell: `${ge({
196
+ theme: e
197
+ })} !bu-h-[32px] ${$ ? "!bu-w-[50px]" : "!bu-w-[32px]"} bu-text-center bu-text-base bu-p-0 bu-relative [&:has([disabled])]:!bu-cursor-not-allowed [&:has([aria-selected].day-range-end)]:bu-rounded-r-[16px] first:[&:has([aria-selected])]:bu-rounded-l-[0px] last:[&:has([aria-selected])]:bu-rounded-r-[0px] focus-within:bu-relative focus-within:bu-z-20 [&:has([aria-selected].day-range-start)]:bu-rounded-l-[16px]`,
198
+ day: `${pe({
199
+ theme: e
200
+ })} bu-inline-flex bu-items-center bu-justify-center bu-whitespace-nowrap bu-rounded-[16px] bu-text-base bu-font-medium bu-ring-offset-background bu-transition-colors focus:bu-outline-none disabled:bu-pointer-events-none bu-h-8 bu-w-8 bu-p-0 bu-font-normal aria-selected:bu-opacity-100`,
201
+ day_selected: `${xe({ theme: e })}`,
202
+ day_today: `${fe({ theme: e })} bu-rounded-[16px]`,
203
+ day_outside: `day-outside ${ye({ theme: e })} aria-selected:bu-rounded-[16px]`,
204
+ day_disabled: `${ke({ theme: e })}`,
205
+ day_range_middle: `${we({ theme: e })}`,
206
+ day_hidden: "invisible",
207
+ ...h
208
+ },
209
+ components: {
210
+ Caption: p
211
+ },
212
+ locale: x,
213
+ ...u
214
+ }
215
+ );
216
+ }, Q = ({
217
+ theme: n,
218
+ items: h,
219
+ selectedItem: i,
220
+ onSelect: b,
221
+ disablePast: S = !1,
222
+ current: m
223
+ }) => {
224
+ const o = r.useRef(null), D = r.useRef([]), x = r.useRef(!1), $ = (u) => m ? Number(u) < m : !1;
225
+ return r.useEffect(() => {
226
+ if (x.current)
227
+ return;
228
+ const u = D.current[i];
229
+ if (u && o.current) {
230
+ const e = o.current.clientHeight, p = u.clientHeight, g = u.offsetTop - e / 2 - p;
231
+ o.current.scrollTo({ top: g });
232
+ }
233
+ }, [i]), r.useEffect(() => (setTimeout(() => {
234
+ x.current = !0;
235
+ }, 500), () => {
236
+ x.current = !1;
237
+ }), []), /* @__PURE__ */ a(
238
+ "ul",
239
+ {
240
+ ref: o,
241
+ className: `bu-h-[232px] bu-flex-1 bu-overflow-y-auto bu-overflow-x-hidden ${de["hide-scrollbar"]}`,
242
+ children: h.map((u, e) => {
243
+ const p = S && $(u);
244
+ return /* @__PURE__ */ a(
245
+ "li",
246
+ {
247
+ ref: (g) => {
248
+ D.current[e] = g;
249
+ },
250
+ className: `bu-mb-2 bu-flex bu-h-[32px] bu-w-[48px] bu-items-center bu-justify-center ${i === Number(u) ? ve({ theme: n }) : ""} ${p ? "bu-cursor-not-allowed" : "bu-cursor-pointer"}`,
251
+ onClick: () => !p && b(Number(u)),
252
+ children: /* @__PURE__ */ a(
253
+ I,
254
+ {
255
+ variant: "body3",
256
+ className: `${p ? he({ theme: n }) : q({ theme: n })}`,
257
+ children: u
258
+ }
259
+ )
260
+ },
261
+ u
262
+ );
263
+ })
264
+ }
265
+ );
266
+ }, Me = (n) => {
267
+ const h = [];
268
+ for (let i = 0; i < 60; i += n) {
269
+ const b = i.toString().padStart(2, "0");
270
+ h.push(`${b}`);
271
+ }
272
+ return h;
273
+ }, Se = ({
274
+ defaultValue: n,
275
+ limitDays: h,
276
+ isUtcTime: i,
277
+ lang: b,
278
+ minuteInterval: S,
279
+ hidePast: m
280
+ }) => {
281
+ const [o, D] = r.useState(/* @__PURE__ */ new Date()), [x, $] = r.useState(!1), [u, e] = r.useState(), [p, g] = r.useState(), [s, H] = r.useState(303), [f, y] = r.useState((/* @__PURE__ */ new Date()).getHours()), [M, j] = r.useState((/* @__PURE__ */ new Date()).getMinutes()), [z, R] = r.useState(null), L = h && h > 0 && h * 24 * 60 * 60 * 1e3, N = (l) => i ? J(l, "UTC") : new Date(l), A = {
282
+ today: J((/* @__PURE__ */ new Date()).getTime(), "UTC")
283
+ };
284
+ r.useEffect(() => {
285
+ (async () => {
286
+ const k = await le(b);
287
+ R(k);
288
+ })();
289
+ }, [b]), r.useEffect(() => {
290
+ var l;
291
+ if (u) {
292
+ const k = ((l = document.querySelector(".bu-date-picker")) == null ? void 0 : l.clientHeight) || 303;
293
+ H(k);
294
+ }
295
+ }, [u]), r.useEffect(() => {
296
+ n && (D(new Date(n)), y(new Date(n).getHours()), j(new Date(n).getMinutes()), g(new Date(n)), e(new Date(n)));
297
+ }, [n]);
298
+ const _ = r.useMemo(() => {
299
+ const l = N(L ? (/* @__PURE__ */ new Date()).getTime() : new Date(2100, 10).getTime());
300
+ l.setHours(0, 0, 0, 0);
301
+ const k = L ? new Date(l.getTime() - L) : N(new Date(1970, 0).getTime()), T = k.getFullYear(), E = k.getMonth() + 1, w = l.getFullYear(), O = l.getMonth() + 1, F = {};
302
+ for (let t = T; t <= w; t++) {
303
+ F[t] = [];
304
+ let c = 1, C = 12;
305
+ t === T && (c = E), t === w && (C = O);
306
+ for (let W = c; W <= C; W++)
307
+ F[t].push(W);
308
+ }
309
+ return F;
310
+ }, [L]), P = Array.from({ length: 24 }, (l, k) => k.toString().padStart(2, "0")), Y = Me(S), U = r.useMemo(() => m && o && o.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), [m, o]), B = r.useMemo(() => m && o && o.toDateString() === (/* @__PURE__ */ new Date()).toDateString() && f === (/* @__PURE__ */ new Date()).getHours(), [m, o, f]);
311
+ return {
312
+ date: o,
313
+ setDate: D,
314
+ startMonthShow: x,
315
+ setStartMonthShow: $,
316
+ startMonth: u,
317
+ setStartMonth: e,
318
+ month: p,
319
+ setMonth: g,
320
+ monthHeight: s,
321
+ currentHour: f,
322
+ setCurrentHour: y,
323
+ currentMinute: M,
324
+ setCurrentMinute: j,
325
+ locale: z,
326
+ modifiers: A,
327
+ calculateMonths: _,
328
+ hours: P,
329
+ minutes: Y,
330
+ disabledHour: U,
331
+ disabledMinute: B
332
+ };
333
+ }, Oe = ({
334
+ id: n,
335
+ className: h = "",
336
+ defaultValue: i,
337
+ setValues: b,
338
+ disabledDays: S,
339
+ limitDays: m,
340
+ isUtcTime: o = !1,
341
+ lang: D = "en",
342
+ confirmText: x = "Confirm",
343
+ cancelText: $ = "Cancel",
344
+ submitText: u = "Ok",
345
+ minuteInterval: e = 1,
346
+ hidePast: p = !0,
347
+ hideHoursAndMinutes: g = !1
348
+ }) => {
349
+ const {
350
+ date: s,
351
+ setDate: H,
352
+ startMonthShow: f,
353
+ setStartMonthShow: y,
354
+ startMonth: M,
355
+ setStartMonth: j,
356
+ month: z,
357
+ setMonth: R,
358
+ monthHeight: L,
359
+ currentHour: N,
360
+ setCurrentHour: A,
361
+ currentMinute: _,
362
+ setCurrentMinute: P,
363
+ locale: Y,
364
+ modifiers: U,
365
+ calculateMonths: B,
366
+ hours: l,
367
+ minutes: k,
368
+ disabledHour: T,
369
+ disabledMinute: E
370
+ } = Se({
371
+ defaultValue: i,
372
+ limitDays: m,
373
+ isUtcTime: o,
374
+ lang: D,
375
+ minuteInterval: e,
376
+ hidePast: p
377
+ }), { theme: w } = X(), O = (t) => {
378
+ if (H(t), t) {
379
+ const c = t.getMonth();
380
+ c !== (s == null ? void 0 : s.getMonth()) && R(new Date(t.getFullYear(), c));
381
+ }
382
+ }, F = () => {
383
+ if (s) {
384
+ const t = new Date(s), c = T && N < (/* @__PURE__ */ new Date()).getHours() ? (/* @__PURE__ */ new Date()).getHours() : N, C = E && _ < (/* @__PURE__ */ new Date()).getMinutes() ? (/* @__PURE__ */ new Date()).getMinutes() : _;
385
+ t.setHours(c, C, 0, 0), b(t.getTime());
386
+ } else
387
+ b(i);
388
+ setTimeout(() => {
389
+ y(!1);
390
+ }, 500);
391
+ };
392
+ return /* @__PURE__ */ a("div", { id: n, className: `bu-date-picker-range ${h}`, children: /* @__PURE__ */ v("div", { className: `bu-rounded bu-border bu-px-[16px] bu-pb-[8px] ${K({ theme: w })}`, children: [
393
+ /* @__PURE__ */ v("div", { className: "bu-date-picker bu-relative", children: [
394
+ f && /* @__PURE__ */ v(
395
+ "div",
396
+ {
397
+ className: `bu-w-[333px] bu-flex-1 bu-pr-[16px] bu-pt-[16px] ${K({
398
+ theme: w
399
+ })}`,
400
+ style: { height: L + "px" },
401
+ children: [
402
+ /* @__PURE__ */ v(
403
+ "div",
404
+ {
405
+ className: "bu-flex bu-h-[40px] bu-cursor-pointer bu-items-center bu-gap-[4px] bu-py-[8px]",
406
+ onClick: () => y(!1),
407
+ children: [
408
+ /* @__PURE__ */ a(I, { variant: "body2", weight: "medium", children: M && oe(M, "MMM yyy", {
409
+ locale: Y || Z
410
+ }) }),
411
+ /* @__PURE__ */ a(ce, { className: `bu-h-5 bu-w-5 ${q({ theme: w })}` })
412
+ ]
413
+ }
414
+ ),
415
+ /* @__PURE__ */ a(
416
+ se,
417
+ {
418
+ data: B,
419
+ currentYear: M ? M.getFullYear() : (/* @__PURE__ */ new Date()).getFullYear(),
420
+ currentMonth: M ? M.getMonth() + 1 : (/* @__PURE__ */ new Date()).getMonth() + 1,
421
+ setMonth: j,
422
+ locale: Y || Z,
423
+ confirmText: x,
424
+ cancelText: $,
425
+ cancel: y.bind(null, !1),
426
+ confirm: () => {
427
+ R(M), y(!1), setTimeout(() => {
428
+ R(void 0);
429
+ }, 200);
430
+ }
431
+ }
432
+ )
433
+ ]
434
+ }
435
+ ),
436
+ /* @__PURE__ */ a(
437
+ De,
438
+ {
439
+ mode: "single",
440
+ date: s == null ? void 0 : s.getTime(),
441
+ selected: s,
442
+ onSelect: O,
443
+ disabled: S,
444
+ startMonthShow: f,
445
+ setStartMonthShow: y,
446
+ setStartMonth: j,
447
+ locale: Y || Z,
448
+ month: z,
449
+ modifiers: o ? U : void 0,
450
+ fixedWeeks: !0,
451
+ showOutsideDays: !0,
452
+ hideHoursAndMinutes: g
453
+ }
454
+ ),
455
+ !g && /* @__PURE__ */ v(
456
+ "div",
457
+ {
458
+ className: `bu-absolute bu-right-0 bu-top-[56px] bu-h-[236px] bu-w-[109px] ${f ? "bu-hidden" : ""}`,
459
+ children: [
460
+ /* @__PURE__ */ a(
461
+ "div",
462
+ {
463
+ className: `bu-h-[36px] bu-border-b ${G({
464
+ theme: w
465
+ })}`,
466
+ children: " "
467
+ }
468
+ ),
469
+ /* @__PURE__ */ v("div", { className: "bu-flex bu-pl-1 bu-pt-2", children: [
470
+ /* @__PURE__ */ a(
471
+ Q,
472
+ {
473
+ theme: w,
474
+ items: l,
475
+ selectedItem: N,
476
+ onSelect: (t) => {
477
+ const c = (/* @__PURE__ */ new Date()).getHours(), C = (/* @__PURE__ */ new Date()).getMinutes();
478
+ A(T && t < c ? c : t), T && t === c && _ < C && P(C);
479
+ },
480
+ disablePast: T,
481
+ current: (/* @__PURE__ */ new Date()).getHours()
482
+ }
483
+ ),
484
+ /* @__PURE__ */ a(
485
+ "span",
486
+ {
487
+ className: `bu-mx-1 bu-h-[236px] bu-w-[1px] bu-border-r ${G({
488
+ theme: w
489
+ })}`
490
+ }
491
+ ),
492
+ /* @__PURE__ */ a(
493
+ Q,
494
+ {
495
+ theme: w,
496
+ items: k,
497
+ selectedItem: _,
498
+ onSelect: (t) => {
499
+ const c = (/* @__PURE__ */ new Date()).getMinutes();
500
+ P(E && t < c ? c : t);
501
+ },
502
+ disablePast: E,
503
+ current: (/* @__PURE__ */ new Date()).getMinutes()
504
+ }
505
+ )
506
+ ] })
507
+ ]
508
+ }
509
+ )
510
+ ] }),
511
+ !f && /* @__PURE__ */ v(V, { children: [
512
+ /* @__PURE__ */ a(be, { direction: "horizontal" }),
513
+ /* @__PURE__ */ a("div", { className: "bu-flex bu-items-center bu-justify-end bu-py-[8px]", children: /* @__PURE__ */ a(ie, { onClick: () => F(), size: "small", variant: "primary", children: u }) })
514
+ ] })
515
+ ] }) });
516
+ };
517
+ export {
518
+ Oe as DateTimePicker
519
+ };
package/dist/Dialog.es.js CHANGED
@@ -1,11 +1,182 @@
1
- import { D as f } from "./index-0b47cbae.js";
2
- import "./jsx-runtime-82a9ddf6.js";
3
- import "react";
4
- import "react-dom";
5
- import "./close-c67ec245.js";
6
- import "./Button.es.js";
7
- import "./utils-19b44377.js";
8
- import "./index-6ffbeca8.js";
1
+ "use client";
2
+ import { jsx as o, jsxs as f, Fragment as g } from "react/jsx-runtime";
3
+ import * as a from "react";
4
+ import { createPortal as G } from "react-dom";
5
+ import { S as M } from "./close-0df24351.js";
6
+ import { Button as _ } from "./Button.es.js";
7
+ import { c as u } from "./index-c57db938.js";
8
+ import { u as U } from "./useTheme-0688f238.js";
9
+ import "./utils-071abd68.js";
10
+ import "./clsx.m-e965ef18.js";
11
+ const V = u(
12
+ "bu-absolute bu-left-[50%] bu-top-[50%] bu-flex bu-translate-x-[-50%] bu-translate-y-[-50%] bu-flex-col bu-justify-between bu-rounded-[10px] bu-pb-[32px] bu-pt-[24px]",
13
+ {
14
+ variants: {
15
+ size: {
16
+ large: "max-[600px]:bu-w-[80%] min-[600px]:bu-min-h-[234px] min-[600px]:bu-w-[800px]",
17
+ medium: "max-[600px]:bu-w-[80%] min-[600px]:bu-min-h-[226px] min-[600px]:bu-w-[600px]",
18
+ small: "max-[600px]:bu-w-[80%] min-[600px]:bu-min-h-[210px] min-[600px]:bu-w-[520px]"
19
+ },
20
+ theme: {
21
+ dark: "bu-bg-dark-hover-fill-primary",
22
+ light: "bu-bg-light-background"
23
+ }
24
+ }
25
+ }
26
+ ), A = u("", {
27
+ variants: {
28
+ theme: {
29
+ dark: "bu-text-dark-label",
30
+ light: "bu-text-light-label"
31
+ }
32
+ }
33
+ }), H = u(
34
+ "bu-absolute bu-right-[20px] bu-h-[24px] bu-w-[24px] bu-cursor-pointer",
35
+ {
36
+ variants: {
37
+ theme: {
38
+ dark: "bu-text-dark-label-40",
39
+ light: "bu-text-light-label-40"
40
+ }
41
+ }
42
+ }
43
+ ), J = u("bu-flex bu-px-[24px]", {
44
+ variants: {
45
+ footerLayout: {
46
+ right: "bu-justify-end",
47
+ left: "bu-justify-start",
48
+ center: "bu-justify-center"
49
+ }
50
+ }
51
+ }), K = "_mock_13kkq_1", Q = "_dialog_13kkq_5", W = "_title_13kkq_9", X = "_content_13kkq_13", r = {
52
+ mock: K,
53
+ dialog: Q,
54
+ title: W,
55
+ content: X
56
+ }, N = (t) => {
57
+ const {
58
+ size: e,
59
+ title: s,
60
+ content: m,
61
+ maskClosable: n = !1,
62
+ cancelText: l = "",
63
+ confirmText: $ = "",
64
+ footer: d,
65
+ cancel: k,
66
+ confirm: y,
67
+ theme: v,
68
+ footerLayout: j,
69
+ footerSize: w = "small",
70
+ hideCancel: C = !1,
71
+ hideConfirm: z = !1,
72
+ hideIcon: D = !1,
73
+ className: I,
74
+ contentClassName: q,
75
+ open: b,
76
+ loading: T = !1,
77
+ containerRef: E,
78
+ modalClassName: R
79
+ } = t, { theme: L } = U(), [O, P] = a.useState(!1), i = () => v || L, p = () => {
80
+ k && k();
81
+ }, B = () => {
82
+ n && p();
83
+ }, F = () => {
84
+ y && y();
85
+ };
86
+ return a.useEffect(() => (document.body.style.overflow = b ? "hidden" : "", P(b), () => {
87
+ document.body.style.overflow = "";
88
+ }), [b]), O ? G(
89
+ /* @__PURE__ */ o("div", { className: `${r.mock} ${R}`, onClick: B, children: /* @__PURE__ */ f(
90
+ "div",
91
+ {
92
+ className: `${r.dialog} ${V({
93
+ size: e,
94
+ theme: i()
95
+ })} ${I}`,
96
+ children: [
97
+ !D && /* @__PURE__ */ o(
98
+ M,
99
+ {
100
+ className: `${H({
101
+ theme: i()
102
+ })}`,
103
+ onClick: p
104
+ }
105
+ ),
106
+ /* @__PURE__ */ o("div", { className: A({ theme: i() }), children: s !== null && /* @__PURE__ */ o("div", { className: r.title, children: s }) }),
107
+ /* @__PURE__ */ o("div", { ref: E, className: `${r.content} ${q}`, children: m }),
108
+ /* @__PURE__ */ o("div", { className: J({ footerLayout: j }), children: d === null ? null : d || /* @__PURE__ */ f(g, { children: [
109
+ !C && /* @__PURE__ */ o(
110
+ _,
111
+ {
112
+ size: w,
113
+ variant: "ghost",
114
+ theme: i(),
115
+ onClick: p,
116
+ children: l
117
+ }
118
+ ),
119
+ !z && /* @__PURE__ */ o(
120
+ _,
121
+ {
122
+ className: C ? "" : "bu-ml-[16px]",
123
+ size: w,
124
+ variant: "primary",
125
+ loading: T,
126
+ theme: i(),
127
+ onClick: F,
128
+ children: $
129
+ }
130
+ )
131
+ ] }) })
132
+ ]
133
+ }
134
+ ) }),
135
+ document.body
136
+ ) : null;
137
+ }, c = [];
138
+ let Y = 0;
139
+ const h = /* @__PURE__ */ new Set(), S = () => {
140
+ h.forEach((t) => t());
141
+ }, x = (t) => {
142
+ const e = c.findIndex((s) => s.id === t);
143
+ e !== -1 && (c.splice(e, 1), S());
144
+ }, Z = () => {
145
+ const [, t] = a.useReducer((e) => e + 1, 0);
146
+ return a.useEffect(() => (h.add(t), () => {
147
+ h.delete(t);
148
+ }), []), /* @__PURE__ */ o(g, { children: c.map((e) => {
149
+ const s = () => {
150
+ var n, l;
151
+ (l = (n = e.props).cancel) == null || l.call(n), x(e.id);
152
+ }, m = () => {
153
+ var n, l;
154
+ (l = (n = e.props).confirm) == null || l.call(n), x(e.id);
155
+ };
156
+ return /* @__PURE__ */ o(
157
+ N,
158
+ {
159
+ ...e.props,
160
+ open: !0,
161
+ cancel: s,
162
+ confirm: m
163
+ },
164
+ e.id
165
+ );
166
+ }) });
167
+ }, ee = (t) => {
168
+ if (typeof window > "u")
169
+ return console.warn("Dialog.show 仅能在浏览器端调用"), () => {
170
+ };
171
+ const e = Y++;
172
+ return c.push({ id: e, props: t }), S(), () => x(e);
173
+ };
174
+ N.show = ee;
175
+ const ce = ({ children: t }) => /* @__PURE__ */ f(g, { children: [
176
+ t,
177
+ /* @__PURE__ */ o(Z, {})
178
+ ] });
9
179
  export {
10
- f as Dialog
180
+ N as Dialog,
181
+ ce as DialogProvider
11
182
  };