@sqrzro/admin 2.1.0-r19.98 → 4.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/dist/components/AdminAppLayout/index.d.ts +7 -0
  2. package/dist/components/AdminAppLayout/index.js +7 -0
  3. package/dist/components/AdminPage/index.d.ts +6 -0
  4. package/dist/components/AdminPage/index.js +7 -0
  5. package/dist/components/AdminRootLayout/index.d.ts +5 -0
  6. package/dist/components/AdminRootLayout/index.js +7 -0
  7. package/dist/{styles/config.d.ts → config.d.ts} +1 -1
  8. package/dist/config.js +66 -0
  9. package/dist/index.d.ts +6 -10
  10. package/dist/index.js +6 -9
  11. package/dist/utility/interfaces.d.ts +8 -0
  12. package/package.json +16 -65
  13. package/README.md +0 -22
  14. package/assets/images/check-white.svg +0 -3
  15. package/assets/images/chevron.svg +0 -3
  16. package/assets/images/close.svg +0 -3
  17. package/assets/images/danger-dark.svg +0 -3
  18. package/assets/images/danger.svg +0 -3
  19. package/assets/images/eye.svg +0 -12
  20. package/assets/images/info-dark.svg +0 -3
  21. package/assets/images/info.svg +0 -3
  22. package/assets/images/success-dark.svg +0 -3
  23. package/assets/images/success.svg +0 -3
  24. package/assets/images/warning-dark.svg +0 -3
  25. package/assets/images/warning.svg +0 -3
  26. package/dist/components/ActionAddButton/index.d.ts +0 -5
  27. package/dist/components/ActionAddButton/index.js +0 -11
  28. package/dist/components/ActionAddButton/stories.d.ts +0 -27
  29. package/dist/components/ActionAddButton/stories.js +0 -34
  30. package/dist/components/ActionButton/index.d.ts +0 -7
  31. package/dist/components/ActionButton/index.js +0 -9
  32. package/dist/components/ActionButton/stories.d.ts +0 -20
  33. package/dist/components/ActionButton/stories.js +0 -23
  34. package/dist/components/ActionDownloadButton/index.d.ts +0 -4
  35. package/dist/components/ActionDownloadButton/index.js +0 -7
  36. package/dist/components/ActionDownloadButton/stories.d.ts +0 -37
  37. package/dist/components/ActionDownloadButton/stories.js +0 -23
  38. package/dist/components/ActionRemoveButton/index.d.ts +0 -4
  39. package/dist/components/ActionRemoveButton/index.js +0 -7
  40. package/dist/components/ActionRemoveButton/stories.d.ts +0 -47
  41. package/dist/components/ActionRemoveButton/stories.js +0 -23
  42. package/dist/components/AppError/index.d.ts +0 -8
  43. package/dist/components/AppError/index.js +0 -19
  44. package/dist/components/AppError/stories.d.ts +0 -17
  45. package/dist/components/AppError/stories.js +0 -23
  46. package/dist/components/AppLayout/index.d.ts +0 -10
  47. package/dist/components/AppLayout/index.js +0 -10
  48. package/dist/components/AppNavigation/index.d.ts +0 -5
  49. package/dist/components/AppNavigation/index.js +0 -8
  50. package/dist/components/AppNavigationComponent/index.d.ts +0 -11
  51. package/dist/components/AppNavigationComponent/index.js +0 -19
  52. package/dist/components/AppNavigationSub/index.d.ts +0 -11
  53. package/dist/components/AppNavigationSub/index.js +0 -12
  54. package/dist/components/AppPageNotFound/index.d.ts +0 -2
  55. package/dist/components/AppPageNotFound/index.js +0 -8
  56. package/dist/components/AppPageNotFound/stories.d.ts +0 -17
  57. package/dist/components/AppPageNotFound/stories.js +0 -15
  58. package/dist/components/Auth/index.d.ts +0 -10
  59. package/dist/components/Auth/index.js +0 -10
  60. package/dist/components/Badge/index.d.ts +0 -7
  61. package/dist/components/Badge/index.js +0 -20
  62. package/dist/components/Badge/stories.d.ts +0 -22
  63. package/dist/components/Badge/stories.js +0 -32
  64. package/dist/components/BooleanBadge/index.d.ts +0 -6
  65. package/dist/components/BooleanBadge/index.js +0 -7
  66. package/dist/components/BooleanBadge/stories.d.ts +0 -24
  67. package/dist/components/BooleanBadge/stories.js +0 -30
  68. package/dist/components/BooleanFilter/index.d.ts +0 -7
  69. package/dist/components/BooleanFilter/index.js +0 -28
  70. package/dist/components/CSVFormField/index.d.ts +0 -4
  71. package/dist/components/CSVFormField/index.js +0 -7
  72. package/dist/components/CSVFormField copy/index.d.ts +0 -4
  73. package/dist/components/CSVFormField copy/index.js +0 -7
  74. package/dist/components/Config/index.d.ts +0 -6
  75. package/dist/components/Config/index.js +0 -9
  76. package/dist/components/ConfirmableButton/index.d.ts +0 -4
  77. package/dist/components/ConfirmableButton/index.js +0 -8
  78. package/dist/components/ConfirmableForm/index.d.ts +0 -4
  79. package/dist/components/ConfirmableForm/index.js +0 -5
  80. package/dist/components/ConfirmableForm copy/index.d.ts +0 -4
  81. package/dist/components/ConfirmableForm copy/index.js +0 -7
  82. package/dist/components/Dashboard/index.d.ts +0 -6
  83. package/dist/components/Dashboard/index.js +0 -5
  84. package/dist/components/DataTable/index.d.ts +0 -8
  85. package/dist/components/DataTable/index.js +0 -5
  86. package/dist/components/DataTable/stories.d.ts +0 -10
  87. package/dist/components/DataTable/stories.js +0 -24
  88. package/dist/components/DateFilter/index.d.ts +0 -4
  89. package/dist/components/DateFilter/index.js +0 -35
  90. package/dist/components/DropdownFilter/index.d.ts +0 -5
  91. package/dist/components/DropdownFilter/index.js +0 -10
  92. package/dist/components/EditableCSVFormField/index.d.ts +0 -4
  93. package/dist/components/EditableCSVFormField/index.js +0 -7
  94. package/dist/components/EditableCSVFormField copy/index.d.ts +0 -4
  95. package/dist/components/EditableCSVFormField copy/index.js +0 -7
  96. package/dist/components/EditableCheckboxFormField/index.d.ts +0 -4
  97. package/dist/components/EditableCheckboxFormField/index.js +0 -7
  98. package/dist/components/EditableForm/index.d.ts +0 -4
  99. package/dist/components/EditableForm/index.js +0 -7
  100. package/dist/components/EditableImageFormField/index.d.ts +0 -4
  101. package/dist/components/EditableImageFormField/index.js +0 -7
  102. package/dist/components/EmptyMessage/index.d.ts +0 -6
  103. package/dist/components/EmptyMessage/index.js +0 -6
  104. package/dist/components/FilterBar/index.d.ts +0 -9
  105. package/dist/components/FilterBar/index.js +0 -49
  106. package/dist/components/FilterBarClearButton/index.d.ts +0 -5
  107. package/dist/components/FilterBarClearButton/index.js +0 -6
  108. package/dist/components/FilterBarColumns/index.d.ts +0 -8
  109. package/dist/components/FilterBarColumns/index.js +0 -12
  110. package/dist/components/FilterBarItem/index.d.ts +0 -25
  111. package/dist/components/FilterBarItem/index.js +0 -83
  112. package/dist/components/FilterBarSort/index.d.ts +0 -8
  113. package/dist/components/FilterBarSort/index.js +0 -27
  114. package/dist/components/GridList/index.d.ts +0 -4
  115. package/dist/components/GridList/index.js +0 -7
  116. package/dist/components/GridListItem/index.d.ts +0 -3
  117. package/dist/components/GridListItem/index.js +0 -8
  118. package/dist/components/ImageFormField/index.d.ts +0 -4
  119. package/dist/components/ImageFormField/index.js +0 -7
  120. package/dist/components/InfoPanel/index.d.ts +0 -9
  121. package/dist/components/InfoPanel/index.js +0 -22
  122. package/dist/components/List/index.d.ts +0 -5
  123. package/dist/components/List/index.js +0 -10
  124. package/dist/components/List/stories.d.ts +0 -24
  125. package/dist/components/List/stories.js +0 -27
  126. package/dist/components/ListAction/index.d.ts +0 -7
  127. package/dist/components/ListAction/index.js +0 -9
  128. package/dist/components/ListActions/index.d.ts +0 -11
  129. package/dist/components/ListActions/index.js +0 -21
  130. package/dist/components/ListClientComponent/index.d.ts +0 -10
  131. package/dist/components/ListClientComponent/index.js +0 -8
  132. package/dist/components/ListComponent/index.d.ts +0 -20
  133. package/dist/components/ListComponent/index.js +0 -49
  134. package/dist/components/ListItem/index.d.ts +0 -22
  135. package/dist/components/ListItem/index.js +0 -32
  136. package/dist/components/ListItem/stories.d.ts +0 -38
  137. package/dist/components/ListItem/stories.js +0 -80
  138. package/dist/components/ListItemMeta/index.d.ts +0 -7
  139. package/dist/components/ListItemMeta/index.js +0 -26
  140. package/dist/components/ListItemSecondary/index.d.ts +0 -11
  141. package/dist/components/ListItemSecondary/index.js +0 -14
  142. package/dist/components/ListMenu/index.d.ts +0 -4
  143. package/dist/components/ListMenu/index.js +0 -9
  144. package/dist/components/ListMenuButton/index.d.ts +0 -4
  145. package/dist/components/ListMenuButton/index.js +0 -6
  146. package/dist/components/ListSkeleton/index.d.ts +0 -2
  147. package/dist/components/ListSkeleton/index.js +0 -5
  148. package/dist/components/Loader/index.d.ts +0 -6
  149. package/dist/components/Loader/index.js +0 -12
  150. package/dist/components/MeActions/index.d.ts +0 -6
  151. package/dist/components/MeActions/index.js +0 -6
  152. package/dist/components/MePanel/index.d.ts +0 -10
  153. package/dist/components/MePanel/index.js +0 -7
  154. package/dist/components/Menu/index.d.ts +0 -9
  155. package/dist/components/Menu/index.js +0 -7
  156. package/dist/components/MenuButton/index.d.ts +0 -8
  157. package/dist/components/MenuButton/index.js +0 -16
  158. package/dist/components/MenuItem/index.d.ts +0 -13
  159. package/dist/components/MenuItem/index.js +0 -26
  160. package/dist/components/ModalAddForm/index.d.ts +0 -4
  161. package/dist/components/ModalAddForm/index.js +0 -7
  162. package/dist/components/MoneyRangeFilter/index.d.ts +0 -4
  163. package/dist/components/MoneyRangeFilter/index.js +0 -17
  164. package/dist/components/Page/index.d.ts +0 -11
  165. package/dist/components/Page/index.js +0 -11
  166. package/dist/components/PaginatedList/index.d.ts +0 -8
  167. package/dist/components/PaginatedList/index.js +0 -22
  168. package/dist/components/PaginatedListComponent/index.d.ts +0 -13
  169. package/dist/components/PaginatedListComponent/index.js +0 -20
  170. package/dist/components/PaginatedTable/index.d.ts +0 -9
  171. package/dist/components/PaginatedTable/index.js +0 -22
  172. package/dist/components/PaginatedTableComponent/index.d.ts +0 -11
  173. package/dist/components/PaginatedTableComponent/index.js +0 -19
  174. package/dist/components/Pagination/index.d.ts +0 -7
  175. package/dist/components/Pagination/index.js +0 -40
  176. package/dist/components/PaginationItem/index.d.ts +0 -9
  177. package/dist/components/PaginationItem/index.js +0 -16
  178. package/dist/components/Panel/index.d.ts +0 -9
  179. package/dist/components/Panel/index.js +0 -16
  180. package/dist/components/RangeFilter/index.d.ts +0 -7
  181. package/dist/components/RangeFilter/index.js +0 -38
  182. package/dist/components/RootLayout/index.d.ts +0 -10
  183. package/dist/components/RootLayout/index.js +0 -15
  184. package/dist/components/SettingsForm/index.d.ts +0 -6
  185. package/dist/components/SettingsForm/index.js +0 -14
  186. package/dist/components/SettingsPage/index.d.ts +0 -2
  187. package/dist/components/SettingsPage/index.js +0 -9
  188. package/dist/components/SortFilter/index.d.ts +0 -5
  189. package/dist/components/SortFilter/index.js +0 -9
  190. package/dist/components/StatusModal/index.d.ts +0 -8
  191. package/dist/components/StatusModal/index.js +0 -33
  192. package/dist/components/Summary/index.d.ts +0 -8
  193. package/dist/components/Summary/index.js +0 -14
  194. package/dist/components/Table/index.d.ts +0 -6
  195. package/dist/components/Table/index.js +0 -9
  196. package/dist/components/TableClientComponent/index.d.ts +0 -17
  197. package/dist/components/TableClientComponent/index.js +0 -15
  198. package/dist/components/TableColumn/index.d.ts +0 -5
  199. package/dist/components/TableColumn/index.js +0 -29
  200. package/dist/components/TableComponent/index.d.ts +0 -19
  201. package/dist/components/TableComponent/index.js +0 -50
  202. package/dist/components/Tabs/index.d.ts +0 -3
  203. package/dist/components/Tabs/index.js +0 -8
  204. package/dist/components/TabsComponent/index.d.ts +0 -7
  205. package/dist/components/TabsComponent/index.js +0 -9
  206. package/dist/components/Test/index.d.ts +0 -1
  207. package/dist/components/Test/index.js +0 -14
  208. package/dist/components/Tooltip/index.d.ts +0 -6
  209. package/dist/components/Tooltip/index.js +0 -15
  210. package/dist/components/Tooltip/stories.d.ts +0 -18
  211. package/dist/components/Tooltip/stories.js +0 -26
  212. package/dist/components/index.d.ts +0 -73
  213. package/dist/components/index.js +0 -37
  214. package/dist/filters/components/BooleanFilter/index.d.ts +0 -3
  215. package/dist/filters/components/BooleanFilter/index.js +0 -10
  216. package/dist/filters/components/CalendarFilter/index.d.ts +0 -3
  217. package/dist/filters/components/CalendarFilter/index.js +0 -11
  218. package/dist/filters/components/ColumnFilter/index.d.ts +0 -9
  219. package/dist/filters/components/ColumnFilter/index.js +0 -11
  220. package/dist/filters/components/DateFilter/index.d.ts +0 -3
  221. package/dist/filters/components/DateFilter/index.js +0 -21
  222. package/dist/filters/components/DropdownFilter/index.d.ts +0 -3
  223. package/dist/filters/components/DropdownFilter/index.js +0 -10
  224. package/dist/filters/components/FilterBar/index.d.ts +0 -8
  225. package/dist/filters/components/FilterBar/index.js +0 -8
  226. package/dist/filters/components/FilterBarClientComponent/index.d.ts +0 -8
  227. package/dist/filters/components/FilterBarClientComponent/index.js +0 -26
  228. package/dist/filters/components/FilterClearButton/index.d.ts +0 -5
  229. package/dist/filters/components/FilterClearButton/index.js +0 -6
  230. package/dist/filters/components/FilterControl/index.d.ts +0 -10
  231. package/dist/filters/components/FilterControl/index.js +0 -9
  232. package/dist/filters/components/FilterItem/index.d.ts +0 -9
  233. package/dist/filters/components/FilterItem/index.js +0 -39
  234. package/dist/filters/components/FilterPanel/index.d.ts +0 -11
  235. package/dist/filters/components/FilterPanel/index.js +0 -36
  236. package/dist/filters/components/FilterPanelComponent/index.d.ts +0 -7
  237. package/dist/filters/components/FilterPanelComponent/index.js +0 -12
  238. package/dist/filters/components/MoneyFilter/index.d.ts +0 -0
  239. package/dist/filters/components/MoneyFilter/index.js +0 -1
  240. package/dist/filters/components/MultiFilter/index.d.ts +0 -3
  241. package/dist/filters/components/MultiFilter/index.js +0 -11
  242. package/dist/filters/components/RangeFilter/index.d.ts +0 -0
  243. package/dist/filters/components/RangeFilter/index.js +0 -1
  244. package/dist/filters/components/SearchFilter/index.d.ts +0 -4
  245. package/dist/filters/components/SearchFilter/index.js +0 -26
  246. package/dist/filters/components/SortFilter/index.d.ts +0 -9
  247. package/dist/filters/components/SortFilter/index.js +0 -40
  248. package/dist/filters/components/SwitchFilter/index.d.ts +0 -6
  249. package/dist/filters/components/SwitchFilter/index.js +0 -11
  250. package/dist/filters/hooks/useDynamicData.d.ts +0 -6
  251. package/dist/filters/hooks/useDynamicData.js +0 -30
  252. package/dist/filters/index.d.ts +0 -19
  253. package/dist/filters/index.js +0 -152
  254. package/dist/filters/interfaces.d.ts +0 -41
  255. package/dist/filters/utility/get-quick-dates.d.ts +0 -3
  256. package/dist/filters/utility/get-quick-dates.js +0 -88
  257. package/dist/filters/utility/render-sort.d.ts +0 -3
  258. package/dist/filters/utility/render-sort.js +0 -22
  259. package/dist/filters/utility/render-value.d.ts +0 -3
  260. package/dist/filters/utility/render-value.js +0 -54
  261. package/dist/filters/utility/transform-boolean.d.ts +0 -2
  262. package/dist/filters/utility/transform-boolean.js +0 -10
  263. package/dist/filters/utility/transform-date.d.ts +0 -2
  264. package/dist/filters/utility/transform-date.js +0 -29
  265. package/dist/filters/utility/transform-multi.d.ts +0 -2
  266. package/dist/filters/utility/transform-multi.js +0 -9
  267. package/dist/hooks/useImageForm.d.ts +0 -0
  268. package/dist/hooks/useImageForm.js +0 -0
  269. package/dist/hooks/useNavigation.d.ts +0 -11
  270. package/dist/hooks/useNavigation.js +0 -27
  271. package/dist/index.cjs +0 -1266
  272. package/dist/index.cjs.map +0 -1
  273. package/dist/index.js.map +0 -1
  274. package/dist/interfaces.d.ts +0 -8
  275. package/dist/interfaces.js +0 -1
  276. package/dist/services/ConfigService.d.ts +0 -16
  277. package/dist/services/ConfigService.js +0 -14
  278. package/dist/services/PermissionService.d.ts +0 -3
  279. package/dist/services/PermissionService.js +0 -30
  280. package/dist/services/SettingsService.d.ts +0 -8
  281. package/dist/services/SettingsService.js +0 -9
  282. package/dist/styles/auth.d.ts +0 -12
  283. package/dist/styles/auth.js +0 -12
  284. package/dist/styles/config.js +0 -263
  285. package/dist/styles/postcss.d.ts +0 -6
  286. package/dist/styles/postcss.js +0 -4
  287. package/dist/styles/tailwind.d.ts +0 -10
  288. package/dist/styles/tailwind.js +0 -89
  289. package/dist/utility/check-has-filters.d.ts +0 -2
  290. package/dist/utility/check-has-filters.js +0 -6
  291. package/dist/utility/get-empty-filter-props.d.ts +0 -0
  292. package/dist/utility/get-empty-filter-props.js +0 -0
  293. package/dist/utility/get-search-params.d.ts +0 -2
  294. package/dist/utility/get-search-params.js +0 -12
  295. package/dist/utility/has-filters.d.ts +0 -0
  296. package/dist/utility/has-filters.js +0 -0
  297. package/dist/utility/lang.d.ts +0 -5
  298. package/dist/utility/lang.js +0 -5
  299. package/dist/utility/storybook/ModalWrapper/index.d.ts +0 -6
  300. package/dist/utility/storybook/ModalWrapper/index.js +0 -14
  301. package/dist/utility/storybook/OnDark/index.d.ts +0 -5
  302. package/dist/utility/storybook/OnDark/index.js +0 -5
  303. package/dist/utility/storybook/Wrapper/index.d.ts +0 -5
  304. package/dist/utility/storybook/Wrapper/index.js +0 -8
  305. package/dist/utility/types.d.ts +0 -2
  306. package/dist/utility/types.js +0 -3
  307. package/postcss.config.cjs +0 -3
  308. package/styles.css +0 -82
  309. package/tailwind.js +0 -11
  310. /package/dist/components/{PageActions → AdminPageActions}/index.d.ts +0 -0
  311. /package/dist/components/{PageActions → AdminPageActions}/index.js +0 -0
  312. /package/dist/{filters → utility}/interfaces.js +0 -0
