@indico-data/design-system 3.18.0 → 3.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/.eslintrc.js +87 -2
  2. package/.husky/pre-commit +2 -0
  3. package/.vscode/settings.json +10 -1
  4. package/lib/components/badge/Badge.d.ts +1 -1
  5. package/lib/components/badge/Badge.stories.d.ts +1 -1
  6. package/lib/components/button/Button.d.ts +2 -2
  7. package/lib/components/button/Button.stories.d.ts +1 -1
  8. package/lib/components/button/types.d.ts +1 -1
  9. package/lib/components/card/Card.d.ts +1 -1
  10. package/lib/components/card/Card.stories.d.ts +1 -1
  11. package/lib/components/floatUI/FloatUI.d.ts +1 -1
  12. package/lib/components/floatUI/FloatUI.stories.d.ts +2 -2
  13. package/lib/components/floatUI/types.d.ts +2 -2
  14. package/lib/components/forms/checkbox/Checkbox.stories.d.ts +1 -1
  15. package/lib/components/forms/date/datePicker/DatePicker.d.ts +1 -1
  16. package/lib/components/forms/date/datePicker/DatePicker.stories.d.ts +1 -1
  17. package/lib/components/forms/date/datePicker/contants.d.ts +1 -1
  18. package/lib/components/forms/date/datePicker/types.d.ts +8 -1
  19. package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +7 -4
  20. package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.d.ts +1 -1
  21. package/lib/components/forms/date/iconTriggerDatePicker/types.d.ts +5 -0
  22. package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +4 -3
  23. package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.d.ts +1 -1
  24. package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +7 -4
  25. package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.d.ts +1 -1
  26. package/lib/components/forms/date/inputDateRangePicker/types.d.ts +7 -0
  27. package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +4 -3
  28. package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.d.ts +1 -1
  29. package/lib/components/forms/form/Form.d.ts +1 -1
  30. package/lib/components/forms/form/Form.stories.d.ts +1 -1
  31. package/lib/components/forms/input/Input.d.ts +2 -2
  32. package/lib/components/forms/input/Input.stories.d.ts +1 -1
  33. package/lib/components/forms/numberInput/NumberInput.d.ts +2 -2
  34. package/lib/components/forms/numberInput/NumberInput.stories.d.ts +1 -1
  35. package/lib/components/forms/passwordInput/PasswordInput.d.ts +1 -1
  36. package/lib/components/forms/passwordInput/PasswordInput.stories.d.ts +1 -1
  37. package/lib/components/forms/radio/Radio.stories.d.ts +1 -1
  38. package/lib/components/forms/select/Select.d.ts +4 -2
  39. package/lib/components/forms/select/Select.stories.d.ts +4 -4
  40. package/lib/components/forms/select/types.d.ts +11 -1
  41. package/lib/components/forms/subcomponents/Label.d.ts +5 -1
  42. package/lib/components/forms/subcomponents/types.d.ts +5 -0
  43. package/lib/components/forms/textarea/Textarea.d.ts +1 -1
  44. package/lib/components/forms/textarea/Textarea.stories.d.ts +1 -1
  45. package/lib/components/forms/timePicker/TimePicker.d.ts +4 -1
  46. package/lib/components/forms/timePicker/types.d.ts +5 -0
  47. package/lib/components/forms/toggle/Toggle.stories.d.ts +1 -1
  48. package/lib/components/grid/col/Col.d.ts +1 -1
  49. package/lib/components/grid/col/Col.stories.d.ts +1 -1
  50. package/lib/components/grid/container/Container.d.ts +1 -1
  51. package/lib/components/grid/container/Container.stories.d.ts +1 -1
  52. package/lib/components/grid/row/Row.d.ts +1 -1
  53. package/lib/components/grid/row/Row.stories.d.ts +1 -1
  54. package/lib/components/icons/Icon.d.ts +1 -1
  55. package/lib/components/icons/Icon.stories.d.ts +2 -2
  56. package/lib/components/icons/indicons.d.ts +1 -1
  57. package/lib/components/icons/types.d.ts +4 -4
  58. package/lib/components/loading-indicators/BarSpinner/BarSpinner.stories.d.ts +1 -1
  59. package/lib/components/loading-indicators/CirclePulse/CirclePulse.stories.d.ts +1 -1
  60. package/lib/components/menu/Menu.stories.d.ts +2 -2
  61. package/lib/components/modal/ConfirmationModal.d.ts +2 -2
  62. package/lib/components/modal/Modal.d.ts +2 -2
  63. package/lib/components/modal/Modal.stories.d.ts +6 -2
  64. package/lib/components/modal/types.d.ts +21 -7
  65. package/lib/components/pagination/Pagination.d.ts +2 -2
  66. package/lib/components/pagination/Pagination.stories.d.ts +1 -1
  67. package/lib/components/pagination/index.d.ts +1 -0
  68. package/lib/components/pagination/types.d.ts +13 -0
  69. package/lib/components/pill/Pill.d.ts +1 -1
  70. package/lib/components/pill/Pill.stories.d.ts +1 -1
  71. package/lib/components/pill/types.d.ts +2 -2
  72. package/lib/components/skeleton/Skeleton.stories.d.ts +1 -1
  73. package/lib/components/stepper/Stepper.d.ts +2 -2
  74. package/lib/components/stepper/Stepper.stories.d.ts +1 -1
  75. package/lib/components/stepper/components/BackNavigation.d.ts +2 -1
  76. package/lib/components/stepper/components/Legend.d.ts +1 -1
  77. package/lib/components/stepper/components/NextNavigation.d.ts +3 -1
  78. package/lib/components/stepper/types.d.ts +12 -1
  79. package/lib/components/table/LoadingComponent.d.ts +5 -1
  80. package/lib/components/table/Table.d.ts +1 -1
  81. package/lib/components/table/Table.stories.d.ts +2 -2
  82. package/lib/components/table/components/HorizontalStickyHeader.d.ts +4 -1
  83. package/lib/components/table/components/helpers.d.ts +1 -1
  84. package/lib/components/table/hooks/usePinnedColumnsManager.d.ts +2 -2
  85. package/lib/components/table/sampleData.d.ts +1 -1
  86. package/lib/components/table/types.d.ts +20 -2
  87. package/lib/components/table/utils/processColumns.d.ts +2 -2
  88. package/lib/components/tanstackTable/TankstackTable.types.d.ts +20 -3
  89. package/lib/components/tanstackTable/TanstackTable.d.ts +2 -2
  90. package/lib/components/tanstackTable/TanstackTable.stories.d.ts +2 -2
  91. package/lib/components/tanstackTable/__tests__/__mocks__/test-mock-data.d.ts +1 -1
  92. package/lib/components/tanstackTable/components/ActionBar/ActionBar.d.ts +2 -2
  93. package/lib/components/tanstackTable/components/ActionBar/ActionBar.stories.d.ts +1 -1
  94. package/lib/components/tanstackTable/components/NoResults/NoResults.d.ts +2 -1
  95. package/lib/components/tanstackTable/components/TableBody/TableBody.d.ts +1 -1
  96. package/lib/components/tanstackTable/components/TableHeader/TableHeader.d.ts +1 -1
  97. package/lib/components/tanstackTable/components/TableLoading/TableLoading.d.ts +1 -1
  98. package/lib/components/tanstackTable/components/TablePagination/TablePagination.d.ts +3 -1
  99. package/lib/components/tanstackTable/docs/internalSorting/InternalClientSideSorting.stories.d.ts +2 -2
  100. package/lib/components/tanstackTable/docs/pinnedColumns/PinnedColumn.stories.d.ts +2 -2
  101. package/lib/components/tanstackTable/docs/withRowClick/WithRowClick.stories.d.ts +2 -2
  102. package/lib/components/tanstackTable/helpers.d.ts +2 -2
  103. package/lib/components/tanstackTable/mock-data/table-configuration.d.ts +2 -2
  104. package/lib/components/tanstackTable/useTanstackTable.d.ts +1 -1
  105. package/lib/components/toast/Toast.stories.d.ts +1 -1
  106. package/lib/components/tooltip/Tooltip.d.ts +2 -2
  107. package/lib/components/tooltip/Tooltip.stories.d.ts +1 -1
  108. package/lib/components/truncate/Truncate.d.ts +1 -1
  109. package/lib/components/truncate/Truncate.stories.d.ts +2 -2
  110. package/lib/components/truncate/types.d.ts +1 -1
  111. package/lib/docs/BaseColorPalette/BaseColorsPalette.stories.d.ts +1 -1
  112. package/lib/docs/SemanticTokens/ColorSwatch.d.ts +1 -1
  113. package/lib/docs/SemanticTokens/SemanticTokens.stories.d.ts +1 -1
  114. package/lib/index.d.ts +165 -45
  115. package/lib/index.esm.js +253 -170
  116. package/lib/index.esm.js.map +1 -1
  117. package/lib/index.js +253 -170
  118. package/lib/index.js.map +1 -1
  119. package/lib/setup/setupIcons.d.ts +1 -1
  120. package/lib/storybook/formArgTypes.d.ts +1 -1
  121. package/lib/stylesAndAnimations/borders/BorderColor.stories.d.ts +1 -1
  122. package/lib/stylesAndAnimations/borders/BorderRadius.stories.d.ts +1 -1
  123. package/lib/stylesAndAnimations/borders/BorderStyles.stories.d.ts +1 -1
  124. package/lib/stylesAndAnimations/borders/BorderThickness.stories.d.ts +1 -1
  125. package/lib/stylesAndAnimations/colors/UtilityClasses.stories.d.ts +1 -1
  126. package/lib/stylesAndAnimations/sizing/Sizing.stories.d.ts +1 -1
  127. package/lib/stylesAndAnimations/typography/Typography.stories.d.ts +1 -1
  128. package/lib/stylesAndAnimations/utilityClasses/UtilityClassesTable.stories.d.ts +1 -1
  129. package/lib/types.d.ts +4 -4
  130. package/package.json +8 -2
  131. package/src/components/badge/Badge.stories.tsx +4 -3
  132. package/src/components/badge/Badge.tsx +2 -1
  133. package/src/components/badge/__tests__/Badge.test.tsx +1 -0
  134. package/src/components/button/Button.stories.tsx +5 -4
  135. package/src/components/button/Button.tsx +12 -22
  136. package/src/components/button/__tests__/Button.test.tsx +31 -28
  137. package/src/components/button/types.ts +1 -1
  138. package/src/components/card/Card.stories.tsx +2 -1
  139. package/src/components/card/Card.tsx +2 -1
  140. package/src/components/card/__tests__/Card.test.tsx +1 -0
  141. package/src/components/floatUI/FloatUI.stories.tsx +3 -2
  142. package/src/components/floatUI/FloatUI.tsx +6 -7
  143. package/src/components/floatUI/__tests__/FloatUI.test.tsx +5 -3
  144. package/src/components/floatUI/types.ts +2 -2
  145. package/src/components/forms/checkbox/Checkbox.stories.tsx +3 -2
  146. package/src/components/forms/checkbox/Checkbox.tsx +1 -1
  147. package/src/components/forms/checkbox/__tests__/Checkbox.test.tsx +2 -1
  148. package/src/components/forms/date/datePicker/DatePicker.stories.tsx +12 -1
  149. package/src/components/forms/date/datePicker/DatePicker.tsx +35 -25
  150. package/src/components/forms/date/datePicker/__tests__/DatePicker.test.tsx +1 -0
  151. package/src/components/forms/date/datePicker/contants.ts +1 -1
  152. package/src/components/forms/date/datePicker/types.ts +16 -8
  153. package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +16 -2
  154. package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +21 -8
  155. package/src/components/forms/date/iconTriggerDatePicker/__tests__/IconTriggerDatePicker.test.tsx +2 -1
  156. package/src/components/forms/date/iconTriggerDatePicker/types.ts +5 -0
  157. package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.tsx +4 -2
  158. package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +18 -13
  159. package/src/components/forms/date/inputDatePicker/__tests__/SingleInputDatePicker.test.tsx +4 -2
  160. package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +15 -4
  161. package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +29 -23
  162. package/src/components/forms/date/inputDateRangePicker/__tests__/InputDateRangePicker.test.tsx +2 -2
  163. package/src/components/forms/date/inputDateRangePicker/types.ts +7 -0
  164. package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +9 -5
  165. package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +18 -13
  166. package/src/components/forms/form/Form.stories.tsx +7 -6
  167. package/src/components/forms/form/Form.tsx +1 -1
  168. package/src/components/forms/form/__tests__/Form.test.tsx +7 -4
  169. package/src/components/forms/input/Input.stories.tsx +6 -3
  170. package/src/components/forms/input/Input.tsx +4 -3
  171. package/src/components/forms/input/__tests__/Input.test.tsx +5 -3
  172. package/src/components/forms/numberInput/NumberInput.stories.tsx +5 -2
  173. package/src/components/forms/numberInput/NumberInput.tsx +6 -3
  174. package/src/components/forms/numberInput/__tests__/NumberInput.test.tsx +2 -1
  175. package/src/components/forms/passwordInput/PasswordInput.stories.tsx +6 -3
  176. package/src/components/forms/passwordInput/PasswordInput.tsx +12 -3
  177. package/src/components/forms/passwordInput/__tests__/PasswordInput.test.tsx +3 -4
  178. package/src/components/forms/radio/Radio.stories.tsx +5 -2
  179. package/src/components/forms/radio/__tests__/Radio.test.tsx +3 -2
  180. package/src/components/forms/select/Select.stories.tsx +11 -9
  181. package/src/components/forms/select/Select.tsx +21 -6
  182. package/src/components/forms/select/__tests__/Select.test.tsx +2 -2
  183. package/src/components/forms/select/types.ts +13 -1
  184. package/src/components/forms/subcomponents/Label.tsx +24 -4
  185. package/src/components/forms/subcomponents/__tests__/Label.test.tsx +1 -0
  186. package/src/components/forms/subcomponents/types.ts +5 -0
  187. package/src/components/forms/textarea/Textarea.stories.tsx +5 -2
  188. package/src/components/forms/textarea/Textarea.tsx +5 -4
  189. package/src/components/forms/textarea/__tests__/Textarea.test.tsx +3 -3
  190. package/src/components/forms/timePicker/TimePicker.stories.tsx +14 -2
  191. package/src/components/forms/timePicker/TimePicker.tsx +15 -5
  192. package/src/components/forms/timePicker/__tests__/TimePicker.test.tsx +2 -1
  193. package/src/components/forms/timePicker/types.ts +5 -0
  194. package/src/components/forms/toggle/Toggle.stories.tsx +3 -2
  195. package/src/components/forms/toggle/__tests__/Toggle.test.tsx +3 -2
  196. package/src/components/grid/col/Col.stories.tsx +2 -1
  197. package/src/components/grid/col/Col.tsx +1 -1
  198. package/src/components/grid/container/Container.stories.tsx +2 -1
  199. package/src/components/grid/container/Container.tsx +1 -1
  200. package/src/components/grid/row/Row.stories.tsx +2 -1
  201. package/src/components/grid/row/Row.tsx +1 -1
  202. package/src/components/icons/Icon.stories.tsx +11 -4
  203. package/src/components/icons/Icon.tsx +4 -3
  204. package/src/components/icons/__tests__/Icon.test.tsx +1 -0
  205. package/src/components/icons/indicons.tsx +3 -3
  206. package/src/components/icons/types.ts +5 -4
  207. package/src/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +2 -1
  208. package/src/components/loading-indicators/BarSpinner/__tests__/BarSpinner.test.tsx +1 -0
  209. package/src/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +2 -1
  210. package/src/components/menu/Menu.stories.tsx +3 -2
  211. package/src/components/menu/Menu.test.tsx +1 -1
  212. package/src/components/menu/Menu.tsx +1 -1
  213. package/src/components/modal/ConfirmationModal.tsx +25 -18
  214. package/src/components/modal/Modal.stories.tsx +62 -28
  215. package/src/components/modal/Modal.tsx +9 -2
  216. package/src/components/modal/__tests__/Modal.test.tsx +1 -0
  217. package/src/components/modal/types.ts +23 -7
  218. package/src/components/pagination/Pagination.stories.tsx +14 -2
  219. package/src/components/pagination/Pagination.tsx +18 -8
  220. package/src/components/pagination/__tests__/Pagination.test.tsx +1 -0
  221. package/src/components/pagination/index.ts +1 -0
  222. package/src/components/pagination/types.ts +14 -0
  223. package/src/components/pill/Pill.stories.tsx +10 -6
  224. package/src/components/pill/Pill.tsx +2 -1
  225. package/src/components/pill/__tests__/Pill.test.tsx +4 -1
  226. package/src/components/pill/types.ts +4 -2
  227. package/src/components/skeleton/Skeleton.stories.tsx +2 -1
  228. package/src/components/skeleton/__tests__/Skeleton.test.tsx +1 -0
  229. package/src/components/stepper/Stepper.stories.tsx +20 -7
  230. package/src/components/stepper/Stepper.tsx +18 -3
  231. package/src/components/stepper/__tests__/Stepper.tests.tsx +5 -4
  232. package/src/components/stepper/components/BackNavigation.tsx +5 -3
  233. package/src/components/stepper/components/Legend.tsx +4 -3
  234. package/src/components/stepper/components/NextNavigation.tsx +15 -5
  235. package/src/components/stepper/examples/MixedExample.tsx +4 -3
  236. package/src/components/stepper/examples/OptionalStepsExample.tsx +4 -3
  237. package/src/components/stepper/examples/RequiredStepsExample.tsx +4 -3
  238. package/src/components/stepper/examples/commonExample/CommonExample.tsx +4 -3
  239. package/src/components/stepper/examples/commonExample/steps/StepOne.tsx +1 -0
  240. package/src/components/stepper/examples/commonExample/steps/StepThree.tsx +1 -0
  241. package/src/components/stepper/examples/commonExample/steps/StepTwo.tsx +1 -0
  242. package/src/components/stepper/types.ts +13 -1
  243. package/src/components/table/LoadingComponent.tsx +6 -2
  244. package/src/components/table/Table.stories.tsx +19 -5
  245. package/src/components/table/Table.tsx +16 -5
  246. package/src/components/table/__tests__/Table.test.tsx +2 -1
  247. package/src/components/table/components/HorizontalStickyHeader.tsx +14 -2
  248. package/src/components/table/components/TablePagination.tsx +1 -1
  249. package/src/components/table/components/__tests__/HorizontalStickyHeader.test.tsx +3 -3
  250. package/src/components/table/components/__tests__/TablePagination.test.tsx +1 -0
  251. package/src/components/table/components/helpers.ts +1 -1
  252. package/src/components/table/hooks/usePinnedColumnsManager.ts +7 -2
  253. package/src/components/table/sampleData.tsx +1 -3
  254. package/src/components/table/types.ts +25 -6
  255. package/src/components/table/utils/processColumns.tsx +4 -2
  256. package/src/components/tanstackTable/TankstackTable.types.ts +21 -3
  257. package/src/components/tanstackTable/TanstackTable.stories.tsx +14 -11
  258. package/src/components/tanstackTable/TanstackTable.tsx +28 -18
  259. package/src/components/tanstackTable/__tests__/TanstackTable.test.tsx +2 -1
  260. package/src/components/tanstackTable/__tests__/__mocks__/test-mock-data.tsx +2 -1
  261. package/src/components/tanstackTable/components/ActionBar/ActionBar.stories.tsx +6 -3
  262. package/src/components/tanstackTable/components/ActionBar/ActionBar.tsx +7 -3
  263. package/src/components/tanstackTable/components/ActionBar/__tests__/ActionBar.test.tsx +4 -1
  264. package/src/components/tanstackTable/components/NoResults/NoResults.tsx +9 -3
  265. package/src/components/tanstackTable/components/NoResults/__tests__/NoResult.test.tsx +1 -0
  266. package/src/components/tanstackTable/components/TableBody/TableBody.tsx +2 -1
  267. package/src/components/tanstackTable/components/TableHeader/TableHeader.tsx +3 -2
  268. package/src/components/tanstackTable/components/TableLoading/TableLoading.tsx +2 -1
  269. package/src/components/tanstackTable/components/TablePagination/TablePagination.tsx +4 -1
  270. package/src/components/tanstackTable/components/TablePagination/__tests__/TablePagination.test.tsx +1 -0
  271. package/src/components/tanstackTable/docs/internalSorting/InternalClientSideSorting.stories.tsx +5 -5
  272. package/src/components/tanstackTable/docs/pinnedColumns/PinnedColumn.stories.tsx +5 -4
  273. package/src/components/tanstackTable/docs/withRowClick/WithRowClick.stories.tsx +5 -4
  274. package/src/components/tanstackTable/helpers.ts +2 -2
  275. package/src/components/tanstackTable/mock-data/table-configuration.tsx +7 -4
  276. package/src/components/tanstackTable/useTanstackTable.tsx +1 -2
  277. package/src/components/toast/Toast.stories.tsx +2 -1
  278. package/src/components/tooltip/Tooltip.stories.tsx +3 -2
  279. package/src/components/tooltip/Tooltip.tsx +2 -2
  280. package/src/components/truncate/Truncate.stories.tsx +3 -2
  281. package/src/components/truncate/Truncate.tsx +5 -4
  282. package/src/components/truncate/__tests__/Truncate.test.tsx +1 -0
  283. package/src/components/truncate/types.ts +1 -1
  284. package/src/docs/BaseColorPalette/BaseColorPalette.tsx +1 -0
  285. package/src/docs/BaseColorPalette/BaseColorsPalette.stories.tsx +2 -1
  286. package/src/docs/BaseColorPalette/Swatch.tsx +2 -1
  287. package/src/docs/SemanticTokens/ColorSwatch.tsx +1 -1
  288. package/src/docs/SemanticTokens/SemanticTokens.stories.tsx +2 -2
  289. package/src/index.ts +1 -1
  290. package/src/setup/setupIcons.ts +2 -2
  291. package/src/storybook/formArgTypes.ts +12 -1
  292. package/src/storybook/iconNames.ts +1 -0
  293. package/src/storybookDocs/Permafrost.mdx +8 -0
  294. package/src/stylesAndAnimations/borders/BorderColor.stories.tsx +2 -1
  295. package/src/stylesAndAnimations/borders/BorderColor.tsx +0 -1
  296. package/src/stylesAndAnimations/borders/BorderRadius.stories.tsx +2 -1
  297. package/src/stylesAndAnimations/borders/BorderRadius.tsx +0 -1
  298. package/src/stylesAndAnimations/borders/BorderStyles.stories.tsx +2 -1
  299. package/src/stylesAndAnimations/borders/BorderStyles.tsx +0 -1
  300. package/src/stylesAndAnimations/borders/BorderThickness.stories.tsx +2 -1
  301. package/src/stylesAndAnimations/borders/BorderThickness.tsx +0 -1
  302. package/src/stylesAndAnimations/colors/UtilityClasses.stories.tsx +2 -1
  303. package/src/stylesAndAnimations/colors/UtilityClasses.tsx +1 -2
  304. package/src/stylesAndAnimations/sizing/Sizing.stories.tsx +2 -1
  305. package/src/stylesAndAnimations/sizing/Sizing.tsx +0 -1
  306. package/src/stylesAndAnimations/typography/Typography.stories.tsx +2 -1
  307. package/src/stylesAndAnimations/typography/Typography.tsx +0 -1
  308. package/src/stylesAndAnimations/utilityClasses/UtilityClassesTable.stories.tsx +2 -1
  309. package/src/stylesAndAnimations/utilityClasses/UtilityClassesTable.tsx +6 -3
  310. package/src/types.ts +12 -6
