@sqrzro/ui 4.0.0-alpha.6 → 4.0.0-alpha.61

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 (295) hide show
  1. package/dist/components/buttons/ActionButton/index.d.ts +8 -6
  2. package/dist/components/buttons/ActionButton/index.js +3 -27
  3. package/dist/components/buttons/Button/index.d.ts +7 -6
  4. package/dist/components/buttons/Button/index.js +9 -19
  5. package/dist/components/collections/Collection/index.d.ts +7 -3
  6. package/dist/components/collections/Collection/index.js +9 -7
  7. package/dist/components/collections/DataTable/index.d.ts +14 -0
  8. package/dist/components/collections/DataTable/index.js +14 -0
  9. package/dist/components/collections/DefinitionList/index.d.ts +13 -0
  10. package/dist/components/collections/DefinitionList/index.js +13 -0
  11. package/dist/components/collections/EmptyMessage/index.d.ts +1 -1
  12. package/dist/components/collections/EmptyMessage/index.js +6 -4
  13. package/dist/components/collections/EmptyMessageAction/index.d.ts +2 -2
  14. package/dist/components/collections/EmptyMessageAction/index.js +1 -1
  15. package/dist/components/collections/List/index.d.ts +6 -3
  16. package/dist/components/collections/List/index.js +2 -2
  17. package/dist/components/collections/ListClientComponent/index.d.ts +7 -4
  18. package/dist/components/collections/ListClientComponent/index.js +8 -5
  19. package/dist/components/collections/ListItem/index.d.ts +10 -3
  20. package/dist/components/collections/ListItem/index.js +15 -23
  21. package/dist/components/collections/ListItemMenu/index.d.ts +8 -0
  22. package/dist/components/collections/ListItemMenu/index.js +7 -0
  23. package/dist/components/collections/ListItemMeta/index.d.ts +6 -4
  24. package/dist/components/collections/ListItemMeta/index.js +13 -17
  25. package/dist/components/collections/ListItemSecondary/index.d.ts +5 -3
  26. package/dist/components/collections/ListItemSecondary/index.js +12 -8
  27. package/dist/components/collections/Pagination/index.d.ts +1 -1
  28. package/dist/components/collections/Pagination/index.js +6 -7
  29. package/dist/components/collections/PaginationLink/index.d.ts +9 -0
  30. package/dist/components/collections/PaginationLink/index.js +9 -0
  31. package/dist/components/collections/Table/index.d.ts +3 -4
  32. package/dist/components/collections/Table/index.js +2 -8
  33. package/dist/components/collections/TableClientComponent/index.d.ts +7 -6
  34. package/dist/components/collections/TableClientComponent/index.js +11 -26
  35. package/dist/components/collections/TableRow/index.d.ts +13 -0
  36. package/dist/components/collections/TableRow/index.js +15 -0
  37. package/dist/components/collections/interfaces.d.ts +41 -34
  38. package/dist/components/collections/lang.js +1 -1
  39. package/dist/components/collections/utility/is-paginated.d.ts +1 -1
  40. package/dist/components/collections/utility/is-right-aligned.d.ts +3 -0
  41. package/dist/components/collections/utility/is-right-aligned.js +11 -0
  42. package/dist/components/collections/utility/normalize-href.d.ts +2 -0
  43. package/dist/components/collections/utility/normalize-href.js +8 -0
  44. package/dist/components/collections/utility/render-cell.d.ts +5 -0
  45. package/dist/components/collections/utility/render-cell.js +33 -0
  46. package/dist/components/elements/Badge/index.d.ts +12 -0
  47. package/dist/components/elements/Badge/index.js +9 -0
  48. package/dist/components/elements/ContentLink/index.d.ts +4 -0
  49. package/dist/components/elements/ContentLink/index.js +7 -0
  50. package/dist/components/elements/InfoPanel/index.d.ts +11 -0
  51. package/dist/components/elements/InfoPanel/index.js +9 -0
  52. package/dist/components/{utility → elements}/Link/index.d.ts +3 -2
  53. package/dist/components/{utility → elements}/Link/index.js +10 -9
  54. package/dist/components/elements/Menu/index.d.ts +19 -0
  55. package/dist/components/elements/Menu/index.js +17 -0
  56. package/dist/components/elements/MenuItem/index.d.ts +9 -0
  57. package/dist/components/elements/MenuItem/index.js +12 -0
  58. package/dist/components/elements/Page/index.d.ts +19 -0
  59. package/dist/components/elements/Page/index.js +18 -0
  60. package/dist/components/elements/Reference/index.d.ts +9 -0
  61. package/dist/components/elements/Reference/index.js +16 -0
  62. package/dist/components/elements/Summary/index.d.ts +13 -0
  63. package/dist/components/elements/Summary/index.js +22 -0
  64. package/dist/components/errors/AppError/index.d.ts +19 -0
  65. package/dist/components/errors/AppError/index.js +9 -0
  66. package/dist/components/errors/AppForbiddenError/index.d.ts +7 -0
  67. package/dist/components/errors/AppForbiddenError/index.js +6 -0
  68. package/dist/components/errors/AppNotFoundError/index.d.ts +7 -0
  69. package/dist/components/errors/AppNotFoundError/index.js +6 -0
  70. package/dist/components/errors/AppServerError/index.d.ts +8 -0
  71. package/dist/components/errors/AppServerError/index.js +17 -0
  72. package/dist/components/index.d.ts +35 -6
  73. package/dist/components/index.js +17 -3
  74. package/dist/components/modals/ConfirmModal/index.d.ts +5 -3
  75. package/dist/components/modals/ConfirmModal/index.js +3 -3
  76. package/dist/components/modals/Modal/index.d.ts +4 -4
  77. package/dist/components/modals/Modal/index.js +3 -3
  78. package/dist/components/modals/ModalActions/index.d.ts +3 -3
  79. package/dist/components/modals/ModalActions/index.js +4 -3
  80. package/dist/components/utility/Action/index.d.ts +11 -0
  81. package/dist/components/utility/Action/index.js +48 -0
  82. package/dist/components/utility/ActionList/index.d.ts +5 -5
  83. package/dist/components/utility/ActionList/index.js +5 -3
  84. package/dist/components/utility/AppBody/index.d.ts +5 -0
  85. package/dist/components/utility/AppBody/index.js +9 -0
  86. package/dist/components/utility/Calendar/index.d.ts +32 -0
  87. package/dist/components/utility/Calendar/index.js +66 -0
  88. package/dist/components/utility/CalendarDay/index.d.ts +11 -0
  89. package/dist/components/utility/CalendarDay/index.js +22 -0
  90. package/dist/components/utility/Confirmable/index.d.ts +9 -0
  91. package/dist/components/utility/Confirmable/index.js +14 -0
  92. package/dist/components/utility/Container/index.d.ts +1 -1
  93. package/dist/components/utility/Container/index.js +2 -2
  94. package/dist/components/utility/Loader/index.d.ts +1 -1
  95. package/dist/components/utility/Loader/index.js +5 -4
  96. package/dist/components/utility/Popover/index.d.ts +1 -1
  97. package/dist/components/utility/Popover/index.js +5 -5
  98. package/dist/components/utility/Toast/index.d.ts +2 -2
  99. package/dist/components/utility/Toast/index.js +6 -4
  100. package/dist/components/utility/Toaster/index.js +5 -5
  101. package/dist/filters/components/FilterBar/index.d.ts +5 -2
  102. package/dist/filters/components/FilterBarClientComponent/index.d.ts +2 -4
  103. package/dist/filters/components/FilterBarClientComponent/index.js +3 -43
  104. package/dist/filters/components/FilterClearButton/index.d.ts +7 -2
  105. package/dist/filters/components/FilterClearButton/index.js +8 -4
  106. package/dist/filters/components/FilterControl/index.d.ts +1 -1
  107. package/dist/filters/components/FilterControl/index.js +11 -4
  108. package/dist/filters/components/FilterItem/index.d.ts +2 -1
  109. package/dist/filters/components/FilterItem/index.js +3 -7
  110. package/dist/filters/components/FilterPanel/index.d.ts +1 -1
  111. package/dist/filters/{utility/filter.d.ts → filter.d.ts} +1 -1
  112. package/dist/filters/{utility/filter.js → filter.js} +8 -8
  113. package/dist/filters/filters/BooleanFilter/index.js +1 -1
  114. package/dist/filters/filters/CalendarFilter/index.js +3 -2
  115. package/dist/filters/filters/DateFilter/index.d.ts +1 -1
  116. package/dist/filters/filters/DateFilter/index.js +9 -4
  117. package/dist/filters/filters/DropdownFilter/index.js +1 -1
  118. package/dist/filters/filters/Filter/index.d.ts +5 -4
  119. package/dist/filters/filters/Filter/index.js +7 -7
  120. package/dist/filters/filters/SearchFilter/index.d.ts +7 -2
  121. package/dist/filters/filters/SearchFilter/index.js +8 -8
  122. package/dist/filters/filters/interfaces.d.ts +0 -2
  123. package/dist/filters/index.d.ts +2 -1
  124. package/dist/filters/index.js +2 -1
  125. package/dist/filters/interfaces.d.ts +2 -2
  126. package/dist/filters/utility/render-value.js +5 -5
  127. package/dist/forms/components/Autocomplete/index.d.ts +2 -2
  128. package/dist/forms/components/Autocomplete/index.js +3 -3
  129. package/dist/forms/components/AutocompleteList/index.d.ts +7 -0
  130. package/dist/forms/components/AutocompleteList/index.js +15 -0
  131. package/dist/forms/components/BaseCalendarInput/index.d.ts +11 -0
  132. package/dist/forms/components/BaseCalendarInput/index.js +22 -0
  133. package/dist/forms/components/CSVInput/index.d.ts +11 -0
  134. package/dist/forms/components/CSVInput/index.js +32 -0
  135. package/dist/forms/components/CalendarInput/index.d.ts +6 -0
  136. package/dist/forms/components/CalendarInput/index.js +14 -0
  137. package/dist/forms/components/ColorInput/index.d.ts +16 -0
  138. package/dist/forms/components/ColorInput/index.js +14 -0
  139. package/dist/forms/components/Dropdown/index.d.ts +1 -1
  140. package/dist/forms/components/Dropdown/index.js +9 -8
  141. package/dist/forms/components/DropdownItem/index.d.ts +9 -0
  142. package/dist/forms/components/DropdownItem/index.js +9 -0
  143. package/dist/forms/components/DropdownList/index.d.ts +1 -1
  144. package/dist/forms/components/DropdownList/index.js +7 -11
  145. package/dist/forms/components/EditableForm/index.d.ts +3 -3
  146. package/dist/forms/components/EditableForm/index.js +9 -9
  147. package/dist/forms/components/EditableFormField/index.d.ts +1 -1
  148. package/dist/forms/components/EditableFormField/index.js +3 -3
  149. package/dist/forms/components/EditableFormFields/index.d.ts +6 -0
  150. package/dist/forms/components/EditableFormFields/index.js +22 -1
  151. package/dist/forms/components/Form/index.d.ts +4 -2
  152. package/dist/forms/components/Form/index.js +7 -6
  153. package/dist/forms/components/FormError/index.d.ts +2 -2
  154. package/dist/forms/components/FormError/index.js +7 -5
  155. package/dist/forms/components/FormField/index.d.ts +7 -5
  156. package/dist/forms/components/FormField/index.js +15 -7
  157. package/dist/forms/components/FormFields/index.d.ts +19 -2
  158. package/dist/forms/components/FormFields/index.js +38 -2
  159. package/dist/forms/components/FormLabel/index.d.ts +1 -1
  160. package/dist/forms/components/FormLabel/index.js +4 -3
  161. package/dist/forms/components/ModalForm/index.d.ts +3 -2
  162. package/dist/forms/components/ModalForm/index.js +4 -3
  163. package/dist/forms/components/NumberInput/index.d.ts +1 -1
  164. package/dist/forms/components/PasswordComplexity/index.d.ts +16 -0
  165. package/dist/forms/components/PasswordComplexity/index.js +14 -0
  166. package/dist/forms/components/PasswordComplexityItem/index.d.ts +8 -0
  167. package/dist/forms/components/PasswordComplexityItem/index.js +10 -0
  168. package/dist/forms/components/PasswordInput/index.d.ts +1 -1
  169. package/dist/forms/components/PasswordInput/index.js +6 -6
  170. package/dist/forms/components/PointsInput/index.d.ts +5 -0
  171. package/dist/forms/components/{MoneyInput → PointsInput}/index.js +3 -3
  172. package/dist/forms/components/RangeCalendarInput/index.d.ts +6 -0
  173. package/dist/forms/components/RangeCalendarInput/index.js +14 -0
  174. package/dist/forms/components/StaticTextInput/index.d.ts +2 -2
  175. package/dist/forms/components/StaticTextInput/index.js +6 -7
  176. package/dist/forms/components/Switch/index.d.ts +9 -3
  177. package/dist/forms/components/Switch/index.js +7 -5
  178. package/dist/forms/components/TextArea/index.d.ts +14 -0
  179. package/dist/forms/components/TextArea/index.js +15 -0
  180. package/dist/forms/components/TextInput/index.d.ts +1 -1
  181. package/dist/forms/components/TextInput/index.js +5 -4
  182. package/dist/forms/hooks/useAutocomplete.d.ts +8 -6
  183. package/dist/forms/hooks/useAutocomplete.js +4 -4
  184. package/dist/forms/hooks/useDropdown.d.ts +5 -7
  185. package/dist/forms/hooks/useDropdown.js +5 -5
  186. package/dist/forms/hooks/useEditableDropdown.d.ts +4 -0
  187. package/dist/forms/hooks/useEditableDropdown.js +6 -0
  188. package/dist/forms/hooks/useEditableForm.js +8 -1
  189. package/dist/forms/hooks/useForm.d.ts +6 -7
  190. package/dist/forms/hooks/useForm.js +25 -27
  191. package/dist/forms/hooks/useModalForm.d.ts +2 -2
  192. package/dist/forms/hooks/useModalForm.js +8 -1
  193. package/dist/forms/index.d.ts +22 -6
  194. package/dist/forms/index.js +9 -4
  195. package/dist/forms/interfaces.d.ts +1 -1
  196. package/dist/forms/utility/extract-input-props.js +1 -0
  197. package/dist/forms/utility/format-date-value.d.ts +2 -0
  198. package/dist/forms/utility/format-date-value.js +13 -0
  199. package/dist/forms/utility/format-file-size.d.ts +2 -0
  200. package/dist/forms/utility/format-file-size.js +11 -0
  201. package/dist/hooks/index.d.ts +3 -0
  202. package/dist/hooks/index.js +3 -0
  203. package/dist/hooks/useConfirmable.d.ts +21 -0
  204. package/dist/hooks/useConfirmable.js +58 -0
  205. package/dist/hooks/useDownload.d.ts +2 -0
  206. package/dist/hooks/useDownload.js +18 -0
  207. package/dist/hooks/usePopover.d.ts +12 -0
  208. package/dist/hooks/usePopover.js +24 -0
  209. package/dist/hooks/useSelected.d.ts +12 -0
  210. package/dist/hooks/useSelected.js +35 -0
  211. package/dist/hooks/useServerAction.d.ts +10 -0
  212. package/dist/hooks/useServerAction.js +17 -0
  213. package/dist/hooks/useSuccess.d.ts +10 -0
  214. package/dist/hooks/useSuccess.js +22 -0
  215. package/dist/mail/Mail/index.d.ts +8 -0
  216. package/dist/mail/Mail/index.js +106 -0
  217. package/dist/mail/MailBlock/index.d.ts +5 -0
  218. package/dist/mail/MailBlock/index.js +5 -0
  219. package/dist/mail/MailButton/index.d.ts +8 -0
  220. package/dist/mail/MailButton/index.js +28 -0
  221. package/dist/mail/MailTable/index.d.ts +9 -0
  222. package/dist/mail/MailTable/index.js +7 -0
  223. package/dist/mail/index.d.ts +8 -0
  224. package/dist/mail/index.js +4 -0
  225. package/dist/mail/utility/convert-to-datauri.d.ts +2 -0
  226. package/dist/mail/utility/convert-to-datauri.js +16 -0
  227. package/dist/mail/utility/get-mail-config.d.ts +4 -0
  228. package/dist/mail/utility/get-mail-config.js +34 -0
  229. package/dist/mail/utility/interfaces.d.ts +23 -0
  230. package/dist/navigation/components/AppNavigation/index.d.ts +3 -1
  231. package/dist/navigation/components/AppNavigation/index.js +4 -4
  232. package/dist/navigation/components/AppNavigationItem/index.d.ts +5 -3
  233. package/dist/navigation/components/AppNavigationItem/index.js +16 -7
  234. package/dist/navigation/components/Tabs/index.js +1 -4
  235. package/dist/navigation/hooks/useNavigation.d.ts +3 -3
  236. package/dist/navigation/hooks/useNavigation.js +5 -5
  237. package/dist/styles/classnames/config.d.ts +91 -0
  238. package/dist/styles/classnames/config.js +1 -0
  239. package/dist/styles/classnames/interfaces.d.ts +56 -0
  240. package/dist/styles/classnames/interfaces.js +1 -0
  241. package/dist/styles/classnames/utility/apply-sizes.d.ts +3 -0
  242. package/dist/styles/classnames/utility/apply-sizes.js +21 -0
  243. package/dist/styles/classnames/utility/apply-variants.d.ts +3 -0
  244. package/dist/styles/classnames/utility/apply-variants.js +26 -0
  245. package/dist/styles/classnames/utility/is-classname-object.d.ts +3 -0
  246. package/dist/styles/classnames/utility/is-classname-object.js +7 -0
  247. package/dist/styles/classnames/utility/parse-classnames.d.ts +6 -0
  248. package/dist/styles/classnames/utility/parse-classnames.js +33 -0
  249. package/dist/styles/context.d.ts +28 -0
  250. package/dist/styles/context.js +19 -0
  251. package/dist/styles/icons/config.d.ts +22 -0
  252. package/dist/styles/icons/config.js +1 -0
  253. package/dist/styles/icons/interfaces.d.ts +4 -0
  254. package/dist/styles/icons/interfaces.js +1 -0
  255. package/dist/styles/index.d.ts +6 -2
  256. package/dist/styles/index.js +2 -1
  257. package/dist/styles/styles.css +60 -0
  258. package/dist/utility/compare-dates.d.ts +2 -0
  259. package/dist/utility/compare-dates.js +13 -0
  260. package/dist/utility/get-date-state.d.ts +8 -0
  261. package/dist/utility/get-date-state.js +63 -0
  262. package/dist/utility/get-days.d.ts +2 -0
  263. package/dist/utility/get-days.js +5 -0
  264. package/dist/utility/get-weeks.d.ts +2 -0
  265. package/dist/utility/get-weeks.js +31 -0
  266. package/dist/utility/index.d.ts +1 -1
  267. package/dist/utility/interfaces.d.ts +33 -17
  268. package/dist/utility/is-data-object-array.d.ts +3 -0
  269. package/dist/utility/is-data-object-array.js +5 -0
  270. package/dist/utility/is-data-object.d.ts +3 -0
  271. package/dist/utility/is-data-object.js +4 -0
  272. package/package.json +31 -19
  273. package/dist/components/buttons/ConfirmableButton/index.d.ts +0 -7
  274. package/dist/components/buttons/ConfirmableButton/index.js +0 -13
  275. package/dist/components/collections/utility/filter-columns.d.ts +0 -3
  276. package/dist/components/collections/utility/filter-columns.js +0 -8
  277. package/dist/components/collections/utility/get-selected-from-search-params.d.ts +0 -2
  278. package/dist/components/collections/utility/get-selected-from-search-params.js +0 -5
  279. package/dist/components/collections/utility/set-selected-to-search-params.d.ts +0 -2
  280. package/dist/components/collections/utility/set-selected-to-search-params.js +0 -4
  281. package/dist/components/utility/ClassNames/index.d.ts +0 -6
  282. package/dist/components/utility/ClassNames/index.js +0 -7
  283. package/dist/components/utility/Page/index.d.ts +0 -18
  284. package/dist/components/utility/Page/index.js +0 -34
  285. package/dist/components/utility/RootLayout/index.d.ts +0 -12
  286. package/dist/components/utility/RootLayout/index.js +0 -14
  287. package/dist/forms/components/MoneyInput/index.d.ts +0 -5
  288. package/dist/styles/config.d.ts +0 -64
  289. package/dist/styles/config.js +0 -43
  290. package/dist/styles/icons.d.ts +0 -15
  291. package/dist/styles/icons.js +0 -7
  292. package/dist/styles/interfaces.d.ts +0 -41
  293. /package/dist/{styles → mail/utility}/interfaces.js +0 -0
  294. /package/dist/styles/{tw.d.ts → classnames/utility/tw.d.ts} +0 -0
  295. /package/dist/styles/{tw.js → classnames/utility/tw.js} +0 -0
