musae 0.2.26 → 0.3.0

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 (682) hide show
  1. package/dist/components/avatar/avatar.cjs +179 -0
  2. package/dist/components/avatar/{avatar.js → avatar.mjs} +12 -12
  3. package/dist/components/avatar/context.cjs +9 -0
  4. package/dist/components/avatar/group.cjs +67 -0
  5. package/dist/components/avatar/{group.js → group.mjs} +6 -6
  6. package/dist/components/avatar/index.cjs +8 -0
  7. package/dist/components/avatar/{index.js → index.mjs} +2 -2
  8. package/dist/components/avatar/types.d.ts +1 -1
  9. package/dist/components/badge/badge.cjs +120 -0
  10. package/dist/components/badge/{badge.js → badge.mjs} +9 -10
  11. package/dist/components/badge/types.d.ts +1 -1
  12. package/dist/components/bench/bench.cjs +164 -0
  13. package/dist/components/bench/bench.d.ts +2 -2
  14. package/dist/components/bench/{bench.js → bench.mjs} +13 -14
  15. package/dist/components/bench/hooks.cjs +129 -0
  16. package/dist/components/bench/hooks.d.ts +4 -4
  17. package/dist/components/bench/{hooks.js → hooks.mjs} +3 -3
  18. package/dist/components/bench/index.d.ts +0 -2
  19. package/dist/components/breadcrumb/breadcrumb.cjs +60 -0
  20. package/dist/components/breadcrumb/{breadcrumb.js → breadcrumb.mjs} +10 -11
  21. package/dist/components/breadcrumb/item.cjs +88 -0
  22. package/dist/components/breadcrumb/{item.js → item.mjs} +6 -6
  23. package/dist/components/breadcrumb/types.d.ts +1 -1
  24. package/dist/components/button/button.cjs +298 -0
  25. package/dist/components/button/{button.js → button.mjs} +15 -15
  26. package/dist/components/button/hooks.cjs +24 -0
  27. package/dist/components/button/{hooks.js → hooks.mjs} +1 -1
  28. package/dist/components/button/types.d.ts +1 -1
  29. package/dist/components/calendar/calendar.cjs +109 -0
  30. package/dist/components/calendar/{calendar.js → calendar.mjs} +15 -16
  31. package/dist/components/calendar/hooks.cjs +235 -0
  32. package/dist/components/calendar/{hooks.js → hooks.mjs} +11 -11
  33. package/dist/components/calendar/types.d.ts +1 -1
  34. package/dist/components/cascader/cascader.cjs +86 -0
  35. package/dist/components/cascader/{cascader.js → cascader.mjs} +8 -9
  36. package/dist/components/cascader/hooks.cjs +130 -0
  37. package/dist/components/cascader/hooks.d.ts +2 -2
  38. package/dist/components/cascader/{hooks.js → hooks.mjs} +1 -1
  39. package/dist/components/cascader/types.d.ts +1 -1
  40. package/dist/components/cascader/utils.cjs +108 -0
  41. package/dist/components/cascader/utils.d.ts +1 -1
  42. package/dist/components/checkbox/checkbox.cjs +88 -0
  43. package/dist/components/checkbox/{checkbox.js → checkbox.mjs} +10 -10
  44. package/dist/components/checkbox/context.cjs +7 -0
  45. package/dist/components/checkbox/group.cjs +48 -0
  46. package/dist/components/checkbox/{group.js → group.mjs} +1 -1
  47. package/dist/components/checkbox/index.cjs +8 -0
  48. package/dist/components/checkbox/{index.js → index.mjs} +2 -2
  49. package/dist/components/checkbox/styles.cjs +186 -0
  50. package/dist/components/checkbox/styles.d.ts +1 -0
  51. package/dist/components/checkbox/{styles.js → styles.mjs} +1 -0
  52. package/dist/components/checkbox/types.d.ts +1 -1
  53. package/dist/components/clock/clock.cjs +40 -0
  54. package/dist/components/clock/{clock.js → clock.mjs} +7 -8
  55. package/dist/components/clock/column.cjs +92 -0
  56. package/dist/components/clock/{column.js → column.mjs} +9 -9
  57. package/dist/components/clock/hooks.cjs +12 -0
  58. package/dist/components/clock/{hooks.js → hooks.mjs} +1 -1
  59. package/dist/components/clock/types.cjs +6 -0
  60. package/dist/components/clock/types.d.ts +1 -1
  61. package/dist/components/collapse/collapse.cjs +102 -0
  62. package/dist/components/collapse/{collapse.js → collapse.mjs} +10 -11
  63. package/dist/components/collapse/context.cjs +12 -0
  64. package/dist/components/collapse/hooks.cjs +51 -0
  65. package/dist/components/collapse/item.cjs +170 -0
  66. package/dist/components/collapse/{item.js → item.mjs} +9 -9
  67. package/dist/components/collapse/types.d.ts +1 -1
  68. package/dist/components/config/context.cjs +11 -0
  69. package/dist/components/config/{context.js → context.mjs} +1 -1
  70. package/dist/components/config/hooks.cjs +12 -0
  71. package/dist/components/config/{hooks.js → hooks.mjs} +1 -1
  72. package/dist/components/config/provider.cjs +35 -0
  73. package/dist/components/config/{provider.js → provider.mjs} +7 -8
  74. package/dist/components/config/types.d.ts +1 -1
  75. package/dist/components/countdown/countdown.cjs +85 -0
  76. package/dist/components/countdown/{countdown.js → countdown.mjs} +2 -3
  77. package/dist/components/countdown/types.d.ts +1 -1
  78. package/dist/components/date-picker/date-picker.cjs +45 -0
  79. package/dist/components/date-picker/{date-picker.js → date-picker.mjs} +12 -13
  80. package/dist/components/date-picker/hooks.cjs +31 -0
  81. package/dist/components/date-range-picker/date-range-picker.cjs +56 -0
  82. package/dist/components/date-range-picker/{date-range-picker.js → date-range-picker.mjs} +8 -9
  83. package/dist/components/date-range-picker/hooks.cjs +41 -0
  84. package/dist/components/dialog/dialog.cjs +40 -0
  85. package/dist/components/dialog/{dialog.js → dialog.mjs} +3 -4
  86. package/dist/components/dialog/hooks.cjs +32 -0
  87. package/dist/components/dialog/{hooks.js → hooks.mjs} +4 -4
  88. package/dist/components/dialog/popup.cjs +216 -0
  89. package/dist/components/dialog/{popup.js → popup.mjs} +20 -20
  90. package/dist/components/dialog/types.d.ts +1 -1
  91. package/dist/components/divider/divider.cjs +181 -0
  92. package/dist/components/divider/{divider.js → divider.mjs} +12 -13
  93. package/dist/components/divider/hooks.cjs +16 -0
  94. package/dist/components/divider/types.d.ts +1 -1
  95. package/dist/components/drawer/drawer.cjs +46 -0
  96. package/dist/components/drawer/{drawer.js → drawer.mjs} +3 -4
  97. package/dist/components/drawer/hooks.cjs +8 -0
  98. package/dist/components/drawer/popup.cjs +276 -0
  99. package/dist/components/drawer/{popup.js → popup.mjs} +15 -15
  100. package/dist/components/drawer/types.d.ts +1 -1
  101. package/dist/components/empty/empty.cjs +66 -0
  102. package/dist/components/empty/{empty.js → empty.mjs} +8 -9
  103. package/dist/components/floating-action-button/floatable.cjs +102 -0
  104. package/dist/components/floating-action-button/{floatable.js → floatable.mjs} +4 -4
  105. package/dist/components/floating-action-button/floating-action-button.cjs +39 -0
  106. package/dist/components/floating-action-button/{floating-action-button.js → floating-action-button.mjs} +3 -4
  107. package/dist/components/form/context.cjs +12 -0
  108. package/dist/components/form/context.d.ts +1 -1
  109. package/dist/components/form/{context.js → context.mjs} +1 -2
  110. package/dist/components/form/field/error.cjs +74 -0
  111. package/dist/components/form/field/error.d.ts +1 -1
  112. package/dist/components/form/field/{error.js → error.mjs} +6 -6
  113. package/dist/components/form/field/field.cjs +96 -0
  114. package/dist/components/form/field/field.d.ts +2 -2
  115. package/dist/components/form/field/field.mjs +94 -0
  116. package/dist/components/form/field/layout.cjs +79 -0
  117. package/dist/components/form/field/layout.d.ts +4 -3
  118. package/dist/components/form/field/layout.mjs +77 -0
  119. package/dist/components/form/form.cjs +55 -0
  120. package/dist/components/form/form.d.ts +1 -1
  121. package/dist/components/form/{form.js → form.mjs} +2 -2
  122. package/dist/components/form/hooks.cjs +14 -0
  123. package/dist/components/form/index.cjs +10 -0
  124. package/dist/components/form/index.d.ts +1 -4
  125. package/dist/components/form/index.mjs +10 -0
  126. package/dist/components/form/item.cjs +35 -0
  127. package/dist/components/form/item.d.ts +1 -1
  128. package/dist/components/form/{item.js → item.mjs} +4 -2
  129. package/dist/components/grid/col.cjs +40 -0
  130. package/dist/components/grid/{col.js → col.mjs} +5 -5
  131. package/dist/components/grid/index.cjs +9 -0
  132. package/dist/components/grid/{index.js → index.mjs} +2 -2
  133. package/dist/components/grid/row.cjs +65 -0
  134. package/dist/components/grid/{row.js → row.mjs} +6 -6
  135. package/dist/components/grid/types.d.ts +1 -1
  136. package/dist/components/highlight/highlight.cjs +57 -0
  137. package/dist/components/highlight/{highlight.js → highlight.mjs} +6 -6
  138. package/dist/components/i18n-button/hooks.cjs +78 -0
  139. package/dist/components/i18n-button/hooks.d.ts +2 -2
  140. package/dist/components/i18n-button/{hooks.js → hooks.mjs} +3 -3
  141. package/dist/components/i18n-button/i18n-button.cjs +56 -0
  142. package/dist/components/i18n-button/{i18n-button.js → i18n-button.mjs} +6 -7
  143. package/dist/components/i18n-button/types.d.ts +1 -1
  144. package/dist/components/icon/hoc.cjs +17 -0
  145. package/dist/components/icon/{hoc.js → hoc.mjs} +1 -1
  146. package/dist/components/icon/icon.cjs +60 -0
  147. package/dist/components/icon/{icon.js → icon.mjs} +8 -9
  148. package/dist/components/icon/icons/action/check-circle-outline.cjs +20 -0
  149. package/dist/components/icon/icons/action/{check-circle-outline.js → check-circle-outline.mjs} +2 -3
  150. package/dist/components/icon/icons/action/check-circle.cjs +20 -0
  151. package/dist/components/icon/icons/action/{check-circle.js → check-circle.mjs} +2 -3
  152. package/dist/components/icon/icons/action/code.cjs +20 -0
  153. package/dist/components/icon/icons/action/{code.js → code.mjs} +2 -3
  154. package/dist/components/icon/icons/action/done-outline.cjs +20 -0
  155. package/dist/components/icon/icons/action/{done-outline.js → done-outline.mjs} +2 -3
  156. package/dist/components/icon/icons/action/done.cjs +20 -0
  157. package/dist/components/icon/icons/action/{done.js → done.mjs} +2 -3
  158. package/dist/components/icon/icons/action/index.cjs +29 -0
  159. package/dist/components/icon/icons/action/index.mjs +13 -0
  160. package/dist/components/icon/icons/action/open-in-new.cjs +20 -0
  161. package/dist/components/icon/icons/action/{open-in-new.js → open-in-new.mjs} +2 -3
  162. package/dist/components/icon/icons/action/swap-horiz.cjs +20 -0
  163. package/dist/components/icon/icons/action/{swap-horiz.js → swap-horiz.mjs} +2 -3
  164. package/dist/components/icon/icons/action/swap-vert.cjs +20 -0
  165. package/dist/components/icon/icons/action/{swap-vert.js → swap-vert.mjs} +2 -3
  166. package/dist/components/icon/icons/action/translate.cjs +20 -0
  167. package/dist/components/icon/icons/action/{translate.js → translate.mjs} +2 -3
  168. package/dist/components/icon/icons/action/visibility-off.cjs +20 -0
  169. package/dist/components/icon/icons/action/{visibility-off.js → visibility-off.mjs} +2 -3
  170. package/dist/components/icon/icons/action/visibility.cjs +20 -0
  171. package/dist/components/icon/icons/action/{visibility.js → visibility.mjs} +2 -3
  172. package/dist/components/icon/icons/action/zoom-in.cjs +20 -0
  173. package/dist/components/icon/icons/action/{zoom-in.js → zoom-in.mjs} +2 -3
  174. package/dist/components/icon/icons/action/zoom-out.cjs +20 -0
  175. package/dist/components/icon/icons/action/{zoom-out.js → zoom-out.mjs} +2 -3
  176. package/dist/components/icon/icons/alert/add-alert.cjs +20 -0
  177. package/dist/components/icon/icons/alert/{add-alert.js → add-alert.mjs} +2 -3
  178. package/dist/components/icon/icons/alert/auto-delete.cjs +26 -0
  179. package/dist/components/icon/icons/alert/{auto-delete.js → auto-delete.mjs} +2 -3
  180. package/dist/components/icon/icons/alert/error-outline.cjs +20 -0
  181. package/dist/components/icon/icons/alert/{error-outline.js → error-outline.mjs} +2 -3
  182. package/dist/components/icon/icons/alert/error.cjs +20 -0
  183. package/dist/components/icon/icons/alert/{error.js → error.mjs} +2 -3
  184. package/dist/components/icon/icons/alert/index.cjs +17 -0
  185. package/dist/components/icon/icons/alert/index.mjs +7 -0
  186. package/dist/components/icon/icons/alert/notification-important.cjs +20 -0
  187. package/dist/components/icon/icons/alert/{notification-important.js → notification-important.mjs} +2 -3
  188. package/dist/components/icon/icons/alert/warning-amber.cjs +20 -0
  189. package/dist/components/icon/icons/alert/{warning-amber.js → warning-amber.mjs} +2 -3
  190. package/dist/components/icon/icons/alert/warning.cjs +20 -0
  191. package/dist/components/icon/icons/alert/{warning.js → warning.mjs} +2 -3
  192. package/dist/components/icon/icons/content/clear.cjs +20 -0
  193. package/dist/components/icon/icons/content/{clear.js → clear.mjs} +2 -3
  194. package/dist/components/icon/icons/content/font-download.cjs +20 -0
  195. package/dist/components/icon/icons/content/{font-download.js → font-download.mjs} +2 -3
  196. package/dist/components/icon/icons/content/index.cjs +13 -0
  197. package/dist/components/icon/icons/content/index.mjs +5 -0
  198. package/dist/components/icon/icons/content/link-off.cjs +20 -0
  199. package/dist/components/icon/icons/content/{link-off.js → link-off.mjs} +2 -3
  200. package/dist/components/icon/icons/content/redo.cjs +20 -0
  201. package/dist/components/icon/icons/content/{redo.js → redo.mjs} +2 -3
  202. package/dist/components/icon/icons/content/undo.cjs +20 -0
  203. package/dist/components/icon/icons/content/{undo.js → undo.mjs} +2 -3
  204. package/dist/components/icon/icons/editor/checklist.cjs +20 -0
  205. package/dist/components/icon/icons/editor/{checklist.js → checklist.mjs} +2 -3
  206. package/dist/components/icon/icons/editor/format-bold.cjs +20 -0
  207. package/dist/components/icon/icons/editor/{format-bold.js → format-bold.mjs} +2 -3
  208. package/dist/components/icon/icons/editor/format-italic.cjs +20 -0
  209. package/dist/components/icon/icons/editor/{format-italic.js → format-italic.mjs} +2 -3
  210. package/dist/components/icon/icons/editor/format-strikethrough.cjs +20 -0
  211. package/dist/components/icon/icons/editor/{format-strikethrough.js → format-strikethrough.mjs} +2 -3
  212. package/dist/components/icon/icons/editor/format-underlined.cjs +20 -0
  213. package/dist/components/icon/icons/editor/{format-underlined.js → format-underlined.mjs} +2 -3
  214. package/dist/components/icon/icons/editor/index.cjs +21 -0
  215. package/dist/components/icon/icons/editor/index.mjs +9 -0
  216. package/dist/components/icon/icons/editor/insert-link.cjs +20 -0
  217. package/dist/components/icon/icons/editor/{insert-link.js → insert-link.mjs} +2 -3
  218. package/dist/components/icon/icons/editor/notes.cjs +20 -0
  219. package/dist/components/icon/icons/editor/{notes.js → notes.mjs} +2 -3
  220. package/dist/components/icon/icons/editor/subscript.cjs +20 -0
  221. package/dist/components/icon/icons/editor/{subscript.js → subscript.mjs} +2 -3
  222. package/dist/components/icon/icons/editor/superscript.cjs +20 -0
  223. package/dist/components/icon/icons/editor/{superscript.js → superscript.mjs} +2 -3
  224. package/dist/components/icon/icons/hardware/index.cjs +15 -0
  225. package/dist/components/icon/icons/hardware/{index.js → index.mjs} +6 -6
  226. package/dist/components/icon/icons/hardware/keyboard-arrow-down.cjs +19 -0
  227. package/dist/components/icon/icons/hardware/{keyboard-arrow-down.js → keyboard-arrow-down.mjs} +2 -3
  228. package/dist/components/icon/icons/hardware/keyboard-arrow-left.cjs +20 -0
  229. package/dist/components/icon/icons/hardware/{keyboard-arrow-left.js → keyboard-arrow-left.mjs} +2 -3
  230. package/dist/components/icon/icons/hardware/keyboard-arrow-right.cjs +20 -0
  231. package/dist/components/icon/icons/hardware/{keyboard-arrow-right.js → keyboard-arrow-right.mjs} +2 -3
  232. package/dist/components/icon/icons/hardware/keyboard-arrow-up.cjs +20 -0
  233. package/dist/components/icon/icons/hardware/{keyboard-arrow-up.js → keyboard-arrow-up.mjs} +2 -3
  234. package/dist/components/icon/icons/hardware/keyboard-double-arrow-left.cjs +23 -0
  235. package/dist/components/icon/icons/hardware/{keyboard-double-arrow-left.js → keyboard-double-arrow-left.mjs} +2 -3
  236. package/dist/components/icon/icons/hardware/keyboard-double-arrow-right.cjs +23 -0
  237. package/dist/components/icon/icons/hardware/{keyboard-double-arrow-right.js → keyboard-double-arrow-right.mjs} +2 -3
  238. package/dist/components/icon/icons/image/bedtime.cjs +20 -0
  239. package/dist/components/icon/icons/image/{bedtime.js → bedtime.mjs} +2 -3
  240. package/dist/components/icon/icons/image/edit.cjs +20 -0
  241. package/dist/components/icon/icons/image/{edit.js → edit.mjs} +2 -3
  242. package/dist/components/icon/icons/image/index.cjs +25 -0
  243. package/dist/components/icon/icons/image/index.mjs +11 -0
  244. package/dist/components/icon/icons/image/looks-five.cjs +20 -0
  245. package/dist/components/icon/icons/image/{looks-five.js → looks-five.mjs} +2 -3
  246. package/dist/components/icon/icons/image/looks-four.cjs +20 -0
  247. package/dist/components/icon/icons/image/{looks-four.js → looks-four.mjs} +2 -3
  248. package/dist/components/icon/icons/image/looks-one.cjs +20 -0
  249. package/dist/components/icon/icons/image/{looks-one.js → looks-one.mjs} +2 -3
  250. package/dist/components/icon/icons/image/looks-six.cjs +20 -0
  251. package/dist/components/icon/icons/image/{looks-six.js → looks-six.mjs} +2 -3
  252. package/dist/components/icon/icons/image/looks-three.cjs +20 -0
  253. package/dist/components/icon/icons/image/{looks-three.js → looks-three.mjs} +2 -3
  254. package/dist/components/icon/icons/image/looks-two.cjs +20 -0
  255. package/dist/components/icon/icons/image/{looks-two.js → looks-two.mjs} +2 -3
  256. package/dist/components/icon/icons/image/rotate-left.cjs +20 -0
  257. package/dist/components/icon/icons/image/{rotate-left.js → rotate-left.mjs} +2 -3
  258. package/dist/components/icon/icons/image/rotate-right.cjs +20 -0
  259. package/dist/components/icon/icons/image/{rotate-right.js → rotate-right.mjs} +2 -3
  260. package/dist/components/icon/icons/image/wb-sunny.cjs +20 -0
  261. package/dist/components/icon/icons/image/{wb-sunny.js → wb-sunny.mjs} +2 -3
  262. package/dist/components/icon/icons/index.cjs +125 -0
  263. package/dist/components/icon/icons/index.mjs +61 -0
  264. package/dist/components/icon/icons/mock/github.cjs +21 -0
  265. package/dist/components/icon/icons/mock/{github.js → github.mjs} +2 -3
  266. package/dist/components/icon/icons/mock/index.cjs +7 -0
  267. package/dist/components/icon/icons/mock/index.mjs +2 -0
  268. package/dist/components/icon/icons/mock/loading.cjs +26 -0
  269. package/dist/components/icon/icons/mock/{loading.js → loading.mjs} +2 -3
  270. package/dist/components/icon/icons/navigation/cancel.cjs +20 -0
  271. package/dist/components/icon/icons/navigation/{cancel.js → cancel.mjs} +2 -3
  272. package/dist/components/icon/icons/navigation/check.cjs +20 -0
  273. package/dist/components/icon/icons/navigation/{check.js → check.mjs} +2 -3
  274. package/dist/components/icon/icons/navigation/close.cjs +20 -0
  275. package/dist/components/icon/icons/navigation/{close.js → close.mjs} +2 -3
  276. package/dist/components/icon/icons/navigation/index.cjs +13 -0
  277. package/dist/components/icon/icons/navigation/index.mjs +5 -0
  278. package/dist/components/icon/icons/navigation/more-horiz.cjs +20 -0
  279. package/dist/components/icon/icons/navigation/{more-horiz.js → more-horiz.mjs} +2 -3
  280. package/dist/components/icon/icons/navigation/unfold-more.cjs +20 -0
  281. package/dist/components/icon/icons/navigation/{unfold-more.js → unfold-more.mjs} +2 -3
  282. package/dist/components/icon/icons/toggle/index.cjs +9 -0
  283. package/dist/components/icon/icons/toggle/index.mjs +3 -0
  284. package/dist/components/icon/icons/toggle/star-half.cjs +20 -0
  285. package/dist/components/icon/icons/toggle/{star-half.js → star-half.mjs} +2 -3
  286. package/dist/components/icon/icons/toggle/star-outline.cjs +20 -0
  287. package/dist/components/icon/icons/toggle/{star-outline.js → star-outline.mjs} +2 -3
  288. package/dist/components/icon/icons/toggle/star.cjs +20 -0
  289. package/dist/components/icon/icons/toggle/{star.js → star.mjs} +2 -3
  290. package/dist/components/icon/types.d.ts +1 -1
  291. package/dist/components/image/hooks.cjs +65 -0
  292. package/dist/components/image/{hooks.js → hooks.mjs} +7 -7
  293. package/dist/components/image/image.cjs +47 -0
  294. package/dist/components/image/{image.js → image.mjs} +2 -2
  295. package/dist/components/image/index.cjs +8 -0
  296. package/dist/components/image/{index.js → index.mjs} +2 -2
  297. package/dist/components/image/preview/context.cjs +7 -0
  298. package/dist/components/image/preview/group.cjs +62 -0
  299. package/dist/components/image/preview/{group.js → group.mjs} +2 -2
  300. package/dist/components/image/preview/operations.cjs +148 -0
  301. package/dist/components/image/preview/{operations.js → operations.mjs} +10 -10
  302. package/dist/components/image/preview/preview.cjs +135 -0
  303. package/dist/components/image/preview/{preview.js → preview.mjs} +3 -3
  304. package/dist/components/image/types.d.ts +1 -1
  305. package/dist/components/input/hooks.cjs +69 -0
  306. package/dist/components/input/input.cjs +225 -0
  307. package/dist/components/input/{input.js → input.mjs} +11 -12
  308. package/dist/components/input/types.d.ts +1 -1
  309. package/dist/components/layout/footer.cjs +7 -0
  310. package/dist/components/layout/header.cjs +46 -0
  311. package/dist/components/layout/{header.js → header.mjs} +4 -4
  312. package/dist/components/layout/hooks.cjs +60 -0
  313. package/dist/components/layout/hooks.d.ts +1 -1
  314. package/dist/components/layout/{hooks.js → hooks.mjs} +4 -4
  315. package/dist/components/layout/index.cjs +13 -0
  316. package/dist/components/layout/index.mjs +13 -0
  317. package/dist/components/layout/layout.cjs +52 -0
  318. package/dist/components/layout/{layout.js → layout.mjs} +5 -5
  319. package/dist/components/layout/main.cjs +8 -0
  320. package/dist/components/layout/sider.cjs +18 -0
  321. package/dist/components/layout/{sider.js → sider.mjs} +1 -1
  322. package/dist/components/layout/types.d.ts +1 -1
  323. package/dist/components/loading/loading.cjs +159 -0
  324. package/dist/components/loading/loading.d.ts +1 -1
  325. package/dist/components/loading/{loading.js → loading.mjs} +39 -49
  326. package/dist/components/loading/types.d.ts +9 -2
  327. package/dist/components/menu/context.cjs +20 -0
  328. package/dist/components/menu/context.d.ts +1 -1
  329. package/dist/components/menu/group.cjs +190 -0
  330. package/dist/components/menu/group.d.ts +2 -2
  331. package/dist/components/menu/{group.js → group.mjs} +11 -11
  332. package/dist/components/menu/hooks.cjs +163 -0
  333. package/dist/components/menu/hooks.d.ts +2 -2
  334. package/dist/components/menu/{hooks.js → hooks.mjs} +4 -4
  335. package/dist/components/menu/index.d.ts +1 -2
  336. package/dist/components/menu/item.cjs +291 -0
  337. package/dist/components/menu/item.d.ts +3 -3
  338. package/dist/components/menu/{item.js → item.mjs} +17 -17
  339. package/dist/components/menu/menu.cjs +73 -0
  340. package/dist/components/menu/menu.d.ts +1 -1
  341. package/dist/components/menu/{menu.js → menu.mjs} +7 -8
  342. package/dist/components/message/hooks.cjs +47 -0
  343. package/dist/components/message/{hooks.js → hooks.mjs} +1 -1
  344. package/dist/components/message/messager.cjs +22 -0
  345. package/dist/components/message/{messager.js → messager.mjs} +2 -3
  346. package/dist/components/notification/holder.cjs +170 -0
  347. package/dist/components/notification/{holder.js → holder.mjs} +4 -4
  348. package/dist/components/notification/hooks.cjs +86 -0
  349. package/dist/components/notification/{hooks.js → hooks.mjs} +2 -2
  350. package/dist/components/notification/notification.cjs +279 -0
  351. package/dist/components/notification/{notification.js → notification.mjs} +14 -14
  352. package/dist/components/notification/notifier.cjs +73 -0
  353. package/dist/components/notification/{notifier.js → notifier.mjs} +2 -3
  354. package/dist/components/number-input/hooks.cjs +31 -0
  355. package/dist/components/number-input/number-input.cjs +40 -0
  356. package/dist/components/number-input/{number-input.js → number-input.mjs} +3 -4
  357. package/dist/components/otp-input/hooks.cjs +82 -0
  358. package/dist/components/otp-input/{hooks.js → hooks.mjs} +1 -1
  359. package/dist/components/otp-input/otp-input.cjs +89 -0
  360. package/dist/components/otp-input/{otp-input.js → otp-input.mjs} +3 -4
  361. package/dist/components/pagination/hooks.cjs +70 -0
  362. package/dist/components/pagination/{hooks.js → hooks.mjs} +1 -1
  363. package/dist/components/pagination/item.cjs +74 -0
  364. package/dist/components/pagination/{item.js → item.mjs} +7 -7
  365. package/dist/components/pagination/pagination.cjs +90 -0
  366. package/dist/components/pagination/{pagination.js → pagination.mjs} +8 -9
  367. package/dist/components/pagination/types.cjs +11 -0
  368. package/dist/components/picker/context.cjs +9 -0
  369. package/dist/components/picker/picker.cjs +121 -0
  370. package/dist/components/picker/{picker.js → picker.mjs} +12 -12
  371. package/dist/components/picker/types.d.ts +1 -1
  372. package/dist/components/popconfirm/popconfirm.cjs +148 -0
  373. package/dist/components/popconfirm/{popconfirm.js → popconfirm.mjs} +13 -14
  374. package/dist/components/popconfirm/types.d.ts +1 -1
  375. package/dist/components/popover/hooks.cjs +64 -0
  376. package/dist/components/popover/{hooks.js → hooks.mjs} +1 -1
  377. package/dist/components/popover/popover.cjs +154 -0
  378. package/dist/components/popover/{popover.js → popover.mjs} +9 -10
  379. package/dist/components/popover/types.d.ts +1 -1
  380. package/dist/components/popper/dropdown.cjs +135 -0
  381. package/dist/components/popper/{dropdown.js → dropdown.mjs} +11 -11
  382. package/dist/components/popper/hooks.cjs +187 -0
  383. package/dist/components/popper/{hooks.js → hooks.mjs} +1 -1
  384. package/dist/components/popper/popper.cjs +26 -0
  385. package/dist/components/popper/{popper.js → popper.mjs} +2 -2
  386. package/dist/components/popper/types.d.ts +1 -1
  387. package/dist/components/portal/portal.cjs +39 -0
  388. package/dist/components/portal/{portal.js → portal.mjs} +1 -1
  389. package/dist/components/progress/circular.cjs +86 -0
  390. package/dist/components/progress/{circular.js → circular.mjs} +5 -5
  391. package/dist/components/progress/hooks.cjs +48 -0
  392. package/dist/components/progress/linear.cjs +85 -0
  393. package/dist/components/progress/{linear.js → linear.mjs} +7 -7
  394. package/dist/components/progress/progress.cjs +22 -0
  395. package/dist/components/progress/{progress.js → progress.mjs} +3 -4
  396. package/dist/components/progress/types.d.ts +1 -1
  397. package/dist/components/quote/quote.cjs +30 -0
  398. package/dist/components/quote/{quote.js → quote.mjs} +9 -10
  399. package/dist/components/quote/styles.cjs +31 -0
  400. package/dist/components/quote/types.d.ts +1 -1
  401. package/dist/components/radio/context.cjs +7 -0
  402. package/dist/components/radio/group.cjs +37 -0
  403. package/dist/components/radio/{group.js → group.mjs} +1 -1
  404. package/dist/components/radio/index.cjs +8 -0
  405. package/dist/components/radio/{index.js → index.mjs} +2 -2
  406. package/dist/components/radio/radio.cjs +241 -0
  407. package/dist/components/radio/{radio.js → radio.mjs} +13 -13
  408. package/dist/components/radio/types.d.ts +1 -1
  409. package/dist/components/rate/hooks.cjs +59 -0
  410. package/dist/components/rate/rate.cjs +66 -0
  411. package/dist/components/rate/{rate.js → rate.mjs} +7 -8
  412. package/dist/components/rate/star.cjs +147 -0
  413. package/dist/components/rate/{star.js → star.mjs} +9 -9
  414. package/dist/components/rate/types.d.ts +1 -1
  415. package/dist/components/rich-text-editor/dropdown.cjs +80 -0
  416. package/dist/components/rich-text-editor/{dropdown.js → dropdown.mjs} +4 -4
  417. package/dist/components/rich-text-editor/index.cjs +12 -0
  418. package/dist/components/rich-text-editor/{index.js → index.mjs} +1 -1
  419. package/dist/components/rich-text-editor/nodes/checkable-list-item.cjs +89 -0
  420. package/dist/components/rich-text-editor/plugins/check-list/index.cjs +49 -0
  421. package/dist/components/rich-text-editor/plugins/controlled-state/index.cjs +45 -0
  422. package/dist/components/rich-text-editor/plugins/controlled-state/{index.js → index.mjs} +1 -1
  423. package/dist/components/rich-text-editor/plugins/floating-link-editor/index.cjs +123 -0
  424. package/dist/components/rich-text-editor/plugins/floating-link-editor/{index.js → index.mjs} +10 -10
  425. package/dist/components/rich-text-editor/plugins/markdown-shortcut/index.cjs +16 -0
  426. package/dist/components/rich-text-editor/plugins/markdown-shortcut/{index.js → index.mjs} +3 -4
  427. package/dist/components/rich-text-editor/plugins/toolbar/hooks.cjs +265 -0
  428. package/dist/components/rich-text-editor/plugins/toolbar/hooks.d.ts +3 -3
  429. package/dist/components/rich-text-editor/plugins/toolbar/{hooks.js → hooks.mjs} +11 -11
  430. package/dist/components/rich-text-editor/plugins/toolbar/index.cjs +218 -0
  431. package/dist/components/rich-text-editor/plugins/toolbar/{index.js → index.mjs} +17 -17
  432. package/dist/components/rich-text-editor/rich-text-editor.cjs +209 -0
  433. package/dist/components/rich-text-editor/rich-text-editor.d.ts +1 -1
  434. package/dist/components/rich-text-editor/{rich-text-editor.js → rich-text-editor.mjs} +16 -20
  435. package/dist/components/rich-text-editor/types.d.ts +1 -6
  436. package/dist/components/rich-text-editor/utils/get-element-by-node.cjs +8 -0
  437. package/dist/components/ripple/hooks.cjs +53 -0
  438. package/dist/components/ripple/ripple.cjs +93 -0
  439. package/dist/components/ripple/{ripple.js → ripple.mjs} +2 -2
  440. package/dist/components/select/hooks.cjs +145 -0
  441. package/dist/components/select/hooks.d.ts +2 -2
  442. package/dist/components/select/{hooks.js → hooks.mjs} +1 -1
  443. package/dist/components/select/select.cjs +91 -0
  444. package/dist/components/select/{select.js → select.mjs} +8 -9
  445. package/dist/components/select/selections.cjs +41 -0
  446. package/dist/components/select/{selections.js → selections.mjs} +3 -3
  447. package/dist/components/select/selector.cjs +82 -0
  448. package/dist/components/select/{selector.js → selector.mjs} +7 -7
  449. package/dist/components/select/types.d.ts +3 -3
  450. package/dist/components/select/utils.cjs +67 -0
  451. package/dist/components/select/utils.d.ts +2 -2
  452. package/dist/components/skeleton/skeleton.cjs +101 -0
  453. package/dist/components/skeleton/{skeleton.js → skeleton.mjs} +5 -6
  454. package/dist/components/skeleton/types.d.ts +1 -1
  455. package/dist/components/space/space.cjs +61 -0
  456. package/dist/components/space/{space.js → space.mjs} +4 -5
  457. package/dist/components/space/types.d.ts +1 -1
  458. package/dist/components/steps/context.cjs +9 -0
  459. package/dist/components/steps/item.cjs +237 -0
  460. package/dist/components/steps/{item.js → item.mjs} +10 -10
  461. package/dist/components/steps/steps.cjs +78 -0
  462. package/dist/components/steps/{steps.js → steps.mjs} +7 -8
  463. package/dist/components/steps/types.d.ts +1 -1
  464. package/dist/components/switch/switch.cjs +311 -0
  465. package/dist/components/switch/{switch.js → switch.mjs} +15 -16
  466. package/dist/components/switch/types.d.ts +1 -1
  467. package/dist/components/table/body.cjs +92 -0
  468. package/dist/components/table/{body.js → body.mjs} +7 -7
  469. package/dist/components/table/context.cjs +18 -0
  470. package/dist/components/table/context.d.ts +1 -1
  471. package/dist/components/table/header/cell.cjs +135 -0
  472. package/dist/components/table/header/cell.d.ts +2 -2
  473. package/dist/components/table/header/{cell.js → cell.mjs} +5 -5
  474. package/dist/components/table/header/header.cjs +109 -0
  475. package/dist/components/table/header/header.d.ts +1 -1
  476. package/dist/components/table/header/{header.js → header.mjs} +8 -8
  477. package/dist/components/table/hooks.cjs +74 -0
  478. package/dist/components/table/hooks.d.ts +1 -1
  479. package/dist/components/table/{hooks.js → hooks.mjs} +1 -1
  480. package/dist/components/table/index.d.ts +0 -2
  481. package/dist/components/table/table.cjs +41 -0
  482. package/dist/components/table/table.d.ts +1 -1
  483. package/dist/components/table/{table.js → table.mjs} +5 -6
  484. package/dist/components/tabs/context.cjs +7 -0
  485. package/dist/components/tabs/hooks.cjs +134 -0
  486. package/dist/components/tabs/{hooks.js → hooks.mjs} +1 -1
  487. package/dist/components/tabs/navigation.cjs +168 -0
  488. package/dist/components/tabs/{navigation.js → navigation.mjs} +8 -8
  489. package/dist/components/tabs/panels.cjs +88 -0
  490. package/dist/components/tabs/{panels.js → panels.mjs} +5 -5
  491. package/dist/components/tabs/tab.cjs +35 -0
  492. package/dist/components/tabs/{tab.js → tab.mjs} +5 -5
  493. package/dist/components/tabs/tabs.cjs +56 -0
  494. package/dist/components/tabs/{tabs.js → tabs.mjs} +8 -9
  495. package/dist/components/tabs/types.d.ts +1 -1
  496. package/dist/components/tag/tag.cjs +123 -0
  497. package/dist/components/tag/{tag.js → tag.mjs} +10 -11
  498. package/dist/components/tag/types.d.ts +1 -1
  499. package/dist/components/theme/hooks.cjs +218 -0
  500. package/dist/components/theme/{hooks.js → hooks.mjs} +2 -2
  501. package/dist/components/theme/theme-provider.cjs +36 -0
  502. package/dist/components/theme/{theme-provider.js → theme-provider.mjs} +2 -3
  503. package/dist/components/theme/theme.cjs +145 -0
  504. package/dist/components/theme/tokens.stylex.cjs +64 -0
  505. package/dist/components/time-picker/hooks.cjs +31 -0
  506. package/dist/components/time-picker/panel.cjs +105 -0
  507. package/dist/components/time-picker/{panel.js → panel.mjs} +15 -15
  508. package/dist/components/time-picker/time-picker.cjs +64 -0
  509. package/dist/components/time-picker/{time-picker.js → time-picker.mjs} +12 -13
  510. package/dist/components/time-picker/types.d.ts +1 -1
  511. package/dist/components/timeline/context.cjs +8 -0
  512. package/dist/components/timeline/item.cjs +220 -0
  513. package/dist/components/timeline/{item.js → item.mjs} +8 -8
  514. package/dist/components/timeline/timeline.cjs +44 -0
  515. package/dist/components/timeline/{timeline.js → timeline.mjs} +6 -7
  516. package/dist/components/tooltip/tooltip.cjs +24 -0
  517. package/dist/components/tooltip/{tooltip.js → tooltip.mjs} +5 -6
  518. package/dist/components/tooltip/types.d.ts +1 -1
  519. package/dist/components/tour/hooks.cjs +47 -0
  520. package/dist/components/tour/hooks.d.ts +1 -1
  521. package/dist/components/tour/index.d.ts +0 -2
  522. package/dist/components/tour/spotlight.cjs +65 -0
  523. package/dist/components/tour/spotlight.d.ts +1 -1
  524. package/dist/components/tour/{spotlight.js → spotlight.mjs} +3 -3
  525. package/dist/components/tour/tour.cjs +171 -0
  526. package/dist/components/tour/tour.d.ts +1 -1
  527. package/dist/components/tour/{tour.js → tour.mjs} +16 -17
  528. package/dist/components/transfer/context.cjs +11 -0
  529. package/dist/components/transfer/hooks.cjs +72 -0
  530. package/dist/components/transfer/item.cjs +27 -0
  531. package/dist/components/transfer/{item.js → item.mjs} +4 -4
  532. package/dist/components/transfer/list.cjs +132 -0
  533. package/dist/components/transfer/{list.js → list.mjs} +11 -11
  534. package/dist/components/transfer/transfer.cjs +82 -0
  535. package/dist/components/transfer/{transfer.js → transfer.mjs} +10 -11
  536. package/dist/components/transfer/types.d.ts +2 -2
  537. package/dist/components/tree/context.cjs +12 -0
  538. package/dist/components/tree/context.d.ts +1 -1
  539. package/dist/components/tree/hooks.cjs +67 -0
  540. package/dist/components/tree/hooks.d.ts +1 -1
  541. package/dist/components/tree/index.d.ts +1 -2
  542. package/dist/components/tree/list.cjs +97 -0
  543. package/dist/components/tree/list.d.ts +1 -1
  544. package/dist/components/tree/{list.js → list.mjs} +8 -8
  545. package/dist/components/tree/node.cjs +153 -0
  546. package/dist/components/tree/node.d.ts +1 -1
  547. package/dist/components/tree/{node.js → node.mjs} +14 -14
  548. package/dist/components/tree/tree.cjs +68 -0
  549. package/dist/components/tree/tree.d.ts +1 -1
  550. package/dist/components/tree/{tree.js → tree.mjs} +4 -5
  551. package/dist/components/upload/upload.cjs +80 -0
  552. package/dist/components/upload/{upload.js → upload.mjs} +3 -4
  553. package/dist/components/upload/uploadeds.cjs +116 -0
  554. package/dist/components/upload/{uploadeds.js → uploadeds.mjs} +3 -3
  555. package/dist/components/visually-hidden/visually-hidden.cjs +21 -0
  556. package/dist/components/visually-hidden/{visually-hidden.js → visually-hidden.mjs} +4 -5
  557. package/dist/components/waterfall/hooks.cjs +60 -0
  558. package/dist/components/waterfall/sequential.cjs +73 -0
  559. package/dist/components/waterfall/{sequential.js → sequential.mjs} +2 -2
  560. package/dist/components/waterfall/types.d.ts +1 -1
  561. package/dist/components/waterfall/waterfall.cjs +152 -0
  562. package/dist/components/waterfall/{waterfall.js → waterfall.mjs} +10 -11
  563. package/dist/components/watermark/hooks.cjs +154 -0
  564. package/dist/components/watermark/watermark.cjs +86 -0
  565. package/dist/components/watermark/{watermark.js → watermark.mjs} +2 -3
  566. package/dist/hooks/use-class-names.cjs +12 -0
  567. package/dist/hooks/use-class-names.d.ts +1 -0
  568. package/dist/hooks/{use-class-names.js → use-class-names.mjs} +1 -1
  569. package/dist/hooks/use-closable.cjs +61 -0
  570. package/dist/hooks/use-closable.d.ts +1 -1
  571. package/dist/hooks/{use-closable.js → use-closable.mjs} +3 -3
  572. package/dist/hooks/use-container.cjs +28 -0
  573. package/dist/hooks/use-expandable.cjs +74 -0
  574. package/dist/hooks/use-gutters.cjs +13 -0
  575. package/dist/hooks/use-lazy-boolean.cjs +64 -0
  576. package/dist/index.cjs +130 -0
  577. package/dist/index.d.ts +2 -13
  578. package/dist/index.mjs +64 -0
  579. package/dist/locale/context.cjs +6 -0
  580. package/dist/locale/context.d.ts +1 -1
  581. package/dist/locale/context.mjs +6 -0
  582. package/dist/locale/index.d.ts +1 -2
  583. package/dist/locale/locales/en_US.cjs +34 -0
  584. package/dist/locale/locales/en_US.d.ts +1 -1
  585. package/dist/locale/locales/{en_US.js → en_US.mjs} +3 -5
  586. package/dist/locale/locales/index.cjs +7 -0
  587. package/dist/locale/locales/index.mjs +2 -0
  588. package/dist/locale/locales/zh_CN.cjs +34 -0
  589. package/dist/locale/locales/zh_CN.d.ts +1 -1
  590. package/dist/locale/locales/{zh_CN.js → zh_CN.mjs} +3 -5
  591. package/dist/locale/use-locale.cjs +12 -0
  592. package/dist/locale/use-locale.d.ts +1 -1
  593. package/dist/locale/{use-locale.js → use-locale.mjs} +1 -1
  594. package/dist/node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.cjs +306 -0
  595. package/dist/styles.css +2 -6
  596. package/dist/{components/bench/types.d.ts → types/bench.d.ts} +5 -5
  597. package/dist/{components/form/types.d.ts → types/form.d.ts} +7 -2
  598. package/dist/{locale/types.d.ts → types/locale.d.ts} +1 -4
  599. package/dist/{components/menu/types.d.ts → types/menu.d.ts} +2 -2
  600. package/dist/{components/table/types.d.ts → types/table.d.ts} +1 -1
  601. package/dist/{components/tour/types.d.ts → types/tour.d.ts} +1 -1
  602. package/dist/{components/tree/types.d.ts → types/tree.d.ts} +1 -1
  603. package/dist/utils/class-name.cjs +357 -0
  604. package/dist/utils/class-name.d.ts +4 -1
  605. package/dist/utils/{class-name.js → class-name.mjs} +4 -3
  606. package/dist/utils/colors.cjs +72 -0
  607. package/dist/utils/component-token.cjs +54 -0
  608. package/dist/utils/keyboard.cjs +12 -0
  609. package/dist/utils/layer.cjs +23 -0
  610. package/dist/utils/styles.cjs +15 -0
  611. package/dist/utils/timespan.cjs +52 -0
  612. package/package.json +28 -47
  613. package/dist/components/form/field/field.js +0 -88
  614. package/dist/components/form/field/layout.js +0 -65
  615. package/dist/components/form/index.js +0 -10
  616. package/dist/components/icon/icons/action/index.js +0 -13
  617. package/dist/components/icon/icons/alert/index.js +0 -7
  618. package/dist/components/icon/icons/content/index.js +0 -5
  619. package/dist/components/icon/icons/editor/index.js +0 -9
  620. package/dist/components/icon/icons/image/index.js +0 -11
  621. package/dist/components/icon/icons/index.js +0 -61
  622. package/dist/components/icon/icons/mock/index.js +0 -2
  623. package/dist/components/icon/icons/navigation/index.js +0 -5
  624. package/dist/components/icon/icons/toggle/index.js +0 -3
  625. package/dist/components/layout/index.js +0 -13
  626. package/dist/index.js +0 -64
  627. package/dist/locale/context.js +0 -6
  628. package/dist/locale/locales/index.js +0 -2
  629. package/dist/locale/types.js +0 -7
  630. /package/dist/components/avatar/{context.js → context.mjs} +0 -0
  631. /package/dist/components/cascader/{utils.js → utils.mjs} +0 -0
  632. /package/dist/components/checkbox/{context.js → context.mjs} +0 -0
  633. /package/dist/components/clock/{types.js → types.mjs} +0 -0
  634. /package/dist/components/collapse/{context.js → context.mjs} +0 -0
  635. /package/dist/components/collapse/{hooks.js → hooks.mjs} +0 -0
  636. /package/dist/components/date-picker/{hooks.js → hooks.mjs} +0 -0
  637. /package/dist/components/date-range-picker/{hooks.js → hooks.mjs} +0 -0
  638. /package/dist/components/divider/{hooks.js → hooks.mjs} +0 -0
  639. /package/dist/components/drawer/{hooks.js → hooks.mjs} +0 -0
  640. /package/dist/components/form/{hooks.js → hooks.mjs} +0 -0
  641. /package/dist/components/image/preview/{context.js → context.mjs} +0 -0
  642. /package/dist/components/input/{hooks.js → hooks.mjs} +0 -0
  643. /package/dist/components/layout/{footer.js → footer.mjs} +0 -0
  644. /package/dist/components/layout/{main.js → main.mjs} +0 -0
  645. /package/dist/components/menu/{context.js → context.mjs} +0 -0
  646. /package/dist/components/number-input/{hooks.js → hooks.mjs} +0 -0
  647. /package/dist/components/pagination/{types.js → types.mjs} +0 -0
  648. /package/dist/components/picker/{context.js → context.mjs} +0 -0
  649. /package/dist/components/progress/{hooks.js → hooks.mjs} +0 -0
  650. /package/dist/components/quote/{styles.js → styles.mjs} +0 -0
  651. /package/dist/components/radio/{context.js → context.mjs} +0 -0
  652. /package/dist/components/rate/{hooks.js → hooks.mjs} +0 -0
  653. /package/dist/components/rich-text-editor/nodes/{checkable-list-item.js → checkable-list-item.mjs} +0 -0
  654. /package/dist/components/rich-text-editor/plugins/check-list/{index.js → index.mjs} +0 -0
  655. /package/dist/components/rich-text-editor/utils/{get-element-by-node.js → get-element-by-node.mjs} +0 -0
  656. /package/dist/components/ripple/{hooks.js → hooks.mjs} +0 -0
  657. /package/dist/components/select/{utils.js → utils.mjs} +0 -0
  658. /package/dist/components/steps/{context.js → context.mjs} +0 -0
  659. /package/dist/components/table/{context.js → context.mjs} +0 -0
  660. /package/dist/components/tabs/{context.js → context.mjs} +0 -0
  661. /package/dist/components/theme/{theme.js → theme.mjs} +0 -0
  662. /package/dist/components/theme/{tokens.stylex.js → tokens.stylex.mjs} +0 -0
  663. /package/dist/components/time-picker/{hooks.js → hooks.mjs} +0 -0
  664. /package/dist/components/timeline/{context.js → context.mjs} +0 -0
  665. /package/dist/components/tour/{hooks.js → hooks.mjs} +0 -0
  666. /package/dist/components/transfer/{context.js → context.mjs} +0 -0
  667. /package/dist/components/transfer/{hooks.js → hooks.mjs} +0 -0
  668. /package/dist/components/tree/{context.js → context.mjs} +0 -0
  669. /package/dist/components/tree/{hooks.js → hooks.mjs} +0 -0
  670. /package/dist/components/waterfall/{hooks.js → hooks.mjs} +0 -0
  671. /package/dist/components/watermark/{hooks.js → hooks.mjs} +0 -0
  672. /package/dist/hooks/{use-container.js → use-container.mjs} +0 -0
  673. /package/dist/hooks/{use-expandable.js → use-expandable.mjs} +0 -0
  674. /package/dist/hooks/{use-gutters.js → use-gutters.mjs} +0 -0
  675. /package/dist/hooks/{use-lazy-boolean.js → use-lazy-boolean.mjs} +0 -0
  676. /package/dist/node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/{stylex.js → stylex.mjs} +0 -0
  677. /package/dist/utils/{colors.js → colors.mjs} +0 -0
  678. /package/dist/utils/{component-token.js → component-token.mjs} +0 -0
  679. /package/dist/utils/{keyboard.js → keyboard.mjs} +0 -0
  680. /package/dist/utils/{layer.js → layer.mjs} +0 -0
  681. /package/dist/utils/{styles.js → styles.mjs} +0 -0
  682. /package/dist/utils/{timespan.js → timespan.mjs} +0 -0