@@ -1,15 +1,17 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { Stepper } from './Stepper';
1
+ import { fas } from '@fortawesome/free-solid-svg-icons';
2
+ import { type Meta, type StoryObj } from '@storybook/react';
3
+
3
4
  import { indiconDefinitions } from '@/components/icons/indicons';
4
5
  import { registerFontAwesomeIcons } from '@/setup/setupIcons';
5
- registerFontAwesomeIcons(...Object.values(fas), ...indiconDefinitions);
6
6
 
7
- // Import all example components
7
+ import { CommonExample } from './examples/commonExample/CommonExample';
8
8
  import { MixedExample } from './examples/MixedExample';
9
- import { RequiredStepsExample } from './examples/RequiredStepsExample';
10
9
  import { OptionalStepsExample } from './examples/OptionalStepsExample';
11
- import { CommonExample } from './examples/commonExample/CommonExample';
12
- import { fas } from '@fortawesome/free-solid-svg-icons';
10
+ import { RequiredStepsExample } from './examples/RequiredStepsExample';
11
+ import { Stepper } from './Stepper';
12
+
13
+
14
+ registerFontAwesomeIcons(...Object.values(fas), ...indiconDefinitions);
13
15
 
14
16
  const meta: Meta = {
15
17
  title: 'Components/Stepper',
@@ -146,6 +148,17 @@ const meta: Meta = {
146
148
  },
147
149
  },
