@sqrzro/admin 1.0.0-beta.7 → 2.0.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 (773) hide show
  1. package/.eslintrc +5 -1
  2. package/.storybook/main.js +6 -34
  3. package/.storybook/preview-head.html +3 -0
  4. package/.storybook/preview.js +1 -11
  5. package/.turbo/turbo-docs.log +0 -0
  6. package/.turbo/turbo-lint.log +112 -0
  7. package/.turbo/turbo-prettier.log +215 -0
  8. package/.turbo/turbo-test.log +6 -0
  9. package/LICENSE +1 -1
  10. package/dist/{types/components → components}/Alert/index.d.ts +4 -4
  11. package/dist/components/Alert/index.js +15 -0
  12. package/dist/{types/components → components}/Allow/index.d.ts +20 -13
  13. package/dist/components/Allow/index.js +29 -0
  14. package/dist/components/AppLayout/AppLayout.stories.d.ts +5 -0
  15. package/dist/components/AppLayout/AppLayout.stories.js +11 -0
  16. package/dist/components/AppLayout/index.d.ts +6 -0
  17. package/dist/components/AppLayout/index.js +18 -0
  18. package/dist/{types/components → components}/AutoSuggest/index.d.ts +74 -60
  19. package/dist/components/AutoSuggest/index.js +143 -0
  20. package/dist/components/Button/Button.stories.d.ts +11 -0
  21. package/{src/components/Button/Button.story.tsx → dist/components/Button/Button.stories.js} +16 -14
  22. package/dist/{types/components → components}/Button/index.d.ts +49 -36
  23. package/dist/components/Button/index.js +50 -0
  24. package/dist/components/CalendarInput/index.d.ts +24 -0
  25. package/dist/components/CalendarInput/index.js +54 -0
  26. package/dist/{types/components → components}/CheckboxList/index.d.ts +17 -17
  27. package/dist/components/CheckboxList/index.js +25 -0
  28. package/dist/components/CodeInput/index.d.ts +9 -0
  29. package/dist/components/CodeInput/index.js +51 -0
  30. package/dist/{types/components → components}/ConnectedDropdown/index.d.ts +14 -14
  31. package/dist/components/ConnectedDropdown/index.js +36 -0
  32. package/dist/{types/components → components}/ConnectedList/index.d.ts +5 -5
  33. package/dist/components/ConnectedList/index.js +7 -0
  34. package/dist/{types/components → components}/ConnectedTable/index.d.ts +5 -5
  35. package/dist/components/ConnectedTable/index.js +7 -0
  36. package/dist/{types/components → components}/ContentBlock/index.d.ts +16 -16
  37. package/dist/components/ContentBlock/index.js +13 -0
  38. package/dist/components/DataPanel/index.d.ts +8 -0
  39. package/dist/components/DataPanel/index.js +8 -0
  40. package/dist/components/DateInput/index.d.ts +18 -0
  41. package/dist/components/DateInput/index.js +81 -0
  42. package/dist/{types/components → components}/Dropdown/index.d.ts +36 -36
  43. package/dist/components/Dropdown/index.js +122 -0
  44. package/dist/components/ErrorMessage/index.d.ts +16 -0
  45. package/dist/components/ErrorMessage/index.js +17 -0
  46. package/dist/components/Fieldset/index.d.ts +18 -0
  47. package/dist/components/Fieldset/index.js +19 -0
  48. package/dist/{types/components → components}/FileInput/index.d.ts +10 -10
  49. package/dist/components/FileInput/index.js +26 -0
  50. package/dist/components/FilterLink/index.d.ts +14 -0
  51. package/dist/components/FilterLink/index.js +15 -0
  52. package/dist/components/Form/index.d.ts +14 -0
  53. package/dist/components/Form/index.js +15 -0
  54. package/dist/components/FormActions/index.d.ts +18 -0
  55. package/dist/components/FormActions/index.js +14 -0
  56. package/dist/{types/components → components}/FormField/index.d.ts +14 -14
  57. package/dist/components/FormField/index.js +40 -0
  58. package/dist/components/FormRepeater/index.d.ts +18 -0
  59. package/dist/components/FormRepeater/index.js +65 -0
  60. package/dist/{types/components → components}/ImageInput/index.d.ts +13 -13
  61. package/dist/components/ImageInput/index.js +45 -0
  62. package/dist/components/InfoPanel/index.d.ts +14 -0
  63. package/dist/components/InfoPanel/index.js +11 -0
  64. package/dist/{types/components → components}/Link/__mocks__/index.d.ts +6 -6
  65. package/dist/components/Link/__mocks__/index.js +12 -0
  66. package/dist/components/Link/index.d.ts +23 -0
  67. package/dist/components/Link/index.js +21 -0
  68. package/dist/{types/components → components}/List/index.d.ts +36 -36
  69. package/dist/components/List/index.js +46 -0
  70. package/dist/components/ListActions/index.d.ts +18 -0
  71. package/dist/components/ListActions/index.js +14 -0
  72. package/dist/components/LoginForm/index.d.ts +3 -0
  73. package/dist/components/LoginForm/index.js +47 -0
  74. package/dist/components/Message/index.d.ts +14 -0
  75. package/dist/components/Message/index.js +14 -0
  76. package/dist/{types/components → components}/Modal/index.d.ts +4 -4
  77. package/dist/components/Modal/index.js +18 -0
  78. package/dist/components/ModalActions/index.d.ts +21 -0
  79. package/dist/components/ModalActions/index.js +18 -0
  80. package/dist/{types/components → components}/MoneyInput/index.d.ts +10 -10
  81. package/dist/components/MoneyInput/index.js +13 -0
  82. package/dist/components/PasswordForm/index.d.ts +35 -0
  83. package/dist/components/PasswordForm/index.js +21 -0
  84. package/dist/components/PasswordInput/index.d.ts +4 -0
  85. package/dist/components/PasswordInput/index.js +12 -0
  86. package/dist/{types/components → components}/RadioList/index.d.ts +9 -9
  87. package/dist/components/RadioList/index.js +7 -0
  88. package/dist/components/RootLayout/index.d.ts +6 -0
  89. package/dist/components/RootLayout/index.js +7 -0
  90. package/dist/components/SummaryList/index.d.ts +18 -0
  91. package/dist/components/SummaryList/index.js +15 -0
  92. package/dist/components/Switch/index.d.ts +21 -0
  93. package/dist/components/Switch/index.js +31 -0
  94. package/dist/{types/components → components}/Table/index.d.ts +28 -28
  95. package/dist/components/Table/index.js +55 -0
  96. package/dist/components/Tag/index.d.ts +15 -0
  97. package/dist/components/Tag/index.js +13 -0
  98. package/dist/components/TextArea/index.d.ts +18 -0
  99. package/dist/components/TextArea/index.js +26 -0
  100. package/dist/{types/components → components}/TextInput/index.d.ts +14 -14
  101. package/dist/components/TextInput/index.js +27 -0
  102. package/dist/{types/components → components}/WebsiteInput/index.d.ts +10 -10
  103. package/dist/components/WebsiteInput/index.js +13 -0
  104. package/dist/components/WeekCalendar/index.d.ts +24 -0
  105. package/dist/components/WeekCalendar/index.js +48 -0
  106. package/dist/{types/core → core}/AlertComponent/index.d.ts +26 -26
  107. package/dist/core/AlertComponent/index.js +35 -0
  108. package/dist/{types/core → core}/AppHeader/index.d.ts +3 -3
  109. package/dist/core/AppHeader/index.js +17 -0
  110. package/dist/core/AppLogo/index.d.ts +12 -0
  111. package/dist/core/AppLogo/index.js +16 -0
  112. package/dist/{types/core → core}/AppLogoImage/index.d.ts +3 -3
  113. package/dist/core/AppLogoImage/index.js +11 -0
  114. package/dist/{types/core → core}/AppLogoPlaceholder/index.d.ts +3 -3
  115. package/dist/core/AppLogoPlaceholder/index.js +10 -0
  116. package/dist/core/Assistive/index.d.ts +12 -0
  117. package/dist/core/Assistive/index.js +9 -0
  118. package/dist/core/AuthForm/index.d.ts +10 -0
  119. package/dist/core/AuthForm/index.js +13 -0
  120. package/dist/{types/core → core}/Banner/index.d.ts +3 -3
  121. package/dist/core/Banner/index.js +14 -0
  122. package/dist/core/Calendar/index.d.ts +21 -0
  123. package/dist/core/Calendar/index.js +69 -0
  124. package/dist/core/CalendarDay/index.d.ts +30 -0
  125. package/dist/core/CalendarDay/index.js +30 -0
  126. package/dist/core/CalendarMonth/index.d.ts +23 -0
  127. package/dist/core/CalendarMonth/index.js +45 -0
  128. package/dist/core/CalendarNavigation/index.d.ts +17 -0
  129. package/dist/core/CalendarNavigation/index.js +24 -0
  130. package/dist/core/CalendarWeek/index.d.ts +28 -0
  131. package/dist/core/CalendarWeek/index.js +46 -0
  132. package/dist/core/ChkRad/index.d.ts +26 -0
  133. package/dist/core/ChkRad/index.js +33 -0
  134. package/dist/core/ChkRadIcon/index.d.ts +14 -0
  135. package/dist/core/ChkRadIcon/index.js +12 -0
  136. package/dist/{types/core → core}/ChkRadList/index.d.ts +32 -32
  137. package/dist/core/ChkRadList/index.js +37 -0
  138. package/dist/core/CloseButton/index.d.ts +17 -0
  139. package/dist/core/CloseButton/index.js +12 -0
  140. package/dist/{types/core → core}/ConfirmModal/index.d.ts +3 -3
  141. package/dist/core/ConfirmModal/index.js +38 -0
  142. package/dist/{types/core → core}/ConnectedRepeater/index.d.ts +50 -50
  143. package/dist/core/ConnectedRepeater/index.js +154 -0
  144. package/dist/{types/core → core}/ConnectedRepeaterComponent/index.d.ts +24 -24
  145. package/dist/core/ConnectedRepeaterComponent/index.js +25 -0
  146. package/dist/core/Container/index.d.ts +14 -0
  147. package/dist/core/Container/index.js +12 -0
  148. package/dist/core/DataPanelItem/index.d.ts +8 -0
  149. package/dist/core/DataPanelItem/index.js +7 -0
  150. package/dist/core/DropdownPanel/index.d.ts +31 -0
  151. package/dist/core/DropdownPanel/index.js +32 -0
  152. package/dist/{types/core → core}/EmptyMessage/index.d.ts +21 -14
  153. package/dist/core/EmptyMessage/index.js +21 -0
  154. package/dist/core/FilterItem/index.d.ts +25 -0
  155. package/dist/core/FilterItem/index.js +82 -0
  156. package/dist/core/Filters/index.d.ts +31 -0
  157. package/dist/core/Filters/index.js +85 -0
  158. package/dist/{types/core → core}/FixedActions/index.d.ts +24 -24
  159. package/dist/core/FixedActions/index.js +22 -0
  160. package/dist/core/FormError/index.d.ts +12 -0
  161. package/dist/core/FormError/index.js +9 -0
  162. package/dist/core/FormLabel/index.d.ts +16 -0
  163. package/dist/core/FormLabel/index.js +13 -0
  164. package/dist/core/FormLegend/index.d.ts +12 -0
  165. package/dist/core/FormLegend/index.js +9 -0
  166. package/dist/core/Header/Header.stories.d.ts +5 -0
  167. package/dist/core/Header/Header.stories.js +11 -0
  168. package/dist/core/Header/index.d.ts +14 -0
  169. package/dist/core/Header/index.js +12 -0
  170. package/dist/core/Icon/index.d.ts +14 -0
  171. package/dist/core/Icon/index.js +32 -0
  172. package/dist/core/IconButton/index.d.ts +22 -0
  173. package/dist/core/IconButton/index.js +20 -0
  174. package/dist/core/InputPanel/index.d.ts +16 -0
  175. package/dist/core/InputPanel/index.js +11 -0
  176. package/dist/{types/core → core}/ListItem/index.d.ts +39 -38
  177. package/dist/core/ListItem/index.js +44 -0
  178. package/dist/core/ListItemAction/index.d.ts +11 -0
  179. package/dist/core/ListItemAction/index.js +13 -0
  180. package/dist/{types/core → core}/ListItemActions/index.d.ts +8 -8
  181. package/dist/core/ListItemActions/index.js +16 -0
  182. package/dist/core/ListItemMetaItem/index.d.ts +19 -0
  183. package/dist/core/ListItemMetaItem/index.js +29 -0
  184. package/dist/core/ListItemTitle/index.d.ts +19 -0
  185. package/dist/core/ListItemTitle/index.js +44 -0
  186. package/dist/core/Loader/index.d.ts +15 -0
  187. package/dist/core/Loader/index.js +16 -0
  188. package/dist/core/MeActions/index.d.ts +3 -0
  189. package/dist/core/MeActions/index.js +48 -0
  190. package/dist/{types/core → core}/MePanel/index.d.ts +19 -19
  191. package/dist/core/MePanel/index.js +29 -0
  192. package/dist/core/ModalComponent/index.d.ts +22 -0
  193. package/dist/core/ModalComponent/index.js +29 -0
  194. package/dist/{types/core → core}/Navigation/index.d.ts +3 -3
  195. package/dist/core/Navigation/index.js +33 -0
  196. package/dist/{types/core → core}/NavigationDivider/index.d.ts +3 -3
  197. package/dist/core/NavigationDivider/index.js +8 -0
  198. package/dist/core/NavigationItem/index.d.ts +16 -0
  199. package/dist/core/NavigationItem/index.js +21 -0
  200. package/dist/core/Pagination/index.d.ts +15 -0
  201. package/{src/core/Pagination/index.tsx → dist/core/Pagination/index.js} +10 -46
  202. package/dist/core/PaginationItem/index.d.ts +10 -0
  203. package/dist/core/PaginationItem/index.js +17 -0
  204. package/dist/core/Panel/index.d.ts +17 -0
  205. package/dist/core/Panel/index.js +13 -0
  206. package/dist/{types/core → core}/PasswordForgotForm/index.d.ts +7 -7
  207. package/dist/core/PasswordForgotForm/index.js +40 -0
  208. package/dist/{types/core → core}/PasswordResetForm/index.d.ts +7 -7
  209. package/dist/core/PasswordResetForm/index.js +34 -0
  210. package/dist/core/RadialProgress/index.d.ts +16 -0
  211. package/dist/core/RadialProgress/index.js +23 -0
  212. package/dist/core/SettingsForm/index.d.ts +3 -0
  213. package/dist/core/SettingsForm/index.js +14 -0
  214. package/dist/core/StaticTextInput/index.d.ts +29 -0
  215. package/dist/core/StaticTextInput/index.js +39 -0
  216. package/dist/{types/core → core}/Styled/index.d.ts +6 -6
  217. package/{src/core/Styled/index.tsx → dist/core/Styled/index.js} +7 -30
  218. package/dist/core/SummaryListItem/index.d.ts +23 -0
  219. package/dist/core/SummaryListItem/index.js +31 -0
  220. package/dist/core/TabItem/index.d.ts +4 -0
  221. package/dist/core/TabItem/index.js +13 -0
  222. package/dist/{types/core → core}/TableActionsCell/index.d.ts +8 -8
  223. package/dist/core/TableActionsCell/index.js +8 -0
  224. package/dist/core/TableCell/index.d.ts +15 -0
  225. package/dist/core/TableCell/index.js +20 -0
  226. package/dist/core/TableHead/index.d.ts +18 -0
  227. package/dist/core/TableHead/index.js +18 -0
  228. package/dist/{types/core → core}/TableRow/index.d.ts +13 -13
  229. package/dist/core/TableRow/index.js +18 -0
  230. package/dist/core/Tabs/index.d.ts +7 -0
  231. package/dist/core/Tabs/index.js +13 -0
  232. package/dist/core/TextInputAncillary/index.d.ts +29 -0
  233. package/dist/core/TextInputAncillary/index.js +31 -0
  234. package/dist/{types/core → core}/Toast/index.d.ts +3 -3
  235. package/dist/core/Toast/index.js +47 -0
  236. package/dist/core/TwoFactor/index.d.ts +13 -0
  237. package/dist/core/TwoFactor/index.js +49 -0
  238. package/dist/{types/core/LoginFormAuthenticator → core/TwoFactorAuthenticator}/index.d.ts +10 -10
  239. package/dist/core/TwoFactorAuthenticator/index.js +9 -0
  240. package/dist/core/TwoFactorMethodList/index.d.ts +10 -0
  241. package/dist/core/TwoFactorMethodList/index.js +22 -0
  242. package/dist/core/TwoFactorSetup/index.d.ts +12 -0
  243. package/dist/core/TwoFactorSetup/index.js +43 -0
  244. package/dist/core/TwoFactorSetupAuthenticator/index.d.ts +20 -0
  245. package/dist/core/TwoFactorSetupAuthenticator/index.js +42 -0
  246. package/dist/core/TwoFactorSetupYubikey/index.d.ts +16 -0
  247. package/dist/core/TwoFactorSetupYubikey/index.js +14 -0
  248. package/dist/{types/core/LoginFormYubikey → core/TwoFactorYubikey}/index.d.ts +9 -9
  249. package/dist/core/TwoFactorYubikey/index.js +14 -0
  250. package/dist/core/WeekCalendarDay/index.d.ts +27 -0
  251. package/dist/core/WeekCalendarDay/index.js +35 -0
  252. package/dist/core/YubikeyInput/index.d.ts +4 -0
  253. package/dist/core/YubikeyInput/index.js +14 -0
  254. package/dist/filters/BooleanFilter/index.d.ts +14 -0
  255. package/dist/filters/BooleanFilter/index.js +35 -0
  256. package/dist/filters/DateFilter/index.d.ts +5 -0
  257. package/dist/filters/DateFilter/index.js +24 -0
  258. package/dist/filters/DropdownFilter/index.d.ts +17 -0
  259. package/dist/filters/DropdownFilter/index.js +32 -0
  260. package/dist/filters/QuickDateFilter/index.d.ts +13 -0
  261. package/dist/filters/QuickDateFilter/index.js +40 -0
  262. package/dist/{types/filters → filters}/interfaces.d.ts +35 -35
  263. package/dist/filters/interfaces.js +1 -0
  264. package/dist/{types/hooks → hooks}/useAlert.d.ts +12 -12
  265. package/dist/hooks/useAlert.js +18 -0
  266. package/dist/hooks/useAppConfig.d.ts +3 -0
  267. package/dist/hooks/useAppConfig.js +5 -0
  268. package/dist/{types/hooks → hooks}/useConnectedList.d.ts +7 -7
  269. package/dist/hooks/useConnectedList.js +6 -0
  270. package/dist/{types/hooks → hooks}/useConnectedRepeater.d.ts +7 -7
  271. package/dist/hooks/useConnectedRepeater.js +14 -0
  272. package/dist/{types/hooks → hooks}/useConnectedTable.d.ts +7 -7
  273. package/dist/hooks/useConnectedTable.js +6 -0
  274. package/dist/hooks/useFilters.d.ts +9 -0
  275. package/dist/hooks/useFilters.js +24 -0
  276. package/dist/{types/hooks → hooks}/useLayout.d.ts +7 -7
  277. package/dist/hooks/useLayout.js +10 -0
  278. package/dist/hooks/useLayout.spec.d.ts +1 -0
  279. package/dist/hooks/useLayout.spec.js +24 -0
  280. package/dist/{types/hooks → hooks}/useModal.d.ts +12 -12
  281. package/dist/hooks/useModal.js +39 -0
  282. package/dist/hooks/useModalOffset.d.ts +2 -0
  283. package/dist/hooks/useModalOffset.js +16 -0
  284. package/dist/hooks/useModalOffset.spec.d.ts +1 -0
  285. package/dist/hooks/useModalOffset.spec.js +19 -0
  286. package/dist/hooks/useNavigation.d.ts +7 -0
  287. package/dist/hooks/useNavigation.js +113 -0
  288. package/dist/hooks/useRemote.d.ts +7 -0
  289. package/dist/hooks/useRemote.js +29 -0
  290. package/dist/hooks/useVariant.d.ts +9 -0
  291. package/dist/hooks/useVariant.js +14 -0
  292. package/dist/{types/index.d.ts → index.d.ts} +209 -203
  293. package/dist/index.js +213 -5459
  294. package/dist/{types/scenes → scenes}/Error404Scene.d.ts +3 -3
  295. package/dist/scenes/Error404Scene.js +5 -0
  296. package/dist/services/AppService.d.ts +5 -0
  297. package/dist/services/AppService.js +11 -0
  298. package/dist/services/ConfigService.d.ts +42 -0
  299. package/dist/services/ConfigService.js +52 -0
  300. package/dist/{types/services → services}/ConfirmService.d.ts +12 -12
  301. package/dist/services/ConfirmService.js +10 -0
  302. package/dist/services/DateService.d.ts +26 -0
  303. package/dist/services/DateService.js +132 -0
  304. package/dist/services/DateService.spec.d.ts +1 -0
  305. package/dist/services/DateService.spec.js +83 -0
  306. package/dist/services/DownloadService.d.ts +7 -0
  307. package/dist/services/DownloadService.js +16 -0
  308. package/dist/services/DownloadService.spec.d.ts +1 -0
  309. package/dist/services/DownloadService.spec.js +18 -0
  310. package/dist/{types/services → services}/FilterComponentService.d.ts +25 -25
  311. package/dist/services/FilterComponentService.js +54 -0
  312. package/dist/services/FilterService.d.ts +34 -0
  313. package/dist/services/FilterService.js +58 -0
  314. package/dist/services/FilterService.spec.d.ts +1 -0
  315. package/dist/services/FilterService.spec.js +67 -0
  316. package/dist/services/FormatService.d.ts +11 -0
  317. package/dist/services/FormatService.js +45 -0
  318. package/dist/services/FormatService.spec.d.ts +1 -0
  319. package/dist/services/FormatService.spec.js +66 -0
  320. package/dist/services/ToastService.d.ts +7 -0
  321. package/dist/services/ToastService.js +17 -0
  322. package/dist/services/ToastService.spec.d.ts +1 -0
  323. package/dist/services/ToastService.spec.js +34 -0
  324. package/dist/styles.css +984 -0
  325. package/dist/utility/MockRouter/index.d.ts +2 -0
  326. package/dist/utility/MockRouter/index.js +37 -0
  327. package/dist/utility/StorybookPanel/index.d.ts +14 -0
  328. package/dist/utility/StorybookPanel/index.js +12 -0
  329. package/dist/utility/TestChangeHandler/index.d.ts +15 -0
  330. package/dist/utility/TestChangeHandler/index.js +30 -0
  331. package/dist/utility/icons.d.ts +3 -0
  332. package/dist/utility/icons.js +12 -0
  333. package/dist/{types/utility → utility}/interfaces.d.ts +79 -69
  334. package/dist/utility/interfaces.js +18 -0
  335. package/dist/utility/middleware.d.ts +4 -0
  336. package/dist/utility/middleware.js +9 -0
  337. package/dist/{types/utility → utility}/prop-types.d.ts +57 -55
  338. package/dist/utility/prop-types.js +77 -0
  339. package/dist/utility/register.d.ts +3 -0
  340. package/dist/utility/register.js +9 -0
  341. package/package.json +53 -88
  342. package/postcss.config.js +1 -1
  343. package/prettier.config.js +1 -0
  344. package/src/components/Alert/index.tsx +103 -13
  345. package/src/components/Allow/Allow.spec.tsx +2 -2
  346. package/src/components/Allow/index.tsx +8 -8
  347. package/src/components/AppLayout/AppLayout.stories.tsx +20 -0
  348. package/src/components/AppLayout/index.tsx +22 -0
  349. package/src/components/AutoSuggest/AutoSuggest.spec.tsx +38 -18
  350. package/src/components/AutoSuggest/AutoSuggest.story.tsx +8 -6
  351. package/src/components/AutoSuggest/index.tsx +30 -30
  352. package/src/components/Button/Button.spec.tsx +8 -0
  353. package/src/components/Button/Button.stories.tsx +62 -0
  354. package/src/components/Button/index.tsx +9 -93
  355. package/src/components/CalendarInput/CalendarInput.spec.tsx +38 -22
  356. package/src/components/CalendarInput/CalendarInput.story.tsx +2 -2
  357. package/src/components/CalendarInput/index.tsx +23 -19
  358. package/src/components/CheckboxList/CheckboxList.spec.tsx +20 -10
  359. package/src/components/CheckboxList/index.tsx +9 -12
  360. package/src/components/ConnectedDropdown/index.tsx +7 -5
  361. package/src/components/ConnectedList/index.tsx +13 -11
  362. package/src/components/ConnectedTable/index.tsx +15 -13
  363. package/src/components/ContentBlock/index.tsx +10 -8
  364. package/src/components/DataPanel/index.tsx +25 -0
  365. package/src/components/DateInput/DateInput.spec.tsx +10 -6
  366. package/src/components/DateInput/index.tsx +11 -12
  367. package/src/components/ErrorMessage/index.tsx +18 -20
  368. package/src/components/Fieldset/Fieldset.story.tsx +17 -13
  369. package/src/components/Fieldset/index.tsx +12 -10
  370. package/src/components/FileInput/FileInput.spec.tsx +9 -5
  371. package/src/components/FileInput/FileInput.story.tsx +3 -1
  372. package/src/components/FileInput/index.tsx +12 -10
  373. package/src/components/FilterLink/FilterLink.spec.tsx +18 -4
  374. package/src/components/FilterLink/index.tsx +19 -14
  375. package/src/components/Form/Form.spec.tsx +7 -5
  376. package/src/components/Form/index.tsx +5 -3
  377. package/src/components/FormActions/FormActions.story.tsx +19 -15
  378. package/src/components/FormActions/index.tsx +11 -7
  379. package/src/components/FormField/FormField.spec.tsx +28 -39
  380. package/src/components/FormField/FormField.stories.tsx +44 -0
  381. package/src/components/FormField/index.tsx +8 -103
  382. package/src/components/FormRepeater/FormRepeater.spec.tsx +26 -14
  383. package/src/components/FormRepeater/index.tsx +9 -7
  384. package/src/components/ImageInput/ImageInput.spec.tsx +3 -1
  385. package/src/components/ImageInput/ImageInput.story.tsx +3 -1
  386. package/src/components/ImageInput/index.tsx +16 -14
  387. package/src/components/InfoPanel/index.tsx +7 -7
  388. package/src/components/Link/Link.spec.tsx +4 -2
  389. package/src/components/Link/__mocks__/index.tsx +3 -3
  390. package/src/components/Link/index.tsx +6 -6
  391. package/src/components/List/List.spec.tsx +57 -20
  392. package/src/components/List/List.story.tsx +21 -2
  393. package/src/components/List/index.tsx +13 -13
  394. package/src/components/ListActions/ListActions.story.tsx +3 -1
  395. package/src/components/ListActions/index.tsx +10 -11
  396. package/src/components/LoginForm/LoginForm.spec.tsx +19 -7
  397. package/src/components/LoginForm/LoginForm.story.tsx +25 -0
  398. package/src/components/LoginForm/index.tsx +72 -171
  399. package/src/components/Message/index.tsx +12 -10
  400. package/src/components/Modal/index.tsx +18 -12
  401. package/src/components/ModalActions/ModalActions.spec.tsx +4 -2
  402. package/src/components/ModalActions/ModalActions.story.tsx +3 -1
  403. package/src/components/ModalActions/index.tsx +22 -18
  404. package/src/components/MoneyInput/MoneyInput.story.tsx +3 -1
  405. package/src/components/MoneyInput/index.tsx +7 -5
  406. package/src/components/PasswordForm/index.tsx +12 -24
  407. package/src/components/RadioList/RadioList.spec.tsx +4 -2
  408. package/src/components/RadioList/index.tsx +8 -6
  409. package/src/components/RootLayout/index.tsx +45 -0
  410. package/src/components/SummaryList/SummaryList.module.css +19 -4
  411. package/src/components/SummaryList/SummaryList.spec.tsx +14 -2
  412. package/src/components/SummaryList/SummaryList.story.tsx +3 -1
  413. package/src/components/SummaryList/index.tsx +16 -14
  414. package/src/components/Switch/Switch.spec.tsx +8 -4
  415. package/src/components/Switch/index.tsx +16 -14
  416. package/src/components/Table/Table.spec.tsx +11 -7
  417. package/src/components/Table/Table.story.tsx +3 -3
  418. package/src/components/Table/index.tsx +20 -22
  419. package/src/components/TextArea/TextArea.spec.tsx +12 -6
  420. package/src/components/TextArea/index.tsx +10 -8
  421. package/src/components/TextInput/TextInput.module.css +1 -0
  422. package/src/components/TextInput/TextInput.spec.tsx +12 -6
  423. package/src/components/TextInput/TextInput.stories.tsx +46 -0
  424. package/src/components/TextInput/index.tsx +6 -99
  425. package/src/components/WebsiteInput/index.tsx +7 -5
  426. package/src/components/WeekCalendar/index.tsx +8 -8
  427. package/src/core/AlertComponent/AlertComponent.spec.tsx +17 -4
  428. package/src/core/AlertComponent/AlertComponent.story.tsx +19 -15
  429. package/src/core/AlertComponent/index.tsx +30 -25
  430. package/src/core/AppHeader/index.tsx +5 -3
  431. package/src/core/AppLogo/index.tsx +9 -7
  432. package/src/core/AppLogoImage/index.tsx +6 -6
  433. package/src/core/AppLogoPlaceholder/index.tsx +28 -22
  434. package/src/core/Assistive/index.tsx +1 -18
  435. package/src/{components/LoginForm/LoginForm.module.css → core/AuthForm/AuthForm.module.css} +4 -0
  436. package/src/core/AuthForm/AuthForm.spec.tsx +72 -0
  437. package/src/core/AuthForm/index.tsx +63 -0
  438. package/src/core/Banner/index.tsx +11 -11
  439. package/src/core/Calendar/index.tsx +9 -7
  440. package/src/core/CalendarDay/index.tsx +12 -12
  441. package/src/core/CalendarMonth/index.tsx +14 -12
  442. package/src/core/CalendarNavigation/index.tsx +14 -14
  443. package/src/core/CalendarWeek/index.tsx +21 -19
  444. package/src/core/ChkRadList/index.tsx +25 -23
  445. package/src/core/CloseButton/CloseButton.spec.tsx +4 -2
  446. package/src/core/CloseButton/index.tsx +10 -8
  447. package/src/core/ConfirmModal/ConfirmModal.spec.tsx +10 -4
  448. package/src/core/ConfirmModal/index.tsx +9 -7
  449. package/src/core/ConnectedRepeater/index.tsx +46 -19
  450. package/src/core/ConnectedRepeaterComponent/index.tsx +13 -9
  451. package/src/core/Container/index.tsx +6 -12
  452. package/src/core/DataPanelItem/index.tsx +19 -0
  453. package/src/core/EmptyMessage/EmptyMessage.stories.tsx +33 -0
  454. package/src/core/EmptyMessage/index.tsx +9 -42
  455. package/src/core/FilterItem/index.tsx +41 -33
  456. package/src/core/Filters/Filters.spec.tsx +103 -69
  457. package/src/core/Filters/index.tsx +39 -31
  458. package/src/core/FixedActions/FixedActions.module.css +6 -0
  459. package/src/core/FixedActions/FixedActions.spec.tsx +8 -3
  460. package/src/core/FixedActions/index.tsx +9 -9
  461. package/src/core/FormLegend/index.tsx +4 -4
  462. package/src/core/Header/Header.stories.tsx +20 -0
  463. package/src/core/Header/index.tsx +8 -13
  464. package/src/core/Icon/Icon.spec.tsx +1 -3
  465. package/src/core/Icon/index.tsx +14 -10
  466. package/src/core/IconButton/index.tsx +18 -20
  467. package/src/core/ListItem/ListItem.story.tsx +23 -19
  468. package/src/core/ListItem/index.tsx +46 -37
  469. package/src/core/ListItemAction/index.tsx +7 -14
  470. package/src/core/ListItemActions/index.tsx +13 -12
  471. package/src/core/ListItemMetaItem/index.tsx +8 -8
  472. package/src/core/ListItemTitle/ListItemTitle.module.css +9 -1
  473. package/src/core/ListItemTitle/ListItemTitle.spec.tsx +24 -2
  474. package/src/core/ListItemTitle/index.tsx +20 -10
  475. package/src/core/Loader/Loader.module.css +3 -3
  476. package/src/core/Loader/Loader.stories.tsx +22 -0
  477. package/src/core/Loader/index.tsx +2 -27
  478. package/src/core/MeActions/index.tsx +28 -18
  479. package/src/core/MePanel/index.tsx +10 -10
  480. package/src/core/ModalComponent/ModalComponent.spec.tsx +8 -4
  481. package/src/core/ModalComponent/index.tsx +13 -13
  482. package/src/core/Navigation/Navigation.spec.tsx +47 -36
  483. package/src/core/Navigation/index.tsx +18 -58
  484. package/src/core/NavigationDivider/index.tsx +6 -6
  485. package/src/core/NavigationItem/index.tsx +12 -21
  486. package/src/core/Panel/Panel.module.css +11 -0
  487. package/src/core/Panel/Panel.spec.tsx +16 -0
  488. package/src/core/Panel/index.tsx +17 -13
  489. package/src/core/PasswordForgotForm/index.tsx +15 -12
  490. package/src/core/PasswordResetForm/index.tsx +15 -12
  491. package/src/core/RadialProgress/index.tsx +11 -14
  492. package/src/core/SettingsForm/index.tsx +9 -8
  493. package/src/core/SummaryListItem/SummaryListItem.module.css +3 -11
  494. package/src/core/SummaryListItem/index.tsx +19 -14
  495. package/src/core/TabItem/TabItem.module.css +28 -0
  496. package/src/core/TabItem/index.tsx +42 -0
  497. package/src/core/Tabs/Tabs.module.css +0 -24
  498. package/src/core/Tabs/Tabs.spec.tsx +30 -0
  499. package/src/core/Tabs/index.tsx +18 -76
  500. package/src/core/Toast/Toast.spec.tsx +4 -2
  501. package/src/core/Toast/index.tsx +16 -18
  502. package/src/core/TwoFactor/TwoFactor.spec.tsx +183 -0
  503. package/src/core/TwoFactor/index.tsx +102 -0
  504. package/src/core/TwoFactorAuthenticator/index.tsx +39 -0
  505. package/src/core/{LoginFormTwoFactor/LoginFormTwoFactor.module.css → TwoFactorMethodList/TwoFactorMethodList.module.css} +1 -1
  506. package/src/core/TwoFactorMethodList/index.tsx +49 -0
  507. package/src/core/TwoFactorSetup/index.tsx +91 -0
  508. package/src/core/TwoFactorSetupAuthenticator/TwoFactorSetupAuthenticator.module.css +6 -0
  509. package/src/core/TwoFactorSetupAuthenticator/index.tsx +100 -0
  510. package/src/core/TwoFactorSetupYubikey/index.tsx +49 -0
  511. package/src/core/TwoFactorYubikey/index.tsx +41 -0
  512. package/src/core/WeekCalendarDay/index.tsx +7 -7
  513. package/src/core/{LoginFormYubikey/LoginFormYubikey.module.css → YubikeyInput/YubikeyInput.module.css} +5 -0
  514. package/src/core/YubikeyInput/YubikeyInput.spec.tsx +77 -0
  515. package/src/core/YubikeyInput/index.tsx +76 -0
  516. package/src/filters/BooleanFilter/index.tsx +13 -12
  517. package/src/filters/DateFilter/index.tsx +8 -8
  518. package/src/filters/DropdownFilter/index.tsx +19 -17
  519. package/src/filters/QuickDateFilter/index.tsx +12 -12
  520. package/src/filters/interfaces.ts +2 -2
  521. package/src/hooks/useAlert.spec.tsx +72 -0
  522. package/src/hooks/useAlert.ts +7 -5
  523. package/src/hooks/useConfig.ts +31 -0
  524. package/src/hooks/useConnectedList.ts +4 -4
  525. package/src/hooks/useConnectedRepeater.ts +8 -6
  526. package/src/hooks/useConnectedTable.ts +4 -4
  527. package/src/hooks/useFilters.ts +21 -13
  528. package/src/hooks/useLayout.spec.ts +3 -11
  529. package/src/hooks/useLayout.ts +8 -7
  530. package/src/hooks/useModal.spec.tsx +23 -15
  531. package/src/hooks/useModal.ts +17 -17
  532. package/src/hooks/useModalOffset.ts +4 -2
  533. package/src/hooks/useNavigation.ts +160 -0
  534. package/src/hooks/useRemote.ts +43 -0
  535. package/src/index.ts +31 -26
  536. package/src/scenes/Error404Scene.tsx +3 -1
  537. package/src/services/AppService.ts +16 -0
  538. package/src/services/ConfigService.ts +93 -0
  539. package/src/services/ConfirmService.ts +7 -2
  540. package/src/services/DateService.ts +48 -32
  541. package/src/services/DownloadService.spec.ts +4 -10
  542. package/src/services/DownloadService.ts +16 -9
  543. package/src/services/FilterComponentService.tsx +9 -5
  544. package/src/services/FilterService.spec.ts +57 -39
  545. package/src/services/FilterService.ts +62 -40
  546. package/src/services/FormatService.spec.ts +2 -0
  547. package/src/services/FormatService.ts +13 -8
  548. package/src/services/ToastService.ts +9 -4
  549. package/src/styles/tailwind.css +57 -0
  550. package/src/typings.d.ts +2 -2
  551. package/src/utility/MockRouter/index.ts +1 -0
  552. package/src/utility/icons.tsx +46 -30
  553. package/src/utility/interfaces.ts +39 -21
  554. package/src/utility/middleware.ts +10 -0
  555. package/src/utility/prop-types.ts +6 -2
  556. package/src/utility/register.tsx +11 -0
  557. package/tailwind.config.js +11 -0
  558. package/tsconfig.eslint.json +4 -0
  559. package/tsconfig.json +7 -15
  560. package/.gitattributes +0 -1
  561. package/.github/workflows/development.yml +0 -47
  562. package/.prettierrc +0 -9
  563. package/.storybook/manager.js +0 -4
  564. package/.storybook/postcss.config.js +0 -3
  565. package/.storybook/theme.js +0 -7
  566. package/.stylelintrc +0 -9
  567. package/__mocks__/@sqrzro/utility.ts +0 -43
  568. package/assets/logo-horizontal-dark.svg +0 -21
  569. package/assets/logo-horizontal-white.svg +0 -21
  570. package/assets/logo-vertical-dark.svg +0 -21
  571. package/assets/logo-vertical-white.svg +0 -21
  572. package/dist/index.css +0 -3812
  573. package/dist/index.js.map +0 -1
  574. package/dist/types/components/App/index.d.ts +0 -18
  575. package/dist/types/components/CalendarInput/index.d.ts +0 -10
  576. package/dist/types/components/CodeInput/index.d.ts +0 -9
  577. package/dist/types/components/ConnectedListScene/index.d.ts +0 -7
  578. package/dist/types/components/ConnectedScene/index.d.ts +0 -11
  579. package/dist/types/components/DateInput/index.d.ts +0 -7
  580. package/dist/types/components/Document/index.d.ts +0 -3
  581. package/dist/types/components/ErrorMessage/index.d.ts +0 -8
  582. package/dist/types/components/Fieldset/index.d.ts +0 -11
  583. package/dist/types/components/FilterLink/index.d.ts +0 -7
  584. package/dist/types/components/Form/index.d.ts +0 -14
  585. package/dist/types/components/FormActions/index.d.ts +0 -9
  586. package/dist/types/components/FormRepeater/index.d.ts +0 -9
  587. package/dist/types/components/InfoPanel/index.d.ts +0 -8
  588. package/dist/types/components/Link/index.d.ts +0 -13
  589. package/dist/types/components/ListActions/index.d.ts +0 -9
  590. package/dist/types/components/LoginForm/index.d.ts +0 -3
  591. package/dist/types/components/Message/index.d.ts +0 -7
  592. package/dist/types/components/ModalActions/index.d.ts +0 -11
  593. package/dist/types/components/PasswordForm/index.d.ts +0 -3
  594. package/dist/types/components/PasswordInput/index.d.ts +0 -4
  595. package/dist/types/components/Scene/index.d.ts +0 -10
  596. package/dist/types/components/SummaryList/index.d.ts +0 -8
  597. package/dist/types/components/Switch/index.d.ts +0 -9
  598. package/dist/types/components/Tag/index.d.ts +0 -8
  599. package/dist/types/components/TextArea/index.d.ts +0 -4
  600. package/dist/types/components/WeekCalendar/index.d.ts +0 -12
  601. package/dist/types/core/App/index.d.ts +0 -19
  602. package/dist/types/core/AppLogo/index.d.ts +0 -6
  603. package/dist/types/core/Assistive/index.d.ts +0 -6
  604. package/dist/types/core/BuildModal/index.d.ts +0 -3
  605. package/dist/types/core/Calendar/index.d.ts +0 -11
  606. package/dist/types/core/CalendarDay/index.d.ts +0 -16
  607. package/dist/types/core/CalendarMonth/index.d.ts +0 -12
  608. package/dist/types/core/CalendarNavigation/index.d.ts +0 -9
  609. package/dist/types/core/CalendarWeek/index.d.ts +0 -14
  610. package/dist/types/core/ChkRad/index.d.ts +0 -13
  611. package/dist/types/core/ChkRadIcon/index.d.ts +0 -7
  612. package/dist/types/core/CloseButton/index.d.ts +0 -9
  613. package/dist/types/core/ConnectedList/index.d.ts +0 -4
  614. package/dist/types/core/ConnectedTable/index.d.ts +0 -4
  615. package/dist/types/core/Container/index.d.ts +0 -7
  616. package/dist/types/core/DropdownPanel/index.d.ts +0 -18
  617. package/dist/types/core/ErrorBoundary/index.d.ts +0 -15
  618. package/dist/types/core/ErrorMessage/index.d.ts +0 -8
  619. package/dist/types/core/FilterItem/index.d.ts +0 -10
  620. package/dist/types/core/Filters/index.d.ts +0 -15
  621. package/dist/types/core/Form/index.d.ts +0 -12
  622. package/dist/types/core/FormError/index.d.ts +0 -6
  623. package/dist/types/core/FormLabel/index.d.ts +0 -8
  624. package/dist/types/core/FormLegend/index.d.ts +0 -6
  625. package/dist/types/core/Header/index.d.ts +0 -8
  626. package/dist/types/core/Icon/index.d.ts +0 -7
  627. package/dist/types/core/IconButton/Icon/index.d.ts +0 -7
  628. package/dist/types/core/IconButton/index.d.ts +0 -11
  629. package/dist/types/core/InputPanel/index.d.ts +0 -8
  630. package/dist/types/core/ListItemAction/index.d.ts +0 -4
  631. package/dist/types/core/ListItemMetaItem/index.d.ts +0 -10
  632. package/dist/types/core/ListItemTitle/index.d.ts +0 -9
  633. package/dist/types/core/Loader/index.d.ts +0 -6
  634. package/dist/types/core/LoginFormTwoFactor/index.d.ts +0 -13
  635. package/dist/types/core/MeActions/index.d.ts +0 -3
  636. package/dist/types/core/Modal/index.d.ts +0 -12
  637. package/dist/types/core/ModalComponent/index.d.ts +0 -12
  638. package/dist/types/core/NavigationItem/index.d.ts +0 -7
  639. package/dist/types/core/Pagination/index.d.ts +0 -7
  640. package/dist/types/core/PaginationItem/index.d.ts +0 -7
  641. package/dist/types/core/Panel/index.d.ts +0 -8
  642. package/dist/types/core/RadialProgress/index.d.ts +0 -8
  643. package/dist/types/core/SettingsForm/index.d.ts +0 -3
  644. package/dist/types/core/StaticTextInput/index.d.ts +0 -13
  645. package/dist/types/core/SummaryListItem/index.d.ts +0 -15
  646. package/dist/types/core/TableCell/index.d.ts +0 -8
  647. package/dist/types/core/TableHead/index.d.ts +0 -8
  648. package/dist/types/core/Tabs/index.d.ts +0 -11
  649. package/dist/types/core/TextInputAncillary/index.d.ts +0 -12
  650. package/dist/types/core/WeekCalendarDay/index.d.ts +0 -14
  651. package/dist/types/filters/BooleanFilter/index.d.ts +0 -5
  652. package/dist/types/filters/DateFilter/index.d.ts +0 -5
  653. package/dist/types/filters/DropdownFilter/index.d.ts +0 -17
  654. package/dist/types/filters/QuickDateFilter/index.d.ts +0 -5
  655. package/dist/types/hooks/useAccessiblePanel.d.ts +0 -13
  656. package/dist/types/hooks/useAppContext.d.ts +0 -55
  657. package/dist/types/hooks/useClickOutside.d.ts +0 -3
  658. package/dist/types/hooks/useComponentId.d.ts +0 -2
  659. package/dist/types/hooks/useFilters.d.ts +0 -3
  660. package/dist/types/hooks/useForm.d.ts +0 -41
  661. package/dist/types/hooks/useFormData.d.ts +0 -12
  662. package/dist/types/hooks/useModalOffset.d.ts +0 -2
  663. package/dist/types/hooks/useVariant.d.ts +0 -6
  664. package/dist/types/services/BuildService.d.ts +0 -5
  665. package/dist/types/services/DateService.d.ts +0 -17
  666. package/dist/types/services/DownloadService.d.ts +0 -5
  667. package/dist/types/services/FilterService.d.ts +0 -13
  668. package/dist/types/services/FormatService.d.ts +0 -7
  669. package/dist/types/services/OLD_ApiService.d.ts +0 -19
  670. package/dist/types/services/ToastService.d.ts +0 -5
  671. package/dist/types/utility/MockRouter/index.d.ts +0 -2
  672. package/dist/types/utility/StorybookPanel/index.d.ts +0 -7
  673. package/dist/types/utility/TestChangeHandler/index.d.ts +0 -15
  674. package/dist/types/utility/create-app.d.ts +0 -4
  675. package/dist/types/utility/icons.d.ts +0 -3
  676. package/docs/guides/01-installation.story.mdx +0 -33
  677. package/docs/guides/02-configuration.story.mdx +0 -80
  678. package/docs/guides/03-pages.story.mdx +0 -18
  679. package/docs/guides/04-integration.story.mdx +0 -33
  680. package/docs/guides/a11y.story.mdx +0 -7
  681. package/docs/guides/theming.story.mdx +0 -7
  682. package/docs/introduction.story.mdx +0 -17
  683. package/jest.config.js +0 -19
  684. package/rollup.config.js +0 -36
  685. package/scripts/create-exports.js +0 -74
  686. package/scripts/update-license.js +0 -8
  687. package/squarezero.config.js +0 -5
  688. package/src/components/Button/Button.module.css +0 -100
  689. package/src/components/CodeInput/CodeInput.module.css +0 -33
  690. package/src/components/CodeInput/CodeInput.spec.tsx +0 -180
  691. package/src/components/CodeInput/index.tsx +0 -138
  692. package/src/components/ConnectedScene/index.tsx +0 -96
  693. package/src/components/Document/index.tsx +0 -14
  694. package/src/components/Dropdown/Dropdown.module.css +0 -8
  695. package/src/components/Dropdown/Dropdown.spec.tsx +0 -304
  696. package/src/components/Dropdown/Dropdown.story.tsx +0 -53
  697. package/src/components/Dropdown/index.tsx +0 -228
  698. package/src/components/FormField/FormField.story.tsx +0 -29
  699. package/src/components/PasswordForm/PasswordForm.module.css +0 -21
  700. package/src/components/PasswordInput/PasswordInput.module.css +0 -23
  701. package/src/components/PasswordInput/PasswordInput.spec.tsx +0 -28
  702. package/src/components/PasswordInput/PasswordInput.story.tsx +0 -16
  703. package/src/components/PasswordInput/index.tsx +0 -23
  704. package/src/components/Scene/Scene.spec.tsx +0 -123
  705. package/src/components/Scene/Scene.story.tsx +0 -6
  706. package/src/components/Scene/index.tsx +0 -58
  707. package/src/components/Tag/Tag.module.css +0 -37
  708. package/src/components/Tag/Tag.spec.tsx +0 -10
  709. package/src/components/Tag/Tag.story.tsx +0 -55
  710. package/src/components/Tag/index.tsx +0 -27
  711. package/src/components/TextInput/TextInput.story.tsx +0 -24
  712. package/src/core/App/App.module.css +0 -24
  713. package/src/core/App/App.spec.tsx +0 -265
  714. package/src/core/App/index.tsx +0 -115
  715. package/src/core/Assistive/Assistive.module.css +0 -10
  716. package/src/core/ChkRad/ChkRad.module.css +0 -31
  717. package/src/core/ChkRad/ChkRad.spec.tsx +0 -79
  718. package/src/core/ChkRad/index.tsx +0 -75
  719. package/src/core/ChkRadIcon/ChkRadIcon.module.css +0 -29
  720. package/src/core/ChkRadIcon/index.tsx +0 -33
  721. package/src/core/DropdownPanel/DropdownPanel.module.css +0 -68
  722. package/src/core/DropdownPanel/index.tsx +0 -93
  723. package/src/core/ErrorBoundary/ErrorBoundary.spec.tsx +0 -33
  724. package/src/core/ErrorBoundary/index.tsx +0 -42
  725. package/src/core/FormError/FormError.module.css +0 -7
  726. package/src/core/FormError/index.tsx +0 -18
  727. package/src/core/FormLabel/FormLabel.module.css +0 -15
  728. package/src/core/FormLabel/index.tsx +0 -25
  729. package/src/core/Header/Header.module.css +0 -28
  730. package/src/core/InputPanel/InputPanel.module.css +0 -70
  731. package/src/core/InputPanel/index.tsx +0 -28
  732. package/src/core/Loader/Loader.story.tsx +0 -8
  733. package/src/core/LoginFormAuthenticator/index.tsx +0 -36
  734. package/src/core/LoginFormTwoFactor/index.tsx +0 -133
  735. package/src/core/LoginFormYubikey/index.tsx +0 -59
  736. package/src/core/Pagination/Pagination.module.css +0 -15
  737. package/src/core/PaginationItem/PaginationItem.module.css +0 -33
  738. package/src/core/PaginationItem/index.tsx +0 -46
  739. package/src/core/StaticTextInput/StaticTextInput.module.css +0 -79
  740. package/src/core/StaticTextInput/StaticTextInput.spec.tsx +0 -126
  741. package/src/core/StaticTextInput/index.tsx +0 -112
  742. package/src/core/Styled/Styled.spec.tsx +0 -32
  743. package/src/core/Styled/Styled.story.tsx +0 -10
  744. package/src/core/TableActionsCell/TableActionsCell.module.css +0 -3
  745. package/src/core/TableActionsCell/index.tsx +0 -26
  746. package/src/core/TableCell/TableCell.module.css +0 -16
  747. package/src/core/TableCell/index.tsx +0 -39
  748. package/src/core/TableHead/TableHead.module.css +0 -12
  749. package/src/core/TableHead/index.tsx +0 -48
  750. package/src/core/TableRow/index.tsx +0 -49
  751. package/src/core/TextInputAncillary/TextInputAncillary.module.css +0 -69
  752. package/src/core/TextInputAncillary/index.tsx +0 -84
  753. package/src/hooks/useAccessiblePanel.spec.tsx +0 -88
  754. package/src/hooks/useAccessiblePanel.ts +0 -74
  755. package/src/hooks/useAppContext.spec.ts +0 -38
  756. package/src/hooks/useAppContext.ts +0 -110
  757. package/src/hooks/useClickOutside.ts +0 -49
  758. package/src/hooks/useComponentId.spec.ts +0 -19
  759. package/src/hooks/useComponentId.ts +0 -16
  760. package/src/hooks/useForm.spec.ts +0 -251
  761. package/src/hooks/useForm.ts +0 -179
  762. package/src/hooks/useVariant.spec.ts +0 -14
  763. package/src/hooks/useVariant.ts +0 -34
  764. package/src/styles/layout.css +0 -64
  765. package/src/styles/variables.css +0 -85
  766. package/src/utility/StorybookPanel/StorybookPanel.module.css +0 -9
  767. package/src/utility/StorybookPanel/index.tsx +0 -25
  768. package/src/utility/TestChangeHandler/TestChangeHandler.module.css +0 -7
  769. package/src/utility/TestChangeHandler/TestChangeHandler.spec.tsx +0 -24
  770. package/src/utility/TestChangeHandler/index.tsx +0 -51
  771. package/src/utility/create-app.tsx +0 -28
  772. package/tests/setupFilesAfterEnv.js +0 -16
  773. package/tsconfig.types.json +0 -9