@@ -0,0 +1,279 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ var _regeneratorRuntime = require('@babel/runtime/helpers/regeneratorRuntime');
4
+ var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
5
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
6
+ var stylex = require('../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.cjs');
7
+ var React = require('react');
8
+ var framerMotion = require('framer-motion');
9
+ var hooks = require('../theme/hooks.cjs');
10
+ var colors = require('../../utils/colors.cjs');
11
+ var relax = require('@aiszlab/relax');
12
+ var useClassNames = require('../../hooks/use-class-names.cjs');
13
+ var className = require('../../utils/class-name.cjs');
14
+ var button = require('../button/button.cjs');
15
+ var theme = require('../theme/theme.cjs');
16
+ var componentToken = require('../../utils/component-token.cjs');
17
+ var close = require('../icon/icons/navigation/close.cjs');
18
+ var checkCircle = require('../icon/icons/action/check-circle.cjs');
19
+ var error = require('../icon/icons/alert/error.cjs');
20
+ var notificationImportant = require('../icon/icons/alert/notification-important.cjs');
21
+ var warning = require('../icon/icons/alert/warning.cjs');
22
+ var loading = require('../icon/icons/mock/loading.cjs');
23
+
24
+ var AXIS = {
25
+ top: "top",
26
+ "top-left": "left",
27
+ "top-right": "right",
28
+ bottom: "bottom",
29
+ "bottom-left": "left",
30
+ "bottom-right": "right"
31
+ };
32
+ var PLACEMENTS = {
33
+ right: ["translateX(100%)", "translateX(0)"],
34
+ left: ["translateX(-100%)", "translateX(0)"],
35
+ bottom: ["translateY(100%)", "translateY(0)"],
36
+ top: ["translateY(-100%)", "translateY(0)"]
37
+ };
38
+ var LEADINGS = new Map([["success", checkCircle.default], ["error", error.default], ["loading", loading.default], ["info", notificationImportant.default], ["warning", warning.default]]);
39
+ var styles = {
40
+ notification: {
41
+ "default": function _default(props) {
42
+ return [{
43
+ backgroundColor: "musaex-q1mx2j",
44
+ color: "musaex-19dipnz",
45
+ borderRadius: "musaex-ok3b7d",
46
+ borderStartStartRadius: null,
47
+ borderStartEndRadius: null,
48
+ borderEndStartRadius: null,
49
+ borderEndEndRadius: null,
50
+ borderTopLeftRadius: null,
51
+ borderTopRightRadius: null,
52
+ borderBottomLeftRadius: null,
53
+ borderBottomRightRadius: null,
54
+ boxShadow: "musaex-sgc7hx",
55
+ maxWidth: "musaex-77asx0",
56
+ pointerEvents: "musaex-71s49j",
57
+ overflow: "musaex-b3r6kr",
58
+ overflowX: null,
59
+ overflowY: null,
60
+ transitionProperty: "musaex-1c9o64o",
61
+ transitionDuration: "musaex-13dflua",
62
+ transform: "musaex-1v0jg1i",
63
+ opacity: "musaex-g01cxk",
64
+ marginTop: "musaex-gqr9ew",
65
+ display: "musaex-rvj5dj",
66
+ gap: "musaex-1lsrmdg",
67
+ rowGap: null,
68
+ columnGap: null,
69
+ grid: "musaex-tdrehe",
70
+ gridTemplate: null,
71
+ gridTemplateAreas: null,
72
+ gridTemplateColumns: null,
73
+ gridTemplateRows: null,
74
+ gridAutoRows: null,
75
+ gridAutoColumns: null,
76
+ gridAutoFlow: null,
77
+ paddingBlock: "musaex-4g05pm",
78
+ paddingTop: null,
79
+ paddingBottom: null,
80
+ paddingInline: "musaex-y0sash",
81
+ paddingStart: null,
82
+ paddingLeft: null,
83
+ paddingEnd: null,
84
+ paddingRight: null,
85
+ $$css: true
86
+ }, {
87
+ "--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial",
88
+ "--color": props.color != null ? props.color : "initial",
89
+ "--transform": props.transform != null ? props.transform : "initial"
90
+ }];
91
+ },
92
+ simple: {
93
+ grid: "musaex-1t1eshv",
94
+ gridTemplate: null,
95
+ gridTemplateAreas: null,
96
+ gridTemplateColumns: null,
97
+ gridTemplateRows: null,
98
+ gridAutoRows: null,
99
+ gridAutoColumns: null,
100
+ gridAutoFlow: null,
101
+ paddingBlock: "musaex-15v7278",
102
+ paddingTop: null,
103
+ paddingBottom: null,
104
+ paddingInline: "musaex-1dhq86w",
105
+ paddingStart: null,
106
+ paddingLeft: null,
107
+ paddingEnd: null,
108
+ paddingRight: null,
109
+ $$css: true
110
+ }
111
+ },
112
+ leading: {
113
+ "default": function _default(props) {
114
+ return [{
115
+ gridArea: "musaex-1kxrqrs",
116
+ gridRow: null,
117
+ gridRowStart: null,
118
+ gridRowEnd: null,
119
+ gridColumn: null,
120
+ gridColumnStart: null,
121
+ gridColumnEnd: null,
122
+ alignSelf: "musaex-amitd3",
123
+ display: "musaex-3nfvp2",
124
+ color: "musaex-19dipnz",
125
+ $$css: true
126
+ }, {
127
+ "--color": props.color != null ? props.color : "initial"
128
+ }];
129
+ }
130
+ },
131
+ title: {
132
+ "default": {
133
+ gridArea: "musaex-nyuz70",
134
+ gridRow: null,
135
+ gridRowStart: null,
136
+ gridRowEnd: null,
137
+ gridColumn: null,
138
+ gridColumnStart: null,
139
+ gridColumnEnd: null,
140
+ $$css: true
141
+ }
142
+ },
143
+ description: {
144
+ "default": {
145
+ gridArea: "musaex-19tbii3",
146
+ gridRow: null,
147
+ gridRowStart: null,
148
+ gridRowEnd: null,
149
+ gridColumn: null,
150
+ gridColumnStart: null,
151
+ gridColumnEnd: null,
152
+ display: "musaex-1rg5ohu",
153
+ wordBreak: "musaex-13faqbe",
154
+ $$css: true
155
+ },
156
+ simple: {
157
+ alignSelf: "musaex-amitd3",
158
+ $$css: true
159
+ }
160
+ },
161
+ closer: {
162
+ "default": {
163
+ gridArea: "musaex-1n8w83i",
164
+ gridRow: null,
165
+ gridRowStart: null,
166
+ gridRowEnd: null,
167
+ gridColumn: null,
168
+ gridColumnStart: null,
169
+ gridColumnEnd: null,
170
+ justifySelf: "musaex-15bdqvn",
171
+ $$css: true
172
+ }
173
+ }
174
+ };
175
+ var Notification = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
176
+ var placement = _ref.placement,
177
+ _ref$duration = _ref.duration,
178
+ duration = _ref$duration === void 0 ? 3000 : _ref$duration,
179
+ onClose = _ref.onClose,
180
+ description = _ref.description,
181
+ title = _ref.title,
182
+ type = _ref.type,
183
+ _ref$closable = _ref.closable,
184
+ closable = _ref$closable === void 0 ? true : _ref$closable;
185
+ var theme$1 = hooks.useTheme();
186
+ var _usePresence = framerMotion.usePresence(),
187
+ _usePresence2 = _slicedToArray(_usePresence, 2),
188
+ isPresent = _usePresence2[0],
189
+ safeToRemove = _usePresence2[1];
190
+ var axis = AXIS[placement];
191
+ var _useAnimate = framerMotion.useAnimate(),
192
+ _useAnimate2 = _slicedToArray(_useAnimate, 2),
193
+ scope = _useAnimate2[0],
194
+ animate = _useAnimate2[1];
195
+ var _placement = PLACEMENTS[axis];
196
+ var classNames = useClassNames.useClassNames(componentToken.ComponentToken.Notification);
197
+ var notificationRef = relax.useRefs(scope, ref);
198
+ // after duration, `Notification` will auto destroy
199
+ relax.useTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
200
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
201
+ while (1) switch (_context.prev = _context.next) {
202
+ case 0:
203
+ _context.t0 = placement;
204
+ _context.next = _context.t0 === "bottom" ? 3 : _context.t0 === "bottom-left" ? 3 : _context.t0 === "bottom-right" ? 3 : 6;
205
+ break;
206
+ case 3:
207
+ _context.next = 5;
208
+ return animate(scope.current, {
209
+ opacity: 0,
210
+ marginBlockEnd: scope.current.getBoundingClientRect().height * -1
211
+ });
212
+ case 5:
213
+ return _context.abrupt("break", 9);
214
+ case 6:
215
+ _context.next = 8;
216
+ return animate(scope.current, {
217
+ opacity: 0,
218
+ marginBlockStart: scope.current.getBoundingClientRect().height * -1
219
+ });
220
+ case 8:
221
+ return _context.abrupt("break", 9);
222
+ case 9:
223
+ onClose === null || onClose === void 0 || onClose();
224
+ case 10:
225
+ case "end":
226
+ return _context.stop();
227
+ }
228
+ }, _callee);
229
+ })), duration);
230
+ var styled = {
231
+ notification: stylex.default.props(styles.notification["default"]({
232
+ backgroundColor: theme$1.colors[colors.ColorToken.SurfaceContainerLowest],
233
+ color: theme$1.colors[colors.ColorToken.OnSurface],
234
+ transform: _placement[0]
235
+ }), !title && styles.notification.simple),
236
+ leading: stylex.default.props(styles.leading["default"]({
237
+ color: type === "success" ? theme$1.colors[colors.ColorToken.Success] : type === "warning" ? theme$1.colors[colors.ColorToken.Warning] : type === "error" ? theme$1.colors[colors.ColorToken.Error] : theme$1.colors[colors.ColorToken.Primary]
238
+ })),
239
+ title: stylex.default.props(theme.typography.title.medium, styles.title["default"]),
240
+ description: stylex.default.props(theme.typography.body.medium, styles.description["default"], !title && styles.description.simple),
241
+ closer: stylex.default.props(styles.closer["default"])
242
+ };
243
+ React.useEffect(function () {
244
+ if (!isPresent) {
245
+ safeToRemove();
246
+ return;
247
+ }
248
+ // appear animation
249
+ animate(scope.current, {
250
+ opacity: 1,
251
+ transform: _placement[1]
252
+ });
253
+ // eslint-disable-next-line react-hooks/exhaustive-deps
254
+ }, [isPresent]);
255
+ return /*#__PURE__*/React.createElement("div", {
256
+ className: relax.clsx(classNames[className.NotificationClassToken.Notification], styled.notification.className),
257
+ style: styled.notification.style,
258
+ ref: notificationRef
259
+ }, LEADINGS.has(type) && (/*#__PURE__*/React.createElement("div", {
260
+ className: styled.leading.className,
261
+ style: styled.leading.style
262
+ }, /*#__PURE__*/React.createElement(LEADINGS.get(type)))), !!title && (/*#__PURE__*/React.createElement("div", {
263
+ className: relax.clsx(classNames[className.NotificationClassToken.Title], styled.title.className),
264
+ style: styled.title.style
265
+ }, title)), /*#__PURE__*/React.createElement("div", {
266
+ className: relax.clsx(classNames[className.NotificationClassToken.Description], styled.description.className),
267
+ style: styled.description.style
268
+ }, description), closable && (/*#__PURE__*/React.createElement(button.Button, {
269
+ className: relax.clsx(classNames[className.NotificationClassToken.Closer], styled.closer.className),
270
+ shape: "circular",
271
+ variant: "text",
272
+ prefix: /*#__PURE__*/React.createElement(close.default, null),
273
+ onClick: onClose,
274
+ size: "small"
275
+ })));
276
+ });
277
+
278
+ exports.PLACEMENTS = PLACEMENTS;
279
+ exports.default = Notification;
@@ -1,23 +1,23 @@
1
1
  import _regeneratorRuntime from '@babel/runtime/helpers/regeneratorRuntime';
