@helpwave/hightide 0.0.8 → 0.0.11

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 (300) hide show
  1. package/README.md +1 -1
  2. package/dist/coloring/shading.d.ts +2 -0
  3. package/dist/coloring/shading.js +40 -0
  4. package/dist/coloring/types.d.ts +11 -0
  5. package/dist/coloring/types.js +1 -0
  6. package/dist/components/Avatar.d.ts +14 -0
  7. package/dist/components/Avatar.js +35 -0
  8. package/dist/components/AvatarGroup.d.ts +10 -0
  9. package/dist/components/AvatarGroup.js +13 -0
  10. package/dist/components/BreadCrumb.d.ts +16 -0
  11. package/dist/components/BreadCrumb.js +12 -0
  12. package/dist/components/Button.d.ts +41 -0
  13. package/dist/components/Button.js +84 -0
  14. package/dist/components/ChipList.d.ts +21 -0
  15. package/dist/components/ChipList.js +38 -0
  16. package/dist/components/Circle.d.ts +6 -0
  17. package/dist/components/Circle.js +10 -0
  18. package/dist/components/ErrorComponent.d.ts +13 -0
  19. package/dist/components/ErrorComponent.js +19 -0
  20. package/dist/components/Expandable.d.ts +30 -0
  21. package/dist/components/Expandable.js +16 -0
  22. package/dist/components/HelpwaveBadge.d.ts +11 -0
  23. package/dist/components/HelpwaveBadge.js +14 -0
  24. package/dist/components/HideableContentSection.d.ts +10 -0
  25. package/dist/components/HideableContentSection.js +15 -0
  26. package/dist/components/InputGroup.d.ts +13 -0
  27. package/dist/components/InputGroup.js +33 -0
  28. package/dist/components/LoadingAndErrorComponent.d.ts +17 -0
  29. package/dist/components/LoadingAndErrorComponent.js +25 -0
  30. package/dist/components/LoadingAnimation.d.ts +13 -0
  31. package/dist/components/LoadingAnimation.js +19 -0
  32. package/dist/components/LoadingButton.d.ts +6 -0
  33. package/dist/components/LoadingButton.js +10 -0
  34. package/dist/components/MarkdownInterpreter.d.ts +25 -0
  35. package/dist/components/MarkdownInterpreter.js +190 -0
  36. package/dist/components/Pagination.d.ts +14 -0
  37. package/dist/components/Pagination.js +25 -0
  38. package/dist/components/Profile.d.ts +28 -0
  39. package/dist/components/Profile.js +45 -0
  40. package/dist/components/ProgressIndicator.d.ts +21 -0
  41. package/dist/components/ProgressIndicator.js +24 -0
  42. package/dist/components/Ring.d.ts +31 -0
  43. package/dist/components/Ring.js +113 -0
  44. package/dist/components/SearchableList.d.ts +18 -0
  45. package/dist/components/SearchableList.js +27 -0
  46. package/dist/components/SortButton.d.ts +10 -0
  47. package/dist/components/SortButton.js +9 -0
  48. package/dist/components/Span.js +1 -0
  49. package/dist/components/StepperBar.d.ts +23 -0
  50. package/dist/components/StepperBar.js +47 -0
  51. package/dist/components/Table.d.ts +87 -0
  52. package/dist/components/Table.js +187 -0
  53. package/dist/components/TechRadar.d.ts +36 -0
  54. package/dist/components/TechRadar.js +191 -0
  55. package/dist/components/TextImage.d.ts +20 -0
  56. package/dist/components/TextImage.js +31 -0
  57. package/dist/components/TimeDisplay.d.ts +30 -0
  58. package/dist/components/TimeDisplay.js +83 -0
  59. package/dist/components/Tooltip.d.ts +34 -0
  60. package/dist/components/Tooltip.js +38 -0
  61. package/dist/components/VerticalDivider.d.ts +11 -0
  62. package/dist/components/VerticalDivider.js +7 -0
  63. package/dist/components/date/DatePicker.d.ts +26 -0
  64. package/dist/components/date/DatePicker.js +58 -0
  65. package/dist/components/date/DayPicker.d.ts +16 -0
  66. package/dist/components/date/DayPicker.js +37 -0
  67. package/dist/components/date/TimePicker.d.ts +12 -0
  68. package/dist/components/date/TimePicker.js +79 -0
  69. package/dist/components/date/YearMonthPicker.d.ts +11 -0
  70. package/dist/components/date/YearMonthPicker.js +59 -0
  71. package/dist/components/examples/InputGroupExample.d.ts +6 -0
  72. package/dist/components/examples/InputGroupExample.js +21 -0
  73. package/dist/components/examples/MultiSelectExample.d.ts +7 -0
  74. package/dist/components/examples/MultiSelectExample.js +27 -0
  75. package/dist/components/examples/SearchableSelectExample.d.ts +6 -0
  76. package/dist/components/examples/SearchableSelectExample.js +17 -0
  77. package/dist/components/examples/SelectExample.d.ts +4 -0
  78. package/dist/components/examples/SelectExample.js +15 -0
  79. package/dist/components/examples/StackingModals.d.ts +4 -0
  80. package/dist/components/examples/StackingModals.js +15 -0
  81. package/dist/components/examples/TableExample.d.ts +9 -0
  82. package/dist/components/examples/TableExample.js +92 -0
  83. package/dist/components/examples/TextareaExample.d.ts +6 -0
  84. package/dist/components/examples/TextareaExample.js +10 -0
  85. package/dist/components/examples/TileExample.d.ts +9 -0
  86. package/dist/components/examples/TileExample.js +9 -0
  87. package/dist/components/examples/Title.js +1 -0
  88. package/dist/components/examples/date/DateTimePickerExample.d.ts +10 -0
  89. package/dist/components/examples/date/DateTimePickerExample.js +21 -0
  90. package/dist/components/examples/properties/CheckboxPropertyExample.d.ts +8 -0
  91. package/dist/components/examples/properties/CheckboxPropertyExample.js +13 -0
  92. package/dist/components/examples/properties/DatePropertyExample.d.ts +8 -0
  93. package/dist/components/examples/properties/DatePropertyExample.js +23 -0
  94. package/dist/components/examples/properties/MultiSelectPropertyExample.d.ts +8 -0
  95. package/dist/components/examples/properties/MultiSelectPropertyExample.js +16 -0
  96. package/dist/components/examples/properties/NumberPropertyExample.d.ts +6 -0
  97. package/dist/components/examples/properties/NumberPropertyExample.js +13 -0
  98. package/dist/components/examples/properties/SelectPropertyExample.d.ts +6 -0
  99. package/dist/components/examples/properties/SelectPropertyExample.js +18 -0
  100. package/dist/components/examples/properties/TextPropertyExample.d.ts +8 -0
  101. package/dist/components/examples/properties/TextPropertyExample.js +13 -0
  102. package/dist/components/icons/Helpwave.d.ts +10 -0
  103. package/dist/components/icons/Helpwave.js +20 -0
  104. package/dist/components/icons/Tag.d.ts +10 -0
  105. package/dist/components/icons/Tag.js +12 -0
  106. package/dist/components/layout/Carousel.d.ts +22 -0
  107. package/dist/components/layout/Carousel.js +233 -0
  108. package/dist/components/layout/DividerInserter.d.ts +11 -0
  109. package/dist/components/layout/DividerInserter.js +20 -0
  110. package/dist/components/layout/FAQSection.d.ts +23 -0
  111. package/dist/components/layout/FAQSection.js +14 -0
  112. package/dist/components/layout/Tile.d.ts +34 -0
  113. package/dist/components/layout/Tile.js +18 -0
  114. package/dist/components/modals/ConfirmDialog.d.ts +34 -0
  115. package/dist/components/modals/ConfirmDialog.js +31 -0
  116. package/dist/components/modals/DiscardChangesDialog.d.ts +19 -0
  117. package/dist/components/modals/DiscardChangesDialog.js +24 -0
  118. package/dist/components/modals/InputModal.d.ts +9 -0
  119. package/dist/components/modals/InputModal.js +9 -0
  120. package/dist/components/modals/LanguageModal.d.ts +17 -0
  121. package/dist/components/modals/LanguageModal.js +35 -0
  122. package/dist/components/modals/Modal.d.ts +38 -0
  123. package/dist/components/modals/Modal.js +57 -0
  124. package/dist/components/modals/ModalRegister.d.ts +11 -0
  125. package/dist/components/modals/ModalRegister.js +28 -0
  126. package/dist/components/properties/CheckboxProperty.d.ts +15 -0
  127. package/dist/components/properties/CheckboxProperty.js +27 -0
  128. package/dist/components/properties/DateProperty.d.ts +11 -0
  129. package/dist/components/properties/DateProperty.js +22 -0
  130. package/dist/components/properties/MultiSelectProperty.d.ts +12 -0
  131. package/dist/components/properties/MultiSelectProperty.js +33 -0
  132. package/dist/components/properties/NumberProperty.d.ts +16 -0
  133. package/dist/components/properties/NumberProperty.js +42 -0
  134. package/dist/components/properties/PropertyBase.d.ts +23 -0
  135. package/dist/components/properties/PropertyBase.js +27 -0
  136. package/dist/components/properties/SelectProperty.d.ts +12 -0
  137. package/dist/components/properties/SelectProperty.js +22 -0
  138. package/dist/components/properties/TextProperty.d.ts +15 -0
  139. package/dist/components/properties/TextProperty.js +37 -0
  140. package/dist/components/user-input/Checkbox.d.ts +37 -0
  141. package/dist/components/user-input/Checkbox.js +63 -0
  142. package/dist/components/user-input/DateAndTimePicker.d.ts +39 -0
  143. package/dist/components/user-input/DateAndTimePicker.js +65 -0
  144. package/dist/components/user-input/Input.d.ts +61 -0
  145. package/dist/components/user-input/Input.js +61 -0
  146. package/dist/components/user-input/Label.d.ts +12 -0
  147. package/dist/components/user-input/Label.js +12 -0
  148. package/dist/components/user-input/Menu.d.ts +21 -0
  149. package/dist/components/user-input/Menu.js +26 -0
  150. package/dist/components/user-input/MultiSelect.d.ts +39 -0
  151. package/dist/components/user-input/MultiSelect.js +57 -0
  152. package/dist/components/user-input/ScrollPicker.d.ts +11 -0
  153. package/dist/components/user-input/ScrollPicker.js +151 -0
  154. package/dist/components/user-input/SearchableSelect.d.ts +8 -0
  155. package/dist/components/user-input/SearchableSelect.js +14 -0
  156. package/dist/components/user-input/Select.d.ts +32 -0
  157. package/dist/components/user-input/Select.js +48 -0
  158. package/dist/components/user-input/Textarea.d.ts +20 -0
  159. package/dist/components/user-input/Textarea.js +33 -0
  160. package/dist/components/user-input/ToggleableInput.d.ts +32 -0
  161. package/dist/components/user-input/ToggleableInput.js +40 -0
  162. package/{globals.css → dist/css/globals.css} +1 -1
  163. package/dist/hooks/useHoverState.d.ts +40 -0
  164. package/dist/hooks/useHoverState.js +46 -0
  165. package/dist/hooks/useLanguage.d.ts +17 -0
  166. package/dist/hooks/useLanguage.js +51 -0
  167. package/dist/hooks/useLocalStorage.d.ts +4 -0
  168. package/dist/hooks/useLocalStorage.js +24 -0
  169. package/dist/hooks/useOutsideClick.d.ts +2 -0
  170. package/dist/hooks/useOutsideClick.js +22 -0
  171. package/dist/hooks/useSaveDelay.d.ts +5 -0
  172. package/dist/hooks/useSaveDelay.js +41 -0
  173. package/dist/hooks/useTheme.d.ts +16 -0
  174. package/dist/hooks/useTheme.js +32 -0
  175. package/dist/hooks/useTranslation.d.ts +24 -0
  176. package/dist/hooks/useTranslation.js +11 -0
  177. package/dist/util/array.d.ts +23 -0
  178. package/dist/util/array.js +103 -0
  179. package/{util/builder.ts → dist/util/builder.d.ts} +1 -4
  180. package/dist/util/builder.js +9 -0
  181. package/dist/util/date.d.ts +28 -0
  182. package/dist/util/date.js +133 -0
  183. package/dist/util/easeFunctions.d.ts +9 -0
  184. package/dist/util/easeFunctions.js +30 -0
  185. package/dist/util/emailValidation.d.ts +1 -0
  186. package/dist/util/emailValidation.js +3 -0
  187. package/dist/util/loopingArray.d.ts +23 -0
  188. package/dist/util/loopingArray.js +67 -0
  189. package/dist/util/math.d.ts +1 -0
  190. package/dist/util/math.js +3 -0
  191. package/dist/util/news.d.ts +98 -0
  192. package/dist/util/news.js +27 -0
  193. package/dist/util/noop.d.ts +1 -0
  194. package/dist/util/noop.js +1 -0
  195. package/{util/simpleSearch.ts → dist/util/simpleSearch.d.ts} +4 -21
  196. package/dist/util/simpleSearch.js +62 -0
  197. package/dist/util/storage.d.ts +15 -0
  198. package/dist/util/storage.js +32 -0
  199. package/dist/util/types.d.ts +1 -0
  200. package/dist/util/types.js +1 -0
  201. package/package.json +7 -8
  202. package/coloring/shading.ts +0 -46
  203. package/coloring/types.ts +0 -13
  204. package/components/Avatar.tsx +0 -58
  205. package/components/AvatarGroup.tsx +0 -48
  206. package/components/BreadCrumb.tsx +0 -35
  207. package/components/Button.tsx +0 -236
  208. package/components/ChipList.tsx +0 -89
  209. package/components/Circle.tsx +0 -27
  210. package/components/ErrorComponent.tsx +0 -40
  211. package/components/Expandable.tsx +0 -61
  212. package/components/HelpwaveBadge.tsx +0 -35
  213. package/components/HideableContentSection.tsx +0 -43
  214. package/components/InputGroup.tsx +0 -72
  215. package/components/LoadingAndErrorComponent.tsx +0 -47
  216. package/components/LoadingAnimation.tsx +0 -40
  217. package/components/LoadingButton.tsx +0 -27
  218. package/components/MarkdownInterpreter.tsx +0 -278
  219. package/components/Pagination.tsx +0 -65
  220. package/components/Profile.tsx +0 -124
  221. package/components/ProgressIndicator.tsx +0 -58
  222. package/components/Ring.tsx +0 -286
  223. package/components/SearchableList.tsx +0 -69
  224. package/components/SortButton.tsx +0 -33
  225. package/components/StepperBar.tsx +0 -124
  226. package/components/Table.tsx +0 -330
  227. package/components/TechRadar.tsx +0 -247
  228. package/components/TextImage.tsx +0 -86
  229. package/components/TimeDisplay.tsx +0 -121
  230. package/components/Tooltip.tsx +0 -92
  231. package/components/VerticalDivider.tsx +0 -51
  232. package/components/date/DatePicker.tsx +0 -164
  233. package/components/date/DayPicker.tsx +0 -95
  234. package/components/date/TimePicker.tsx +0 -167
  235. package/components/date/YearMonthPicker.tsx +0 -130
  236. package/components/examples/InputGroupExample.tsx +0 -58
  237. package/components/examples/MultiSelectExample.tsx +0 -57
  238. package/components/examples/SearchableSelectExample.tsx +0 -34
  239. package/components/examples/SelectExample.tsx +0 -28
  240. package/components/examples/StackingModals.tsx +0 -54
  241. package/components/examples/TableExample.tsx +0 -159
  242. package/components/examples/TextareaExample.tsx +0 -23
  243. package/components/examples/TileExample.tsx +0 -25
  244. package/components/examples/date/DateTimePickerExample.tsx +0 -53
  245. package/components/examples/properties/CheckboxPropertyExample.tsx +0 -29
  246. package/components/examples/properties/DatePropertyExample.tsx +0 -44
  247. package/components/examples/properties/MultiSelectPropertyExample.tsx +0 -39
  248. package/components/examples/properties/NumberPropertyExample.tsx +0 -28
  249. package/components/examples/properties/SelectPropertyExample.tsx +0 -39
  250. package/components/examples/properties/TextPropertyExample.tsx +0 -30
  251. package/components/icons/Helpwave.tsx +0 -51
  252. package/components/icons/Tag.tsx +0 -29
  253. package/components/layout/Carousel.tsx +0 -396
  254. package/components/layout/DividerInserter.tsx +0 -37
  255. package/components/layout/FAQSection.tsx +0 -57
  256. package/components/layout/Tile.tsx +0 -67
  257. package/components/modals/ConfirmDialog.tsx +0 -105
  258. package/components/modals/DiscardChangesDialog.tsx +0 -71
  259. package/components/modals/InputModal.tsx +0 -26
  260. package/components/modals/LanguageModal.tsx +0 -76
  261. package/components/modals/Modal.tsx +0 -149
  262. package/components/modals/ModalRegister.tsx +0 -45
  263. package/components/properties/CheckboxProperty.tsx +0 -62
  264. package/components/properties/DateProperty.tsx +0 -58
  265. package/components/properties/MultiSelectProperty.tsx +0 -82
  266. package/components/properties/NumberProperty.tsx +0 -86
  267. package/components/properties/PropertyBase.tsx +0 -84
  268. package/components/properties/SelectProperty.tsx +0 -67
  269. package/components/properties/TextProperty.tsx +0 -81
  270. package/components/user-input/Checkbox.tsx +0 -139
  271. package/components/user-input/DateAndTimePicker.tsx +0 -156
  272. package/components/user-input/Input.tsx +0 -192
  273. package/components/user-input/Label.tsx +0 -32
  274. package/components/user-input/Menu.tsx +0 -75
  275. package/components/user-input/MultiSelect.tsx +0 -158
  276. package/components/user-input/ScrollPicker.tsx +0 -240
  277. package/components/user-input/SearchableSelect.tsx +0 -36
  278. package/components/user-input/Select.tsx +0 -132
  279. package/components/user-input/Textarea.tsx +0 -86
  280. package/components/user-input/ToggleableInput.tsx +0 -115
  281. package/hooks/useHoverState.ts +0 -88
  282. package/hooks/useLanguage.tsx +0 -78
  283. package/hooks/useLocalStorage.tsx +0 -33
  284. package/hooks/useOutsideClick.ts +0 -25
  285. package/hooks/useSaveDelay.ts +0 -46
  286. package/hooks/useTheme.tsx +0 -57
  287. package/hooks/useTranslation.ts +0 -43
  288. package/index.ts +0 -0
  289. package/util/array.ts +0 -115
  290. package/util/date.ts +0 -180
  291. package/util/easeFunctions.ts +0 -37
  292. package/util/emailValidation.ts +0 -3
  293. package/util/loopingArray.ts +0 -94
  294. package/util/math.ts +0 -3
  295. package/util/news.ts +0 -43
  296. package/util/noop.ts +0 -1
  297. package/util/storage.ts +0 -37
  298. package/util/types.ts +0 -4
  299. /package/{components/Span.tsx → dist/components/Span.d.ts} +0 -0
  300. /package/{components/examples/Title.tsx → dist/components/examples/Title.d.ts} +0 -0
