@zuzjs/ui 0.7.7 → 0.7.9

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 (340) hide show
  1. package/dist/cjs/comps/Accordion/index.js +2 -1
  2. package/dist/cjs/comps/Actionbar/index.d.ts +1 -1
  3. package/dist/cjs/comps/Actionbar/index.js +3 -2
  4. package/dist/cjs/comps/Alert/index.d.ts +1 -1
  5. package/dist/cjs/comps/Alert/index.js +1 -0
  6. package/dist/cjs/comps/AutoComplete/index.js +1 -0
  7. package/dist/cjs/comps/Avatar/index.js +3 -2
  8. package/dist/cjs/comps/Box/index.d.ts +1 -2
  9. package/dist/cjs/comps/Box/index.js +15 -13
  10. package/dist/cjs/comps/Button/index.d.ts +2 -2
  11. package/dist/cjs/comps/Button/index.js +4 -3
  12. package/dist/cjs/comps/Button/types.d.ts +1 -1
  13. package/dist/cjs/comps/CheckBox/index.d.ts +2 -2
  14. package/dist/cjs/comps/CheckBox/index.js +2 -1
  15. package/dist/cjs/comps/ColorScheme/index.d.ts +3 -2
  16. package/dist/cjs/comps/ColorScheme/index.js +29 -9
  17. package/dist/cjs/comps/ColorScheme/types.d.ts +4 -0
  18. package/dist/cjs/comps/ColorScheme/types.js +1 -0
  19. package/dist/cjs/comps/ContextMenu/index.js +4 -4
  20. package/dist/cjs/comps/CookiesConsent/index.js +3 -2
  21. package/dist/cjs/comps/Cover/index.d.ts +1 -1
  22. package/dist/cjs/comps/Cover/index.js +3 -2
  23. package/dist/cjs/comps/Crumb/index.d.ts +4 -0
  24. package/dist/cjs/comps/Crumb/index.js +13 -0
  25. package/dist/cjs/comps/Crumb/types.d.ts +11 -0
  26. package/dist/cjs/comps/Crumb/types.js +1 -0
  27. package/dist/cjs/comps/Drawer/index.js +17 -15
  28. package/dist/cjs/comps/Editor/Timeline/index.js +4 -3
  29. package/dist/cjs/comps/Editor/index.js +2 -1
  30. package/dist/cjs/comps/Fab/index.d.ts +1 -2
  31. package/dist/cjs/comps/Fab/index.js +2 -1
  32. package/dist/cjs/comps/Filters/index.d.ts +4 -1
  33. package/dist/cjs/comps/Filters/index.js +1 -0
  34. package/dist/cjs/comps/Form/index.d.ts +3 -59
  35. package/dist/cjs/comps/Form/index.js +5 -7
  36. package/dist/cjs/comps/Form/types.d.ts +43 -0
  37. package/dist/cjs/comps/Form/types.js +1 -0
  38. package/dist/cjs/comps/Icon/index.d.ts +1 -1
  39. package/dist/cjs/comps/Icon/index.js +2 -2
  40. package/dist/cjs/comps/Image/index.js +1 -1
  41. package/dist/cjs/comps/Input/index.js +1 -0
  42. package/dist/cjs/comps/KeyboardKeys/index.d.ts +8 -0
  43. package/dist/cjs/comps/KeyboardKeys/index.js +33 -0
  44. package/dist/cjs/comps/KeyboardKeys/types.d.ts +13 -0
  45. package/dist/cjs/comps/KeyboardKeys/types.js +51 -0
  46. package/dist/cjs/comps/Label/index.js +1 -1
  47. package/dist/cjs/comps/List/index.d.ts +4 -1
  48. package/dist/cjs/comps/List/index.js +5 -4
  49. package/dist/cjs/comps/List/item.d.ts +6 -3
  50. package/dist/cjs/comps/List/item.js +6 -1
  51. package/dist/cjs/comps/List/types.d.ts +4 -1
  52. package/dist/cjs/comps/Network/index.js +6 -7
  53. package/dist/cjs/comps/Overlay/index.js +2 -1
  54. package/dist/cjs/comps/Pagination/index.js +3 -2
  55. package/dist/cjs/comps/Password/index.js +2 -1
  56. package/dist/cjs/comps/PinInput/index.js +2 -1
  57. package/dist/cjs/comps/ProgressBar/index.js +1 -0
  58. package/dist/cjs/comps/Radio/index.js +1 -0
  59. package/dist/cjs/comps/ScrollView/index.d.ts +5 -0
  60. package/dist/cjs/comps/ScrollView/index.js +13 -0
  61. package/dist/cjs/comps/ScrollView/types.d.ts +6 -0
  62. package/dist/cjs/comps/ScrollView/types.js +1 -0
  63. package/dist/cjs/comps/Search/index.d.ts +7 -10
  64. package/dist/cjs/comps/Search/index.js +12 -7
  65. package/dist/cjs/comps/Search/types.d.ts +12 -0
  66. package/dist/cjs/comps/Search/types.js +1 -0
  67. package/dist/cjs/comps/Segmented/index.d.ts +3 -2
  68. package/dist/cjs/comps/Segmented/index.js +6 -5
  69. package/dist/cjs/comps/Segmented/item.d.ts +4 -1
  70. package/dist/cjs/comps/Segmented/item.js +16 -14
  71. package/dist/cjs/comps/Segmented/types.d.ts +5 -1
  72. package/dist/cjs/comps/Select/index.d.ts +2 -4
  73. package/dist/cjs/comps/Select/index.js +4 -3
  74. package/dist/cjs/comps/Select/optionItem.d.ts +4 -1
  75. package/dist/cjs/comps/Select/optionItem.js +1 -0
  76. package/dist/cjs/comps/Select/types.d.ts +1 -1
  77. package/dist/cjs/comps/Sheet/index.d.ts +1 -1
  78. package/dist/cjs/comps/Sheet/index.js +12 -8
  79. package/dist/cjs/comps/Sidebar/index.js +1 -0
  80. package/dist/cjs/comps/Slider/index.d.ts +1 -1
  81. package/dist/cjs/comps/Slider/index.js +3 -2
  82. package/dist/cjs/comps/Span/index.js +1 -0
  83. package/dist/cjs/comps/Spinner/index.d.ts +1 -1
  84. package/dist/cjs/comps/Spinner/index.js +4 -7
  85. package/dist/cjs/comps/Switch/index.d.ts +1 -1
  86. package/dist/cjs/comps/Switch/index.js +2 -1
  87. package/dist/cjs/comps/TabView/body.js +1 -0
  88. package/dist/cjs/comps/TabView/index.d.ts +1 -1
  89. package/dist/cjs/comps/TabView/index.js +1 -0
  90. package/dist/cjs/comps/TabView/tab.d.ts +4 -1
  91. package/dist/cjs/comps/TabView/tab.js +1 -0
  92. package/dist/cjs/comps/TabView/types.d.ts +2 -2
  93. package/dist/cjs/comps/Table/col.d.ts +9 -6
  94. package/dist/cjs/comps/Table/col.js +1 -0
  95. package/dist/cjs/comps/Table/index.js +13 -5
  96. package/dist/cjs/comps/Table/row.d.ts +4 -1
  97. package/dist/cjs/comps/Table/row.js +5 -3
  98. package/dist/cjs/comps/Table/types.d.ts +88 -1
  99. package/dist/cjs/comps/Text/index.d.ts +2 -0
  100. package/dist/cjs/comps/Text/index.js +4 -2
  101. package/dist/cjs/comps/TextArea/index.d.ts +2 -0
  102. package/dist/cjs/comps/TextArea/index.js +3 -3
  103. package/dist/cjs/comps/TextWheel/index.js +1 -0
  104. package/dist/cjs/comps/Tooltip/index.d.ts +1 -2
  105. package/dist/cjs/comps/Tooltip/index.js +2 -1
  106. package/dist/cjs/comps/Treeview/index.d.ts +1 -2
  107. package/dist/cjs/comps/Treeview/index.js +3 -1
  108. package/dist/cjs/comps/Treeview/item.d.ts +3 -2
  109. package/dist/cjs/comps/Treeview/item.js +12 -7
  110. package/dist/cjs/comps/Treeview/types.d.ts +6 -2
  111. package/dist/cjs/comps/VideoPlayer/index.d.ts +2 -0
  112. package/dist/cjs/comps/VideoPlayer/index.js +7 -0
  113. package/dist/cjs/comps/index.d.ts +26 -18
  114. package/dist/cjs/comps/index.js +8 -0
  115. package/dist/cjs/funs/css.d.ts +3 -3
  116. package/dist/cjs/funs/css.js +20 -18
  117. package/dist/cjs/funs/index.d.ts +3 -1
  118. package/dist/cjs/funs/index.js +14 -3
  119. package/dist/cjs/funs/stylesheet.js +5 -0
  120. package/dist/cjs/hooks/index.d.ts +15 -9
  121. package/dist/cjs/hooks/index.js +14 -7
  122. package/dist/cjs/hooks/useAnchorPosition.d.ts +1 -2
  123. package/dist/cjs/hooks/useAnchorPosition.js +1 -0
  124. package/dist/cjs/hooks/useBase.js +27 -13
  125. package/dist/cjs/hooks/useCalendar.js +1 -0
  126. package/dist/cjs/hooks/useColorScheme.js +2 -2
  127. package/dist/cjs/hooks/useContextMenu.js +1 -0
  128. package/dist/cjs/hooks/useDB.js +1 -0
  129. package/dist/cjs/hooks/useDebounce.js +2 -1
  130. package/dist/cjs/hooks/useDelayed.d.ts +17 -0
  131. package/dist/cjs/hooks/useDelayed.js +26 -0
  132. package/dist/cjs/hooks/useDevice.js +1 -0
  133. package/dist/cjs/hooks/useDimensions.js +2 -1
  134. package/dist/cjs/hooks/useDom.d.ts +2 -0
  135. package/dist/cjs/hooks/useDom.js +3 -0
  136. package/dist/cjs/hooks/useDomMutation.d.ts +3 -0
  137. package/dist/cjs/hooks/useDomMutation.js +19 -0
  138. package/dist/cjs/hooks/useDrag.js +2 -1
  139. package/dist/cjs/hooks/useFileManager.d.ts +2 -0
  140. package/dist/cjs/hooks/useFileManager.js +3 -0
  141. package/dist/cjs/hooks/useImage.js +1 -0
  142. package/dist/cjs/hooks/useIntersectionObserver.js +2 -1
  143. package/dist/cjs/hooks/useMediaPlayer.d.ts +32 -0
  144. package/dist/cjs/hooks/useMediaPlayer.js +86 -0
  145. package/dist/cjs/hooks/useMergedRefs.d.ts +2 -0
  146. package/dist/cjs/hooks/useMergedRefs.js +14 -0
  147. package/dist/cjs/hooks/useMutationObserver.d.ts +3 -0
  148. package/dist/cjs/hooks/useMutationObserver.js +20 -0
  149. package/dist/cjs/hooks/useNetworkStatus.js +2 -1
  150. package/dist/cjs/hooks/usePlayer.d.ts +32 -0
  151. package/dist/cjs/hooks/usePlayer.js +85 -0
  152. package/dist/cjs/hooks/useResizeObserver.js +2 -1
  153. package/dist/cjs/hooks/useScrollbar.d.ts +16 -0
  154. package/dist/cjs/hooks/useScrollbar.js +160 -0
  155. package/dist/cjs/hooks/useSheet.js +1 -0
  156. package/dist/cjs/hooks/useShortcuts.d.ts +7 -0
  157. package/dist/cjs/hooks/useShortcuts.js +29 -0
  158. package/dist/cjs/hooks/useSlider.d.ts +7 -0
  159. package/dist/cjs/hooks/useSlider.js +23 -0
  160. package/dist/cjs/hooks/useTruncateText.d.ts +2 -0
  161. package/dist/cjs/hooks/useTruncateText.js +17 -0
  162. package/dist/cjs/hooks/useViewTransition.d.ts +2 -0
  163. package/dist/cjs/hooks/useViewTransition.js +13 -0
  164. package/dist/cjs/index.js +1 -0
  165. package/dist/cjs/types/enums.d.ts +1 -0
  166. package/dist/cjs/types/enums.js +1 -0
  167. package/dist/cjs/types/index.d.ts +2 -1
  168. package/dist/cjs/types/interfaces.d.ts +2 -0
  169. package/dist/css/styles.css +1 -1
  170. package/dist/esm/comps/Accordion/index.js +2 -1
  171. package/dist/esm/comps/Actionbar/index.d.ts +1 -1
  172. package/dist/esm/comps/Actionbar/index.js +3 -2
  173. package/dist/esm/comps/Alert/index.d.ts +1 -1
  174. package/dist/esm/comps/Alert/index.js +1 -0
  175. package/dist/esm/comps/AutoComplete/index.js +1 -0
  176. package/dist/esm/comps/Avatar/index.js +3 -2
  177. package/dist/esm/comps/Box/index.d.ts +1 -2
  178. package/dist/esm/comps/Box/index.js +15 -13
  179. package/dist/esm/comps/Button/index.d.ts +2 -2
  180. package/dist/esm/comps/Button/index.js +4 -3
  181. package/dist/esm/comps/Button/types.d.ts +1 -1
  182. package/dist/esm/comps/CheckBox/index.d.ts +2 -2
  183. package/dist/esm/comps/CheckBox/index.js +2 -1
  184. package/dist/esm/comps/ColorScheme/index.d.ts +3 -2
  185. package/dist/esm/comps/ColorScheme/index.js +29 -9
  186. package/dist/esm/comps/ColorScheme/types.d.ts +4 -0
  187. package/dist/esm/comps/ColorScheme/types.js +1 -0
  188. package/dist/esm/comps/ContextMenu/index.js +4 -4
  189. package/dist/esm/comps/CookiesConsent/index.js +3 -2
  190. package/dist/esm/comps/Cover/index.d.ts +1 -1
  191. package/dist/esm/comps/Cover/index.js +3 -2
  192. package/dist/esm/comps/Crumb/index.d.ts +4 -0
  193. package/dist/esm/comps/Crumb/index.js +13 -0
  194. package/dist/esm/comps/Crumb/types.d.ts +11 -0
  195. package/dist/esm/comps/Crumb/types.js +1 -0
  196. package/dist/esm/comps/Drawer/index.js +17 -15
  197. package/dist/esm/comps/Editor/Timeline/index.js +4 -3
  198. package/dist/esm/comps/Editor/index.js +2 -1
  199. package/dist/esm/comps/Fab/index.d.ts +1 -2
  200. package/dist/esm/comps/Fab/index.js +2 -1
  201. package/dist/esm/comps/Filters/index.d.ts +4 -1
  202. package/dist/esm/comps/Filters/index.js +1 -0
  203. package/dist/esm/comps/Form/index.d.ts +3 -59
  204. package/dist/esm/comps/Form/index.js +5 -7
  205. package/dist/esm/comps/Form/types.d.ts +43 -0
  206. package/dist/esm/comps/Form/types.js +1 -0
  207. package/dist/esm/comps/Icon/index.d.ts +1 -1
  208. package/dist/esm/comps/Icon/index.js +2 -2
  209. package/dist/esm/comps/Image/index.js +1 -1
  210. package/dist/esm/comps/Input/index.js +1 -0
  211. package/dist/esm/comps/KeyboardKeys/index.d.ts +8 -0
  212. package/dist/esm/comps/KeyboardKeys/index.js +33 -0
  213. package/dist/esm/comps/KeyboardKeys/types.d.ts +13 -0
  214. package/dist/esm/comps/KeyboardKeys/types.js +51 -0
  215. package/dist/esm/comps/Label/index.js +1 -1
  216. package/dist/esm/comps/List/index.d.ts +4 -1
  217. package/dist/esm/comps/List/index.js +5 -4
  218. package/dist/esm/comps/List/item.d.ts +6 -3
  219. package/dist/esm/comps/List/item.js +6 -1
  220. package/dist/esm/comps/List/types.d.ts +4 -1
  221. package/dist/esm/comps/Network/index.js +6 -7
  222. package/dist/esm/comps/Overlay/index.js +2 -1
  223. package/dist/esm/comps/Pagination/index.js +3 -2
  224. package/dist/esm/comps/Password/index.js +2 -1
  225. package/dist/esm/comps/PinInput/index.js +2 -1
  226. package/dist/esm/comps/ProgressBar/index.js +1 -0
  227. package/dist/esm/comps/Radio/index.js +1 -0
  228. package/dist/esm/comps/ScrollView/index.d.ts +5 -0
  229. package/dist/esm/comps/ScrollView/index.js +13 -0
  230. package/dist/esm/comps/ScrollView/types.d.ts +6 -0
  231. package/dist/esm/comps/ScrollView/types.js +1 -0
  232. package/dist/esm/comps/Search/index.d.ts +7 -10
  233. package/dist/esm/comps/Search/index.js +12 -7
  234. package/dist/esm/comps/Search/types.d.ts +12 -0
  235. package/dist/esm/comps/Search/types.js +1 -0
  236. package/dist/esm/comps/Segmented/index.d.ts +3 -2
  237. package/dist/esm/comps/Segmented/index.js +6 -5
  238. package/dist/esm/comps/Segmented/item.d.ts +4 -1
  239. package/dist/esm/comps/Segmented/item.js +16 -14
  240. package/dist/esm/comps/Segmented/types.d.ts +5 -1
  241. package/dist/esm/comps/Select/index.d.ts +2 -4
  242. package/dist/esm/comps/Select/index.js +4 -3
  243. package/dist/esm/comps/Select/optionItem.d.ts +4 -1
  244. package/dist/esm/comps/Select/optionItem.js +1 -0
  245. package/dist/esm/comps/Select/types.d.ts +1 -1
  246. package/dist/esm/comps/Sheet/index.d.ts +1 -1
  247. package/dist/esm/comps/Sheet/index.js +12 -8
  248. package/dist/esm/comps/Sidebar/index.js +1 -0
  249. package/dist/esm/comps/Slider/index.d.ts +1 -1
  250. package/dist/esm/comps/Slider/index.js +3 -2
  251. package/dist/esm/comps/Span/index.js +1 -0
  252. package/dist/esm/comps/Spinner/index.d.ts +1 -1
  253. package/dist/esm/comps/Spinner/index.js +4 -7
  254. package/dist/esm/comps/Switch/index.d.ts +1 -1
  255. package/dist/esm/comps/Switch/index.js +2 -1
  256. package/dist/esm/comps/TabView/body.js +1 -0
  257. package/dist/esm/comps/TabView/index.d.ts +1 -1
  258. package/dist/esm/comps/TabView/index.js +1 -0
  259. package/dist/esm/comps/TabView/tab.d.ts +4 -1
  260. package/dist/esm/comps/TabView/tab.js +1 -0
  261. package/dist/esm/comps/TabView/types.d.ts +2 -2
  262. package/dist/esm/comps/Table/col.d.ts +9 -6
  263. package/dist/esm/comps/Table/col.js +1 -0
  264. package/dist/esm/comps/Table/index.js +13 -5
  265. package/dist/esm/comps/Table/row.d.ts +4 -1
  266. package/dist/esm/comps/Table/row.js +5 -3
  267. package/dist/esm/comps/Table/types.d.ts +88 -1
  268. package/dist/esm/comps/Text/index.d.ts +2 -0
  269. package/dist/esm/comps/Text/index.js +4 -2
  270. package/dist/esm/comps/TextArea/index.d.ts +2 -0
  271. package/dist/esm/comps/TextArea/index.js +3 -3
  272. package/dist/esm/comps/TextWheel/index.js +1 -0
  273. package/dist/esm/comps/Tooltip/index.d.ts +1 -2
  274. package/dist/esm/comps/Tooltip/index.js +2 -1
  275. package/dist/esm/comps/Treeview/index.d.ts +1 -2
  276. package/dist/esm/comps/Treeview/index.js +3 -1
  277. package/dist/esm/comps/Treeview/item.d.ts +3 -2
  278. package/dist/esm/comps/Treeview/item.js +12 -7
  279. package/dist/esm/comps/Treeview/types.d.ts +6 -2
  280. package/dist/esm/comps/VideoPlayer/index.d.ts +2 -0
  281. package/dist/esm/comps/VideoPlayer/index.js +7 -0
  282. package/dist/esm/comps/index.d.ts +26 -18
  283. package/dist/esm/comps/index.js +8 -0
  284. package/dist/esm/funs/css.d.ts +3 -3
  285. package/dist/esm/funs/css.js +20 -18
  286. package/dist/esm/funs/index.d.ts +3 -1
  287. package/dist/esm/funs/index.js +14 -3
  288. package/dist/esm/funs/stylesheet.js +5 -0
  289. package/dist/esm/hooks/index.d.ts +15 -9
  290. package/dist/esm/hooks/index.js +14 -7
  291. package/dist/esm/hooks/useAnchorPosition.d.ts +1 -2
  292. package/dist/esm/hooks/useAnchorPosition.js +1 -0
  293. package/dist/esm/hooks/useBase.js +27 -13
  294. package/dist/esm/hooks/useCalendar.js +1 -0
  295. package/dist/esm/hooks/useColorScheme.js +2 -2
  296. package/dist/esm/hooks/useContextMenu.js +1 -0
  297. package/dist/esm/hooks/useDB.js +1 -0
  298. package/dist/esm/hooks/useDebounce.js +2 -1
  299. package/dist/esm/hooks/useDelayed.d.ts +17 -0
  300. package/dist/esm/hooks/useDelayed.js +26 -0
  301. package/dist/esm/hooks/useDevice.js +1 -0
  302. package/dist/esm/hooks/useDimensions.js +2 -1
  303. package/dist/esm/hooks/useDom.d.ts +2 -0
  304. package/dist/esm/hooks/useDom.js +3 -0
  305. package/dist/esm/hooks/useDomMutation.d.ts +3 -0
  306. package/dist/esm/hooks/useDomMutation.js +19 -0
  307. package/dist/esm/hooks/useDrag.js +2 -1
  308. package/dist/esm/hooks/useFileManager.d.ts +2 -0
  309. package/dist/esm/hooks/useFileManager.js +3 -0
  310. package/dist/esm/hooks/useImage.js +1 -0
  311. package/dist/esm/hooks/useIntersectionObserver.js +2 -1
  312. package/dist/esm/hooks/useMediaPlayer.d.ts +32 -0
  313. package/dist/esm/hooks/useMediaPlayer.js +86 -0
  314. package/dist/esm/hooks/useMergedRefs.d.ts +2 -0
  315. package/dist/esm/hooks/useMergedRefs.js +14 -0
  316. package/dist/esm/hooks/useMutationObserver.d.ts +3 -0
  317. package/dist/esm/hooks/useMutationObserver.js +20 -0
  318. package/dist/esm/hooks/useNetworkStatus.js +2 -1
  319. package/dist/esm/hooks/usePlayer.d.ts +32 -0
  320. package/dist/esm/hooks/usePlayer.js +85 -0
  321. package/dist/esm/hooks/useResizeObserver.js +2 -1
  322. package/dist/esm/hooks/useScrollbar.d.ts +16 -0
  323. package/dist/esm/hooks/useScrollbar.js +160 -0
  324. package/dist/esm/hooks/useSheet.js +1 -0
  325. package/dist/esm/hooks/useShortcuts.d.ts +7 -0
  326. package/dist/esm/hooks/useShortcuts.js +29 -0
  327. package/dist/esm/hooks/useSlider.d.ts +7 -0
  328. package/dist/esm/hooks/useSlider.js +23 -0
  329. package/dist/esm/hooks/useTruncateText.d.ts +2 -0
  330. package/dist/esm/hooks/useTruncateText.js +17 -0
  331. package/dist/esm/hooks/useViewTransition.d.ts +2 -0
  332. package/dist/esm/hooks/useViewTransition.js +13 -0
  333. package/dist/esm/index.js +1 -0
  334. package/dist/esm/types/enums.d.ts +1 -0
  335. package/dist/esm/types/enums.js +1 -0
  336. package/dist/esm/types/index.d.ts +2 -1
  337. package/dist/esm/types/interfaces.d.ts +2 -0
  338. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  339. package/dist/tsconfig.tsbuildinfo +1 -1
  340. package/package.json +1 -1
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { isValidElement } from "react";
2
3
  import { useBase, useDelayed } from "../../hooks";
