@indico-data/design-system 3.18.0 → 3.19.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 (93) hide show
  1. package/lib/components/forms/date/datePicker/types.d.ts +7 -0
  2. package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +3 -0
  3. package/lib/components/forms/date/iconTriggerDatePicker/types.d.ts +5 -0
  4. package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +2 -1
  5. package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +3 -0
  6. package/lib/components/forms/date/inputDateRangePicker/types.d.ts +7 -0
  7. package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +2 -1
  8. package/lib/components/forms/select/Select.d.ts +3 -1
  9. package/lib/components/forms/select/types.d.ts +10 -0
  10. package/lib/components/forms/subcomponents/Label.d.ts +4 -0
  11. package/lib/components/forms/subcomponents/types.d.ts +5 -0
  12. package/lib/components/forms/timePicker/TimePicker.d.ts +4 -1
  13. package/lib/components/forms/timePicker/types.d.ts +5 -0
  14. package/lib/components/modal/ConfirmationModal.d.ts +1 -1
  15. package/lib/components/modal/Modal.d.ts +1 -1
  16. package/lib/components/modal/Modal.stories.d.ts +4 -0
  17. package/lib/components/modal/types.d.ts +19 -5
  18. package/lib/components/pagination/Pagination.d.ts +1 -1
  19. package/lib/components/pagination/index.d.ts +1 -0
  20. package/lib/components/pagination/types.d.ts +13 -0
  21. package/lib/components/stepper/Stepper.d.ts +1 -1
  22. package/lib/components/stepper/components/BackNavigation.d.ts +2 -1
  23. package/lib/components/stepper/components/NextNavigation.d.ts +3 -1
  24. package/lib/components/stepper/types.d.ts +11 -0
  25. package/lib/components/table/LoadingComponent.d.ts +5 -1
  26. package/lib/components/table/components/HorizontalStickyHeader.d.ts +4 -1
  27. package/lib/components/table/hooks/usePinnedColumnsManager.d.ts +2 -2
  28. package/lib/components/table/types.d.ts +18 -0
  29. package/lib/components/table/utils/processColumns.d.ts +2 -2
  30. package/lib/components/tanstackTable/TankstackTable.types.d.ts +19 -2
  31. package/lib/components/tanstackTable/TanstackTable.d.ts +1 -1
  32. package/lib/components/tanstackTable/components/NoResults/NoResults.d.ts +2 -1
  33. package/lib/components/tanstackTable/components/TablePagination/TablePagination.d.ts +3 -1
  34. package/lib/index.d.ts +143 -23
  35. package/lib/index.esm.js +130 -60
  36. package/lib/index.esm.js.map +1 -1
  37. package/lib/index.js +130 -60
  38. package/lib/index.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/components/button/Button.tsx +4 -18
  41. package/src/components/button/__tests__/Button.test.tsx +30 -28
  42. package/src/components/forms/date/datePicker/DatePicker.stories.tsx +10 -0
  43. package/src/components/forms/date/datePicker/DatePicker.tsx +9 -2
  44. package/src/components/forms/date/datePicker/types.ts +8 -0
  45. package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +10 -0
  46. package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +12 -1
  47. package/src/components/forms/date/iconTriggerDatePicker/types.ts +5 -0
  48. package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +4 -3
  49. package/src/components/forms/date/inputDatePicker/__tests__/SingleInputDatePicker.test.tsx +2 -0
  50. package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +10 -0
  51. package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +14 -2
  52. package/src/components/forms/date/inputDateRangePicker/types.ts +7 -0
  53. package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +3 -2
  54. package/src/components/forms/input/Input.tsx +1 -0
  55. package/src/components/forms/numberInput/NumberInput.tsx +1 -0
  56. package/src/components/forms/passwordInput/PasswordInput.tsx +7 -1
  57. package/src/components/forms/select/Select.stories.tsx +6 -5
  58. package/src/components/forms/select/Select.tsx +15 -1
  59. package/src/components/forms/select/types.ts +11 -0
  60. package/src/components/forms/subcomponents/Label.tsx +20 -3
  61. package/src/components/forms/subcomponents/types.ts +5 -0
  62. package/src/components/forms/textarea/Textarea.tsx +1 -0
  63. package/src/components/forms/timePicker/TimePicker.stories.tsx +10 -0
  64. package/src/components/forms/timePicker/TimePicker.tsx +10 -1
  65. package/src/components/forms/timePicker/types.ts +5 -0
  66. package/src/components/modal/ConfirmationModal.tsx +19 -14
  67. package/src/components/modal/Modal.stories.tsx +53 -22
  68. package/src/components/modal/Modal.tsx +8 -2
  69. package/src/components/modal/types.ts +21 -5
  70. package/src/components/pagination/Pagination.stories.tsx +11 -0
  71. package/src/components/pagination/Pagination.tsx +14 -5
  72. package/src/components/pagination/index.ts +1 -0
  73. package/src/components/pagination/types.ts +14 -0
  74. package/src/components/stepper/Stepper.stories.tsx +11 -0
  75. package/src/components/stepper/Stepper.tsx +16 -2
  76. package/src/components/stepper/components/BackNavigation.tsx +5 -3
  77. package/src/components/stepper/components/NextNavigation.tsx +15 -5
  78. package/src/components/stepper/types.ts +12 -0
  79. package/src/components/table/LoadingComponent.tsx +6 -2
  80. package/src/components/table/Table.stories.tsx +10 -0
  81. package/src/components/table/Table.tsx +12 -2
  82. package/src/components/table/components/HorizontalStickyHeader.tsx +12 -1
  83. package/src/components/table/hooks/usePinnedColumnsManager.ts +3 -2
  84. package/src/components/table/types.ts +20 -0
  85. package/src/components/table/utils/processColumns.tsx +3 -1
  86. package/src/components/tanstackTable/TankstackTable.types.ts +20 -2
  87. package/src/components/tanstackTable/TanstackTable.stories.tsx +8 -6
  88. package/src/components/tanstackTable/TanstackTable.tsx +21 -11
  89. package/src/components/tanstackTable/components/NoResults/NoResults.tsx +9 -3
  90. package/src/components/tanstackTable/components/TablePagination/TablePagination.tsx +4 -1
  91. package/src/index.ts +1 -1
  92. package/src/storybook/formArgTypes.ts +10 -0
  93. package/src/storybookDocs/Permafrost.mdx +8 -0
