@luscii-healthtech/web-ui 0.0.0-alpha.01cea45

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 (256) hide show
  1. package/README.md +238 -0
  2. package/dist/components/Accordion/Accordion.d.ts +10 -0
  3. package/dist/components/Accordion/AccordionItem.d.ts +9 -0
  4. package/dist/components/AccordionList/AccordionList.d.ts +42 -0
  5. package/dist/components/AccordionList/subcomponents/AccordionListActions.d.ts +18 -0
  6. package/dist/components/Avatar/Avatar.d.ts +23 -0
  7. package/dist/components/Badge/Badge.d.ts +7 -0
  8. package/dist/components/BaseList/BaseList.d.ts +7 -0
  9. package/dist/components/BaseList/BaseList.types.d.ts +55 -0
  10. package/dist/components/BaseList/BaseListEmptyState.d.ts +7 -0
  11. package/dist/components/BaseList/BaseListHeader.d.ts +4 -0
  12. package/dist/components/BaseList/BaseListIcon.d.ts +5 -0
  13. package/dist/components/BaseList/BaseListItem.d.ts +4 -0
  14. package/dist/components/BaseList/DraggableBaseList/DraggableBaseList.d.ts +4 -0
  15. package/dist/components/BaseList/DraggableBaseList/DraggableBaseListItem.d.ts +3 -0
  16. package/dist/components/BaseList/DraggableBaseList/index.d.ts +2 -0
  17. package/dist/components/BaseList/ListSkeleton/ListItemSkeleton.d.ts +2 -0
  18. package/dist/components/BaseList/ListSkeleton/ListSkeleton.d.ts +8 -0
  19. package/dist/components/BaseList/SortableBaseList/SortableBaseList.d.ts +4 -0
  20. package/dist/components/BaseList/SortableBaseList/SortableBaseListItem.d.ts +3 -0
  21. package/dist/components/BaseList/SortableBaseList/index.d.ts +2 -0
  22. package/dist/components/BaseList/index.d.ts +6 -0
  23. package/dist/components/BaseList/utils.d.ts +10 -0
  24. package/dist/components/Breadcrumbs/BreadcrumbItem.d.ts +4 -0
  25. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -0
  26. package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +14 -0
  27. package/dist/components/Breadcrumbs/index.d.ts +2 -0
  28. package/dist/components/Button/Button.d.ts +9 -0
  29. package/dist/components/Button/Button.types.d.ts +32 -0
  30. package/dist/components/Button/ButtonIcon.d.ts +7 -0
  31. package/dist/components/ButtonV2/ButtonProps.type.d.ts +49 -0
  32. package/dist/components/ButtonV2/ButtonV2.d.ts +3 -0
  33. package/dist/components/ButtonV2/PrimaryButton.d.ts +3 -0
  34. package/dist/components/ButtonV2/SecondaryButton.d.ts +3 -0
  35. package/dist/components/ButtonV2/TertiaryButton.d.ts +3 -0
  36. package/dist/components/Card/Actions.d.ts +2 -0
  37. package/dist/components/Card/Card.d.ts +57 -0
  38. package/dist/components/Card/Padding.d.ts +6 -0
  39. package/dist/components/Card/Section.d.ts +6 -0
  40. package/dist/components/Card/TopBar.d.ts +9 -0
  41. package/dist/components/Carousel/Carousel.d.ts +8 -0
  42. package/dist/components/Carousel/GliderContainer.d.ts +7 -0
  43. package/dist/components/CenteredHero/CenteredHero.d.ts +14 -0
  44. package/dist/components/CheckBoxListModal/CheckboxListModal.d.ts +30 -0
  45. package/dist/components/Checkbox/Checkbox.d.ts +64 -0
  46. package/dist/components/CheckboxList/CheckboxGroup.d.ts +3 -0
  47. package/dist/components/CheckboxList/CheckboxList.d.ts +4 -0
  48. package/dist/components/CheckboxList/CheckboxList.types.d.ts +74 -0
  49. package/dist/components/ConfirmationDialog/ConfirmationDialog.d.ts +3 -0
  50. package/dist/components/ConfirmationDialog/ConfirmationDialogChoices.d.ts +7 -0
  51. package/dist/components/ConfirmationDialog/ConfirmationDialogMessage.d.ts +4 -0
  52. package/dist/components/ConfirmationDialog/ConfirmationDialogTitle.d.ts +3 -0
  53. package/dist/components/ConfirmationDialog/types/ConfirmationDialog.types.d.ts +41 -0
  54. package/dist/components/Container/FlexColumn.d.ts +7 -0
  55. package/dist/components/Container/FlexContainer.d.ts +9 -0
  56. package/dist/components/Container/FlexRow.d.ts +7 -0
  57. package/dist/components/Container/types/FlexContainerProps.type.d.ts +26 -0
  58. package/dist/components/Divider/Divider.d.ts +6 -0
  59. package/dist/components/DragHandle/DragHandle.d.ts +7 -0
  60. package/dist/components/DragHandle/DragHandle.types.d.ts +6 -0
  61. package/dist/components/DragHandle/index.d.ts +2 -0
  62. package/dist/components/Dropzone/Dropzone.d.ts +6 -0
  63. package/dist/components/Dropzone/Dropzone.types.d.ts +33 -0
  64. package/dist/components/Dropzone/index.d.ts +2 -0
  65. package/dist/components/EmptyListMessage/EmptyListMessage.d.ts +14 -0
  66. package/dist/components/FilterBar/ActiveFilters.d.ts +9 -0
  67. package/dist/components/FilterBar/FilterBar.d.ts +96 -0
  68. package/dist/components/FilterBar/FilterBar.utils.d.ts +32 -0
  69. package/dist/components/FilterBar/FilterBarProps.type.d.ts +86 -0
  70. package/dist/components/FilterBar/FiltersMenus.d.ts +8 -0
  71. package/dist/components/FilterBar/SortMenu.d.ts +9 -0
  72. package/dist/components/FilterBar/index.d.ts +2 -0
  73. package/dist/components/Form/Form.d.ts +30 -0
  74. package/dist/components/Form/FormFieldCheckbox.d.ts +9 -0
  75. package/dist/components/Form/FormFieldCheckboxList.d.ts +9 -0
  76. package/dist/components/Form/FormFieldErrorMessages.d.ts +8 -0
  77. package/dist/components/Form/FormFieldLabeler.d.ts +8 -0
  78. package/dist/components/Form/FormImagePicker.d.ts +9 -0
  79. package/dist/components/Form/FormInput.d.ts +14 -0
  80. package/dist/components/Form/FormRadioGroup.d.ts +13 -0
  81. package/dist/components/Form/FormSelect.d.ts +10 -0
  82. package/dist/components/Form/FormTextarea.d.ts +14 -0
  83. package/dist/components/Form/form.transformer.d.ts +3 -0
  84. package/dist/components/Form/form.types.d.ts +92 -0
  85. package/dist/components/Icon/Icon.d.ts +17 -0
  86. package/dist/components/Icon/index.d.ts +1 -0
  87. package/dist/components/Icons/BellIcon.d.ts +4 -0
  88. package/dist/components/Icons/BluetoothIcon.d.ts +4 -0
  89. package/dist/components/Icons/CalendarDayIcon.d.ts +4 -0
  90. package/dist/components/Icons/CalendarMonthIcon.d.ts +4 -0
  91. package/dist/components/Icons/CalendarRepeatIcon.d.ts +4 -0
  92. package/dist/components/Icons/ChartBarsIcon.d.ts +4 -0
  93. package/dist/components/Icons/ChartLineAndBarsIcon.d.ts +4 -0
  94. package/dist/components/Icons/ChatBubbleIcon.d.ts +4 -0
  95. package/dist/components/Icons/ChatBubbleWithTextIcon.d.ts +4 -0
  96. package/dist/components/Icons/CheckIcon.d.ts +4 -0
  97. package/dist/components/Icons/ChevronDoubleIcon.d.ts +4 -0
  98. package/dist/components/Icons/ChevronDownIcon.d.ts +4 -0
  99. package/dist/components/Icons/ChevronLeftIcon.d.ts +4 -0
  100. package/dist/components/Icons/ChevronRightIcon.d.ts +4 -0
  101. package/dist/components/Icons/ClockIcon.d.ts +4 -0
  102. package/dist/components/Icons/CogwheelIcon.d.ts +4 -0
  103. package/dist/components/Icons/CopyToClipboardIcon.d.ts +4 -0
  104. package/dist/components/Icons/CrossIcon.d.ts +4 -0
  105. package/dist/components/Icons/CrossInCircleIcon.d.ts +4 -0
  106. package/dist/components/Icons/CrossInFilledCircleIcon.d.ts +4 -0
  107. package/dist/components/Icons/DatabaseIcon.d.ts +4 -0
  108. package/dist/components/Icons/DragIndicatorIcon.d.ts +4 -0
  109. package/dist/components/Icons/EmailIcon.d.ts +4 -0
  110. package/dist/components/Icons/EmptyIcon.d.ts +4 -0
  111. package/dist/components/Icons/ExclamationMarkIcon.d.ts +4 -0
  112. package/dist/components/Icons/ExportIcon.d.ts +4 -0
  113. package/dist/components/Icons/EyeClosedIcon.d.ts +4 -0
  114. package/dist/components/Icons/EyeIconSlashed.d.ts +4 -0
  115. package/dist/components/Icons/EyeOpenIcon.d.ts +4 -0
  116. package/dist/components/Icons/FilterIcon.d.ts +4 -0
  117. package/dist/components/Icons/FireIcon.d.ts +4 -0
  118. package/dist/components/Icons/FirstAidKitIcon.d.ts +4 -0
  119. package/dist/components/Icons/FlagIcon.d.ts +4 -0
  120. package/dist/components/Icons/ForwardIcon.d.ts +4 -0
  121. package/dist/components/Icons/GroupIcon.d.ts +4 -0
  122. package/dist/components/Icons/GroupOfThreeIcon.d.ts +4 -0
  123. package/dist/components/Icons/HamburgerIcon.d.ts +4 -0
  124. package/dist/components/Icons/HandshakeIcon.d.ts +4 -0
  125. package/dist/components/Icons/HeartIcon.d.ts +4 -0
  126. package/dist/components/Icons/HomeIcon.d.ts +4 -0
  127. package/dist/components/Icons/ImageIcon.d.ts +4 -0
  128. package/dist/components/Icons/InfoIcon.d.ts +4 -0
  129. package/dist/components/Icons/LifebuoyIcon.d.ts +4 -0
  130. package/dist/components/Icons/LightBulbIcon.d.ts +4 -0
  131. package/dist/components/Icons/LinkIcon.d.ts +4 -0
  132. package/dist/components/Icons/LockIcon.d.ts +4 -0
  133. package/dist/components/Icons/LogOutIcon.d.ts +4 -0
  134. package/dist/components/Icons/MessageWithArrowIcon.d.ts +4 -0
  135. package/dist/components/Icons/MoreIcon.d.ts +4 -0
  136. package/dist/components/Icons/MouseIcon.d.ts +4 -0
  137. package/dist/components/Icons/NoteIcon.d.ts +4 -0
  138. package/dist/components/Icons/PageViewIcon.d.ts +4 -0
  139. package/dist/components/Icons/PatientIcon.d.ts +4 -0
  140. package/dist/components/Icons/PencilIcon.d.ts +4 -0
  141. package/dist/components/Icons/PhoneIcon.d.ts +4 -0
  142. package/dist/components/Icons/PieChartIcon.d.ts +4 -0
  143. package/dist/components/Icons/PinIcon.d.ts +4 -0
  144. package/dist/components/Icons/PlusIcon.d.ts +4 -0
  145. package/dist/components/Icons/PrinterIcon.d.ts +4 -0
  146. package/dist/components/Icons/RobotIcon.d.ts +4 -0
  147. package/dist/components/Icons/RocketIcon.d.ts +4 -0
  148. package/dist/components/Icons/SearchIcon.d.ts +4 -0
  149. package/dist/components/Icons/ShareIcon.d.ts +4 -0
  150. package/dist/components/Icons/SmallCircleIcon.d.ts +4 -0
  151. package/dist/components/Icons/SmallDiamondIcon.d.ts +4 -0
  152. package/dist/components/Icons/SmallSquareIcon.d.ts +4 -0
  153. package/dist/components/Icons/StarIcon.d.ts +4 -0
  154. package/dist/components/Icons/TrashBinIcon.d.ts +4 -0
  155. package/dist/components/Icons/iconWrapper/iconWrapper.d.ts +4 -0
  156. package/dist/components/Icons/iconWrapper/index.d.ts +1 -0
  157. package/dist/components/Icons/index.d.ts +244 -0
  158. package/dist/components/Icons/special-icons/ChartLineColoredIcon.d.ts +4 -0
  159. package/dist/components/Icons/special-icons/GearColoredIcon.d.ts +4 -0
  160. package/dist/components/Icons/special-icons/GroupColoredIcon.d.ts +4 -0
  161. package/dist/components/Icons/special-icons/StatusColoredIcon.d.ts +4 -0
  162. package/dist/components/Icons/special-icons/index.d.ts +4 -0
  163. package/dist/components/Icons/types/IconProps.type.d.ts +8 -0
  164. package/dist/components/Image/Image.d.ts +10 -0
  165. package/dist/components/InfoField/InfoField.d.ts +28 -0
  166. package/dist/components/Input/Input.d.ts +56 -0
  167. package/dist/components/Input/SearchInput.d.ts +24 -0
  168. package/dist/components/Link/Link.d.ts +19 -0
  169. package/dist/components/List/List.d.ts +6 -0
  170. package/dist/components/List/List.types.d.ts +19 -0
  171. package/dist/components/List/ListItem.d.ts +4 -0
  172. package/dist/components/List/index.d.ts +5 -0
  173. package/dist/components/LoadingIndicator/LoadingIndicator.d.ts +12 -0
  174. package/dist/components/MediaPicker/ImageCategory.d.ts +14 -0
  175. package/dist/components/MediaPicker/MediaPicker.d.ts +91 -0
  176. package/dist/components/Modal/FullPageModal.d.ts +41 -0
  177. package/dist/components/Modal/FullPageModalHeader.d.ts +13 -0
  178. package/dist/components/Modal/Modal.d.ts +11 -0
  179. package/dist/components/Modal/ModalBase.d.ts +16 -0
  180. package/dist/components/Modal/ModalFooter.d.ts +12 -0
  181. package/dist/components/Modal/ModalHeader.d.ts +6 -0
  182. package/dist/components/Modal/subcomponents/FullPageModalActions.d.ts +18 -0
  183. package/dist/components/NavMenu/NavLayout.d.ts +35 -0
  184. package/dist/components/NavMenu/NavMenu.d.ts +16 -0
  185. package/dist/components/NavMenu/NavMenuContent.d.ts +3 -0
  186. package/dist/components/NavMenu/NavMenuFooter.d.ts +3 -0
  187. package/dist/components/NavMenu/NavMenuHeader.d.ts +3 -0
  188. package/dist/components/NavMenu/NavMenuItem.d.ts +3 -0
  189. package/dist/components/NavMenu/types/NavMenuFooterProps.type.d.ts +5 -0
  190. package/dist/components/NavMenu/types/NavMenuHeaderProps.type.d.ts +11 -0
  191. package/dist/components/NavMenu/types/NavMenuItemProps.type.d.ts +11 -0
  192. package/dist/components/NotificationBanner/NotificationBanner.d.ts +41 -0
  193. package/dist/components/Page/CRUDPage.d.ts +4 -0
  194. package/dist/components/Page/CRUDPage.types.d.ts +32 -0
  195. package/dist/components/Page/index.d.ts +3 -0
  196. package/dist/components/PageHeader/PageHeader.d.ts +4 -0
  197. package/dist/components/PageHeader/PageHeader.types.d.ts +28 -0
  198. package/dist/components/PageHeader/index.d.ts +2 -0
  199. package/dist/components/PaginationMenu/PaginationMenu.d.ts +3 -0
  200. package/dist/components/PaginationMenu/PaginationMenu.types.d.ts +37 -0
  201. package/dist/components/PaginationMenu/PaginationMenu.utils.d.ts +15 -0
  202. package/dist/components/PaginationMenu/PaginationMenuLarge.d.ts +3 -0
  203. package/dist/components/PaginationMenu/PaginationMenuSmall.d.ts +3 -0
  204. package/dist/components/PreviewPhone/PreviewPhone.d.ts +7 -0
  205. package/dist/components/Radio/RadioV2.d.ts +17 -0
  206. package/dist/components/RadioGroup/RadioGroupV2.d.ts +10 -0
  207. package/dist/components/Section/Section.d.ts +25 -0
  208. package/dist/components/Section/SectionItem.d.ts +9 -0
  209. package/dist/components/Section/SectionItemWithContent.d.ts +9 -0
  210. package/dist/components/Section/subcomponents/SectionActions.d.ts +21 -0
  211. package/dist/components/Select/Select.d.ts +46 -0
  212. package/dist/components/Select/SelectDropdownIndicator.d.ts +3 -0
  213. package/dist/components/Select/SelectLoadingIndicator.d.ts +3 -0
  214. package/dist/components/SettingsMenuButton/SettingsMenuButton.d.ts +19 -0
  215. package/dist/components/Spinner/Spinner.d.ts +6 -0
  216. package/dist/components/Steps/Step.d.ts +10 -0
  217. package/dist/components/Steps/Steps.d.ts +10 -0
  218. package/dist/components/Tabbar/Tabbar.d.ts +18 -0
  219. package/dist/components/Tabbar/TabbarItem.d.ts +16 -0
  220. package/dist/components/Table/Table.d.ts +16 -0
  221. package/dist/components/Table/Table.types.d.ts +42 -0
  222. package/dist/components/Table/Table.utils.d.ts +3 -0
  223. package/dist/components/Table/TableBody.d.ts +13 -0
  224. package/dist/components/Table/TableBodyRow.d.ts +10 -0
  225. package/dist/components/Table/TableBodyRowDataCell.d.ts +8 -0
  226. package/dist/components/Table/TableFooter.d.ts +8 -0
  227. package/dist/components/Table/TableHeader.d.ts +7 -0
  228. package/dist/components/Tag/Tag.d.ts +26 -0
  229. package/dist/components/Tag/TagGroup.d.ts +23 -0
  230. package/dist/components/Text/Text.d.ts +115 -0
  231. package/dist/components/TextEditor/TextEditor.d.ts +53 -0
  232. package/dist/components/TextLink/TextLink.d.ts +14 -0
  233. package/dist/components/Textarea/Textarea.d.ts +33 -0
  234. package/dist/components/Timeline/Timeline.d.ts +14 -0
  235. package/dist/components/Timeline/TimelineHeader.d.ts +10 -0
  236. package/dist/components/Timeline/TimelineStep.d.ts +10 -0
  237. package/dist/components/Title/Title.d.ts +31 -0
  238. package/dist/components/Toaster/Toaster.d.ts +17 -0
  239. package/dist/components/Toaster/toast-elements-getter.d.ts +22 -0
  240. package/dist/components/Toaster/toast-progress-animator.d.ts +12 -0
  241. package/dist/components/Toaster/toast.d.ts +12 -0
  242. package/dist/components/UnorderedList/UnorderedList.d.ts +61 -0
  243. package/dist/components/VerticalMenu/VerticalMenu.d.ts +84 -0
  244. package/dist/components/ViewItem/ViewItem.d.ts +16 -0
  245. package/dist/components/WeekdaysPicker/WeekdaysPicker.d.ts +42 -0
  246. package/dist/index.d.ts +82 -0
  247. package/dist/index.development.js +6063 -0
  248. package/dist/index.development.js.map +1 -0
  249. package/dist/index.js +2 -0
  250. package/dist/index.js.map +1 -0
  251. package/dist/types/general.types.d.ts +8 -0
  252. package/dist/utils/string.utils.d.ts +7 -0
  253. package/dist/web-ui-tailwind.css +3082 -0
  254. package/dist/web-ui.esm.js +2 -0
  255. package/dist/web-ui.esm.js.map +1 -0
  256. package/package.json +165 -0
