@akanjs/ui 0.0.151 → 0.0.152

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 (351) hide show
  1. package/Button.d.ts +1 -1
  2. package/ClientSide.d.ts +1 -1
  3. package/Copy.d.ts +1 -1
  4. package/CsrImage.d.ts +1 -1
  5. package/Data/CardList.d.ts +1 -1
  6. package/Data/Dashboard.d.ts +1 -1
  7. package/Data/Insight.d.ts +1 -1
  8. package/Data/Item.d.ts +6 -6
  9. package/Data/ListContainer.d.ts +2 -2
  10. package/Data/Pagination.d.ts +1 -1
  11. package/Data/QueryMaker.d.ts +1 -1
  12. package/Data/TableList.d.ts +2 -2
  13. package/DatePicker.d.ts +3 -4
  14. package/Dialog/Close.d.ts +1 -1
  15. package/Dialog/Content.d.ts +1 -1
  16. package/Dialog/Modal.d.ts +1 -1
  17. package/Dialog/Provider.d.ts +1 -1
  18. package/Dialog/Trigger.d.ts +1 -1
  19. package/Dialog/index.d.ts +4 -4
  20. package/DragAction.d.ts +4 -4
  21. package/DraggableList.d.ts +2 -2
  22. package/Dropdown.d.ts +1 -1
  23. package/Empty.d.ts +2 -2
  24. package/Field.d.ts +22 -22
  25. package/Image.d.ts +1 -1
  26. package/InfiniteScroll.d.ts +1 -1
  27. package/Input.d.ts +6 -6
  28. package/KeyboardAvoiding.d.ts +1 -1
  29. package/Layout/BottomAction.d.ts +1 -1
  30. package/Layout/BottomInset.d.ts +1 -1
  31. package/Layout/BottomTab.d.ts +1 -1
  32. package/Layout/Header.d.ts +1 -1
  33. package/Layout/LeftSider.d.ts +1 -1
  34. package/Layout/Navbar.d.ts +2 -2
  35. package/Layout/RightSider.d.ts +1 -1
  36. package/Layout/Sider.d.ts +1 -1
  37. package/Layout/Template.d.ts +1 -1
  38. package/Layout/TopLeftAction.d.ts +1 -1
  39. package/Layout/Unit.d.ts +1 -1
  40. package/Layout/View.d.ts +1 -1
  41. package/Layout/Zone.d.ts +1 -1
  42. package/Layout/index.d.ts +12 -12
  43. package/Link/Back.d.ts +1 -1
  44. package/Link/Close.d.ts +1 -1
  45. package/Link/CsrLink.d.ts +1 -1
  46. package/Link/NextLink.d.ts +1 -1
  47. package/Link/index.d.ts +1 -1
  48. package/Load/Edit.d.ts +1 -1
  49. package/Load/Edit_Client.d.ts +1 -1
  50. package/Load/Page.d.ts +1 -1
  51. package/Load/PageCSR.d.ts +1 -1
  52. package/Load/Pagination.d.ts +1 -1
  53. package/Load/Units.d.ts +1 -1
  54. package/Load/View.d.ts +1 -1
  55. package/Load/index.d.ts +1 -1
  56. package/Loading/Area.d.ts +1 -1
  57. package/Loading/Button.d.ts +1 -1
  58. package/Loading/Input.d.ts +1 -1
  59. package/Loading/ProgressBar.d.ts +1 -1
  60. package/Loading/Skeleton.d.ts +1 -1
  61. package/Loading/Spin.d.ts +1 -1
  62. package/Loading/index.d.ts +6 -6
  63. package/Menu.d.ts +1 -1
  64. package/Modal.d.ts +3 -3
  65. package/Model/Edit.d.ts +1 -1
  66. package/Model/EditModal.d.ts +2 -2
  67. package/Model/EditWrapper.d.ts +1 -1
  68. package/Model/LoadInit.d.ts +1 -1
  69. package/Model/New.d.ts +1 -1
  70. package/Model/NewWrapper.d.ts +1 -1
  71. package/Model/NewWrapper_Client.d.ts +1 -1
  72. package/Model/Remove.d.ts +1 -1
  73. package/Model/RemoveWrapper.d.ts +1 -1
  74. package/Model/SureToRemove.d.ts +1 -1
  75. package/Model/View.d.ts +1 -1
  76. package/Model/ViewEditModal.d.ts +1 -1
  77. package/Model/ViewModal.d.ts +1 -1
  78. package/Model/ViewWrapper.d.ts +1 -1
  79. package/More.d.ts +1 -1
  80. package/ObjectId.d.ts +1 -1
  81. package/Popconfirm.d.ts +2 -2
  82. package/Radio.d.ts +2 -2
  83. package/RecentTime.d.ts +1 -1
  84. package/Refresh.d.ts +1 -1
  85. package/ScreenNavigator.d.ts +3 -3
  86. package/Select.d.ts +1 -1
  87. package/Signal/Arg.d.ts +13 -13
  88. package/Signal/Doc.d.ts +6 -6
  89. package/Signal/GraphQL.d.ts +5 -6
  90. package/Signal/Listener.d.ts +2 -2
  91. package/Signal/Message.d.ts +4 -5
  92. package/Signal/Object.d.ts +4 -4
  93. package/Signal/PubSub.d.ts +4 -4
  94. package/Signal/Request.d.ts +2 -2
  95. package/Signal/Response.d.ts +3 -3
  96. package/Signal/RestApi.d.ts +5 -6
  97. package/Signal/WebSocket.d.ts +2 -2
  98. package/System/CSR.d.ts +5 -5
  99. package/System/Client.d.ts +8 -8
  100. package/System/Common.d.ts +2 -2
  101. package/System/DevModeToggle.d.ts +1 -1
  102. package/System/Gtag.d.ts +1 -1
  103. package/System/HealthCheck.d.ts +1 -1
  104. package/System/Messages.d.ts +1 -1
  105. package/System/Reconnect.d.ts +1 -1
  106. package/System/Root.d.ts +1 -1
  107. package/System/SSR.d.ts +4 -4
  108. package/System/SelectLanguage.d.ts +1 -1
  109. package/System/ThemeToggle.d.ts +1 -1
  110. package/System/index.d.ts +7 -7
  111. package/Tab/Menu.d.ts +1 -1
  112. package/Tab/Menus.d.ts +1 -1
  113. package/Tab/Panel.d.ts +1 -1
  114. package/Tab/Provider.d.ts +1 -1
  115. package/Tab/index.d.ts +4 -4
  116. package/Table.d.ts +1 -1
  117. package/ToggleSelect.d.ts +2 -2
  118. package/Unauthorized.d.ts +2 -2
  119. package/cjs/BottomSheet.js +38 -42
  120. package/cjs/Button.js +36 -34
  121. package/cjs/ClientSide.js +2 -1
  122. package/cjs/Copy.js +5 -4
  123. package/cjs/CsrImage.js +2 -1
  124. package/cjs/Data/CardList.js +41 -33
  125. package/cjs/Data/Dashboard.js +22 -12
  126. package/cjs/Data/Insight.js +7 -3
  127. package/cjs/Data/Item.js +54 -39
  128. package/cjs/Data/ListContainer.js +104 -70
  129. package/cjs/Data/Pagination.js +3 -2
  130. package/cjs/Data/QueryMaker.js +104 -82
  131. package/cjs/Data/TableList.js +45 -34
  132. package/cjs/DatePicker.js +38 -33
  133. package/cjs/Dialog/Close.js +5 -4
  134. package/cjs/Dialog/Content.js +2 -1
  135. package/cjs/Dialog/Modal.js +60 -49
  136. package/cjs/Dialog/Provider.js +2 -1
  137. package/cjs/Dialog/Trigger.js +5 -4
  138. package/cjs/Dialog/index.js +2 -1
  139. package/cjs/DragAction.js +11 -10
  140. package/cjs/DraggableList.js +10 -9
  141. package/cjs/Dropdown.js +32 -29
  142. package/cjs/Empty.js +17 -22
  143. package/cjs/Field.js +695 -573
  144. package/cjs/Image.js +2 -1
  145. package/cjs/InfiniteScroll.js +6 -1
  146. package/cjs/Input.js +171 -154
  147. package/cjs/KeyboardAvoiding.js +2 -1
  148. package/cjs/Layout/BottomAction.js +2 -1
  149. package/cjs/Layout/BottomInset.js +6 -5
  150. package/cjs/Layout/BottomTab.js +23 -17
  151. package/cjs/Layout/Header.js +14 -10
  152. package/cjs/Layout/LeftSider.js +17 -14
  153. package/cjs/Layout/Navbar.js +6 -12
  154. package/cjs/Layout/RightSider.js +24 -18
  155. package/cjs/Layout/Sider.js +24 -11
  156. package/cjs/Layout/Template.js +2 -1
  157. package/cjs/Layout/TopLeftAction.js +2 -1
  158. package/cjs/Layout/Unit.js +2 -1
  159. package/cjs/Layout/View.js +2 -1
  160. package/cjs/Layout/Zone.js +2 -1
  161. package/cjs/Link/Back.js +2 -1
  162. package/cjs/Link/Close.js +5 -4
  163. package/cjs/Link/CsrLink.js +5 -4
  164. package/cjs/Link/NextLink.js +5 -4
  165. package/cjs/Link/index.js +4 -3
  166. package/cjs/Load/Edit.js +2 -1
  167. package/cjs/Load/Edit_Client.js +6 -5
  168. package/cjs/Load/PageCSR.js +2 -1
  169. package/cjs/Load/Pagination.js +4 -3
  170. package/cjs/Load/Units.js +34 -27
  171. package/cjs/Load/View.js +3 -2
  172. package/cjs/Loading/Area.js +5 -1
  173. package/cjs/Loading/Button.js +2 -1
  174. package/cjs/Loading/Input.js +2 -1
  175. package/cjs/Loading/ProgressBar.js +2 -1
  176. package/cjs/Loading/Skeleton.js +7 -1
  177. package/cjs/Loading/Spin.js +2 -1
  178. package/cjs/Menu.js +105 -89
  179. package/cjs/Modal.js +33 -20
  180. package/cjs/Model/Edit.js +18 -12
  181. package/cjs/Model/EditModal.js +43 -45
  182. package/cjs/Model/EditWrapper.js +5 -4
  183. package/cjs/Model/LoadInit.js +2 -1
  184. package/cjs/Model/New.js +18 -12
  185. package/cjs/Model/NewWrapper.js +2 -1
  186. package/cjs/Model/NewWrapper_Client.js +5 -4
  187. package/cjs/Model/Remove.js +45 -39
  188. package/cjs/Model/RemoveWrapper.js +6 -5
  189. package/cjs/Model/SureToRemove.js +70 -54
  190. package/cjs/Model/View.js +13 -3
  191. package/cjs/Model/ViewEditModal.js +30 -19
  192. package/cjs/Model/ViewModal.js +9 -8
  193. package/cjs/Model/ViewWrapper.js +5 -4
  194. package/cjs/More.js +10 -6
  195. package/cjs/ObjectId.js +5 -1
  196. package/cjs/Pagination.js +45 -40
  197. package/cjs/Popconfirm.js +53 -45
  198. package/cjs/Radio.js +26 -22
  199. package/cjs/RecentTime.js +16 -15
  200. package/cjs/Refresh.js +5 -4
  201. package/cjs/ScreenNavigator.js +7 -6
  202. package/cjs/Select.js +156 -135
  203. package/cjs/Signal/Arg.js +94 -54
  204. package/cjs/Signal/Doc.js +175 -98
  205. package/cjs/Signal/GraphQL.js +143 -59
  206. package/cjs/Signal/Listener.js +28 -21
  207. package/cjs/Signal/Message.js +166 -80
  208. package/cjs/Signal/Object.js +75 -39
  209. package/cjs/Signal/PubSub.js +161 -79
  210. package/cjs/Signal/Request.js +16 -9
  211. package/cjs/Signal/Response.js +30 -17
  212. package/cjs/Signal/RestApi.js +186 -84
  213. package/cjs/Signal/WebSocket.js +6 -5
  214. package/cjs/System/CSR.js +184 -165
  215. package/cjs/System/Client.js +24 -20
  216. package/cjs/System/Common.js +29 -25
  217. package/cjs/System/DevModeToggle.js +14 -10
  218. package/cjs/System/Gtag.js +11 -7
  219. package/cjs/System/HealthCheck.js +2 -1
  220. package/cjs/System/Messages.js +39 -36
  221. package/cjs/System/Reconnect.js +25 -3
  222. package/cjs/System/Root.js +2 -1
  223. package/cjs/System/SSR.js +72 -54
  224. package/cjs/System/SelectLanguage.js +25 -21
  225. package/cjs/System/ThemeToggle.js +5 -1
  226. package/cjs/System/index.js +3 -2
  227. package/cjs/Tab/Menu.js +5 -4
  228. package/cjs/Tab/Menus.js +2 -1
  229. package/cjs/Tab/Panel.js +3 -2
  230. package/cjs/Tab/Provider.js +2 -1
  231. package/cjs/Tab/index.js +2 -1
  232. package/cjs/Table.js +25 -26
  233. package/cjs/ToggleSelect.js +59 -54
  234. package/cjs/Unauthorized.js +17 -22
  235. package/esm/BottomSheet.js +38 -32
  236. package/esm/Button.js +36 -24
  237. package/esm/ClientSide.js +2 -1
  238. package/esm/Copy.js +5 -4
  239. package/esm/CsrImage.js +2 -1
  240. package/esm/Data/CardList.js +41 -33
  241. package/esm/Data/Dashboard.js +22 -12
  242. package/esm/Data/Insight.js +7 -3
  243. package/esm/Data/Item.js +54 -29
  244. package/esm/Data/ListContainer.js +104 -70
  245. package/esm/Data/Pagination.js +3 -2
  246. package/esm/Data/QueryMaker.js +104 -82
  247. package/esm/Data/TableList.js +45 -34
  248. package/esm/DatePicker.js +38 -33
  249. package/esm/Dialog/Close.js +5 -4
  250. package/esm/Dialog/Content.js +2 -1
  251. package/esm/Dialog/Modal.js +60 -49
  252. package/esm/Dialog/Provider.js +2 -1
  253. package/esm/Dialog/Trigger.js +5 -4
  254. package/esm/Dialog/index.js +2 -1
  255. package/esm/DragAction.js +11 -10
  256. package/esm/DraggableList.js +10 -9
  257. package/esm/Dropdown.js +32 -29
  258. package/esm/Empty.js +17 -12
  259. package/esm/Field.js +695 -573
  260. package/esm/Image.js +2 -1
  261. package/esm/InfiniteScroll.js +6 -1
  262. package/esm/Input.js +171 -144
  263. package/esm/KeyboardAvoiding.js +2 -1
  264. package/esm/Layout/BottomAction.js +2 -1
  265. package/esm/Layout/BottomInset.js +6 -5
  266. package/esm/Layout/BottomTab.js +23 -17
  267. package/esm/Layout/Header.js +14 -10
  268. package/esm/Layout/LeftSider.js +17 -14
  269. package/esm/Layout/Navbar.js +6 -2
  270. package/esm/Layout/RightSider.js +24 -18
  271. package/esm/Layout/Sider.js +24 -11
  272. package/esm/Layout/Template.js +2 -1
  273. package/esm/Layout/TopLeftAction.js +2 -1
  274. package/esm/Layout/Unit.js +2 -1
  275. package/esm/Layout/View.js +2 -1
  276. package/esm/Layout/Zone.js +2 -1
  277. package/esm/Link/Back.js +2 -1
  278. package/esm/Link/Close.js +5 -4
  279. package/esm/Link/CsrLink.js +5 -4
  280. package/esm/Link/NextLink.js +5 -4
  281. package/esm/Link/index.js +4 -3
  282. package/esm/Load/Edit.js +2 -1
  283. package/esm/Load/Edit_Client.js +6 -5
  284. package/esm/Load/PageCSR.js +2 -1
  285. package/esm/Load/Pagination.js +4 -3
  286. package/esm/Load/Units.js +34 -27
  287. package/esm/Load/View.js +3 -2
  288. package/esm/Loading/Area.js +5 -1
  289. package/esm/Loading/Button.js +2 -1
  290. package/esm/Loading/Input.js +2 -1
  291. package/esm/Loading/ProgressBar.js +2 -1
  292. package/esm/Loading/Skeleton.js +7 -1
  293. package/esm/Loading/Spin.js +2 -1
  294. package/esm/Menu.js +105 -89
  295. package/esm/Modal.js +33 -20
  296. package/esm/Model/Edit.js +18 -12
  297. package/esm/Model/EditModal.js +43 -35
  298. package/esm/Model/EditWrapper.js +5 -4
  299. package/esm/Model/LoadInit.js +2 -1
  300. package/esm/Model/New.js +18 -12
  301. package/esm/Model/NewWrapper.js +2 -1
  302. package/esm/Model/NewWrapper_Client.js +5 -4
  303. package/esm/Model/Remove.js +45 -39
  304. package/esm/Model/RemoveWrapper.js +6 -5
  305. package/esm/Model/SureToRemove.js +70 -54
  306. package/esm/Model/View.js +13 -3
  307. package/esm/Model/ViewEditModal.js +30 -19
  308. package/esm/Model/ViewModal.js +9 -8
  309. package/esm/Model/ViewWrapper.js +5 -4
  310. package/esm/More.js +10 -6
  311. package/esm/ObjectId.js +5 -1
  312. package/esm/Pagination.js +45 -40
  313. package/esm/Popconfirm.js +53 -35
  314. package/esm/Radio.js +26 -22
  315. package/esm/RecentTime.js +16 -15
  316. package/esm/Refresh.js +5 -4
  317. package/esm/ScreenNavigator.js +7 -6
  318. package/esm/Select.js +156 -135
  319. package/esm/Signal/Arg.js +94 -54
  320. package/esm/Signal/Doc.js +175 -98
  321. package/esm/Signal/GraphQL.js +143 -59
  322. package/esm/Signal/Listener.js +28 -21
  323. package/esm/Signal/Message.js +166 -80
  324. package/esm/Signal/Object.js +75 -39
  325. package/esm/Signal/PubSub.js +161 -79
  326. package/esm/Signal/Request.js +16 -9
  327. package/esm/Signal/Response.js +30 -17
  328. package/esm/Signal/RestApi.js +186 -84
  329. package/esm/Signal/WebSocket.js +6 -5
  330. package/esm/System/CSR.js +184 -165
  331. package/esm/System/Client.js +24 -20
  332. package/esm/System/Common.js +29 -25
  333. package/esm/System/DevModeToggle.js +14 -10
  334. package/esm/System/Gtag.js +11 -7
  335. package/esm/System/HealthCheck.js +2 -1
  336. package/esm/System/Messages.js +39 -36
  337. package/esm/System/Reconnect.js +25 -3
  338. package/esm/System/Root.js +2 -1
  339. package/esm/System/SSR.js +72 -54
  340. package/esm/System/SelectLanguage.js +25 -21
  341. package/esm/System/ThemeToggle.js +5 -1
  342. package/esm/System/index.js +3 -2
  343. package/esm/Tab/Menu.js +5 -4
  344. package/esm/Tab/Menus.js +2 -1
  345. package/esm/Tab/Panel.js +3 -2
  346. package/esm/Tab/Provider.js +2 -1
  347. package/esm/Tab/index.js +2 -1
  348. package/esm/Table.js +25 -16
  349. package/esm/ToggleSelect.js +59 -54
  350. package/esm/Unauthorized.js +17 -12
  351. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