2
2
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
3
3
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
- import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.mjs';
5
5
  import React, { forwardRef, useEffect, createElement } from 'react';
6
6
  import { usePresence, useAnimate } from 'framer-motion';
7
- import { useTheme } from '../theme/hooks.js';
8
- import { ColorToken } from '../../utils/colors.js';
7
+ import { useTheme } from '../theme/hooks.mjs';
8
+ import { ColorToken } from '../../utils/colors.mjs';
9
9
  import { useRefs, useTimeout, clsx } from '@aiszlab/relax';
10
- import { useClassNames } from '../../hooks/use-class-names.js';
11
- import { NotificationClassToken } from '../../utils/class-name.js';
12
- import Button from '../button/button.js';
13
- import { typography } from '../theme/theme.js';
14
- import { ComponentToken } from '../../utils/component-token.js';
15
- import CheckCircle from '../icon/icons/action/check-circle.js';
16
- import Error from '../icon/icons/alert/error.js';
17
- import NotificationImportant from '../icon/icons/alert/notification-important.js';
18
- import Warning from '../icon/icons/alert/warning.js';
19
- import Loading from '../icon/icons/mock/loading.js';
20
- import Close from '../icon/icons/navigation/close.js';
10
+ import { useClassNames } from '../../hooks/use-class-names.mjs';
11
+ import { NotificationClassToken } from '../../utils/class-name.mjs';
12
+ import { Button } from '../button/button.mjs';
13
+ import { typography } from '../theme/theme.mjs';
14
+ import { ComponentToken } from '../../utils/component-token.mjs';
15
+ import Close from '../icon/icons/navigation/close.mjs';
16
+ import CheckCircle from '../icon/icons/action/check-circle.mjs';
17
+ import Error from '../icon/icons/alert/error.mjs';
18
+ import NotificationImportant from '../icon/icons/alert/notification-important.mjs';
19
+ import Warning from '../icon/icons/alert/warning.mjs';
20
+ import Loading from '../icon/icons/mock/loading.mjs';
21
21
 