@@ -0,0 +1,7 @@
1
+ import type { AdminConfig } from '../../utility/interfaces';
2
+ interface AdminAppLayoutProps {
3
+ readonly children: React.ReactNode;
4
+ readonly config?: AdminConfig;
5
+ }
6
+ declare function AdminAppLayout({ children, config }: AdminAppLayoutProps): React.ReactElement;
7
+ export default AdminAppLayout;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Link } from '@sqrzro/ui/components';
3
+ import { AppNavigation } from '@sqrzro/ui/navigation';
4
+ function AdminAppLayout({ children, config }) {
5
+ return (_jsxs("div", { className: "flex flex-1 flex-col", children: [_jsx("header", { className: "bg-slate-800", children: _jsxs("div", { className: "flex h-16 items-center border-b border-slate-700 px-4", children: [_jsx(Link, { className: "h-9 w-9", href: "/", children: _jsx("span", { className: "sr-only", children: config?.app.name }) }), _jsx(AppNavigation, { data: config?.navigation || [] })] }) }), _jsx("main", { className: "@container mb-10 block flex flex-1 flex-col", children: children })] }));
6
+ }
7
+ export default AdminAppLayout;
@@ -0,0 +1,6 @@
1
+ interface AdminPageProps {
2
+ readonly children: React.ReactNode;
3
+ readonly title: string;
4
+ }
5
+ declare function AdminPage({ children, title }: AdminPageProps): React.ReactElement;
6
+ export default AdminPage;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from 'react';
3
+ import { Container } from '@sqrzro/ui/components';
4
+ function AdminPage({ children, title }) {
5
+ return (_jsxs(Fragment, { children: [_jsx("header", { className: "bg-slate-800 pb-16 text-white", children: _jsx(Container, { children: _jsxs("div", { className: "flex items-center justify-between py-10", children: [_jsx("h1", { className: "flex min-h-10 items-center text-3xl font-semibold", children: title }), _jsx("div", { className: "flex gap-2", id: "page-actions" })] }) }) }), _jsx(Container, { children: _jsx("div", { className: "@container -mt-16 flex flex-col gap-8", children: children }) })] }));
6
+ }
7
+ export default AdminPage;
@@ -0,0 +1,5 @@
1
+ interface AdminRootLayoutProps {
2
+ readonly children: React.ReactNode;
3
+ }
4
+ declare function AdminRootLayout({ children }: AdminRootLayoutProps): React.ReactElement;
5
+ export default AdminRootLayout;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { RootLayout } from '@sqrzro/ui/components';
3
+ import classNameConfig from '../../config';
4
+ function AdminRootLayout({ children }) {
5
+ return _jsx(RootLayout, { classNameConfig: classNameConfig, children: children });
6
+ }
7
+ export default AdminRootLayout;
@@ -1,3 +1,3 @@
1
- import type { RegisteredClassNames } from '@sqrzro/components';
1
+ import type { RegisteredClassNames } from '@sqrzro/ui/styles';
2
2
  declare const classNames: RegisteredClassNames;