@@ -1,60 +1,74 @@
1
- import React from 'react';
2
- import type { DropdownItem } from '../../core/DropdownPanel';
3
- import type { InputProps } from '../../utility/interfaces';
4
- interface AutoSuggestProps extends InputProps<string> {
5
- /**
6
- * An array of strings to filter for the suggestions. If a `remote` prop is specified, this is
7
- * ignored.
8
- */
9
- data?: (DropdownItem | string)[] | null;
10
- /** The URL for the endpoint that will return the suggestions */
11
- remote?: string | null;
12
- }
13
- /**
14
- * As a user types, suggestions based on they've typed are displayed in a panel below. When a user
15
- * clicks a suggestion, the value is updated. Under the hood, it is more or less a combination of a
16
- * `TextInput` and a `DropdownPanel`.
17
- *
18
- * ## Request Methods
19
- *
20
- * At its most basic, the suggestions are a predefined array of `data`. However,
21
- * if the `remote` prop is specified, the AutoSuggest will `GET` that endpoint as the user types.
22
- * The following will be appended onto the query:
23
- *
24
- * ````
25
- * ?search={value}
26
- * ```
27
- *
28
- * The endpoint should then handle filtering the data, and returning an array of the results. If the
29
- * value of the input changes before the previous `GET` request has completed, that one is
30
- * cancelled and a new one started, with the updated search query.
31
- *
32
- * ## Data Formats
33
- *
34
- * The data returned should be one of two formats. The choice of format has an impact on how the
35
- * value is stored, and the label that is displayed.
36
- *
37
- * The most basic format is an array of strings. The value is stored as the string itself, and the
38
- * label displays the same string. This is most useful for situations where no relationships are
39
- * required on the backend, and the `AutoSuggest` is purely being used to assist the user in
40
- * defining a value.
41
- *
42
- * An example of this data would be:
43
- *
44
- * ```
45
- * ['apple', 'banana', 'carrot']
46
- * ```
47
- *
48
- * The second format is an array of objects. The value is stored as the `id` of the object, and the
49
- * label displays the `name` of the object. This is most useful for situations where a relationship
50
- * is required on the backend, and the `AutoSuggest` is being used to assist the user in defining
51
- * a value. With this format, the `AutoSuggest` works more like a `Dropdown`.
52
- *
53
- * For example:
54
- *
55
- * ```
56
- * [{ id: 1, name: 'apple' }, { id: 2, name: 'banana' }, { id: 3, name: 'carrot' }]
57
- * ```
58
- */
59
- declare const AutoSuggest: React.FunctionComponent<AutoSuggestProps>;
60
- export default AutoSuggest;
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import type { DropdownItem } from '../../core/DropdownPanel';
4
+ import type { InputProps } from '../../utility/interfaces';
5
+ export interface AutoSuggestProps extends InputProps<string> {
6
+ /**
7
+ * An array of strings to filter for the suggestions. If a `remote` prop is specified, this is
8
+ * ignored.
9
+ */
10
+ data?: (DropdownItem | string)[] | null;
11
+ /** The URL for the endpoint that will return the suggestions */
12
+ remote?: string | null;
13
+ }
14
+ /**
15
+ * As a user types, suggestions based on they've typed are displayed in a panel below. When a user
16
+ * clicks a suggestion, the value is updated. Under the hood, it is more or less a combination of a
17
+ * `TextInput` and a `DropdownPanel`.
18
+ *
19
+ * ## Request Methods
20
+ *
21
+ * At its most basic, the suggestions are a predefined array of `data`. However,
22
+ * if the `remote` prop is specified, the AutoSuggest will `GET` that endpoint as the user types.
23
+ * The following will be appended onto the query:
24
+ *
25
+ * ````
26
+ * ?search={value}
27
+ * ```
28
+ *
29
+ * The endpoint should then handle filtering the data, and returning an array of the results. If the
30
+ * value of the input changes before the previous `GET` request has completed, that one is
31
+ * cancelled and a new one started, with the updated search query.
32
+ *
33
+ * ## Data Formats
34
+ *
35
+ * The data returned should be one of two formats. The choice of format has an impact on how the
36
+ * value is stored, and the label that is displayed.
37
+ *
38
+ * The most basic format is an array of strings. The value is stored as the string itself, and the
39
+ * label displays the same string. This is most useful for situations where no relationships are
40
+ * required on the backend, and the `AutoSuggest` is purely being used to assist the user in
41
+ * defining a value.
42
+ *
43
+ * An example of this data would be:
44
+ *
45
+ * ```
46
+ * ['apple', 'banana', 'carrot']
47
+ * ```
48
+ *
49
+ * The second format is an array of objects. The value is stored as the `id` of the object, and the
50
+ * label displays the `name` of the object. This is most useful for situations where a relationship
51
+ * is required on the backend, and the `AutoSuggest` is being used to assist the user in defining
52
+ * a value. With this format, the `AutoSuggest` works more like a `Dropdown`.
53
+ *
54
+ * For example:
55
+ *
56
+ * ```
57
+ * [{ id: 1, name: 'apple' }, { id: 2, name: 'banana' }, { id: 3, name: 'carrot' }]
58
+ * ```
59
+ */
60
+ declare function AutoSuggest({ data, name, remote, value, hasError, onChange, }: AutoSuggestProps): React.ReactElement;
61
+ declare namespace AutoSuggest {
62
+ var propTypes: {
63
+ name: PropTypes.Validator<string>;
64
+ data: PropTypes.Requireable<NonNullable<NonNullable<string | NonNullable<PropTypes.InferProps<{
65
+ id: PropTypes.Validator<string>;
66
+ name: PropTypes.Validator<string>;
67
+ }>>>>[]>;
68
+ hasError: PropTypes.Requireable<boolean>;
69
+ remote: PropTypes.Requireable<string>;
70
+ value: PropTypes.Requireable<string>;
71
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
72
+ };
73
+ }
74
+ export default AutoSuggest;
@@ -0,0 +1,143 @@
1
+ 'use client';
2
+ import React, { useState } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { useAccessiblePanel, useClickOutside } from '@sqrzro/hooks';
5
+ import { ApiService } from '@sqrzro/utility';
6
+ import ErrorMessage from '../../components/ErrorMessage';
7
+ import TextInput from '../../components/TextInput';
8
+ import DropdownPanel from '../../core/DropdownPanel';
9
+ import InputPanel from '../../core/InputPanel';
10
+ // Import styles from './AutoSuggest.module.css';
11
+ const transformSuggestions = (data) => {
12
+ if (!data) {
13
+ return [];
14
+ }
15
+ return data.map((item) => (typeof item === 'object' ? item : { id: item, name: item }));
16
+ };
17
+ /**
18
+ * As a user types, suggestions based on they've typed are displayed in a panel below. When a user
19
+ * clicks a suggestion, the value is updated. Under the hood, it is more or less a combination of a
20
+ * `TextInput` and a `DropdownPanel`.
21
+ *
22
+ * ## Request Methods
23
+ *
24
+ * At its most basic, the suggestions are a predefined array of `data`. However,
25
+ * if the `remote` prop is specified, the AutoSuggest will `GET` that endpoint as the user types.
26
+ * The following will be appended onto the query:
27
+ *
28
+ * ````
29
+ * ?search={value}
30
+ * ```
31
+ *
32
+ * The endpoint should then handle filtering the data, and returning an array of the results. If the
33
+ * value of the input changes before the previous `GET` request has completed, that one is
34
+ * cancelled and a new one started, with the updated search query.
35
+ *
36
+ * ## Data Formats
37
+ *
38
+ * The data returned should be one of two formats. The choice of format has an impact on how the
39
+ * value is stored, and the label that is displayed.
40
+ *
41
+ * The most basic format is an array of strings. The value is stored as the string itself, and the
42
+ * label displays the same string. This is most useful for situations where no relationships are
43
+ * required on the backend, and the `AutoSuggest` is purely being used to assist the user in
44
+ * defining a value.
45
+ *
46
+ * An example of this data would be:
47
+ *
48
+ * ```
49
+ * ['apple', 'banana', 'carrot']
50
+ * ```
51
+ *
52
+ * The second format is an array of objects. The value is stored as the `id` of the object, and the
53
+ * label displays the `name` of the object. This is most useful for situations where a relationship
54
+ * is required on the backend, and the `AutoSuggest` is being used to assist the user in defining
55
+ * a value. With this format, the `AutoSuggest` works more like a `Dropdown`.
56
+ *
57
+ * For example:
58
+ *
59
+ * ```
60
+ * [{ id: 1, name: 'apple' }, { id: 2, name: 'banana' }, { id: 3, name: 'carrot' }]
61
+ * ```
62
+ */
63
+ function AutoSuggest({ data, name, remote, value, hasError, onChange, }) {
64
+ const [suggestions, setSuggestions] = useState(null);
65
+ const [isOpen, setIsOpen, node] = useClickOutside({ shouldHandleEnterKey: true });
66
+ const [isError, setIsError] = useState(false);
67
+ const [isLoading, setIsLoading] = useState(false);
68
+ const getLocalData = (search) => {
69
+ if (!data?.length) {
70
+ return;
71
+ }
72
+ const rgx = new RegExp(`^${search}.*`, 'iu');
73
+ const response = data.filter((item) => rgx.exec(typeof item === 'string' ? item : item.name));
74
+ setIsOpen(Boolean(response.length));
75
+ setSuggestions(response);
76
+ };
77
+ const getData = async (search) => {
78
+ if (!remote) {
79
+ getLocalData(search);
80
+ return;
81
+ }
82
+ setIsLoading(true);
83
+ try {
84
+ const response = await ApiService.get([remote, { search }], {
85
+ isCancellable: true,
86
+ });
87
+ setSuggestions(response.data);
88
+ }
89
+ catch (err) {
90
+ setIsError(true);
91
+ }
92
+ setIsLoading(false);
93
+ setIsOpen(true);
94
+ };
95
+ const handleChange = (event) => {
96
+ if (onChange) {
97
+ onChange(event);
98
+ }
99
+ if (!event.target.value) {
100
+ setIsOpen(false);
101
+ return;
102
+ }
103
+ void getData(event.target.value);
104
+ };
105
+ const handleSuggest = (item) => {
106
+ const simpleEvent = {
107
+ target: { name, value: item.id },
108
+ };
109
+ if (onChange) {
110
+ onChange(simpleEvent);
111
+ }
112
+ setIsOpen(false);
113
+ };
114
+ if (isError) {
115
+ return React.createElement(ErrorMessage, { isMini: true });
116
+ }
117
+ const transformed = transformSuggestions(suggestions);
118
+ const { handleKeyboard } = useAccessiblePanel({
119
+ data: transformed,
120
+ name,
121
+ onChange,
122
+ value,
123
+ });
124
+ return (React.createElement("div", { ref: node, className: "/*clsx(styles.root, isOpen && styles.rootOpen)*/" },
125
+ React.createElement(TextInput, { hasError: hasError, isAutocomplete: false, isLoading: isLoading, name: name, onChange: handleChange, onKeyDown: handleKeyboard, value: value }),
126
+ isOpen && suggestions && suggestions.length ? (React.createElement(InputPanel, { isScrollable: true },
127
+ React.createElement(DropdownPanel, { data: transformed, name: name, onChange: ({ item }) => handleSuggest(item), value: value }))) : null));
128
+ }
129
+ AutoSuggest.propTypes = {
130
+ name: PropTypes.string.isRequired,
131
+ data: PropTypes.arrayOf(PropTypes.oneOfType([
132
+ PropTypes.string.isRequired,
133
+ PropTypes.shape({
134
+ id: PropTypes.string.isRequired,
135
+ name: PropTypes.string.isRequired,
136
+ }).isRequired,
137
+ ]).isRequired),
138
+ hasError: PropTypes.bool,
139
+ remote: PropTypes.string,
140
+ value: PropTypes.string,
141
+ onChange: PropTypes.func,
142
+ };
143
+ export default AutoSuggest;
@@ -0,0 +1,11 @@
1
+ import type { ComponentMeta } from '@storybook/react';
2
+ import Button from './index';
3
+ declare const _default: ComponentMeta<typeof Button>;
4
+ export default _default;
5
+ export declare const Basic: any;
6
+ export declare const Danger: any;
7
+ export declare const Bordered: any;
8
+ export declare const BorderedDanger: any;
9
+ export declare const FullWidth: any;
10
+ export declare const Disabled: any;
11
+ export declare const Loading: any;
@@ -1,39 +1,41 @@
1
1
  import React from 'react';