148
150
  },
151
+ text: {
152
+ control: 'object',
153
+ description: 'Customizable text.',
154
+ table: {
155
+ category: 'i18n Text',
156
+ type: {
157
+ summary:
158
+ '{ previousStep?: string; previousStepAriaLabel?: string; nextStep?: string; nextStepAriaLabel?: string; finish?: string; finishAriaLabel?: string }',
159
+ },
160
+ },
161
+ },
149
162
  },
150
163
  };
151
164
 
@@ -1,8 +1,15 @@
1
1
  import { useState, Children } from 'react';
2
- import { Legend } from './components/Legend';
2
+
3
3
  import { BackNavigation } from './components/BackNavigation';
4
+ import { Legend } from './components/Legend';
4
5
  import { NextNavigation } from './components/NextNavigation';
5
- import { StepperProps } from './types';
6
+ import { type StepperProps, type StepperText } from './types';
7
+
8
+ const DEFAULT_TEXT: Required<StepperText> = {
9
+ previousStep: 'Previous Step',
10
+ nextStep: 'Next Step',
11
+ finish: 'Finish',
12
+ };
6
13
 
7
14
  export const Stepper = ({
8
15
  currentStep: externalCurrentStep,
@@ -14,7 +21,9 @@ export const Stepper = ({
14
21
  onFinishClick,
15
22
  children,
16
23
  onStepClick,
24
+ text: textProp,
17
25
  }: StepperProps) => {
26
+ const text = { ...DEFAULT_TEXT, ...textProp };
18
27
  const [internalCurrentStep, setInternalCurrentStep] = useState(0);
19
28
 
20
29
  const currentStep = externalCurrentStep !== undefined ? externalCurrentStep : internalCurrentStep;
@@ -71,12 +80,18 @@ export const Stepper = ({
71
80
  <div className="stepper-steps">{childrenArray[currentStep]}</div>
72
81
  </div>
73
82
  <div className="stepper-actions">
74
- <BackNavigation isDisabled={isFirstStep} onBackClick={handleBackClick} />
83
+ <BackNavigation
84
+ isDisabled={isFirstStep}
85
+ onBackClick={handleBackClick}
86
+ label={text.previousStep}
87
+ />
75
88
  <NextNavigation
76
89
  isLastStep={isLastStep}
77
90
  onNextClick={handleNextClick}
78
91
  onFinishClick={handleFinishClick}
79
92
  isDisabled={disableNextButton(currentStep)}
93
+ nextLabel={text.nextStep}
94
+ finishLabel={text.finish}
80
95
  />
81
96
  </div>
82
97
  </div>
@@ -1,11 +1,12 @@
1
1
  import { render, screen } from '@testing-library/react';
2
- import { Stepper } from '../Stepper';
3
- import { StepOne } from '../examples/commonExample/steps/StepOne';
4
- import { StepTwo } from '../examples/commonExample/steps/StepTwo';
5
- import { StepThree } from '../examples/commonExample/steps/StepThree';
6
2
  import userEvent from '@testing-library/user-event';
7
3
  import React from 'react';
8
4
 
5
+ import { StepOne } from '../examples/commonExample/steps/StepOne';
6
+ import { StepThree } from '../examples/commonExample/steps/StepThree';
7
+ import { StepTwo } from '../examples/commonExample/steps/StepTwo';
8
+ import { Stepper } from '../Stepper';
9
+
9
10
  // NOTES ================================================
10
11
  // The core functionality of the stepper is mainly various callbacks. As a result, we are indirectly testing them through the testing conditions created in this file. For example, to check if a step is complete, we have a callback function that fires when that step is complete. You will need to test your own logic in your implementation as the conditions tested here are for the purposes of the stepper itself, not the handlers we created.
11
12
 
@@ -1,21 +1,23 @@
1
1
  import { Button } from '../../button';
2
+
2
3
  type Props = {
3
4
  isDisabled: boolean;
4
5
  onBackClick: () => void;
6
+ label: string;
5
7
  };
6
8
 
7
- export const BackNavigation = ({ isDisabled, onBackClick }: Props) => {
9
+ export const BackNavigation = ({ isDisabled, onBackClick, label }: Props) => {
8
10
  return (
9
11
  <div className="stepper-navigation-back">
10
12
  <Button
11
13
  data-testid="stepper-back-button"
12
- ariaLabel="Previous Step"
14
+ ariaLabel={label}
13
15
  iconLeft="fa-arrow-left"
14
16
  onClick={onBackClick}
15
17
  variant="outline"
16
18
  isDisabled={isDisabled}
17
19
  >
18
- Previous Step
20
+ {label}
19
21
  </Button>
20
22
  </div>
21
23
  );
@@ -1,8 +1,9 @@
1
1
  import classNames from 'classnames';
2
- import { Icon } from '../../icons/Icon';
3
- import { Col, Row } from '../../grid/';
2
+
4
3
  import { Button } from '../../button';
5
- import { StepperLegendProps } from '../types';
4
+ import { Col, Row } from '../../grid/';
5
+ import { Icon } from '../../icons/Icon';
6
+ import { type StepperLegendProps } from '../types';
6
7
 
7
8
  export const Legend = ({ currentStep, steps, onStepClick }: StepperLegendProps) => {
8
9
  const totalSteps = steps?.length || 0;
@@ -1,12 +1,22 @@
1
1
  import { Button } from '../../button';
2
+
2
3
  type Props = {
3
4
  isLastStep: boolean;
4
5
  onNextClick: () => void;
5
6
  onFinishClick: () => void;
6
7
  isDisabled: boolean;
8
+ nextLabel: string;
9
+ finishLabel: string;
7
10
  };
8
11
 
9
- export const NextNavigation = ({ isLastStep, onNextClick, onFinishClick, isDisabled }: Props) => {
12
+ export const NextNavigation = ({
13
+ isLastStep,
14
+ onNextClick,
15
+ onFinishClick,
16
+ isDisabled,
17
+ nextLabel,
18
+ finishLabel,
19
+ }: Props) => {
10
20
  return (
11
21
  <div className="stepper-navigation">
12
22
  {!isLastStep ? (
@@ -14,22 +24,22 @@ export const NextNavigation = ({ isLastStep, onNextClick, onFinishClick, isDisab
14
24
  <Button
15
25
  data-testid="stepper-next-button"
16
26
  iconRight="fa-arrow-right"
17
- ariaLabel="Next Step"
27
+ ariaLabel={nextLabel}
18
28
  onClick={onNextClick}
19
29
  isDisabled={isDisabled}
20
30
  >
21
- Next Step
31
+ {nextLabel}
22
32
  </Button>
23
33
  </div>
24
34
  ) : (
25
35
  <div className="stepper-navigation-finish">
26
36
  <Button
27
37
  data-testid="stepper-finish-button"
28
- ariaLabel="Finish"
38
+ ariaLabel={finishLabel}
29
39
  onClick={onFinishClick}
30
40
  isDisabled={isDisabled}
31
41
  >
32
- Finish
42
+ {finishLabel}
33
43
  </Button>
34
44
  </div>
35
45
  )}
@@ -1,7 +1,8 @@
1
- import React, { useState } from 'react';
2
- import { Stepper } from '../Stepper';
3
- import { Button } from '../../button';
1
+ import { useState } from 'react';
2
+
4
3
  import { MIXED_EXAMPLE_STEPS, STEP_CONTENT_DATA, INFO_BOX_STYLE } from './constants';
4
+ import { Button } from '../../button';
5
+ import { Stepper } from '../Stepper';
5
6
 
6
7
  export const MixedExample = () => {
7
8
  // Value of the current step.
@@ -1,7 +1,8 @@
1
- import React, { useState } from 'react';
2
- import { Stepper } from '../Stepper';
3
- import { Button } from '../../button';
1
+ import { useState } from 'react';
2
+
4
3
  import { OPTIONAL_STEPS, INFO_BOX_STYLE, STATUS_INDICATOR_STYLE } from './constants';
4
+ import { Button } from '../../button';
5
+ import { Stepper } from '../Stepper';
5
6
 
6
7
  export const OptionalStepsExample = () => {
7
8
  const [currentStep, setCurrentStep] = useState(0);
@@ -1,7 +1,8 @@
1
- import React, { useState } from 'react';
2
- import { Stepper } from '../Stepper';
3
- import { Button } from '../../button';
1
+ import { useState } from 'react';
2
+
4
3
  import { REQUIRED_STEPS, INFO_BOX_STYLE, STATUS_INDICATOR_STYLE } from './constants';
4
+ import { Button } from '../../button';
5
+ import { Stepper } from '../Stepper';
5
6
 
6
7
  export const RequiredStepsExample = () => {
7
8
  const [currentStep, setCurrentStep] = useState(0);
@@ -1,8 +1,9 @@
1
- import React, { useState } from 'react';
2
- import { Stepper } from '../../Stepper';
1
+ import { useState } from 'react';
2
+
3
3
  import { StepOne } from './steps/StepOne';
4
- import { StepTwo } from './steps/StepTwo';
5
4
  import { StepThree } from './steps/StepThree';
5
+ import { StepTwo } from './steps/StepTwo';
6
+ import { Stepper } from '../../Stepper';
6
7
 
7
8
  export const CommonExample = () => {
8
9
  const exampleSteps = [
@@ -1,4 +1,5 @@
1
1
  import { useState } from 'react';
2
+
2
3
  import { Input } from '../../../..';
3
4
  import { Col, Row } from '../../../..';
4
5
 
@@ -1,4 +1,5 @@
1
1
  import { useState } from 'react';
2
+
2
3
  import { Input } from '../../../..';
3
4
  import { Col, Row } from '../../../..';
4
5
 
@@ -1,4 +1,5 @@
1
1
  import { useState } from 'react';
2
+
2
3
  import { Input } from '../../../..';
3
4
  import { Col, Row } from '../../../..';
4
5
 
@@ -1,4 +1,14 @@
1
- import { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
+
3
+ /** Customizable text for Stepper. */
4
+ export interface StepperText {
5
+ /** Label for the "Previous Step" button. Default: "Previous Step" */
6
+ previousStep?: string;
7
+ /** Label for the "Next Step" button. Default: "Next Step" */
8
+ nextStep?: string;
9
+ /** Label for the "Finish" button. Default: "Finish" */
10
+ finish?: string;
11
+ }
2
12
 
3
13
  export interface StepperProps {
4
14
  /** An array of step objects that define the stepper navigation. */
@@ -18,6 +28,8 @@ export interface StepperProps {
18
28
  children: React.ReactNode;
19
29
  /** The function to call when a step is clicked ont he legend. */
20
30
  onStepClick: (step: number) => void;
31
+ /** Customizable display text. */
32
+ text?: StepperText;
21
33
  }
22
34
 
23
35
  export interface StepperLegendProps {
@@ -1,3 +1,7 @@
1
- export const LoadingComponent = () => {
2
- return <div className="table-loading">Loading...</div>;
1
+ interface LoadingComponentProps {
2
+ loadingText: string;
3
+ }
4
+
5
+ export const LoadingComponent = ({ loadingText }: LoadingComponentProps) => {
6
+ return <div className="table-loading">{loadingText}</div>;
3
7
  };
@@ -1,10 +1,14 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { Table } from './Table';
3
- import { columns, sampleData, SampleDataRow } from './sampleData';
4
- import { registerFontAwesomeIcons } from '@/setup/setupIcons';
5
- import { indiconDefinitions } from '@/components/icons/indicons';
1
+ import { type Meta, type StoryObj } from '@storybook/react';
6
2
  import { useState } from 'react';
7
3
 
4
+ import { indiconDefinitions } from '@/components/icons/indicons';
5
+ import { registerFontAwesomeIcons } from '@/setup/setupIcons';
6
+
7
+ import { columns, sampleData, type SampleDataRow } from './sampleData';
8
+ import { Table } from './Table';
9
+
10
+
11
+
8
12
  registerFontAwesomeIcons(...Object.values(indiconDefinitions));
9
13
 
10
14
  const meta: Meta = {
@@ -494,6 +498,16 @@ const meta: Meta = {
494
498
  disable: true,
495
499
  },
496
500
  },
501
+ text: {
502
+ control: 'object',
503
+ description: 'Customizable text.',
504
+ table: {
505
+ category: 'i18n Text',
506
+ type: {
507
+ summary: '{ loading?: string; unpinColumn?: string; pinColumn?: string }',
508
+ },
509
+ },
510
+ },
497
511
  },
498
512
  };
499
513
 
@@ -1,12 +1,19 @@
1
1
  import classNames from 'classnames';
2
2
  import DataTable, {
3
- Direction as RDTDirection,
4
- Alignment as RDTAlignment,
3
+ type Direction as RDTDirection,
4
+ type Alignment as RDTAlignment,
5
5
  } from 'react-data-table-component';
6
- import { LoadingComponent } from './LoadingComponent';
7
- import { TableProps } from './types';
6
+
8
7
  import { TablePagination } from './components/TablePagination';
9
8
  import { usePinnedColumnsManager } from './hooks/usePinnedColumnsManager';
9
+ import { LoadingComponent } from './LoadingComponent';
10
+ import { type TableProps, type TableText } from './types';
11
+
12
+ const DEFAULT_TEXT: Required<TableText> = {
13
+ loading: 'Loading...',
14
+ unpinColumn: 'Unpin column',
15
+ pinColumn: 'Pin column',
16
+ };
10
17
 
11
18
  export const Table = <T,>(props: TableProps<T>) => {
12
19
  const {
@@ -26,14 +33,18 @@ export const Table = <T,>(props: TableProps<T>) => {
26
33
  columns: initialColumns,
27
34
  canPinColumns = false,
28
35
  onPinnedColumnsChange,
36
+ text: textProp,
29
37
  ...rest
30
38
  } = props;
31
39
 
40
+ const text = { ...DEFAULT_TEXT, ...textProp };
41
+
32
42
  // Turns on/off column pinning.
33
43
  const { columnsWithPinning } = usePinnedColumnsManager(
34
44
  initialColumns,
35
45
  canPinColumns,
36
46
  onPinnedColumnsChange,
47
+ { unpinColumn: text.unpinColumn, pinColumn: text.pinColumn },
37
48
  );
38
49
 
39
50
  const combinedClassName = classNames(className, {
@@ -59,7 +70,7 @@ export const Table = <T,>(props: TableProps<T>) => {
59
70
  disabled={isDisabled}
60
71
  noDataComponent={noDataComponent}
61
72
  progressPending={isLoading}
62
- progressComponent={<LoadingComponent />}
73
+ progressComponent={<LoadingComponent loadingText={text.loading} />}
63
74
  pagination
64
75
  paginationComponent={(props) => (
65
76
  <TablePagination {...props} totalEntriesText={totalEntriesText} />
@@ -1,6 +1,7 @@
1
1
  import { render, screen } from '@testing-library/react';
2
- import { Table } from '../Table';
2
+
3
3
  import { sampleData, columns } from '../sampleData';
4
+ import { Table } from '../Table';
4
5
 
5
6
  describe('Table', () => {
6
7
  it('renders the total entries text', () => {
@@ -1,10 +1,18 @@
1
1
  import { useEffect } from 'react';
2
- import { Button } from '../../button/Button';
2
+
3
3
  import {
4
4
  getPreviousHeadersWidth,
5
5
  applyStickyStylesToTableHeader,
6
6
  clearStickyStyles,
7
7
  } from './helpers';
8
+ import { Button } from '../../button/Button';
9
+ import { type HorizontalStickyHeaderText } from '../types';
10
+
11
+ const DEFAULT_TEXT: Required<HorizontalStickyHeaderText> = {
12
+ unpinColumn: 'Unpin column',
13
+ pinColumn: 'Pin column',
14
+ };
15
+
8
16
  interface HorizontalStickyHeaderProps {
9
17
  children: React.ReactNode;
10
18
  position: number;
@@ -12,6 +20,8 @@ interface HorizontalStickyHeaderProps {
12
20
  isPinned?: boolean;
13
21
  forceUpdate?: number;
14
22
  pinnedColumnIds: string[];
23
+ /** Customizable display text. */
24
+ text?: HorizontalStickyHeaderText;
15
25
  }
16
26
 
17
27
  const HorizontalStickyHeader = ({
@@ -20,7 +30,9 @@ const HorizontalStickyHeader = ({
20
30
  onPinColumn,
21
31
  isPinned = false,
22
32
  pinnedColumnIds,
33
+ text: textProp,
23
34
  }: HorizontalStickyHeaderProps) => {
35
+ const text = { ...DEFAULT_TEXT, ...textProp };
24
36
  useEffect(() => {
25
37
  const calculateWidth = async () => {
26
38
  await new Promise((resolve) => setTimeout(resolve, 0));
@@ -46,7 +58,7 @@ const HorizontalStickyHeader = ({
46
58
  size="sm"
47
59
  iconLeft="pin"
48
60
  onClick={() => onPinColumn?.(`sticky-column-${position}`)}
49
- ariaLabel={isPinned ? 'Unpin column' : 'Pin column'}
61
+ ariaLabel={isPinned ? text.unpinColumn : text.pinColumn}
50
62
  className={`table__column--${isPinned ? 'is-pinned' : 'is-not-pinned'} table__column__pin-action`}
51
63
  />
52
64
  <div className="table__header-content">{children}</div>
@@ -1,5 +1,5 @@
1
- import { Pagination as PaginationComponent } from '../../pagination';
2
1
  import { Row, Col } from '../../grid';
2
+ import { Pagination as PaginationComponent } from '../../pagination';
3
3
  interface TablePaginationProps {
4
4
  rowsPerPage: number;
5
5
  rowCount: number;
@@ -1,9 +1,9 @@
1
1
  import { render, screen, fireEvent } from '@testing-library/react';
2
- import HorizontalStickyHeader from '../HorizontalStickyHeader';
2
+
3
3
  import { sampleData } from '../../sampleData';
4
- import { Table } from '../../Table';
5
4
  import { columns } from '../../sampleData';
6
- import userEvent from '@testing-library/user-event';
5
+ import { Table } from '../../Table';
6
+ import HorizontalStickyHeader from '../HorizontalStickyHeader';
7
7
 
8
8
  // Add ResizeObserver mock before tests
9
9
  class ResizeObserverMock {
@@ -1,4 +1,5 @@
1
1
  import { render, screen } from '@testing-library/react';
2
+
2
3
  import { TablePagination } from '../TablePagination';
3
4
 
4
5
  describe('TablePagination', () => {
@@ -1,4 +1,4 @@
1
- import { CSSObject } from 'styled-components';
1
+ import { type CSSObject } from 'styled-components';
2
2
 
3
3
  // Gets the width of the previous pinned columns
4
4
  export const getPreviousHeadersWidth = (position: number, pinnedColumnIds: string[]): number => {
@@ -1,6 +1,7 @@
1
1
  import { useEffect, useCallback, useMemo } from 'react';
2
- import { TableColumn } from '../types';
2
+
3
3
  import { sortPinnedColumns, getPreviousHeadersWidth } from '../components/helpers';
4
+ import { type TableColumn, type HorizontalStickyHeaderText } from '../types';
4
5
  import { processColumns } from '../utils/processColumns';
5
6
 
6
7
  /**
@@ -11,6 +12,7 @@ export const usePinnedColumnsManager = <T>(
11
12
  columns: TableColumn<T>[],
12
13
  canPinColumns: boolean,
13
14
  onPinnedColumnsChange?: (pinnedColumnIds: string[]) => void,
15
+ text?: HorizontalStickyHeaderText,
14
16
  ) => {
15
17
  const pinnedColumnIds = columns.filter((column) => column.isPinned).map((column) => column.id);
16
18
 
@@ -137,7 +139,10 @@ export const usePinnedColumnsManager = <T>(
137
139
 
138
140
  // Process columns for rendering with pin state
139
141
  const columnsWithPinning = canPinColumns
140
- ? sortPinnedColumns(processColumns(columns, dataColumnIds, togglePinnedColumn), dataColumnIds)
142
+ ? sortPinnedColumns(
143
+ processColumns(columns, dataColumnIds, togglePinnedColumn, text),
144
+ dataColumnIds,
145
+ )
141
146
  : columns;
142
147
 
143
148
  return {
@@ -1,6 +1,4 @@
1
- import { TableColumn } from './types';
2
- import { useState } from 'react';
3
- import { Table } from './Table';
1
+ import { type TableColumn } from './types';
4
2
 
5
3
  export interface SampleDataRow {
6
4
  name: string;
@@ -1,11 +1,10 @@
1
1
  import {
2
- TableProps as RDTTableProps,
3
- Direction as RDTDirection,
4
- Alignment as RDTAlignment,
5
- TableColumn as RDTTableColumn,
6
- IDataTableProps,
2
+ type Direction as RDTDirection,
3
+ type Alignment as RDTAlignment,
4
+ type TableColumn as RDTTableColumn,
5
+ type IDataTableProps,
7
6
  } from 'react-data-table-component';
8
- import { CSSObject } from 'styled-components';
7
+ import { type CSSObject } from 'styled-components';
9
8
 
10
9
  export type Direction = `${RDTDirection}`;
11
10
  export type Alignment = `${RDTAlignment}`;
@@ -19,6 +18,24 @@ export interface PinnableColumn<T> extends RDTTableColumn<T> {
19
18
 
20
19
  export type TableColumn<T> = PinnableColumn<T>;
21
20
 
21
+ /** Customizable text for Table. */
22
+ export interface TableText {
23
+ /** Text to display while loading. Default: "Loading..." */
24
+ loading?: string;
25
+ /** Aria label for unpinning a column. Default: "Unpin column" */
26
+ unpinColumn?: string;
27
+ /** Aria label for pinning a column. Default: "Pin column" */
28
+ pinColumn?: string;
29
+ }
30
+
31
+ /** Customizable text for HorizontalStickyHeader. */
32
+ export interface HorizontalStickyHeaderText {
33
+ /** Aria label for unpinning a column. Default: "Unpin column" */
34
+ unpinColumn?: string;
35
+ /** Aria label for pinning a column. Default: "Pin column" */
36
+ pinColumn?: string;
37
+ }
38
+
22
39
  export interface TableProps<T>
23
40
  extends Omit<IDataTableProps<T>, 'paginationComponent' | 'direction' | 'subHeaderAlign'> {
24
41
  /** The columns to display in the table. All columns require a unique id property. For pinned columns, please see the pinned example below. */
@@ -39,4 +56,6 @@ export interface TableProps<T>
39
56
  canPinColumns?: boolean;
40
57
  /** Callback that receives the IDs of the pinned columns when they change. */
41
58
  onPinnedColumnsChange?: (pinnedColumnIds: any[]) => void;
59
+ /** Customizable display text. */
60
+ text?: TableText;
42
61
  }
@@ -1,11 +1,12 @@
1
- import { TableColumn } from '../types';
2
- import HorizontalStickyHeader from '../components/HorizontalStickyHeader';
3
1
  import { getPinnedColumnStyles } from '../components/helpers';
2
+ import HorizontalStickyHeader from '../components/HorizontalStickyHeader';
3
+ import { type TableColumn, type HorizontalStickyHeaderText } from '../types';
4
4
 
5
5
  export const processColumns = <T,>(
6
6
  columns: TableColumn<T>[],
7
7
  pinnedColumnIds: string[],
8
8
  togglePinnedColumn: (id: string) => void,
9
+ text?: HorizontalStickyHeaderText,
9
10
  ): TableColumn<T>[] => {
10
11
  return columns.map((column, index) => {
11
12
  const dataColumnId = `sticky-column-${index}`;
@@ -18,6 +19,7 @@ export const processColumns = <T,>(
18
19
  isPinned={isPinned}
19
20
  onPinColumn={() => togglePinnedColumn(column.id)}
20
21
  pinnedColumnIds={pinnedColumnIds}
22
+ text={text}
21
23
  >
22
24
  {column.name}
23
25
  </HorizontalStickyHeader>
@@ -1,4 +1,22 @@
1
- import { Row, ColumnDef, SortingState } from '@tanstack/react-table';
1
+ import { type Row, type ColumnDef, type SortingState } from '@tanstack/react-table';
2
+
3
+ /** Customizable text for TanstackTable. */
4
+ export interface TanstackTableText {
5
+ /** Message while table is loading. Default: "Table is loading..." */
6
+ loading?: string;
7
+ /** Message when no results found. Default: "No results found." */
8
+ noResults?: string;
9
+ /** Message when there's an error loading data. Default: "There was an error loading the data." */
10
+ error?: string;
11
+ /** Text for reset filters button. Default: "Reset filters" */
12
+ resetFilters?: string;
13
+ /** Singular entry text. Default: "entry" */
14
+ entry?: string;
15
+ /** Plural entries text. Default: "entries" */
16
+ entries?: string;
17
+ /** "of" text in pagination (e.g., "5 of 10 entries"). Default: "of" */
18
+ of?: string;
19
+ }
2
20
 
3
21
  export type WithPaginationProps = {
4
22
  /** Number of rows to display per pagination page. */
@@ -51,8 +69,6 @@ export type Props<T extends object> = {
51
69
  hasFilters?: boolean;
52
70
  /** When this is true, the table is considered to be in a loading state. */
53
71
  isLoading?: boolean;
54
- /** Message to display when the table is loading. */
55
- isLoadingMessage?: string;
56
72
  /** Columns that are pinned by default. */
57
73
  defaultPinnedColumns?: string[];
58
74
  /** Callback when a row is clicked. */
@@ -69,4 +85,6 @@ export type Props<T extends object> = {
69
85
  onSelectAllChange?: (isSelected: boolean) => void;
70
86
  /** You may pass a default sorting state to the table. This will be used to sort the table by default. This is useful if you want to sort the table by a column by default. */
71
87
  defaultSorting?: SortingState;
88
+ /** Customizable display text. */
89
+ text?: TanstackTableText;
72
90
  } & PaginationProps;