3
  import { scalarDefaultMap } from "@akanjs/base";
3
4
  import { clsx } from "@akanjs/client";
4
5
  import { capitalize } from "@akanjs/common";
@@ -69,54 +70,69 @@ function QueryMaker({ className, sliceName, query }) {
69
70
  useEffect(() => {
70
71
  setQueryOfModel(querySetting);
71
72
  }, [querySetting]);
72
- return /* @__PURE__ */ React.createElement("div", { className: clsx("flex w-full items-center gap-4", className) }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-2" }, "Query", /* @__PURE__ */ React.createElement(
73
- Select,
74
- {
75
- value: querySetting.queryKey,
76
- options: Object.keys(summaryQueryMap).map((queryKey) => ({
77
- label: l.qry(sliceName, queryKey),
78
- value: queryKey
79
- })),
80
- onChange: (queryKey) => {
81
- const filterQueryArgMetas = getFilterArgMetas(filterRef, queryKey);
82
- const defaultArg = Object.fromEntries(
83
- filterQueryArgMetas.map((queryArgMeta) => [
84
- queryArgMeta.name,
85
- queryArgMeta.nullable ? null : queryArgMeta.arrDepth ? { $in: [] } : queryArgMeta.default ? typeof queryArgMeta.default === "function" ? queryArgMeta.default() : queryArgMeta.default : scalarDefaultMap.get(queryArgMeta.modelRef) ?? null
86
- ])
87
- );
88
- setQuerySetting({ queryKey, arg: defaultArg });
89
- }
90
- }
91
- )), querySetting.queryKey === "search" ? /* @__PURE__ */ React.createElement("div", { className: "flex w-full flex-col gap-2" }, "Search", /* @__PURE__ */ React.createElement("label", { className: "input flex w-full items-center gap-2" }, /* @__PURE__ */ React.createElement(
92
- "input",
93
- {
94
- type: "text",
95
- className: "grow",
96
- placeholder: "Type to search...",
97
- value: querySetting.arg.$search ?? "",
98
- onChange: (e) => {
99
- setQuerySetting({ ...querySetting, arg: e.target.value ? { $search: e.target.value } : {} });
100
- }
101
- }
102
- ), /* @__PURE__ */ React.createElement(BiSearch, { className: "size-4 opacity-70" }))) : summaryQueryMap[querySetting.queryKey] ? null : getFilterArgMetas(filterRef, querySetting.queryKey).map((queryArgMeta, idx) => /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-2", key: idx }, /* @__PURE__ */ React.createElement("div", { className: "text-sm text-gray-500" }, l.qarg(sliceName, querySetting.queryKey, queryArgMeta.name)), /* @__PURE__ */ React.createElement(
103
- QueryArg,
104
- {
105
- queryArgMeta,
106
- value: querySetting.arg[queryArgMeta.name],
107
- onChange: (value) => {
108
- setQuerySetting({
109
- ...querySetting,
110
- arg: { ...querySetting.arg, [queryArgMeta.name]: value }
111
- });
112
- }
113
- }
114
- ))));
73
+ return /* @__PURE__ */ jsxs("div", { className: clsx("flex w-full items-center gap-4", className), children: [
74
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
75
+ "Query",
76
+ /* @__PURE__ */ jsx(
77
+ Select,
78
+ {
79
+ value: querySetting.queryKey,
80
+ options: Object.keys(summaryQueryMap).map((queryKey) => ({
81
+ label: l.qry(sliceName, queryKey),
82
+ value: queryKey
83
+ })),
84
+ onChange: (queryKey) => {
85
+ const filterQueryArgMetas = getFilterArgMetas(filterRef, queryKey);
86
+ const defaultArg = Object.fromEntries(
87
+ filterQueryArgMetas.map((queryArgMeta) => [
88
+ queryArgMeta.name,
89
+ queryArgMeta.nullable ? null : queryArgMeta.arrDepth ? { $in: [] } : queryArgMeta.default ? typeof queryArgMeta.default === "function" ? queryArgMeta.default() : queryArgMeta.default : scalarDefaultMap.get(queryArgMeta.modelRef) ?? null
90
+ ])
91
+ );
92
+ setQuerySetting({ queryKey, arg: defaultArg });
93
+ }
94
+ }
95
+ )
96
+ ] }),
97
+ querySetting.queryKey === "search" ? /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col gap-2", children: [
98
+ "Search",
99
+ /* @__PURE__ */ jsxs("label", { className: "input flex w-full items-center gap-2", children: [
100
+ /* @__PURE__ */ jsx(
101
+ "input",
102
+ {
103
+ type: "text",
104
+ className: "grow",
105
+ placeholder: "Type to search...",
106
+ value: querySetting.arg.$search ?? "",
107
+ onChange: (e) => {
108
+ setQuerySetting({ ...querySetting, arg: e.target.value ? { $search: e.target.value } : {} });
109
+ }
110
+ }
111
+ ),
112
+ /* @__PURE__ */ jsx(BiSearch, { className: "size-4 opacity-70" })
113
+ ] })
114
+ ] }) : summaryQueryMap[querySetting.queryKey] ? null : getFilterArgMetas(filterRef, querySetting.queryKey).map((queryArgMeta, idx) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
115
+ /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-500", children: l.qarg(sliceName, querySetting.queryKey, queryArgMeta.name) }),
116
+ /* @__PURE__ */ jsx(
117
+ QueryArg,
118
+ {
119
+ queryArgMeta,
120
+ value: querySetting.arg[queryArgMeta.name],
121
+ onChange: (value) => {
122
+ setQuerySetting({
123
+ ...querySetting,
124
+ arg: { ...querySetting.arg, [queryArgMeta.name]: value }
125
+ });
126
+ }
127
+ }
128
+ )
129
+ ] }, idx))
130
+ ] });
115
131
  }