@@ -0,0 +1,22 @@
1
+ import { useRouter } from 'next/navigation';
2
+ function useSuccess({ onSuccess, redirectOnSuccess, refreshOnSuccess, }) {
3
+ const router = useRouter();
4
+ async function handleSuccess(response) {
5
+ if (onSuccess) {
6
+ await onSuccess(response);
7
+ }
8
+ if (redirectOnSuccess) {
9
+ const url = typeof redirectOnSuccess === 'function'
10
+ ? await redirectOnSuccess(response)
11
+ : redirectOnSuccess;
12
+ if (url) {
13
+ router.push(url);
14
+ }
15
+ }
16
+ else if (refreshOnSuccess) {
17
+ router.refresh();
18
+ }
19
+ }
20
+ return { handleSuccess };
21
+ }
22
+ export default useSuccess;
@@ -0,0 +1,8 @@
1
+ import { DeepPartial } from '@sqrzro/utility';
2
+ import { MailConfigObject } from '../utility/interfaces';
3
+ export interface MailProps extends DeepPartial<MailConfigObject> {
4
+ children: React.ReactNode;
5
+ title: string;
6
+ }
7
+ declare function Mail({ children, logo, styles, title, }: Readonly<MailProps>): Promise<React.ReactElement>;
8
+ export default Mail;
@@ -0,0 +1,106 @@
1
+ 'use server';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Fragment } from 'react';
4
+ import getMailConfig from '../utility/get-mail-config';
5
+ const HALF = 2;
6
+ async function Mail({ children, logo, styles, title, }) {
7
+ const mailConfig = getMailConfig({ styles });
8
+ const logoData = await (await import('../utility/convert-to-datauri')).default(logo ?? mailConfig.logo ?? '');
9
+ return (_jsxs("html", { lang: "en", children: [_jsxs("head", { children: [_jsx("meta", { charSet: "utf-8" }), _jsx("style", { dangerouslySetInnerHTML: {
10
+ __html: `
11
+ body {
12
+ color: #0f172b !important;
13
+ font-family: -apple-system, 'SF Pro Display', 'SF Pro Text', 'Helvetica', sans-serif;
14
+ font-size: 16px;
15
+ font-weight:400;
16
+ line-height: 24px;
17
+ margin: 0;
18
+ padding: 0;
19
+ }
20
+ @media print {
21
+ body {
22
+ font-size: 14px !important;
23
+ line-height: 21px !important;
24
+ }
25
+ .container {
26
+ width: 100% !important;
27
+ }
28
+ .padding {
29
+ height: auto !important;
30
+ width: auto !important;
31
+ }
32
+ }
33
+ `,
34
+ } })] }), _jsx("body", { children: _jsx("table", { border: 0, cellPadding: 0, cellSpacing: 0, width: "100%", children: _jsxs("tbody", { children: [_jsx("tr", { children: _jsx("td", { className: "padding", colSpan: 3, height: "20", style: { backgroundColor: mailConfig.styles.root.backgroundColor } }) }), _jsxs("tr", { children: [_jsx("td", { className: "padding", style: { backgroundColor: mailConfig.styles.root.backgroundColor }, width: "20" }), _jsx("td", { align: "center", style: { backgroundColor: mailConfig.styles.root.backgroundColor }, children: _jsx("table", { border: 0, cellPadding: 0, cellSpacing: 0, className: "container", width: "650", children: _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { className: "padding", height: "20", style: {
35
+ backgroundColor: mailConfig.styles.panel.backgroundColor,
36
+ }, width: "20", children: _jsx("div", { className: "padding", style: {
37
+ backgroundColor: mailConfig.styles.root.backgroundColor,
38
+ height: mailConfig.styles.panel.padding,
39
+ width: mailConfig.styles.panel.padding,
40
+ }, children: _jsx("div", { className: "padding", style: {
41
+ backgroundColor: mailConfig.styles.panel
42
+ .backgroundColor,
43
+ borderTopLeftRadius: mailConfig.styles.panel.padding /
44
+ HALF,
45
+ height: mailConfig.styles.panel.padding,
46
+ width: mailConfig.styles.panel.padding,
47
+ } }) }) }), _jsx("td", { className: "container", style: {
48
+ backgroundColor: mailConfig.styles.panel.backgroundColor,
49
+ }, width: "610" }), _jsx("td", { className: "padding", height: mailConfig.styles.panel.padding, style: {
50
+ backgroundColor: mailConfig.styles.panel.backgroundColor,
51
+ }, width: mailConfig.styles.panel.padding, children: _jsx("div", { className: "padding", style: {
52
+ backgroundColor: mailConfig.styles.root.backgroundColor,
53
+ height: mailConfig.styles.panel.padding,
54
+ width: mailConfig.styles.panel.padding,
55
+ }, children: _jsx("div", { className: "padding", style: {
56
+ backgroundColor: mailConfig.styles.panel
57
+ .backgroundColor,
58
+ borderTopRightRadius: mailConfig.styles.panel.padding /
59
+ HALF,
60
+ height: mailConfig.styles.panel.padding,
61
+ width: mailConfig.styles.panel.padding,
62
+ } }) }) })] }), _jsxs("tr", { children: [_jsx("td", { className: "padding", style: {
63
+ backgroundColor: mailConfig.styles.panel.backgroundColor,
64
+ }, width: mailConfig.styles.panel.padding }), _jsx("td", { style: {
65
+ backgroundColor: mailConfig.styles.panel.backgroundColor,
66
+ }, children: _jsx("table", { border: 0, cellPadding: 0, cellSpacing: 0, width: "100%", children: _jsxs("tbody", { children: [logoData ? (_jsxs(Fragment, { children: [_jsx("tr", { children: _jsx("td", { children: _jsx("table", { border: 0, cellPadding: 0, cellSpacing: 0, width: 240, children: _jsx("tbody", { children: _jsx("tr", { children: _jsx("td", { children: _jsx("img", { alt: "Logo", src: logoData, width: 240 }) }) }) }) }) }) }), _jsx("tr", { children: _jsx("td", { height: mailConfig.styles.panel
67
+ .padding }) })] })) : null, _jsx("tr", { children: _jsx("td", { style: {
68
+ color: mailConfig.styles.title
69
+ .color,
70
+ fontSize: mailConfig.styles.title
71
+ .fontSize,
72
+ fontWeight: mailConfig.styles.title
73
+ .fontWeight,
74
+ }, children: title }) }), _jsx("tr", { children: _jsx("td", { height: mailConfig.styles.panel.padding }) }), _jsx("tr", { children: _jsx("td", { children: children }) })] }) }) }), _jsx("td", { className: "padding", style: {
75
+ backgroundColor: mailConfig.styles.panel.backgroundColor,
76
+ }, width: mailConfig.styles.panel.padding })] }), _jsxs("tr", { children: [_jsx("td", { className: "padding", height: mailConfig.styles.panel.padding, style: {
77
+ backgroundColor: mailConfig.styles.panel.backgroundColor,
78
+ }, width: mailConfig.styles.panel.padding, children: _jsx("div", { className: "padding", style: {
79
+ backgroundColor: mailConfig.styles.root.backgroundColor,
80
+ height: mailConfig.styles.panel.padding,
81
+ width: mailConfig.styles.panel.padding,
82
+ }, children: _jsx("div", { className: "padding", style: {
83
+ backgroundColor: mailConfig.styles.panel
84
+ .backgroundColor,
85
+ borderBottomLeftRadius: mailConfig.styles.panel.padding /
86
+ HALF,
87
+ height: mailConfig.styles.panel.padding,
88
+ width: mailConfig.styles.panel.padding,
89
+ } }) }) }), _jsx("td", { className: "container", style: {
90
+ backgroundColor: mailConfig.styles.panel.backgroundColor,
91
+ }, width: "610" }), _jsx("td", { className: "padding", height: mailConfig.styles.panel.padding, style: {
92
+ backgroundColor: mailConfig.styles.panel.backgroundColor,
93
+ }, width: mailConfig.styles.panel.padding, children: _jsx("div", { className: "padding", style: {
94
+ backgroundColor: mailConfig.styles.root.backgroundColor,
95
+ height: mailConfig.styles.panel.padding,
96
+ width: mailConfig.styles.panel.padding,
97
+ }, children: _jsx("div", { className: "padding", style: {
98
+ backgroundColor: mailConfig.styles.panel
99
+ .backgroundColor,
100
+ borderBottomRightRadius: mailConfig.styles.panel.padding /
101
+ HALF,
102
+ height: mailConfig.styles.panel.padding,
103
+ width: mailConfig.styles.panel.padding,
104
+ } }) }) })] })] }) }) }), _jsx("td", { className: "padding", style: { backgroundColor: mailConfig.styles.root.backgroundColor }, width: "20" })] }), _jsx("tr", { children: _jsx("td", { className: "padding", colSpan: 3, height: "20", style: { backgroundColor: mailConfig.styles.root.backgroundColor } }) })] }) }) })] }));
105
+ }
106
+ export default Mail;
@@ -0,0 +1,5 @@
1
+ export interface MailBlockProps {
2
+ children: React.ReactNode;
3
+ }
4
+ declare function MailBlock({ children }: Readonly<MailBlockProps>): React.ReactElement;
5
+ export default MailBlock;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ function MailBlock({ children }) {
3
+ return _jsx("div", { style: { marginBottom: 30 }, children: children });
4
+ }
5
+ export default MailBlock;
@@ -0,0 +1,8 @@
1
+ import type { DeepPartial } from '@sqrzro/utility';
2
+ import { MailConfigObject } from '../utility/interfaces';
3
+ export interface MailButtonProps extends DeepPartial<MailConfigObject> {
4
+ children: string;
5
+ href: string;
6
+ }
7
+ declare function MailButton({ children, href, styles, }: MailButtonProps): Promise<React.ReactElement>;
8
+ export default MailButton;
@@ -0,0 +1,28 @@
1
+ 'use server';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import getMailConfig from '../utility/get-mail-config';
4
+ function calculateWidth(text) {
5
+ const characterWidth = 8;
6
+ const padding = 50;
7
+ return text.length * characterWidth + padding;
8
+ }
9
+ async function MailButton({ children, href, styles, }) {
10
+ const mailConfig = getMailConfig({ styles });
11
+ const calculatedWidth = calculateWidth(children);
12
+ return (_jsx("div", { dangerouslySetInnerHTML: {
13
+ __html: `
14
+ <!--[if mso]>
15
+ <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="${href}" style="height:${mailConfig.styles.button.height}px;v-text-anchor:middle;width:${calculatedWidth}px;" arcsize="50%" stroke="f" fillcolor="${mailConfig.styles.button.backgroundColor}">
16
+ <w:anchorlock/>
17
+ <center>
18
+ <![endif]-->
19
+ <a href="${href}"
20
+ style="background-color:${mailConfig.styles.button.backgroundColor};border-radius:${mailConfig.styles.button.borderRadius}px;color:${mailConfig.styles.button.color};display:inline-block;font-weight:bold;line-height:${mailConfig.styles.button.height}px;text-align:center;text-decoration:none;width:${calculatedWidth}px;-webkit-text-size-adjust:none;">${children}</a>
21
+ <!--[if mso]>
22
+ </center>
23
+ </v:roundrect>
24
+ <![endif]-->
25
+ `,
26
+ } }));
27
+ }
28
+ export default MailButton;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export interface MailTableProps {
3
+ data: {
4
+ title: React.ReactNode;
5
+ value: React.ReactNode;
6
+ }[];
7
+ }
8
+ declare function MailTable({ data }: Readonly<MailTableProps>): React.ReactElement;
9
+ export default MailTable;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from 'react';
3
+ const EVEN_NUMBER = 2;
4
+ function MailTable({ data }) {
5
+ return (_jsx("table", { border: 0, cellPadding: 0, cellSpacing: 0, style: { marginBottom: 30 }, width: "100%", children: _jsxs("tbody", { children: [data.map(({ title, value }, index) => (_jsxs(Fragment, { children: [_jsx("tr", { children: _jsx("td", { colSpan: 5, height: 1, style: { backgroundColor: '#cccccc' } }) }), _jsx("tr", { children: _jsx("td", { colSpan: 5, height: 10, style: { backgroundColor: index % EVEN_NUMBER ? '' : '#f7f7f7' } }) }), _jsxs("tr", { children: [_jsx("td", { style: { backgroundColor: index % EVEN_NUMBER ? '' : '#f7f7f7' }, width: 10 }), _jsx("td", { style: { backgroundColor: index % EVEN_NUMBER ? '' : '#f7f7f7' }, children: title }), _jsx("td", { style: { backgroundColor: index % EVEN_NUMBER ? '' : '#f7f7f7' }, width: 20 }), _jsx("td", { align: "right", style: { backgroundColor: index % EVEN_NUMBER ? '' : '#f7f7f7' }, children: value }), _jsx("td", { style: { backgroundColor: index % EVEN_NUMBER ? '' : '#f7f7f7' }, width: 10 })] }), _jsx("tr", { children: _jsx("td", { colSpan: 5, height: 10, style: { backgroundColor: index % EVEN_NUMBER ? '' : '#f7f7f7' } }) })] }, index))), _jsx("tr", { children: _jsx("td", { colSpan: 5, height: 1, style: { backgroundColor: '#cccccc' } }) })] }) }));
6
+ }
7
+ export default MailTable;
@@ -0,0 +1,8 @@
1
+ export type { MailProps } from './Mail';
2
+ export { default as Mail } from './Mail';
3
+ export type { MailBlockProps } from './MailBlock';
4
+ export { default as MailBlock } from './MailBlock';
5
+ export type { MailButtonProps } from './MailButton';
6
+ export { default as MailButton } from './MailButton';
7
+ export type { MailTableProps } from './MailTable';
8
+ export { default as MailTable } from './MailTable';
@@ -0,0 +1,4 @@
1
+ export { default as Mail } from './Mail';
2
+ export { default as MailBlock } from './MailBlock';
3
+ export { default as MailButton } from './MailButton';
4
+ export { default as MailTable } from './MailTable';
@@ -0,0 +1,2 @@
1
+ declare function convertToDataURI(fileName: string): Promise<string | null>;
2
+ export default convertToDataURI;
@@ -0,0 +1,16 @@
1
+ 'use server';
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ async function convertToDataURI(fileName) {
5
+ try {
6
+ const filePath = path.join(process.cwd(), fileName);
7
+ const mimeType = 'image/' + path.extname(filePath).slice(1);
8
+ const imageData = fs.readFileSync(filePath);
9
+ const base64Image = Buffer.from(imageData).toString('base64');
10
+ return Promise.resolve(`data:${mimeType};base64,${base64Image}`);
11
+ }
12
+ catch (error) {
13
+ return null;
14
+ }
15
+ }
16
+ export default convertToDataURI;
@@ -0,0 +1,4 @@
1
+ import type { DeepPartial } from '@sqrzro/utility';
2
+ import type { MailConfigObject } from './interfaces';
3
+ declare function getMailConfig(overrides?: DeepPartial<MailConfigObject>): MailConfigObject;
4
+ export default getMailConfig;
@@ -0,0 +1,34 @@
1
+ import { deepMerge } from '@sqrzro/utility';
2
+ const DEFAULT_STYLES = {
3
+ styles: {
4
+ button: {
5
+ backgroundColor: '#0f172b',
6
+ borderRadius: 4,
7
+ color: '#ffffff',
8
+ height: 40,
9
+ },
10
+ panel: {
11
+ backgroundColor: '#ffffff',
12
+ padding: 40,
13
+ },
14
+ root: {
15
+ backgroundColor: '#f5f5f5',
16
+ },
17
+ title: {
18
+ color: '#62748e',
19
+ fontSize: 20,
20
+ fontWeight: 'bold',
21
+ },
22
+ },
23
+ };
24
+ function getMailConfig(overrides) {
25
+ const string = process.env.MAIL_CONFIG || '{}';
26
+ try {
27
+ const object = JSON.parse(string);
28
+ return deepMerge(DEFAULT_STYLES, object, overrides || {});
29
+ }
30
+ catch (err) {
31
+ return deepMerge(DEFAULT_STYLES, overrides || {});
32
+ }
33
+ }
34
+ export default getMailConfig;
@@ -0,0 +1,23 @@
1
+ export interface MailConfigObject {
2
+ logo?: string;
3
+ styles: {
4
+ root: {
5
+ backgroundColor: string;
6
+ };
7
+ panel: {
8
+ backgroundColor: string;
9
+ padding: number;
10
+ };
11
+ button: {
12
+ backgroundColor: string;
13
+ borderRadius: number;
14
+ color: string;
15
+ height: number;
16
+ };
17
+ title: {
18
+ color: string;
19
+ fontSize: number;
20
+ fontWeight: string;
21
+ };
22
+ };
23
+ }
@@ -1,12 +1,14 @@
1
- import type { ClassNameProps, HighlightableClassName } from '../../../styles/interfaces';
1
+ import type { ClassNameProps, HighlightableClassName, SelectableClassName } from '../../../styles/classnames/interfaces';
2
2
  import type { NavigationObject } from '../../interfaces';
