@sqrzro/ui 4.0.0-alpha.7 → 4.0.0-alpha.71

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 (301) 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 +13 -0
  51. package/dist/components/elements/InfoPanel/index.js +20 -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 +14 -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 +12 -0
  150. package/dist/forms/components/EditableFormFields/index.js +44 -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 +22 -2
  158. package/dist/forms/components/FormFields/index.js +44 -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/ImageInput/index.d.ts +17 -0
  162. package/dist/forms/components/ImageInput/index.js +46 -0
  163. package/dist/forms/components/ImageInputPanel/index.d.ts +10 -0
  164. package/dist/forms/components/ImageInputPanel/index.js +34 -0
  165. package/dist/forms/components/ModalForm/index.d.ts +3 -2
  166. package/dist/forms/components/ModalForm/index.js +5 -4
  167. package/dist/forms/components/NumberInput/index.d.ts +1 -1
  168. package/dist/forms/components/PasswordComplexity/index.d.ts +16 -0
  169. package/dist/forms/components/PasswordComplexity/index.js +14 -0
  170. package/dist/forms/components/PasswordComplexityItem/index.d.ts +8 -0
  171. package/dist/forms/components/PasswordComplexityItem/index.js +10 -0
  172. package/dist/forms/components/PasswordInput/index.d.ts +1 -1
  173. package/dist/forms/components/PasswordInput/index.js +6 -6
  174. package/dist/forms/components/PointsInput/index.d.ts +5 -0
  175. package/dist/forms/components/{MoneyInput → PointsInput}/index.js +3 -3
  176. package/dist/forms/components/RangeCalendarInput/index.d.ts +6 -0
  177. package/dist/forms/components/RangeCalendarInput/index.js +14 -0
  178. package/dist/forms/components/StaticTextInput/index.d.ts +2 -2
  179. package/dist/forms/components/StaticTextInput/index.js +6 -7
  180. package/dist/forms/components/Switch/index.d.ts +9 -3
  181. package/dist/forms/components/Switch/index.js +7 -5
  182. package/dist/forms/components/TextArea/index.d.ts +14 -0
  183. package/dist/forms/components/TextArea/index.js +15 -0
  184. package/dist/forms/components/TextInput/index.d.ts +1 -1
  185. package/dist/forms/components/TextInput/index.js +5 -4
  186. package/dist/forms/hooks/useAutocomplete.d.ts +8 -6
  187. package/dist/forms/hooks/useAutocomplete.js +4 -4
  188. package/dist/forms/hooks/useDropdown.d.ts +5 -7
  189. package/dist/forms/hooks/useDropdown.js +5 -5
  190. package/dist/forms/hooks/useEditableDropdown.d.ts +4 -0
  191. package/dist/forms/hooks/useEditableDropdown.js +6 -0
  192. package/dist/forms/hooks/useEditableForm.js +8 -1
  193. package/dist/forms/hooks/useForm.d.ts +7 -14
  194. package/dist/forms/hooks/useForm.js +25 -27
  195. package/dist/forms/hooks/useModalForm.d.ts +2 -2
  196. package/dist/forms/hooks/useModalForm.js +9 -2
  197. package/dist/forms/index.d.ts +22 -6
  198. package/dist/forms/index.js +9 -4
  199. package/dist/forms/interfaces.d.ts +8 -1
  200. package/dist/forms/utility/extract-input-props.js +1 -0
  201. package/dist/forms/utility/format-date-value.d.ts +2 -0
  202. package/dist/forms/utility/format-date-value.js +13 -0
  203. package/dist/forms/utility/format-file-size.d.ts +2 -0
  204. package/dist/forms/utility/format-file-size.js +11 -0
  205. package/dist/forms/utility/preprocess-image.d.ts +6 -0
  206. package/dist/forms/utility/preprocess-image.js +58 -0
  207. package/dist/hooks/index.d.ts +3 -0
  208. package/dist/hooks/index.js +3 -0
  209. package/dist/hooks/useConfirmable.d.ts +21 -0
  210. package/dist/hooks/useConfirmable.js +58 -0
  211. package/dist/hooks/useDownload.d.ts +2 -0
  212. package/dist/hooks/useDownload.js +18 -0
  213. package/dist/hooks/usePopover.d.ts +12 -0
  214. package/dist/hooks/usePopover.js +24 -0
  215. package/dist/hooks/useSelected.d.ts +12 -0
  216. package/dist/hooks/useSelected.js +35 -0
  217. package/dist/hooks/useServerAction.d.ts +10 -0
  218. package/dist/hooks/useServerAction.js +17 -0
  219. package/dist/hooks/useSuccess.d.ts +10 -0
  220. package/dist/hooks/useSuccess.js +22 -0
  221. package/dist/mail/Mail/index.d.ts +8 -0
  222. package/dist/mail/Mail/index.js +108 -0
  223. package/dist/mail/MailBlock/index.d.ts +5 -0
  224. package/dist/mail/MailBlock/index.js +5 -0
  225. package/dist/mail/MailButton/index.d.ts +8 -0
  226. package/dist/mail/MailButton/index.js +28 -0
  227. package/dist/mail/MailTable/index.d.ts +9 -0
  228. package/dist/mail/MailTable/index.js +7 -0
  229. package/dist/mail/index.d.ts +8 -0
  230. package/dist/mail/index.js +4 -0
  231. package/dist/mail/utility/convert-to-datauri.d.ts +2 -0
  232. package/dist/mail/utility/convert-to-datauri.js +37 -0
  233. package/dist/mail/utility/interfaces.d.ts +23 -0
  234. package/dist/mail/utility/mail-config.d.ts +4 -0
  235. package/dist/mail/utility/mail-config.js +42 -0
  236. package/dist/navigation/components/AppNavigation/index.d.ts +3 -1
  237. package/dist/navigation/components/AppNavigation/index.js +4 -4
  238. package/dist/navigation/components/AppNavigationItem/index.d.ts +5 -3
  239. package/dist/navigation/components/AppNavigationItem/index.js +16 -7
  240. package/dist/navigation/components/Tabs/index.js +1 -4
  241. package/dist/navigation/hooks/useNavigation.d.ts +3 -3
  242. package/dist/navigation/hooks/useNavigation.js +5 -5
  243. package/dist/styles/classnames/config.d.ts +93 -0
  244. package/dist/styles/classnames/config.js +1 -0
  245. package/dist/styles/classnames/interfaces.d.ts +56 -0
  246. package/dist/styles/classnames/interfaces.js +1 -0
  247. package/dist/styles/classnames/utility/apply-sizes.d.ts +3 -0
  248. package/dist/styles/classnames/utility/apply-sizes.js +21 -0
  249. package/dist/styles/classnames/utility/apply-variants.d.ts +3 -0
  250. package/dist/styles/classnames/utility/apply-variants.js +26 -0
  251. package/dist/styles/classnames/utility/is-classname-object.d.ts +3 -0
  252. package/dist/styles/classnames/utility/is-classname-object.js +7 -0
  253. package/dist/styles/classnames/utility/parse-classnames.d.ts +6 -0
  254. package/dist/styles/classnames/utility/parse-classnames.js +33 -0
  255. package/dist/styles/context.d.ts +28 -0
  256. package/dist/styles/context.js +19 -0
  257. package/dist/styles/icons/config.d.ts +28 -0
  258. package/dist/styles/icons/config.js +1 -0
  259. package/dist/styles/icons/interfaces.d.ts +4 -0
  260. package/dist/styles/icons/interfaces.js +1 -0
  261. package/dist/styles/index.d.ts +6 -2
  262. package/dist/styles/index.js +2 -1
  263. package/dist/styles/styles.css +60 -0
  264. package/dist/utility/compare-dates.d.ts +2 -0
  265. package/dist/utility/compare-dates.js +13 -0
  266. package/dist/utility/get-date-state.d.ts +8 -0
  267. package/dist/utility/get-date-state.js +63 -0
  268. package/dist/utility/get-days.d.ts +2 -0
  269. package/dist/utility/get-days.js +5 -0
  270. package/dist/utility/get-weeks.d.ts +2 -0
  271. package/dist/utility/get-weeks.js +31 -0
  272. package/dist/utility/index.d.ts +1 -1
  273. package/dist/utility/interfaces.d.ts +33 -17
  274. package/dist/utility/is-data-object-array.d.ts +3 -0
  275. package/dist/utility/is-data-object-array.js +5 -0
  276. package/dist/utility/is-data-object.d.ts +3 -0
  277. package/dist/utility/is-data-object.js +4 -0
  278. package/package.json +34 -22
  279. package/dist/components/buttons/ConfirmableButton/index.d.ts +0 -7
  280. package/dist/components/buttons/ConfirmableButton/index.js +0 -13
  281. package/dist/components/collections/utility/filter-columns.d.ts +0 -3
  282. package/dist/components/collections/utility/filter-columns.js +0 -8
  283. package/dist/components/collections/utility/get-selected-from-search-params.d.ts +0 -2
  284. package/dist/components/collections/utility/get-selected-from-search-params.js +0 -5
  285. package/dist/components/collections/utility/set-selected-to-search-params.d.ts +0 -2
  286. package/dist/components/collections/utility/set-selected-to-search-params.js +0 -4
  287. package/dist/components/utility/ClassNames/index.d.ts +0 -6
  288. package/dist/components/utility/ClassNames/index.js +0 -7
  289. package/dist/components/utility/Page/index.d.ts +0 -18
  290. package/dist/components/utility/Page/index.js +0 -34
  291. package/dist/components/utility/RootLayout/index.d.ts +0 -15
  292. package/dist/components/utility/RootLayout/index.js +0 -14
  293. package/dist/forms/components/MoneyInput/index.d.ts +0 -5
  294. package/dist/styles/config.d.ts +0 -64
  295. package/dist/styles/config.js +0 -43
  296. package/dist/styles/icons.d.ts +0 -15
  297. package/dist/styles/icons.js +0 -7
  298. package/dist/styles/interfaces.d.ts +0 -41
  299. /package/dist/{styles → mail/utility}/interfaces.js +0 -0
  300. /package/dist/styles/{tw.d.ts → classnames/utility/tw.d.ts} +0 -0
  301. /package/dist/styles/{tw.js → classnames/utility/tw.js} +0 -0
