@akanjs/ui 0.0.149 → 0.0.151

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 (405) hide show
  1. package/BottomSheet.d.ts +13 -0
  2. package/Button.d.ts +9 -0
  3. package/ClientSide.d.ts +6 -0
  4. package/Copy.d.ts +6 -0
  5. package/CsrImage.d.ts +11 -0
  6. package/Data/CardList.d.ts +36 -0
  7. package/Data/Dashboard.d.ts +15 -0
  8. package/Data/Insight.d.ts +8 -0
  9. package/Data/Item.d.ts +74 -0
  10. package/Data/ListContainer.d.ts +38 -0
  11. package/Data/Pagination.d.ts +6 -0
  12. package/Data/QueryMaker.d.ts +9 -0
  13. package/Data/TableList.d.ts +26 -0
  14. package/Data/index.d.ts +10 -0
  15. package/Data/index_.d.ts +8 -0
  16. package/DatePicker.d.ts +38 -0
  17. package/Dialog/Action.d.ts +5 -0
  18. package/Dialog/Close.d.ts +5 -0
  19. package/Dialog/Content.d.ts +6 -0
  20. package/Dialog/Modal.d.ts +8 -0
  21. package/Dialog/Provider.d.ts +7 -0
  22. package/Dialog/Title.d.ts +5 -0
  23. package/Dialog/Trigger.d.ts +5 -0
  24. package/Dialog/context.d.ts +10 -0
  25. package/Dialog/index.d.ts +9 -0
  26. package/DragAction.d.ts +24 -0
  27. package/DraggableList.d.ts +25 -0
  28. package/Dropdown.d.ts +10 -0
  29. package/Empty.d.ts +9 -0
  30. package/Field.d.ts +404 -0
  31. package/FontFace.d.ts +6 -0
  32. package/Image.d.ts +17 -0
  33. package/InfiniteScroll.d.ts +10 -0
  34. package/Input.d.ts +85 -0
  35. package/KeyboardAvoiding.d.ts +7 -0
  36. package/Layout/BottomAction.d.ts +5 -0
  37. package/Layout/BottomInset.d.ts +6 -0
  38. package/Layout/BottomTab.d.ts +14 -0
  39. package/Layout/Header.d.ts +7 -0
  40. package/Layout/LeftSider.d.ts +8 -0
  41. package/Layout/Navbar.d.ts +11 -0
  42. package/Layout/RightSider.d.ts +9 -0
  43. package/Layout/Sider.d.ts +6 -0
  44. package/Layout/Template.d.ts +5 -0
  45. package/Layout/TopLeftAction.d.ts +5 -0
  46. package/Layout/Unit.d.ts +6 -0
  47. package/Layout/View.d.ts +5 -0
  48. package/Layout/Zone.d.ts +5 -0
  49. package/Layout/index.d.ts +14 -0
  50. package/Link/Back.d.ts +6 -0
  51. package/Link/Close.d.ts +6 -0
  52. package/Link/CsrLink.d.ts +2 -0
  53. package/Link/NextLink.d.ts +2 -0
  54. package/Link/index.d.ts +8 -0
  55. package/Link/types.d.ts +22 -0
  56. package/Load/Edit.d.ts +4 -0
  57. package/Load/Edit_Client.d.ts +25 -0
  58. package/Load/Page.d.ts +10 -0
  59. package/Load/PageCSR.d.ts +11 -0
  60. package/Load/Pagination.d.ts +8 -0
  61. package/Load/Units.d.ts +34 -0
  62. package/Load/View.d.ts +17 -0
  63. package/Load/index.d.ts +8 -0
  64. package/Load/index_.d.ts +3 -0
  65. package/Loading/Area.d.ts +1 -0
  66. package/Loading/Button.d.ts +7 -0
  67. package/Loading/Input.d.ts +7 -0
  68. package/Loading/ProgressBar.d.ts +6 -0
  69. package/Loading/Skeleton.d.ts +7 -0
  70. package/Loading/Spin.d.ts +7 -0
  71. package/Loading/index.d.ts +8 -0
  72. package/Menu.d.ts +26 -0
  73. package/Modal.d.ts +23 -0
  74. package/Model/Edit.d.ts +15 -0
  75. package/Model/EditModal.d.ts +33 -0
  76. package/Model/EditWrapper.d.ts +11 -0
  77. package/Model/LoadInit.d.ts +10 -0
  78. package/Model/New.d.ts +15 -0
  79. package/Model/NewWrapper.d.ts +12 -0
  80. package/Model/NewWrapper_Client.d.ts +12 -0
  81. package/Model/Remove.d.ts +10 -0
  82. package/Model/RemoveWrapper.d.ts +11 -0
  83. package/Model/SureToRemove.d.ts +10 -0
  84. package/Model/View.d.ts +19 -0
  85. package/Model/ViewEditModal.d.ts +11 -0
  86. package/Model/ViewModal.d.ts +13 -0
  87. package/Model/ViewWrapper.d.ts +11 -0
  88. package/Model/index.d.ts +15 -0
  89. package/Model/index_.d.ts +13 -0
  90. package/More.d.ts +12 -0
  91. package/ObjectId.d.ts +5 -0
  92. package/Pagination.d.ts +14 -0
  93. package/Popconfirm.d.ts +18 -0
  94. package/Portal.d.ts +6 -0
  95. package/Radio.d.ts +19 -0
  96. package/RecentTime.d.ts +7 -0
  97. package/Refresh.d.ts +7 -0
  98. package/ScreenNavigator.d.ts +18 -0
  99. package/Select.d.ts +29 -0
  100. package/Signal/Arg.d.ts +75 -0
  101. package/Signal/Doc.d.ts +19 -0
  102. package/Signal/GraphQL.d.ts +32 -0
  103. package/Signal/Listener.d.ts +9 -0
  104. package/Signal/Message.d.ts +27 -0
  105. package/Signal/Object.d.ts +19 -0
  106. package/Signal/PubSub.d.ts +26 -0
  107. package/Signal/Request.d.ts +8 -0
  108. package/Signal/Response.d.ts +16 -0
  109. package/Signal/RestApi.d.ts +40 -0
  110. package/Signal/WebSocket.d.ts +9 -0
  111. package/Signal/index.d.ts +20 -0
  112. package/System/CSR.d.ts +31 -0
  113. package/System/Client.d.ts +48 -0
  114. package/System/Common.d.ts +66 -0
  115. package/System/DevModeToggle.d.ts +1 -0
  116. package/System/Gtag.d.ts +3 -0
  117. package/System/HealthCheck.d.ts +5 -0
  118. package/System/Messages.d.ts +1 -0
  119. package/System/Reconnect.d.ts +6 -0
  120. package/System/Root.d.ts +5 -0
  121. package/System/SSR.d.ts +26 -0
  122. package/System/SelectLanguage.d.ts +5 -0
  123. package/System/ThemeToggle.d.ts +1 -0
  124. package/System/index.d.ts +11 -0
  125. package/Tab/Menu.d.ts +11 -0
  126. package/Tab/Menus.d.ts +5 -0
  127. package/Tab/Panel.d.ts +7 -0
  128. package/Tab/Provider.d.ts +6 -0
  129. package/Tab/context.d.ts +9 -0
  130. package/Tab/index.d.ts +7 -0
  131. package/Table.d.ts +26 -0
  132. package/ToggleSelect.d.ts +31 -0
  133. package/Unauthorized.d.ts +9 -0
  134. package/cjs/BottomSheet.js +113 -0
  135. package/cjs/Button.js +69 -0
  136. package/cjs/ClientSide.js +26 -0
  137. package/cjs/Copy.js +37 -0
  138. package/cjs/CsrImage.js +50 -0
  139. package/cjs/Data/CardList.js +119 -0
  140. package/cjs/Data/Dashboard.js +54 -0
  141. package/cjs/Data/Insight.js +38 -0
  142. package/cjs/Data/Item.js +204 -0
  143. package/cjs/Data/ListContainer.js +251 -0
  144. package/cjs/Data/Pagination.js +64 -0
  145. package/cjs/Data/QueryMaker.js +304 -0
  146. package/cjs/Data/TableList.js +139 -0
  147. package/cjs/Data/index.js +33 -0
  148. package/cjs/Data/index_.js +49 -0
  149. package/cjs/DatePicker.js +173 -0
  150. package/cjs/Dialog/Action.js +32 -0
  151. package/cjs/Dialog/Close.js +38 -0
  152. package/cjs/Dialog/Content.js +27 -0
  153. package/cjs/Dialog/Modal.js +155 -0
  154. package/cjs/Dialog/Provider.js +46 -0
  155. package/cjs/Dialog/Title.js +32 -0
  156. package/cjs/Dialog/Trigger.js +38 -0
  157. package/cjs/Dialog/context.js +32 -0
  158. package/cjs/Dialog/index.js +36 -0
  159. package/cjs/DragAction.js +111 -0
  160. package/cjs/DraggableList.js +141 -0
  161. package/cjs/Dropdown.js +64 -0
  162. package/cjs/Empty.js +50 -0
  163. package/cjs/Field.js +1109 -0
  164. package/cjs/FontFace.js +77 -0
  165. package/cjs/Image.js +61 -0
  166. package/cjs/InfiniteScroll.js +65 -0
  167. package/cjs/Input.js +440 -0
  168. package/cjs/KeyboardAvoiding.js +65 -0
  169. package/cjs/Layout/BottomAction.js +26 -0
  170. package/cjs/Layout/BottomInset.js +53 -0
  171. package/cjs/Layout/BottomTab.js +56 -0
  172. package/cjs/Layout/Header.js +52 -0
  173. package/cjs/Layout/LeftSider.js +49 -0
  174. package/cjs/Layout/Navbar.js +51 -0
  175. package/cjs/Layout/RightSider.js +52 -0
  176. package/cjs/Layout/Sider.js +39 -0
  177. package/cjs/Layout/Template.js +26 -0
  178. package/cjs/Layout/TopLeftAction.js +39 -0
  179. package/cjs/Layout/Unit.js +27 -0
  180. package/cjs/Layout/View.js +26 -0
  181. package/cjs/Layout/Zone.js +26 -0
  182. package/cjs/Layout/index.js +48 -0
  183. package/cjs/Link/Back.js +27 -0
  184. package/cjs/Link/Close.js +36 -0
  185. package/cjs/Link/CsrLink.js +49 -0
  186. package/cjs/Link/NextLink.js +71 -0
  187. package/cjs/Link/index.js +47 -0
  188. package/cjs/Link/types.js +15 -0
  189. package/cjs/Load/Edit.js +42 -0
  190. package/cjs/Load/Edit_Client.js +93 -0
  191. package/cjs/Load/Page.js +35 -0
  192. package/cjs/Load/PageCSR.js +67 -0
  193. package/cjs/Load/Pagination.js +89 -0
  194. package/cjs/Load/Units.js +232 -0
  195. package/cjs/Load/View.js +88 -0
  196. package/cjs/Load/index.js +42 -0
  197. package/cjs/Load/index_.js +39 -0
  198. package/cjs/Loading/Area.js +25 -0
  199. package/cjs/Loading/Button.js +33 -0
  200. package/cjs/Loading/Input.js +33 -0
  201. package/cjs/Loading/ProgressBar.js +29 -0
  202. package/cjs/Loading/Skeleton.js +27 -0
  203. package/cjs/Loading/Spin.js +27 -0
  204. package/cjs/Loading/index.js +29 -0
  205. package/cjs/Menu.js +215 -0
  206. package/cjs/Modal.js +75 -0
  207. package/cjs/Model/Edit.js +61 -0
  208. package/cjs/Model/EditModal.js +255 -0
  209. package/cjs/Model/EditWrapper.js +48 -0
  210. package/cjs/Model/LoadInit.js +27 -0
  211. package/cjs/Model/New.js +61 -0
  212. package/cjs/Model/NewWrapper.js +28 -0
  213. package/cjs/Model/NewWrapper_Client.js +66 -0
  214. package/cjs/Model/Remove.js +86 -0
  215. package/cjs/Model/RemoveWrapper.js +48 -0
  216. package/cjs/Model/SureToRemove.js +109 -0
  217. package/cjs/Model/View.js +44 -0
  218. package/cjs/Model/ViewEditModal.js +118 -0
  219. package/cjs/Model/ViewModal.js +92 -0
  220. package/cjs/Model/ViewWrapper.js +48 -0
  221. package/cjs/Model/index.js +38 -0
  222. package/cjs/Model/index_.js +58 -0
  223. package/cjs/More.js +67 -0
  224. package/cjs/ObjectId.js +37 -0
  225. package/cjs/Pagination.js +110 -0
  226. package/cjs/Popconfirm.js +116 -0
  227. package/cjs/Portal.js +27 -0
  228. package/cjs/Radio.js +53 -0
  229. package/cjs/RecentTime.js +86 -0
  230. package/cjs/Refresh.js +45 -0
  231. package/cjs/ScreenNavigator.js +121 -0
  232. package/cjs/Select.js +262 -0
  233. package/cjs/Signal/Arg.js +237 -0
  234. package/cjs/Signal/Doc.js +181 -0
  235. package/cjs/Signal/GraphQL.js +177 -0
  236. package/cjs/Signal/Listener.js +59 -0
  237. package/cjs/Signal/Message.js +190 -0
  238. package/cjs/Signal/Object.js +95 -0
  239. package/cjs/Signal/PubSub.js +191 -0
  240. package/cjs/Signal/Request.js +38 -0
  241. package/cjs/Signal/Response.js +53 -0
  242. package/cjs/Signal/RestApi.js +255 -0
  243. package/cjs/Signal/WebSocket.js +68 -0
  244. package/cjs/Signal/index.js +42 -0
  245. package/cjs/System/CSR.js +376 -0
  246. package/cjs/System/Client.js +200 -0
  247. package/cjs/System/Common.js +64 -0
  248. package/cjs/System/DevModeToggle.js +38 -0
  249. package/cjs/System/Gtag.js +67 -0
  250. package/cjs/System/HealthCheck.js +60 -0
  251. package/cjs/System/Messages.js +170 -0
  252. package/cjs/System/Reconnect.js +64 -0
  253. package/cjs/System/Root.js +30 -0
  254. package/cjs/System/SSR.js +144 -0
  255. package/cjs/System/SelectLanguage.js +58 -0
  256. package/cjs/System/ThemeToggle.js +40 -0
  257. package/cjs/System/index.js +55 -0
  258. package/cjs/Tab/Menu.js +70 -0
  259. package/cjs/{src/index.js → Tab/Menus.js} +8 -5
  260. package/cjs/Tab/Panel.js +42 -0
  261. package/cjs/Tab/Provider.js +31 -0
  262. package/cjs/Tab/context.js +30 -0
  263. package/cjs/Tab/index.js +32 -0
  264. package/cjs/Table.js +85 -0
  265. package/cjs/ToggleSelect.js +118 -0
  266. package/cjs/Unauthorized.js +50 -0
  267. package/cjs/index.js +88 -2
  268. package/esm/BottomSheet.js +84 -0
  269. package/esm/Button.js +40 -0
  270. package/esm/ClientSide.js +7 -0
  271. package/esm/Copy.js +18 -0
  272. package/esm/CsrImage.js +31 -0
  273. package/esm/Data/CardList.js +90 -0
  274. package/esm/Data/Dashboard.js +35 -0
  275. package/esm/Data/Insight.js +19 -0
  276. package/esm/Data/Item.js +175 -0
  277. package/esm/Data/ListContainer.js +228 -0
  278. package/esm/Data/Pagination.js +45 -0
  279. package/esm/Data/QueryMaker.js +293 -0
  280. package/esm/Data/TableList.js +110 -0
  281. package/esm/Data/index.js +14 -0
  282. package/esm/Data/index_.js +20 -0
  283. package/esm/DatePicker.js +144 -0
  284. package/esm/Dialog/Action.js +13 -0
  285. package/esm/Dialog/Close.js +19 -0
  286. package/esm/Dialog/Content.js +8 -0
  287. package/esm/Dialog/Modal.js +126 -0
  288. package/esm/Dialog/Provider.js +17 -0
  289. package/esm/Dialog/Title.js +13 -0
  290. package/esm/Dialog/Trigger.js +19 -0
  291. package/esm/Dialog/context.js +13 -0
  292. package/esm/Dialog/index.js +17 -0
  293. package/esm/DragAction.js +92 -0
  294. package/esm/DraggableList.js +112 -0
  295. package/esm/Dropdown.js +45 -0
  296. package/esm/Empty.js +21 -0
  297. package/esm/Field.js +1090 -0
  298. package/esm/FontFace.js +58 -0
  299. package/esm/Image.js +32 -0
  300. package/esm/InfiniteScroll.js +46 -0
  301. package/esm/Input.js +415 -0
  302. package/esm/KeyboardAvoiding.js +46 -0
  303. package/esm/Layout/BottomAction.js +7 -0
  304. package/esm/Layout/BottomInset.js +34 -0
  305. package/esm/Layout/BottomTab.js +37 -0
  306. package/esm/Layout/Header.js +33 -0
  307. package/esm/Layout/LeftSider.js +30 -0
  308. package/esm/Layout/Navbar.js +22 -0
  309. package/esm/Layout/RightSider.js +33 -0
  310. package/esm/Layout/Sider.js +20 -0
  311. package/esm/Layout/Template.js +7 -0
  312. package/esm/Layout/TopLeftAction.js +20 -0
  313. package/esm/Layout/Unit.js +8 -0
  314. package/esm/Layout/View.js +7 -0
  315. package/esm/Layout/Zone.js +7 -0
  316. package/esm/Layout/index.js +29 -0
  317. package/esm/Link/Back.js +8 -0
  318. package/esm/Link/Close.js +17 -0
  319. package/esm/Link/CsrLink.js +30 -0
  320. package/esm/Link/NextLink.js +42 -0
  321. package/esm/Link/index.js +18 -0
  322. package/esm/Link/types.js +0 -0
  323. package/esm/Load/Edit.js +13 -0
  324. package/esm/Load/Edit_Client.js +74 -0
  325. package/esm/Load/Page.js +16 -0
  326. package/esm/Load/PageCSR.js +48 -0
  327. package/esm/Load/Pagination.js +70 -0
  328. package/esm/Load/Units.js +213 -0
  329. package/esm/Load/View.js +69 -0
  330. package/esm/Load/index.js +13 -0
  331. package/esm/Load/index_.js +10 -0
  332. package/esm/Loading/Area.js +6 -0
  333. package/esm/Loading/Button.js +14 -0
  334. package/esm/Loading/Input.js +14 -0
  335. package/esm/Loading/ProgressBar.js +10 -0
  336. package/esm/Loading/Skeleton.js +8 -0
  337. package/esm/Loading/Spin.js +8 -0
  338. package/esm/Loading/index.js +10 -0
  339. package/esm/Menu.js +196 -0
  340. package/esm/Modal.js +46 -0
  341. package/esm/Model/Edit.js +32 -0
  342. package/esm/Model/EditModal.js +226 -0
  343. package/esm/Model/EditWrapper.js +29 -0
  344. package/esm/Model/LoadInit.js +8 -0
  345. package/esm/Model/New.js +32 -0
  346. package/esm/Model/NewWrapper.js +9 -0
  347. package/esm/Model/NewWrapper_Client.js +47 -0
  348. package/esm/Model/Remove.js +67 -0
  349. package/esm/Model/RemoveWrapper.js +29 -0
  350. package/esm/Model/SureToRemove.js +90 -0
  351. package/esm/Model/View.js +25 -0
  352. package/esm/Model/ViewEditModal.js +89 -0
  353. package/esm/Model/ViewModal.js +63 -0
  354. package/esm/Model/ViewWrapper.js +29 -0
  355. package/esm/Model/index.js +33 -0
  356. package/esm/Model/index_.js +29 -0
  357. package/esm/More.js +38 -0
  358. package/esm/ObjectId.js +18 -0
  359. package/esm/Pagination.js +91 -0
  360. package/esm/Popconfirm.js +87 -0
  361. package/esm/Portal.js +8 -0
  362. package/esm/Radio.js +34 -0
  363. package/esm/RecentTime.js +57 -0
  364. package/esm/Refresh.js +16 -0
  365. package/esm/ScreenNavigator.js +102 -0
  366. package/esm/Select.js +243 -0
  367. package/esm/Signal/Arg.js +208 -0
  368. package/esm/Signal/Doc.js +152 -0
  369. package/esm/Signal/GraphQL.js +156 -0
  370. package/esm/Signal/Listener.js +40 -0
  371. package/esm/Signal/Message.js +161 -0
  372. package/esm/Signal/Object.js +76 -0
  373. package/esm/Signal/PubSub.js +162 -0
  374. package/esm/Signal/Request.js +19 -0
  375. package/esm/Signal/Response.js +34 -0
  376. package/esm/Signal/RestApi.js +234 -0
  377. package/esm/Signal/WebSocket.js +39 -0
  378. package/esm/Signal/index.js +13 -0
  379. package/esm/System/CSR.js +357 -0
  380. package/esm/System/Client.js +191 -0
  381. package/esm/System/Common.js +45 -0
  382. package/esm/System/DevModeToggle.js +19 -0
  383. package/esm/System/Gtag.js +48 -0
  384. package/esm/System/HealthCheck.js +41 -0
  385. package/esm/System/Messages.js +156 -0
  386. package/esm/System/Reconnect.js +45 -0
  387. package/esm/System/Root.js +11 -0
  388. package/esm/System/SSR.js +125 -0
  389. package/esm/System/SelectLanguage.js +39 -0
  390. package/esm/System/ThemeToggle.js +21 -0
  391. package/esm/System/index.js +26 -0
  392. package/esm/Tab/Menu.js +51 -0
  393. package/esm/Tab/Menus.js +7 -0
  394. package/esm/Tab/Panel.js +23 -0
  395. package/esm/Tab/Provider.js +12 -0
  396. package/esm/Tab/context.js +11 -0
  397. package/esm/Tab/index.js +13 -0
  398. package/esm/Table.js +56 -0
  399. package/esm/ToggleSelect.js +99 -0
  400. package/esm/Unauthorized.js +21 -0
  401. package/esm/index.js +84 -1
  402. package/index.d.ts +41 -1
  403. package/package.json +23 -2
  404. package/esm/src/index.js +0 -4
  405. package/src/index.d.ts +0 -1
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { router } from "@akanjs/client";
3
+ import { usePage } from "@akanjs/next";
4
+ import { useState } from "react";
5
+ const languageNames = {
6
+ en: "English",
7
+ ko: "\uD55C\uAD6D\uC5B4",
8
+ zhChs: "\u7B80\u4F53\u4E2D\u6587",
9
+ zhCht: "\u7E41\u9AD4\u4E2D\u6587"
10
+ };
11
+ const SelectLanguage = ({ className, languages = ["en", "ko"] }) => {
12
+ const { l, lang } = usePage();
13
+ const [open, setOpen] = useState(false);
14
+ return /* @__PURE__ */ React.createElement("div", { className: "relative" }, /* @__PURE__ */ React.createElement(
15
+ "div",
16
+ {
17
+ id: "select-language",
18
+ onClick: () => {
19
+ setOpen(!open);
20
+ },
21
+ className: "mx-2 my-auto cursor-pointer rounded-3xl border bg-black/50 px-3 text-xs font-light text-white md:mx-4"
22
+ },
23
+ languageNames[lang]
24
+ ), open ? /* @__PURE__ */ React.createElement("div", { className: "absolute top-6 -left-4 w-28 rounded-xl border bg-slate-900/90 py-2 text-center text-white" }, languages.filter((lang2) => !!languageNames[lang2]).map((lang2) => /* @__PURE__ */ React.createElement(
25
+ "div",
26
+ {
27
+ key: lang2,
28
+ onClick: () => {
29
+ router.setLang(lang2);
30
+ setOpen(false);
31
+ },
32
+ className: "cursor-pointer py-1 hover:bg-white/20"
33
+ },
34
+ languageNames[lang2]
35
+ ))) : null);
36
+ };
37
+ export {
38
+ SelectLanguage
39
+ };
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import { capitalize } from "@akanjs/common";
3
+ import { useTheme } from "next-themes";
4
+ import { useEffect, useState } from "react";
5
+ const ThemeToggle = () => {
6
+ const [mounted, setMounted] = useState(false);
7
+ const { theme, setTheme, themes } = useTheme();
8
+ useEffect(() => {
9
+ setMounted(true);
10
+ }, []);
11
+ const handleTheme = (e) => {
12
+ setTheme(theme === "dark" ? "light" : "dark");
13
+ };
14
+ if (!mounted) {
15
+ return null;
16
+ }
17
+ return /* @__PURE__ */ React.createElement("div", { className: "form-control" }, /* @__PURE__ */ React.createElement("label", { className: "label cursor-pointer" }, /* @__PURE__ */ React.createElement("span", { className: "label-text mr-2 text-sm whitespace-nowrap" }, capitalize(theme ?? "")), /* @__PURE__ */ React.createElement("input", { type: "checkbox", className: "toggle toggle-sm", checked: theme === "dark", onChange: handleTheme })));
18
+ };
19
+ export {
20
+ ThemeToggle
21
+ };
@@ -0,0 +1,26 @@
1
+ import { baseClientEnv } from "@akanjs/base";
2
+ import { default as CSR } from "./CSR";
3
+ import { DevModeToggle } from "./DevModeToggle";
4
+ import { Reconnect } from "./Reconnect";
5
+ import { Root } from "./Root";
6
+ import { SelectLanguage } from "./SelectLanguage";
7
+ import { default as SSR } from "./SSR";
8
+ import { ThemeToggle } from "./ThemeToggle";
9
+ const Provider = (props) => {
10
+ if (baseClientEnv.renderMode === "csr")
11
+ return /* @__PURE__ */ React.createElement(CSR, { ...props });
12
+ else
13
+ return /* @__PURE__ */ React.createElement(SSR, { ...props });
14
+ };
15
+ const System = {
16
+ Provider,
17
+ ThemeToggle,
18
+ Root,
19
+ SelectLanguage,
20
+ Reconnect,
21
+ DevModeToggle
22
+ };
23
+ export {
24
+ Provider,
25
+ System
26
+ };
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ import { clsx } from "@akanjs/client";
3
+ import { useContext, useEffect } from "react";
4
+ import { TabContext } from "./context";
5
+ const Menu = ({
6
+ className,
7
+ activeClassName = "",
8
+ disabledClassName = "",
9
+ disabled = false,
10
+ menu,
11
+ children,
12
+ scrollToTop,
13
+ tooltip
14
+ }) => {
15
+ const { menu: currentMenu, setMenu, menuSet } = useContext(TabContext);
16
+ useEffect(() => {
17
+ if (!menuSet.current)
18
+ return;
19
+ menuSet.current.add(menu);
20
+ }, [menu]);
21
+ useEffect(() => {
22
+ if (!disabled || !menuSet.current)
23
+ return;
24
+ if (currentMenu === menu)
25
+ setMenu([...menuSet.current.values()].find((m) => m !== menu) ?? null);
26
+ }, [disabled]);
27
+ return /* @__PURE__ */ React.createElement(
28
+ "div",
29
+ {
30
+ "data-tip": tooltip,
31
+ className: clsx(className, {
32
+ "cursor-pointer": menu !== currentMenu && !disabled,
33
+ "cursor-not-allowed": disabled,
34
+ tooltip: !!tooltip,
35
+ [activeClassName]: menu === currentMenu,
36
+ [disabledClassName]: disabled
37
+ }),
38
+ onClick: () => {
39
+ if (disabled)
40
+ return;
41
+ setMenu(menu);
42
+ if (scrollToTop)
43
+ window.scrollTo({ top: 0, behavior: "smooth" });
44
+ }
45
+ },
46
+ children
47
+ );
48
+ };
49
+ export {
50
+ Menu
51
+ };
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ const Menus = ({ className, children }) => {
3
+ return /* @__PURE__ */ React.createElement("div", { className }, children);
4
+ };
5
+ export {
6
+ Menus
7
+ };
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { clsx } from "@akanjs/client";
3
+ import { useContext, useEffect, useState } from "react";
4
+ import { TabContext } from "./context";
5
+ const Panel = ({ className, menu, children, loading = "eager" }) => {
6
+ const { menu: currentMenu } = useContext(TabContext);
7
+ const [loaded, setLoaded] = useState(menu === currentMenu);
8
+ useEffect(() => {
9
+ if (loading === "eager")
10
+ setLoaded(true);
11
+ else if (loading === "lazy" && !loaded && currentMenu === menu)
12
+ setLoaded(true);
13
+ else if (loading === "every")
14
+ setLoaded(currentMenu === menu);
15
+ }, [currentMenu]);
16
+ if (loading === "eager")
17
+ return /* @__PURE__ */ React.createElement("div", { className: clsx(className, { hidden: currentMenu !== menu }) }, children);
18
+ else
19
+ return loaded ? /* @__PURE__ */ React.createElement("div", { className: clsx(className, { hidden: currentMenu !== menu }) }, children) : null;
20
+ };
21
+ export {
22
+ Panel
23
+ };
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { clsx } from "@akanjs/client";
3
+ import { useRef, useState } from "react";
4
+ import { TabContext } from "./context";
5
+ const Provider = ({ className, defaultMenu = null, children }) => {
6
+ const menuSet = useRef(/* @__PURE__ */ new Set());
7
+ const [menu, setMenu] = useState(defaultMenu);
8
+ return /* @__PURE__ */ React.createElement(TabContext.Provider, { value: { defaultMenu, menu, setMenu, menuSet } }, /* @__PURE__ */ React.createElement("div", { "data-menu": menu, className: clsx(className, "group/tab") }, children));
9
+ };
10
+ export {
11
+ Provider
12
+ };
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { createContext } from "react";
3
+ const TabContext = createContext({
4
+ defaultMenu: null,
5
+ menu: null,
6
+ setMenu: (value) => null,
7
+ menuSet: null
8
+ });
9
+ export {
10
+ TabContext
11
+ };
@@ -0,0 +1,13 @@
1
+ import { Menu } from "./Menu";
2
+ import { Menus } from "./Menus";
3
+ import { Panel } from "./Panel";
4
+ import { Provider } from "./Provider";
5
+ const Tab = (props) => {
6
+ return /* @__PURE__ */ React.createElement(Provider, { ...props });
7
+ };
8
+ Tab.Menu = Menu;
9
+ Tab.Menus = Menus;
10
+ Tab.Panel = Panel;
11
+ export {
12
+ Tab
13
+ };
package/esm/Table.js ADDED
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import { clsx } from "@akanjs/client";
3
+ import { st } from "@akanjs/store";
4
+ import React, { useMemo } from "react";
5
+ import { AiOutlineLoading3Quarters } from "react-icons/ai";
6
+ import { Empty } from "./Empty";
7
+ import { Pagination } from "./Pagination";
8
+ const Table = ({
9
+ columns,
10
+ dataSource,
11
+ loading,
12
+ size,
13
+ bordered,
14
+ pagination,
15
+ showHeader = true,
16
+ onRow,
17
+ rowClassName,
18
+ rowKey
19
+ }) => {
20
+ const sizeClassName = size === "small" ? "table-compact" : "";
21
+ const loadingClassName = loading ? "opacity-30" : "";
22
+ const borderedClassName = bordered ? "border border-gray-200 rounded-xl" : "";
23
+ const responsive = st.use.responsive();
24
+ const renderedColumns = useMemo(() => {
25
+ return columns.filter((c) => !c.responsive || c.responsive.includes(responsive)).map((column, idx) => /* @__PURE__ */ React.createElement("th", { key: idx, className: "whitespace-nowrap" }, column.title));
26
+ }, [columns, responsive]);
27
+ const renderedRows = useMemo(() => {
28
+ return dataSource.map((rowData, rowIndex) => {
29
+ const renderedCells = columns.filter((c) => !c.responsive || c.responsive.includes(responsive)).map((column, idx) => /* @__PURE__ */ React.createElement(
30
+ "td",
31
+ {
32
+ key: idx,
33
+ className: clsx(
34
+ "whitespace-nowrap",
35
+ rowClassName ? typeof rowClassName === "string" ? rowClassName : rowClassName(rowData, rowIndex) : ""
36
+ ),
37
+ ...onRow?.(rowData, rowIndex)
38
+ },
39
+ column.render ? column.render(rowData[column.dataIndex], rowData, rowIndex) : column.dataIndex ? rowData[column.dataIndex] : null
40
+ ));
41
+ return /* @__PURE__ */ React.createElement("tr", { key: rowIndex }, renderedCells);
42
+ });
43
+ }, [columns, dataSource, responsive]);
44
+ return /* @__PURE__ */ React.createElement("div", { className: clsx("relative w-full", loadingClassName, borderedClassName) }, loading && /* @__PURE__ */ React.createElement("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2" }, /* @__PURE__ */ React.createElement(AiOutlineLoading3Quarters, { className: "animate-spin text-3xl" })), /* @__PURE__ */ React.createElement("table", { className: clsx("table w-full", sizeClassName) }, showHeader === true || Array.isArray(showHeader) && showHeader.includes(responsive) ? /* @__PURE__ */ React.createElement("thead", { className: "normal-case" }, /* @__PURE__ */ React.createElement("tr", null, renderedColumns)) : null, !!dataSource.length && /* @__PURE__ */ React.createElement("tbody", null, renderedRows)), !dataSource.length && /* @__PURE__ */ React.createElement("div", { className: "w-full" }, /* @__PURE__ */ React.createElement(Empty, null)), pagination && /* @__PURE__ */ React.createElement("div", { className: "mt-3 flex justify-center" }, /* @__PURE__ */ React.createElement(
45
+ Pagination,
46
+ {
47
+ currentPage: pagination.currentPage,
48
+ total: pagination.total,
49
+ onPageSelect: pagination.onPageSelect,
50
+ itemsPerPage: pagination.itemsPerPage
51
+ }
52
+ )));
53
+ };
54
+ export {
55
+ Table
56
+ };
@@ -0,0 +1,99 @@
1
+ import { clsx } from "@akanjs/client";
2
+ import { usePage } from "@akanjs/next";
3
+ const ToggleSelect = ({
4
+ className,
5
+ btnClassName,
6
+ items,
7
+ nullable,
8
+ validate,
9
+ value,
10
+ onChange,
11
+ disabled
12
+ }) => {
13
+ const { l } = usePage();
14
+ const validateResult = validate(value ?? "");
15
+ const invalidMessage = !value?.length || validateResult === true ? null : validateResult === false ? l("util.invalidValueError") : validateResult;
16
+ const options = items.map(
17
+ (item) => typeof item === "string" ? { label: item, value: item } : item
18
+ );
19
+ return /* @__PURE__ */ React.createElement(
20
+ "div",
21
+ {
22
+ className: clsx(
23
+ "border-base-content/20 relative flex w-full flex-wrap items-center gap-1 rounded-md border p-2",
24
+ className
25
+ )
26
+ },
27
+ options.map((option, idx) => {
28
+ const isSelected = value === option.value;
29
+ return /* @__PURE__ */ React.createElement(
30
+ "button",
31
+ {
32
+ key: idx,
33
+ disabled,
34
+ className: clsx(
35
+ "btn btn-sm",
36
+ { "bg-success/70 text-success-content": isSelected },
37
+ // {
38
+ // "btn-error": status === "error",
39
+ // "btn-warning": status === "warning",
40
+ // },
41
+ btnClassName
42
+ ),
43
+ onClick: () => {
44
+ onChange(option.value, idx);
45
+ }
46
+ },
47
+ option.label
48
+ );
49
+ }),
50
+ invalidMessage ? /* @__PURE__ */ React.createElement("div", { className: "text-error animate-fadeIn absolute -bottom-4 text-xs" }, invalidMessage) : null
51
+ );
52
+ };
53
+ const Multi = ({ className, btnClassName, items, nullable, validate, value, onChange, disabled }) => {
54
+ const { l } = usePage();
55
+ const validateResult = validate(value);
56
+ const invalidMessage = !value.length || validateResult === true ? null : validateResult === false ? l("util.invalidValueError") : validateResult;
57
+ const options = items.map(
58
+ (item) => typeof item === "string" ? { label: item, value: item } : item
59
+ );
60
+ return /* @__PURE__ */ React.createElement(
61
+ "div",
62
+ {
63
+ className: clsx(
64
+ "border-base-content/20 relative flex w-full flex-wrap items-center gap-1 rounded-md border p-2",
65
+ className
66
+ )
67
+ },
68
+ options.map((option, idx) => {
69
+ const isSelected = value.includes(option.value);
70
+ return /* @__PURE__ */ React.createElement(
71
+ "button",
72
+ {
73
+ key: idx,
74
+ disabled,
75
+ className: clsx(
76
+ "btn btn-sm",
77
+ {
78
+ "bg-success/70 text-success-content": isSelected
79
+ },
80
+ btnClassName
81
+ ),
82
+ onClick: () => {
83
+ onChange(
84
+ isSelected ? value.filter((i) => i !== option.value) : [...value, option.value].sort(
85
+ (a, b) => options.findIndex((o) => o.value === a) - items.findIndex((o) => o.value === b)
86
+ )
87
+ );
88
+ }
89
+ },
90
+ option.label
91
+ );
92
+ }),
93
+ invalidMessage ? /* @__PURE__ */ React.createElement("div", { className: "text-error animate-fadeIn absolute -bottom-4 text-xs" }, invalidMessage) : null
94
+ );
95
+ };
96
+ ToggleSelect.Multi = Multi;
97
+ export {
98
+ ToggleSelect
99
+ };
@@ -0,0 +1,21 @@
1
+ import { clsx } from "@akanjs/client";
2
+ import { usePage } from "@akanjs/next";
3
+ import React from "react";
4
+ import { AiOutlineBlock } from "react-icons/ai";
5
+ const Unauthorized = ({ className = "", description, children, minHeight = 300 }) => {
6
+ const { l } = usePage();
7
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
8
+ "div",
9
+ {
10
+ className: clsx(
11
+ `min-h-[ w-full${minHeight}px] text-base-content/30 flex flex-col items-center justify-center gap-3 pt-6 pb-3`,
12
+ className
13
+ )
14
+ },
15
+ /* @__PURE__ */ React.createElement(AiOutlineBlock, { className: "scale-150 text-4xl" }),
16
+ /* @__PURE__ */ React.createElement("p", null, description ?? l("util.unauthorized"))
17
+ ), children);
18
+ };
19
+ export {
20
+ Unauthorized
21
+ };
package/esm/index.js CHANGED
@@ -1 +1,84 @@
1
- export * from "./src";
1
+ import { Data } from "./Data";
2
+ import { Dialog } from "./Dialog";
3
+ import { Layout } from "./Layout";
4
+ import { Link } from "./Link";
5
+ import { Load } from "./Load";
6
+ import { Loading } from "./Loading";
7
+ import { Model } from "./Model";
8
+ import { Signal } from "./Signal";
9
+ import { System } from "./System";
10
+ import { Tab } from "./Tab";
11
+ import { BottomSheet } from "./BottomSheet";
12
+ import { Button } from "./Button";
13
+ import { ClientSide } from "./ClientSide";
14
+ import { Copy } from "./Copy";
15
+ import { CsrImage } from "./CsrImage";
16
+ import { DatePicker } from "./DatePicker";
17
+ import { DragAction } from "./DragAction";
18
+ import { DraggableList } from "./DraggableList";
19
+ import { Dropdown } from "./Dropdown";
20
+ import { Empty } from "./Empty";
21
+ import { Field } from "./Field";
22
+ import { FontFace } from "./FontFace";
23
+ import { Image } from "./Image";
24
+ import { InfiniteScroll } from "./InfiniteScroll";
25
+ import { Input } from "./Input";
26
+ import { KeyboardAvoiding } from "./KeyboardAvoiding";
27
+ import { Menu } from "./Menu";
28
+ import { Modal } from "./Modal";
29
+ import { More } from "./More";
30
+ import { ObjectId } from "./ObjectId";
31
+ import { Pagination } from "./Pagination";
32
+ import { Popconfirm } from "./Popconfirm";
33
+ import { Portal } from "./Portal";
34
+ import { Radio } from "./Radio";
35
+ import { RecentTime } from "./RecentTime";
36
+ import { Refresh } from "./Refresh";
37
+ import { ScreenNavigator } from "./ScreenNavigator";
38
+ import { Select } from "./Select";
39
+ import { Table } from "./Table";
40
+ import { ToggleSelect } from "./ToggleSelect";
41
+ import { Unauthorized } from "./Unauthorized";
42
+ export {
43
+ BottomSheet,
44
+ Button,
45
+ ClientSide,
46
+ Copy,
47
+ CsrImage,
48
+ Data,
49
+ DatePicker,
50
+ Dialog,
51
+ DragAction,
52
+ DraggableList,
53
+ Dropdown,
54
+ Empty,
55
+ Field,
56
+ FontFace,
57
+ Image,
58
+ InfiniteScroll,
59
+ Input,
60
+ KeyboardAvoiding,
61
+ Layout,
62
+ Link,
63
+ Load,
64
+ Loading,
65
+ Menu,
66
+ Modal,
67
+ Model,
68
+ More,
69
+ ObjectId,
70
+ Pagination,
71
+ Popconfirm,
72
+ Portal,
73
+ Radio,
74
+ RecentTime,
75
+ Refresh,
76
+ ScreenNavigator,
77
+ Select,
78
+ Signal,
79
+ System,
80
+ Tab,
81
+ Table,
82
+ ToggleSelect,
83
+ Unauthorized
84
+ };
package/index.d.ts CHANGED
@@ -1 +1,41 @@
1
- export * from "./src";
1
+ export { Data } from "./Data";
2
+ export { Dialog } from "./Dialog";
3
+ export { Layout } from "./Layout";
4
+ export { Link } from "./Link";
5
+ export { Load } from "./Load";
6
+ export { Loading } from "./Loading";
7
+ export { Model } from "./Model";
8
+ export { Signal } from "./Signal";
9
+ export { System } from "./System";
10
+ export { Tab } from "./Tab";
11
+ export { BottomSheet, type BottomSheetRef } from "./BottomSheet";
12
+ export { Button } from "./Button";
13
+ export { ClientSide } from "./ClientSide";
14
+ export { Copy } from "./Copy";
15
+ export { CsrImage } from "./CsrImage";
16
+ export { DatePicker } from "./DatePicker";
17
+ export { DragAction } from "./DragAction";
18
+ export { DraggableList } from "./DraggableList";
19
+ export { Dropdown } from "./Dropdown";
20
+ export { Empty } from "./Empty";
21
+ export { Field } from "./Field";
22
+ export { FontFace } from "./FontFace";
23
+ export { Image } from "./Image";
24
+ export { InfiniteScroll } from "./InfiniteScroll";
25
+ export { Input } from "./Input";
26
+ export { KeyboardAvoiding } from "./KeyboardAvoiding";
27
+ export { Menu } from "./Menu";
28
+ export { Modal } from "./Modal";
29
+ export { More } from "./More";
30
+ export { ObjectId } from "./ObjectId";
31
+ export { Pagination } from "./Pagination";
32
+ export { Popconfirm } from "./Popconfirm";
33
+ export { Portal } from "./Portal";
34
+ export { Radio } from "./Radio";
35
+ export { RecentTime } from "./RecentTime";
36
+ export { Refresh } from "./Refresh";
37
+ export { ScreenNavigator } from "./ScreenNavigator";
38
+ export { Select } from "./Select";
39
+ export { Table } from "./Table";
40
+ export { ToggleSelect } from "./ToggleSelect";
41
+ export { Unauthorized } from "./Unauthorized";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/ui",
3
- "version": "0.0.149",
3
+ "version": "0.0.151",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -14,7 +14,28 @@
14
14
  "engines": {
15
15
  "node": ">=22"
16
16
  },