22
22
  var AXIS = {
23
23
  top: "top",
@@ -0,0 +1,73 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
+ var _regeneratorRuntime = require('@babel/runtime/helpers/regeneratorRuntime');
5
+ var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
6
+ var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
7
+ var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
8
+ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
9
+ var _createClass = require('@babel/runtime/helpers/createClass');
10
+ var _classPrivateFieldInitSpec = require('@babel/runtime/helpers/classPrivateFieldInitSpec');
11
+ var _classPrivateFieldSet = require('@babel/runtime/helpers/classPrivateFieldSet2');
12
+ var _classPrivateFieldGet = require('@babel/runtime/helpers/classPrivateFieldGet2');
13
+ var React = require('react');
14
+ var client = require('react-dom/client');
15
+ var holder = require('./holder.cjs');
16
+
17
+ var METHODS = ["error", "info", "success", "warning"];
18
+ var _holder = /*#__PURE__*/new WeakMap();
19
+ var Notifier = /*#__PURE__*/function () {
20
+ function Notifier() {
21
+ var _notifier$_;
22
+ _classCallCheck(this, Notifier);
23
+ _classPrivateFieldInitSpec(this, _holder, null);
24
+ return (_notifier$_ = _notifier._) !== null && _notifier$_ !== void 0 ? _notifier$_ : _notifier._ = this;
25
+ }
26
+ return _createClass(Notifier, [{
27
+ key: "open",
28
+ value: function open(notification) {
29
+ var _this = this;
30
+ if (!_classPrivateFieldGet(_holder, this)) {
31
+ client.createRoot(document.createDocumentFragment()).render(/*#__PURE__*/React.createElement(holder.default, {
32
+ ref: function ref(holder) {
33
+ _classPrivateFieldSet(_holder, _this, holder);
34
+ },
35
+ defaultNotifications: [notification]
36
+ }));
37
+ return;
38
+ }
39
+ _classPrivateFieldGet(_holder, this).add(notification);
40
+ }
41
+ }]);
42
+ }();
43
+ // singleton mode
44
+ var _notifier = {
45
+ _: null
46
+ };
47
+ var Notification = Object.assign.apply(Object, [{
48
+ open: function open(notification) {
49
+ return new Notifier().open(notification);
50
+ }
51
+ }].concat(_toConsumableArray(METHODS.map(function (type) {
52
+ return _defineProperty({}, type, function () {
53
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(notification) {
54
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
55
+ while (1) switch (_context.prev = _context.next) {
56
+ case 0:
57
+ new Notifier().open(_objectSpread(_objectSpread({}, notification), {}, {
58
+ type: type
59
+ }));
60
+ case 1:
61
+ case "end":
62
+ return _context.stop();
63
+ }
64
+ }, _callee);
65
+ }));
66
+ return function (_x) {
67
+ return _ref.apply(this, arguments);
68
+ };
69
+ }());
70
+ }))));
71
+
72
+ exports.Notifier = Notifier;
73
+ exports.default = Notification;
@@ -10,7 +10,7 @@ import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet2'
10
10
  import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet2';