3
3
  export interface AppNavigationClassNames {
4
4
  root: string;
5
5
  list: string;
6
6
  item: HighlightableClassName;
7
7
  link: HighlightableClassName;
8
+ icon: SelectableClassName;
8
9
  }
9
10
  export interface AppNavigationProps extends ClassNameProps<AppNavigationClassNames> {
11
+ classNameKey?: 'appNavigation' | 'tabs';
10
12
  data: NavigationObject[];
11
13
  }
12
14
  declare function AppNavigation(props: Readonly<AppNavigationProps>): React.ReactElement;
@@ -1,13 +1,13 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { Suspense } from 'react';
4
- import { getClassNames } from '../../../styles/config';
4
+ import { useClassNames } from '../../../styles/context';
5
5
  import useNavigation from '../../hooks/useNavigation';
6
6
  import AppNavigationItem from '../AppNavigationItem';
7
- function AppNavigationComponent({ classNameProps, classNames, data, }) {
8
- const componentClassNames = classNames || getClassNames('appNavigation')?.(classNameProps);
7
+ function AppNavigationComponent({ classNameKey, classNameProps, classNames, data, }) {
8
+ const componentClassNames = useClassNames(classNameKey ?? 'appNavigation', { props: classNameProps }, classNames);
9
9
  const navigation = useNavigation(data);
10
- return (_jsx("nav", { className: componentClassNames?.root, children: _jsx("ul", { className: componentClassNames?.list, children: navigation.map((item, index) => (_jsx(AppNavigationItem, { classNames: classNames, ...item }, index))) }) }));
10
+ return (_jsx("nav", { className: componentClassNames?.root, children: _jsx("ul", { className: componentClassNames?.list, children: navigation.map((item, index) => (_jsx(AppNavigationItem, { classNameKey: classNameKey, classNames: classNames, ...item }, index))) }) }));
11
11
  }
12
12
  function AppNavigation(props) {
13
13
  return (_jsx(Suspense, { children: _jsx(AppNavigationComponent, { ...props }) }));
@@ -1,6 +1,8 @@
1
1
  import type { NavigationObject } from '../../../navigation/interfaces';
2
- import type { ClassNameProps } from '../../../styles/interfaces';
2
+ import type { ClassNameProps } from '../../../styles/classnames/interfaces';
3
3
  import type { AppNavigationClassNames } from '../AppNavigation';
4
- export type AppNavigationItemProps = NavigationObject & ClassNameProps<AppNavigationClassNames>;
5
- declare function AppNavigationItem({ classNameProps, classNames, href, isActive, label, }: Readonly<AppNavigationItemProps>): React.ReactElement;
4
+ export interface AppNavigationItemProps extends NavigationObject, ClassNameProps<AppNavigationClassNames> {
5
+ classNameKey?: 'appNavigation' | 'tabs';
6
+ }
7
+ declare function AppNavigationItem({ children, classNameKey, classNameProps, classNames, href, isActive, label, }: Readonly<AppNavigationItemProps>): React.ReactElement;
6
8
  export default AppNavigationItem;
@@ -1,9 +1,18 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import Link from '../../../components/utility/Link';
3
- import { getClassNames } from '../../../styles/config';
4
- import tw from '../../../styles/tw';
5
- function AppNavigationItem({ classNameProps, classNames, href, isActive, label, }) {
6
- const componentClassNames = classNames || getClassNames('appNavigation')?.(classNameProps);
7
- return (_jsx("li", { className: tw(componentClassNames?.item?.default, isActive ? componentClassNames?.item?.highlighted : null), children: _jsx(Link, { className: tw(componentClassNames?.link?.default, isActive ? componentClassNames?.link?.highlighted : null), href: href, children: label }) }));
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Link from '../../../components/elements/Link';
4
+ import MenuItem from '../../../components/elements/MenuItem';
5
+ import Action from '../../../components/utility/Action';
6
+ import Popover from '../../../components/utility/Popover';
7
+ import usePopover from '../../../hooks/usePopover';
8
+ import { useClassNames, useIcon } from '../../../styles/context';
9
+ function AppNavigationItem({ children, classNameKey, classNameProps, classNames, href, isActive, label, }) {
10
+ const Icon = useIcon('appNavigation.menu');
11
+ const { controlProps, isOpen, ref, targetProps } = usePopover();
12
+ const componentClassNames = useClassNames(classNameKey ?? 'appNavigation', { props: classNameProps, states: { isHighlighted: isActive ?? false, isSelected: isOpen } }, classNames);
13
+ if (children?.length) {
14
+ return (_jsxs("li", { className: componentClassNames?.item, ref: ref, children: [_jsxs("button", { className: componentClassNames?.link, type: "button", ...controlProps, children: [label, Icon ? (_jsx("div", { className: componentClassNames?.icon, children: _jsx(Icon, {}) })) : null] }), _jsx("div", { className: "relative -mt-3", children: _jsx(Popover, { align: "left", vAlign: "bottom", ...targetProps, children: _jsx("ul", { children: children.map((item, index) => (_jsx("li", { children: _jsx(Action, { ...item, render: MenuItem }) }, index))) }) }) })] }));
15
+ }
16
+ return (_jsx("li", { className: componentClassNames?.item, children: _jsx(Link, { className: componentClassNames?.link, href: href, children: label }) }));
8
17
  }
9
18
  export default AppNavigationItem;
@@ -1,9 +1,6 @@
1
- 'use client';
2
1
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { getClassNames } from '../../../styles/config';
4
2
  import AppNavigation from '../AppNavigation';
5
3
  function Tabs({ classNameProps, classNames, ...props }) {
6
- const componentClassNames = classNames || getClassNames('tabs')?.(classNameProps);
7
- return _jsx(AppNavigation, { classNames: componentClassNames ?? {}, ...props });
4
+ return _jsx(AppNavigation, { classNameKey: "tabs", ...props });
8
5
  }
9
6
  export default Tabs;
@@ -1,7 +1,7 @@
1
- import type { Action } from '../../utility/interfaces';
1
+ import type { SimpleActionObject } from '../../utility/interfaces';
2
2
  import type { NavigationObject } from '../interfaces';
3
- interface NavigationAction extends Action {
4
- children?: Action[];
3
+ interface NavigationAction extends SimpleActionObject {
4
+ children?: SimpleActionObject[];
5
5
  }
6
6
  interface UseNavigationOptions {
7
7
  basePath?: string;
@@ -1,4 +1,4 @@
1
- import { joinUrl } from '@sqrzro/utility';
1
+ import { joinURL } from '@sqrzro/utility';
2
2
  import { usePathname, useSelectedLayoutSegments } from 'next/navigation';
3
3
  function getActivePath(pathname, hrefs) {
4
4
  return (hrefs
@@ -18,7 +18,7 @@ function getBasePath(pathname, segments) {
18
18
  function transformChildren(children, basePath) {
19
19
  return children.map(({ details, href, label }) => ({
20
20
  details,
21
- href: joinUrl(basePath, href),
21
+ href: joinURL(basePath, href),
22
22
  label,
23
23
  }));
24
24
  }
@@ -26,13 +26,13 @@ function useNavigation(data, options) {
26
26
  const pathname = usePathname();
27
27
  const segments = useSelectedLayoutSegments();
28
28
  const basePath = getBasePath(pathname, segments);
29
- const hrefs = data.map(({ href }) => joinUrl(basePath, href));
29
+ const hrefs = data.map(({ href }) => joinURL(basePath, href));
30
30
  const activePath = getActivePath(pathname, hrefs);
31
31
  return data.map((item) => ({
32
32
  ...item,
33
33
  children: transformChildren(item.children || [], item.href),
34
- href: joinUrl(basePath, item.href),
35
- isActive: joinUrl(basePath, item.href) === activePath,
34
+ href: joinURL(basePath, item.href),
35
+ isActive: joinURL(basePath, item.href) === activePath,
36
36
  }));
37
37
  }
38
38
  export default useNavigation;
@@ -0,0 +1,91 @@
1
+ import type { ButtonClassNames } from '../../components/buttons/Button';
2
+ import type { TextButtonClassNames } from '../../components/buttons/TextButton';
3
+ import type { DataTableClassNames } from '../../components/collections/DataTable';
4
+ import type { DefinitionListClassNames } from '../../components/collections/DefinitionList';
5
+ import type { EmptyMessageClassNames } from '../../components/collections/EmptyMessage';
6
+ import type { ListClassNames } from '../../components/collections/List';
7
+ import type { ListItemClassNames } from '../../components/collections/ListItem';
8
+ import type { ListItemMetaClassNames } from '../../components/collections/ListItemMeta';
9
+ import type { PaginationClassNames } from '../../components/collections/Pagination';
10
+ import type { TableClassNames } from '../../components/collections/Table';
11
+ import type { BadgeClassNames } from '../../components/elements/Badge';
12
+ import type { InfoPanelClassNames } from '../../components/elements/InfoPanel';
13
+ import type { LinkClassNames } from '../../components/elements/Link';
14
+ import type { MenuClassNames } from '../../components/elements/Menu';
15
+ import type { ReferenceClassNames } from '../../components/elements/Reference';
16
+ import type { SummaryClassNames } from '../../components/elements/Summary';
17
+ import type { AppErrorClassNames } from '../../components/errors/AppError';
18
+ import type { ModalClassNames } from '../../components/modals/Modal';
19
+ import type { ActionListClassNames } from '../../components/utility/ActionList';
20
+ import type { CalendarClassNames } from '../../components/utility/Calendar';
21
+ import type { ContainerClassNames } from '../../components/utility/Container';
22
+ import type { LoaderClassNames } from '../../components/utility/Loader';
23
+ import type { PopoverClassNames } from '../../components/utility/Popover';
24
+ import type { ToastClassNames } from '../../components/utility/Toast';
25
+ import type { FilterBarClassNames } from '../../filters/components/FilterBar';
26
+ import type { FilterClearButtonClassNames } from '../../filters/components/FilterClearButton';
27
+ import type { FilterItemClassNames } from '../../filters/components/FilterItem';
28
+ import type { FilterPanelClassNames } from '../../filters/components/FilterPanel';
29
+ import type { SearchFilterClassNames } from '../../filters/filters/SearchFilter';
30
+ import type { ColorInputClassNames } from '../../forms/components/ColorInput';
31
+ import type { CSVInputClassNames } from '../../forms/components/CSVInput';
32
+ import type { DropdownClassNames } from '../../forms/components/Dropdown';
33
+ import type { EditableFormClassNames } from '../../forms/components/EditableForm';
34
+ import type { EditableFormFieldClassNames } from '../../forms/components/EditableFormField';
35
+ import type { FormClassNames } from '../../forms/components/Form';
36
+ import type { FormFieldClassNames } from '../../forms/components/FormField';
37
+ import type { PasswordComplexityClassNames } from '../../forms/components/PasswordComplexity';
38
+ import type { PasswordInputClassNames } from '../../forms/components/PasswordInput';
39
+ import type { StaticTextInputClassNames } from '../../forms/components/StaticTextInput';
40
+ import type { SwitchClassNames } from '../../forms/components/Switch';
41
+ import type { TextInputClassNames } from '../../forms/components/TextInput';
42
+ import type { TextAreaClassNames } from '../../forms/components/TextArea';
43
+ import type { AppNavigationClassNames } from '../../navigation/components/AppNavigation';
44
+ import type { TabsClassNames } from '../../navigation/components/Tabs';
45
+ import type { ComponentClassNames } from './interfaces';
46
+ export interface UIClassNames {
47
+ actionList?: ComponentClassNames<ActionListClassNames>;
48
+ appError?: ComponentClassNames<AppErrorClassNames>;
49
+ appNavigation?: ComponentClassNames<AppNavigationClassNames>;
50
+ badge?: ComponentClassNames<BadgeClassNames>;
51
+ button?: ComponentClassNames<ButtonClassNames>;
52
+ calendar?: ComponentClassNames<CalendarClassNames>;
53
+ colorInput?: ComponentClassNames<ColorInputClassNames>;
54
+ container?: ComponentClassNames<ContainerClassNames>;
55
+ csvInput?: ComponentClassNames<CSVInputClassNames>;
56
+ dataTable?: ComponentClassNames<DataTableClassNames>;
57
+ definitionList?: ComponentClassNames<DefinitionListClassNames>;
58
+ dropdown?: ComponentClassNames<DropdownClassNames>;
59
+ editableForm?: ComponentClassNames<EditableFormClassNames>;
60
+ editableFormField?: ComponentClassNames<EditableFormFieldClassNames>;
61
+ emptyMessage?: ComponentClassNames<EmptyMessageClassNames>;
62
+ filterBar?: ComponentClassNames<FilterBarClassNames>;
63
+ filterClear?: ComponentClassNames<FilterClearButtonClassNames>;
64
+ filterItem?: ComponentClassNames<FilterItemClassNames>;
65
+ filterPanel?: ComponentClassNames<FilterPanelClassNames>;
66
+ filterSearch?: ComponentClassNames<SearchFilterClassNames>;
67
+ form?: ComponentClassNames<FormClassNames>;
68
+ formField?: ComponentClassNames<FormFieldClassNames>;
69
+ infoPanel?: ComponentClassNames<InfoPanelClassNames>;
70
+ link?: ComponentClassNames<LinkClassNames>;
71
+ list?: ComponentClassNames<ListClassNames>;
72
+ listItem?: ComponentClassNames<ListItemClassNames>;
73
+ listItemMeta?: ComponentClassNames<ListItemMetaClassNames>;
74
+ loader?: ComponentClassNames<LoaderClassNames>;
75
+ menu?: ComponentClassNames<MenuClassNames>;
76
+ modal?: ComponentClassNames<ModalClassNames>;
77
+ pagination?: ComponentClassNames<PaginationClassNames>;
78
+ passwordComplexity?: ComponentClassNames<PasswordComplexityClassNames>;
79
+ passwordInput?: ComponentClassNames<PasswordInputClassNames>;
80
+ popover?: ComponentClassNames<PopoverClassNames>;
81
+ reference?: ComponentClassNames<ReferenceClassNames>;
82
+ staticTextInput?: ComponentClassNames<StaticTextInputClassNames>;
83
+ summary?: ComponentClassNames<SummaryClassNames>;
84
+ switch?: ComponentClassNames<SwitchClassNames>;
85
+ table?: ComponentClassNames<TableClassNames>;
86
+ tabs?: ComponentClassNames<TabsClassNames>;
87
+ textArea?: ComponentClassNames<TextAreaClassNames>;
88
+ textButton?: ComponentClassNames<TextButtonClassNames>;
89
+ textInput?: ComponentClassNames<TextInputClassNames>;
90
+ toast?: ComponentClassNames<ToastClassNames>;
91
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,56 @@
1
+ type ComponentClassNamesValue<T> = T extends string ? string | StatefulClassName : T extends StatefulClassName<infer U> ? StatefulClassName<U> : never;
2
+ export type ComponentClassNames<T> = {
3
+ [K in keyof T]?: ComponentClassNamesValue<T[K]>;
4
+ };
5
+ export type ExtractClassNames<T> = {
6
+ [K in keyof T]?: string;
7
+ };
8
+ export interface ClassNameObject {
9
+ default: string;
10
+ props?: Record<string, string>;
11
+ states?: Record<string, string>;
12
+ }
13
+ export interface ClassNameProps<T> {
14
+ classNames?: Partial<T>;
15
+ classNameProps?: Record<string, boolean>;
16
+ }
17
+ interface StatefulClassName<T = null> {
18
+ default: string;
19
+ props?: Record<string, string>;
20
+ states?: T;
21
+ }
22
+ export type CheckableClassName = string | StatefulClassName<{
23
+ isChecked?: string;
24
+ }>;
25
+ export type ErrorableClassName = string | StatefulClassName<{
26
+ isError?: string;
27
+ }>;
28
+ export type FocusableClassName = string | StatefulClassName<{
29
+ isFocused?: string;
30
+ }>;
31
+ export type HighlightableClassName = string | StatefulClassName<{
32
+ isHighlighted?: string;
33
+ }>;
34
+ export type LoadableClassName = string | StatefulClassName<{
35
+ isLoading?: string;
36
+ }>;
37
+ export type SelectableClassName = string | StatefulClassName<{
38
+ isSelected?: string;
39
+ }>;
40
+ export type SizableClassName = string | StatefulClassName<{
41
+ isLarge?: string;
42
+ isMedium?: string;
43
+ isSmall?: string;
44
+ }>;
45
+ export type StylableClassName = string | StatefulClassName<{
46
+ isBordered?: string;
47
+ isDanger?: string;
48
+ isError?: string;
49
+ isInfo?: string;
50
+ isPrimary?: string;
51
+ isSecondary?: string;
52
+ isSuccess?: string;
53
+ isTertiary?: string;
54
+ isWarning?: string;
55
+ }>;
56
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { SizeVariant } from '../../../utility/interfaces';
2
+ declare function applySizes(sizes?: SizeVariant[] | SizeVariant | null): Record<string, boolean>;
3
+ export default applySizes;