@@ -0,0 +1,9 @@
1
+ import type { TableProps } from '../Table';
2
+ export type DataType = {
3
+ id: string;
4
+ name: string;
5
+ age: number;
6
+ };
7
+ export declare const exampleData: DataType[];
8
+ declare const TableExample: ({ data: initialData }: Pick<TableProps<DataType>, "data">) => import("react/jsx-runtime").JSX.Element;
9
+ export default TableExample;
@@ -0,0 +1,92 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { addElementToTable, defaultTableStatePagination, defaultTableStateSelection, removeFromTableSelection, Table } from '../Table';
4
+ import { Input } from '../user-input/Input';
5
+ import { SolidButton, TextButton } from '../Button';
6
+ import { SortButton } from '../SortButton';
7
+ export const exampleData = [
8
+ { id: 'data1', name: 'Name 1', age: 23 },
9
+ { id: 'data2', name: 'Name 2', age: 21 },
10
+ { id: 'data3', name: 'Name 3', age: 32 },
11
+ { id: 'data4', name: 'Name 4', age: 42 },
12
+ { id: 'data5', name: 'Name 5', age: 17 },
13
+ { id: 'data6', name: 'Name 6', age: 26 },
14
+ { id: 'data7', name: 'Name 7', age: 19 },
15
+ { id: 'data8', name: 'Name 8', age: 31 }
16
+ ];
17
+ const TableExample = ({ data: initialData }) => {
18
+ const [data, setData] = useState(initialData);
19
+ const [tableState, setTableState] = useState({
20
+ pagination: defaultTableStatePagination,
21
+ selection: defaultTableStateSelection
22
+ });
23
+ useEffect(() => {
24
+ setData(initialData);
25
+ }, [initialData]);
26
+ const [sorting, setSorting] = useState();
27
+ const [sortingKey, ascending] = sorting !== null && sorting !== void 0 ? sorting : ['', 'ascending'];
28
+ const idMapping = (data) => data.id;
29
+ const sortingFunctions = {
30
+ id: {
31
+ ascending: (t1, t2) => t1.id.localeCompare(t2.id),
32
+ descending: (t1, t2) => t1.id.localeCompare(t2.id) * -1,
33
+ },
34
+ name: {
35
+ ascending: (t1, t2) => t1.name.localeCompare(t2.name),
36
+ descending: (t1, t2) => t1.name.localeCompare(t2.name) * -1,
37
+ },
38
+ age: {
39
+ ascending: (t1, t2) => t1.age - t2.age,
40
+ descending: (t1, t2) => (t1.age - t2.age) * -1,
41
+ }
42
+ };
43
+ return (_jsxs("div", { className: "col gap-y-12 items-center", children: [_jsx(Table, { stateManagement: [tableState, (newTableState) => {
44
+ setTableState(newTableState);
45
+ setData(data);
46
+ }], data: data, identifierMapping: idMapping, rowMappingToCells: dataObject => [
47
+ _jsx("span", { className: "textstyle-title-md w-[100px] text-ellipsis overflow-hidden block", children: dataObject.id }, "id"),
48
+ _jsx(Input, { value: dataObject.name, onChange: text => {
49
+ setData(data.map(value => value.id === dataObject.id ? { ...dataObject, name: text } : value));
50
+ setSorting(undefined);
51
+ } }, "name"),
52
+ _jsx(Input, { type: "number", value: dataObject.age.toString(), onChange: text => {
53
+ setData(data.map(value => value.id === dataObject.id ? { ...dataObject, age: parseInt(text) } : value));
54
+ setSorting(undefined);
55
+ } }, "age"),
56
+ _jsx(TextButton, { color: "negative", onClick: () => {
57
+ const newData = data.filter(value => value.id !== dataObject.id);
58
+ setData(newData);
59
+ setTableState(removeFromTableSelection(tableState, [dataObject], data.length, idMapping));
60
+ }, children: "Delete" }, "delete")
61
+ ], header: [
62
+ _jsx(SortButton, { ascending: sortingKey === 'id' ? ascending : undefined, onClick: newTableSorting => {
63
+ setSorting(['id', newTableSorting]);
64
+ setData(data.sort(sortingFunctions.id[newTableSorting]));
65
+ }, children: _jsx("span", { className: "textstyle-table-header", children: "Id" }) }, "headerId"),
66
+ _jsx(SortButton, { ascending: sortingKey === 'name' ? ascending : undefined, onClick: newTableSorting => {
67
+ setSorting(['name', newTableSorting]);
68
+ setData(data.sort(sortingFunctions.name[newTableSorting]));
69
+ }, children: _jsx("span", { className: "textstyle-table-header", children: "Name" }) }, "name"),
70
+ _jsx(SortButton, { ascending: sortingKey === 'age' ? ascending : undefined, onClick: newTableSorting => {
71
+ setSorting(['age', newTableSorting]);
72
+ setData(data.sort(sortingFunctions.age[newTableSorting]));
73
+ }, children: _jsx("span", { className: "textstyle-table-header", children: "age" }, "age") }, "name"),
74
+ _jsx(_Fragment, {})
75
+ ] }), _jsxs("div", { className: "row gap-x-2", children: [_jsx(SolidButton, { className: "w-auto", onClick: () => {
76
+ const newData = {
77
+ id: Math.random().toString(),
78
+ name: 'Name ' + data.length,
79
+ age: Math.ceil(Math.random() * 100)
80
+ };
81
+ const withNewData = [...data, newData];
82
+ const sorted = sortingKey ? withNewData.sort(sortingFunctions[sortingKey][ascending]) : withNewData;
83
+ setData(sorted);
84
+ setTableState(addElementToTable(tableState, sorted, newData, idMapping));
85
+ }, children: 'Add Data' }), _jsx(TextButton, { className: "w-auto", onClick: () => {
86
+ const selectedData = data.filter((d) => { var _a; return (_a = tableState.selection) === null || _a === void 0 ? void 0 : _a.currentSelection.includes(idMapping(d)); });
87
+ const unselectedData = data.filter((d) => { var _a; return !((_a = tableState.selection) === null || _a === void 0 ? void 0 : _a.currentSelection.includes(idMapping(d))); });
88
+ setData(unselectedData);
89
+ setTableState(removeFromTableSelection(tableState, selectedData, data.length, idMapping));
90
+ }, children: 'Remove all selected' })] })] }));
91
+ };
92
+ export default TableExample;
@@ -0,0 +1,6 @@
1
+ import type { TextareaProps } from '../user-input/Textarea';
2
+ export type TextareaExampleProps = Omit<TextareaProps, 'onChange' | 'onEditCompleted'>;
3
+ /**
4
+ * Example for the Textarea component
5
+ */
6
+ export declare const TextareaExample: ({ value, ...props }: TextareaExampleProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Textarea } from '../user-input/Textarea';
4
+ /**
5
+ * Example for the Textarea component
6
+ */
7
+ export const TextareaExample = ({ value, ...props }) => {
8
+ const [text, setText] = useState(value);
9
+ return (_jsx(Textarea, { ...props, value: text, onChange: setText, onEditCompleted: setText }));
10
+ };
@@ -0,0 +1,9 @@
1
+ import type { TileProps } from '../layout/Tile';
2
+ export type TileExampleProps = Omit<TileProps, 'prefix' | 'suffix'> & {
3
+ prefix: boolean;
4
+ suffix: boolean;
5
+ };
6
+ /**
7
+ * An Example for using the tile
8
+ */
9
+ export declare const TileExample: ({ prefix, suffix, ...restProps }: TileExampleProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Info, X } from 'lucide-react';
3
+ import { Tile } from '../layout/Tile';
4
+ /**
5
+ * An Example for using the tile
6
+ */
7
+ export const TileExample = ({ prefix, suffix, ...restProps }) => {
8
+ return (_jsx(Tile, { ...restProps, prefix: prefix ? _jsx(Info, { size: 20 }) : undefined, suffix: suffix ? _jsx(X, { size: 20 }) : undefined }));
9
+ };
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,10 @@
1
+ import type { DateTimePickerProps } from '../../user-input/DateAndTimePicker';
2
+ import type { DatePickerProps } from '../../date/DatePicker';
3
+ import type { TimePickerProps } from '../../date/TimePicker';
4
+ import type { YearMonthPickerProps } from '../../date/YearMonthPicker';
5
+ import type { DayPickerProps } from '../../date/DayPicker';
6
+ export type DateTimePickerExampleProps = Omit<DateTimePickerProps, 'datePickerProps' | 'timePickerProps'> & Pick<DatePickerProps, 'initialDisplay'> & Pick<TimePickerProps, 'is24HourFormat' | 'minuteIncrement'> & Pick<YearMonthPickerProps, 'showValueOpen'> & Pick<DayPickerProps, 'markToday' | 'weekStart'>;
7
+ /**
8
+ * Example for the DateTimePicker
9
+ */
10
+ export declare const DateTimePickerExample: ({ value, onChange, onRemove, onFinish, initialDisplay, is24HourFormat, minuteIncrement, showValueOpen, markToday, weekStart, ...props }: DateTimePickerExampleProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { DateTimePicker } from '../../user-input/DateAndTimePicker';
4
+ import { noop } from '../../../util/noop';
5
+ /**
6
+ * Example for the DateTimePicker
7
+ */
8
+ export const DateTimePickerExample = ({ value, onChange = noop, onRemove = noop, onFinish = noop, initialDisplay, is24HourFormat, minuteIncrement, showValueOpen, markToday, weekStart, ...props }) => {
9
+ const [time, setTime] = useState(value);
10
+ useEffect(() => setTime(value), [value]);
11
+ return (_jsx(DateTimePicker, { ...props, value: time, onChange: date => {
12
+ onChange(date);
13
+ setTime(date);
14
+ }, onRemove: () => {
15
+ onRemove();
16
+ setTime(new Date());
17
+ }, onFinish: date => {
18
+ onFinish(date);
19
+ setTime(date);
20
+ }, timePickerProps: { is24HourFormat, minuteIncrement }, datePickerProps: { initialDisplay, dayPickerProps: { markToday, weekStart }, yearMonthPickerProps: { showValueOpen } } }));
21
+ };
@@ -0,0 +1,8 @@
1
+ import type { CheckboxPropertyProps } from '../../properties/CheckboxProperty';
2
+ export type CheckboxPropertyExampleProps = Omit<CheckboxPropertyProps, 'onChange' | 'onRemove'> & {
3
+ readOnly: boolean;
4
+ };
5
+ /**
6
+ * Example for using the CheckboxProperty
7
+ */
8
+ export declare const CheckboxPropertyExample: ({ value, ...restProps }: CheckboxPropertyExampleProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { CheckboxProperty } from '../../properties/CheckboxProperty';
4
+ /**
5
+ * Example for using the CheckboxProperty
6
+ */
7
+ export const CheckboxPropertyExample = ({ value = false, ...restProps }) => {
8
+ const [usedValue, setUsedValue] = useState(value);
9
+ useEffect(() => {
10
+ setUsedValue(value);
11
+ }, [value]);
12
+ return (_jsx(CheckboxProperty, { ...restProps, onChange: setUsedValue, value: usedValue }));
13
+ };
@@ -0,0 +1,8 @@
1
+ import type { DatePropertyProps } from '../../properties/DateProperty';
2
+ export type DatePropertyExampleProps = DatePropertyProps & {
3
+ readOnly: boolean;
4
+ };
5
+ /**
6
+ * Example for using the DateProperty
7
+ */
8
+ export declare const DatePropertyExample: ({ value, onChange, onRemove, onEditComplete, ...restProps }: DatePropertyExampleProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { DateProperty } from '../../properties/DateProperty';
4
+ import { noop } from '../../../util/noop';
5
+ /**
6
+ * Example for using the DateProperty
7
+ */
8
+ export const DatePropertyExample = ({ value, onChange = noop, onRemove = noop, onEditComplete = noop, ...restProps }) => {
9
+ const [usedDate, setUsedDate] = useState(value);
10
+ useEffect(() => {
11
+ setUsedDate(value);
12
+ }, [value]);
13
+ return (_jsx(DateProperty, { ...restProps, onChange: date => {
14
+ setUsedDate(date);
15
+ onChange(date);
16
+ }, onEditComplete: date => {
17
+ setUsedDate(date);
18
+ onEditComplete(date);
19
+ }, onRemove: () => {
20
+ setUsedDate(undefined);
21
+ onRemove();
22
+ }, value: usedDate }));
23
+ };
@@ -0,0 +1,8 @@
1
+ import type { MultiSelectPropertyProps } from '../../properties/MultiSelectProperty';
2
+ export type MultiSelectPropertyExample = Omit<MultiSelectPropertyProps<string>, 'onChange' | 'onRemove' | 'search' | 'selectedDisplay'> & {
3
+ enableSearch: boolean;
4
+ };
5
+ /**
6
+ * Example for using the MultiSelectProperty
7
+ */
8
+ export declare const MultiSelectPropertyExample: ({ options, hintText, enableSearch, ...restProps }: MultiSelectPropertyExample) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { MultiSelectProperty } from '../../properties/MultiSelectProperty';
4
+ /**
5
+ * Example for using the MultiSelectProperty
6
+ */
7
+ export const MultiSelectPropertyExample = ({ options, hintText, enableSearch, ...restProps }) => {
8
+ const [usedOptions, setUsedOptions] = useState(options);
9
+ useEffect(() => {
10
+ setUsedOptions(options);
11
+ }, [options]);
12
+ useEffect(() => {
13
+ setUsedOptions(options.map(value => ({ ...value, selected: false })));
14
+ }, [hintText, options]);
15
+ return (_jsx(MultiSelectProperty, { ...restProps, options: usedOptions, search: enableSearch ? { initialSearch: '', searchMapping: value => [value.label] } : undefined, onChange: setUsedOptions, onRemove: () => setUsedOptions(usedOptions.map(value => ({ ...value, selected: false }))), hintText: hintText }));
16
+ };
@@ -0,0 +1,6 @@
1
+ import type { NumberPropertyProps } from '../../properties/NumberProperty';
2
+ export type NumberPropertyExampleProps = Omit<NumberPropertyProps, 'onChange' | 'onRemove'>;
3
+ /**
4
+ * Example for using the NumberProperty
5
+ */
6
+ export declare const NumberPropertyExample: ({ value, ...restProps }: NumberPropertyExampleProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { NumberProperty } from '../../properties/NumberProperty';
4
+ /**
5
+ * Example for using the NumberProperty
6
+ */
7
+ export const NumberPropertyExample = ({ value, ...restProps }) => {
8
+ const [usedValue, setUsedValue] = useState(value);
9
+ useEffect(() => {
10
+ setUsedValue(value);
11
+ }, [value]);
12
+ return (_jsx(NumberProperty, { ...restProps, onChange: setUsedValue, onRemove: () => setUsedValue(undefined), value: usedValue }));
13
+ };
@@ -0,0 +1,6 @@
1
+ import type { SingleSelectPropertyProps } from '../../properties/SelectProperty';
2
+ export type SingleSelectPropertyExample = Omit<SingleSelectPropertyProps<string>, 'onChange' | 'onRemove' | 'searchMapping'>;
3
+ /**
4
+ * Example for using the SingleSelectProperty
5
+ */
6
+ export declare const SingleSelectPropertyExample: ({ value, options, hintText, ...restProps }: SingleSelectPropertyExample) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { SingleSelectProperty } from '../../properties/SelectProperty';
4
+ /**
5
+ * Example for using the SingleSelectProperty
6
+ */
7
+ export const SingleSelectPropertyExample = ({ value, options, hintText, ...restProps }) => {
8
+ const [usedValue, setUsedValue] = useState(value);
9
+ useEffect(() => {
10
+ setUsedValue(undefined);
11
+ }, [hintText]);
12
+ useEffect(() => {
13
+ if (options.find(value1 => value1.value === value)) {
14
+ setUsedValue(value);
15
+ }
16
+ }, [value, options]);
17
+ return (_jsx(SingleSelectProperty, { ...restProps, value: usedValue, options: options, searchMapping: value1 => [value1.value], onChange: setUsedValue, onRemove: () => setUsedValue(undefined), hintText: hintText }));
18
+ };
@@ -0,0 +1,8 @@
1
+ import type { TextPropertyProps } from '../../properties/TextProperty';
2
+ export type TextPropertyExampleProps = Omit<TextPropertyProps, 'onChange' | 'onRemove'> & {
3
+ readOnly: boolean;
4
+ };
5
+ /**
6
+ * Example for using the TextProperty
7
+ */
8
+ export declare const TextPropertyExample: ({ value, ...restProps }: TextPropertyExampleProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { TextProperty } from '../../properties/TextProperty';
4
+ /**
5
+ * Example for using the TextProperty
6
+ */
7
+ export const TextPropertyExample = ({ value, ...restProps }) => {
8
+ const [usedValue, setUsedValue] = useState(value);
9
+ useEffect(() => {
10
+ setUsedValue(value);
11
+ }, [value]);
12
+ return (_jsx(TextProperty, { ...restProps, onChange: setUsedValue, onRemove: () => setUsedValue(undefined), value: usedValue }));
13
+ };
@@ -0,0 +1,10 @@
1
+ import type { SVGProps } from 'react';
2
+ export type HelpwaveProps = SVGProps<SVGSVGElement> & {
3
+ color?: string;
4
+ animate?: 'none' | 'loading' | 'pulse' | 'bounce';
5
+ size?: number;
6
+ };
7
+ /**
8
+ * The helpwave loading spinner based on the svg logo.
9
+ */
10
+ export declare const Helpwave: ({ color, animate, size, ...props }: HelpwaveProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { clsx } from 'clsx';
3
+ /**
4
+ * The helpwave loading spinner based on the svg logo.
5
+ */
6
+ export const Helpwave = ({ color = 'currentColor', animate = 'none', size = 64, ...props }) => {
7
+ const isLoadingAnimation = animate === 'loading';
8
+ let svgAnimationKey = '';
9
+ if (animate === 'pulse') {
10
+ svgAnimationKey = 'animate-pulse';
11
+ }
12
+ else if (animate === 'bounce') {
13
+ svgAnimationKey = 'animate-bounce';
14
+ }
15
+ if (size < 0) {
16
+ console.error('size cannot be less than 0');
17
+ size = 64;
18
+ }
19
+ return (_jsx("svg", { width: size, height: size, viewBox: "0 0 888 888", fill: "none", strokeLinecap: "round", strokeWidth: 48, ...props, children: _jsxs("g", { className: clsx(svgAnimationKey), children: [_jsx("path", { className: clsx({ 'animate-wave-big-left-up': isLoadingAnimation }), d: "M144 543.235C144 423.259 232.164 326 340.92 326", stroke: color, strokeDasharray: "1000" }), _jsx("path", { className: clsx({ 'animate-wave-big-right-down': isLoadingAnimation }), d: "M537.84 544.104C429.084 544.104 340.92 446.844 340.92 326.869", stroke: color, strokeDasharray: "1000" }), _jsx("path", { className: clsx({ 'animate-wave-small-left-up': isLoadingAnimation }), d: "M462.223 518.035C462.223 432.133 525.348 362.495 603.217 362.495", stroke: color, strokeDasharray: "1000" }), _jsx("path", { className: clsx({ 'animate-wave-small-right-down': isLoadingAnimation }), d: "M745.001 519.773C666.696 519.773 603.218 450.136 603.218 364.233", stroke: color, strokeDasharray: "1000" })] }) }));
20
+ };
@@ -0,0 +1,10 @@
1
+ import type { ImageProps } from 'next/image';
2
+ export type TagProps = Omit<ImageProps, 'src' | 'alt'>;
3
+ /**
4
+ * Tag icon from flaticon
5
+ *
6
+ * https://www.flaticon.com/free-icon/price-tag_721550?term=label&page=1&position=8&origin=tag&related_id=721550
7
+ *
8
+ * When using it make attribution
9
+ */
10
+ export declare const TagIcon: ({ className, width, height, ...props }: TagProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Image from 'next/image';
3
+ /**
4
+ * Tag icon from flaticon
5
+ *
6
+ * https://www.flaticon.com/free-icon/price-tag_721550?term=label&page=1&position=8&origin=tag&related_id=721550
7
+ *
8
+ * When using it make attribution
9
+ */
10
+ export const TagIcon = ({ className, width = 16, height = 16, ...props }) => {
11
+ return (_jsx(Image, { ...props, width: width, height: height, alt: "", src: "https://cdn.helpwave.de/icons/label.png", className: className }));
12
+ };
@@ -0,0 +1,22 @@
1
+ import type { ReactNode } from 'react';
2
+ type CarouselProps = {
3
+ children: ReactNode[];
4
+ animationTime?: number;
5
+ isLooping?: boolean;
6
+ isAutoLooping?: boolean;
7
+ autoLoopingTimeOut?: number;
8
+ autoLoopAnimationTime?: number;
9
+ hintNext?: boolean;
10
+ arrows?: boolean;
11
+ dots?: boolean;
12
+ /**
13
+ * Percentage that is allowed to be scrolled further
14
+ */
15
+ overScrollThreshold?: number;
16
+ blurColor?: string;
17
+ className?: string;
18
+ heightClassName?: string;
19
+ widthClassName?: string;
20
+ };
21
+ export declare const Carousel: ({ children, animationTime, isLooping, isAutoLooping, autoLoopingTimeOut, autoLoopAnimationTime, hintNext, arrows, dots, overScrollThreshold, blurColor, className, heightClassName, widthClassName, }: CarouselProps) => import("react/jsx-runtime").JSX.Element;
22
+ export {};