@@ -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,93 @@
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 { ImageInputClassNames } from '../../forms/components/ImageInput';
38
+ import type { PasswordComplexityClassNames } from '../../forms/components/PasswordComplexity';
39
+ import type { PasswordInputClassNames } from '../../forms/components/PasswordInput';
40
+ import type { StaticTextInputClassNames } from '../../forms/components/StaticTextInput';
41
+ import type { SwitchClassNames } from '../../forms/components/Switch';
42
+ import type { TextInputClassNames } from '../../forms/components/TextInput';
43
+ import type { TextAreaClassNames } from '../../forms/components/TextArea';
44
+ import type { AppNavigationClassNames } from '../../navigation/components/AppNavigation';
45
+ import type { TabsClassNames } from '../../navigation/components/Tabs';
46
+ import type { ComponentClassNames } from './interfaces';
47
+ export interface UIClassNames {
48
+ actionList?: ComponentClassNames<ActionListClassNames>;
49
+ appError?: ComponentClassNames<AppErrorClassNames>;
50
+ appNavigation?: ComponentClassNames<AppNavigationClassNames>;
51
+ badge?: ComponentClassNames<BadgeClassNames>;
52
+ button?: ComponentClassNames<ButtonClassNames>;
53
+ calendar?: ComponentClassNames<CalendarClassNames>;
54
+ colorInput?: ComponentClassNames<ColorInputClassNames>;
55
+ container?: ComponentClassNames<ContainerClassNames>;
56
+ csvInput?: ComponentClassNames<CSVInputClassNames>;
57
+ dataTable?: ComponentClassNames<DataTableClassNames>;
58
+ definitionList?: ComponentClassNames<DefinitionListClassNames>;
59
+ dropdown?: ComponentClassNames<DropdownClassNames>;
60
+ editableForm?: ComponentClassNames<EditableFormClassNames>;
61
+ editableFormField?: ComponentClassNames<EditableFormFieldClassNames>;
62
+ emptyMessage?: ComponentClassNames<EmptyMessageClassNames>;
63
+ filterBar?: ComponentClassNames<FilterBarClassNames>;
64
+ filterClear?: ComponentClassNames<FilterClearButtonClassNames>;
65
+ filterItem?: ComponentClassNames<FilterItemClassNames>;
66
+ filterPanel?: ComponentClassNames<FilterPanelClassNames>;
67
+ filterSearch?: ComponentClassNames<SearchFilterClassNames>;
68
+ form?: ComponentClassNames<FormClassNames>;
69
+ formField?: ComponentClassNames<FormFieldClassNames>;
70
+ imageInput?: ComponentClassNames<ImageInputClassNames>;
71
+ infoPanel?: ComponentClassNames<InfoPanelClassNames>;
72
+ link?: ComponentClassNames<LinkClassNames>;
73
+ list?: ComponentClassNames<ListClassNames>;
74
+ listItem?: ComponentClassNames<ListItemClassNames>;
75
+ listItemMeta?: ComponentClassNames<ListItemMetaClassNames>;
76
+ loader?: ComponentClassNames<LoaderClassNames>;
77
+ menu?: ComponentClassNames<MenuClassNames>;
78
+ modal?: ComponentClassNames<ModalClassNames>;
79
+ pagination?: ComponentClassNames<PaginationClassNames>;
80
+ passwordComplexity?: ComponentClassNames<PasswordComplexityClassNames>;
81
+ passwordInput?: ComponentClassNames<PasswordInputClassNames>;
82
+ popover?: ComponentClassNames<PopoverClassNames>;
83
+ reference?: ComponentClassNames<ReferenceClassNames>;
84
+ staticTextInput?: ComponentClassNames<StaticTextInputClassNames>;
85
+ summary?: ComponentClassNames<SummaryClassNames>;
86
+ switch?: ComponentClassNames<SwitchClassNames>;
87
+ table?: ComponentClassNames<TableClassNames>;
88
+ tabs?: ComponentClassNames<TabsClassNames>;
89
+ textArea?: ComponentClassNames<TextAreaClassNames>;
90
+ textButton?: ComponentClassNames<TextButtonClassNames>;
91
+ textInput?: ComponentClassNames<TextInputClassNames>;
92
+ toast?: ComponentClassNames<ToastClassNames>;
93
+ }
@@ -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;
@@ -0,0 +1,21 @@
1
+ const keyMap = {
2
+ extraSmall: 'isExtraSmall',
3
+ small: 'isSmall',
4
+ medium: 'isMedium',
5
+ large: 'isLarge',
6
+ extraLarge: 'isExtraLarge',
7
+ };
8
+ function applySizes(sizes) {
9
+ if (!sizes) {
10
+ return {};
11
+ }
12
+ const sizeArray = Array.isArray(sizes) ? sizes : [sizes];
13
+ return sizeArray.reduce((acc, size) => {
14
+ const key = keyMap[size];
15
+ if (key) {
16
+ acc[key] = true;
17
+ }
18
+ return acc;
19
+ }, {});
20
+ }
21
+ export default applySizes;
@@ -0,0 +1,3 @@
1
+ import type { StyleVariant } from '../../../utility/interfaces';
2
+ declare function applyVariants(variants?: StyleVariant[] | StyleVariant | null): Record<string, boolean>;
3
+ export default applyVariants;
@@ -0,0 +1,26 @@
1
+ const keyMap = {
2
+ bordered: 'isBordered',
3
+ danger: 'isDanger',
4
+ error: 'isError',
5
+ hollow: 'isHollow',
6
+ info: 'isInfo',
7
+ primary: 'isPrimary',
8
+ secondary: 'isSecondary',
9
+ success: 'isSuccess',
10
+ tertiary: 'isTertiary',
11
+ warning: 'isWarning',
12
+ };
13
+ function applyVariants(variants) {
14
+ if (!variants) {
15
+ return {};
16
+ }
17
+ const variantArray = Array.isArray(variants) ? variants : [variants];
18
+ return variantArray.reduce((acc, variant) => {
19
+ const key = keyMap[variant];
20
+ if (key) {
21
+ acc[key] = true;
22
+ }
23
+ return acc;
24
+ }, {});
25
+ }
26
+ export default applyVariants;
@@ -0,0 +1,3 @@
1
+ import type { ClassNameObject } from '../interfaces';
2
+ declare function isClassNameObject(value: unknown): value is ClassNameObject;
3
+ export default isClassNameObject;
@@ -0,0 +1,7 @@
1
+ function isClassNameObject(value) {
2
+ return (typeof value === 'object' &&
3
+ value !== null &&
4
+ 'default' in value &&
5
+ typeof value.default === 'string');
6
+ }
7
+ export default isClassNameObject;
@@ -0,0 +1,6 @@
1
+ import type { ExtractClassNames } from '../interfaces';
2
+ declare function parseClassNames<T>(classNames: T, config?: {
3
+ props?: Record<string, boolean>;
4
+ states?: Record<string, boolean>;
5
+ }, overrides?: T): ExtractClassNames<T>;
6
+ export default parseClassNames;
@@ -0,0 +1,33 @@
1
+ import { getEntries } from '@sqrzro/utility';
2
+ import tw from '../utility/tw';
3
+ import isClassNameObject from './is-classname-object';
4
+ function parseClassNames(classNames, config, overrides) {
5
+ if (!classNames) {
6
+ return {};
7
+ }
8
+ const overridden = { ...classNames, ...overrides };
9
+ return getEntries(overridden).reduce((acc, [key, value]) => {
10
+ if (typeof value === 'string') {
11
+ return { ...acc, [key]: value };
12
+ }
13
+ if (isClassNameObject(value)) {
14
+ const { default: defaultClassName, props, states } = value;
15
+ const propClassNames = props
16
+ ? Object.keys(props)
17
+ .filter((key) => config?.props?.[key])
18
+ .map((key) => props[key])
19
+ : [];
20
+ const stateClassNames = states
21
+ ? Object.keys(states)
22
+ .filter((key) => config?.states?.[key])
23
+ .map((key) => states[key])
24
+ : [];
25
+ return {
26
+ ...acc,
27
+ [key]: tw(defaultClassName, ...propClassNames, ...stateClassNames),
28
+ };
29
+ }
30
+ return acc;
31
+ }, {});
32
+ }
33
+ export default parseClassNames;
@@ -0,0 +1,28 @@
1
+ import { UIClassNames } from './classnames/config';
2
+ import { UIIcons } from './icons/config';
3
+ import type { ExtractClassNames } from './classnames/interfaces';
4
+ declare function createUIContext<TClassNames extends object, TIcons extends object>(): {
5
+ UIProvider: ({ data, children }: {
6
+ data: {
7
+ classNames: TClassNames;
8
+ icons: TIcons;
9
+ };
10
+ children: React.ReactNode;
11
+ }) => import("react").JSX.Element;
12
+ useClassNames: <K extends keyof TClassNames>(component: K, config?: {
13
+ props?: Record<string, boolean>;
14
+ states?: Record<string, boolean>;
15
+ }, overrides?: TClassNames[K]) => ExtractClassNames<TClassNames[K]>;
16
+ useIcon: <K extends keyof TIcons>(component: K) => TIcons[K];
17
+ };
18
+ export declare const UIProvider: ({ data, children }: {
19
+ data: {
20
+ classNames: UIClassNames;
21
+ icons: UIIcons;
22
+ };
23
+ children: React.ReactNode;
24
+ }) => import("react").JSX.Element, useClassNames: <K extends keyof UIClassNames>(component: K, config?: {
25
+ props?: Record<string, boolean>;
26
+ states?: Record<string, boolean>;
27
+ } | undefined, overrides?: UIClassNames[K] | undefined) => ExtractClassNames<UIClassNames[K]>, useIcon: <K extends keyof UIIcons>(component: K) => UIIcons[K];
28
+ export default createUIContext;
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { createContext, useContext } from 'react';
4
+ import parseClassNames from './classnames/utility/parse-classnames';
5
+ function createUIContext() {
6
+ const UIContext = createContext({});
7
+ const UIProvider = ({ data, children }) => (_jsx(UIContext.Provider, { value: data, children: children }));
8
+ function useClassNames(component, config, overrides) {
9
+ const ctx = useContext(UIContext);
10
+ return parseClassNames(ctx.classNames[component], config, overrides);
11
+ }
12
+ function useIcon(component) {
13
+ const ctx = useContext(UIContext);
14
+ return ctx.icons[component];
15
+ }
16
+ return { UIProvider, useClassNames, useIcon };
17
+ }
18
+ export const { UIProvider, useClassNames, useIcon } = createUIContext();
19
+ export default createUIContext;
@@ -0,0 +1,28 @@
1
+ import type { IconComponent } from './interfaces';
2
+ export interface UIIcons {
3
+ 'appNavigation.menu'?: IconComponent;
4
+ 'calendar.previous'?: IconComponent;
5
+ 'calendar.next'?: IconComponent;
6
+ 'csvInput.upload'?: IconComponent;
7
+ 'csvInput.success'?: IconComponent;
8
+ 'collection.empty'?: IconComponent;
9
+ 'colorInput.clear'?: IconComponent;
10
+ 'dropdown.control'?: IconComponent;
11
+ 'filter.clear'?: IconComponent;
12
+ 'filter.panel'?: IconComponent;
13
+ 'filter.search'?: IconComponent;
14
+ 'formField.error'?: IconComponent;
15
+ 'imageInput.error'?: IconComponent;
16
+ 'imageInput.upload'?: IconComponent;
17
+ 'infoPanel.error'?: IconComponent;
18
+ 'infoPanel.info'?: IconComponent;
19
+ 'infoPanel.success'?: IconComponent;
20
+ 'infoPanel.warning'?: IconComponent;
21
+ 'passwordComplexity.invalid'?: IconComponent;
22
+ 'passwordComplexity.valid'?: IconComponent;
23
+ 'passwordInput.hidden'?: IconComponent;
24
+ 'passwordInput.visible'?: IconComponent;
25
+ 'staticTextInput.clear'?: IconComponent;
26
+ 'utility.success'?: IconComponent;
27
+ 'utility.error'?: IconComponent;
28
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export type IconComponent = React.ForwardRefExoticComponent<React.PropsWithoutRef<React.SVGProps<SVGSVGElement>> & {
2
+ title?: string;
3
+ titleId?: string;
4
+ } & React.RefAttributes<SVGSVGElement>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,6 @@
1
- export type { RegisteredClassNames } from './config';
2
- export { default as tw, twx } from './tw';
1
+ export type { UIClassNames } from './classnames/config';
2
+ export type * from './classnames/interfaces';
3
+ export { default as tw, twx } from './classnames/utility/tw';
4
+ export type { UIIcons } from './icons/config';
5
+ export type * from './icons/interfaces';
6
+ export { default as createUIContext, UIProvider, useClassNames, useIcon } from './context';
@@ -1 +1,2 @@
1
- export { default as tw, twx } from './tw';
1
+ export { default as tw, twx } from './classnames/utility/tw';
2
+ export { default as createUIContext, UIProvider, useClassNames, useIcon } from './context';
@@ -0,0 +1,60 @@
1
+ @theme {
2
+ /* These are defaults that will (probably) be overwritten by the consuming application */
3
+ --color-primary: var(--color-teal-600);
4
+ --color-primary-dark: var(--color-teal-700);
5
+ --color-on-primary: var(--color-white);
6
+ /* End defaults */
7
+
8
+ --color-button-bg: var(--color-primary);
9
+ --color-button-bg-hover: var(--color-primary-dark);
10
+ --color-button-text: var(--color-on-primary);
11
+ --color-link: var(--color-primary);
12
+ --color-panel: var(--color-white);
13
+
14
+ --color-error: var(--color-red-600);
15
+ }
16
+
17
+ @layer base {
18
+ button {
19
+ @apply cursor-pointer;
20
+ }
21
+
22
+ hr {
23
+ @apply border-slate-200;
24
+ }
25
+
26
+ input::-webkit-inner-spin-button {
27
+ @apply appearance-none m-0;
28
+ }
29
+
30
+ input[type=number] {
31
+ -moz-appearance: textfield;
32
+ appearance: textfield;
33
+ }
34
+
35
+ small {
36
+ @apply text-xs;
37
+ }
38
+
39
+ strong {
40
+ @apply font-semibold;
41
+ }
42
+ }
43
+
44
+ @layer utilities {
45
+ .fade {
46
+ @apply transition-discrete transition-all duration-100 invisible opacity-0 ease-in-out;
47
+ }
48
+
49
+ .fade-open {
50
+ @apply starting:opacity-0 visible opacity-100;
51
+ }
52
+
53
+ .show {
54
+ @apply transition-discrete transition-all duration-100 invisible opacity-0 ease-in-out scale-90;
55
+ }
56
+
57
+ .show-open {
58
+ @apply starting:opacity-0 starting:scale-90 visible opacity-100 scale-100;
59
+ }
60
+ }
@@ -0,0 +1,2 @@
1
+ declare function compareDates(first: Date, second: Date): -1 | 0 | 1;
2
+ export default compareDates;
@@ -0,0 +1,13 @@
1
+ function compareDates(first, second) {
2
+ if (first.getFullYear() !== second.getFullYear()) {
3
+ return first.getFullYear() < second.getFullYear() ? -1 : 1;
4
+ }
5
+ if (first.getMonth() !== second.getMonth()) {
6
+ return first.getMonth() < second.getMonth() ? -1 : 1;
7
+ }
8
+ if (first.getDate() !== second.getDate()) {
9
+ return first.getDate() < second.getDate() ? -1 : 1;
10
+ }
11
+ return 0;
12
+ }
13
+ export default compareDates;
@@ -0,0 +1,8 @@
1
+ export interface DateState {
2
+ isEnd: boolean;
3
+ isInRange: boolean;
4
+ isSelected: boolean;
5
+ isStart: boolean;
6
+ }
7
+ declare function getDateState(date: Date | null, pendingValue?: Date | null, value?: Date | [Date, Date] | null): DateState;
8
+ export default getDateState;
@@ -0,0 +1,63 @@
1
+ import compareDates from './compare-dates';
2
+ function getDateState(date, pendingValue, value) {
3
+ const defaultState = {
4
+ isEnd: false,
5
+ isInRange: false,
6
+ isSelected: false,
7
+ isStart: false,
8
+ };
9
+ // If there is no date, pending value, or value, return null
10
+ if (!date || (!pendingValue && !value)) {
11
+ return defaultState;
12
+ }
13
+ // For single date, check that the date is selected
14
+ if (date &&
15
+ !pendingValue &&
16
+ !Array.isArray(value) &&
17
+ value &&
18
+ compareDates(date, value) === 0) {
19
+ return { ...defaultState, isSelected: true };
20
+ }
21
+ // For range, check that the date is selected, and is the only one selected
22
+ if (date && pendingValue && compareDates(date, pendingValue) === 0) {
23
+ return { ...defaultState, isSelected: true };
24
+ }
25
+ // For range, check that both dates are the same
26
+ if (date &&
27
+ !pendingValue &&
28
+ Array.isArray(value) &&
29
+ value[0] &&
30
+ value[1] &&
31
+ compareDates(value[0], value[1]) === 0 &&
32
+ compareDates(date, value[0]) === 0) {
33
+ return { ...defaultState, isSelected: true };
34
+ }
35
+ // For range, check that the date is selected, and is the first of two selected
36
+ if (date &&
37
+ !pendingValue &&
38
+ Array.isArray(value) &&
39
+ value[0] &&
40
+ compareDates(date, value[0]) === 0) {
41
+ return { ...defaultState, isStart: true };
42
+ }
43
+ // For range, check that the date is selected, and is the second of two selected
44
+ if (date &&
45
+ !pendingValue &&
46
+ Array.isArray(value) &&
47
+ value[1] &&
48
+ compareDates(date, value[1]) === 0) {
49
+ return { ...defaultState, isEnd: true };
50
+ }
51
+ // For range, check that the date is in between two selected dates
52
+ if (date &&
53
+ !pendingValue &&
54
+ Array.isArray(value) &&
55
+ value[0] &&
56
+ value[1] &&
57
+ compareDates(date, value[0]) > 0 &&
58
+ compareDates(date, value[1]) < 0) {
59
+ return { ...defaultState, isInRange: true };
60
+ }
61
+ return defaultState;
62
+ }
63
+ export default getDateState;
@@ -0,0 +1,2 @@
1
+ declare function getDays(): string[];
2
+ export default getDays;
@@ -0,0 +1,5 @@
1
+ const DAYS = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'];
2
+ function getDays() {
3
+ return DAYS;
4
+ }
5
+ export default getDays;
@@ -0,0 +1,2 @@
1
+ declare function getWeeks(date: Date): (Date | null)[][];
2
+ export default getWeeks;