11
11
  import React from 'react';
12
12
  import { createRoot } from 'react-dom/client';
13
- import Holder from './holder.js';
13
+ import Holder from './holder.mjs';
14
14
 
15
15
  var METHODS = ["error", "info", "success", "warning"];
16
16
  var _holder = /*#__PURE__*/new WeakMap();
@@ -66,6 +66,5 @@ var Notification = Object.assign.apply(Object, [{
66
66
  };
67
67
  }());
68
68
  }))));
69
- var Notification$1 = Notification;
70
69
 
71
- export { Notifier, Notification$1 as default };
70
+ export { Notifier, Notification as default };
@@ -0,0 +1,31 @@
1
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
2
+ var relax = require('@aiszlab/relax');
3
+
4
+ /**
5
+ * @description
6
+ * number input value hook
7
+ */
8
+ var useValue = function useValue(_ref) {
9
+ var _value = _ref.value;
10
+ var _useControlledState = relax.useControlledState(_value === null || _value === void 0 ? void 0 : _value.toString()),
11
+ _useControlledState2 = _slicedToArray(_useControlledState, 2),
12
+ value = _useControlledState2[0],
13
+ setValue = _useControlledState2[1];
14
+ var change = relax.useEvent(function (___value) {
15
+ // ignore invalid character
16
+ if (!/^-?(?:\d+)?(\.)?\d*$/.test(___value) && ___value !== "") {
17
+ return;
18
+ }
19
+ // uncontrolled, change state only
20
+ if (relax.isUndefined(_value)) {
21
+ setValue(___value);
22
+ return;
23
+ }
24
+ });
25
+ return {
26
+ value: value,
27
+ change: change
28
+ };
29
+ };
30
+
31
+ exports.useValue = useValue;
@@ -0,0 +1,40 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
4
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
5
+ var React = require('react');
6
+ var input = require('../input/input.cjs');
7
+ var relax = require('@aiszlab/relax');
8
+ var hooks = require('./hooks.cjs');
9
+
10
+ var NumberInput = function NumberInput(_ref) {
11
+ var __value = _ref.value,
12
+ _formatter = _ref.formatter;
13
+ var _useFocus = relax.useFocus(),
14
+ _useFocus2 = _slicedToArray(_useFocus, 2),
15
+ isFocused = _useFocus2[0],
16
+ focusProps = _useFocus2[1];
17
+ var _useValue = hooks.useValue({
18
+ value: __value
19
+ }),
20
+ _value = _useValue.value,
21
+ change = _useValue.change;
22
+ /// formatter
23
+ var formatter = relax.useEvent(function (value) {
24
+ if (!_formatter) return _value;
25
+ formatter(value);
26
+ });
27
+ var value = React.useMemo(function () {
28
+ if (isFocused) {
29
+ return _value;
30
+ }
31
+ return formatter(_value);
32
+ }, [isFocused, formatter, _value]);
33
+ return /*#__PURE__*/React.createElement(input.default, _objectSpread({
34
+ type: "number",
35
+ value: value,
36
+ onChange: change
37
+ }, focusProps));
38
+ };
39
+
40
+ exports.default = NumberInput;
@@ -1,9 +1,9 @@
1
1
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
2
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
3
  import React, { useMemo } from 'react';