3
3
  export default classNames;
package/dist/config.js ADDED
@@ -0,0 +1,66 @@
1
+ import { twx } from '@sqrzro/ui/styles';
2
+ const classNames = twx({
3
+ appNavigation: {
4
+ root: 'h-full pl-6',
5
+ list: 'flex h-full items-center gap-4',
6
+ item: { default: 'relative h-full' },
7
+ link: {
8
+ default: 'relative flex h-full items-center px-1 font-semibold text-white/80 hover:text-white',
9
+ highlighted: 'before:bg-primary text-white before:absolute before:bottom-0 before:left-0 before:right-0 before:h-1',
10
+ },
11
+ },
12
+ button: {
13
+ root: {
14
+ danger: 'border-red-500 bg-white text-red-500',
15
+ default: 'h-10 rounded border border-slate-300 bg-white px-5 text-sm text-slate-600',
16
+ primary: 'bg-button-bg hover:bg-button-bg-hover text-button-text border-none font-semibold transition-colors',
17
+ link: 'text-link h-auto w-auto border-0 bg-transparent p-0',
18
+ },
19
+ icon: '-ml-1.5 h-4 w-4',
20
+ },
21
+ container: {
22
+ root: 'mx-auto w-full max-w-6xl px-8',
23
+ },
24
+ editableForm: {
25
+ root: 'grid grid-cols-[25%_1fr] gap-20 rounded bg-white p-8 shadow',
26
+ title: 'mb-8 text-lg font-semibold leading-none text-slate-700',
27
+ description: 'text-slate-600',
28
+ actions: 'flex justify-end gap-2 border-t border-slate-200 pt-4',
29
+ },
30
+ modal: {
31
+ root: 'starting:open:backdrop:opacity-0 py-16 backdrop:bg-slate-700/50 backdrop:transition-all backdrop:duration-500 open:backdrop:opacity-100',
32
+ panel: 'show row-start-2 mx-auto flex w-full max-w-lg flex-col gap-6 rounded bg-white p-6 shadow-xl',
33
+ content: 'flex flex-col gap-6 [&_p]:text-pretty',
34
+ icon: 'text-slate-400',
35
+ title: 'flex items-center gap-2 border-b border-slate-200 pb-6 text-lg font-semibold',
36
+ actions: 'border-t border-slate-200 pt-6',
37
+ },
38
+ pagination: {
39
+ root: 'mx-auto flex w-full justify-between',
40
+ list: 'mx-auto flex flex-row items-center gap-1',
41
+ link: {
42
+ default: 'inline-flex h-9 w-9 items-center justify-center whitespace-nowrap rounded-md border border-transparent text-sm font-medium hover:bg-slate-100 disabled:pointer-events-none disabled:opacity-30',
43
+ highlighted: 'border-slate-200 bg-white shadow-sm',
44
+ },
45
+ gap: 'flex h-9 w-9 items-center justify-center text-xs text-slate-400',
46
+ navigation: 'inline-flex h-9 items-center justify-center gap-1 whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium hover:bg-slate-100',
47
+ },
48
+ rootLayout: {
49
+ root: 'overflow-x-hidden overflow-y-scroll bg-slate-50 font-sans text-sm text-slate-800 has-[[data-modal][open]]:overflow-hidden',
50
+ content: 'flex min-h-screen flex-col',
51
+ },
52
+ textInput: {
53
+ root: {
54
+ default: 'text-md focus:border-primary h-10 rounded border border-slate-300 px-3 placeholder-slate-400',
55
+ error: 'border-red-500',
56
+ },
57
+ prefix: {
58
+ default: 'peer-focus:border-primary relative -mr-1 rounded-l border border-slate-300 bg-white px-3 text-sm text-slate-600',
59
+ },
60
+ suffix: {
61
+ default: 'peer-focus:border-primary relative -ml-1 rounded-r border border-slate-300 bg-white px-3 text-sm text-slate-600',
62
+ },
63
+ loading: 'text-slate-400',
64
+ },
65
+ });
66
+ export default classNames;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,6 @@
1
- export * from './components';
2
- export { filter, parseFilters } from './filters';
3
- export { default as FilterBar } from './filters/components/FilterBar';
4
- export type { FilterMap } from './filters/interfaces';
5
- export { transformFromBoolean, transformToBoolean } from './filters/utility/transform-boolean';
6
- export { transformFromDate, transformToDate } from './filters/utility/transform-date';
7
- export { transformFromMulti, transformToMulti } from './filters/utility/transform-multi';
8
- export * from './interfaces';
9
- export * from './services/ConfigService';
10
- export { default as authClassNames } from './styles/auth';
1
+ export * from './utility/interfaces';
2
+ export { default as classNames } from './config';
3
+ export { default as AdminAppLayout } from './components/AdminAppLayout';
4
+ export { default as AdminPage } from './components/AdminPage';
5
+ export { default as AdminPageActions } from './components/AdminPageActions';
6
+ export { default as AdminRootLayout } from './components/AdminRootLayout';
package/dist/index.js CHANGED
@@ -1,9 +1,6 @@
1
- export * from './components';
2
- export { filter, parseFilters } from './filters';
3
- export { default as FilterBar } from './filters/components/FilterBar';
4
- export { transformFromBoolean, transformToBoolean } from './filters/utility/transform-boolean';
5
- export { transformFromDate, transformToDate } from './filters/utility/transform-date';
6
- export { transformFromMulti, transformToMulti } from './filters/utility/transform-multi';
7
- export * from './interfaces';
8
- export * from './services/ConfigService';
9
- export { default as authClassNames } from './styles/auth';
1
+ export * from './utility/interfaces';
2
+ export { default as classNames } from './config';
3
+ export { default as AdminAppLayout } from './components/AdminAppLayout';
4
+ export { default as AdminPage } from './components/AdminPage';
5
+ export { default as AdminPageActions } from './components/AdminPageActions';
6
+ export { default as AdminRootLayout } from './components/AdminRootLayout';
@@ -0,0 +1,8 @@
1
+ import { NavigationObject } from 'node_modules/@sqrzro/ui/dist/navigation/interfaces';
2
+ export interface AdminConfig {
3
+ app: {
4
+ name: string;
5
+ url: string;
6
+ };
7
+ navigation: NavigationObject[];
8
+ }
package/package.json CHANGED
@@ -1,81 +1,32 @@
1
1
  {
2
2
  "name": "@sqrzro/admin",
3
3
  "type": "module",
4
- "version": "2.1.0-r19.98",
4
+ "version": "4.0.0-alpha.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "ISC",
8
- "exports": {
9
- ".": "./dist/index.js",
10
- "./postcss": "./postcss.config.cjs",
11
- "./styles.css": "./styles.css",
12
- "./tailwind": "./tailwind.js"
13
- },
14
8
  "files": [
15
- "assets/**/*",
16
- "dist/**/*",
17
- "postcss.config.cjs",
18
- "styles.css",
19
- "tailwind.js"
9
+ "dist/**/*"
20
10
  ],
21
11
  "dependencies": {
22
- "@heroicons/react": "^2.2.0",
23
- "@sqrzro/components": "r19",
24
- "@sqrzro/hooks": "r19",
25
- "@sqrzro/interfaces": "r19",
26
- "@sqrzro/server": "r19",
27
- "@sqrzro/utility": "r19",
28
- "next": "^15.4.1",
29
- "react": "^19.1.0",
30
- "react-dom": "^19.1.0"
12
+ "next": "^16.0.8",
13
+ "react": "^19.2.1",
14
+ "react-dom": "^19.2.1",
15
+ "@sqrzro/ui": "^4.0.0-alpha.0"
31
16
  },
32
17
  "devDependencies": {
33
- "@babel/core": "^7.28.0",
34
- "@babel/preset-env": "^7.28.0",
35
- "@babel/preset-react": "^7.27.1",
36
- "@babel/preset-typescript": "^7.27.1",
37
- "@chromatic-com/storybook": "^4.1.1",
38
- "@sqrzro/eslint-plugin": "r19",
39
- "@sqrzro/prettier-config": "r19",
40
- "@sqrzro/tailwind-plugin": "r19",
41
- "@storybook/addon-a11y": "^9.1.3",
42
- "@storybook/addon-docs": "^9.1.3",
43
- "@storybook/addon-onboarding": "^9.1.3",
44
- "@storybook/nextjs": "^9.1.3",
45
- "@testing-library/dom": "^8.20.1",
46
- "@testing-library/jest-dom": "^5.17.0",
47
- "@testing-library/react": "^16.3.0",
48
- "@testing-library/user-event": "^14.6.1",
49
- "@types/bcrypt": "^5.0.2",
50
- "@types/jest": "^29.5.14",
51
- "@types/node": "18.14.6",
52
- "@types/react": "^19.1.8",
53
- "@types/react-dom": "^19.1.6",
54
- "babel-loader": "^8.4.1",
55
- "concurrently": "^7.6.0",
56
- "eslint": "^8.57.1",
57
- "jest": "^29.7.0",
58
- "mockdate": "^3.0.5",
59
- "prettier": "^3.6.2",
60
- "rimraf": "^4.4.1",
61
- "storybook": "^9.1.3",
62
- "tailwindcss": "^4.1.11",
63
- "tslib": "^2.8.1",
64
- "tsup": "^8.5.0",
65
- "tsx": "^4.20.3",
66
- "typescript": "^5.8.3"
18
+ "@types/react": "^19.2.7",
19
+ "@types/react-dom": "^19.2.3",
20
+ "concurrently": "^9.2.1",
21
+ "prettier": "^3.7.4",
22
+ "rimraf": "^6.1.2",
23
+ "tsc-alias": "^1.8.16",
24
+ "typescript": "^5.9.3",
25
+ "@sqrzro/prettier-config": "^4.0.0-alpha.0"
67
26
  },
68
27
  "scripts": {
69
- "build": "tsc -p tsconfig.build.json",
28
+ "build": "pnpm clean && tsc -p tsconfig.build.json && tsc-alias",
70
29
  "clean": "rimraf ./dist",
71
- "dev": "pnpm build --watch",
72
- "docs:build": "pnpm docs:import && storybook build",
73
- "docs:import": "tsx scripts/import-component-stories.ts",
74
- "docs:start": "pnpm docs:import && storybook dev -p 6006",
75
- "lint": "tsc --noEmit && eslint \"./src/**/*.tsx\" \"./src/**/*.ts\"",
76
- "prettier": "prettier --write \"./src/**/*.tsx\" \"./src/**/*.ts\"",
77
- "start": "pnpm dev",
78
- "test": "jest",
79
- "test:coverage": "jest --coverage"
30
+ "dev": "(concurrently \"tsc -p tsconfig.build.json --watch\" \"tsc-alias -w\")"
80
31
  }
81
32
  }