2
- import type { Story } from '@storybook/react';
3
-
4
2
  import Button from './index';
5
- import type { ButtonProps } from './index';
6
-
7
3
  export default {
8
4
  title: 'Components/Button',
9
5
  component: Button,
10
6
  };
11
-
12
- const Template: Story<ButtonProps> = (props) => <Button {...props} />;
13
-
7
+ const Template = (args) => (React.createElement(Button, { ...args }));
14
8
  export const Basic = Template.bind({});
15
-
16
9
  Basic.args = {
17
10
  children: 'Lorem Ipsum',
18
11
  };
19
-
20
12
  export const Danger = Template.bind({});
21
-
22
13
  Danger.args = {
23
14
  children: 'Lorem Ipsum',
24
15
  variant: 'danger',
25
16
  };
26
-
27
17
  export const Bordered = Template.bind({});
28
-
29
18
  Bordered.args = {
30
19
  children: 'Lorem Ipsum',
31
20
  variant: 'bordered',
32
21
  };
33
-
22
+ export const BorderedDanger = Template.bind({});
23
+ BorderedDanger.args = {
24
+ children: 'Lorem Ipsum',
25
+ variant: ['bordered', 'danger'],
26
+ };
27
+ export const FullWidth = Template.bind({});
28
+ FullWidth.args = {
29
+ children: 'Lorem Ipsum',
30
+ isFullWidth: true,
31
+ };
34
32
  export const Disabled = Template.bind({});