3
4
  const Item = (props) => {
4
5
  const { meta } = props;
5
6
  const mounted = useDelayed();
6
- const { label, ...pops } = meta;
7
+ const { label, ...pops } = isValidElement(meta) ? {} : meta;
7
8
  const { className, style, rest } = useBase({
8
9
  ...pops,
9
10
  ...(pops.animate ? { animate: {
@@ -11,6 +12,10 @@ const Item = (props) => {
11
12
  when: mounted
12
13
  } } : {})
13
14
  });
15
+ if (isValidElement(meta)) {
16
+ return _jsx("li", { style: style, className: className, children: meta });
17
+ }
14
18
  return _jsx("li", { style: style, className: className, ...rest, children: typeof meta == `string` ? meta : label });
15
19
  };
20
+ Item.displayName = `ListItem`;
16
21
  export default Item;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  import { Props } from "../../types";
3
- import { Size } from "../../types/enums";
3
+ import { Size, Variant } from "../../types/enums";
4
4
  import { animationProps } from "../../types/interfaces";
5
5
  export type ListItemObject = {
6
6
  icon?: ReactNode;
@@ -13,6 +13,9 @@ export type ListItemObject = {
13
13
  export type ListItem = Props<`li`> & (ReactNode | ListItemObject);
14
14
  export type ListProps = Props<`ul` | `ol`> & {
15
15
  size?: Size;
16
+ variant?: Variant;
16
17
  items: ListItem[];
18
+ direction?: "cols" | "rows";
19
+ seperator?: ReactNode;
17
20
  ol?: boolean;
18
21
  };
@@ -1,16 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useEffect } from "react";
3
- import Box from "../Box";
4
- import Text from "../Text";
5
- import { ALERT, Size, TRANSITION_CURVES } from "../../types/enums";
2
+ import { forwardRef } from "react";
6
3
  import { useNetworkStatus } from "../../hooks";
4
+ import { ALERT, Size, TRANSITION_CURVES } from "../../types/enums";
5
+ import Box from "../Box";
7
6
  import SVGIcons from "../svgicons";
7
+ import Text from "../Text";
8
8
  const NetworkManager = forwardRef((props, ref) => {
9
9
  const isOnline = useNetworkStatus();
10
10
  const { onlineMessage, offlineMessage, size } = props;
11
- useEffect(() => {
12
- }, []);
13
- return _jsxs(Box, { animate: {
11
+ return _jsxs(Box, { fx: {
14
12
  from: { x: `-50%`, y: 200, opacity: 0 },
15
13
  to: { x: `-50%`, y: 0, opacity: 1 },
16
14
  when: isOnline == false,
@@ -19,4 +17,5 @@ const NetworkManager = forwardRef((props, ref) => {
19
17
  delay: 2
20
18
  }, className: `--network-manager --${isOnline == true ? `online` : `offline`} --${size || Size.Small} fixed flex`, children: [_jsx(Box, { className: `--ico`, children: isOnline ? SVGIcons[ALERT.Success] : SVGIcons[ALERT.Error] }), _jsx(Text, { as: `--message`, children: isOnline ? onlineMessage || `internet connection restored :)` : offlineMessage || `no internet connection` })] });
21
19
  });
20
+ NetworkManager.displayName = `ZuzUI.NetWorkManager`;
22
21
  export default NetworkManager;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import Box from "../Box";
4
3
  import { TRANSITIONS } from "../../types/enums";
4
+ import Box from "../Box";
5
5
  export const Overlay = forwardRef((props, ref) => {
6
6
  const { when, ...pops } = props;
7
7
  return _jsx(Box, { ref: ref, "aria-hidden": !when, className: `--overlay fixed fill`, animate: {
@@ -9,4 +9,5 @@ export const Overlay = forwardRef((props, ref) => {
9
9
  when,
10
10
  }, ...pops });
11
11
  });
12
+ Overlay.displayName = `Overlay`;
12
13
  export default Overlay;
@@ -7,7 +7,7 @@ import Box from "../Box";
7
7
  import Button from "../Button";
8
8
  import SVGIcons from "../svgicons";
9
9
  import { PaginationStyle } from "./types";
10
- const Pagination = forwardRef((props, _ref) => {
10
+ const Pagination = forwardRef((props, ref) => {
11
11
  const { itemCount, itemsPerPage, startPage, pageRange, paginationStyle, breakLabel, prevLabel, nextLabel, hash, loading, seperator, renderOnZeroPageCount, onPageChange, ...pops } = props;
12
12
  const _hashKey = useMemo(() => toHash(numberInRange(4, 8)), []);
13
13
  const _hash = useCallback((input) => `${toHash(input, hash || 6, _hashKey)}${seperator || ``}${_hashKey}`, [_hashKey]);
@@ -54,9 +54,10 @@ const Pagination = forwardRef((props, _ref) => {
54
54
  }, [itemCount, itemsPerPage, _currentPage]);
55
55
  if (pages.length <= 1 && ((renderOnZeroPageCount == undefined ? false : renderOnZeroPageCount) === false))
56
56
  return null;
57
- return _jsxs(Box, { as: `--pagination --pgt-${paginationStyle || PaginationStyle.Table} flex aic w:100% jcc ${className}`, children: [_jsx(Box, { as: `flex flex:1 aic --pgt-btns`, children: (pages.length > 1 ? pages : [{ id: 1, label: 1 }, { id: -1, label: _breakLabel }]).map((page, index, items) => _jsx(Button, { disabled: page.id == -1 || getPageValue(_currentPage) == +page.label, className: (`string` == typeof page ? page : page.label) == getPageValue(_currentPage) ? `--current-page` : ``, onClick: (ev) => handlePage(page), children: `string` == typeof page ? page : page.label }, `--pg-${index}-${page.id}`)) }), _jsx(Box, { as: `flex aic jcc flex:1 --pagination-label`, children: [
57
+ return _jsxs(Box, { ref: ref, as: `--pagination --pgt-${paginationStyle || PaginationStyle.Table} flex aic w:100% jcc ${className}`, children: [_jsx(Box, { as: `flex flex:1 aic --pgt-btns`, children: (pages.length > 1 ? pages : [{ id: 1, label: 1 }, { id: -1, label: _breakLabel }]).map((page, index, items) => _jsx(Button, { disabled: page.id == -1 || getPageValue(_currentPage) == +page.label, className: (`string` == typeof page ? page : page.label) == getPageValue(_currentPage) ? `--current-page` : ``, onClick: (ev) => handlePage(page), children: `string` == typeof page ? page : page.label }, `--pg-${index}-${page.id}`)) }), _jsx(Box, { as: `flex aic jcc flex:1 --pagination-label`, children: [
58
58
  `Showing ${(getPageValue(_currentPage) - 1) * itemsPerPage + 1} - `,
59
59
  `${Math.min(getPageValue(_currentPage) * itemsPerPage, itemCount)} of ${itemCount} items`
60
60
  ].join(` `) }), _jsxs(Box, { as: `flex aic jce flex:1 --pgt-btns --pgt-nav`, children: [_jsx(Button, { disabled: getPageValue(_currentPage) <= 1, onClick: (ev) => handlePage({ id: hash ? _hash(getPageValue(_currentPage) - 1) : getPageValue(_currentPage) - 1, label: getPageValue(_currentPage) - 1 }), children: SVGIcons.chevronLeftOutline }), _jsx(Button, { disabled: pages.length <= 1 || getPageValue(_currentPage) == getPageValue(pages[pages.length - 1]), onClick: (ev) => handlePage({ id: hash ? _hash(getPageValue(_currentPage) + 1) : getPageValue(_currentPage) + 1, label: getPageValue(_currentPage) + 1 }), children: SVGIcons.chevronRightOutline })] })] });
61
61
  });
62
+ Pagination.displayName = `Pagination`;
62
63
  export default Pagination;
@@ -2,9 +2,9 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { forwardRef, useState } from 'react';
4
4
  import { useBase } from '../../hooks';
5
- import Input from '../Input';
6
5
  import Box from '../Box';
7
6
  import Button from '../Button';
7
+ import Input from '../Input';
8
8
  import SVGIcons from '../svgicons';
9
9
  const Password = forwardRef((props, ref) => {
10
10
  const { ...pops } = props;
@@ -15,4 +15,5 @@ const Password = forwardRef((props, ref) => {
15
15
  const [visible, setVisible] = useState(false);
16
16
  return _jsxs(Box, { style: style, className: `--password flex aic rel`, children: [_jsx(Input, { ref: ref, type: visible ? 'text' : 'password', className: className, ...rest }), _jsx(Button, { tabIndex: -1, onClick: () => setVisible(prev => !prev), className: `--toggle flex aic jcc abs`, children: visible ? SVGIcons.eye : SVGIcons.eyeSlash })] });
17
17
  });
18
+ Password.displayName = `Password`;
18
19
  export default Password;
@@ -2,8 +2,8 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { forwardRef, useEffect, useRef } from 'react';
4
4
  import { useBase } from '../../hooks';
5
- import Input from '../Input';
6
5
  import Box from '../Box';
6
+ import Input from '../Input';
7
7
  const PinInput = forwardRef((props, ref) => {
8
8
  const { size, length, mask, ...pops } = props;
9
9
  const inputs = useRef([]);
@@ -39,4 +39,5 @@ const PinInput = forwardRef((props, ref) => {
39
39
  inputs.current[i] = el;
40
40
  }, numeric: true, onChange: handleInput, maxLength: 1, placeholder: `0`, type: mask ? `password` : 'text', ...pops }, `pin-${i}`)) });
41
41
  });
42
+ PinInput.displayName = `PinInput`;
42
43
  export default PinInput;
@@ -19,4 +19,5 @@ const ProgressBar = forwardRef((props, ref) => {
19
19
  const { className, style, rest } = useBase(pops);
20
20
  return _jsx(Box, { className: `--progress flex rel ${className}`.trim(), style: style, ...rest, children: _jsx(Box, { ref: bar, className: `--bar rel` }) });
21
21
  });
22
+ ProgressBar.displayName = `ProgressBar`;
22
23
  export default ProgressBar;
@@ -15,4 +15,5 @@ const Radio = forwardRef((props, _ref) => {
15
15
  _setChecked(e.target.checked);
16
16
  } }), _jsx(Box, { className: `--dot rel`, children: _jsx(Box, { className: `--rod abs abc` }) }), _jsx(Box, { className: `--value`, children: children })] });
17
17
  });
18
+ Radio.displayName = `Radio`;
18
19
  export default Radio;
@@ -0,0 +1,5 @@
1
+ declare const ScrollView: import("react").ForwardRefExoticComponent<import("..").BoxProps & {
2
+ style?: import("react").CSSProperties;
3
+ speed?: number;
4
+ } & import("react").RefAttributes<HTMLDivElement>>;
5
+ export default ScrollView;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useBase, useScrollbar } from "../../hooks";
4
+ import Box from "../Box";
5
+ const ScrollView = forwardRef((props, ref) => {
6
+ const { speed, style: _style, ...pops } = props;
7
+ const { rootRef, containerRef, thumbY, thumbX, onScrollY, onScrollX } = useScrollbar();
8
+ const { style, className, rest } = useBase(pops);
9
+ // useEffect(() => { }, [])
10
+ return _jsxs(Box, { ref: rootRef, className: className.trim(), as: `--scrollview rel`, children: [_jsx(Box, { as: `--scroll-content`, ref: containerRef, style: _style || {}, children: rest.children }), _jsx(Box, { as: `--scroll-track --track-y abs`, children: _jsx(Box, { as: `--scroll-thumb abs`, ref: thumbY, onMouseDown: onScrollY }) }), _jsx(Box, { as: `--scroll-track --track-x abs`, children: _jsx(Box, { as: `--scroll-thumb abs`, ref: thumbX, onMouseDown: onScrollX }) })] });
11
+ });
12
+ ScrollView.displayName = `ZuzUI.ScrollView`;
13
+ export default ScrollView;
@@ -0,0 +1,6 @@
1
+ import { CSSProperties } from "react";
2
+ import { BoxProps } from "../Box";
3
+ export type ScrollViewProps = BoxProps & {
4
+ style?: CSSProperties;
5
+ speed?: number;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,18 +1,15 @@
1
- import { InputProps } from '../Input';
2
- import { Size } from '../../types/enums';
3
- export type SearchProps = InputProps & {
4
- onSubmit?: (value: string) => void;
5
- onChange?: (value: string) => void;
6
- withStyle?: string;
7
- };
1
+ import { Variant } from '../../types/enums';
2
+ import { SearchHandler } from './types';
8
3
  declare const Search: import("react").ForwardRefExoticComponent<import("../..").ZuzProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, keyof import("../..").ZuzProps> & {
9
4
  numeric?: boolean;
10
- size?: Size;
11
- variant?: import("../..").Variant;
5
+ size?: import("../..").Size;
6
+ variant?: Variant;
12
7
  with?: import("../..").FORMVALIDATION;
13
8
  } & {
14
9
  onSubmit?: (value: string) => void;
15
10
  onChange?: (value: string) => void;
16
11
  withStyle?: string;
17
- } & import("react").RefAttributes<HTMLInputElement>>;
12
+ shortcut?: import("..").KeyCombination;
13
+ reverse?: boolean;
14
+ } & import("react").RefAttributes<SearchHandler>>;
18
15
  export default Search;
@@ -1,16 +1,17 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { forwardRef, useEffect, useRef, useState } from 'react';
3
+ import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
4
4
  import { useBase } from '../../hooks';
5
- import Input from '../Input';
5
+ import { Variant } from '../../types/enums';
6
6
  import Box from '../Box';
7
7
  import Button from '../Button';
8
+ import Input from '../Input';
9
+ import KeyBoardKeys from '../KeyboardKeys';
8
10
  import SVGIcons from '../svgicons';
9
- import { Size } from '../../types/enums';
10
11
  const Search = forwardRef((props, ref) => {
11
- const { animate, withStyle, onChange, ...pops } = props;
12
- const { style } = useBase(pops);
13
- const { className: searchStyle } = useBase({ as: withStyle || `` });
12
+ const { fx, animate, withStyle, as, reverse, onChange, ...pops } = props;
13
+ const { style, className } = useBase({ as: props.as });
14
+ // const { className : searchStyle } = useBase({ as: withStyle || `` } as Props<`div`>)
14
15
  const [query, setQuery] = useState(``);
15
16
  const innerRef = useRef(null);
16
17
  if (`type` in props) {
@@ -31,7 +32,11 @@ const Search = forwardRef((props, ref) => {
31
32
  }
32
33
  // onSubmit?.(query)
33
34
  };
35
+ useImperativeHandle(ref, () => ({
36
+ focus: () => innerRef.current?.focus()
37
+ }));
34
38
  useEffect(() => { }, []);
35
- return _jsxs(Box, { style: style, className: `--search --${props.size || Size.Small} flex aic rel ${searchStyle}`.trim(), children: [_jsx(Input, { ref: innerRef, onChange: handleChange, className: `--${props.size || Size.Small}`, ...pops }), _jsx(Button, { tabIndex: -1, onClick: e => handleSubmit(), className: `--send flex aic jcc abs`, size: props.size || Size.Small, children: query !== `` ? SVGIcons.close : SVGIcons.search })] });
39
+ return _jsxs(Box, { style: style, className: `--search ${reverse ? `--search-rev` : ``} --${props.variant || Variant.Small} flex aic ${props.as?.includes(`abs`) ? `` : `rel`} ${className}`.trim(), children: [reverse && _jsx(Button, { tabIndex: -1, onClick: e => handleSubmit(), className: `--send flex aic jcc`, variant: props.variant || Variant.Small, children: query !== `` ? SVGIcons.close : SVGIcons.search }), _jsx(Input, { ref: innerRef, onChange: handleChange, className: `--${props.variant || Variant.Small}`, ...pops }), props.shortcut && _jsx(KeyBoardKeys, { keys: props.shortcut, as: `abs` }), !reverse && _jsx(Button, { tabIndex: -1, onClick: e => handleSubmit(), className: `--send flex aic jcc`, variant: props.variant || Variant.Small, children: query !== `` ? SVGIcons.close : SVGIcons.search })] });
36
40
  });
41
+ Search.displayName = `Search`;
37
42
  export default Search;
@@ -0,0 +1,12 @@
1
+ import { KeyCombination } from "../..";
2
+ import { InputProps } from "../Input";
3
+ export type SearchProps = InputProps & {
4
+ onSubmit?: (value: string) => void;
5
+ onChange?: (value: string) => void;
6
+ withStyle?: string;
7
+ shortcut?: KeyCombination;
8
+ reverse?: boolean;
9
+ };
10
+ export interface SearchHandler {
11
+ focus: () => void;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { Size } from "../../types/enums";
1
+ import { Variant } from "../../types/enums";
2
2
  import { BoxProps } from "../Box";
3
3
  import { Segment } from "./types";
4
4
  /**
@@ -20,7 +20,8 @@ import { Segment } from "./types";
20
20
  * <SelectTabs selected={1} items={segments} />
21
21
  */
22
22
  declare const Segmented: import("react").ForwardRefExoticComponent<BoxProps & {
23
- size?: Size;
23
+ size?: import("../..").Size;
24
+ variant?: Variant;
24
25
  selected?: number;
25
26
  onSwitch?: (segment: Segment) => void;
26
27
  items: Segment[];
@@ -1,8 +1,8 @@
1
- "use client";
1
+ 'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { forwardRef, useEffect, useRef, useState } from "react";
4
4
  import { useBase } from "../../hooks";
5
- import { Size } from "../../types/enums";
5
+ import { Variant } from "../../types/enums";
6
6
  import Box from "../Box";
7
7
  import SegmentItem from "./item";
8
8
  /**
@@ -24,7 +24,7 @@ import SegmentItem from "./item";
24
24
  * <SelectTabs selected={1} items={segments} />
25
25
  */
26
26
  const Segmented = forwardRef((props, ref) => {
27
- const { animate, fx, items, selected, size, onSwitch, ...pops } = props;
27
+ const { animate, fx, items, selected, size, variant, onSwitch, ...pops } = props;
28
28
  const [_selected, setSelected] = useState(selected || 0);
29
29
  const { className, style, rest } = useBase(pops);
30
30
  const _tab = useRef(null);
@@ -38,7 +38,7 @@ const Segmented = forwardRef((props, ref) => {
38
38
  */
39
39
  const handleSelect = (index, width, x, meta, force) => {
40
40
  // console.log(selected, _selected, index, mounted)
41
- if (force || _selected != index) {
41
+ if (force || (_selected != index && _selected != -2)) {
42
42
  setSelected(index);
43
43
  if (onSwitch)
44
44
  onSwitch(meta);
@@ -54,9 +54,10 @@ const Segmented = forwardRef((props, ref) => {
54
54
  setSelected(selected);
55
55
  }
56
56
  }, [selected, _selected]);
57
- return _jsxs(Box, { suppressHydrationWarning: true, ref: _segmented, "data-selected": _selected, className: `${className} --segmented --${size || Size.Small} flex aic rel`, style: style, ...rest, children: [_jsx(Box, { ref: _tab, className: `--segment-tab abs` }), items.map((item, i) => _jsx(SegmentItem, { onSelect: handleSelect, selected: _selected == i, meta: {
57
+ return _jsxs(Box, { ref: _segmented, "data-selected": _selected, className: `${className} --segmented --${variant || Variant.Small} flex aic rel`, style: style, ...rest, children: [_jsx(Box, { ref: _tab, className: `--segment-tab abs` }), items.map((item, i) => _jsx(SegmentItem, { onSelect: handleSelect, selected: _selected == i, meta: {
58
58
  ...item,
59
59
  index: i
60
60
  } }, `segment-${item.label}-${i}`))] });
61
61
  });
62
+ Segmented.displayName = `ZuzUI.SelectTabs`;
62
63
  export default Segmented;
@@ -1,3 +1,6 @@
1
1
  import { SegmentItemProps } from "./types";
2
- declare const SegmentItem: ({ onSelect, meta, selected }: SegmentItemProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const SegmentItem: {
3
+ ({ onSelect, meta, selected }: SegmentItemProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
3
6
  export default SegmentItem;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useRef, useState } from "react";
2
+ import { useEffect, useLayoutEffect, useRef, useState } from "react";
3
+ import { useDelayed } from "../../hooks";
3
4
  import Box from "../Box";
4
5
  import Button from "../Button";
5
6
  import Icon from "../Icon";
@@ -7,32 +8,33 @@ const SegmentItem = ({ onSelect, meta, selected }) => {
7
8
  const ref = useRef(null);
8
9
  const { index, icon, label } = meta;
9
10
  const [pos, setPos] = useState({ x: 0, width: 0 });
10
- // const [ _selected, setSelected ] = useState(selected)
11
- useEffect(() => {
12
- if (ref.current) {
11
+ const hydrated = useDelayed();
12
+ // const observer = useResizeObserver(ref)
13
+ useLayoutEffect(() => {
14
+ if (hydrated && ref.current) {
13
15
  const { width, x } = ref.current.getBoundingClientRect();
16
+ // const { width, left } = observer
17
+ // console.log(pos, { x: left, width })
14
18
  setPos({ x, width });
15
19
  if (selected) {
16
20
  onSelect(index, width, x, meta, true);
17
- // setSelected(meta.index)
18
21
  }
19
- // if ( selected && !_initial ){
20
- // ref.current.click()
21
- // setInitial(true)
22
+ // else if ( pos.x != left || pos.width != width ){
23
+ // // console.log(`re-triggered`)
24
+ // setPos({ x: left, width })
25
+ // onSelect(-2, width, left, meta, false)
22
26
  // }
27
+ // console.log(`hydrated`, index, width, x, observer)
23
28
  }
24
- // else
25
- // setInitial(false)
26
- }, [ref.current]);
29
+ }, [hydrated, ref.current]);
27
30
  useEffect(() => {
28
31
  if (selected) {
29
32
  onSelect(index, pos.width, pos.x, meta, false);
30
33
  }
31
34
  }, [selected]);
32
- return _jsxs(Button, { onClick: () => onSelect(index, pos.width, pos.x, meta, false), ref: ref,
33
- // data-x={pos.x}
34
- suppressHydrationWarning: true, className: `--segment-item flex aic rel ${selected ? `--segement-active` : ``}`.trim(), children: [icon ?
35
+ return _jsxs(Button, { onClick: () => onSelect(index, pos.width, pos.x, meta, false), ref: ref, className: `--segment-item flex aic rel ${selected ? `--segment-active` : ``}`.trim(), children: [icon ?
35
36
  `string` == typeof icon ? _jsx(Icon, { name: icon, as: `--segment-icon` }) : _jsx(Box, { as: `--segment-icon flex aic jcc`, children: icon })
36
37
  : null, label && String(label).trim() != `` && _jsx(Box, { className: `--segment-label`, children: label || `Item ${index}` })] });
37
38
  };
39
+ SegmentItem.displayName = `SelectTabItem`;
38
40
  export default SegmentItem;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from "react";
2
+ import { Size, Variant } from "../../types/enums";
2
3
  import { BoxProps } from "../Box";
3
- import { Size } from "../../types/enums";
4
4
  /**
5
5
  * Individual segment in the `SelectTabs` component.
6
6
  * @typedef {Object} Segment
@@ -22,7 +22,11 @@ export interface Segment {
22
22
  * @property {Segment[]} items - Array of segments to display.
23
23
  */
24
24
  export type SegmentProps = BoxProps & {
25
+ /**
26
+ * @deprecated use variant
27
+ */
25
28
  size?: Size;
29
+ variant?: Variant;
26
30
  selected?: number;
27
31
  onSwitch?: (segment: Segment) => void;
28
32
  items: Segment[];
@@ -1,8 +1,6 @@
1
- import { FORMVALIDATION } from "../../types/enums";
2
- import { BoxProps } from "../Box";
3
1
  import { Option } from "./types";
4
- declare const Select: import("react").ForwardRefExoticComponent<BoxProps & {
5
- required?: FORMVALIDATION;
2
+ declare const Select: import("react").ForwardRefExoticComponent<Omit<import("..").BoxProps, "onChange"> & {
3
+ required?: import("../..").FORMVALIDATION;
6
4
  options: Option[];
7
5
  label?: string;
8
6
  selected?: string | Option;
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { forwardRef, useEffect, useId, useMemo, useRef, useState } from "react";
4
- import SVGIcons from "../svgicons";
5
- import Box from "../Box";
6
4
  import { useBase } from "../../hooks";
5
+ import Box from "../Box";
7
6
  import Button from "../Button";
8
- import Text from "../Text";
9
7
  import Input from "../Input";
8
+ import SVGIcons from "../svgicons";
9
+ import Text from "../Text";
10
10
  import OptionItem from "./optionItem";
11
11
  const Select = forwardRef((props, ref) => {
12
12
  const { selected, options, label, name, search: withSearch, searchPlaceholder, onChange, ...pops } = props;
@@ -58,4 +58,5 @@ const Select = forwardRef((props, ref) => {
58
58
  }))
59
59
  .map((o) => _jsx(OptionItem, { updateValue: updateValue, value: value, o: o }, `option-${(`string` == typeof o ? o : o.label).replace(/\s+/g, `-`)}-${`string` == typeof o ? o : o.value}`))] })] });
60
60
  });
61
+ Select.displayName = `Select`;
61
62
  export default Select;
@@ -1,3 +1,6 @@
1
1
  import { OptionItemProps } from "./types";
2
- declare const OptionItem: ({ value, updateValue, o }: OptionItemProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const OptionItem: {
3
+ ({ value, updateValue, o }: OptionItemProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
3
6
  export default OptionItem;
@@ -3,4 +3,5 @@ import Button from "../Button";
3
3
  const OptionItem = ({ value, updateValue, o }) => {
4
4
  return _jsx(Button, { onClick: (e) => updateValue(o), className: value && (`string` == typeof o ? o : o.value) == (`string` == typeof value ? value : value.value) ? `selected` : ``, children: `string` == typeof o ? o : o.label });
5
5
  };
6
+ OptionItem.displayName = `Option`;
6
7
  export default OptionItem;
@@ -20,7 +20,7 @@ export interface OptionItemProps {
20
20
  /**
21
21
  * Props for the Select component.
22
22
  */
23
- export type SelectProps = BoxProps & {
23
+ export type SelectProps = Omit<BoxProps, "onChange"> & {
24
24
  /**
25
25
  * Indicates if the select field is required and its validation type.
26
26
  */
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from "react";
2
- import { SHEET, SHEET_ACTION_POSITION, SPINNER, TRANSITION_CURVES, TRANSITIONS } from "../../types/enums";
3
2
  import { ZuzProps } from "../../types";
3
+ import { SHEET, SHEET_ACTION_POSITION, SPINNER, TRANSITION_CURVES, TRANSITIONS } from "../../types/enums";
4
4
  export type SheetProps = ZuzProps & {
5
5
  title?: string;
6
6
  message?: string | ReactNode;
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
4
- import { SHEET, SHEET_ACTION_POSITION, TRANSITION_CURVES } from "../../types/enums";
5
- import Box from "../Box";
6
- import { useBase } from "../../hooks";
7
4
  import { uuid } from "../../funs";
8
5
  import { animationTransition } from "../../funs/css";
6
+ import { useBase } from "../../hooks";
7
+ import { SHEET, SHEET_ACTION_POSITION, TRANSITION_CURVES } from "../../types/enums";
8
+ import Box from "../Box";
9
9
  import Button from "../Button";
10
10
  import Cover from "../Cover";
11
11
  import Overlay from "../Overlay";
@@ -138,10 +138,13 @@ const Sheet = forwardRef((props, ref) => {
138
138
  };
139
139
  if (sheetType == SHEET.Dialog) {
140
140
  if (transition) {
141
- const { from, to } = animationTransition(transition);
141
+ const { from, to } = animationTransition(transition, 20, true);
142
142
  return {
143
- from: { ...from, x: `-50%`, y: `-50%` },
144
- to: { ...to, x: `-50%`, y: `-50%` },
143
+ // from: { ...from, x: `-50%`, y: `-50%` },
144
+ // to: { ...to, x: `-50%`, y: `-50%` },
145
+ // from: { ...from, x: `-50%` },
146
+ // to: { ...to, x: `-50%` },
147
+ from, to,
145
148
  curve: curve || TRANSITION_CURVES.EaseInOut,
146
149
  ...base
147
150
  };
@@ -173,9 +176,9 @@ const Sheet = forwardRef((props, ref) => {
173
176
  }
174
177
  }, [visible]);
175
178
  if (sheetType == SHEET.Dialog) {
176
- return _jsxs(_Fragment, { children: [_jsx(Overlay, { when: visible }), _jsxs(Box, { className: `--sheet --sheet-${sheetType.toLowerCase()} ${className} fixed`.trim(), style: style, animate: buildAnimation, ...rest, ref: innerRef, children: [_jsx(Cover, { when: loading, spinner: spinner, message: loadingMessage }), _jsxs(Box, { className: `--head flex aic rel`, children: [_jsx(Box, { className: `--${title ? `title` : `dot`} flex aic rel`, children: title || `` }), _jsx(Button, { onClick: (e) => setVisible(false), className: `--closer abs`, children: "\u00D7" })] }), _jsx(Box, { className: `--body flex aic rel ${action ? `` : `--no-action`}`.trim(), children: render ? renderMessage : null }), action && _jsx(Box, { className: `--footer flex aic rel ${actionPosition ? actionPosition == SHEET_ACTION_POSITION.Center ? `jcc` : `` : `jce`}`.trim(), children: action.map((a, i) => _jsx(Button, { onClick: (e) => a.handler ? a.handler() : a.onClick ? a.onClick() : console.log(`onClick Handler missing`), className: `--action`, children: a.label }, `sheet-${sheetID}-action-${a.key}`)) })] })] });
179
+ return _jsxs(_Fragment, { children: [_jsx(Overlay, { when: visible }), _jsxs(Box, { className: `--sheet --sheet-${sheetType.toLowerCase()} ${className} fixed`.trim(), style: style, fx: buildAnimation, ...rest, ref: innerRef, children: [_jsx(Cover, { when: loading, spinner: spinner, message: loadingMessage }), _jsxs(Box, { className: `--head flex aic rel`, children: [_jsx(Box, { className: `--${title ? `title` : `dot`} flex aic rel`, children: title || `` }), _jsx(Button, { onClick: (e) => setVisible(false), className: `--closer abs`, children: "\u00D7" })] }), _jsx(Box, { className: `--body flex aic rel ${action ? `` : `--no-action`}`.trim(), children: render ? renderMessage : null }), action && _jsx(Box, { className: `--footer flex aic rel ${actionPosition ? actionPosition == SHEET_ACTION_POSITION.Center ? `jcc` : `` : `jce`}`.trim(), children: action.map((a, i) => _jsx(Button, { onClick: (e) => a.handler ? a.handler() : a.onClick ? a.onClick() : console.log(`onClick Handler missing`), className: `--action`, children: a.label }, `sheet-${sheetID}-action-${a.key}`)) })] })] });
177
180
  }
178
- return _jsx(Box, { className: `--sheet --sheet-${sheetType.toLowerCase()} ${className} abs`.trim(), style: style, ...rest, animate: buildAnimation, ref: innerRef, children: visible ? msg : null });
181
+ return _jsx(Box, { className: `--sheet --sheet-${sheetType.toLowerCase()} ${className} abs`.trim(), style: style, ...rest, fx: buildAnimation, ref: innerRef, children: visible ? msg : null });
179
182
  });
180
183
  export const isSheetHandler = (src) => {
181
184
  return typeof src === `object`
@@ -184,4 +187,5 @@ export const isSheetHandler = (src) => {
184
187
  && `success` in src
185
188
  && `error` in src;
186
189
  };
190
+ Sheet.displayName = `Sheet`;
187
191
  export default Sheet;
@@ -5,4 +5,5 @@ const Sidebar = forwardRef((props, ref) => {
5
5
  const { layout, logo } = props;
6
6
  return _jsxs(Box, { ref: ref, className: `--sidebar --${layout || `2-columns`} flex cols`, children: [_jsx(Box, { as: `--logo`, children: logo }), _jsx(Box, { as: `--nav flex cols` })] });
7
7
  });
8
+ Sidebar.displayName = `Sidebar`;
8
9
  export default Sidebar;
@@ -1,5 +1,5 @@
1
- import { BoxProps } from "../Box";
2
1
  import { SLIDER } from "../../types/enums";
2
+ import { BoxProps } from "../Box";
3
3
  export type SliderProps = BoxProps & {
4
4
  type?: SLIDER;
5
5
  value?: number;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { forwardRef, useEffect, useRef, useState } from "react";
4
- import Box from "../Box";
5
- import { SLIDER } from "../../types/enums";
6
4
  import { useBase } from "../../hooks";
5
+ import { SLIDER } from "../../types/enums";
6
+ import Box from "../Box";
7
7
  import Input from "../Input";
8
8
  import Text from "../Text";
9
9
  const Slider = forwardRef((props, ref) => {
@@ -78,4 +78,5 @@ const Slider = forwardRef((props, ref) => {
78
78
  }, [isDragging]);
79
79
  return _jsx(Box, { ref: slider, "data-value": value || 0, className: `--slider --${type || SLIDER.Default} flex rel ${className}`.trim(), style: { ...style }, children: SLIDER.Text === type ? _jsx(_Fragment, { children: _jsx(Text, { ref: text, onMouseDown: handleMouseDown, className: `--slider-text`, children: value || 0 }) }) : _jsxs(_Fragment, { children: [_jsx(Box, { ref: track, className: `--slider-track abs fill` }), _jsx(Box, { ref: knob, className: `--slider-knob abs` }), _jsx(Input, { ref: input, onInput: handleInput, className: `abs fill`, tabIndex: 0, type: type || SLIDER.Default, defaultValue: value || 0, step: step, max: max, min: min })] }) });
80
80
  });
81
+ Slider.displayName = `Slider`;
81
82
  export default Slider;
@@ -7,4 +7,5 @@ const Span = forwardRef((props, ref) => {
7
7
  const { style: _style, className, rest } = useBase(pops);
8
8
  return _jsx("span", { ref: ref, style: style, className: className, ...rest });
9
9
  });
10
+ Span.displayName = `Span`;
10
11
  export default Span;
@@ -1,5 +1,5 @@
1
- import { BoxProps } from "../Box";
2
1
  import { Size, SPINNER } from "../../types/enums";
2
+ import { BoxProps } from "../Box";
3
3
  export type SpinnerProps = BoxProps & {
4
4
  type?: SPINNER;
5
5
  size?: Size | number;
@@ -1,10 +1,9 @@
1
- "use client";
2
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  import { forwardRef } from "react";
4
- import Box from "../Box";
5
- import { Size, SPINNER } from "../../types/enums";
6
- import { useBase } from "../../hooks";
7
3
  import { hexToRgba } from "../../funs";
4
+ import { useBase } from "../../hooks";
5
+ import { Size, SPINNER } from "../../types/enums";
6
+ import Box from "../Box";
8
7
  const Spinner = forwardRef((props, ref) => {
9
8
  const { type, size, width, speed, color, background, foreground, ...pops } = props;
10
9
  const defaultColor = `#000000`;
@@ -39,13 +38,10 @@ const Spinner = forwardRef((props, ref) => {
39
38
  switch (type || SPINNER.Simple) {
40
39
  case SPINNER.Simple:
41
40
  return null;
42
- break;
43
41
  case SPINNER.Wave:
44
42
  return _jsxs(_Fragment, { children: [_jsx(Box, { as: `--dot --dot-1` }), _jsx(Box, { as: `--dot --dot-2` }), _jsx(Box, { as: `--dot --dot-3` })] });
45
- break;
46
43
  case SPINNER.Roller:
47
44
  return null;
48
- break;
49
45
  }
50
46
  };
51
47
  return _jsx(Box, { className: `${className} --spinner --${(type || SPINNER.Simple).toLowerCase()} --${size || Size.Default}`.trim(), style: {
@@ -53,4 +49,5 @@ const Spinner = forwardRef((props, ref) => {
53
49
  ...build()
54
50
  }, ...rest, children: child() });
55
51
  });
52
+ Spinner.displayName = `ZuzUI.Spinner`;
56
53
  export default Spinner;