package/README.md DELETED
@@ -1,22 +0,0 @@
1
- <div align="center">
2
-
3
- <h1>
4
- <img src="assets/logo.svg" alt="" width="64" style="margin-bottom: 5px">
5
- <br />
6
- Square Zero Admin
7
- </h1>
8
-
9
- <p>An intentionally opionated collection of components, hooks, services and utilities that lets you very quickly build admin systems in Typescript & React.</p>
10
- <p>[Click here to get started](/story/guides-installation--page)</p>
11
-
12
- <hr />
13
-
14
- [![GitHub license](https://img.shields.io/badge/license-ISC-blue.svg)](https://github.com/sqrzro/sqrzro/admin/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/@sqrzro/admin.svg?style=flat)](https://www.npmjs.com/package/@sqrzro/admin) [![Build](https://github.com/sqrzro/sqrzro/admin/actions/workflows/development.yml/badge.svg)](https://github.com/sqrzro/sqrzro/admin/actions/workflows/development.yml)
15
-
16
- </div>
17
-
18
- <hr />
19
-
20
- ## A Note on Beta
21
-
22
- Currently, the latest version of Square Zero Admin is `beta`. Although the package is well tested, and used on a number of production sites, with the current lack of documentation it would be unfair to describe it as ‘production-ready’, unless being used by the developers of the package. Work on complete documentation is underway and a true version `1.0.0` should be available in the near future.
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M20.7071 5.29289C21.0976 5.68342 21.0976 6.31658 20.7071 6.70711L9.70711 17.7071C9.31658 18.0976 8.68342 18.0976 8.29289 17.7071L3.29289 12.7071C2.90237 12.3166 2.90237 11.6834 3.29289 11.2929C3.68342 10.9024 4.31658 10.9024 4.70711 11.2929L9 15.5858L19.2929 5.29289C19.6834 4.90237 20.3166 4.90237 20.7071 5.29289Z" fill="white"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M5.29289 8.29289C5.68342 7.90237 6.31658 7.90237 6.70711 8.29289L12 13.5858L17.2929 8.29289C17.6834 7.90237 18.3166 7.90237 18.7071 8.29289C19.0976 8.68342 19.0976 9.31658 18.7071 9.70711L12.7071 15.7071C12.3166 16.0976 11.6834 16.0976 11.2929 15.7071L5.29289 9.70711C4.90237 9.31658 4.90237 8.68342 5.29289 8.29289Z" fill="#64748B"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M5.29289 5.29289C5.68342 4.90237 6.31658 4.90237 6.70711 5.29289L12 10.5858L17.2929 5.29289C17.6834 4.90237 18.3166 4.90237 18.7071 5.29289C19.0976 5.68342 19.0976 6.31658 18.7071 6.70711L13.4142 12L18.7071 17.2929C19.0976 17.6834 19.0976 18.3166 18.7071 18.7071C18.3166 19.0976 17.6834 19.0976 17.2929 18.7071L12 13.4142L6.70711 18.7071C6.31658 19.0976 5.68342 19.0976 5.29289 18.7071C4.90237 18.3166 4.90237 17.6834 5.29289 17.2929L10.5858 12L5.29289 6.70711C4.90237 6.31658 4.90237 5.68342 5.29289 5.29289Z" fill="#64748B"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12ZM8.29289 8.29289C8.68342 7.90237 9.31658 7.90237 9.70711 8.29289L12 10.5858L14.2929 8.29289C14.6834 7.90237 15.3166 7.90237 15.7071 8.29289C16.0976 8.68342 16.0976 9.31658 15.7071 9.70711L13.4142 12L15.7071 14.2929C16.0976 14.6834 16.0976 15.3166 15.7071 15.7071C15.3166 16.0976 14.6834 16.0976 14.2929 15.7071L12 13.4142L9.70711 15.7071C9.31658 16.0976 8.68342 16.0976 8.29289 15.7071C7.90237 15.3166 7.90237 14.6834 8.29289 14.2929L10.5858 12L8.29289 9.70711C7.90237 9.31658 7.90237 8.68342 8.29289 8.29289Z" fill="#1e293b"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12ZM8.29289 8.29289C8.68342 7.90237 9.31658 7.90237 9.70711 8.29289L12 10.5858L14.2929 8.29289C14.6834 7.90237 15.3166 7.90237 15.7071 8.29289C16.0976 8.68342 16.0976 9.31658 15.7071 9.70711L13.4142 12L15.7071 14.2929C16.0976 14.6834 16.0976 15.3166 15.7071 15.7071C15.3166 16.0976 14.6834 16.0976 14.2929 15.7071L12 13.4142L9.70711 15.7071C9.31658 16.0976 8.68342 16.0976 8.29289 15.7071C7.90237 15.3166 7.90237 14.6834 8.29289 14.2929L10.5858 12L8.29289 9.70711C7.90237 9.31658 7.90237 8.68342 8.29289 8.29289Z" fill="#EF4444"/>
3
- </svg>
@@ -1,12 +0,0 @@
1
- <svg width="24" height="72" viewBox="0 0 24 72" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g clip-path="url(#clip0_61_10)">
3
- <path d="M2.42012 12.7132C2.28394 12.4975 2.21584 12.3897 2.17772 12.2234C2.14909 12.0985 2.14909 11.9015 2.17772 11.7766C2.21584 11.6103 2.28394 11.5025 2.42012 11.2868C3.54553 9.50484 6.8954 5 12.0004 5C17.1054 5 20.4553 9.50484 21.5807 11.2868C21.7169 11.5025 21.785 11.6103 21.8231 11.7766C21.8517 11.9015 21.8517 12.0985 21.8231 12.2234C21.785 12.3897 21.7169 12.4975 21.5807 12.7132C20.4553 14.4952 17.1054 19 12.0004 19C6.8954 19 3.54553 14.4952 2.42012 12.7132Z" stroke="#1e293b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
4
- <path d="M12.0004 15C13.6573 15 15.0004 13.6569 15.0004 12C15.0004 10.3431 13.6573 9 12.0004 9C10.3435 9 9.0004 10.3431 9.0004 12C9.0004 13.6569 10.3435 15 12.0004 15Z" stroke="#1e293b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5
- <path d="M10.7429 53.0923C11.1494 53.0322 11.5686 53 12.0004 53C17.1054 53 20.4553 57.5048 21.5807 59.2868C21.7169 59.5025 21.785 59.6103 21.8231 59.7767C21.8518 59.9016 21.8517 60.0987 21.8231 60.2236C21.7849 60.3899 21.7164 60.4985 21.5792 60.7156C21.2793 61.1901 20.8222 61.8571 20.2165 62.5805M6.72432 54.715C4.56225 56.1817 3.09445 58.2194 2.42111 59.2853C2.28428 59.5019 2.21587 59.6102 2.17774 59.7765C2.1491 59.9014 2.14909 60.0984 2.17771 60.2234C2.21583 60.3897 2.28393 60.4975 2.42013 60.7132C3.54554 62.4952 6.89541 67 12.0004 67C14.0588 67 15.8319 66.2676 17.2888 65.2766M3.00042 51L21.0004 69M9.8791 57.8787C9.3362 58.4216 9.00042 59.1716 9.00042 60C9.00042 61.6569 10.3436 63 12.0004 63C12.8288 63 13.5788 62.6642 14.1217 62.1213" stroke="#1e293b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
6
- </g>
7
- <defs>
8
- <clipPath id="clip0_61_10">
9
- <rect width="24" height="72" fill="white"/>
10
- </clipPath>
11
- </defs>
12
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12ZM11 8C11 7.44772 11.4477 7 12 7H12.01C12.5623 7 13.01 7.44772 13.01 8C13.01 8.55228 12.5623 9 12.01 9H12C11.4477 9 11 8.55228 11 8ZM12 11C12.5523 11 13 11.4477 13 12V16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16V12C11 11.4477 11.4477 11 12 11Z" fill="#1e293b"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12ZM11 8C11 7.44772 11.4477 7 12 7H12.01C12.5623 7 13.01 7.44772 13.01 8C13.01 8.55228 12.5623 9 12.01 9H12C11.4477 9 11 8.55228 11 8ZM12 11C12.5523 11 13 11.4477 13 12V16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16V12C11 11.4477 11.4477 11 12 11Z" fill="#3B82F6"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12ZM17.2071 8.29289C17.5976 8.68342 17.5976 9.31658 17.2071 9.70711L11.2071 15.7071C10.8166 16.0976 10.1834 16.0976 9.79289 15.7071L6.79289 12.7071C6.40237 12.3166 6.40237 11.6834 6.79289 11.2929C7.18342 10.9024 7.81658 10.9024 8.20711 11.2929L10.5 13.5858L15.7929 8.29289C16.1834 7.90237 16.8166 7.90237 17.2071 8.29289Z" fill="#1e293b"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12ZM17.2071 8.29289C17.5976 8.68342 17.5976 9.31658 17.2071 9.70711L11.2071 15.7071C10.8166 16.0976 10.1834 16.0976 9.79289 15.7071L6.79289 12.7071C6.40237 12.3166 6.40237 11.6834 6.79289 11.2929C7.18342 10.9024 7.81658 10.9024 8.20711 11.2929L10.5 13.5858L15.7929 8.29289C16.1834 7.90237 16.8166 7.90237 17.2071 8.29289Z" fill="#22C55E"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12ZM12 7C12.5523 7 13 7.44772 13 8V12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12V8C11 7.44772 11.4477 7 12 7ZM11 16C11 15.4477 11.4477 15 12 15H12.01C12.5623 15 13.01 15.4477 13.01 16C13.01 16.5523 12.5623 17 12.01 17H12C11.4477 17 11 16.5523 11 16Z" fill="#1e293b"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12ZM12 7C12.5523 7 13 7.44772 13 8V12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12V8C11 7.44772 11.4477 7 12 7ZM11 16C11 15.4477 11.4477 15 12 15H12.01C12.5623 15 13.01 15.4477 13.01 16C13.01 16.5523 12.5623 17 12.01 17H12C11.4477 17 11 16.5523 11 16Z" fill="#EAB308"/>
3
- </svg>
@@ -1,5 +0,0 @@
1
- import type { ButtonProps } from '@sqrzro/components';
2
- import type { ActionButtonProps } from '../ActionButton';
3
- export type ActionAddButtonProps = Omit<ActionButtonProps, 'action' | 'icon' | 'variant'> & Omit<ButtonProps, 'icon' | 'variant'>;
4
- declare function ActionAddButton({ href, ...props }: Readonly<ActionAddButtonProps>): React.ReactElement;
5
- export default ActionAddButton;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { PlusCircleIcon } from '@heroicons/react/16/solid';
3
- import { Button } from '@sqrzro/components';
4
- import ActionButton from '../ActionButton';
5
- function ActionAddButton({ href, ...props }) {
6
- if (href) {
7
- return _jsx(Button, { href: href, icon: _jsx(PlusCircleIcon, {}), variant: "primary", ...props });
8
- }
9
- return _jsx(ActionButton, { action: "new", icon: _jsx(PlusCircleIcon, {}), variant: "primary", ...props });
10
- }
11
- export default ActionAddButton;
@@ -1,27 +0,0 @@
1
- import type { StoryObj } from '@storybook/nextjs';
2
- import ActionAddButton from './index';
3
- /**
4
- * A helper button that will most often be used to open a modal for creating 'new' items. It will
5
- * always be styled as a primary button, and always have a plus icon.
6
- *
7
- * When given a `href` prop, this button behaves like any other `Button` with a `href` (i.e. like a
8
- * `Link` styled as a button).
9
- *
10
- * When the `href` prop is omitted, the button appends `action=new` to the current URL. It does this
11
- * by using the `ActionButton` component with the action preset to 'new'.
12
- *
13
- * As it essentially just a wrapper around the `Button` component, all `ButtonProps` can be applied
14
- * to this component.
15
- */
16
- declare const meta: {
17
- title: string;
18
- component: typeof ActionAddButton;
19
- parameters: {
20
- layout: string;
21
- };
22
- tags: string[];
23
- };
24
- export default meta;
25
- type Story = StoryObj<typeof meta>;
26
- export declare const Default: Story;
27
- export declare const WithHref: Story;
@@ -1,34 +0,0 @@
1
- import ActionAddButton from './index';
2
- /**
3
- * A helper button that will most often be used to open a modal for creating 'new' items. It will
4
- * always be styled as a primary button, and always have a plus icon.
5
- *
6
- * When given a `href` prop, this button behaves like any other `Button` with a `href` (i.e. like a
7
- * `Link` styled as a button).
8
- *
9
- * When the `href` prop is omitted, the button appends `action=new` to the current URL. It does this
10
- * by using the `ActionButton` component with the action preset to 'new'.
11
- *
12
- * As it essentially just a wrapper around the `Button` component, all `ButtonProps` can be applied
13
- * to this component.
14
- */
15
- const meta = {
16
- title: 'Buttons/ActionAddButton',
17
- component: ActionAddButton,
18
- parameters: {
19
- layout: 'centered',
20
- },
21
- tags: ['autodocs'],
22
- };
23
- export default meta;
24
- export const Default = {
25
- args: {
26
- children: 'Add New Item',
27
- },
28
- };
29
- export const WithHref = {
30
- args: {
31
- children: 'Add New Item',
32
- href: '/example',
33
- },
34
- };
@@ -1,7 +0,0 @@
1
- import type { ButtonProps } from '@sqrzro/components';
2
- export interface ActionButtonProps extends Omit<ButtonProps, 'href'> {
3
- action: string;
4
- extraParams?: Record<string, string | null>;
5
- }
6
- declare function ActionButton({ action, extraParams, ...props }: Readonly<ActionButtonProps>): React.ReactElement;
7
- export default ActionButton;
@@ -1,9 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Button } from '@sqrzro/components';
4
- import { useFilterHref } from '@sqrzro/hooks';
5
- function ActionButton({ action, extraParams, ...props }) {
6
- const { getFilterHref } = useFilterHref();
7
- return _jsx(Button, { ...props, href: getFilterHref({ action, ...extraParams }) });
8
- }
9
- export default ActionButton;
@@ -1,20 +0,0 @@
1
- import type { StoryObj } from '@storybook/nextjs';
2
- import ActionButton from './index';
3
- /**
4
- * A helper button that appends `action=${action}` to the current URL. This is useful for opening
5
- * modals.
6
- *
7
- * As it essentially just a wrapper around the `Button` component, all `ButtonProps` (except `href`)
8
- * can be applied to this component.
9
- */
10
- declare const meta: {
11
- title: string;
12
- component: typeof ActionButton;
13
- parameters: {
14
- layout: string;
15
- };
16
- tags: string[];
17
- };
18
- export default meta;
19
- type Story = StoryObj<typeof meta>;
20
- export declare const Default: Story;
@@ -1,23 +0,0 @@
1
- import ActionButton from './index';
2
- /**
3
- * A helper button that appends `action=${action}` to the current URL. This is useful for opening
4
- * modals.
5
- *
6
- * As it essentially just a wrapper around the `Button` component, all `ButtonProps` (except `href`)
7
- * can be applied to this component.
8
- */
9
- const meta = {
10
- title: 'Buttons/ActionButton',
11
- component: ActionButton,
12
- parameters: {
13
- layout: 'centered',
14
- },
15
- tags: ['autodocs'],
16
- };
17
- export default meta;
18
- export const Default = {
19
- args: {
20
- action: 'example',
21
- children: 'Do Example Action',
22
- },
23
- };
@@ -1,4 +0,0 @@
1
- import type { ButtonProps } from '@sqrzro/components';
2
- export type ActionDownloadButtonProps = Omit<ButtonProps, 'icon' | 'variant'>;
3
- declare function ActionDownloadButton({ classNameProps, ...props }: Readonly<ActionDownloadButtonProps>): React.ReactElement;
4
- export default ActionDownloadButton;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { ArrowDownTrayIcon } from '@heroicons/react/16/solid';
3
- import { Button } from '@sqrzro/components';
4
- function ActionDownloadButton({ classNameProps, ...props }) {
5
- return (_jsx(Button, { classNameProps: { isOnDark: true, ...classNameProps }, icon: _jsx(ArrowDownTrayIcon, {}), ...props }));
6
- }
7
- export default ActionDownloadButton;
@@ -1,37 +0,0 @@
1
- import type { StoryObj } from '@storybook/nextjs';
2
- import ActionDownloadButton from './index';
3
- /**
4
- * A helper button that is styled to look like a download button - with a download icon. As it is
5
- * will almost always appear in the header section of a page, it is also preset with the `isOnDark`
6
- * `classNameProp`. This however can be overridden if required.
7
- *
8
- * As it essentially just a wrapper around the `Button` component, all `ButtonProps` (except `icon`)
9
- * can be applied to this component.
10
- */
11
- declare const meta: {
12
- title: string;
13
- component: typeof ActionDownloadButton;
14
- decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/nextjs/*").ReactRenderer, {
15
- readonly href?: string | undefined;
16
- readonly children: React.ReactNode;
17
- readonly form?: string | undefined;
18
- readonly hasAssistiveLabel?: boolean | undefined;
19
- readonly isDisabled?: boolean | undefined;
20
- readonly isFullWidth?: boolean | undefined;
21
- readonly isLoading?: boolean | undefined;
22
- readonly isNewWindow?: boolean | undefined;
23
- readonly isText?: boolean | undefined;
24
- readonly name?: string | undefined;
25
- readonly onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement> | undefined;
26
- readonly scroll?: boolean | undefined;
27
- readonly style?: React.CSSProperties | undefined;
28
- readonly type?: "button" | "submit" | undefined;
29
- readonly value?: string | undefined;
30
- readonly classNames?: Partial<import("@sqrzro/components/dist/Button").ButtonClassNames> | undefined;
31
- readonly classNameProps?: Record<string, unknown> | undefined;
32
- }>) => import("react/jsx-runtime").JSX.Element)[];
33
- tags: string[];
34
- };
35
- export default meta;
36
- type Story = StoryObj<typeof meta>;
37
- export declare const Default: Story;
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import OnDark from '../../utility/storybook/OnDark';
3
- import ActionDownloadButton from './index';
4
- /**
5
- * A helper button that is styled to look like a download button - with a download icon. As it is
6
- * will almost always appear in the header section of a page, it is also preset with the `isOnDark`
7
- * `classNameProp`. This however can be overridden if required.
8
- *
9
- * As it essentially just a wrapper around the `Button` component, all `ButtonProps` (except `icon`)
10
- * can be applied to this component.
11
- */
12
- const meta = {
13
- title: 'Buttons/ActionDownloadButton',
14
- component: ActionDownloadButton,
15
- decorators: [(Story) => _jsx(OnDark, { children: Story() })],
16
- tags: ['autodocs'],
17
- };
18
- export default meta;
19
- export const Default = {
20
- args: {
21
- children: 'Download',
22
- },
23
- };
@@ -1,4 +0,0 @@
1
- import type { ConfirmableButtonProps } from '../ConfirmableButton';
2
- export type ActionRemoveButtonProps = Omit<ConfirmableButtonProps, 'icon' | 'variant'>;
3
- declare function ActionRemoveButton({ classNameProps, ...props }: Readonly<ActionRemoveButtonProps>): React.ReactElement;
4
- export default ActionRemoveButton;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { TrashIcon } from '@heroicons/react/16/solid';
3
- import ConfirmableButton from '../ConfirmableButton';
4
- function ActionRemoveButton({ classNameProps, ...props }) {
5
- return (_jsx(ConfirmableButton, { classNameProps: { isOnDark: true, ...classNameProps }, icon: _jsx(TrashIcon, {}), variant: "danger", ...props }));
6
- }
7
- export default ActionRemoveButton;