@@ -1,4 +1,9 @@
1
1
  import { CustomComponents, DateRange, DayEventHandler, Formatters, Matcher, Mode, MonthChangeEventHandler, OnSelectHandler } from 'react-day-picker';
2
+ /** Customizable text for DatePicker. */
3
+ export interface DatePickerText {
4
+ /** Label for "Select Time" text. Default: "Select Time" */
5
+ selectTime?: string;
6
+ }
2
7
  export interface DatePickerProps {
3
8
  ref?: React.LegacyRef<HTMLInputElement>;
4
9
  /** The selected day(s). */
@@ -41,6 +46,8 @@ export interface DatePickerProps {
41
46
  isReadOnly?: boolean;
42
47
  timeTabIndex?: number;
43
48
  dateTabIndex?: number;
49
+ /** Customizable display text. */
50
+ text?: DatePickerText;
44
51
  }
45
52
  export interface CommonProps {
46
53
  className?: string;
@@ -2,6 +2,7 @@ import { DateRange, Mode } from 'react-day-picker';
2
2
  import { IconName, IconSizes } from '../../../icons/types';
3
3
  import { UseFloatingOptions } from '@floating-ui/react-dom';
4
4
  import { PortalOptions } from '../datePicker/types';
5
+ import { IconTriggerDatePickerText } from './types';
5
6
  interface Props {
6
7
  /** Allows you to select a single day, a range of days, or multiple days. */
7
8
  mode?: Mode;
@@ -38,6 +39,8 @@ interface Props {
38
39
  isPortal?: boolean;
39
40
  /** The floating options for the date picker. Follows floating-ui options. */
40
41
  floatingOptions?: UseFloatingOptions;
42
+ /** Customizable display text. */
43
+ text?: IconTriggerDatePickerText;
41
44
  }
42
45
  export declare const IconTriggerDatePicker: (props: Props) => import("react/jsx-runtime").JSX.Element;
43
46
  export {};
@@ -0,0 +1,5 @@
1
+ /** Customizable text for IconTriggerDatePicker. */
2
+ export interface IconTriggerDatePickerText {
3
+ /** Aria label for the trigger icon. Default: "Open date picker" */
4
+ triggerIcon?: string;
5
+ }
@@ -10,7 +10,8 @@ export interface SingleInputDatePickerProps {
10
10
  /** The layout of the caption. Enables you to add or remove the dropdown navigation for months/years */
11
11
  captionLayout?: 'dropdown' | 'dropdown-months' | 'dropdown-years' | 'label';
12
12
  id?: string;
13
- label?: string;
13
+ /** The label for the input field. */
14
+ label: string;
14
15
  onSelect: (selected: Date | undefined) => void;
15
16
  initialMonth?: Date;
16
17
  selected?: Date;
@@ -2,6 +2,7 @@ import { IconName } from '../../../icons/types';
2
2
  import { DateRange } from 'react-day-picker';
3
3
  import { UseFloatingOptions } from '@floating-ui/react-dom';
4
4
  import { PortalOptions } from '../datePicker/types';
5
+ import { InputDateRangePickerText } from './types';
5
6
  interface InputDateRangePickerProps {
6
7
  /** A label for assistive technologies. */
7
8
  ariaLabel: string;
@@ -43,6 +44,8 @@ interface InputDateRangePickerProps {
43
44
  floatingOptions?: UseFloatingOptions;
44
45
  /** Whether the date picker is a portal. */
45
46
  isPortal?: boolean;
47
+ /** Customizable display text. */
48
+ text?: InputDateRangePickerText;
46
49
  }
47
50
  export declare function InputDateRangePicker(props: InputDateRangePickerProps): import("react/jsx-runtime").JSX.Element;
48
51
  export {};
@@ -0,0 +1,7 @@
1
+ /** Customizable text for InputDateRangePicker. */
2
+ export interface InputDateRangePickerText {
3
+ /** Label for the "from" date input. Default: "From Date" */
4
+ fromDate?: string;
5
+ /** Label for the "to" date input. Default: "To Date" */
6
+ toDate?: string;
7
+ }
@@ -9,7 +9,8 @@ export interface SingleInputDateTimePickerProps {
9
9
  isDisabled?: boolean;
10
10
  captionLayout?: 'dropdown' | 'dropdown-months' | 'dropdown-years' | 'label';
11
11
  id?: string;
12
- label?: string;
12
+ /** The label for the date input field. */
13
+ label: string;
13
14
  onSelect: (selected: Date | undefined) => void;
14
15
  initialMonth?: Date;
15
16
  selected?: Date;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Props as ReactSelectProps } from 'react-select';
3
- import { SelectOption } from './types';
3
+ import { SelectOption, SelectText } from './types';
4
4
  export interface SelectProps<OptionType extends SelectOption> extends ReactSelectProps<OptionType> {
5
5
  /** Options for the select component */
6
6
  options: OptionType[];
@@ -16,6 +16,8 @@ export interface SelectProps<OptionType extends SelectOption> extends ReactSelec
16
16
  classNamePrefix?: string;
17
17
  /** Event handler for when the selected value changes */
18
18
  onChange?: (newValue: any, actionMeta: any) => void;
19
+ /** Customizable display text. */
20
+ text?: SelectText;
19
21
  }
20
22
  declare const LabeledSelect: React.ForwardRefExoticComponent<Omit<SelectProps<SelectOption> & {
21
23
  ref?: React.Ref<any>;
@@ -1,7 +1,17 @@
1
1
  import { ReactNode } from 'react';
2
+ import { FormLabelText } from '../subcomponents/Label';
2
3
  export type SelectOption = {
3
4
  label: string;
4
5
  value: string;
5
6
  detail?: ReactNode;
6
7
  [key: string]: any;
7
8
  };
9
+ /** Customizable text for Select. Extends FormLabelText for label-related text. */
10
+ export interface SelectText extends FormLabelText {
11
+ /** Placeholder text when no option is selected. Default: "Select..." */
12
+ placeholder?: string;
13
+ /** Text when there are no options. Default: "No options" */
14
+ noOptions?: string;
15
+ /** Text while loading options. Default: "Loading..." */
16
+ loading?: string;
17
+ }
@@ -1,9 +1,13 @@
1
1
  import React from 'react';
2
+ import { FormLabelText } from './types';
3
+ export type { FormLabelText } from './types';
2
4
  export interface LabelProps {
3
5
  label?: string;
4
6
  name: string;
5
7
  isRequired?: boolean;
6
8
  hasHiddenLabel?: boolean;
9
+ /** Customizable display text. */
10
+ text?: FormLabelText;
7
11
  }
8
12
  export declare const Label: ({ label, name, isRequired }: LabelProps) => import("react/jsx-runtime").JSX.Element;
9
13
  export declare function withLabel<P extends object>(WrappedComponent: React.ComponentType<P>): React.ForwardRefExoticComponent<React.PropsWithoutRef<P & LabelProps> & React.RefAttributes<any>>;
@@ -0,0 +1,5 @@
1
+ /** Customizable text for form Label. */
2
+ export interface FormLabelText {
3
+ /** Text appended to aria-label for required fields. Default: "(required)" */
4
+ required?: string;
5
+ }
@@ -1,3 +1,4 @@
1
+ import { TimePickerText } from './types';
1
2
  interface TimePickerProps {
2
3
  ref?: React.LegacyRef<HTMLInputElement>;
3
4
  /** The time value to be displayed in the input field */
@@ -14,7 +15,9 @@ interface TimePickerProps {
14
15
  isReadOnly?: boolean;
15
16
  isDisabled?: boolean;
16
17
  tabIndex?: number;
18
+ /** Customizable display text. */
19
+ text?: TimePickerText;
17
20
  [key: string]: unknown;
18
21
  }
19
- export declare const TimePicker: ({ ref, timeValue, label, name, hasHiddenLabel, onTimeChange, className, isDisabled, isReadOnly, tabIndex, ...rest }: TimePickerProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const TimePicker: ({ ref, timeValue, label, name, hasHiddenLabel, onTimeChange, className, isDisabled, isReadOnly, tabIndex, text: textProp, ...rest }: TimePickerProps) => import("react/jsx-runtime").JSX.Element;
20
23
  export {};
@@ -0,0 +1,5 @@
1
+ /** Customizable text for TimePicker. */
2
+ export interface TimePickerText {
3
+ /** Aria label for the validation error tooltip. Default: "Time validation error" */
4
+ validationError?: string;
5
+ }
@@ -1,2 +1,2 @@
1
1
  import { ConfirmationModalProps } from './types';
2
- export declare const ConfirmationModal: ({ className, overlayClassName, testId, isOpen, onRequestClose, portalClassName, appElement, parentSelector, shouldCloseOnOverlayClick, shouldCloseOnEsc, contentElement, overlayElement, footer, children, onConfirmRequest, onCancelRequest, confirmationButtonText, cancelButtonText, confirmationButtonVariant, icon, title, status, maxWidthInPixels, hasDontShowAgainCheckbox, }: ConfirmationModalProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const ConfirmationModal: ({ className, overlayClassName, testId, isOpen, onRequestClose, portalClassName, appElement, parentSelector, shouldCloseOnOverlayClick, shouldCloseOnEsc, contentElement, overlayElement, footer, children, onConfirmRequest, onCancelRequest, confirmationButtonVariant, icon, title, status, maxWidthInPixels, hasDontShowAgainCheckbox, text: textProp, }: ConfirmationModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { ModalProps } from './types';
2
- export declare const Modal: ({ className, children, isOpen, onRequestClose, portalClassName, overlayClassName, appElement, shouldCloseOnOverlayClick, shouldCloseOnEsc, testId, contentElement, overlayElement, position, parentSelector, title, subtitle, footer, maxWidthInPixels, ...rest }: ModalProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Modal: ({ className, children, isOpen, onRequestClose, portalClassName, overlayClassName, appElement, shouldCloseOnOverlayClick, shouldCloseOnEsc, testId, contentElement, overlayElement, position, parentSelector, title, subtitle, footer, maxWidthInPixels, text: textProp, ...rest }: ModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -7,3 +7,7 @@ type Story = StoryObj<typeof Modal>;
7
7
  export declare const Default: Story;
8
8
  export declare const ConfirmationModalStory: StoryObj<typeof ConfirmationModal>;
9
9
  export declare const ConfirmationModalStoryWithCheckbox: StoryObj<typeof ConfirmationModal>;
10
+ /**
11
+ * Use the `text` prop to customize displayed text.
12
+ */
13
+ export declare const WithText: StoryObj<typeof ConfirmationModal>;
@@ -1,5 +1,10 @@
1
1
  import { ButtonVariants } from '../button/types';
2
2
  import { IconName } from '../icons/types';
3
+ /** Customizable text for Modal. */
4
+ export interface ModalText {
5
+ /** Aria label for the close button. Default: "Close" */
6
+ closeButton?: string;
7
+ }
3
8
  export interface ModalProps {
4
9
  /** Additional classes for the badge component */
5
10
  className?: string;
@@ -35,8 +40,19 @@ export interface ModalProps {
35
40
  footer?: React.ReactNode;
36
41
  /** The maximum width of the modal in pixels */
37
42
  maxWidthInPixels?: number;
43
+ /** Customizable display text. */
44
+ text?: ModalText;
45
+ }
46
+ /** Customizable text for ConfirmationModal. Extends ModalText. */
47
+ export interface ConfirmationModalText extends ModalText {
48
+ /** Label for the "Don't show again" checkbox. Default: "Don't display this again." */
49
+ dontShowAgain?: string;
50
+ /** Text for the confirm button. Default: "Confirm" */
51
+ confirm?: string;
52
+ /** Text for the cancel button. Default: "Cancel" */
53
+ cancel?: string;
38
54
  }
39
- export interface ConfirmationModalProps extends ModalProps {
55
+ export interface ConfirmationModalProps extends Omit<ModalProps, 'text'> {
40
56
  onConfirmRequest?: ({ dontShowAgain, }: {
41
57
  dontShowAgain?: boolean;
42
58
  }) => void | Promise<void> | Promise<boolean>;
@@ -45,12 +61,10 @@ export interface ConfirmationModalProps extends ModalProps {
45
61
  hasDontShowAgainCheckbox?: boolean;
46
62
  /** The variant of the confirmation button. */
47
63
  confirmationButtonVariant?: ButtonVariants;
48
- /** The text of the confirmation button */
49
- confirmationButtonText?: string;
50
- /** The text of the cancel button */
51
- cancelButtonText?: string;
52
64
  /** The icon of the modal */
53
65
  icon?: IconName;
54
66
  /** The status of the modal. This will determine the color of the icon. */
55
67
  status?: 'info' | 'success' | 'error';
68
+ /** Customizable display text. */
69
+ text?: ConfirmationModalText;
56
70
  }
@@ -1,2 +1,2 @@
1
1
  import { PaginationProps } from './types';
2
- export declare const Pagination: ({ totalPages, currentPage, onChange, className, ...rest }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Pagination: ({ totalPages, currentPage, onChange, className, text: textProp, ...rest }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1,2 @@
1
1
  export { Pagination } from './Pagination';
2
+ export type { PaginationText } from './types';
@@ -1,3 +1,14 @@
1
+ /** Customizable text for Pagination. */
2
+ export interface PaginationText {
3
+ /** Aria label for previous page button. Default: "Previous Page" */
4
+ previousPage?: string;
5
+ /** Aria label for next page button. Default: "Next Page" */
6
+ nextPage?: string;
7
+ /** Label for current page input. Default: "Current Page" */
8
+ currentPage?: string;
9
+ /** Text between current page and total (e.g., "of"). Default: "of" */
10
+ of?: string;
11
+ }
1
12
  export interface PaginationProps {
2
13
  /** The total number of pages to be displayed */
3
14
  totalPages: number;
@@ -7,4 +18,6 @@ export interface PaginationProps {
7
18
  className?: string;
8
19
  /** The callback function that is called when the page changes. */
9
20
  onChange?: (value: number) => void;
21
+ /** Customizable display text. */
22
+ text?: PaginationText;
10
23
  }
@@ -1,2 +1,2 @@
1
1
  import { StepperProps } from './types';
2
- export declare const Stepper: ({ currentStep: externalCurrentStep, legendHeader, legendFooter, steps, onBackClick, onNextClick, onFinishClick, children, onStepClick, }: StepperProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Stepper: ({ currentStep: externalCurrentStep, legendHeader, legendFooter, steps, onBackClick, onNextClick, onFinishClick, children, onStepClick, text: textProp, }: StepperProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  type Props = {
2
2
  isDisabled: boolean;
3
3
  onBackClick: () => void;
4
+ label: string;
4
5
  };
5
- export declare const BackNavigation: ({ isDisabled, onBackClick }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const BackNavigation: ({ isDisabled, onBackClick, label }: Props) => import("react/jsx-runtime").JSX.Element;
6
7
  export {};
@@ -3,6 +3,8 @@ type Props = {
3
3
  onNextClick: () => void;
4
4
  onFinishClick: () => void;
5
5
  isDisabled: boolean;
6
+ nextLabel: string;
7
+ finishLabel: string;
6
8
  };
7
- export declare const NextNavigation: ({ isLastStep, onNextClick, onFinishClick, isDisabled }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const NextNavigation: ({ isLastStep, onNextClick, onFinishClick, isDisabled, nextLabel, finishLabel, }: Props) => import("react/jsx-runtime").JSX.Element;
8
10
  export {};
@@ -1,4 +1,13 @@
1
1
  import { ReactNode } from 'react';
2
+ /** Customizable text for Stepper. */
3
+ export interface StepperText {
4
+ /** Label for the "Previous Step" button. Default: "Previous Step" */
5
+ previousStep?: string;
6
+ /** Label for the "Next Step" button. Default: "Next Step" */
7
+ nextStep?: string;
8
+ /** Label for the "Finish" button. Default: "Finish" */
9
+ finish?: string;
10
+ }
2
11
  export interface StepperProps {
3
12
  /** An array of step objects that define the stepper navigation. */
4
13
  steps: Step[];
@@ -17,6 +26,8 @@ export interface StepperProps {
17
26
  children: React.ReactNode;
18
27
  /** The function to call when a step is clicked ont he legend. */
19
28
  onStepClick: (step: number) => void;
29
+ /** Customizable display text. */
30
+ text?: StepperText;
20
31
  }
21
32
  export interface StepperLegendProps {
22
33
  currentStep: number;
@@ -1 +1,5 @@
1
- export declare const LoadingComponent: () => import("react/jsx-runtime").JSX.Element;
1
+ interface LoadingComponentProps {
2
+ loadingText: string;
3
+ }
4
+ export declare const LoadingComponent: ({ loadingText }: LoadingComponentProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -1,3 +1,4 @@
1
+ import { HorizontalStickyHeaderText } from '../types';
1
2
  interface HorizontalStickyHeaderProps {
2
3
  children: React.ReactNode;
3
4
  position: number;
@@ -5,6 +6,8 @@ interface HorizontalStickyHeaderProps {
5
6
  isPinned?: boolean;
6
7
  forceUpdate?: number;
7
8
  pinnedColumnIds: string[];
9
+ /** Customizable display text. */
10
+ text?: HorizontalStickyHeaderText;
8
11
  }
9
- declare const HorizontalStickyHeader: ({ children, position, onPinColumn, isPinned, pinnedColumnIds, }: HorizontalStickyHeaderProps) => import("react/jsx-runtime").JSX.Element;
12
+ declare const HorizontalStickyHeader: ({ children, position, onPinColumn, isPinned, pinnedColumnIds, text: textProp, }: HorizontalStickyHeaderProps) => import("react/jsx-runtime").JSX.Element;
10
13
  export default HorizontalStickyHeader;
@@ -1,8 +1,8 @@
1
- import { TableColumn } from '../types';
1
+ import { TableColumn, HorizontalStickyHeaderText } from '../types';
2
2
  /**
3
3
  * Hook to manage pinned columns in a table
4
4
  * Handles initialization, toggling, positioning and resizing of pinned columns
5
5
  */
6
- export declare const usePinnedColumnsManager: <T>(columns: TableColumn<T>[], canPinColumns: boolean, onPinnedColumnsChange?: (pinnedColumnIds: string[]) => void) => {
6
+ export declare const usePinnedColumnsManager: <T>(columns: TableColumn<T>[], canPinColumns: boolean, onPinnedColumnsChange?: (pinnedColumnIds: string[]) => void, text?: HorizontalStickyHeaderText) => {
7
7
  columnsWithPinning: TableColumn<T>[];
8
8
  };
@@ -9,6 +9,22 @@ export interface PinnableColumn<T> extends RDTTableColumn<T> {
9
9
  position?: number;
10
10
  }
11
11
  export type TableColumn<T> = PinnableColumn<T>;
12
+ /** Customizable text for Table. */
13
+ export interface TableText {
14
+ /** Text to display while loading. Default: "Loading..." */
15
+ loading?: string;
16
+ /** Aria label for unpinning a column. Default: "Unpin column" */
17
+ unpinColumn?: string;
18
+ /** Aria label for pinning a column. Default: "Pin column" */
19
+ pinColumn?: string;
20
+ }
21
+ /** Customizable text for HorizontalStickyHeader. */
22
+ export interface HorizontalStickyHeaderText {
23
+ /** Aria label for unpinning a column. Default: "Unpin column" */
24
+ unpinColumn?: string;
25
+ /** Aria label for pinning a column. Default: "Pin column" */
26
+ pinColumn?: string;
27
+ }
12
28
  export interface TableProps<T> extends Omit<IDataTableProps<T>, 'paginationComponent' | 'direction' | 'subHeaderAlign'> {
13
29
  /** The columns to display in the table. All columns require a unique id property. For pinned columns, please see the pinned example below. */
14
30
  columns: TableColumn<T>[];
@@ -28,4 +44,6 @@ export interface TableProps<T> extends Omit<IDataTableProps<T>, 'paginationCompo
28
44
  canPinColumns?: boolean;
29
45
  /** Callback that receives the IDs of the pinned columns when they change. */
30
46
  onPinnedColumnsChange?: (pinnedColumnIds: any[]) => void;
47
+ /** Customizable display text. */
48
+ text?: TableText;
31
49
  }
@@ -1,2 +1,2 @@
1
- import { TableColumn } from '../types';
2
- export declare const processColumns: <T>(columns: TableColumn<T>[], pinnedColumnIds: string[], togglePinnedColumn: (id: string) => void) => TableColumn<T>[];
1
+ import { TableColumn, HorizontalStickyHeaderText } from '../types';
2
+ export declare const processColumns: <T>(columns: TableColumn<T>[], pinnedColumnIds: string[], togglePinnedColumn: (id: string) => void, text?: HorizontalStickyHeaderText) => TableColumn<T>[];
@@ -1,4 +1,21 @@
1
1
  import { Row, ColumnDef, SortingState } from '@tanstack/react-table';
2
+ /** Customizable text for TanstackTable. */
3
+ export interface TanstackTableText {
4
+ /** Message while table is loading. Default: "Table is loading..." */
5
+ loading?: string;
6
+ /** Message when no results found. Default: "No results found." */
7
+ noResults?: string;
8
+ /** Message when there's an error loading data. Default: "There was an error loading the data." */
9
+ error?: string;
10
+ /** Text for reset filters button. Default: "Reset filters" */
11
+ resetFilters?: string;
12
+ /** Singular entry text. Default: "entry" */
13
+ entry?: string;
14
+ /** Plural entries text. Default: "entries" */
15
+ entries?: string;
16
+ /** "of" text in pagination (e.g., "5 of 10 entries"). Default: "of" */
17
+ of?: string;
18
+ }
2
19
  export type WithPaginationProps = {
3
20
  /** Number of rows to display per pagination page. */
4
21
  rowsPerPage: number;
@@ -52,8 +69,6 @@ export type Props<T extends object> = {
52
69
  hasFilters?: boolean;
53
70
  /** When this is true, the table is considered to be in a loading state. */
54
71
  isLoading?: boolean;
55
- /** Message to display when the table is loading. */
56
- isLoadingMessage?: string;
57
72
  /** Columns that are pinned by default. */
58
73
  defaultPinnedColumns?: string[];
59
74
  /** Callback when a row is clicked. */
@@ -70,4 +85,6 @@ export type Props<T extends object> = {
70
85
  onSelectAllChange?: (isSelected: boolean) => void;
71
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. */
72
87
  defaultSorting?: SortingState;
88
+ /** Customizable display text. */
89
+ text?: TanstackTableText;
73
90
  } & PaginationProps;
@@ -1,4 +1,4 @@
1
1
  import { Props } from './TankstackTable.types';
2
- export declare function TanstackTable<T extends object>({ columns: defaultColumns, data, className, currentPage, rowCount, rowsPerPage, onChangePage, totalEntriesText, TableActions, error, enableRowSelection, clearFilters, hasFilters, showPagination, isLoading, isLoadingMessage, defaultPinnedColumns, onRowClick, activeRows, isStriped, actionBarClassName, defaultSorting, ...rest }: Props<T & {
2
+ export declare function TanstackTable<T extends object>({ columns: defaultColumns, data, className, currentPage, rowCount, rowsPerPage, onChangePage, totalEntriesText, TableActions, error, enableRowSelection, clearFilters, hasFilters, showPagination, isLoading, defaultPinnedColumns, onRowClick, activeRows, isStriped, actionBarClassName, defaultSorting, text: textProp, ...rest }: Props<T & {
3
3
  id: string;
4
4
  }>): import("react/jsx-runtime").JSX.Element;
@@ -2,6 +2,7 @@ type Props = {
2
2
  clearFilters?: () => void;
3
3
  hasFilters?: boolean;
4
4
  message: string;
5
+ resetFiltersText?: string;
5
6
  };
6
- export declare function NoResults({ clearFilters, hasFilters, message }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export declare function NoResults({ clearFilters, hasFilters, message, resetFiltersText, }: Props): import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -1,9 +1,11 @@
1
+ import { PaginationText } from '../../../pagination';
1
2
  interface TablePaginationProps {
2
3
  rowsPerPage: number;
3
4
  rowCount: number;
4
5
  onChangePage: (page: number) => void;
5
6
  currentPage: number;
6
7
  totalEntriesText?: string;
8
+ text?: PaginationText;
7
9
  }
8
- export declare const TablePagination: ({ rowsPerPage, rowCount, onChangePage, currentPage, totalEntriesText, }: TablePaginationProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const TablePagination: ({ rowsPerPage, rowCount, onChangePage, currentPage, totalEntriesText, text, }: TablePaginationProps) => import("react/jsx-runtime").JSX.Element;
9
11
  export {};