@@ -0,0 +1,32 @@
1
+ import { CategorizedFilters, FilterGenerator, TransformedSortingOptions } from "./FilterBarProps.type";
2
+ /**
3
+ * Generates the list of filters based on the data (see this as what you'd like to be filtered in your component).
4
+ *
5
+ * @param dataToGenerateFiltersFrom - The data (list of entities) that will be used to create the filters.
6
+ * @param groupers a list of functions used to create the filters dropdown
7
+ * @returns {CategorisedFilters} a list of filters properly grouped.
8
+ */
9
+ export declare function getFilterGroups<T extends unknown[]>(dataToGenerateFiltersFrom: T, groupers: FilterGenerator<T[number]>[]): CategorizedFilters;
10
+ /**
11
+ *
12
+ * @param filterKey the key of the categorized filter (eg. color, size, brand) - which one of them are you gonna check.
13
+ * @param categorizedFilters the array of categorized filters the FilterBar component needs
14
+ * @param attributeGetter the getter to retrieve the attribute to be filtered on, this allow maximum flexibility on how to process
15
+ * filters on any level of nesting if necessary.
16
+ * @returns a predicate to be used in the filter function
17
+ * @example
18
+ *
19
+ * const sizeFilterPredicate = createFilterPredicate<TShirtFromApi>("size", filtersOptions, (item) => item.meta.size);
20
+ * const filteredBySize = items.filter(sizeFilterPredicate);
21
+ *
22
+ */
23
+ export declare const createFilterPredicate: <T extends object>(filterKey: string, categorizedFilters: CategorizedFilters, attributeGetter: (item: T) => string) => (item: T) => boolean;
24
+ /**
25
+ * Creates a sorting function to be used on a specific object attribute.
26
+ *
27
+ * @param getter the getter function to retrieve the attribute used in the sorting
28
+ * @param order if ascending or descending
29
+ * @returns the sorting comparer function to be used in Array.sort
30
+ */
31
+ export declare const createSortingComparer: <T extends object>(getter: (item: T) => string | number, order?: "asc" | "desc") => (itemA: T, itemB: T) => number;
32
+ export declare const applySorting: <T extends object[]>(sortable: T, sortingOptions: TransformedSortingOptions<T[number]>) => T;
@@ -0,0 +1,86 @@
1
+ /**
2
+ * The object used to create a filter dropdown in the component.
3
+ * This is used based on the dataset passed to FilterBar, so we always calculate the filters
4
+ * looking at the data.
5
+ */
6
+ export type FilterGenerator<SortableEntity> = {
7
+ id: string;
8
+ label: string;
9
+ /**
10
+ *
11
+ * @param data the value from the dataset entry that will be used for the filter
12
+ * @returns the string value for the desired filter
13
+ *
14
+ * @example
15
+ *
16
+ * ```ts
17
+ * {
18
+ id: "brand",
19
+ label: "Brand",
20
+ filterValuePredicate: (tshirt: TShirtFromApi) => tshirt.brand,
21
+ }
22
+ * ```
23
+ * in the above, all unique values from `brand` will be used to populate the `Brand` filter.
24
+ */
25
+ filterValuePredicate: (data: SortableEntity) => string;
26
+ };
27
+ /**
28
+ * Allows customization of labels related to filter.
29
+ *
30
+ */
31
+ export type FilterBarLocalization = {
32
+ /**
33
+ * The string prefix displayed when a sorting value is selected in the menu.
34
+ *
35
+ * @default "Sorted by:"
36
+ * @example
37
+ *
38
+ * `sortedByLabel`: "Sorted by: "
39
+ *
40
+ * Example of sorting options
41
+ * - Name
42
+ * - Email (selected)
43
+ * - Date of birth
44
+ *
45
+ * UI shows: `Sorted by: Email`.
46
+ */
47
+ sortedByLabel: string;
48
+ /**
49
+ * The string for unselected state of the sorting options.
50
+ *
51
+ * @default "Sort"
52
+ */
53
+ sortLabel: string;
54
+ /**
55
+ * The string for the active filters and the mobile filter menu label.
56
+ *
57
+ * @default "Filters"
58
+ */
59
+ filtersLabel: string;
60
+ };
61
+ export type TransformedFilterOption = {
62
+ id: string;
63
+ label: string;
64
+ value: string;
65
+ isChecked: boolean;
66
+ };
67
+ export type TransformedFilterOptions = TransformedFilterOption[];
68
+ type CategorizedFilter = {
69
+ key: string;
70
+ label: string;
71
+ options: TransformedFilterOptions;
72
+ };
73
+ export type CategorizedFilters = CategorizedFilter[];
74
+ export type TransformedSortingOption<SortableEntity extends object> = {
75
+ id: string;
76
+ label: string;
77
+ value: string;
78
+ isChecked: boolean;
79
+ sortingCompare: (itemA: SortableEntity, itemB: SortableEntity) => number;
80
+ };
81
+ export type TransformedSortingOptions<SortableEntity extends object> = TransformedSortingOption<SortableEntity>[];
82
+ export type OnFilterBarFilterChange = (params: {
83
+ changedFilterOption: TransformedFilterOption;
84
+ }) => void;
85
+ export type OnFilterBarSortingChange<SortableEntity extends object> = (changedSortingOption: TransformedSortingOption<SortableEntity>) => void;
86
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { CategorizedFilters, OnFilterBarFilterChange } from "./FilterBarProps.type";
3
+ type FiltersMenusProps = {
4
+ filters: CategorizedFilters;
5
+ onFilterOptionChange: OnFilterBarFilterChange;
6
+ };
7
+ export declare const FiltersMenus: React.FC<FiltersMenusProps>;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import { ReactElement } from "react";
2
+ import { FilterBarLocalization, OnFilterBarSortingChange, TransformedSortingOption } from "./FilterBarProps.type";
3
+ type SortMenuProps<SortableEntity extends object> = {
4
+ localization: FilterBarLocalization;
5
+ sortingOptions: TransformedSortingOption<SortableEntity>[];
6
+ onSortOptionChange: OnFilterBarSortingChange<SortableEntity>;
7
+ };
8
+ export declare const SortMenu: <SortableEntity extends object>(props: SortMenuProps<SortableEntity>) => ReactElement | null;
9
+ export {};
@@ -0,0 +1,2 @@
1
+ export { FilterBar } from "./FilterBar";
2
+ export * as FilterBarUtils from "./FilterBar.utils";
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ import { type FieldValues, type UseFormMethods as UseFormReturn, DeepPartial, SubmitErrorHandler, SubmitHandler, UnpackNestedValue } from "react-hook-form/dist/index.ie11";
3
+ import { FormFieldConfiguration } from "./form.types";
4
+ export interface GenericFormProps<TFieldValues extends FieldValues> {
5
+ fields: FormFieldConfiguration<TFieldValues>[];
6
+ onValid: SubmitHandler<TFieldValues>;
7
+ onError?: SubmitErrorHandler<TFieldValues>;
8
+ defaultValues?: UnpackNestedValue<DeepPartial<TFieldValues>>;
9
+ }
10
+ /**
11
+ * Create a straight forward Form, which takes away the 'overhead' of react-hook-form.
12
+ *
13
+ * You will probably don't want to use this component for now, given that the button is hardcoded.
14
+ * This is an example for the Form for now, though it could be improved to enforce further unification.
15
+ *
16
+ * TODO: make the buttons configurable.
17
+ */
18
+ export declare function GenericForm<TFieldValues extends FieldValues>({ fields, onValid, onError, defaultValues, }: GenericFormProps<TFieldValues>): JSX.Element;
19
+ export interface FormProps<TFieldValues extends FieldValues> {
20
+ fields: FormFieldConfiguration<TFieldValues>[];
21
+ useFormReturn: UseFormReturn<TFieldValues>;
22
+ }
23
+ /**
24
+ * Creates a Form based on the fields input.
25
+ *
26
+ * Expects the results of the useForm hook to be injected into the useFormReturn parameter.
27
+ *
28
+ * This allows you to use and modify the useFormReturn before injecting it here.
29
+ */
30
+ export declare function Form<TFieldValues extends FieldValues>({ fields, useFormReturn, }: FormProps<TFieldValues>): JSX.Element;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { Control, RegisterOptions } from "react-hook-form/dist/index.ie11";
3
+ import { FieldCheckboxConfiguration, FormFieldLabelerWithFormProps } from "./form.types";
4
+ interface FormCheckboxProps extends FieldCheckboxConfiguration, FormFieldLabelerWithFormProps {
5
+ control: Control;
6
+ rules?: Exclude<RegisterOptions, "valueAsNumber" | "valueAsDate" | "setValueAs">;
7
+ }
8
+ export declare const FormFieldCheckbox: React.ForwardRefExoticComponent<FormCheckboxProps & React.RefAttributes<HTMLInputElement>>;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { Control, RegisterOptions } from "react-hook-form/dist/index.ie11";
3
+ import { FieldCheckboxListConfiguration, FormFieldLabelerWithFormProps } from "./form.types";
4
+ interface FormCheckboxListProps extends FieldCheckboxListConfiguration, FormFieldLabelerWithFormProps {
5
+ control: Control;
6
+ rules?: Exclude<RegisterOptions, "valueAsNumber" | "valueAsDate" | "setValueAs">;
7
+ }
8
+ export declare const FormFieldCheckboxList: React.FC<FormCheckboxListProps>;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import type { FieldErrors } from "react-hook-form";
3
+ interface FormFieldErrorMessages {
4
+ fieldName: string;
5
+ error: FieldErrors;
6
+ }
7
+ export declare const FormFieldErrorMessages: React.FC<FormFieldErrorMessages>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { FormFieldLabelerWithFormProps } from "./form.types";
3
+ /**
4
+ * Decorator for any input component. Adds a label and additional information to be shown.
5
+ *
6
+ * Includes the default error handling from react-hook-form.
7
+ */
8
+ export declare function FormFieldLabeler({ name, children, label, fieldRequired, info, fieldErrors, decoratorClassname, }: FormFieldLabelerWithFormProps): JSX.Element;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { Control, RegisterOptions } from "react-hook-form/dist/index.ie11";
3
+ import { MediaPickerFieldConfiguration, FormFieldLabelerWithFormProps } from "./form.types";
4
+ interface FormMediaPickerProps extends MediaPickerFieldConfiguration, FormFieldLabelerWithFormProps {
5
+ control: Control;
6
+ rules?: Exclude<RegisterOptions, "valueAsNumber" | "valueAsDate" | "setValueAs">;
7
+ }
8
+ export declare const FormImagePicker: React.ForwardRefExoticComponent<FormMediaPickerProps & React.RefAttributes<any>>;
9
+ export {};
@@ -0,0 +1,14 @@
1
+ import React, { HTMLInputTypeAttribute } from "react";
2
+ import { Control, RegisterOptions } from "react-hook-form/dist/index.ie11";
3
+ import { InputProps } from "../Input/Input";
4
+ import { FormFieldLabelerWithFormProps } from "./form.types";
5
+ interface FormInputProps extends Omit<InputProps, "name">, FormFieldLabelerWithFormProps {
6
+ control: Control;
7
+ rules?: Exclude<RegisterOptions, "valueAsNumber" | "valueAsDate" | "setValueAs">;
8
+ type: Extract<HTMLInputTypeAttribute, "email" | "number" | "password" | "text">;
9
+ }
10
+ /**
11
+ * Input field that can be used in any react-hook-form context.
12
+ */
13
+ export declare const FormInput: React.ForwardRefExoticComponent<FormInputProps & React.RefAttributes<HTMLInputElement>>;
14
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { Control, RegisterOptions } from "react-hook-form/dist/index.ie11";
3
+ import { RadioGroupProps } from "../RadioGroup/RadioGroupV2";
4
+ import { FormFieldLabelerWithFormProps } from "./form.types";
5
+ interface FormRadioGroupProps extends Omit<RadioGroupProps, "isError">, FormFieldLabelerWithFormProps {
6
+ control: Control;
7
+ rules?: Exclude<RegisterOptions, "valueAsNumber" | "valueAsDate" | "setValueAs">;
8
+ }
9
+ /**
10
+ * Radio Group that can be used in any react-hook-form context.
11
+ */
12
+ export declare const FormRadioGroup: React.ForwardRefExoticComponent<FormRadioGroupProps & React.RefAttributes<HTMLInputElement>>;
13
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { Control, RegisterOptions } from "react-hook-form/dist/index.ie11";
3
+ import { SelectProps } from "../Select/Select";
4
+ import { FormFieldLabelerWithFormProps } from "./form.types";
5
+ interface FormSelectProps extends Omit<SelectProps, "name">, FormFieldLabelerWithFormProps {
6
+ control: Control;
7
+ rules?: Exclude<RegisterOptions, "valueAsNumber" | "valueAsDate" | "setValueAs">;
8
+ }
9
+ export declare const FormSelect: React.ForwardRefExoticComponent<FormSelectProps & React.RefAttributes<any>>;
10
+ export {};
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { Control, RegisterOptions } from "react-hook-form/dist/index.ie11";
3
+ import { TextareaProps } from "../Textarea/Textarea";
4
+ import { FieldTextareaConfiguration, FormFieldLabelerWithFormProps } from "./form.types";
5
+ interface FormTextareaProps extends FieldTextareaConfiguration, Omit<TextareaProps, "name">, FormFieldLabelerWithFormProps {
6
+ control: Control;
7
+ rules?: Exclude<RegisterOptions, "valueAsNumber" | "valueAsDate" | "setValueAs">;
8
+ type: "textarea";
9
+ }
10
+ /**
11
+ * Input field that can be used in any react-hook-form context.
12
+ */
13
+ export declare const FormTextarea: React.ForwardRefExoticComponent<FormTextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
14
+ export {};
@@ -0,0 +1,3 @@
1
+ import { FieldErrors, RegisterOptions } from "react-hook-form/dist/index.ie11";
2
+ export declare const hasError: (name?: string, errors?: FieldErrors) => boolean;
3
+ export declare const isRequired: (options?: RegisterOptions) => boolean;
@@ -0,0 +1,92 @@
1
+ import { FieldErrors, FieldName, FieldValues, RegisterOptions } from "react-hook-form/dist/index.ie11";
2
+ import React, { HTMLInputTypeAttribute } from "react";
3
+ import { InputProps } from "../Input/Input";
4
+ import { RadioGroupProps } from "../RadioGroup/RadioGroupV2";
5
+ import { SelectProps } from "../Select/Select";
6
+ import { MediaPickerProps } from "../MediaPicker/MediaPicker";
7
+ import { PartialProperties } from "../../types/general.types";
8
+ import { CheckboxProps } from "../Checkbox/Checkbox";
9
+ import { TextareaProps } from "../Textarea/Textarea";
10
+ import { TitleProps } from "../Title/Title";
11
+ export type AllowedTextInputTypes = Extract<HTMLInputTypeAttribute, "email" | "number" | "password" | "text">;
12
+ export type FormFieldWidth = "sm" | "md" | "lg" | "xl" | "full";
13
+ interface FormFieldBaseConfiguration<TFieldType> extends FormFieldLabelerProps {
14
+ name: FieldName<FieldValues>;
15
+ options?: RegisterOptions;
16
+ fieldProps?: TFieldType;
17
+ }
18
+ export interface FormFieldLabelerProps {
19
+ label?: string;
20
+ info?: string;
21
+ /**
22
+ * allow for custom styling of the labeler component
23
+ */
24
+ decoratorClassname?: string;
25
+ }
26
+ /**
27
+ * This is an empty entry in the field form. To be used
28
+ * when there's logic to add/remove fields from the array.
29
+ *
30
+ * Using this makes life easier and avoids having to splice/push/concat fields.
31
+ */
32
+ interface FieldVoidConfiguration extends Partial<FormFieldBaseConfiguration<never>> {
33
+ type: "void";
34
+ }
35
+ export type FormFieldConfiguration<TFieldValues> = FieldInputConfiguration | FieldSelectConfiguration | FieldMediaPickerConfiguration | FieldRadioGroupConfiguration | FieldRowConfiguration<TFieldValues> | FieldCheckboxConfiguration | FieldCheckboxListConfiguration | FieldTextareaConfiguration | FieldTitleConfiguration | FieldVoidConfiguration;
36
+ /**
37
+ * @backwardscompatibility
38
+ * @deprecated - this is an alias for `FormFieldConfiguration`, for backwards compatibility the name can remain for now, but
39
+ * import `FormFieldConfiguration` whenever you need this type in the future.
40
+ */
41
+ export type FormFieldProps<TFieldValues> = FormFieldConfiguration<TFieldValues>;
42
+ export interface FieldRowConfiguration<TFieldValues> extends Record<keyof FormFieldBaseConfiguration<never>, never> {
43
+ type: "row";
44
+ key: string;
45
+ fields: FormFieldConfiguration<TFieldValues>[];
46
+ }
47
+ export interface FieldTitleConfiguration extends FormFieldBaseConfiguration<TitleProps> {
48
+ type: "title";
49
+ }
50
+ export interface FieldInputConfiguration extends FormFieldBaseConfiguration<Omit<InputProps, "name">> {
51
+ type: AllowedTextInputTypes;
52
+ }
53
+ export interface FieldTextareaConfiguration extends FormFieldBaseConfiguration<Omit<TextareaProps, "name">> {
54
+ type: "textarea";
55
+ }
56
+ export interface FieldRadioGroupConfiguration extends FormFieldBaseConfiguration<Omit<RadioGroupProps, "name">> {
57
+ type: "radioGroup";
58
+ }
59
+ export interface FieldSelectConfiguration extends FormFieldBaseConfiguration<SelectProps> {
60
+ type: "select";
61
+ fieldProps: SelectProps;
62
+ }
63
+ export type MediaPickerFieldConfiguration = PartialProperties<Omit<MediaPickerProps, "name">, "onChange">;
64
+ export interface FieldMediaPickerConfiguration extends FormFieldBaseConfiguration<MediaPickerFieldConfiguration> {
65
+ type: "mediaPicker";
66
+ fieldProps: MediaPickerFieldConfiguration;
67
+ }
68
+ export interface FieldCheckboxConfiguration extends FormFieldBaseConfiguration<Omit<CheckboxProps, "name" | "type">> {
69
+ type: "checkbox";
70
+ variant?: CheckboxProps["type"];
71
+ }
72
+ /**
73
+ * Omiting `groups` and `onChange` here because these will be handled by
74
+ * the `Control` component from react-hook-form.
75
+ */
76
+ export interface FieldCheckboxListConfiguration extends FormFieldBaseConfiguration<{
77
+ className?: string;
78
+ }> {
79
+ type: "checkboxlist";
80
+ }
81
+ /**
82
+ * This type is the base for every form field component wrapped in the `FormFieldLabeler` and `Control` from `react-form-hook`.
83
+ * This is your baseline for creating a new form field type. For reference, look at FormInput.tsx.
84
+ *
85
+ */
86
+ export interface FormFieldLabelerWithFormProps extends FormFieldLabelerProps {
87
+ name: string;
88
+ fieldErrors: FieldErrors;
89
+ fieldRequired: boolean;
90
+ children?: React.ReactNode;
91
+ }
92
+ export {};
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { IconProps, IconKey } from "../Icons/types/IconProps.type";
3
+ export declare const Icon: React.FC<{
4
+ name: IconKey;
5
+ } & IconProps>;
6
+ /**
7
+ * This is a temporary component toui-transition the way we pass icons to components.
8
+ * Once all components are passed an IconKey instead of a function component we can replace it with the Icon component.
9
+ *
10
+ * If any expansion or customization must be made for all icons, do it in the iconWrapper.tsx component.
11
+ *
12
+ * @linkcode https://github.com/Luscii/web-ui/blob/main/src/components/Icons/iconWrapper/iconWrapper.tsx
13
+ */
14
+ export declare const IconComponentOrKey: React.FC<{
15
+ name: React.FunctionComponent<IconProps> | IconKey;
16
+ } & IconProps>;
17
+ export default Icon;
@@ -0,0 +1 @@
1
+ export { Icon } from "./Icon";
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;