@helpwave/hightide 0.1.11 → 0.1.13

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 (277) hide show
  1. package/dist/components/date/DatePicker.js +37 -7
  2. package/dist/components/date/DatePicker.js.map +1 -1
  3. package/dist/components/date/DatePicker.mjs +37 -7
  4. package/dist/components/date/DatePicker.mjs.map +1 -1
  5. package/dist/components/date/DayPicker.js.map +1 -1
  6. package/dist/components/date/DayPicker.mjs.map +1 -1
  7. package/dist/components/date/TimePicker.js +27 -6
  8. package/dist/components/date/TimePicker.js.map +1 -1
  9. package/dist/components/date/TimePicker.mjs +27 -6
  10. package/dist/components/date/TimePicker.mjs.map +1 -1
  11. package/dist/components/date/YearMonthPicker.js +36 -6
  12. package/dist/components/date/YearMonthPicker.js.map +1 -1
  13. package/dist/components/date/YearMonthPicker.mjs +36 -6
  14. package/dist/components/date/YearMonthPicker.mjs.map +1 -1
  15. package/dist/components/dialogs/ConfirmDialog.js +16 -2
  16. package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
  17. package/dist/components/dialogs/ConfirmDialog.mjs +16 -2
  18. package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
  19. package/dist/components/layout-and-navigation/Carousel.js +42 -9
  20. package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
  21. package/dist/components/layout-and-navigation/Carousel.mjs +42 -9
  22. package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
  23. package/dist/components/layout-and-navigation/Expandable.js +1 -1
  24. package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
  25. package/dist/components/layout-and-navigation/Expandable.mjs +1 -1
  26. package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
  27. package/dist/components/layout-and-navigation/FAQSection.js +1 -1
  28. package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
  29. package/dist/components/layout-and-navigation/FAQSection.mjs +1 -1
  30. package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
  31. package/dist/components/layout-and-navigation/Overlay.js +16 -2
  32. package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
  33. package/dist/components/layout-and-navigation/Overlay.mjs +16 -2
  34. package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
  35. package/dist/components/layout-and-navigation/Pagination.d.mts +6 -3
  36. package/dist/components/layout-and-navigation/Pagination.d.ts +6 -3
  37. package/dist/components/layout-and-navigation/Pagination.js +404 -19
  38. package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
  39. package/dist/components/layout-and-navigation/Pagination.mjs +404 -19
  40. package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
  41. package/dist/components/layout-and-navigation/SearchableList.js +187 -67
  42. package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
  43. package/dist/components/layout-and-navigation/SearchableList.mjs +183 -63
  44. package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
  45. package/dist/components/layout-and-navigation/StepperBar.js +37 -5
  46. package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
  47. package/dist/components/layout-and-navigation/StepperBar.mjs +37 -5
  48. package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
  49. package/dist/components/layout-and-navigation/TextImage.js +2 -0
  50. package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
  51. package/dist/components/layout-and-navigation/TextImage.mjs +2 -0
  52. package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
  53. package/dist/components/loading-states/LoadingAndErrorComponent.js +2 -0
  54. package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
  55. package/dist/components/loading-states/LoadingAndErrorComponent.mjs +2 -0
  56. package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
  57. package/dist/components/loading-states/LoadingAnimation.js +2 -0
  58. package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
  59. package/dist/components/loading-states/LoadingAnimation.mjs +2 -0
  60. package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
  61. package/dist/components/loading-states/LoadingButton.js +9 -0
  62. package/dist/components/loading-states/LoadingButton.js.map +1 -1
  63. package/dist/components/loading-states/LoadingButton.mjs +9 -0
  64. package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
  65. package/dist/components/modals/ConfirmModal.js +16 -2
  66. package/dist/components/modals/ConfirmModal.js.map +1 -1
  67. package/dist/components/modals/ConfirmModal.mjs +16 -2
  68. package/dist/components/modals/ConfirmModal.mjs.map +1 -1
  69. package/dist/components/modals/DiscardChangesModal.js +16 -2
  70. package/dist/components/modals/DiscardChangesModal.js.map +1 -1
  71. package/dist/components/modals/DiscardChangesModal.mjs +16 -2
  72. package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
  73. package/dist/components/modals/InputModal.d.mts +1 -0
  74. package/dist/components/modals/InputModal.d.ts +1 -0
  75. package/dist/components/modals/InputModal.js +196 -76
  76. package/dist/components/modals/InputModal.js.map +1 -1
  77. package/dist/components/modals/InputModal.mjs +189 -69
  78. package/dist/components/modals/InputModal.mjs.map +1 -1
  79. package/dist/components/modals/LanguageModal.js +203 -83
  80. package/dist/components/modals/LanguageModal.js.map +1 -1
  81. package/dist/components/modals/LanguageModal.mjs +192 -72
  82. package/dist/components/modals/LanguageModal.mjs.map +1 -1
  83. package/dist/components/modals/ThemeModal.js +206 -86
  84. package/dist/components/modals/ThemeModal.js.map +1 -1
  85. package/dist/components/modals/ThemeModal.mjs +193 -73
  86. package/dist/components/modals/ThemeModal.mjs.map +1 -1
  87. package/dist/components/properties/CheckboxProperty.js +17 -5
  88. package/dist/components/properties/CheckboxProperty.js.map +1 -1
  89. package/dist/components/properties/CheckboxProperty.mjs +17 -5
  90. package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
  91. package/dist/components/properties/DateProperty.js +182 -65
  92. package/dist/components/properties/DateProperty.js.map +1 -1
  93. package/dist/components/properties/DateProperty.mjs +179 -62
  94. package/dist/components/properties/DateProperty.mjs.map +1 -1
  95. package/dist/components/properties/MultiSelectProperty.js +194 -74
  96. package/dist/components/properties/MultiSelectProperty.js.map +1 -1
  97. package/dist/components/properties/MultiSelectProperty.mjs +187 -67
  98. package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
  99. package/dist/components/properties/NumberProperty.js +182 -65
  100. package/dist/components/properties/NumberProperty.js.map +1 -1
  101. package/dist/components/properties/NumberProperty.mjs +179 -62
  102. package/dist/components/properties/NumberProperty.mjs.map +1 -1
  103. package/dist/components/properties/PropertyBase.js +12 -1
  104. package/dist/components/properties/PropertyBase.js.map +1 -1
  105. package/dist/components/properties/PropertyBase.mjs +12 -1
  106. package/dist/components/properties/PropertyBase.mjs.map +1 -1
  107. package/dist/components/properties/SelectProperty.js +194 -74
  108. package/dist/components/properties/SelectProperty.js.map +1 -1
  109. package/dist/components/properties/SelectProperty.mjs +187 -67
  110. package/dist/components/properties/SelectProperty.mjs.map +1 -1
  111. package/dist/components/properties/TextProperty.js +43 -34
  112. package/dist/components/properties/TextProperty.js.map +1 -1
  113. package/dist/components/properties/TextProperty.mjs +43 -34
  114. package/dist/components/properties/TextProperty.mjs.map +1 -1
  115. package/dist/components/table/FillerRowElement.d.mts +8 -0
  116. package/dist/components/table/FillerRowElement.d.ts +8 -0
  117. package/dist/components/table/FillerRowElement.js +36 -0
  118. package/dist/components/table/FillerRowElement.js.map +1 -0
  119. package/dist/components/table/FillerRowElement.mjs +12 -0
  120. package/dist/components/table/FillerRowElement.mjs.map +1 -0
  121. package/dist/components/table/Filter.d.mts +5 -0
  122. package/dist/components/table/Filter.d.ts +5 -0
  123. package/dist/components/table/Filter.js +41 -0
  124. package/dist/components/table/Filter.js.map +1 -0
  125. package/dist/components/table/Filter.mjs +17 -0
  126. package/dist/components/table/Filter.mjs.map +1 -0
  127. package/dist/components/table/Table.d.mts +41 -0
  128. package/dist/components/table/Table.d.ts +41 -0
  129. package/dist/components/table/Table.js +1549 -0
  130. package/dist/components/table/Table.js.map +1 -0
  131. package/dist/components/table/Table.mjs +1520 -0
  132. package/dist/components/table/Table.mjs.map +1 -0
  133. package/dist/components/table/TableCell.d.mts +9 -0
  134. package/dist/components/table/TableCell.d.ts +9 -0
  135. package/dist/components/table/TableCell.js +37 -0
  136. package/dist/components/table/TableCell.js.map +1 -0
  137. package/dist/components/table/TableCell.mjs +13 -0
  138. package/dist/components/table/TableCell.mjs.map +1 -0
  139. package/dist/components/table/TableFilterButton.d.mts +11 -0
  140. package/dist/components/table/TableFilterButton.d.ts +11 -0
  141. package/dist/components/table/TableFilterButton.js +888 -0
  142. package/dist/components/table/TableFilterButton.js.map +1 -0
  143. package/dist/components/table/TableFilterButton.mjs +852 -0
  144. package/dist/components/table/TableFilterButton.mjs.map +1 -0
  145. package/dist/components/table/TableSortButton.d.mts +15 -0
  146. package/dist/components/table/TableSortButton.d.ts +15 -0
  147. package/dist/components/table/TableSortButton.js +136 -0
  148. package/dist/components/table/TableSortButton.js.map +1 -0
  149. package/dist/components/table/TableSortButton.mjs +102 -0
  150. package/dist/components/table/TableSortButton.mjs.map +1 -0
  151. package/dist/components/user-action/Button.d.mts +20 -5
  152. package/dist/components/user-action/Button.d.ts +20 -5
  153. package/dist/components/user-action/Button.js +12 -3
  154. package/dist/components/user-action/Button.js.map +1 -1
  155. package/dist/components/user-action/Button.mjs +11 -3
  156. package/dist/components/user-action/Button.mjs.map +1 -1
  157. package/dist/components/user-action/Checkbox.js +5 -4
  158. package/dist/components/user-action/Checkbox.js.map +1 -1
  159. package/dist/components/user-action/Checkbox.mjs +5 -4
  160. package/dist/components/user-action/Checkbox.mjs.map +1 -1
  161. package/dist/components/user-action/DateAndTimePicker.js +41 -9
  162. package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
  163. package/dist/components/user-action/DateAndTimePicker.mjs +41 -9
  164. package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
  165. package/dist/components/user-action/Input.d.mts +27 -7
  166. package/dist/components/user-action/Input.d.ts +27 -7
  167. package/dist/components/user-action/Input.js +173 -64
  168. package/dist/components/user-action/Input.js.map +1 -1
  169. package/dist/components/user-action/Input.mjs +172 -63
  170. package/dist/components/user-action/Input.mjs.map +1 -1
  171. package/dist/components/user-action/MultiSelect.js +195 -75
  172. package/dist/components/user-action/MultiSelect.js.map +1 -1
  173. package/dist/components/user-action/MultiSelect.mjs +187 -67
  174. package/dist/components/user-action/MultiSelect.mjs.map +1 -1
  175. package/dist/components/user-action/ScrollPicker.js +26 -5
  176. package/dist/components/user-action/ScrollPicker.js.map +1 -1
  177. package/dist/components/user-action/ScrollPicker.mjs +26 -5
  178. package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
  179. package/dist/components/user-action/Select.js +195 -75
  180. package/dist/components/user-action/Select.js.map +1 -1
  181. package/dist/components/user-action/Select.mjs +187 -67
  182. package/dist/components/user-action/Select.mjs.map +1 -1
  183. package/dist/components/user-action/Textarea.d.mts +3 -1
  184. package/dist/components/user-action/Textarea.d.ts +3 -1
  185. package/dist/components/user-action/Textarea.js +31 -33
  186. package/dist/components/user-action/Textarea.js.map +1 -1
  187. package/dist/components/user-action/Textarea.mjs +31 -33
  188. package/dist/components/user-action/Textarea.mjs.map +1 -1
  189. package/dist/components/user-action/ToggleableInput.d.mts +3 -1
  190. package/dist/components/user-action/ToggleableInput.d.ts +3 -1
  191. package/dist/components/user-action/ToggleableInput.js +31 -33
  192. package/dist/components/user-action/ToggleableInput.js.map +1 -1
  193. package/dist/components/user-action/ToggleableInput.mjs +31 -33
  194. package/dist/components/user-action/ToggleableInput.mjs.map +1 -1
  195. package/dist/css/globals.css +431 -186
  196. package/dist/css/uncompiled/globals.css +36 -493
  197. package/dist/css/uncompiled/textstyles.css +69 -0
  198. package/dist/css/uncompiled/theme/colors-basic.css +72 -0
  199. package/dist/css/uncompiled/theme/colors-component.css +143 -0
  200. package/dist/css/uncompiled/theme/colors-semantic.css +99 -0
  201. package/dist/css/uncompiled/theme/index.css +5 -0
  202. package/dist/css/uncompiled/theme/theme.css +0 -0
  203. package/dist/css/uncompiled/theme/variants.css +3 -0
  204. package/dist/css/uncompiled/utitlity/animation.css +111 -0
  205. package/dist/css/uncompiled/utitlity/borderradius.css +23 -0
  206. package/dist/css/uncompiled/utitlity/general.css +11 -0
  207. package/dist/css/uncompiled/utitlity/index.css +4 -0
  208. package/dist/css/uncompiled/utitlity/shadow.css +29 -0
  209. package/dist/hooks/useDelay.d.mts +11 -0
  210. package/dist/hooks/useDelay.d.ts +11 -0
  211. package/dist/hooks/useDelay.js +64 -0
  212. package/dist/hooks/useDelay.js.map +1 -0
  213. package/dist/hooks/useDelay.mjs +40 -0
  214. package/dist/hooks/useDelay.mjs.map +1 -0
  215. package/dist/hooks/useFocusManagement.d.mts +9 -0
  216. package/dist/hooks/useFocusManagement.d.ts +9 -0
  217. package/dist/hooks/useFocusManagement.js +84 -0
  218. package/dist/hooks/useFocusManagement.js.map +1 -0
  219. package/dist/hooks/useFocusManagement.mjs +60 -0
  220. package/dist/hooks/useFocusManagement.mjs.map +1 -0
  221. package/dist/hooks/useFocusOnceVisible.d.mts +5 -0
  222. package/dist/hooks/useFocusOnceVisible.d.ts +5 -0
  223. package/dist/hooks/useFocusOnceVisible.js +60 -0
  224. package/dist/hooks/useFocusOnceVisible.js.map +1 -0
  225. package/dist/hooks/useFocusOnceVisible.mjs +26 -0
  226. package/dist/hooks/useFocusOnceVisible.mjs.map +1 -0
  227. package/dist/hooks/useRerender.d.mts +5 -0
  228. package/dist/hooks/useRerender.d.ts +5 -0
  229. package/dist/hooks/useRerender.js +33 -0
  230. package/dist/hooks/useRerender.js.map +1 -0
  231. package/dist/hooks/useRerender.mjs +9 -0
  232. package/dist/hooks/useRerender.mjs.map +1 -0
  233. package/dist/hooks/useResizeCallbackWrapper.d.mts +11 -0
  234. package/dist/hooks/useResizeCallbackWrapper.d.ts +11 -0
  235. package/dist/hooks/useResizeCallbackWrapper.js +38 -0
  236. package/dist/hooks/useResizeCallbackWrapper.js.map +1 -0
  237. package/dist/hooks/useResizeCallbackWrapper.mjs +14 -0
  238. package/dist/hooks/useResizeCallbackWrapper.mjs.map +1 -0
  239. package/dist/index.d.mts +16 -5
  240. package/dist/index.d.ts +16 -5
  241. package/dist/index.js +1428 -860
  242. package/dist/index.js.map +1 -1
  243. package/dist/index.mjs +1370 -799
  244. package/dist/index.mjs.map +1 -1
  245. package/dist/localization/defaults/form.d.mts +1 -0
  246. package/dist/localization/defaults/form.d.ts +1 -0
  247. package/dist/localization/defaults/form.js +2 -0
  248. package/dist/localization/defaults/form.js.map +1 -1
  249. package/dist/localization/defaults/form.mjs +2 -0
  250. package/dist/localization/defaults/form.mjs.map +1 -1
  251. package/dist/util/array.d.mts +11 -5
  252. package/dist/util/array.d.ts +11 -5
  253. package/dist/util/array.js +25 -4
  254. package/dist/util/array.js.map +1 -1
  255. package/dist/util/array.mjs +25 -4
  256. package/dist/util/array.mjs.map +1 -1
  257. package/dist/util/date.js.map +1 -1
  258. package/dist/util/date.mjs.map +1 -1
  259. package/dist/util/resolveSetState.d.mts +5 -0
  260. package/dist/util/resolveSetState.d.ts +5 -0
  261. package/dist/util/resolveSetState.js +32 -0
  262. package/dist/util/resolveSetState.js.map +1 -0
  263. package/dist/util/resolveSetState.mjs +8 -0
  264. package/dist/util/resolveSetState.mjs.map +1 -0
  265. package/package.json +4 -2
  266. package/dist/components/layout-and-navigation/Table.d.mts +0 -99
  267. package/dist/components/layout-and-navigation/Table.d.ts +0 -99
  268. package/dist/components/layout-and-navigation/Table.js +0 -688
  269. package/dist/components/layout-and-navigation/Table.js.map +0 -1
  270. package/dist/components/layout-and-navigation/Table.mjs +0 -645
  271. package/dist/components/layout-and-navigation/Table.mjs.map +0 -1
  272. package/dist/hooks/useSaveDelay.d.mts +0 -6
  273. package/dist/hooks/useSaveDelay.d.ts +0 -6
  274. package/dist/hooks/useSaveDelay.js +0 -67
  275. package/dist/hooks/useSaveDelay.js.map +0 -1
  276. package/dist/hooks/useSaveDelay.mjs +0 -43
  277. package/dist/hooks/useSaveDelay.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/user-action/Button.tsx","../../../src/components/user-action/Input.tsx","../../../src/hooks/useDelay.ts","../../../src/util/noop.ts","../../../src/components/user-action/Label.tsx","../../../src/hooks/useFocusManagement.ts","../../../src/hooks/useFocusOnceVisible.ts","../../../src/components/table/TableFilterButton.tsx","../../../src/components/user-action/Menu.tsx","../../../src/hooks/useOutsideClick.ts","../../../src/hooks/useHoverState.ts","../../../src/util/PropsWithFunctionChildren.ts","../../../src/localization/LanguageProvider.tsx","../../../src/hooks/useLocalStorage.ts","../../../src/localization/util.ts","../../../src/localization/useTranslation.ts","../../../src/localization/defaults/form.ts"],"sourcesContent":["import type { ButtonHTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport clsx from 'clsx'\n\n\nexport const ButtonColorUtil = {\n solid: ['primary', 'secondary', 'tertiary', 'positive', 'warning', 'negative', 'neutral'] as const,\n text: ['primary', 'negative', 'neutral'] as const,\n outline: ['primary'] as const,\n}\n\nexport const IconButtonUtil = {\n icon: [...ButtonColorUtil.solid, 'transparent'] as const,\n}\n\n\n/**\n * The allowed colors for the SolidButton and IconButton\n */\nexport type SolidButtonColor = typeof ButtonColorUtil.solid[number]\n/**\n * The allowed colors for the OutlineButton\n */\nexport type OutlineButtonColor = typeof ButtonColorUtil.outline[number]\n/**\n * The allowed colors for the TextButton\n */\nexport type TextButtonColor = typeof ButtonColorUtil.text[number]\n/**\n * The allowed colors for the IconButton\n */\nexport type IconButtonColor = typeof IconButtonUtil.icon[number]\n\n\n/**\n * The different sizes for a button\n */\ntype ButtonSizes = 'small' | 'medium' | 'large'\n\ntype IconButtonSize = 'tiny' | 'small' | 'medium' | 'large'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}> & ButtonHTMLAttributes<Element>\n\nconst paddingMapping: Record<ButtonSizes, string> = {\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\n}\n\nconst iconPaddingMapping: Record<IconButtonSize, string> = {\n tiny: 'icon-btn-xs',\n small: 'icon-btn-sm',\n medium: 'icon-btn-md',\n large: 'icon-btn-lg'\n}\n\nexport const ButtonUtil = {\n paddingMapping,\n iconPaddingMapping\n}\n\ntype ButtonWithIconsProps = ButtonProps & {\n startIcon?: ReactNode,\n endIcon?: ReactNode,\n}\n\nexport type SolidButtonProps = ButtonWithIconsProps & {\n color?: SolidButtonColor,\n}\n\nexport type OutlineButtonProps = ButtonWithIconsProps & {\n color?: OutlineButtonColor,\n}\n\nexport type TextButtonProps = ButtonWithIconsProps & {\n color?: TextButtonColor,\n}\n\n/**\n * The shard properties between all button types\n */\nexport type IconButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: IconButtonSize,\n color?: IconButtonColor,\n}> & ButtonHTMLAttributes<Element>\n\n/**\n * A button with a solid background and different sizes\n */\nconst SolidButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: SolidButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-solid-primary-icon',\n secondary: 'text-button-solid-secondary-icon',\n tertiary: 'text-button-solid-tertiary-icon',\n positive: 'text-button-solid-positive-icon',\n warning: 'text-button-solid-warning-icon',\n negative: 'text-button-solid-negative-icon',\n neutral: 'text-button-solid-neutral-icon',\n }[color]\n\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A button with an outline border and different sizes\n */\nconst OutlineButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent border-2 border-button-outline-primary-text text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text border-disabled-outline cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-80')]: !disabled,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A text that is a button that can have different sizes\n */\nconst TextButton = ({\n children,\n disabled = false,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent text-button-text-primary-text',\n negative: 'bg-transparent text-button-text-negative-text',\n neutral: 'bg-transparent text-button-text-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-text-primary-icon',\n negative: 'text-button-text-negative-icon',\n neutral: 'text-button-text-neutral-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:bg-button-text-hover-background')]: !disabled,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n\n/**\n * A button for icons with a solid background and different sizes\n */\nconst IconButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n onClick,\n className,\n ...restProps\n }: IconButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n transparent: 'bg-transparent',\n }[color]\n\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled && color !== 'transparent',\n 'text-disabled-text cursor-not-allowed opacity-70': disabled && color === 'transparent',\n 'hover:bg-button-text-hover-background': !disabled && color === 'transparent',\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled,\n },\n ButtonUtil.iconPaddingMapping[size],\n className\n )}\n {...restProps}\n >\n {children}\n </button>\n )\n}\n\nexport { SolidButton, OutlineButton, TextButton, IconButton }\n","import React, { forwardRef, type InputHTMLAttributes, useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport clsx from 'clsx'\nimport type { UseDelayOptionsResolved } from '../../hooks/useDelay'\nimport { useDelay } from '../../hooks/useDelay'\nimport { noop } from '../../util/noop'\nimport type { LabelProps } from './Label'\nimport { Label } from './Label'\nimport { useFocusManagement } from '../../hooks/useFocusManagement'\nimport { useFocusOnceVisible } from '../../hooks/useFocusOnceVisible'\n\ntype GetInputClassNameProps = {\n disabled?: boolean,\n hasError?: boolean,\n}\nconst getInputClassName = ({ disabled = false, hasError = false }: GetInputClassNameProps) => {\n return clsx(\n 'px-2 py-1.5 rounded-md border-2',\n {\n 'bg-surface text-on-surface hover:border-primary focus:border-primary': !disabled && !hasError,\n 'bg-on-negative text-negative border-negative-border hover:border-negative-border-hover': !disabled && hasError,\n 'bg-disabled-background text-disabled-text border-disabled-border': disabled,\n }\n )\n}\n\nexport type EditCompleteOptionsResolved = {\n onBlur: boolean,\n afterDelay: boolean,\n} & Omit<UseDelayOptionsResolved, 'disabled'>\n\nexport type EditCompleteOptions = Partial<EditCompleteOptionsResolved>\n\nconst defaultEditCompleteOptions: EditCompleteOptionsResolved = {\n onBlur: true,\n afterDelay: true,\n delay: 2500\n}\n\nexport type InputProps = {\n /**\n * used for the label's `for` attribute\n */\n label?: Omit<LabelProps, 'id'>,\n /**\n * Callback for when the input's value changes\n * This is pretty much required but made optional for the rare cases where it actually isn't need such as when used with disabled\n * That could be enforced through a union type but that seems a bit overkill\n * @default noop\n */\n onChangeText?: (text: string) => void,\n className?: string,\n onEditCompleted?: (text: string) => void,\n allowEnterComplete?: boolean,\n expanded?: boolean,\n containerClassName?: string,\n editCompleteOptions?: EditCompleteOptions,\n} & Omit<InputHTMLAttributes<HTMLInputElement>, 'label'>\n\n/**\n * A Component for inputting text or other information\n *\n * Its state is managed must be managed by the parent\n */\nconst Input = forwardRef<HTMLInputElement, InputProps>(function Input({\n id,\n type = 'text',\n value,\n label,\n onChange = noop,\n onChangeText = noop,\n onEditCompleted,\n className = '',\n allowEnterComplete = true,\n expanded = true,\n autoFocus = false,\n onBlur,\n editCompleteOptions,\n containerClassName,\n disabled,\n ...restProps\n }, forwardedRef) {\n const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions }\n\n const {\n restartTimer,\n clearTimer\n } = useDelay({ delay, disabled: !afterDelay })\n\n const innerRef = useRef<HTMLInputElement>(null)\n const { focusNext } = useFocusManagement()\n\n useFocusOnceVisible(innerRef, !autoFocus)\n useImperativeHandle(forwardedRef, () => innerRef.current)\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault()\n innerRef.current?.blur()\n focusNext()\n }\n }\n\n return (\n <div className={clsx({ 'w-full': expanded }, containerClassName)}>\n {label && <Label {...label} htmlFor={id} className={clsx('mb-1', label.className)} />}\n <input\n {...restProps}\n ref={innerRef}\n value={value}\n id={id}\n type={type}\n disabled={disabled}\n className={clsx(getInputClassName({ disabled }), className)}\n onKeyDown={allowEnterComplete ? handleKeyDown : undefined}\n onBlur={event => {\n onBlur?.(event)\n if (onEditCompleted && allowEditCompleteOnBlur) {\n onEditCompleted(event.target.value)\n clearTimer()\n }\n }}\n onChange={e => {\n const value = e.target.value\n if (onEditCompleted) {\n restartTimer(() => {\n if(innerRef.current){\n innerRef.current.blur()\n if(!allowEditCompleteOnBlur) {\n onEditCompleted(value)\n }\n } else {\n onEditCompleted(value)\n }\n })\n }\n onChange(e)\n onChangeText(value)\n }}\n />\n </div>\n )\n})\n\n\n/**\n * A Component for inputting text or other information\n *\n * Its state is managed by the component itself\n */\nconst InputUncontrolled = ({\n value = '',\n onChangeText = noop,\n ...props\n }: InputProps) => {\n const [usedValue, setUsedValue] = useState(value)\n\n useEffect(() => {\n setUsedValue(value)\n }, [value])\n\n return (\n <Input\n {...props}\n value={usedValue}\n onChangeText={text => {\n setUsedValue(text)\n onChangeText(text)\n }}\n />\n )\n}\n\nexport type FormInputProps = InputHTMLAttributes<HTMLInputElement> & {\n id: string,\n labelText?: string,\n errorText?: string,\n labelClassName?: string,\n errorClassName?: string,\n containerClassName?: string,\n}\n\nconst FormInput = forwardRef<HTMLInputElement, FormInputProps>(function FormInput({\n id,\n labelText,\n errorText,\n className,\n labelClassName,\n errorClassName,\n containerClassName,\n required,\n disabled,\n ...restProps\n }, ref) {\n const input = (\n <input\n {...restProps}\n ref={ref}\n id={id}\n disabled={disabled}\n className={clsx(\n getInputClassName({ disabled, hasError: !!errorText }),\n className\n )}\n />\n )\n\n return (\n <div className={clsx('flex flex-col gap-y-1', containerClassName)}>\n {labelText && (\n <label htmlFor={id} className={clsx('textstyle-label-md', labelClassName)}>\n {labelText}\n {required && <span className=\"text-primary font-bold\">*</span>}\n </label>\n )}\n {input}\n {errorText && <label htmlFor={id} className={clsx('text-negative', errorClassName)}>{errorText}</label>}\n </div>\n )\n})\n\nexport {\n InputUncontrolled,\n Input,\n FormInput\n}\n","import { useEffect, useState } from 'react'\n\nexport type UseDelayOptionsResolved = {\n delay: number,\n disabled: boolean,\n}\n\nexport type UseDelayOptions = Partial<UseDelayOptionsResolved>\n\nconst defaultOptions: UseDelayOptionsResolved = {\n delay: 3000,\n disabled: false,\n}\n\nexport function useDelay(options?: UseDelayOptions) {\n const [timer, setTimer] = useState<NodeJS.Timeout | undefined>(undefined)\n const { delay, disabled }: UseDelayOptionsResolved = {\n ...defaultOptions,\n ...options\n }\n\n const restartTimer = (onDelayFinish: () => void) => {\n if(disabled) {\n return\n }\n clearTimeout(timer)\n setTimer(setTimeout(() => {\n onDelayFinish()\n }, delay))\n }\n\n const clearTimer = () => {\n clearTimeout(timer)\n }\n\n useEffect(() => {\n return () => {\n clearTimeout(timer)\n }\n }, [timer])\n\n useEffect(() => {\n if(disabled){\n clearTimeout(timer)\n }\n }, [disabled, timer])\n\n return { restartTimer, clearTimer }\n}","export const noop = () => undefined\n","import type { LabelHTMLAttributes } from 'react'\nimport clsx from 'clsx'\n\nexport type LabelType = 'labelSmall' | 'labelMedium' | 'labelBig'\n\nconst styleMapping: Record<LabelType, string> = {\n labelSmall: 'textstyle-label-sm',\n labelMedium: 'textstyle-label-md',\n labelBig: 'textstyle-label-lg',\n}\n\nexport type LabelProps = {\n /** The text for the label */\n name?: string,\n /** The styling for the label */\n labelType?: LabelType,\n} & LabelHTMLAttributes<HTMLLabelElement>\n\n/**\n * A Label component\n */\nexport const Label = ({\n children,\n name,\n labelType = 'labelSmall',\n className,\n ...props\n }: LabelProps) => {\n return (\n <label {...props} className={clsx(styleMapping[labelType], className)}>\n {children ? children : name}\n </label>\n )\n}\n","import { useCallback } from 'react'\n\nexport function useFocusManagement() {\n const getFocusableElements = useCallback((): HTMLElement[] => {\n return Array.from(\n document.querySelectorAll(\n 'input, button, select, textarea, a[href], [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter(\n (el): el is HTMLElement =>\n el instanceof HTMLElement &&\n !el.hasAttribute('disabled') &&\n !el.hasAttribute('hidden') &&\n el.tabIndex !== -1\n )\n }, [])\n\n const getNextFocusElement = useCallback((): HTMLElement | undefined => {\n const elements = getFocusableElements()\n if(elements.length === 0) {\n return undefined\n }\n let nextElement = elements[0]\n if(document.activeElement instanceof HTMLElement) {\n const currentIndex = elements.indexOf(document.activeElement)\n nextElement = elements[(currentIndex + 1) % elements.length]\n }\n return nextElement\n }, [getFocusableElements])\n\n const focusNext = useCallback(() => {\n const nextElement = getNextFocusElement()\n nextElement?.focus()\n }, [getNextFocusElement])\n\n const getPreviousFocusElement = useCallback((): HTMLElement | undefined => {\n const elements = getFocusableElements()\n if(elements.length === 0) {\n return undefined\n }\n let previousElement = elements[0]\n if(document.activeElement instanceof HTMLElement) {\n const currentIndex = elements.indexOf(document.activeElement)\n if(currentIndex === 0) {\n previousElement = elements[elements.length - 1]\n } else {\n previousElement = elements[currentIndex - 1]\n }\n }\n return previousElement\n }, [getFocusableElements])\n\n const focusPrevious = useCallback(() => {\n const previousElement = getPreviousFocusElement()\n if (previousElement) previousElement.focus()\n }, [getPreviousFocusElement])\n\n return {\n getFocusableElements,\n getNextFocusElement,\n getPreviousFocusElement,\n focusNext,\n focusPrevious,\n }\n}","import type { MutableRefObject } from 'react'\nimport React, { useEffect } from 'react'\n\nexport const useFocusOnceVisible = (\n ref: MutableRefObject<HTMLElement>,\n disable: boolean = false\n) => {\n const [hasUsedFocus, setHasUsedFocus] = React.useState(false)\n\n useEffect(() => {\n if (disable || hasUsedFocus) {\n return\n }\n const observer = new IntersectionObserver(([entry]) => {\n if (entry.isIntersecting && !hasUsedFocus) {\n ref.current?.focus()\n setHasUsedFocus(hasUsedFocus)\n }\n }, {\n threshold: 0.1,\n })\n\n if (ref.current) {\n observer.observe(ref.current)\n }\n\n return () => observer.disconnect()\n }, [disable, hasUsedFocus, ref])\n}","import { IconButton, SolidButton } from '../user-action/Button'\nimport { Input } from '../user-action/Input'\nimport { FilterIcon } from 'lucide-react'\nimport { Menu } from '../user-action/Menu'\nimport type { Translation } from '../../localization/useTranslation'\nimport { useTranslation } from '../../localization/useTranslation'\nimport { formTranslation } from '../../localization/defaults/form'\nimport { useEffect, useState } from 'react'\nimport type { Column } from '@tanstack/react-table'\n\nexport type TableFilterType = 'text' | 'range' | 'dateRange'\n\ntype TableFilterTranslationType = {\n filter: string,\n min: string,\n max: string,\n startDate: string,\n endDate: string,\n text: string,\n}\n\nconst defaultTableFilterTranslation: Translation<TableFilterTranslationType> = {\n en: {\n filter: 'Filter',\n min: 'Min',\n max: 'Max',\n startDate: 'Start',\n endDate: 'End',\n text: 'Text...',\n },\n de: {\n filter: 'Filter',\n min: 'Min',\n max: 'Max',\n startDate: 'Start',\n endDate: 'Ende',\n text: 'Text...',\n }\n}\n\nexport type TableFilterButtonProps<T = unknown> = {\n filterType: TableFilterType,\n column: Column<T>,\n}\n\nexport const TableFilterButton = <T, >({\n filterType,\n column,\n }: TableFilterButtonProps<T>) => {\n const translation = useTranslation([formTranslation, defaultTableFilterTranslation])\n const columnFilterValue = column.getFilterValue()\n const [filterValue, setFilterValue] = useState<unknown>(columnFilterValue)\n const hasFilter = !!filterValue\n\n useEffect(() => {\n setFilterValue(columnFilterValue)\n }, [columnFilterValue])\n\n return (\n <Menu<HTMLDivElement>\n trigger={(onClick, ref) => (\n <div ref={ref} className=\"relative\">\n <IconButton color=\"neutral\" size=\"tiny\" onClick={onClick}>\n <FilterIcon/>\n </IconButton>\n {hasFilter && (\n <div\n className=\"absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-primary pointer-events-none\"\n aria-hidden={true}\n />\n )}\n </div>\n )}\n >\n {({ close }) => (\n <div className=\"col gap-y-1 p-2 items-start font-normal text-menu-text\">\n <h4 className=\"textstyle-title-sm\">{translation('filter')}</h4>\n {filterType === 'text' && (\n <Input\n value={(filterValue ?? '') as string}\n autoFocus={true}\n placeholder={translation('text')}\n onChangeText={setFilterValue}\n className=\"h-10\"\n />\n )}\n {filterType === 'range' && (\n <div className=\"row gap-x-2 items-center\">\n <Input\n value={(filterValue as [number, number])?.[0] ?? ''}\n type=\"number\"\n placeholder={translation('min')}\n onChangeText={text => {\n const num = Number(text)\n setFilterValue((old: [number, number]) => [num, old?.[1]])\n }}\n className=\"h-10 input-indicator-hidden w-40\"\n />\n <span className=\"font-bold\">-</span>\n <Input\n value={(filterValue as [number, number])?.[1] ?? ''}\n type=\"number\"\n placeholder={translation('max')}\n onChangeText={text => {\n const num = Number(text)\n setFilterValue((old: [number, number]) => [old?.[0], num])\n }}\n className=\"h-10 input-indicator-hidden w-40\"\n />\n </div>\n )}\n {filterType === 'dateRange' && (\n <>\n <Input\n value={(filterValue as [Date, Date])?.[0] ? (filterValue as [Date, Date])?.[0].toISOString().slice(0, 16) : ''}\n type=\"datetime-local\"\n placeholder={translation('startDate')}\n onChangeText={text => {\n const value = new Date(text)\n setFilterValue((old: [Date, Date]) => [value, old?.[1]])\n }}\n className=\"h-10 w-50\"\n />\n <Input\n value={(filterValue as [Date, Date])?.[1] ? (filterValue as [Date, Date])?.[1].toISOString().slice(0, 16) : ''}\n type=\"datetime-local\"\n placeholder={translation('endDate')}\n onChangeText={text => {\n const value = new Date(text)\n setFilterValue((old: [Date, Date]) => [old?.[0], value])\n }}\n className=\"h-10 w-50\"\n />\n </>\n )}\n <div className=\"row justify-end w-full\">\n {hasFilter && (\n <SolidButton color=\"negative\" size=\"small\" onClick={() => {\n column.setFilterValue(undefined)\n close()\n }}>\n {translation('remove')}\n </SolidButton>\n )}\n <SolidButton size=\"small\" onClick={() => {\n column.setFilterValue(filterValue)\n close()\n }}>\n {translation('apply')}\n </SolidButton>\n </div>\n </div>\n )}\n </Menu>\n )\n}","import { type PropsWithChildren, type ReactNode, type RefObject, useRef } from 'react'\nimport clsx from 'clsx'\nimport { useOutsideClick } from '../../hooks/useOutsideClick'\nimport { useHoverState } from '../../hooks/useHoverState'\nimport type { PropsWithBagFunctionOrChildren } from '../../util/PropsWithFunctionChildren'\nimport { BagFunctionUtil } from '../../util/PropsWithFunctionChildren'\n\nexport type MenuItemProps = {\n onClick?: () => void,\n alignment?: 'left' | 'right',\n isDisabled?: boolean,\n className?: string,\n}\nexport const MenuItem = ({\n children,\n onClick,\n alignment = 'left',\n isDisabled = false,\n className\n }: PropsWithChildren<MenuItemProps>) => (\n <div\n className={clsx('block px-3 py-1.5 bg-menu-background first:rounded-t-lg last:rounded-b-lg text-sm font-semibold', {\n 'text-right': alignment === 'right',\n 'text-left': alignment === 'left',\n 'text-disabled-text cursor-not-allowed': isDisabled,\n 'text-menu-text hover:bg-primary/20': !isDisabled,\n 'cursor-pointer': !!onClick,\n }, className)}\n onClick={onClick}\n >\n {children}\n </div>\n)\n\ntype MenuBag = {\n isOpen: boolean,\n close: () => void,\n}\n\nexport type MenuProps<T> = PropsWithBagFunctionOrChildren<MenuBag> & {\n trigger: (onClick: () => void, ref: RefObject<T>) => ReactNode,\n /**\n * @default 'tl'\n */\n alignment?: 'tl' | 'tr' | 'bl' | 'br' | '_l' | '_r' | 't_' | 'b_',\n showOnHover?: boolean,\n menuClassName?: string,\n}\n\n/**\n * A Menu Component to allow the user to see different functions\n */\nexport const Menu = <T extends HTMLElement>({\n trigger,\n children,\n alignment = 'tl',\n showOnHover = false,\n menuClassName = '',\n }: MenuProps<T>) => {\n const { isHovered: isOpen, setIsHovered: setIsOpen, handlers } = useHoverState({ isDisabled: !showOnHover })\n const triggerRef = useRef<T>(null)\n const menuRef = useRef<HTMLDivElement>(null)\n useOutsideClick([triggerRef, menuRef], () => setIsOpen(false))\n\n const bag: MenuBag = { isOpen, close: () => setIsOpen(false) }\n\n return (\n <div\n className=\"relative\"\n {...handlers}\n >\n {trigger(() => setIsOpen(!isOpen), triggerRef)}\n <div\n ref={menuRef}\n onClick={e => e.stopPropagation()}\n className={clsx(\n 'absolute top-full mt-1 min-w-40 rounded-lg bg-menu-background text-menu-text shadow-around-lg z-10',\n {\n 'top-0': alignment[0] === 't',\n 'bottom-0': alignment[0] === 'b',\n 'left-0': alignment[1] === 'l',\n 'right-0': alignment[1] === 'r',\n 'hidden': !isOpen,\n },\n menuClassName\n )}\n >\n {BagFunctionUtil.resolve<MenuBag>(children, bag)}\n </div>\n </div>\n )\n}","import type { RefObject } from 'react'\nimport { useEffect } from 'react'\n\nexport const useOutsideClick = <Ts extends RefObject<HTMLElement>[]>(refs: Ts, handler: () => void) => {\n useEffect(() => {\n const listener = (event: MouseEvent | TouchEvent) => {\n // returning means not \"not clicking outside\"\n\n // if no target exists, return\n if (event.target === null) return\n // if the target is a ref's element or descendent thereof, return\n if (refs.some((ref) => !ref.current || ref.current.contains(event.target as Node))) {\n return\n }\n\n handler()\n }\n document.addEventListener('mousedown', listener)\n document.addEventListener('touchstart', listener)\n return () => {\n document.removeEventListener('mousedown', listener)\n document.removeEventListener('touchstart', listener)\n }\n }, [refs, handler])\n}\n","import type { Dispatch, SetStateAction } from 'react'\nimport { useEffect, useState } from 'react'\n\ntype UseHoverStateProps = {\n /**\n * The delay after which the menu is closed in milliseconds\n *\n * default: 200ms\n */\n closingDelay: number,\n /**\n * Whether the hover state management should be disabled\n *\n * default: false\n */\n isDisabled: boolean,\n}\n\ntype UseHoverStateReturnType = {\n /**\n * Whether the element is hovered\n */\n isHovered: boolean,\n /**\n * Function to change the current hover status\n */\n setIsHovered: Dispatch<SetStateAction<boolean>>,\n /**\n * Handlers to pass on to the component that should be hovered\n */\n handlers: {\n onMouseEnter: () => void,\n onMouseLeave: () => void,\n },\n}\n\nconst defaultUseHoverStateProps: UseHoverStateProps = {\n closingDelay: 200,\n isDisabled: false,\n}\n\n/**\n * @param props See UseHoverStateProps\n *\n * A react hook for managing the hover state of a component. The handlers provided should be\n * forwarded to the component which should be hovered over\n */\nexport const useHoverState = (props: Partial<UseHoverStateProps> | undefined = undefined): UseHoverStateReturnType => {\n const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props }\n\n const [isHovered, setIsHovered] = useState(false)\n const [timer, setTimer] = useState<NodeJS.Timeout>()\n\n const onMouseEnter = () => {\n if (isDisabled) {\n return\n }\n clearTimeout(timer)\n setIsHovered(true)\n }\n\n const onMouseLeave = () => {\n if (isDisabled) {\n return\n }\n setTimer(setTimeout(() => {\n setIsHovered(false)\n }, closingDelay))\n }\n\n useEffect(() => {\n if (timer) {\n return () => {\n clearTimeout(timer)\n }\n }\n })\n\n useEffect(() => {\n if (timer) {\n clearTimeout(timer)\n }\n }, [isDisabled]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return {\n isHovered, setIsHovered, handlers: { onMouseEnter, onMouseLeave }\n }\n}\n","import type { ReactNode } from 'react'\n\nexport type BagFunction<T> = (bag: T) => ReactNode\n\nexport type PropsWithBagFunction<T, P = unknown> = P & { children?: BagFunction<T> }\n\nexport type PropsWithBagFunctionOrChildren<T, P = unknown> = P & { children?: BagFunction<T> | ReactNode }\n\nconst resolve = <T>(children: BagFunction<T> | ReactNode, bag: T): ReactNode => {\n if (typeof children === 'function') {\n return (children as BagFunction<T>)(bag)\n }\n\n return children ?? undefined\n}\n\nexport const BagFunctionUtil = {\n resolve\n}","import type { Dispatch, PropsWithChildren, SetStateAction } from 'react'\nimport { createContext, useContext, useEffect, useState } from 'react'\nimport { useLocalStorage } from '../hooks/useLocalStorage'\nimport type { Language } from './util'\nimport { LanguageUtil } from './util'\n\nexport type LanguageContextValue = {\n language: Language,\n setLanguage: Dispatch<SetStateAction<Language>>,\n}\n\nexport const LanguageContext = createContext<LanguageContextValue>({\n language: LanguageUtil.DEFAULT_LANGUAGE,\n setLanguage: (v) => v\n})\n\nexport const useLanguage = () => useContext(LanguageContext)\n\nexport const useLocale = (overWriteLanguage?: Language) => {\n const { language } = useLanguage()\n const mapping: Record<Language, string> = {\n en: 'en-US',\n de: 'de-DE'\n }\n return mapping[overWriteLanguage ?? language]\n}\n\ntype LanguageProviderProps = {\n initialLanguage?: Language,\n}\n\nexport const LanguageProvider = ({ initialLanguage, children }: PropsWithChildren<LanguageProviderProps>) => {\n const [language, setLanguage] = useState<Language>(initialLanguage ?? LanguageUtil.DEFAULT_LANGUAGE)\n const [storedLanguage, setStoredLanguage] = useLocalStorage<Language>('language', initialLanguage ?? LanguageUtil.DEFAULT_LANGUAGE)\n\n useEffect(() => {\n if (language !== initialLanguage && initialLanguage) {\n console.warn('LanguageProvider initial state changed: Prefer using languageProvider\\'s setLanguage instead')\n setLanguage(initialLanguage)\n }\n }, [initialLanguage]) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n // TODO set locale of html tag here as well\n setStoredLanguage(language)\n }, [language, setStoredLanguage])\n\n useEffect(() => {\n if (storedLanguage !== null) {\n setLanguage(storedLanguage)\n return\n }\n\n const LanguageToTestAgainst = Object.values(LanguageUtil.languages)\n\n const matchingBrowserLanguage = window.navigator.languages\n .map(language => LanguageToTestAgainst.find((test) => language === test || language.split('-')[0] === test))\n .filter(entry => entry !== undefined)\n\n if (matchingBrowserLanguage.length === 0) return\n\n const firstMatch = matchingBrowserLanguage[0] as Language\n setLanguage(firstMatch)\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n <LanguageContext.Provider value={{\n language,\n setLanguage\n }}>\n {children}\n </LanguageContext.Provider>\n )\n}","import type { Dispatch, SetStateAction } from 'react'\nimport { useCallback, useEffect, useState } from 'react'\nimport { LocalStorageService } from '../util/storage'\n\ntype SetValue<T> = Dispatch<SetStateAction<T>>\nexport const useLocalStorage = <T>(key: string, initValue: T): [T, SetValue<T>] => {\n const get = useCallback((): T => {\n if (typeof window === 'undefined') {\n return initValue\n }\n const storageService = new LocalStorageService()\n const value = storageService.get<T>(key)\n return value || initValue\n }, [initValue, key])\n\n const [storedValue, setStoredValue] = useState<T>(get)\n\n const setValue: SetValue<T> = useCallback(value => {\n const newValue = value instanceof Function ? value(storedValue) : value\n const storageService = new LocalStorageService()\n storageService.set(key, value)\n\n setStoredValue(newValue)\n }, [storedValue, setStoredValue, key])\n\n useEffect(() => {\n setStoredValue(get())\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return [storedValue, setValue]\n}","/**\n * The supported languages\n */\nconst languages = ['en', 'de'] as const\n\n/**\n * The supported languages\n */\nexport type Language = typeof languages[number]\n\n/**\n * The supported languages' names in their respective language\n */\nconst languagesLocalNames: Record<Language, string> = {\n en: 'English',\n de: 'Deutsch',\n}\n\n/**\n * The default language\n */\nconst DEFAULT_LANGUAGE: Language = 'en'\n\n/**\n * A constant definition for holding data regarding languages\n */\nexport const LanguageUtil = {\n languages,\n DEFAULT_LANGUAGE,\n languagesLocalNames,\n}","import { useLanguage } from './LanguageProvider'\nimport type { Language } from './util'\n\n/**\n * A type describing the pluralization of a word\n */\nexport type TranslationPlural = {\n zero?: string,\n one?: string,\n two?: string,\n few?: string,\n many?: string,\n other: string,\n}\n\n/**\n * The type describing all values of a translation\n */\nexport type TranslationType = Record<string, string | TranslationPlural>\n\n/**\n * The type of translations\n */\nexport type Translation<T extends TranslationType> = Record<Language, T>\n\ntype OverwriteTranslationType<T extends TranslationType> = {\n language?: Language,\n translation?: Translation<Partial<T>>,\n}\n\n/**\n * Adds the `language` prop to the component props.\n *\n * @param Translation the type of the translation object\n *\n * @param Props the type of the component props, defaults to `Record<string, never>`,\n * if you don't expect any other props other than `language` and get an\n * error when using your component (because it uses `forwardRef` etc.)\n * you can try out `Record<string, unknown>`, this might resolve your\n * problem as `SomeType & never` is still `never` but `SomeType & unknown`\n * is `SomeType` which means that adding back props (like `ref` etc.)\n * works properly\n */\nexport type PropsForTranslation<\n Translation extends TranslationType,\n Props = unknown\n> = Props & {\n overwriteTranslation?: OverwriteTranslationType<Translation>,\n}\n\ntype StringKeys<T> = Extract<keyof T, string>;\n\ntype TranslationFunctionOptions = {\n replacements?: Record<string, string>,\n count?: number,\n}\ntype TranslationFunction<T extends TranslationType> = (key: StringKeys<T>, options?: TranslationFunctionOptions) => string\n\nexport const TranslationPluralCount = {\n zero: 0,\n one: 1,\n two: 2,\n few: 3,\n many: 11,\n other: -1,\n}\n\n\nexport const useTranslation = <T extends TranslationType>(\n translations: Translation<Partial<TranslationType>>[],\n overwriteTranslation: OverwriteTranslationType<T> = {}\n): TranslationFunction<T> => {\n const { language: languageProp, translation: overwrite } = overwriteTranslation\n const { language: inferredLanguage } = useLanguage()\n const usedLanguage = languageProp ?? inferredLanguage\n const usedTranslations = [...translations]\n if (overwrite) {\n usedTranslations.push(overwrite)\n }\n\n return (key: StringKeys<T>, options?: TranslationFunctionOptions): string => {\n const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options }\n\n try {\n for (let i = translations.length - 1; i >= 0; i--) {\n const translation = translations[i]\n const localizedTranslation = translation[usedLanguage]\n if (!localizedTranslation) {\n continue\n }\n const value = localizedTranslation[key]\n if(!value) {\n continue\n }\n\n let forProcessing: string\n if (typeof value !== 'string') {\n if (count === TranslationPluralCount.zero && value?.zero) {\n forProcessing = value.zero\n } else if (count === TranslationPluralCount.one && value?.one) {\n forProcessing = value.one\n } else if (count === TranslationPluralCount.two && value?.two) {\n forProcessing = value.two\n } else if (TranslationPluralCount.few <= count && count < TranslationPluralCount.many && value?.few) {\n forProcessing = value.few\n } else if (count > TranslationPluralCount.many && value?.many) {\n forProcessing = value.many\n } else {\n forProcessing = value.other\n }\n } else {\n forProcessing = value\n }\n forProcessing = forProcessing.replace(/\\{\\{(\\w+)}}/g, (_, placeholder) => {\n return replacements[placeholder] ?? `{{key:${placeholder}}}` // fallback if key is missing\n })\n return forProcessing\n }\n } catch (e) {\n console.error(e)\n }\n return `{{${usedLanguage}:${key}}}`\n }\n}","import type { Translation } from '../useTranslation'\n\nexport type FormTranslationType = {\n all: string,\n apply: string,\n back: string,\n cancel: string,\n change: string,\n clear: string,\n close: string,\n confirm: string,\n decline: string,\n delete: string,\n discard: string,\n discardChanges: string,\n done: string,\n edit: string,\n enterText: string,\n error: string,\n exit: string,\n fieldRequiredError: string,\n invalidEmailError: string,\n less: string,\n loading: string,\n maxLengthError: string,\n minLengthError: string,\n more: string,\n next: string,\n no: string,\n none: string,\n of: string,\n optional: string,\n pleaseWait: string,\n previous: string,\n remove: string,\n required: string,\n reset: string,\n save: string,\n search: string,\n select: string,\n selectOption: string,\n show: string,\n showMore: string,\n showLess: string,\n submit: string,\n success: string,\n unsavedChanges: string,\n unsavedChangesSaveQuestion: string,\n update: string,\n yes: string,\n}\n\nexport const formTranslation: Translation<FormTranslationType> = {\n en: {\n all: 'All',\n apply: 'Apply',\n back: 'Back',\n cancel: 'Cancel',\n change: 'Change',\n clear: 'Clear',\n close: 'Close',\n confirm: 'Confirm',\n decline: 'Decline',\n delete: 'Delete',\n discard: 'Discard',\n discardChanges: 'Discard Changes',\n done: 'Done',\n edit: 'Edit',\n enterText: 'Enter text here',\n error: 'Error',\n exit: 'Exit',\n fieldRequiredError: 'This field is required.',\n invalidEmailError: 'Please enter a valid email address.',\n less: 'Less',\n loading: 'Loading',\n maxLengthError: 'Maximum length exceeded.',\n minLengthError: 'Minimum length not met.',\n more: 'More',\n next: 'Next',\n no: 'No',\n none: 'None',\n of: 'of',\n optional: 'Optional',\n pleaseWait: 'Please wait...',\n previous: 'Previous',\n remove: 'Remove',\n required: 'Required',\n reset: 'Reset',\n save: 'Save',\n search: 'Search',\n select: 'Select',\n selectOption: 'Select an option',\n show: 'Show',\n showMore: 'Show more',\n showLess: 'Show less',\n submit: 'Submit',\n success: 'Success',\n update: 'Update',\n unsavedChanges: 'Unsaved Changes',\n unsavedChangesSaveQuestion: 'Do you want to save your changes?',\n yes: 'Yes',\n },\n de: {\n all: 'Alle',\n apply: 'Anwenden',\n back: 'Zurück',\n cancel: 'Abbrechen',\n change: 'Ändern',\n clear: 'Löschen',\n close: 'Schließen',\n confirm: 'Bestätigen',\n decline: 'Ablehnen',\n delete: 'Löschen',\n discard: 'Verwerfen',\n discardChanges: 'Änderungen Verwerfen',\n done: 'Fertig',\n edit: 'Bearbeiten',\n enterText: 'Text hier eingeben',\n error: 'Fehler',\n exit: 'Beenden',\n fieldRequiredError: 'Dieses Feld ist erforderlich.',\n invalidEmailError: 'Bitte geben Sie eine gültige E-Mail-Adresse ein.',\n less: 'Weniger',\n loading: 'Lädt',\n maxLengthError: 'Maximale Länge überschritten.',\n minLengthError: 'Mindestlänge nicht erreicht.',\n more: 'Mehr',\n next: 'Weiter',\n no: 'Nein',\n none: 'Nichts',\n of: 'von',\n optional: 'Optional',\n pleaseWait: 'Bitte warten...',\n previous: 'Vorherige',\n remove: 'Entfernen',\n required: 'Erforderlich',\n reset: 'Zurücksetzen',\n save: 'Speichern',\n search: 'Suche',\n select: 'Select',\n selectOption: 'Option auswählen',\n show: 'Anzeigen',\n showMore: 'Mehr anzeigen',\n showLess: 'Weniger anzeigen',\n submit: 'Abschicken',\n success: 'Erfolg',\n update: 'Update',\n unsavedChanges: 'Ungespeicherte Änderungen',\n unsavedChangesSaveQuestion: 'Möchtest du die Änderungen speichern?',\n yes: 'Ja',\n }\n}\n"],"mappings":";AACA,OAAO,UAAU;AAkIb,SAcI,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,GAAG,KAAK,CAAC;AAAA,cACzD;AAAA,cACA,WAAU;AAAA;AAAA,UACZ;AAAA,WACF;AAAA,QAEF,gBAAAC,MAAC,SAAI,WAAU,0BACZ;AAAA,uBACC,gBAAAD,KAAC,eAAY,OAAM,YAAW,MAAK,SAAQ,SAAS,MAAM;AACxD,mBAAO,eAAe,MAAS;AAC/B,kBAAM;AAAA,UACR,GACG,sBAAY,QAAQ,GACvB;AAAA,UAEF,gBAAAA,KAAC,eAAY,MAAK,SAAQ,SAAS,MAAM;AACvC,mBAAO,eAAe,WAAW;AACjC,kBAAM;AAAA,UACR,GACG,sBAAY,OAAO,GACtB;AAAA,WACF;AAAA,SACF;AAAA;AAAA,EAEJ;AAEJ;","names":["useEffect","useState","clsx","clsx","jsx","useEffect","jsx","jsxs","clsx","Input","value","FormInput","jsx","clsx","jsxs","useRef","clsx","useEffect","useEffect","useState","jsx","jsxs","useRef","jsxs","jsx","clsx","useEffect","useState","useCallback","useEffect","useState","jsx","useEffect","useState","jsx","jsxs"]}
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { IconButtonProps } from '../user-action/Button.mjs';
3
+ import { SortDirection } from '@tanstack/react-table';
4
+ import 'react';
5
+
6
+ type TableSortButtonProps = IconButtonProps & {
7
+ sortDirection: SortDirection | false;
8
+ invert?: boolean;
9
+ };
10
+ /**
11
+ * An Extension of the normal button that displays the sorting state right of the content
12
+ */
13
+ declare const TableSortButton: ({ sortDirection, invert, color, className, ...buttonProps }: TableSortButtonProps) => react_jsx_runtime.JSX.Element;
14
+
15
+ export { TableSortButton, type TableSortButtonProps };
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { IconButtonProps } from '../user-action/Button.js';
3
+ import { SortDirection } from '@tanstack/react-table';
4
+ import 'react';
5
+
6
+ type TableSortButtonProps = IconButtonProps & {
7
+ sortDirection: SortDirection | false;
8
+ invert?: boolean;
9
+ };
10
+ /**
11
+ * An Extension of the normal button that displays the sorting state right of the content
12
+ */
13
+ declare const TableSortButton: ({ sortDirection, invert, color, className, ...buttonProps }: TableSortButtonProps) => react_jsx_runtime.JSX.Element;
14
+
15
+ export { TableSortButton, type TableSortButtonProps };
@@ -0,0 +1,136 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/table/TableSortButton.tsx
30
+ var TableSortButton_exports = {};
31
+ __export(TableSortButton_exports, {
32
+ TableSortButton: () => TableSortButton
33
+ });
34
+ module.exports = __toCommonJS(TableSortButton_exports);
35
+ var import_lucide_react = require("lucide-react");
36
+
37
+ // src/components/user-action/Button.tsx
38
+ var import_clsx = __toESM(require("clsx"));
39
+ var import_jsx_runtime = require("react/jsx-runtime");
40
+ var ButtonColorUtil = {
41
+ solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
42
+ text: ["primary", "negative", "neutral"],
43
+ outline: ["primary"]
44
+ };
45
+ var IconButtonUtil = {
46
+ icon: [...ButtonColorUtil.solid, "transparent"]
47
+ };
48
+ var paddingMapping = {
49
+ small: "btn-sm",
50
+ medium: "btn-md",
51
+ large: "btn-lg"
52
+ };
53
+ var iconPaddingMapping = {
54
+ tiny: "icon-btn-xs",
55
+ small: "icon-btn-sm",
56
+ medium: "icon-btn-md",
57
+ large: "icon-btn-lg"
58
+ };
59
+ var ButtonUtil = {
60
+ paddingMapping,
61
+ iconPaddingMapping
62
+ };
63
+ var IconButton = ({
64
+ children,
65
+ disabled = false,
66
+ color = "primary",
67
+ size = "medium",
68
+ onClick,
69
+ className,
70
+ ...restProps
71
+ }) => {
72
+ const colorClasses = {
73
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
74
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
75
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
76
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
77
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
78
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
79
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
80
+ transparent: "bg-transparent"
81
+ }[color];
82
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
83
+ "button",
84
+ {
85
+ onClick: disabled ? void 0 : onClick,
86
+ disabled: disabled || onClick === void 0,
87
+ className: (0, import_clsx.default)(
88
+ {
89
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
90
+ "text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
91
+ "hover:bg-button-text-hover-background": !disabled && color === "transparent",
92
+ [(0, import_clsx.default)(colorClasses, "hover:brightness-90")]: !disabled
93
+ },
94
+ ButtonUtil.iconPaddingMapping[size],
95
+ className
96
+ ),
97
+ ...restProps,
98
+ children
99
+ }
100
+ );
101
+ };
102
+
103
+ // src/components/table/TableSortButton.tsx
104
+ var import_clsx2 = __toESM(require("clsx"));
105
+ var import_jsx_runtime2 = require("react/jsx-runtime");
106
+ var TableSortButton = ({
107
+ sortDirection,
108
+ invert = false,
109
+ color = "neutral",
110
+ className,
111
+ ...buttonProps
112
+ }) => {
113
+ let icon = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.ChevronsUpDown, { className: "w-full h-full" });
114
+ if (sortDirection) {
115
+ let usedSortDirection = sortDirection;
116
+ if (invert) {
117
+ usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
118
+ }
119
+ icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.ChevronUp, { className: "w-full h-full" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.ChevronDown, { className: "w-full h-full" });
120
+ }
121
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
122
+ IconButton,
123
+ {
124
+ size: "tiny",
125
+ color,
126
+ className: (0, import_clsx2.default)(className),
127
+ ...buttonProps,
128
+ children: icon
129
+ }
130
+ );
131
+ };
132
+ // Annotate the CommonJS export names for ESM import in node:
133
+ 0 && (module.exports = {
134
+ TableSortButton
135
+ });
136
+ //# sourceMappingURL=TableSortButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/table/TableSortButton.tsx","../../../src/components/user-action/Button.tsx"],"sourcesContent":["import { ChevronDown, ChevronsUpDown, ChevronUp } from 'lucide-react'\nimport type { IconButtonProps } from '../user-action/Button'\nimport { IconButton } from '../user-action/Button'\nimport clsx from 'clsx'\nimport type { SortDirection } from '@tanstack/react-table'\n\nexport type TableSortButtonProps = IconButtonProps & {\n sortDirection: SortDirection | false,\n invert?: boolean,\n}\n\n/**\n * An Extension of the normal button that displays the sorting state right of the content\n */\nexport const TableSortButton = ({\n sortDirection,\n invert = false,\n color = 'neutral',\n className,\n ...buttonProps\n }: TableSortButtonProps) => {\n let icon = <ChevronsUpDown className=\"w-full h-full\"/>\n if (sortDirection) {\n let usedSortDirection = sortDirection\n if (invert) {\n usedSortDirection = usedSortDirection === 'desc' ? 'asc' : 'desc'\n }\n icon = usedSortDirection === 'asc' ? (<ChevronUp className=\"w-full h-full\"/>) : (\n <ChevronDown className=\"w-full h-full\"/>)\n }\n\n return (\n <IconButton\n size=\"tiny\"\n color={color}\n className={clsx(className)}\n {...buttonProps}\n >\n {icon}\n </IconButton>\n )\n}","import type { ButtonHTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport clsx from 'clsx'\n\n\nexport const ButtonColorUtil = {\n solid: ['primary', 'secondary', 'tertiary', 'positive', 'warning', 'negative', 'neutral'] as const,\n text: ['primary', 'negative', 'neutral'] as const,\n outline: ['primary'] as const,\n}\n\nexport const IconButtonUtil = {\n icon: [...ButtonColorUtil.solid, 'transparent'] as const,\n}\n\n\n/**\n * The allowed colors for the SolidButton and IconButton\n */\nexport type SolidButtonColor = typeof ButtonColorUtil.solid[number]\n/**\n * The allowed colors for the OutlineButton\n */\nexport type OutlineButtonColor = typeof ButtonColorUtil.outline[number]\n/**\n * The allowed colors for the TextButton\n */\nexport type TextButtonColor = typeof ButtonColorUtil.text[number]\n/**\n * The allowed colors for the IconButton\n */\nexport type IconButtonColor = typeof IconButtonUtil.icon[number]\n\n\n/**\n * The different sizes for a button\n */\ntype ButtonSizes = 'small' | 'medium' | 'large'\n\ntype IconButtonSize = 'tiny' | 'small' | 'medium' | 'large'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}> & ButtonHTMLAttributes<Element>\n\nconst paddingMapping: Record<ButtonSizes, string> = {\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\n}\n\nconst iconPaddingMapping: Record<IconButtonSize, string> = {\n tiny: 'icon-btn-xs',\n small: 'icon-btn-sm',\n medium: 'icon-btn-md',\n large: 'icon-btn-lg'\n}\n\nexport const ButtonUtil = {\n paddingMapping,\n iconPaddingMapping\n}\n\ntype ButtonWithIconsProps = ButtonProps & {\n startIcon?: ReactNode,\n endIcon?: ReactNode,\n}\n\nexport type SolidButtonProps = ButtonWithIconsProps & {\n color?: SolidButtonColor,\n}\n\nexport type OutlineButtonProps = ButtonWithIconsProps & {\n color?: OutlineButtonColor,\n}\n\nexport type TextButtonProps = ButtonWithIconsProps & {\n color?: TextButtonColor,\n}\n\n/**\n * The shard properties between all button types\n */\nexport type IconButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: IconButtonSize,\n color?: IconButtonColor,\n}> & ButtonHTMLAttributes<Element>\n\n/**\n * A button with a solid background and different sizes\n */\nconst SolidButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: SolidButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-solid-primary-icon',\n secondary: 'text-button-solid-secondary-icon',\n tertiary: 'text-button-solid-tertiary-icon',\n positive: 'text-button-solid-positive-icon',\n warning: 'text-button-solid-warning-icon',\n negative: 'text-button-solid-negative-icon',\n neutral: 'text-button-solid-neutral-icon',\n }[color]\n\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A button with an outline border and different sizes\n */\nconst OutlineButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent border-2 border-button-outline-primary-text text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text border-disabled-outline cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-80')]: !disabled,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A text that is a button that can have different sizes\n */\nconst TextButton = ({\n children,\n disabled = false,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent text-button-text-primary-text',\n negative: 'bg-transparent text-button-text-negative-text',\n neutral: 'bg-transparent text-button-text-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-text-primary-icon',\n negative: 'text-button-text-negative-icon',\n neutral: 'text-button-text-neutral-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:bg-button-text-hover-background')]: !disabled,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n\n/**\n * A button for icons with a solid background and different sizes\n */\nconst IconButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n onClick,\n className,\n ...restProps\n }: IconButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n transparent: 'bg-transparent',\n }[color]\n\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled && color !== 'transparent',\n 'text-disabled-text cursor-not-allowed opacity-70': disabled && color === 'transparent',\n 'hover:bg-button-text-hover-background': !disabled && color === 'transparent',\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled,\n },\n ButtonUtil.iconPaddingMapping[size],\n className\n )}\n {...restProps}\n >\n {children}\n </button>\n )\n}\n\nexport { Solid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A,WAAW,mBAAmB,IAAI;AAAA,QAClC;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;;;AD7UA,IAAAC,eAAiB;AAkBJ,IAAAC,sBAAA;AAPN,IAAM,kBAAkB,CAAC;AAAA,EACH;AAAA,EACA,SAAS;AAAA,EACT,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,MAA4B;AACrD,MAAI,OAAO,6CAAC,sCAAe,WAAU,iBAAe;AACpD,MAAI,eAAe;AACjB,QAAI,oBAAoB;AACxB,QAAI,QAAQ;AACV,0BAAoB,sBAAsB,SAAS,QAAQ;AAAA,IAC7D;AACA,WAAO,sBAAsB,QAAS,6CAAC,iCAAU,WAAU,iBAAe,IACxE,6CAAC,mCAAY,WAAU,iBAAe;AAAA,EAC1C;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL;AAAA,MACA,eAAW,aAAAC,SAAK,SAAS;AAAA,MACxB,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":["clsx","import_clsx","import_jsx_runtime","clsx"]}
@@ -0,0 +1,102 @@
1
+ // src/components/table/TableSortButton.tsx
2
+ import { ChevronDown, ChevronsUpDown, ChevronUp } from "lucide-react";
3
+
4
+ // src/components/user-action/Button.tsx
5
+ import clsx from "clsx";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ var ButtonColorUtil = {
8
+ solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
9
+ text: ["primary", "negative", "neutral"],
10
+ outline: ["primary"]
11
+ };
12
+ var IconButtonUtil = {
13
+ icon: [...ButtonColorUtil.solid, "transparent"]
14
+ };
15
+ var paddingMapping = {
16
+ small: "btn-sm",
17
+ medium: "btn-md",
18
+ large: "btn-lg"
19
+ };
20
+ var iconPaddingMapping = {
21
+ tiny: "icon-btn-xs",
22
+ small: "icon-btn-sm",
23
+ medium: "icon-btn-md",
24
+ large: "icon-btn-lg"
25
+ };
26
+ var ButtonUtil = {
27
+ paddingMapping,
28
+ iconPaddingMapping
29
+ };
30
+ var IconButton = ({
31
+ children,
32
+ disabled = false,
33
+ color = "primary",
34
+ size = "medium",
35
+ onClick,
36
+ className,
37
+ ...restProps
38
+ }) => {
39
+ const colorClasses = {
40
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
41
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
42
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
43
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
44
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
45
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
46
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
47
+ transparent: "bg-transparent"
48
+ }[color];
49
+ return /* @__PURE__ */ jsx(
50
+ "button",
51
+ {
52
+ onClick: disabled ? void 0 : onClick,
53
+ disabled: disabled || onClick === void 0,
54
+ className: clsx(
55
+ {
56
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
57
+ "text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
58
+ "hover:bg-button-text-hover-background": !disabled && color === "transparent",
59
+ [clsx(colorClasses, "hover:brightness-90")]: !disabled
60
+ },
61
+ ButtonUtil.iconPaddingMapping[size],
62
+ className
63
+ ),
64
+ ...restProps,
65
+ children
66
+ }
67
+ );
68
+ };
69
+
70
+ // src/components/table/TableSortButton.tsx
71
+ import clsx2 from "clsx";
72
+ import { jsx as jsx2 } from "react/jsx-runtime";
73
+ var TableSortButton = ({
74
+ sortDirection,
75
+ invert = false,
76
+ color = "neutral",
77
+ className,
78
+ ...buttonProps
79
+ }) => {
80
+ let icon = /* @__PURE__ */ jsx2(ChevronsUpDown, { className: "w-full h-full" });
81
+ if (sortDirection) {
82
+ let usedSortDirection = sortDirection;
83
+ if (invert) {
84
+ usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
85
+ }
86
+ icon = usedSortDirection === "asc" ? /* @__PURE__ */ jsx2(ChevronUp, { className: "w-full h-full" }) : /* @__PURE__ */ jsx2(ChevronDown, { className: "w-full h-full" });
87
+ }
88
+ return /* @__PURE__ */ jsx2(
89
+ IconButton,
90
+ {
91
+ size: "tiny",
92
+ color,
93
+ className: clsx2(className),
94
+ ...buttonProps,
95
+ children: icon
96
+ }
97
+ );
98
+ };
99
+ export {
100
+ TableSortButton
101
+ };
102
+ //# sourceMappingURL=TableSortButton.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/table/TableSortButton.tsx","../../../src/components/user-action/Button.tsx"],"sourcesContent":["import { ChevronDown, ChevronsUpDown, ChevronUp } from 'lucide-react'\nimport type { IconButtonProps } from '../user-action/Button'\nimport { IconButton } from '../user-action/Button'\nimport clsx from 'clsx'\nimport type { SortDirection } from '@tanstack/react-table'\n\nexport type TableSortButtonProps = IconButtonProps & {\n sortDirection: SortDirection | false,\n invert?: boolean,\n}\n\n/**\n * An Extension of the normal button that displays the sorting state right of the content\n */\nexport const TableSortButton = ({\n sortDirection,\n invert = false,\n color = 'neutral',\n className,\n ...buttonProps\n }: TableSortButtonProps) => {\n let icon = <ChevronsUpDown className=\"w-full h-full\"/>\n if (sortDirection) {\n let usedSortDirection = sortDirection\n if (invert) {\n usedSortDirection = usedSortDirection === 'desc' ? 'asc' : 'desc'\n }\n icon = usedSortDirection === 'asc' ? (<ChevronUp className=\"w-full h-full\"/>) : (\n <ChevronDown className=\"w-full h-full\"/>)\n }\n\n return (\n <IconButton\n size=\"tiny\"\n color={color}\n className={clsx(className)}\n {...buttonProps}\n >\n {icon}\n </IconButton>\n )\n}","import type { ButtonHTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport clsx from 'clsx'\n\n\nexport const ButtonColorUtil = {\n solid: ['primary', 'secondary', 'tertiary', 'positive', 'warning', 'negative', 'neutral'] as const,\n text: ['primary', 'negative', 'neutral'] as const,\n outline: ['primary'] as const,\n}\n\nexport const IconButtonUtil = {\n icon: [...ButtonColorUtil.solid, 'transparent'] as const,\n}\n\n\n/**\n * The allowed colors for the SolidButton and IconButton\n */\nexport type SolidButtonColor = typeof ButtonColorUtil.solid[number]\n/**\n * The allowed colors for the OutlineButton\n */\nexport type OutlineButtonColor = typeof ButtonColorUtil.outline[number]\n/**\n * The allowed colors for the TextButton\n */\nexport type TextButtonColor = typeof ButtonColorUtil.text[number]\n/**\n * The allowed colors for the IconButton\n */\nexport type IconButtonColor = typeof IconButtonUtil.icon[number]\n\n\n/**\n * The different sizes for a button\n */\ntype ButtonSizes = 'small' | 'medium' | 'large'\n\ntype IconButtonSize = 'tiny' | 'small' | 'medium' | 'large'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}> & ButtonHTMLAttributes<Element>\n\nconst paddingMapping: Record<ButtonSizes, string> = {\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\n}\n\nconst iconPaddingMapping: Record<IconButtonSize, string> = {\n tiny: 'icon-btn-xs',\n small: 'icon-btn-sm',\n medium: 'icon-btn-md',\n large: 'icon-btn-lg'\n}\n\nexport const ButtonUtil = {\n paddingMapping,\n iconPaddingMapping\n}\n\ntype ButtonWithIconsProps = ButtonProps & {\n startIcon?: ReactNode,\n endIcon?: ReactNode,\n}\n\nexport type SolidButtonProps = ButtonWithIconsProps & {\n color?: SolidButtonColor,\n}\n\nexport type OutlineButtonProps = ButtonWithIconsProps & {\n color?: OutlineButtonColor,\n}\n\nexport type TextButtonProps = ButtonWithIconsProps & {\n color?: TextButtonColor,\n}\n\n/**\n * The shard properties between all button types\n */\nexport type IconButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: IconButtonSize,\n color?: IconButtonColor,\n}> & ButtonHTMLAttributes<Element>\n\n/**\n * A button with a solid background and different sizes\n */\nconst SolidButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: SolidButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-solid-primary-icon',\n secondary: 'text-button-solid-secondary-icon',\n tertiary: 'text-button-solid-tertiary-icon',\n positive: 'text-button-solid-positive-icon',\n warning: 'text-button-solid-warning-icon',\n negative: 'text-button-solid-negative-icon',\n neutral: 'text-button-solid-neutral-icon',\n }[color]\n\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A button with an outline border and different sizes\n */\nconst OutlineButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent border-2 border-button-outline-primary-text text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text border-disabled-outline cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-80')]: !disabled,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A text that is a button that can have different sizes\n */\nconst TextButton = ({\n children,\n disabled = false,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent text-button-text-primary-text',\n negative: 'bg-transparent text-button-text-negative-text',\n neutral: 'bg-transparent text-button-text-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-text-primary-icon',\n negative: 'text-button-text-negative-icon',\n neutral: 'text-button-text-neutral-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:bg-button-text-hover-background')]: !disabled,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n\n/**\n * A button for icons with a solid background and different sizes\n */\nconst IconButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n onClick,\n className,\n ...restProps\n }: IconButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n transparent: 'bg-transparent',\n }[color]\n\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled && color !== 'transparent',\n 'text-disabled-text cursor-not-allowed opacity-70': disabled && color === 'transparent',\n 'hover:bg-button-text-hover-background': !disabled && color === 'transparent',\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled,\n },\n ButtonUtil.iconPaddingMapping[size],\n className\n )}\n {...restProps}\n >\n {children}\n </button>\n )\n}\n\nexport { SolidButton, OutlineButton, TextButton, IconButton }\n"],"mappings":";AAAA,SAAS,aAAa,gBAAgB,iBAAiB;;;ACCvD,OAAO,UAAU;AAkIb,SAcI,KAdJ;AA/HG,IAAM,kBAAkB;AAAA,EAC7B,OAAO,CAAC,WAAW,aAAa,YAAY,YAAY,WAAW,YAAY,SAAS;AAAA,EACxF,MAAM,CAAC,WAAW,YAAY,SAAS;AAAA,EACvC,SAAS,CAAC,SAAS;AACrB;AAEO,IAAM,iBAAiB;AAAA,EAC5B,MAAM,CAAC,GAAG,gBAAgB,OAAO,aAAa;AAChD;AAsCA,IAAM,iBAA8C;AAAA,EAClD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;AAEA,IAAM,qBAAqD;AAAA,EACzD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;AAEO,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AACF;AAu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AAA,MACxB,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":["clsx","jsx"]}
@@ -6,6 +6,9 @@ declare const ButtonColorUtil: {
6
6
  text: readonly ["primary", "negative", "neutral"];
7
7
  outline: readonly ["primary"];
8
8
  };
9
+ declare const IconButtonUtil: {
10
+ icon: readonly ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral", "transparent"];
11
+ };
9
12
  /**
10
13
  * The allowed colors for the SolidButton and IconButton
11
14
  */
@@ -18,10 +21,15 @@ type OutlineButtonColor = typeof ButtonColorUtil.outline[number];
18
21
  * The allowed colors for the TextButton
19
22
  */
20
23
  type TextButtonColor = typeof ButtonColorUtil.text[number];
24
+ /**
25
+ * The allowed colors for the IconButton
26
+ */
27
+ type IconButtonColor = typeof IconButtonUtil.icon[number];
21
28
  /**
22
29
  * The different sizes for a button
23
30
  */
24
31
  type ButtonSizes = 'small' | 'medium' | 'large';
32
+ type IconButtonSize = 'tiny' | 'small' | 'medium' | 'large';
25
33
  /**
26
34
  * The shard properties between all button types
27
35
  */
@@ -33,7 +41,7 @@ type ButtonProps = PropsWithChildren<{
33
41
  }> & ButtonHTMLAttributes<Element>;
34
42
  declare const ButtonUtil: {
35
43
  paddingMapping: Record<ButtonSizes, string>;
36
- iconPaddingMapping: Record<ButtonSizes, string>;
44
+ iconPaddingMapping: Record<IconButtonSize, string>;
37
45
  };
38
46
  type ButtonWithIconsProps = ButtonProps & {
39
47
  startIcon?: ReactNode;
@@ -48,9 +56,16 @@ type OutlineButtonProps = ButtonWithIconsProps & {
48
56
  type TextButtonProps = ButtonWithIconsProps & {
49
57
  color?: TextButtonColor;
50
58
  };
51
- type IconButtonProps = ButtonProps & {
52
- color?: SolidButtonColor;
53
- };
59
+ /**
60
+ * The shard properties between all button types
61
+ */
62
+ type IconButtonProps = PropsWithChildren<{
63
+ /**
64
+ * @default 'medium'
65
+ */
66
+ size?: IconButtonSize;
67
+ color?: IconButtonColor;
68
+ }> & ButtonHTMLAttributes<Element>;
54
69
  /**
55
70
  * A button with a solid background and different sizes
56
71
  */
@@ -68,4 +83,4 @@ declare const TextButton: ({ children, disabled, color, size, startIcon, endIcon
68
83
  */
69
84
  declare const IconButton: ({ children, disabled, color, size, onClick, className, ...restProps }: IconButtonProps) => react_jsx_runtime.JSX.Element;
70
85
 
71
- export { ButtonColorUtil, type ButtonProps, ButtonUtil, IconButton, type IconButtonProps, OutlineButton, type OutlineButtonColor, type OutlineButtonProps, SolidButton, type SolidButtonColor, type SolidButtonProps, TextButton, type TextButtonColor, type TextButtonProps };
86
+ export { ButtonColorUtil, type ButtonProps, ButtonUtil, IconButton, type IconButtonColor, type IconButtonProps, IconButtonUtil, OutlineButton, type OutlineButtonColor, type OutlineButtonProps, SolidButton, type SolidButtonColor, type SolidButtonProps, TextButton, type TextButtonColor, type TextButtonProps };
@@ -6,6 +6,9 @@ declare const ButtonColorUtil: {
6
6
  text: readonly ["primary", "negative", "neutral"];
7
7
  outline: readonly ["primary"];
8
8
  };
9
+ declare const IconButtonUtil: {
10
+ icon: readonly ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral", "transparent"];
11
+ };
9
12
  /**
10
13
  * The allowed colors for the SolidButton and IconButton
11
14
  */
@@ -18,10 +21,15 @@ type OutlineButtonColor = typeof ButtonColorUtil.outline[number];
18
21
  * The allowed colors for the TextButton
19
22
  */
20
23
  type TextButtonColor = typeof ButtonColorUtil.text[number];
24
+ /**
25
+ * The allowed colors for the IconButton
26
+ */
27
+ type IconButtonColor = typeof IconButtonUtil.icon[number];
21
28
  /**
22
29
  * The different sizes for a button
23
30
  */
24
31
  type ButtonSizes = 'small' | 'medium' | 'large';
32
+ type IconButtonSize = 'tiny' | 'small' | 'medium' | 'large';
25
33
  /**
26
34
  * The shard properties between all button types
27
35
  */
@@ -33,7 +41,7 @@ type ButtonProps = PropsWithChildren<{
33
41
  }> & ButtonHTMLAttributes<Element>;
34
42
  declare const ButtonUtil: {
35
43
  paddingMapping: Record<ButtonSizes, string>;
36
- iconPaddingMapping: Record<ButtonSizes, string>;
44
+ iconPaddingMapping: Record<IconButtonSize, string>;
37
45
  };
38
46
  type ButtonWithIconsProps = ButtonProps & {
39
47
  startIcon?: ReactNode;
@@ -48,9 +56,16 @@ type OutlineButtonProps = ButtonWithIconsProps & {
48
56
  type TextButtonProps = ButtonWithIconsProps & {
49
57
  color?: TextButtonColor;
50
58
  };
51
- type IconButtonProps = ButtonProps & {
52
- color?: SolidButtonColor;
53
- };
59
+ /**
60
+ * The shard properties between all button types
61
+ */
62
+ type IconButtonProps = PropsWithChildren<{
63
+ /**
64
+ * @default 'medium'
65
+ */
66
+ size?: IconButtonSize;
67
+ color?: IconButtonColor;
68
+ }> & ButtonHTMLAttributes<Element>;
54
69
  /**
55
70
  * A button with a solid background and different sizes
56
71
  */
@@ -68,4 +83,4 @@ declare const TextButton: ({ children, disabled, color, size, startIcon, endIcon
68
83
  */
69
84
  declare const IconButton: ({ children, disabled, color, size, onClick, className, ...restProps }: IconButtonProps) => react_jsx_runtime.JSX.Element;
70
85
 
71
- export { ButtonColorUtil, type ButtonProps, ButtonUtil, IconButton, type IconButtonProps, OutlineButton, type OutlineButtonColor, type OutlineButtonProps, SolidButton, type SolidButtonColor, type SolidButtonProps, TextButton, type TextButtonColor, type TextButtonProps };
86
+ export { ButtonColorUtil, type ButtonProps, ButtonUtil, IconButton, type IconButtonColor, type IconButtonProps, IconButtonUtil, OutlineButton, type OutlineButtonColor, type OutlineButtonProps, SolidButton, type SolidButtonColor, type SolidButtonProps, TextButton, type TextButtonColor, type TextButtonProps };