17
- "dependencies": {},
17
+ "dependencies": {
18
+ "@capacitor/browser": "7.0.1",
19
+ "@radix-ui/react-dialog": "1.1.4",
20
+ "@react-spring/web": "^9.7.5",
21
+ "@use-gesture/react": "^10.3.1",
22
+ "dayjs": "^1.11.13",
23
+ "file-saver": "^2.0.5",
24
+ "jsonwebtoken": "^9.0.2",
25
+ "lodash-move": "^1.1.1",
26
+ "lodash.clamp": "^4.0.3",
27
+ "next": "15.3.2",
28
+ "next-themes": "0.4.4",
29
+ "react": "18.3.1",
30
+ "react-copy-to-clipboard": "5.1.0",
31
+ "react-datepicker": "7.5.0",
32
+ "react-device-detect": "^2.2.3",
33
+ "react-dom": "18.3.1",
34
+ "react-easy-crop": "^5.2.0",
35
+ "react-icons": "^5.4.0",
36
+ "react-simple-pull-to-refresh": "^1.3.3",
37
+ "react-spring": "^9.7.5"
38
+ },
18
39
  "exports": {
19
40
  ".": {
20
41
  "require": "./cjs/index.js",
package/esm/src/index.js DELETED
@@ -1,4 +0,0 @@
1
- const a = 1;
2
- export {
3
- a
4
- };
package/src/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const a = 1;