116
132
  function QueryArg({ queryArgMeta, value, onChange }) {
117
133
  const argType = getGqlTypeStr(queryArgMeta.modelRef);
118
134
  if (queryArgMeta.enum && queryArgMeta.arrDepth && queryArgMeta.arrDepth < 2)
119
- return /* @__PURE__ */ React.createElement(
135
+ return /* @__PURE__ */ jsx(
120
136
  QueryArg.Enum,
121
137
  {
122
138
  options: queryArgMeta.enum.values,
@@ -126,10 +142,10 @@ function QueryArg({ queryArgMeta, value, onChange }) {
126
142
  multiple: queryArgMeta.arrDepth ? queryArgMeta.arrDepth >= 1 : false
127
143
  }
128
144
  );
129
- return argType === "ID" ? /* @__PURE__ */ React.createElement(QueryArg.ID, { queryArgMeta, value, onChange }) : argType === "Int" ? /* @__PURE__ */ React.createElement(QueryArg.Int, { value, onChange }) : argType === "Float" ? /* @__PURE__ */ React.createElement(QueryArg.Float, { value, onChange }) : argType === "String" ? /* @__PURE__ */ React.createElement(QueryArg.String, { value, onChange }) : argType === "Boolean" ? /* @__PURE__ */ React.createElement(QueryArg.Boolean, { value, onChange }) : argType === "Date" ? /* @__PURE__ */ React.createElement(QueryArg.Date, { value, onChange }) : argType === "JSON" ? /* @__PURE__ */ React.createElement(QueryArg.Json, { value, onChange }) : /* @__PURE__ */ React.createElement(React.Fragment, null);
145
+ return argType === "ID" ? /* @__PURE__ */ jsx(QueryArg.ID, { queryArgMeta, value, onChange }) : argType === "Int" ? /* @__PURE__ */ jsx(QueryArg.Int, { value, onChange }) : argType === "Float" ? /* @__PURE__ */ jsx(QueryArg.Float, { value, onChange }) : argType === "String" ? /* @__PURE__ */ jsx(QueryArg.String, { value, onChange }) : argType === "Boolean" ? /* @__PURE__ */ jsx(QueryArg.Boolean, { value, onChange }) : argType === "Date" ? /* @__PURE__ */ jsx(QueryArg.Date, { value, onChange }) : argType === "JSON" ? /* @__PURE__ */ jsx(QueryArg.Json, { value, onChange }) : /* @__PURE__ */ jsx(Fragment, {});
130
146
  }
131
147
  const ArgEnum = ({ options, value, onChange, nullable, multiple }) => {
132
- return /* @__PURE__ */ React.createElement(
148
+ return /* @__PURE__ */ jsx(
133
149
  Select,
134
150
  {
135
151
  options: options.map((option) => ({
@@ -147,7 +163,7 @@ const ArgEnum = ({ options, value, onChange, nullable, multiple }) => {
147
163
  QueryArg.Enum = ArgEnum;
148
164
  const ArgID = ({ queryArgMeta, value, onChange }) => {
149
165
  if (!queryArgMeta.ref)
150
- return /* @__PURE__ */ React.createElement(
166
+ return /* @__PURE__ */ jsx(
151
167
  Input,
152
168
  {
153
169
  inputClassName: "w-full",
@@ -159,7 +175,7 @@ const ArgID = ({ queryArgMeta, value, onChange }) => {
159
175
  }
160
176
  );
161
177
  else
162
- return /* @__PURE__ */ React.createElement(SelectIDWithRef, { queryArgMeta, value, onChange });
178
+ return /* @__PURE__ */ jsx(SelectIDWithRef, { queryArgMeta, value, onChange });
163
179
  };
164
180
  QueryArg.ID = ArgID;
165
181
  const SelectIDWithRef = ({ queryArgMeta, value, onChange }) => {
@@ -170,40 +186,46 @@ const SelectIDWithRef = ({ queryArgMeta, value, onChange }) => {
170
186
  const modelList = storeUse[`${queryArgMeta.ref}List`]();
171
187
  const renderOption = queryArgMeta.renderOption ?? ((value2) => value2.id);
172
188
  const selectedModel = value ? modelList.get(value) : null;
173
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
174
- "button",
175
- {
176
- className: "btn",
177
- onClick: () => {
178
- setModalOpen(true);
179
- }
180
- },
181
- selectedModel ? renderOption(selectedModel) : `Select ${queryArgMeta.ref}`
182
- ), /* @__PURE__ */ React.createElement(
183
- Modal,
184
- {
185
- open: modalOpen,
186
- onCancel: () => {
187
- setModalOpen(false);
189
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
190
+ /* @__PURE__ */ jsx(
191
+ "button",
192
+ {
193
+ className: "btn",
194
+ onClick: () => {
195
+ setModalOpen(true);
196
+ },
197
+ children: selectedModel ? renderOption(selectedModel) : `Select ${queryArgMeta.ref}`
188
198
  }
189
- },
190
- /* @__PURE__ */ React.createElement("div", { className: "flex w-full flex-col gap-4 pb-[256px]" }, /* @__PURE__ */ React.createElement(QueryMaker, { sliceName: queryArgMeta.ref }), /* @__PURE__ */ React.createElement(
191
- Select,
199
+ ),
200
+ /* @__PURE__ */ jsx(
201
+ Modal,
192
202
  {
193
- options: modelList.map((model) => ({
194
- label: renderOption(model),
195
- value: model.id
196
- })),
197
- value,
198
- onChange: (value2) => {
199
- onChange(value2);
200
- }
203
+ open: modalOpen,
204
+ onCancel: () => {
205
+ setModalOpen(false);
206
+ },
207
+ children: /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col gap-4 pb-[256px]", children: [
208
+ /* @__PURE__ */ jsx(QueryMaker, { sliceName: queryArgMeta.ref }),
209
+ /* @__PURE__ */ jsx(
210
+ Select,
211
+ {
212
+ options: modelList.map((model) => ({
213
+ label: renderOption(model),
214
+ value: model.id
215
+ })),
216
+ value,
217
+ onChange: (value2) => {
218
+ onChange(value2);
219
+ }
220
+ }
221
+ )
222
+ ] })
201
223
  }
202
- ))
203
- ));
224
+ )
225
+ ] });
204
226
  };
205
227
  const ArgInt = ({ value, onChange }) => {
206
- return /* @__PURE__ */ React.createElement(
228
+ return /* @__PURE__ */ jsx(
207
229
  Input.Number,
208
230
  {
209
231
  inputClassName: "w-full",
@@ -217,7 +239,7 @@ const ArgInt = ({ value, onChange }) => {
217
239
  };
218
240
  QueryArg.Int = ArgInt;
219
241
  const ArgFloat = ({ value, onChange }) => {
220
- return /* @__PURE__ */ React.createElement(
242
+ return /* @__PURE__ */ jsx(
221
243
  Input.Number,
222
244
  {
223
245
  inputClassName: "w-full",
@@ -231,7 +253,7 @@ const ArgFloat = ({ value, onChange }) => {
231
253
  };
232
254
  QueryArg.Float = ArgFloat;
233
255
  const ArgString = ({ value, onChange }) => {
234
- return /* @__PURE__ */ React.createElement(
256
+ return /* @__PURE__ */ jsx(
235
257
  Input,
236
258
  {
237
259
  inputClassName: "w-full",
@@ -245,7 +267,7 @@ const ArgString = ({ value, onChange }) => {
245
267
  };
246
268
  QueryArg.String = ArgString;
247
269
  const ArgBoolean = ({ value, onChange }) => {
248
- return /* @__PURE__ */ React.createElement(
270
+ return /* @__PURE__ */ jsx(
249
271
  Input.Checkbox,
250
272
  {
251
273
  className: "w-full",
@@ -258,7 +280,7 @@ const ArgBoolean = ({ value, onChange }) => {
258
280
  };
259
281
  QueryArg.Boolean = ArgBoolean;
260
282
  const ArgDate = ({ value, onChange }) => {
261
- return /* @__PURE__ */ React.createElement(
283
+ return /* @__PURE__ */ jsx(
262
284
  DatePicker,
263
285
  {
264
286
  className: "w-full",
@@ -271,7 +293,7 @@ const ArgDate = ({ value, onChange }) => {
271
293
  };
272
294
  QueryArg.Date = ArgDate;
273
295
  const ArgJson = ({ value, onChange }) => {
274
- return /* @__PURE__ */ React.createElement(
296
+ return /* @__PURE__ */ jsx(
275
297
  Input.TextArea,
276
298
  {
277
299
  validate: (e) => true,
@@ -1,8 +1,9 @@
1
1
  "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import { capitalize } from "@akanjs/common";
3
4
  import { usePage } from "@akanjs/next";
4
5
  import { st } from "@akanjs/store";
5
- import React, { useEffect, useMemo } from "react";
6
+ import { useEffect, useMemo } from "react";
6
7
  import { Model } from "../Model";
7
8
  import { Table } from "../Table";
8
9
  import { Action, convToAntdColumn } from "./Item";
@@ -41,7 +42,7 @@ function TableList({
41
42
  const modelListLoading = storeUse[namesOfSlice.modelListLoading]();
42
43
  const RenderTemplate = ({ id }) => {
43
44
  const Edit = renderTemplate;
44
- return Edit ? /* @__PURE__ */ React.createElement(Edit, { ...{ [names.modelId]: id } }) : null;
45
+ return Edit ? /* @__PURE__ */ jsx(Edit, { ...{ [names.modelId]: id } }) : null;
45
46
  };
46
47
  useEffect(() => {
47
48
  if (queryArgs.length)
@@ -58,15 +59,18 @@ function TableList({
58
59
  return [
59
60
  {
60
61
  ...firstCol,
61
- render: (value, model, idx) => /* @__PURE__ */ React.createElement("div", { key: `${model.id}-${idx}`, className: "flex items-center" }, /* @__PURE__ */ React.createElement("div", { className: "mr-2" }, firstCol.render ? firstCol.render(value, model) : value), actions && (typeof actions === "function" ? actions(model, idx) : actions).filter((action) => typeof action === "string").map((action, idx2) => /* @__PURE__ */ React.createElement(
62
- Action,
63
- {
64
- key: `${model.id}-${action}`,
65
- model,
66
- action,
67
- sliceName
68
- }
69
- )))
62
+ render: (value, model, idx) => /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
63
+ /* @__PURE__ */ jsx("div", { className: "mr-2", children: firstCol.render ? firstCol.render(value, model) : value }),
64
+ actions && (typeof actions === "function" ? actions(model, idx) : actions).filter((action) => typeof action === "string").map((action, idx2) => /* @__PURE__ */ jsx(
65
+ Action,
66
+ {
67
+ model,
68
+ action,
69
+ sliceName
70
+ },
71
+ `${model.id}-${action}`
72
+ ))
73
+ ] }, `${model.id}-${idx}`)
70
74
  },
71
75
  ...columns.slice(1).map((col) => ({
72
76
  ...convToAntdColumn(col),
@@ -77,33 +81,40 @@ function TableList({
77
81
  key: "actions",
78
82
  dataIndex: "id",
79
83
  title: l("shared.actions"),
80
- render: (_, model, idx) => /* @__PURE__ */ React.createElement("div", { className: "flex gap-1" }, (typeof actions === "function" ? actions(model, idx) : actions).filter((action) => typeof action !== "string").map((action, idx2) => /* @__PURE__ */ React.createElement(Action, { key: `${model.id}-${idx2}`, model, action, sliceName })))
84
+ render: (_, model, idx) => /* @__PURE__ */ jsx("div", { className: "flex gap-1", children: (typeof actions === "function" ? actions(model, idx) : actions).filter((action) => typeof action !== "string").map((action, idx2) => /* @__PURE__ */ jsx(Action, { model, action, sliceName }, `${model.id}-${idx2}`)) })
81
85
  }
82
86
  ] : []
83
87
  ];
84
88
  }, []);
85
- return /* @__PURE__ */ React.createElement("div", { className }, /* @__PURE__ */ React.createElement(
86
- Table,
87
- {
88
- dataSource: modelListLoading ? [] : [...modelList],
89
- columns: cols,
90
- loading: !!modelListLoading,
91
- size: "small",
92
- rowKey: (model) => model.id,
93
- pagination: false,
94
- onRow: (model, idx) => ({
95
- onClick: () => onItemClick?.(model, idx)
96
- })
97
- }
98
- ), /* @__PURE__ */ React.createElement(DataPagination, { sliceName }), !modelListLoading ? modelList.map((model) => /* @__PURE__ */ React.createElement("div", { key: model.id }, /* @__PURE__ */ React.createElement(Model.EditModal, { id: model.id, sliceName, renderTitle }, /* @__PURE__ */ React.createElement(RenderTemplate, { id: model.id })), renderView ? /* @__PURE__ */ React.createElement(
99
- Model.ViewModal,
100
- {
101
- id: model.id,
102
- sliceName,
103
- renderTitle,
104
- renderView
105
- }
106
- ) : null)) : null);
89
+ return /* @__PURE__ */ jsxs("div", { className, children: [
90
+ /* @__PURE__ */ jsx(
91
+ Table,
92
+ {
93
+ dataSource: modelListLoading ? [] : [...modelList],
94
+ columns: cols,
95
+ loading: !!modelListLoading,
96
+ size: "small",
97
+ rowKey: (model) => model.id,
98
+ pagination: false,
99
+ onRow: (model, idx) => ({
100
+ onClick: () => onItemClick?.(model, idx)
101
+ })
102
+ }
103
+ ),
104
+ /* @__PURE__ */ jsx(DataPagination, { sliceName }),
105
+ !modelListLoading ? modelList.map((model) => /* @__PURE__ */ jsxs("div", { children: [
106
+ /* @__PURE__ */ jsx(Model.EditModal, { id: model.id, sliceName, renderTitle, children: /* @__PURE__ */ jsx(RenderTemplate, { id: model.id }) }),
107
+ renderView ? /* @__PURE__ */ jsx(
108
+ Model.ViewModal,
109
+ {
110
+ id: model.id,
111
+ sliceName,
112
+ renderTitle,
113
+ renderView
114
+ }
115
+ ) : null
116
+ ] }, model.id)) : null
117
+ ] });
107
118
  }
108
119
  export {
109
120
  TableList as default
package/esm/DatePicker.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import "react-datepicker/dist/react-datepicker.css";
3
4
  import { dayjs } from "@akanjs/base";
4
5
  import { clsx } from "@akanjs/client";
5
6
  import { msg } from "@akanjs/dictionary";
6
7
  import { lazy } from "@akanjs/next";
7
- import React, { useEffect, useRef } from "react";
8
+ import { useEffect, useRef } from "react";
8
9
  import { AiOutlineSwapRight } from "react-icons/ai";
9
10
  const ReactDatePicker = lazy(() => import("react-datepicker"), { ssr: false });
10
11
  const DatePicker = ({
@@ -31,7 +32,7 @@ const DatePicker = ({
31
32
  }
32
33
  onChange(dayjs(date));
33
34
  };
34
- return /* @__PURE__ */ React.createElement(
35
+ return /* @__PURE__ */ jsx(
35
36
  ReactDatePicker,
36
37
  {
37
38
  className: clsx("input text-center", className),
@@ -75,36 +76,40 @@ const RangePicker = ({
75
76
  onChange([value[0] ?? dayjs(), dayjs(date)]);
76
77
  };
77
78
  const pickerClassName = "m-0 input focus:outline-hidden z-50 p-3 text-center h-full w-full ";
78
- return /* @__PURE__ */ React.createElement("div", { className: clsx("input flex h-full w-fit items-center gap-2 p-0", className) }, /* @__PURE__ */ React.createElement(
79
- ReactDatePicker,
80
- {
81
- className: pickerClassName,
82
- selected: value[0] ? value[0].toDate() : void 0,
83
- selectsStart: true,
84
- startDate: value[0] ? value[0].toDate() : void 0,
85
- endDate: value[1] ? value[1].toDate() : void 0,
86
- onChange: handleStartDateChange,
87
- showTimeSelect: showTime,
88
- timeIntervals,
89
- filterDate: (date) => !disabledDate?.(dayjs(date)) ? true : false,
90
- dateFormat: format
91
- }
92
- ), /* @__PURE__ */ React.createElement(AiOutlineSwapRight, { className: "text-3xl text-gray-400" }), /* @__PURE__ */ React.createElement(
93
- ReactDatePicker,
94
- {
95
- className: pickerClassName,
96
- selected: value[1] ? value[1].toDate() : void 0,
97
- selectsEnd: true,
98
- startDate: value[0] ? value[0].toDate() : void 0,
99
- endDate: value[1] ? value[1].toDate() : void 0,
100
- onChange: handleEndDateChange,
101
- showTimeSelect: showTime,
102
- timeIntervals,
103
- filterDate: (date) => !disabledDate?.(dayjs(date)) && !!value[0] && !dayjs(date).add(1, "day").isBefore(value[0]) ? true : false,
104
- filterTime: (time) => !!value[0] && dayjs(time).isAfter(value[0]),
105
- dateFormat: format
106
- }
107
- ));
79
+ return /* @__PURE__ */ jsxs("div", { className: clsx("input flex h-full w-fit items-center gap-2 p-0", className), children: [
80
+ /* @__PURE__ */ jsx(
81
+ ReactDatePicker,
82
+ {
83
+ className: pickerClassName,
84
+ selected: value[0] ? value[0].toDate() : void 0,
85
+ selectsStart: true,
86
+ startDate: value[0] ? value[0].toDate() : void 0,
87
+ endDate: value[1] ? value[1].toDate() : void 0,
88
+ onChange: handleStartDateChange,
89
+ showTimeSelect: showTime,
90
+ timeIntervals,
91
+ filterDate: (date) => !disabledDate?.(dayjs(date)) ? true : false,
92
+ dateFormat: format
93
+ }
94
+ ),
95
+ /* @__PURE__ */ jsx(AiOutlineSwapRight, { className: "text-3xl text-gray-400" }),
96
+ /* @__PURE__ */ jsx(
97
+ ReactDatePicker,
98
+ {
99
+ className: pickerClassName,
100
+ selected: value[1] ? value[1].toDate() : void 0,
101
+ selectsEnd: true,
102
+ startDate: value[0] ? value[0].toDate() : void 0,
103
+ endDate: value[1] ? value[1].toDate() : void 0,
104
+ onChange: handleEndDateChange,
105
+ showTimeSelect: showTime,
106
+ timeIntervals,
107
+ filterDate: (date) => !disabledDate?.(dayjs(date)) && !!value[0] && !dayjs(date).add(1, "day").isBefore(value[0]) ? true : false,
108
+ filterTime: (time) => !!value[0] && dayjs(time).isAfter(value[0]),
109
+ dateFormat: format
110
+ }
111
+ )
112
+ ] });
108
113
  };
109
114
  DatePicker.RangePicker = RangePicker;
110
115
  const TimePicker = ({
@@ -122,7 +127,7 @@ const TimePicker = ({
122
127
  }
123
128
  onChange(dayjs(date));
124
129
  };
125
- return /* @__PURE__ */ React.createElement(
130
+ return /* @__PURE__ */ jsx(
126
131
  ReactDatePicker,
127
132
  {
128
133
  wrapperClassName: "inline-block",
@@ -1,17 +1,18 @@
1
1
  "use client";
2
+ import { jsx } from "react/jsx-runtime";
2
3
  import { useContext } from "react";
3
4
  import { DialogContext } from "./context";
4
5
  const Close = ({ className, children }) => {
5
6
  const { setOpen } = useContext(DialogContext);
6
- return /* @__PURE__ */ React.createElement(
7
+ return /* @__PURE__ */ jsx(
7
8
  "a",
8
9
  {
9
10
  className,
10
11
  onClick: () => {
11
12
  setOpen(false);
12
- }
13
- },
14
- children
13
+ },
14
+ children
15
+ }
15
16
  );
16
17
  };
17
18
  export {
@@ -1,7 +1,8 @@
1
1
  "use client";
2
+ import { jsx } from "react/jsx-runtime";
2
3
  import { clsx } from "@akanjs/client";
3
4
  const Content = ({ className, children }) => {
4
- return /* @__PURE__ */ React.createElement("div", { className: clsx("block w-full", className) }, children);
5
+ return /* @__PURE__ */ jsx("div", { className: clsx("block w-full", className), children });
5
6
  };
6
7
  export {
7
8
  Content
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import { clsx } from "@akanjs/client";
3
4
  import { usePage } from "@akanjs/next";
4
5
  import * as Dialog from "@radix-ui/react-dialog";
@@ -68,58 +69,68 @@ const Modal = ({ className, bodyClassName, confirmClose, children, onCancel }) =
68
69
  else
69
70
  void closeModal({});
70
71
  }, [open]);
71
- return /* @__PURE__ */ React.createElement(Dialog.Portal, null, /* @__PURE__ */ React.createElement(
72
- Dialog.Overlay,
73
- {
74
- onClick: () => {
75
- void closeModal({ confirmClose });
76
- }
77
- },
78
- showBackground ? /* @__PURE__ */ React.createElement("div", { className: "data-[state=open]:animate-fadeIn bg-base-content/50 fixed inset-0 z-10 backdrop-blur-md" }) : null
79
- ), /* @__PURE__ */ React.createElement(
80
- Dialog.Content,
81
- {
82
- className: "fixed top-1/2 left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center",
83
- asChild: true,
84
- forceMount: true
85
- },
86
- /* @__PURE__ */ React.createElement("div", { className: "z-10" }, /* @__PURE__ */ React.createElement(a.div, { ref, style: { translateY, opacity } }, /* @__PURE__ */ React.createElement(
87
- "button",
88
- {
89
- className: "btn btn-circle btn-sm absolute top-[-16px] right-0 z-20 md:top-[-40px]",
90
- onClick: () => void closeModal({ confirmClose })
91
- },
92
- /* @__PURE__ */ React.createElement(BiX, { className: "text-3xl" })
93
- ), /* @__PURE__ */ React.createElement(
94
- "div",
72
+ return /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
73
+ /* @__PURE__ */ jsx(
74
+ Dialog.Overlay,
95
75
  {
96
- className: clsx(
97
- "bg-base-100 animate-fadeIn mx-auto mt-6 flex max-h-[75vh] w-full max-w-[96vw] max-w-screen flex-col items-center justify-center overflow-x-hidden rounded-lg transition-all duration-100 sm:w-[90%] sm:px-2 sm:pb-2 md:mt-0 md:max-h-[90vh] md:pt-0",
98
- className
99
- )
100
- },
101
- /* @__PURE__ */ React.createElement(Dialog.Title, { asChild: true }, /* @__PURE__ */ React.createElement(
102
- a.div,
103
- {
104
- ...bind(),
105
- className: "animate-fadeIn relative z-10 flex w-full cursor-pointer flex-col items-center justify-center px-4 pt-1"
76
+ onClick: () => {
77
+ void closeModal({ confirmClose });
106
78
  },
107
- /* @__PURE__ */ React.createElement("div", { className: "flex w-full cursor-pointer items-center justify-center pt-1 opacity-50" }, /* @__PURE__ */ React.createElement("div", { className: "h-1 w-24 rounded-full bg-gray-500" })),
108
- /* @__PURE__ */ React.createElement("div", { className: "flex w-full items-center justify-start" }, /* @__PURE__ */ React.createElement("div", { className: "w-full text-start text-lg font-bold" }, title))
109
- )),
110
- /* @__PURE__ */ React.createElement(
111
- "div",
112
- {
113
- className: clsx(
114
- "border-base-content/30 scrollbar-none relative m-2 flex size-full min-w-[90vw] overflow-x-hidden overflow-y-scroll border-t-[0.1px] p-4 sm:p-4 md:min-w-[384px] md:px-8 lg:min-w-[576px] xl:min-w-[768px]",
115
- bodyClassName
79
+ children: showBackground ? /* @__PURE__ */ jsx("div", { className: "data-[state=open]:animate-fadeIn bg-base-content/50 fixed inset-0 z-10 backdrop-blur-md" }) : null
80
+ }
81
+ ),
82
+ /* @__PURE__ */ jsx(
83
+ Dialog.Content,
84
+ {
85
+ className: "fixed top-1/2 left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center",
86
+ asChild: true,
87
+ forceMount: true,
88
+ children: /* @__PURE__ */ jsx("div", { className: "z-10", children: /* @__PURE__ */ jsxs(a.div, { ref, style: { translateY, opacity }, children: [
89
+ /* @__PURE__ */ jsx(
90
+ "button",
91
+ {
92
+ className: "btn btn-circle btn-sm absolute top-[-16px] right-0 z-20 md:top-[-40px]",
93
+ onClick: () => void closeModal({ confirmClose }),
94
+ children: /* @__PURE__ */ jsx(BiX, { className: "text-3xl" })
95
+ }
96
+ ),
97
+ /* @__PURE__ */ jsxs(
98
+ "div",
99
+ {
100
+ className: clsx(
101
+ "bg-base-100 animate-fadeIn mx-auto mt-6 flex max-h-[75vh] w-full max-w-[96vw] max-w-screen flex-col items-center justify-center overflow-x-hidden rounded-lg transition-all duration-100 sm:w-[90%] sm:px-2 sm:pb-2 md:mt-0 md:max-h-[90vh] md:pt-0",
102
+ className
103
+ ),
104
+ children: [
105
+ /* @__PURE__ */ jsx(Dialog.Title, { asChild: true, children: /* @__PURE__ */ jsxs(
106
+ a.div,
107
+ {
108
+ ...bind(),
109
+ className: "animate-fadeIn relative z-10 flex w-full cursor-pointer flex-col items-center justify-center px-4 pt-1",
110
+ children: [
111
+ /* @__PURE__ */ jsx("div", { className: "flex w-full cursor-pointer items-center justify-center pt-1 opacity-50", children: /* @__PURE__ */ jsx("div", { className: "h-1 w-24 rounded-full bg-gray-500" }) }),
112
+ /* @__PURE__ */ jsx("div", { className: "flex w-full items-center justify-start", children: /* @__PURE__ */ jsx("div", { className: "w-full text-start text-lg font-bold", children: title }) })
113
+ ]
114
+ }
115
+ ) }),
116
+ /* @__PURE__ */ jsx(
117
+ "div",
118
+ {
119
+ className: clsx(
120
+ "border-base-content/30 scrollbar-none relative m-2 flex size-full min-w-[90vw] overflow-x-hidden overflow-y-scroll border-t-[0.1px] p-4 sm:p-4 md:min-w-[384px] md:px-8 lg:min-w-[576px] xl:min-w-[768px]",
121
+ bodyClassName
122
+ ),
123
+ children
124
+ }
125
+ ),
126
+ action ? /* @__PURE__ */ jsx("div", { className: "w-full", children: action }) : null
127
+ ]
128
+ }
116
129
  )
117
- },
118
- children
119
- ),
120
- action ? /* @__PURE__ */ React.createElement("div", { className: "w-full" }, action) : null
121
- )))
122
- ));
130
+ ] }) })
131
+ }
132
+ )
133
+ ] });
123
134
  };
124
135
  export {
125
136
  Modal