bmdl-sdk 1.5.9 → 2.0.1

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 (341) hide show
  1. package/.prettierrc +37 -0
  2. package/bin/dev.js +10 -8
  3. package/bin/init.js +2 -1
  4. package/bmdl-sdk-2.0.1.tgz +0 -0
  5. package/global.d.ts +9 -0
  6. package/next.config.ts +35 -0
  7. package/package.json +35 -8
  8. package/postcss.config.mjs +5 -0
  9. package/public/favicon.ico +0 -0
  10. package/public/images/bg/404.bg.dark.png +0 -0
  11. package/public/images/bg/404.bg.png +0 -0
  12. package/public/images/bg/maintenance.bg.dark.png +0 -0
  13. package/public/images/bg/maintenance.bg.png +0 -0
  14. package/public/images/bg/not-authorized.bg.dark.png +0 -0
  15. package/public/images/bg/not-authorized.bg.png +0 -0
  16. package/public/images/bg/redirect.bg.dark.png +0 -0
  17. package/public/images/bg/redirect.bg.png +0 -0
  18. package/public/images/cover/email-verify.cover.dark.png +0 -0
  19. package/public/images/cover/email-verify.cover.png +0 -0
  20. package/public/images/cover/login.cover.dark.png +0 -0
  21. package/public/images/cover/login.cover.png +0 -0
  22. package/public/images/cover/password-forgot.cover.dark.png +0 -0
  23. package/public/images/cover/password-forgot.cover.png +0 -0
  24. package/public/images/cover/password-reset.cover.dark.png +0 -0
  25. package/public/images/cover/password-reset.cover.png +0 -0
  26. package/public/images/cover/register.cover.dark.png +0 -0
  27. package/public/images/cover/register.cover.png +0 -0
  28. package/public/images/cover/two-factor-verify.cover.dark.png +0 -0
  29. package/public/images/cover/two-factor-verify.cover.png +0 -0
  30. package/public/images/lang/en.png +0 -0
  31. package/public/images/lang/ru.png +0 -0
  32. package/public/locales/en/datasets.json +92 -0
  33. package/public/locales/en/errors.json +402 -0
  34. package/public/locales/en/general.json +139 -0
  35. package/public/locales/ru/datasets.json +92 -0
  36. package/public/locales/ru/errors.json +406 -0
  37. package/public/locales/ru/general.json +139 -0
  38. package/src/app/datasets/page.tsx +25 -0
  39. package/src/app/layout.tsx +45 -0
  40. package/src/app/not-found.tsx +34 -0
  41. package/src/app/page.tsx +24 -0
  42. package/src/components/atoms/Actions/Actions.styles.ts +31 -0
  43. package/src/components/atoms/Actions/Actions.tsx +45 -0
  44. package/src/components/atoms/Actions/index.ts +1 -0
  45. package/src/components/atoms/Avatar/Avatar.styles.ts +95 -0
  46. package/src/components/atoms/Avatar/Avatar.tsx +46 -0
  47. package/src/components/atoms/Avatar/index.ts +1 -0
  48. package/src/components/atoms/Badge/Badge.styles.ts +93 -0
  49. package/src/components/atoms/Badge/Badge.tsx +31 -0
  50. package/src/components/atoms/Badge/index.ts +1 -0
  51. package/src/components/atoms/Button/Button.styles.ts +189 -0
  52. package/src/components/atoms/Button/Button.tsx +29 -0
  53. package/src/components/atoms/Button/index.ts +1 -0
  54. package/src/components/atoms/Calendar/Calendar.styles.ts +227 -0
  55. package/src/components/atoms/Calendar/Calendar.tsx +96 -0
  56. package/src/components/atoms/Calendar/index.ts +1 -0
  57. package/src/components/atoms/Checkbox/Checkbox.styles.ts +37 -0
  58. package/src/components/atoms/Checkbox/Checkbox.tsx +26 -0
  59. package/src/components/atoms/Checkbox/index.ts +1 -0
  60. package/src/components/atoms/Date/Date.styles.ts +6 -0
  61. package/src/components/atoms/Date/Date.tsx +27 -0
  62. package/src/components/atoms/Date/index.ts +1 -0
  63. package/src/components/atoms/DatePicker/DatePicker.styles.ts +53 -0
  64. package/src/components/atoms/DatePicker/DatePicker.tsx +114 -0
  65. package/src/components/atoms/DatePicker/DatePicker.utils.tsx +49 -0
  66. package/src/components/atoms/DatePicker/index.ts +1 -0
  67. package/src/components/atoms/Dialog/Dialog.styles.ts +71 -0
  68. package/src/components/atoms/Dialog/Dialog.tsx +55 -0
  69. package/src/components/atoms/Dialog/index.ts +1 -0
  70. package/src/components/atoms/Dropdown/Divider/Divider.styles.ts +8 -0
  71. package/src/components/atoms/Dropdown/Divider/Divider.tsx +14 -0
  72. package/src/components/atoms/Dropdown/Divider/index.ts +1 -0
  73. package/src/components/atoms/Dropdown/Dropdown.styles.ts +31 -0
  74. package/src/components/atoms/Dropdown/Dropdown.tsx +48 -0
  75. package/src/components/atoms/Dropdown/Item/Item.styles.ts +12 -0
  76. package/src/components/atoms/Dropdown/Item/Item.tsx +18 -0
  77. package/src/components/atoms/Dropdown/Item/index.ts +1 -0
  78. package/src/components/atoms/Dropdown/index.ts +1 -0
  79. package/src/components/atoms/Form/Form.styles.ts +23 -0
  80. package/src/components/atoms/Form/Form.tsx +21 -0
  81. package/src/components/atoms/Form/Item/Item.styles.ts +23 -0
  82. package/src/components/atoms/Form/Item/Item.tsx +11 -0
  83. package/src/components/atoms/Form/Item/index.ts +1 -0
  84. package/src/components/atoms/Form/Label/Label.tsx +11 -0
  85. package/src/components/atoms/Form/Label/index.ts +1 -0
  86. package/src/components/atoms/Form/Message/Message.tsx +29 -0
  87. package/src/components/atoms/Form/Message/index.ts +1 -0
  88. package/src/components/atoms/Form/index.ts +1 -0
  89. package/src/components/atoms/Input/Email/Email.tsx +11 -0
  90. package/src/components/atoms/Input/Email/index.ts +1 -0
  91. package/src/components/atoms/Input/Input.styles.ts +77 -0
  92. package/src/components/atoms/Input/Input.tsx +29 -0
  93. package/src/components/atoms/Input/Number/Number.tsx +12 -0
  94. package/src/components/atoms/Input/Number/index.ts +1 -0
  95. package/src/components/atoms/Input/OTP/OTP.styles.ts +30 -0
  96. package/src/components/atoms/Input/OTP/OTP.tsx +23 -0
  97. package/src/components/atoms/Input/OTP/index.ts +1 -0
  98. package/src/components/atoms/Input/Password/Password.tsx +11 -0
  99. package/src/components/atoms/Input/Password/index.ts +1 -0
  100. package/src/components/atoms/Input/Search/Search.tsx +12 -0
  101. package/src/components/atoms/Input/Search/index.ts +1 -0
  102. package/src/components/atoms/Input/index.ts +1 -0
  103. package/src/components/atoms/Label/Label.styles.ts +29 -0
  104. package/src/components/atoms/Label/Label.tsx +18 -0
  105. package/src/components/atoms/Label/index.ts +1 -0
  106. package/src/components/atoms/Logo/Logo.styles.ts +16 -0
  107. package/src/components/atoms/Logo/Logo.tsx +20 -0
  108. package/src/components/atoms/Logo/index.ts +1 -0
  109. package/src/components/atoms/Pagination/Pagination.styles.ts +77 -0
  110. package/src/components/atoms/Pagination/Pagination.tsx +131 -0
  111. package/src/components/atoms/Pagination/index.ts +1 -0
  112. package/src/components/atoms/Popover/Popover.styles.ts +28 -0
  113. package/src/components/atoms/Popover/Popover.tsx +46 -0
  114. package/src/components/atoms/Popover/index.ts +1 -0
  115. package/src/components/atoms/Radio/Item/Item.styles.ts +35 -0
  116. package/src/components/atoms/Radio/Item/Item.tsx +18 -0
  117. package/src/components/atoms/Radio/Item/index.ts +1 -0
  118. package/src/components/atoms/Radio/Radio.styles.ts +25 -0
  119. package/src/components/atoms/Radio/Radio.tsx +21 -0
  120. package/src/components/atoms/Radio/index.ts +1 -0
  121. package/src/components/atoms/RangeNumber/RangeNumber.tsx +33 -0
  122. package/src/components/atoms/RangeNumber/index.ts +1 -0
  123. package/src/components/atoms/Select/Item/Item.styles.ts +22 -0
  124. package/src/components/atoms/Select/Item/Item.tsx +17 -0
  125. package/src/components/atoms/Select/Item/index.ts +1 -0
  126. package/src/components/atoms/Select/Select.styles.ts +149 -0
  127. package/src/components/atoms/Select/Select.tsx +68 -0
  128. package/src/components/atoms/Select/index.ts +1 -0
  129. package/src/components/atoms/Separator/Separator.styles.ts +13 -0
  130. package/src/components/atoms/Separator/Separator.tsx +20 -0
  131. package/src/components/atoms/Separator/index.ts +1 -0
  132. package/src/components/atoms/Sheet/Sheet.styles.ts +100 -0
  133. package/src/components/atoms/Sheet/Sheet.tsx +53 -0
  134. package/src/components/atoms/Sheet/index.ts +1 -0
  135. package/src/components/atoms/Skeleton/Skeleton.styles.ts +30 -0
  136. package/src/components/atoms/Skeleton/Skeleton.tsx +11 -0
  137. package/src/components/atoms/Skeleton/index.ts +1 -0
  138. package/src/components/atoms/Spin/Spin.styles.ts +17 -0
  139. package/src/components/atoms/Spin/Spin.tsx +19 -0
  140. package/src/components/atoms/Spin/index.ts +1 -0
  141. package/src/components/atoms/Switch/Switch.styles.ts +34 -0
  142. package/src/components/atoms/Switch/Switch.tsx +20 -0
  143. package/src/components/atoms/Switch/index.ts +1 -0
  144. package/src/components/atoms/Table/FilterContent/FilterContent.styles.ts +33 -0
  145. package/src/components/atoms/Table/FilterContent/FilterContent.tsx +300 -0
  146. package/src/components/atoms/Table/FilterContent/index.ts +1 -0
  147. package/src/components/atoms/Table/FilterIcon/FilterIcon.tsx +16 -0
  148. package/src/components/atoms/Table/FilterIcon/index.ts +1 -0
  149. package/src/components/atoms/Table/SortIcon/SortIcon.tsx +32 -0
  150. package/src/components/atoms/Table/SortIcon/index.ts +1 -0
  151. package/src/components/atoms/Table/Table.styles.ts +178 -0
  152. package/src/components/atoms/Table/Table.tsx +484 -0
  153. package/src/components/atoms/Table/Table.utils.tsx +19 -0
  154. package/src/components/atoms/Table/index.ts +1 -0
  155. package/src/components/atoms/Tabs/Tabs.tsx +15 -0
  156. package/src/components/atoms/Tabs/index.ts +1 -0
  157. package/src/components/atoms/Textarea/Textarea.styles.ts +64 -0
  158. package/src/components/atoms/Textarea/Textarea.tsx +15 -0
  159. package/src/components/atoms/Textarea/index.ts +1 -0
  160. package/src/components/atoms/Toast/Toast.styles.ts +35 -0
  161. package/src/components/atoms/Toast/Toast.tsx +85 -0
  162. package/src/components/atoms/Toast/Toast.utils.tsx +43 -0
  163. package/src/components/atoms/Toast/index.ts +1 -0
  164. package/src/components/atoms/Tooltip/Tooltip.styles.ts +33 -0
  165. package/src/components/atoms/Tooltip/Tooltip.tsx +32 -0
  166. package/src/components/atoms/Tooltip/index.ts +1 -0
  167. package/src/components/atoms/Typography/Display/Display.styles.ts +26 -0
  168. package/src/components/atoms/Typography/Display/Display.tsx +11 -0
  169. package/src/components/atoms/Typography/Display/index.ts +1 -0
  170. package/src/components/atoms/Typography/Link/Link.styles.ts +32 -0
  171. package/src/components/atoms/Typography/Link/Link.tsx +25 -0
  172. package/src/components/atoms/Typography/Link/index.ts +1 -0
  173. package/src/components/atoms/Typography/Paragraph/Paragraph.styles.ts +32 -0
  174. package/src/components/atoms/Typography/Paragraph/Paragraph.tsx +11 -0
  175. package/src/components/atoms/Typography/Paragraph/index.ts +1 -0
  176. package/src/components/atoms/Typography/Text/Text.styles.ts +39 -0
  177. package/src/components/atoms/Typography/Text/Text.tsx +25 -0
  178. package/src/components/atoms/Typography/Text/index.ts +1 -0
  179. package/src/components/atoms/Typography/Title/Title.styles.ts +28 -0
  180. package/src/components/atoms/Typography/Title/Title.tsx +15 -0
  181. package/src/components/atoms/Typography/Title/index.ts +1 -0
  182. package/src/components/atoms/Typography/Typography.tsx +21 -0
  183. package/src/components/atoms/Typography/index.ts +1 -0
  184. package/src/components/atoms/icons/AvanpostIcon.tsx +31 -0
  185. package/src/components/atoms/icons/CheckIcon.tsx +22 -0
  186. package/src/components/atoms/icons/EmptyIcon.tsx +56 -0
  187. package/src/components/atoms/icons/LogoIcon.tsx +141 -0
  188. package/src/components/atoms/icons/NumberTypeIcon.tsx +25 -0
  189. package/src/components/atoms/icons/SidebarCloseIcon.tsx +75 -0
  190. package/src/components/atoms/icons/index.ts +6 -0
  191. package/src/components/atoms/index.ts +31 -0
  192. package/src/components/molecules/DataTable/CreationModal/CreationModal.tsx +31 -0
  193. package/src/components/molecules/DataTable/CreationModal/index.ts +1 -0
  194. package/src/components/molecules/DataTable/DataTable.styles.ts +23 -0
  195. package/src/components/molecules/DataTable/DataTable.tsx +167 -0
  196. package/src/components/molecules/DataTable/Name/Name.tsx +20 -0
  197. package/src/components/molecules/DataTable/Name/index.ts +1 -0
  198. package/src/components/molecules/DataTable/Skeleton/Skeleton.tsx +27 -0
  199. package/src/components/molecules/DataTable/Skeleton/index.ts +6 -0
  200. package/src/components/molecules/DataTable/index.ts +8 -0
  201. package/src/components/molecules/Header/Button/Button.styles.ts +24 -0
  202. package/src/components/molecules/Header/Button/Button.tsx +20 -0
  203. package/src/components/molecules/Header/Button/index.ts +1 -0
  204. package/src/components/molecules/Header/Header.styles.ts +16 -0
  205. package/src/components/molecules/Header/Header.tsx +20 -0
  206. package/src/components/molecules/Header/Navigate/Navigate.tsx +40 -0
  207. package/src/components/molecules/Header/Navigate/index.ts +1 -0
  208. package/src/components/molecules/Header/SelectLang/SelectLang.tsx +47 -0
  209. package/src/components/molecules/Header/SelectLang/index.ts +2 -0
  210. package/src/components/molecules/Header/SelectTheme/SelectTheme.tsx +43 -0
  211. package/src/components/molecules/Header/SelectTheme/index.ts +1 -0
  212. package/src/components/molecules/Header/index.ts +2 -0
  213. package/src/components/molecules/ProjectIcon/ProjectIcon.styles.ts +23 -0
  214. package/src/components/molecules/ProjectIcon/ProjectIcon.tsx +37 -0
  215. package/src/components/molecules/ProjectIcon/index.ts +1 -0
  216. package/src/components/molecules/Sidebar/Item/Item.styles.ts +52 -0
  217. package/src/components/molecules/Sidebar/Item/Item.tsx +30 -0
  218. package/src/components/molecules/Sidebar/Item/index.ts +1 -0
  219. package/src/components/molecules/Sidebar/Sidebar.styles.ts +97 -0
  220. package/src/components/molecules/Sidebar/Sidebar.tsx +122 -0
  221. package/src/components/molecules/Sidebar/Sidebar.utils.tsx +36 -0
  222. package/src/components/molecules/Sidebar/Trigger/Trigger.tsx +23 -0
  223. package/src/components/molecules/Sidebar/Trigger/index.ts +1 -0
  224. package/src/components/molecules/Sidebar/index.ts +1 -0
  225. package/src/components/molecules/Widget/Content/Content.tsx +80 -0
  226. package/src/components/molecules/Widget/Content/index.ts +1 -0
  227. package/src/components/molecules/Widget/Toolbox/Toolbox.tsx +0 -0
  228. package/src/components/molecules/Widget/Toolbox/index.ts +0 -0
  229. package/src/components/molecules/Widget/Widget.tsx +26 -0
  230. package/src/components/molecules/Widget/Widget.utils.tsx +31 -0
  231. package/src/components/molecules/Widget/index.ts +2 -0
  232. package/src/components/molecules/index.ts +6 -0
  233. package/src/components/organisms/ComponentWidget/ComponentWidget.tsx +9 -0
  234. package/src/components/organisms/ComponentWidget/index.ts +2 -0
  235. package/src/components/organisms/DatasetsTable/Creation/Creation.tsx +105 -0
  236. package/src/components/organisms/DatasetsTable/Creation/Navigate/Navigate.tsx +59 -0
  237. package/src/components/organisms/DatasetsTable/Creation/Navigate/index.ts +1 -0
  238. package/src/components/organisms/DatasetsTable/Creation/Step/Step.styles.ts +12 -0
  239. package/src/components/organisms/DatasetsTable/Creation/Step/Step.tsx +43 -0
  240. package/src/components/organisms/DatasetsTable/Creation/Step/index.ts +1 -0
  241. package/src/components/organisms/DatasetsTable/Creation/Steps/Step1/Step1.styles.ts +41 -0
  242. package/src/components/organisms/DatasetsTable/Creation/Steps/Step1/Step1.tsx +67 -0
  243. package/src/components/organisms/DatasetsTable/Creation/Steps/Step1/index.ts +1 -0
  244. package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/SelectSource/SelectSource.tsx +252 -0
  245. package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/SelectSource/index.ts +1 -0
  246. package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/Step2.tsx +11 -0
  247. package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/UploadFile/UploadFile.tsx +112 -0
  248. package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/UploadFile/index.ts +1 -0
  249. package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/index.ts +1 -0
  250. package/src/components/organisms/DatasetsTable/Creation/Steps/Step3/Step3.tsx +145 -0
  251. package/src/components/organisms/DatasetsTable/Creation/Steps/Step3/index.ts +1 -0
  252. package/src/components/organisms/DatasetsTable/Creation/Steps/Step4/Step4.tsx +120 -0
  253. package/src/components/organisms/DatasetsTable/Creation/Steps/Step4/index.ts +1 -0
  254. package/src/components/organisms/DatasetsTable/Creation/Steps/index.ts +4 -0
  255. package/src/components/organisms/DatasetsTable/Creation/index.ts +1 -0
  256. package/src/components/organisms/DatasetsTable/DatasetsTable.tsx +81 -0
  257. package/src/components/organisms/DatasetsTable/DatasetsTable.utils.tsx +125 -0
  258. package/src/components/organisms/DatasetsTable/Source/Source.styles.ts +7 -0
  259. package/src/components/organisms/DatasetsTable/Source/Source.tsx +39 -0
  260. package/src/components/organisms/DatasetsTable/Source/Source.utils.tsx +45 -0
  261. package/src/components/organisms/DatasetsTable/Source/index.ts +1 -0
  262. package/src/components/organisms/DatasetsTable/Status/Status.styles.ts +25 -0
  263. package/src/components/organisms/DatasetsTable/Status/Status.tsx +29 -0
  264. package/src/components/organisms/DatasetsTable/Status/Status.utils.tsx +29 -0
  265. package/src/components/organisms/DatasetsTable/Status/index.ts +1 -0
  266. package/src/components/organisms/DatasetsTable/Type/Type.styles.ts +7 -0
  267. package/src/components/organisms/DatasetsTable/Type/Type.tsx +32 -0
  268. package/src/components/organisms/DatasetsTable/Type/Type.utils.tsx +14 -0
  269. package/src/components/organisms/DatasetsTable/Type/index.ts +1 -0
  270. package/src/components/organisms/DatasetsTable/index.ts +1 -0
  271. package/src/components/organisms/index.ts +3 -0
  272. package/src/components/templates/DefaultLayout/DefaultLayout.styles.ts +26 -0
  273. package/src/components/templates/DefaultLayout/DefaultLayout.tsx +41 -0
  274. package/src/components/templates/DefaultLayout/index.ts +1 -0
  275. package/src/components/templates/PageLayout/PageLayout.styles.ts +25 -0
  276. package/src/components/templates/PageLayout/PageLayout.tsx +28 -0
  277. package/src/components/templates/PageLayout/index.ts +1 -0
  278. package/src/components/templates/index.ts +3 -0
  279. package/src/config/i18n.config.ts +46 -0
  280. package/src/constants/index.ts +10 -0
  281. package/src/contexts/CreateComponentContext/CreateComponentContext.tsx +17 -0
  282. package/src/contexts/CreateComponentContext/index.ts +4 -0
  283. package/src/contexts/CreateDatasetContext/CreateDatasetContext.tsx +25 -0
  284. package/src/contexts/CreateDatasetContext/index.ts +4 -0
  285. package/src/contexts/ProjectContext/ProjectContext.tsx +32 -0
  286. package/src/contexts/ProjectContext/index.ts +1 -0
  287. package/src/contexts/SidebarContext/SidebarContext.tsx +10 -0
  288. package/src/contexts/SidebarContext/index.ts +1 -0
  289. package/src/contexts/index.ts +10 -0
  290. package/src/hooks/index.ts +9 -0
  291. package/src/hooks/useCreateComponent.ts +15 -0
  292. package/src/hooks/useCreateDataset.ts +15 -0
  293. package/src/hooks/useDebounce.ts +17 -0
  294. package/src/hooks/useDebounced.ts +31 -0
  295. package/src/hooks/useIsMobile.ts +27 -0
  296. package/src/hooks/useSidebar.ts +15 -0
  297. package/src/hooks/useStickyHeader.ts +35 -0
  298. package/src/hooks/useWindowSize.ts +27 -0
  299. package/src/providers/CreateComponentProvider/CreateComponentProvider.tsx +53 -0
  300. package/src/providers/CreateComponentProvider/index.ts +1 -0
  301. package/src/providers/CreateDatasetProvider/CreateDatasetProvider.tsx +73 -0
  302. package/src/providers/CreateDatasetProvider/index.ts +1 -0
  303. package/src/providers/LangProvider/LangProvider.tsx +15 -0
  304. package/src/providers/LangProvider/index.ts +1 -0
  305. package/src/providers/ProjectProvider/ProjectProvider.tsx +110 -0
  306. package/src/providers/ProjectProvider/index.ts +1 -0
  307. package/src/providers/SidebarProvider/SidebarProvider.tsx +51 -0
  308. package/src/providers/SidebarProvider/index.ts +1 -0
  309. package/src/providers/ThemeProvider/ThemeProvider.tsx +20 -0
  310. package/src/providers/ThemeProvider/index.ts +1 -0
  311. package/src/providers/index.ts +6 -0
  312. package/src/store/index.ts +2 -0
  313. package/src/store/sidebar/sidebar.store.ts +17 -0
  314. package/src/store/sidebar/sidebar.type.ts +4 -0
  315. package/src/styles/globals.css +202 -0
  316. package/src/types/component.type.ts +13 -0
  317. package/src/types/dataset.type.ts +25 -0
  318. package/src/types/file.type.ts +13 -0
  319. package/src/types/general.type.ts +86 -0
  320. package/src/types/index.ts +9 -0
  321. package/src/types/layer.type.ts +7 -0
  322. package/src/types/project.type.ts +15 -0
  323. package/src/types/user.type.ts +6 -0
  324. package/src/types/widget.type.ts +12 -0
  325. package/src/utils/bm.util.ts +150 -0
  326. package/src/utils/bytes.util.ts +110 -0
  327. package/src/utils/date.util.ts +49 -0
  328. package/src/utils/dynamicMessage.util.ts +9 -0
  329. package/src/utils/getInitials.util.ts +10 -0
  330. package/src/utils/hideEmail.util.ts +14 -0
  331. package/src/utils/index.ts +12 -0
  332. package/src/utils/pagination.util.ts +144 -0
  333. package/src/utils/twJoin.util.ts +49 -0
  334. package/src/utils/twMerge.util.ts +6 -0
  335. package/src/utils/upload.util.ts +26 -0
  336. package/src/utils/url.util.ts +29 -0
  337. package/tsconfig.json +40 -6
  338. package/bmdl-sdk-1.5.9.tgz +0 -0
  339. package/index.html +0 -12
  340. package/src/App.tsx +0 -187
  341. package/src/main.tsx +0 -15