4
- import Input from '../input/input.js';
4
+ import Input from '../input/input.mjs';
5
5
  import { useFocus, useEvent } from '@aiszlab/relax';
6
- import { useValue } from './hooks.js';
6
+ import { useValue } from './hooks.mjs';
7
7
 
8
8
  var NumberInput = function NumberInput(_ref) {
9
9
  var __value = _ref.value,
@@ -34,6 +34,5 @@ var NumberInput = function NumberInput(_ref) {
34
34
  onChange: change
35
35
  }, focusProps));
36
36
  };
37
- var NumberInput$1 = NumberInput;
38
37
 
39
- export { NumberInput$1 as default };
38
+ export { NumberInput as default };
@@ -0,0 +1,82 @@
1
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
2
+ var relax = require('@aiszlab/relax');
3
+ var React = require('react');
4
+ var keyboard = require('../../utils/keyboard.cjs');
5
+
6
+ /**
7
+ * @description
8
+ * use value
9
+ */
10
+ var useValue = function useValue(_ref) {
11
+ var length = _ref.length,
12
+ onChange = _ref.onChange,
13
+ _value = _ref.value;
14
+ var _useControlledState = relax.useControlledState(_value, {
15
+ defaultState: ""
16
+ }),
17
+ _useControlledState2 = _slicedToArray(_useControlledState, 2),
18
+ value = _useControlledState2[0],
19
+ setValue = _useControlledState2[1];
20
+ var values = React.useMemo(function () {
21
+ return Array.from({
22
+ length: length
23
+ }, function (_, index) {
24
+ return value.charAt(index);
25
+ });
26
+ }, [length, value]);
27
+ var change = relax.useEvent(function (index, otp) {
28
+ var changed = Array.from(values);
29
+ changed[index] = otp;
30
+ var changedValue = changed.join("");
31
+ if (relax.isUndefined(_value)) {
32
+ setValue(changedValue);
33
+ return;
34
+ }
35
+ onChange === null || onChange === void 0 || onChange(changedValue);
36
+ });
37
+ return {
38
+ value: values,
39
+ change: change
40
+ };
41
+ };
42
+ /**
43
+ * @description
44
+ * events
45
+ */
46
+ var useInputEvents = function useInputEvents(_ref2) {
47
+ var refocus = _ref2.refocus,
48
+ focusedAt = _ref2.focusedAt,
49
+ value = _ref2.value,
50
+ changeValue = _ref2.changeValue;
51
+ var keyDown = relax.useEvent(function (e) {
52
+ switch (e.key) {
53
+ case keyboard.Keyboard.Backspace:
54
+ e.preventDefault();
55
+ changeValue("");
56
+ refocus(focusedAt - 1);
57
+ break;
58
+ case keyboard.Keyboard.Delete:
59
+ e.preventDefault();
60
+ changeValue("");
61
+ break;
62
+ case keyboard.Keyboard.ArrowLeft:
63
+ e.preventDefault();
64
+ refocus(focusedAt - 1);
65
+ break;
66
+ case keyboard.Keyboard.Space:
67
+ e.preventDefault();
68
+ break;
69
+ case keyboard.Keyboard.ArrowRight:
70
+ case value[focusedAt]:
71
+ e.preventDefault();
72
+ refocus(focusedAt + 1);
73
+ break;
74
+ }
75
+ });
76
+ return {
77
+ keyDown: keyDown
78
+ };
79
+ };
80
+
81
+ exports.useInputEvents = useInputEvents;
82
+ exports.useValue = useValue;
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
2
  import { useControlledState, useEvent, isUndefined } from '@aiszlab/relax';