35
-
36
33
  Disabled.args = {
37
34
  children: 'Lorem Ipsum',
38
35
  isDisabled: true,
39
36
  };
37
+ export const Loading = Template.bind({});
38
+ Loading.args = {
39
+ children: 'Lorem Ipsum',
40
+ isLoading: true,
41
+ };
@@ -1,36 +1,49 @@
1
- import React from 'react';
2
- import type { ButtonVariant } from '../../utility/interfaces';
3
- export interface ButtonProps {
4
- /** Probably the button text, but could be any HTML element or React component */
5
- children: React.ReactNode;
6
- /** If set to true, the Button will be greyed out and non-interactive */
7
- isDisabled?: boolean | null;
8
- isFullWidth?: boolean | null;
9
- onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
10
- /** If specified, the Button will be created as a Link element. */
11
- to?: string;
12
- /** The type of button. Button's with a type of `submit` will submit a parent form */
13
- type?: 'button' | 'submit';
14
- /** With the exception of `bordered` these variants correspond to the theme colours */
15
- variant?: ButtonVariant | ButtonVariant[];
16
- }
17
- /**
18
- * Either a `Link` component or a `button` element, depending on whether a `to` prop is specified.
19
- *
20
- * As a `Link`, it provides navigation between pages, and as a `button` it will handle the
21
- * `onClick` function when clicked (if one is specified).
22
- *
23
- * ## to & onClick
24
- *
25
- * Although it is possible to omit both the `to` and `onClick` props, there will
26
- * be nearly zero situations where this would be useful. It is also possible to include both props.
27
- * This will create a `Link` component, and handle the `onClick` function before navigation.
28
- *
29
- * ## Styles
30
- *
31
- * The `Button` will stretch to the full width of its parent element. If you wish to have a smaller
32
- * width, you can wrap it in a `div`, and then wrap that `div` in a component with a flex property.
33
- * Components like `ListActions` and `ModalActions` do this for you.
34
- */
35
- declare const Button: React.FunctionComponent<ButtonProps>;
36
- export default Button;
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import type { ButtonVariant } from '../../utility/interfaces';
4
+ export interface ButtonProps {
5
+ /** Probably the button text, but could be any HTML element or React component */
6
+ children: React.ReactNode;
7
+ /** If set to true, the Button will be greyed out and non-interactive */
8
+ isDisabled?: boolean | null;
9
+ isFullWidth?: boolean | null;
10
+ isLoading?: boolean | null;
11
+ onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
12
+ /** If specified, the Button will be created as a Link element. */
13
+ to?: string;
14
+ /** The type of button. Button's with a type of `submit` will submit a parent form */
15
+ type?: 'button' | 'submit';
16
+ /** With the exception of `bordered` these variants correspond to the theme colours */
17
+ variant?: ButtonVariant | ButtonVariant[];
18
+ }
19
+ /**
20
+ * Either a `Link` component or a `button` element, depending on whether a `to` prop is specified.
21
+ *
22
+ * As a `Link`, it provides navigation between pages, and as a `button` it will handle the
23
+ * `onClick` function when clicked (if one is specified).
24
+ *
25
+ * ## to & onClick
26
+ *
27
+ * Although it is possible to omit both the `to` and `onClick` props, there will
28
+ * be nearly zero situations where this would be useful. It is also possible to include both props.
29
+ * This will create a `Link` component, and handle the `onClick` function before navigation.
30
+ *
31
+ * ## Styles
32
+ *
33
+ * The `Button` will stretch to the full width of its parent element. If you wish to have a smaller
34
+ * width, you can wrap it in a `div`, and then wrap that `div` in a component with a flex property.
35
+ * Components like `ListActions` and `ModalActions` do this for you.
36
+ */
37
+ declare function Button({ to, children, type, variant, isDisabled, isFullWidth, isLoading, onClick, }: ButtonProps): React.ReactElement;
38
+ declare namespace Button {
39
+ var propTypes: {
40
+ children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
41
+ isDisabled: PropTypes.Requireable<boolean>;
42
+ isFullWidth: PropTypes.Requireable<boolean>;
43
+ to: PropTypes.Requireable<string>;
44
+ type: PropTypes.Requireable<string>;
45
+ variant: PropTypes.Requireable<NonNullable<NonNullable<ButtonVariant> | NonNullable<ButtonVariant>[] | null | undefined>>;
46
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
47
+ };
48
+ }
49
+ export default Button;
@@ -0,0 +1,50 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import clsx from 'clsx';
4
+ import PropTypes from 'prop-types';
5
+ import Link from '../../components/Link';
6
+ import Loader from '../../core/Loader';
7
+ import useVariant from '../../hooks/useVariant';
8
+ import { ButtonVariantPropType } from '../../utility/prop-types';
9
+ /**
10
+ * Either a `Link` component or a `button` element, depending on whether a `to` prop is specified.
11
+ *
12
+ * As a `Link`, it provides navigation between pages, and as a `button` it will handle the
13
+ * `onClick` function when clicked (if one is specified).
14
+ *
15
+ * ## to & onClick
16
+ *
17
+ * Although it is possible to omit both the `to` and `onClick` props, there will
18
+ * be nearly zero situations where this would be useful. It is also possible to include both props.
19
+ * This will create a `Link` component, and handle the `onClick` function before navigation.
20
+ *
21
+ * ## Styles
22
+ *
23
+ * The `Button` will stretch to the full width of its parent element. If you wish to have a smaller
24
+ * width, you can wrap it in a `div`, and then wrap that `div` in a component with a flex property.
25
+ * Components like `ListActions` and `ModalActions` do this for you.
26
+ */
27
+ function Button({ to, children, type, variant, isDisabled, isFullWidth, isLoading, onClick, }) {
28
+ const { applyVariantClassName } = useVariant(variant);
29
+ const className = clsx('text-white bg-blue-500 focus:ring-4 focus:outline-none focus:ring-cyan-300 dark:focus:ring-cyan-800 font-medium rounded-md text-sm px-5 py-2.5 text-center mr-2 mb-2', {
30
+ 'opacity-30 pointer-events-none': isDisabled || isLoading,
31
+ 'w-full': isFullWidth,
32
+ }, applyVariantClassName({ danger: 'bg-red-900' }));
33
+ if (to) {
34
+ return (React.createElement(Link, { className: className, onClick: onClick, to: to }, children));
35
+ }
36
+ return (React.createElement("button", { className: className, disabled: isDisabled || isLoading || false, onClick: onClick, type: type === 'submit' ? 'submit' : 'button' },
37
+ isLoading ? (React.createElement("div", { className: "absolute left-1/2 top-1/2 -translate-x-2/4 -translate-y-2/4" },
38
+ React.createElement(Loader, { isMini: true }))) : null,
39
+ children));
40
+ }
41
+ Button.propTypes = {
42
+ children: PropTypes.node.isRequired,
43
+ isDisabled: PropTypes.bool,
44
+ isFullWidth: PropTypes.bool,
45
+ to: PropTypes.string,
46
+ type: PropTypes.oneOf(['button', 'submit']),
47
+ variant: ButtonVariantPropType,
48
+ onClick: PropTypes.func,
49
+ };
50
+ export default Button;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import type { InputProps } from '../../utility/interfaces';
4
+ export interface CalendarInputProps extends InputProps<string> {
5
+ disabledDates?: string[] | ((date: string) => boolean);
6
+ isOptional?: boolean;
7
+ isPanelOnly?: boolean;
8
+ isRange?: boolean;
9
+ }
10
+ declare function CalendarInput({ disabledDates, hasError, isDisabled, isOptional, isPanelOnly, isRange, name, value, onChange, }: CalendarInputProps): React.ReactElement;
11
+ declare namespace CalendarInput {
12
+ var propTypes: {
13
+ name: PropTypes.Validator<string>;
14
+ disabledDates: PropTypes.Requireable<NonNullable<string[] | ((...args: any[]) => any) | null | undefined>>;
15
+ hasError: PropTypes.Requireable<boolean>;
16
+ isDisabled: PropTypes.Requireable<boolean>;
17
+ isOptional: PropTypes.Requireable<boolean>;
18
+ isPanelOnly: PropTypes.Requireable<boolean>;
19
+ isRange: PropTypes.Requireable<boolean>;
20
+ value: PropTypes.Requireable<string>;
21
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
22
+ };
23
+ }
24
+ export default CalendarInput;
@@ -0,0 +1,54 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import FormatService from '../../services/FormatService';
5
+ import Calendar from '../../core/Calendar';
6
+ import InputPanel from '../../core/InputPanel';
7
+ import StaticTextInput from '../../core/StaticTextInput';
8
+ import { useClickOutside } from '@sqrzro/hooks';
9
+ const formatLabel = (value, isRange) => {
10
+ if (!value || typeof value !== 'string') {
11
+ return '';
12
+ }
13
+ if (!isRange) {
14
+ return FormatService.date(value);
15
+ }
16
+ const splitValues = value.split(',');
17
+ if (splitValues[0] === splitValues[1]) {
18
+ return FormatService.date(splitValues[0]);
19
+ }
20
+ return splitValues.map((item) => FormatService.date(item)).join(' - ');
21
+ };
22
+ function CalendarInput({ disabledDates, hasError, isDisabled, isOptional, isPanelOnly, isRange, name, value, onChange, }) {
23
+ const [isOpen, setIsOpen, node] = useClickOutside();
24
+ const toggleIsOpen = () => setIsOpen(!isOpen);
25
+ const handleChange = (event) => {
26
+ if (onChange) {
27
+ onChange(event);
28
+ }
29
+ setIsOpen(false);
30
+ };
31
+ const label = formatLabel(value, isRange);
32
+ if (isPanelOnly) {
33
+ return (React.createElement(Calendar, { disabledDates: disabledDates, isRange: isRange, name: name, onChange: handleChange, value: value || '' }));
34
+ }
35
+ return (React.createElement("div", { ref: node, className: "/*clsx(styles.root, isOpen && styles.rootIsOpen)*/" },
36
+ React.createElement(StaticTextInput, { hasError: hasError, icon: "calendar", isDisabled: isDisabled, isOptional: isOptional, label: label, name: name, onChange: handleChange, onClick: toggleIsOpen, value: value || '' }),
37
+ isOpen && !isDisabled ? (React.createElement(InputPanel, null,
38
+ React.createElement(Calendar, { disabledDates: disabledDates, isRange: isRange, name: name, onChange: handleChange, value: value || '' }))) : null));
39
+ }
40
+ CalendarInput.propTypes = {
41
+ name: PropTypes.string.isRequired,
42
+ disabledDates: PropTypes.oneOfType([
43
+ PropTypes.arrayOf(PropTypes.string.isRequired),
44
+ PropTypes.func,
45
+ ]),
46
+ hasError: PropTypes.bool,
47
+ isDisabled: PropTypes.bool,
48
+ isOptional: PropTypes.bool,
49
+ isPanelOnly: PropTypes.bool,
50
+ isRange: PropTypes.bool,
51
+ value: PropTypes.string,
52
+ onChange: PropTypes.func,
53
+ };
54
+ export default CalendarInput;
@@ -1,17 +1,17 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import type { ChkRadDataItem } from '../../core/ChkRadList';
4
- import type { InputProps } from '../../utility/interfaces';
5
- interface CheckboxListProps extends InputProps<string[]> {
6
- columns?: number;
7
- data: ChkRadDataItem[];
8
- }
9
- declare const CheckboxList: {
10
- ({ name, onChange, value, ...props }: CheckboxListProps): React.ReactElement;
11
- propTypes: {
12
- name: PropTypes.Validator<string>;
13
- value: PropTypes.Requireable<string[]>;
14
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
15
- };
16
- };
17
- export default CheckboxList;
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import type { ChkRadDataItem } from '../../core/ChkRadList';
4
+ import type { InputProps } from '../../utility/interfaces';
5
+ interface CheckboxListProps extends InputProps<string[]> {
6
+ columns?: number;
7
+ data: ChkRadDataItem[];
8
+ }
9
+ declare function CheckboxList({ name, onChange, value, ...props }: CheckboxListProps): React.ReactElement;
10
+ declare namespace CheckboxList {
11
+ var propTypes: {
12
+ name: PropTypes.Validator<string>;
13
+ value: PropTypes.Requireable<string[]>;
14
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
15
+ };
16
+ }
17
+ export default CheckboxList;
@@ -0,0 +1,25 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { toggleArrayItem } from '@sqrzro/utility';
5
+ import ChkRadList from '../../core/ChkRadList';
6
+ function CheckboxList({ name, onChange, value, ...props }) {
7
+ const handleChange = (event) => {
8
+ if (!onChange) {
9
+ return;
10
+ }
11
+ const newArray = toggleArrayItem(value || [], event.target.value);
12
+ const simpleEvent = {
13
+ item: event.item,
14
+ target: { name, value: newArray },
15
+ };
16
+ onChange(simpleEvent);
17
+ };
18
+ return (React.createElement(ChkRadList, { ...props, name: `${name}[]`, onChange: handleChange, type: "checkbox", value: value }));
19
+ }
20
+ CheckboxList.propTypes = {
21
+ name: PropTypes.string.isRequired,
22
+ value: PropTypes.arrayOf(PropTypes.string.isRequired),
23
+ onChange: PropTypes.func,
24
+ };
25
+ export default CheckboxList;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { InputProps } from '../../utility/interfaces';
3
+ interface CodeInputProps extends InputProps<string> {
4
+ isAutoFocus?: boolean;
5
+ onFinalChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
6
+ size?: number;
7
+ }
8
+ declare function CodeInput({ hasError, id, isAutoFocus, isDisabled, name, onChange, onFinalChange, size, value, }: CodeInputProps): React.ReactElement;
9
+ export default CodeInput;