@@ -0,0 +1,141 @@
1
+ function LogoIcon({ size = 24, ...props }) {
2
+ return (
3
+ <svg
4
+ width={size}
5
+ height={size}
6
+ viewBox='0 0 4000 3860'
7
+ fill='none'
8
+ xmlns='http://www.w3.org/2000/svg'
9
+ {...props}
10
+ >
11
+ <g
12
+ transform='translate(0,3860) scale(0.1,-0.1)'
13
+ fill='#7367F0'
14
+ stroke='none'
15
+ >
16
+ <path
17
+ d='M7485 38594 c-404 -31 -604 -54 -880 -100 -1351 -225 -2635 -808
18
+ -3700 -1681 -396 -324 -794 -722 -1118 -1118 -779 -951 -1330 -2079 -1597
19
+ -3270 -73 -326 -124 -644 -163 -1021 l-22 -219 0 -11885 c0 -11368 1 -11893
20
+ 18 -12065 62 -623 152 -1088 312 -1620 297 -985 796 -1918 1452 -2720 172
21
+ -210 319 -371 533 -585 297 -297 515 -487 830 -724 1194 -898 2559 -1427 4040
22
+ -1566 311 -29 1167 -29 1476 0 1497 140 2877 678 4068 1584 87 67 222 169 300
23
+ 227 77 59 155 118 172 133 18 14 36 26 41 26 5 0 22 13 38 30 16 16 33 30 38
24
+ 30 5 0 24 12 42 28 31 25 58 45 231 170 37 26 84 62 105 81 22 18 39 30 39 26
25
+ 0 -8 109 87 196 170 28 28 94 89 145 137 52 47 121 112 154 143 33 32 107 101
26
+ 165 153 58 53 1337 1327 2843 2831 1505 1505 2742 2736 2747 2736 5 0 1208
27
+ -1197 2672 -2661 1465 -1463 2710 -2703 2768 -2756 58 -52 132 -121 165 -153
28
+ 33 -31 102 -96 154 -143 51 -48 117 -109 145 -137 87 -83 196 -178 196 -170 0
29
+ 4 17 -8 39 -26 21 -19 68 -55 105 -81 173 -125 200 -145 231 -171 18 -15 37
30
+ -27 42 -27 5 0 22 -14 38 -30 16 -17 33 -30 38 -30 5 0 23 -12 41 -26 17 -14
31
+ 76 -60 132 -103 56 -42 159 -125 230 -185 794 -668 1780 -1201 2774 -1499 538
32
+ -162 1017 -255 1574 -307 309 -29 1165 -29 1476 0 1238 116 2409 510 3455
33
+ 1163 734 458 1401 1044 1948 1712 656 802 1155 1735 1452 2720 160 532 250
34
+ 997 312 1620 17 172 18 697 18 12065 l0 11885 -22 219 c-87 845 -269 1583
35
+ -571 2306 -502 1208 -1296 2275 -2307 3103 -801 656 -1736 1155 -2720 1452
36
+ -534 161 -1035 257 -1625 312 -276 26 -1101 26 -1365 0 -934 -91 -1703 -288
37
+ -2530 -650 -415 -181 -938 -475 -1298 -728 -98 -69 -117 -79 -117 -58 0 6 -13
38
+ 0 -29 -13 -16 -12 -45 -33 -63 -46 -60 -42 -312 -229 -344 -256 -18 -14 -36
39
+ -26 -41 -26 -5 0 -22 -13 -38 -30 -16 -16 -33 -30 -38 -30 -5 0 -24 -12 -42
40
+ -27 -31 -26 -72 -56 -234 -172 -35 -25 -81 -61 -102 -80 -22 -18 -39 -30 -39
41
+ -26 0 8 -109 -87 -196 -170 -28 -27 -94 -89 -145 -137 -52 -47 -121 -112 -154
42
+ -143 -33 -32 -107 -101 -165 -153 -58 -53 -1380 -1370 -2938 -2926 -1558
43
+ -1557 -2834 -2831 -2837 -2831 -3 0 -1212 1206 -2687 2681 -1476 1474 -2730
44
+ 2723 -2788 2776 -58 52 -132 121 -165 153 -33 31 -102 96 -154 143 -51 48
45
+ -117 110 -145 137 -87 83 -196 178 -196 170 0 -4 -17 8 -39 26 -21 19 -68 55
46
+ -105 82 -173 124 -200 144 -231 170 -18 15 -37 27 -42 27 -5 0 -22 14 -38 30
47
+ -16 17 -33 30 -38 30 -5 0 -23 12 -41 26 -31 26 -280 211 -344 256 -18 13 -45
48
+ 32 -59 43 -15 11 -33 20 -40 21 -7 1 -34 20 -61 41 -26 22 -101 80 -167 129
49
+ -1012 758 -2170 1260 -3390 1469 -514 88 -731 106 -1305 110 -256 1 -487 1
50
+ -515 -1z m985 -5301 c265 -32 552 -107 747 -194 23 -11 45 -19 48 -19 15 0
51
+ 274 -135 358 -187 87 -54 290 -202 367 -267 19 -17 98 -93 174 -171 77 -77
52
+ 143 -140 147 -140 4 0 509 -501 1123 -1112 613 -612 1121 -1113 1128 -1113 7
53
+ 0 855 -842 1883 -1871 l1870 -1870 -2743 -2740 c-2463 -2460 -2749 -2749
54
+ -2792 -2820 -65 -107 -147 -276 -195 -404 -188 -495 -223 -1040 -100 -1552 52
55
+ -217 127 -415 233 -616 71 -135 199 -334 242 -377 3 -3 30 -36 61 -75 67 -84
56
+ 221 -241 304 -310 33 -28 65 -54 71 -60 7 -5 24 -19 40 -30 15 -11 39 -29 53
57
+ -41 51 -41 248 -161 346 -211 237 -120 465 -199 666 -228 57 -9 149 -23 204
58
+ -31 55 -8 116 -19 135 -24 22 -6 1481 -10 4015 -10 l3980 0 -5448 -5448
59
+ c-4888 -4887 -5461 -5456 -5569 -5537 -67 -49 -164 -116 -216 -148 -85 -53
60
+ -342 -187 -357 -187 -3 0 -25 -8 -48 -19 -23 -10 -87 -35 -142 -54 -609 -215
61
+ -1282 -215 -1890 0 -55 19 -113 41 -130 48 -16 8 -52 23 -80 35 -188 82 -373
62
+ 191 -550 324 -150 113 -165 125 -305 266 -141 140 -153 155 -266 305 -175 233
63
+ -304 472 -402 745 -73 204 -149 520 -159 663 -3 42 -10 77 -14 77 -13 0 -11
64
+ 22157 1 22240 5 36 14 175 20 310 20 436 60 675 167 975 19 55 44 119 54 142
65
+ 11 23 19 45 19 48 0 15 135 274 187 358 54 88 204 293 267 367 38 43 249 254
66
+ 296 295 19 17 89 71 155 121 587 442 1314 636 2045 547z m23735 1 c513 -62
67
+ 964 -243 1370 -548 66 -50 136 -104 155 -121 47 -41 258 -252 296 -295 63 -74
68
+ 213 -279 267 -367 52 -84 187 -343 187 -358 0 -3 8 -25 19 -48 28 -64 87 -231
69
+ 115 -332 32 -112 59 -256 86 -450 11 -82 27 -184 35 -225 12 -65 14 -1601 15
70
+ -11363 0 -9999 -2 -11290 -15 -11303 -8 -9 -15 -31 -15 -50 0 -77 -48 -346
71
+ -86 -479 -99 -352 -253 -665 -468 -950 -113 -150 -125 -165 -266 -305 -140
72
+ -141 -155 -153 -305 -266 -172 -129 -355 -238 -535 -317 -103 -46 -133 -58
73
+ -225 -90 -606 -215 -1281 -215 -1890 0 -55 19 -119 44 -142 54 -23 11 -45 19
74
+ -48 19 -15 0 -274 135 -358 187 -245 151 -120 29 -3497 3408 l-3175 3176 2829
75
+ 2826 c2537 2534 2833 2833 2876 2905 65 106 147 275 195 403 188 495 223 1040
76
+ 100 1552 -52 217 -127 415 -233 616 -71 135 -199 334 -242 377 -3 3 -30 37
77
+ -61 75 -67 84 -221 241 -304 310 -33 28 -65 55 -71 60 -7 6 -24 19 -40 30 -15
78
+ 11 -39 29 -53 41 -51 41 -248 161 -346 211 -250 127 -517 215 -790 258 -55 9
79
+ -101 20 -103 25 -2 7 -1470 10 -4055 10 l-4052 0 5360 5361 c3953 3954 5385
80
+ 5380 5455 5433 52 40 137 98 187 129 84 52 343 187 358 187 3 0 25 8 48 19 23
81
+ 10 87 35 142 54 411 145 848 193 1280 141z'
82
+ />
83
+ </g>
84
+ <g
85
+ transform='translate(0,3860) scale(0.1,-0.1)'
86
+ fill='#685DD7'
87
+ stroke='none'
88
+ >
89
+ <path
90
+ d='M16570 33464 c-6 -32 -22 -108 -35 -169 -36 -164 -115 -538 -195
91
+ -915 -38 -184 -75 -355 -80 -379 -6 -24 -31 -139 -55 -255 -25 -116 -72 -339
92
+ -105 -496 -33 -157 -78 -368 -100 -470 -22 -102 -60 -282 -85 -400 -136 -636
93
+ -219 -1031 -290 -1369 -25 -117 -50 -232 -55 -255 -6 -22 -39 -180 -75 -351
94
+ -36 -170 -100 -469 -141 -664 l-76 -354 519 -519 518 -518 1860 1860 1860
95
+ 1860 -1726 1726 -1727 1727 -12 -59z'
96
+ />
97
+ <path
98
+ d='M21815 10430 l-1860 -1860 1725 -1725 c948 -948 1725 -1723 1727
99
+ -1721 2 1 14 56 28 122 13 65 49 236 80 379 31 143 67 312 80 375 13 63 51
100
+ 243 85 400 33 157 81 380 105 495 25 116 72 338 105 495 33 157 78 368 100
101
+ 470 22 102 60 282 85 400 136 636 219 1031 290 1369 25 117 50 232 55 255 6
102
+ 22 39 181 75 351 36 171 100 469 141 664 l76 354 -519 519 -518 518 -1860
103
+ -1860z'
104
+ />
105
+ </g>
106
+ <g
107
+ transform='translate(0,3860) scale(0.1,-0.1)'
108
+ fill='#6D62E3'
109
+ stroke='none'
110
+ >
111
+ <path
112
+ d='M12650 33533 l0 -3518 1314 -1314 c1159 -1159 1314 -1310 1319 -1290
113
+ 7 31 127 594 212 994 36 171 69 329 75 351 5 23 30 138 55 255 71 338 154 733
114
+ 290 1369 25 118 63 298 85 400 22 102 67 313 100 470 33 157 80 380 105 495
115
+ 24 116 72 338 105 495 34 157 72 337 85 400 13 63 49 232 80 375 31 143 67
116
+ 316 81 384 l26 124 -952 951 c-523 523 -988 984 -1033 1024 -45 39 -122 111
117
+ -172 158 -49 47 -132 125 -184 172 -51 48 -117 110 -145 137 -87 83 -196 178
118
+ -196 170 0 -4 -17 8 -39 26 -21 19 -67 55 -102 80 -162 116 -203 146 -234 172
119
+ -18 15 -37 27 -42 27 -5 0 -22 14 -38 30 -16 17 -33 30 -38 30 -5 0 -23 12
120
+ -41 26 -31 26 -280 211 -344 256 -18 13 -45 32 -59 43 -15 11 -33 20 -40 21
121
+ -7 1 -34 20 -61 41 -26 22 -84 67 -129 102 l-83 62 0 -3518z'
122
+ />
123
+ <path
124
+ d='M24707 11229 c-7 -31 -127 -594 -212 -994 -36 -170 -69 -329 -75
125
+ -351 -5 -23 -30 -138 -55 -255 -71 -338 -154 -733 -290 -1369 -25 -118 -63
126
+ -298 -85 -400 -22 -102 -67 -313 -100 -470 -33 -157 -80 -379 -105 -495 -24
127
+ -115 -72 -338 -105 -495 -34 -157 -72 -337 -85 -400 -13 -63 -49 -232 -80
128
+ -375 -31 -143 -67 -316 -81 -384 l-26 -124 952 -951 c523 -523 988 -984 1033
129
+ -1024 45 -39 123 -111 172 -158 50 -47 132 -125 184 -172 51 -48 117 -109 145
130
+ -137 87 -83 196 -178 196 -170 0 4 17 -8 39 -26 21 -19 70 -56 107 -83 38 -28
131
+ 98 -70 133 -95 34 -25 78 -58 96 -74 18 -15 37 -27 42 -27 5 0 22 -14 38 -30
132
+ 16 -17 33 -30 38 -30 5 0 23 -12 41 -26 31 -26 280 -211 344 -256 18 -13 45
133
+ -32 59 -43 15 -11 33 -20 40 -21 7 -1 34 -20 61 -41 26 -22 84 -67 130 -102
134
+ l82 -62 0 3518 0 3518 -1314 1314 c-1159 1159 -1314 1310 -1319 1290z'
135
+ />
136
+ </g>
137
+ </svg>
138
+ )
139
+ }
140
+
141
+ export { LogoIcon }
@@ -0,0 +1,25 @@
1
+ import { IconBaseProps } from 'react-icons/lib'
2
+
3
+ function NumberTypeIcon({
4
+ color = 'currentColor',
5
+ size = 24,
6
+ ...props
7
+ }: IconBaseProps) {
8
+ return (
9
+ <svg
10
+ width={size}
11
+ height={size}
12
+ viewBox='0 0 16 16'
13
+ fill='none'
14
+ xmlns='http://www.w3.org/2000/svg'
15
+ {...props}
16
+ >
17
+ <path
18
+ d='M8.39 12.648a1.32 1.32 0 0 0-.015.18c0 .305.21.508.5.508.266 0 .492-.172.555-.477l.554-2.703h1.204c.421 0 .617-.234.617-.547 0-.312-.188-.53-.617-.53h-.985l.516-2.524h1.265c.43 0 .618-.227.618-.547 0-.313-.188-.524-.618-.524h-1.046l.476-2.304a1.06 1.06 0 0 0 .016-.164.51.51 0 0 0-.516-.516.54.54 0 0 0-.539.43l-.523 2.554H7.617l.477-2.304c.008-.04.015-.118.015-.164a.512.512 0 0 0-.523-.516.539.539 0 0 0-.531.43L6.53 5.484H5.414c-.43 0-.617.22-.617.532 0 .312.187.539.617.539h.906l-.515 2.523H4.609c-.421 0-.609.219-.609.531 0 .313.188.547.61.547h.976l-.516 2.492c-.008.04-.015.125-.015.18 0 .305.21.508.5.508.265 0 .492-.172.554-.477l.555-2.703h2.242l-.515 2.492zm-1-6.109h2.266l-.515 2.563H6.859l.532-2.563z'
19
+ fill={color}
20
+ />
21
+ </svg>
22
+ )
23
+ }
24
+
25
+ export { NumberTypeIcon }
@@ -0,0 +1,75 @@
1
+ function SidebarCloseIcon({ color = 'currentColor', size = 24, ...props }) {
2
+ return (
3
+ <svg
4
+ width={size}
5
+ height={size}
6
+ viewBox='0 0 24 24'
7
+ fill='none'
8
+ xmlns='http://www.w3.org/2000/svg'
9
+ {...props}
10
+ >
11
+ <path
12
+ d='M20 6H13'
13
+ stroke={color}
14
+ strokeWidth='1.75'
15
+ strokeLinecap='round'
16
+ strokeLinejoin='round'
17
+ />
18
+ <path
19
+ d='M20 6H13'
20
+ stroke='white'
21
+ strokeOpacity='0.1'
22
+ strokeWidth='1.75'
23
+ strokeLinecap='round'
24
+ strokeLinejoin='round'
25
+ />
26
+ <path
27
+ d='M20 12H11'
28
+ stroke={color}
29
+ strokeWidth='1.75'
30
+ strokeLinecap='round'
31
+ strokeLinejoin='round'
32
+ />
33
+ <path
34
+ d='M20 12H11'
35
+ stroke='white'
36
+ strokeOpacity='0.1'
37
+ strokeWidth='1.75'
38
+ strokeLinecap='round'
39
+ strokeLinejoin='round'
40
+ />
41
+ <path
42
+ d='M20 18H13'
43
+ stroke={color}
44
+ strokeWidth='1.75'
45
+ strokeLinecap='round'
46
+ strokeLinejoin='round'
47
+ />
48
+ <path
49
+ d='M20 18H13'
50
+ stroke='white'
51
+ strokeOpacity='0.1'
52
+ strokeWidth='1.75'
53
+ strokeLinecap='round'
54
+ strokeLinejoin='round'
55
+ />
56
+ <path
57
+ d='M8 8L4 12L8 16'
58
+ stroke={color}
59
+ strokeWidth='1.75'
60
+ strokeLinecap='round'
61
+ strokeLinejoin='round'
62
+ />
63
+ <path
64
+ d='M8 8L4 12L8 16'
65
+ stroke='white'
66
+ strokeOpacity='0.1'
67
+ strokeWidth='1.75'
68
+ strokeLinecap='round'
69
+ strokeLinejoin='round'
70
+ />
71
+ </svg>
72
+ )
73
+ }
74
+
75
+ export { SidebarCloseIcon }
@@ -0,0 +1,6 @@
1
+ export { LogoIcon } from './LogoIcon'
2
+ export { AvanpostIcon } from './AvanpostIcon'
3
+ export { CheckIcon } from './CheckIcon'
4
+ export { EmptyIcon } from './EmptyIcon'
5
+ export { SidebarCloseIcon } from './SidebarCloseIcon'
6
+ export { NumberTypeIcon } from './NumberTypeIcon'
@@ -0,0 +1,31 @@
1
+ export { Actions } from './Actions'
2
+ export { Avatar } from './Avatar'
3
+ export { Badge } from './Badge'
4
+ export { Button } from './Button'
5
+ export { Calendar } from './Calendar'
6
+ export { Checkbox } from './Checkbox'
7
+ export { Date } from './Date'
8
+ export { DatePicker } from './DatePicker'
9
+ export { Dialog } from './Dialog'
10
+ export { Dropdown } from './Dropdown'
11
+ export { Form } from './Form'
12
+ export { Input } from './Input'
13
+ export { Label } from './Label'
14
+ export { Logo } from './Logo'
15
+ export { Pagination } from './Pagination'
16
+ export { Popover } from './Popover'
17
+ export { Radio } from './Radio'
18
+ export { RangeNumber } from './RangeNumber'
19
+ export { Select } from './Select'
20
+ export { Separator } from './Separator'
21
+ export { Sheet } from './Sheet'
22
+ export { Skeleton } from './Skeleton'
23
+ export { Spin } from './Spin'
24
+ export { Switch } from './Switch'
25
+ export { Table } from './Table'
26
+ export { Tabs } from './Tabs'
27
+ export { Textarea } from './Textarea'
28
+ export { Toast, toast } from './Toast'
29
+ export { Tooltip } from './Tooltip'
30
+ export { Typography } from './Typography'
31
+
@@ -0,0 +1,31 @@
1
+ import { type ReactNode } from 'react'
2
+
3
+ import { Dialog } from '@/components/atoms'
4
+
5
+ type CreationModalProps = {
6
+ children: ReactNode
7
+ open: boolean
8
+ onEscapeKeyDown?: () => void
9
+ onCancel?: () => void
10
+ className?: string
11
+ }
12
+
13
+ export function CreationModal({
14
+ open,
15
+ onCancel,
16
+ onEscapeKeyDown,
17
+ children,
18
+ className
19
+ }: CreationModalProps) {
20
+ return (
21
+ <Dialog
22
+ open={open}
23
+ onCancel={onCancel}
24
+ onEscapeKeyDown={onEscapeKeyDown}
25
+ className={className}
26
+ blur
27
+ >
28
+ {children}
29
+ </Dialog>
30
+ )
31
+ }
@@ -0,0 +1 @@
1
+ export { CreationModal } from './CreationModal'
@@ -0,0 +1,23 @@
1
+ import { twJoin } from '@/utils'
2
+
3
+ export const rootStyles = twJoin({
4
+ display:
5
+ 'max-h-[calc(100vh-176px)] max-w-[calc(100vw-122px)] overflow-hidden',
6
+ visual: 'bg-white rounded-md shadow-extra',
7
+ //
8
+ dark: {
9
+ visual: 'dark:bg-dark-gray-900 dark:shadow-dark-table'
10
+ }
11
+ })
12
+
13
+ // /////////////////////////
14
+
15
+ export const headerStyles = twJoin({
16
+ display: 'flex p-6 gap-4'
17
+ })
18
+
19
+ // /////////////////////////
20
+
21
+ export const dialogStyles = twJoin({
22
+ // display: 'max-w-210!'
23
+ })
@@ -0,0 +1,167 @@
1
+ 'use client'
2
+
3
+ import clsx from 'clsx'
4
+ import { useTranslations } from 'next-intl'
5
+ import { useRouter } from 'next/navigation'
6
+ import {
7
+ ChangeEvent,
8
+ type ComponentProps,
9
+ type ReactNode,
10
+ useEffect,
11
+ useRef,
12
+ useState
13
+ } from 'react'
14
+
15
+ import { TbPlus } from 'react-icons/tb'
16
+
17
+ import { Button, Input, Select, Table } from '@/components/atoms'
18
+
19
+ import { IColumnItem, IFilterQuery, IPaginationOptions } from '@/types'
20
+
21
+ import { dialogStyles, headerStyles, rootStyles } from './DataTable.styles'
22
+
23
+ import { CreationModal } from './CreationModal'
24
+ import { useDebounce } from '@/hooks'
25
+ import { _, addParam, getParams, removeParam } from '@/utils'
26
+
27
+ type DataTableProps = ComponentProps<'div'> & {
28
+ columns: IColumnItem[]
29
+ dataSource: any[]
30
+ pagination: IPaginationOptions
31
+ getData: (data: Record<string, any>) => void
32
+ filterQuery: IFilterQuery
33
+ listName?: string
34
+ creation: ReactNode
35
+ }
36
+
37
+ export function DataTable({
38
+ columns,
39
+ dataSource,
40
+ pagination,
41
+ getData,
42
+ filterQuery,
43
+ listName,
44
+ creation,
45
+ className
46
+ }: DataTableProps) {
47
+ const tl = useTranslations(listName)
48
+ const t = useTranslations()
49
+ //
50
+ const router = useRouter()
51
+ //
52
+ const [q, setQ] = useState<string>()
53
+ const [limit, setLimit] = useState('10')
54
+ const [modalOpen, setModalOpen] = useState(false)
55
+ const debouncedQ = useDebounce(q, 350)
56
+ const isInit = useRef(false)
57
+ //
58
+ useEffect(() => {
59
+ const { q, limit } = getParams()
60
+ if (q) setQ(q)
61
+ if (limit) setLimit(limit)
62
+ }, [])
63
+ //
64
+ const openHandler = () => {
65
+ setModalOpen(true)
66
+ }
67
+ //
68
+ const cancelHandler = () => {
69
+ setModalOpen(false)
70
+ }
71
+ //
72
+ const changeLimitHandler = (value: string) => {
73
+ if (value === '10') {
74
+ removeParam(router, 'limit')
75
+ } else {
76
+ addParam(router, 'limit', value)
77
+ }
78
+ //
79
+ setTimeout(() => removeParam(router, 'page'), 350)
80
+ //
81
+ setLimit(value)
82
+ //
83
+ getData({
84
+ limit: +value,
85
+ page: 0
86
+ })
87
+ }
88
+ //
89
+ useEffect(() => {
90
+ if (debouncedQ) {
91
+ addParam(router, 'q', debouncedQ)
92
+ } else {
93
+ removeParam(router, 'q')
94
+ }
95
+
96
+ if (!isInit.current) {
97
+ if (!_.isUndefined(debouncedQ)) {
98
+ setTimeout(() => removeParam(router, 'page'), 350)
99
+ //
100
+ getData({
101
+ q: debouncedQ,
102
+ page: 0
103
+ })
104
+ }
105
+
106
+ isInit.current = true
107
+ }
108
+ }, [debouncedQ])
109
+ //
110
+ return (
111
+ <div className={clsx(rootStyles, className)}>
112
+ <div className={headerStyles}>
113
+ <Select
114
+ onValueChange={changeLimitHandler}
115
+ value={limit}
116
+ className='w-25'
117
+ >
118
+ <Select.Item value='1'>1</Select.Item>
119
+ <Select.Item value='2'>2</Select.Item>
120
+ <Select.Item value='3'>3</Select.Item>
121
+ <Select.Item value='10'>10</Select.Item>
122
+ <Select.Item value='50'>50</Select.Item>
123
+ <Select.Item value='100'>100</Select.Item>
124
+ </Select>
125
+ <Button className='mr-auto' onClick={openHandler}>
126
+ <TbPlus /> {listName ? tl('add') : t('add')}
127
+ </Button>
128
+ <Input.Search
129
+ value={q || ''}
130
+ onChange={(e: ChangeEvent<HTMLInputElement>) =>
131
+ setQ(e.target.value)
132
+ }
133
+ placeholder={t('search')}
134
+ className='ml-auto w-65!'
135
+ />
136
+ <Select defaultValue='all' className='w-38'>
137
+ <Select.Item value='all'>{t('all')}</Select.Item>
138
+ <Select.Item value='current'>{t('only-mine')}</Select.Item>
139
+ <Select.Item value='not-current'>
140
+ {t('besides-mine')}
141
+ </Select.Item>
142
+ </Select>
143
+ </div>
144
+ <Table
145
+ dataSource={dataSource}
146
+ columns={columns}
147
+ onRowSelection={() => {}}
148
+ pagination={{
149
+ ...pagination,
150
+ name: listName,
151
+ limit: +limit
152
+ }}
153
+ getData={getData}
154
+ filterQuery={filterQuery}
155
+ actions
156
+ />
157
+ <CreationModal
158
+ open={modalOpen}
159
+ onCancel={cancelHandler}
160
+ onEscapeKeyDown={cancelHandler}
161
+ className={dialogStyles}
162
+ >
163
+ {creation}
164
+ </CreationModal>
165
+ </div>
166
+ )
167
+ }
@@ -0,0 +1,20 @@
1
+ import { type ComponentProps } from 'react'
2
+
3
+ import { Typography } from '@/components/atoms'
4
+
5
+ const { Text, Link } = Typography
6
+
7
+ type TableStatusProps = ComponentProps<'a'> & {
8
+ name: string
9
+ href: string
10
+ }
11
+
12
+ function Name({ name, href }: TableStatusProps) {
13
+ return (
14
+ <Link href={href} className='flex' data-type='name'>
15
+ <Text>{name}</Text>
16
+ </Link>
17
+ )
18
+ }
19
+
20
+ export { Name }
@@ -0,0 +1 @@
1
+ export { Name } from './Name'
@@ -0,0 +1,27 @@
1
+ import { Skeleton } from '@/components/atoms'
2
+
3
+ function SkeletonIcon() {
4
+ return <Skeleton className='size-8' />
5
+ }
6
+
7
+ function SkeletonConnects() {
8
+ return <Skeleton className='h-5 w-8' />
9
+ }
10
+
11
+ function SkeletonProfile() {
12
+ return (
13
+ <div className='flex items-center gap-1.5'>
14
+ <Skeleton circle className='size-8' />
15
+ <div className='flex flex-col gap-0.5'>
16
+ <Skeleton size={'sm'} className='h-3.5 w-30' />
17
+ <Skeleton size={'sm'} className='h-3.5 w-20' />
18
+ </div>
19
+ </div>
20
+ )
21
+ }
22
+
23
+ function SkeletonDate() {
24
+ return <Skeleton className='h-5 w-32' />
25
+ }
26
+
27
+ export { SkeletonConnects, SkeletonDate, SkeletonIcon, SkeletonProfile }
@@ -0,0 +1,6 @@
1
+ export {
2
+ SkeletonConnects,
3
+ SkeletonDate,
4
+ SkeletonIcon,
5
+ SkeletonProfile
6
+ } from './Skeleton'
@@ -0,0 +1,8 @@
1
+ export { DataTable } from './DataTable'
2
+ export { Name } from './Name'
3
+ export {
4
+ SkeletonConnects,
5
+ SkeletonDate,
6
+ SkeletonIcon,
7
+ SkeletonProfile
8
+ } from './Skeleton'
@@ -0,0 +1,24 @@
1
+ import { twJoin } from '@/utils'
2
+
3
+ export const rootStyles = twJoin({
4
+ display: 'flex size-9.5 items-center justify-center',
5
+ visual: 'rounded-full outline-none',
6
+ hover: 'hover:bg-gray-100',
7
+ attrs: 'data-[state="open"]:bg-gray-100',
8
+ childs: [
9
+ '[&_span_span]:hidden',
10
+ '[&_span:has(img)]:size-6.5 [&_span:has(img)]:overflow-hidden [&_span:has(img)]:rounded-full',
11
+ '[&_span_img]:size-6.5 [&_span_img]:object-cover [&_span_img]:object-center [&_span_img]:rounded-full',
12
+ ],
13
+ disabled: [
14
+ 'disabled:cursor-not-allowed!',
15
+ 'disabled:select-none',
16
+ 'disabled:opacity-65',
17
+ 'disabled:shadow-none'
18
+ ],
19
+ //
20
+ dark: {
21
+ hover: 'dark:hover:bg-dark-gray-800/50',
22
+ attrs: ['dark:data-[state=open]:bg-dark-gray-800/50']
23
+ }
24
+ })
@@ -0,0 +1,20 @@
1
+ import clsx from 'clsx'
2
+ import { type ComponentProps } from 'react'
3
+
4
+ import { Slot } from 'radix-ui'
5
+
6
+ import { rootStyles } from './Button.styles'
7
+
8
+ type HeaderButtonProps = ComponentProps<'button'> & { asChild?: boolean }
9
+
10
+ function HeaderButton({
11
+ asChild = false,
12
+ className,
13
+ ...props
14
+ }: HeaderButtonProps) {
15
+ const Comp = asChild ? Slot.Root : 'button'
16
+
17
+ return <Comp className={clsx(rootStyles, className)} {...props} />
18
+ }
19
+
20
+ export { HeaderButton }
@@ -0,0 +1 @@
1
+ export { HeaderButton } from './Button'
@@ -0,0 +1,16 @@
1
+ import { twJoin } from '@/utils'
2
+
3
+ export const rootStyles = twJoin({
4
+ position: 'sticky z-40 top-4',
5
+ display: 'flex h-15.5 items-center px-6 py-3',
6
+ text: 'text-gray-800',
7
+ visual: 'shadow-sm rounded-md bg-white',
8
+ childs: ['lg:[&_[data-type=sidebar-trigger]]:hidden'],
9
+ //
10
+ adaptive: '[&_[data-type=sidebar-trigger]]:flex',
11
+ //
12
+ dark: {
13
+ text: 'dark:text-dark-gray-300',
14
+ visual: 'dark:bg-dark-gray-900 dark:shadow-dark-sm'
15
+ }
16
+ })
@@ -0,0 +1,20 @@
1
+ 'use client'
2
+
3
+ import { rootStyles } from './Header.styles'
4
+ import { Navigate } from './Navigate'
5
+
6
+ import { SelectLang } from './SelectLang'
7
+ import { SelectTheme } from './SelectTheme'
8
+
9
+ function Header() {
10
+ return (
11
+ <header className={rootStyles}>
12
+ <Navigate className="mr-auto" />
13
+ <SelectLang />
14
+ <SelectTheme />
15
+ </header>
16
+ )
17
+ }
18
+
19
+ export { Header }
20
+