3
3
  import { useMemo } from 'react';
4
- import { Keyboard } from '../../utils/keyboard.js';
4
+ import { Keyboard } from '../../utils/keyboard.mjs';
5
5
 
6
6
  /**
7
7
  * @description
@@ -0,0 +1,89 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
4
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
5
+ var React = require('react');
6
+ var hooks = require('./hooks.cjs');
7
+ var input = require('../input/input.cjs');
8
+ var relax = require('@aiszlab/relax');
9
+
10
+ var OtpInput = function OtpInput(_ref) {
11
+ var _ref$length = _ref.length,
12
+ length = _ref$length === void 0 ? 6 : _ref$length,
13
+ onChange = _ref.onChange,
14
+ _value = _ref.value;
15
+ var _useValue = hooks.useValue({
16
+ length: length,
17
+ onChange: onChange,
18
+ value: _value
19
+ }),
20
+ value = _useValue.value,
21
+ _change = _useValue.change;
22
+ var inputRefs = React.useRef(Array.from({
23
+ length: length
24
+ }).fill(null));
25
+ var _useState = React.useState(0),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ focusedAt = _useState2[0],
28
+ setFocusedAt = _useState2[1];
29
+ var refocus = relax.useEvent(function (_foucsAt) {
30
+ var _inputRefs$current$fo, _inputRefs$current$fo2, _inputRefs$current$fo3, _inputRefs$current$fo4;
31
+ var foucsAt = relax.clamp(_foucsAt, 0, length - 1);
32
+ // handle input, only select when prev input
33
+ (_inputRefs$current$fo = inputRefs.current[foucsAt]) === null || _inputRefs$current$fo === void 0 || (_inputRefs$current$fo2 = _inputRefs$current$fo.focus) === null || _inputRefs$current$fo2 === void 0 || _inputRefs$current$fo2.call(_inputRefs$current$fo);
34
+ _foucsAt < length && ((_inputRefs$current$fo3 = inputRefs.current[foucsAt]) === null || _inputRefs$current$fo3 === void 0 || (_inputRefs$current$fo4 = _inputRefs$current$fo3.select) === null || _inputRefs$current$fo4 === void 0 ? void 0 : _inputRefs$current$fo4.call(_inputRefs$current$fo3));
35
+ setFocusedAt(foucsAt);
36
+ });
37
+ var changeValue = relax.useEvent(function (value) {
38
+ _change(focusedAt, value);
39
+ });
40
+ var change = relax.useEvent(function (otp) {
41
+ // value
42
+ changeValue(otp);
43
+ // focus
44
+ refocus(focusedAt + 1);
45
+ });
46
+ var focus = relax.useEvent(function (e, index) {
47
+ setFocusedAt(index);
48
+ e.target.select();
49
+ });
50
+ var _useInputEvents = hooks.useInputEvents({
51
+ refocus: refocus,
52
+ focusedAt: focusedAt,
53
+ value: value,
54
+ changeValue: changeValue
55
+ }),
56
+ keyDown = _useInputEvents.keyDown;
57
+ var styled = {
58
+ otp: {
59
+ className: "musaex-78zum5 musaex-1q0g3np musaex-1lsrmdg"
60
+ },
61
+ input: {
62
+ className: "musaex-16b21pk"
63
+ }
64
+ };
65
+ return /*#__PURE__*/React.createElement("div", {
66
+ className: styled.otp.className,
67
+ style: styled.otp.style
68
+ }, value.map(function (item, index) {
69
+ return /*#__PURE__*/React.createElement(input.default, {
70
+ key: index,
71
+ value: item,
72
+ maxLength: 1,
73
+ className: styled.input.className,
74
+ style: _objectSpread(_objectSpread({}, styled.input.style), {}, {
75
+ minWidth: 0
76
+ }),
77
+ ref: function ref(inputRef) {
78
+ inputRefs.current[index] = inputRef;
79
+ },
80
+ onChange: change,
81
+ onKeyDown: keyDown,
82
+ onFocus: function onFocus(e) {
83
+ return focus(e, index);
84
+ }
85
+ });
86
+ }));
87
+ };
88
+
89
+ exports.default = OtpInput;