@indico-data/design-system 3.0.10 → 3.2.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 (116) hide show
  1. package/.storybook/main.ts +3 -0
  2. package/lib/components/badge/types.d.ts +4 -0
  3. package/lib/components/button/types.d.ts +52 -2
  4. package/lib/components/card/Card.d.ts +5 -0
  5. package/lib/components/floatUI/types.d.ts +7 -0
  6. package/lib/components/forms/checkbox/Checkbox.d.ts +7 -0
  7. package/lib/components/forms/date/datePicker/types.d.ts +10 -0
  8. package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +16 -0
  9. package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +8 -0
  10. package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +9 -0
  11. package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +9 -0
  12. package/lib/components/forms/numberInput/NumberInput.d.ts +4 -0
  13. package/lib/components/forms/passwordInput/PasswordInput.d.ts +1 -0
  14. package/lib/components/forms/radio/Radio.d.ts +6 -0
  15. package/lib/components/forms/select/Select.d.ts +10 -0
  16. package/lib/components/forms/textarea/Textarea.d.ts +7 -0
  17. package/lib/components/forms/timePicker/TimePicker.d.ts +5 -0
  18. package/lib/components/forms/toggle/Toggle.d.ts +7 -0
  19. package/lib/components/icons/types.d.ts +5 -0
  20. package/lib/components/loading-indicators/BarSpinner/BarSpinner.d.ts +4 -0
  21. package/lib/components/loading-indicators/CirclePulse/CirclePulse.d.ts +2 -0
  22. package/lib/components/menu/Menu.d.ts +1 -0
  23. package/lib/components/modal/types.d.ts +22 -0
  24. package/lib/components/pagination/types.d.ts +4 -0
  25. package/lib/components/pill/Pill.d.ts +1 -1
  26. package/lib/components/pill/Pill.stories.d.ts +2 -1
  27. package/lib/components/pill/types.d.ts +8 -2
  28. package/lib/components/skeleton/Skeleton.d.ts +5 -0
  29. package/lib/components/stepper/types.d.ts +9 -0
  30. package/lib/components/table/types.d.ts +9 -0
  31. package/lib/components/tanstackTable/TankstackTable.types.d.ts +25 -0
  32. package/lib/components/tanstackTable/components/ActionBar/ActionBar.d.ts +4 -0
  33. package/lib/components/tooltip/Tooltip.d.ts +6 -0
  34. package/lib/components/truncate/types.d.ts +4 -0
  35. package/lib/index.css +4977 -5020
  36. package/lib/index.d.ts +268 -5
  37. package/lib/index.esm.css +4977 -5020
  38. package/lib/index.esm.js +3 -2
  39. package/lib/index.esm.js.map +1 -1
  40. package/lib/index.js +3 -2
  41. package/lib/index.js.map +1 -1
  42. package/lib/types.d.ts +3 -1
  43. package/package.json +2 -1
  44. package/src/components/badge/Badge.stories.tsx +0 -4
  45. package/src/components/badge/types.ts +4 -0
  46. package/src/components/button/Button.stories.tsx +5 -18
  47. package/src/components/button/types.ts +52 -2
  48. package/src/components/card/Card.stories.tsx +0 -5
  49. package/src/components/card/Card.tsx +5 -0
  50. package/src/components/floatUI/FloatUI.stories.tsx +0 -11
  51. package/src/components/floatUI/types.ts +7 -0
  52. package/src/components/forms/checkbox/Checkbox.stories.tsx +0 -7
  53. package/src/components/forms/checkbox/Checkbox.tsx +7 -0
  54. package/src/components/forms/date/datePicker/DatePicker.stories.tsx +0 -33
  55. package/src/components/forms/date/datePicker/types.ts +10 -0
  56. package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +5 -22
  57. package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +16 -0
  58. package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.tsx +0 -25
  59. package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +8 -0
  60. package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +0 -32
  61. package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +9 -0
  62. package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +0 -28
  63. package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +9 -0
  64. package/src/components/forms/numberInput/NumberInput.stories.tsx +0 -4
  65. package/src/components/forms/numberInput/NumberInput.tsx +4 -0
  66. package/src/components/forms/passwordInput/PasswordInput.stories.tsx +0 -1
  67. package/src/components/forms/passwordInput/PasswordInput.tsx +1 -0
  68. package/src/components/forms/radio/Radio.stories.tsx +0 -6
  69. package/src/components/forms/radio/Radio.tsx +6 -0
  70. package/src/components/forms/select/Select.stories.tsx +1 -14
  71. package/src/components/forms/select/Select.tsx +10 -0
  72. package/src/components/forms/textarea/Textarea.stories.tsx +0 -7
  73. package/src/components/forms/textarea/Textarea.tsx +7 -0
  74. package/src/components/forms/timePicker/TimePicker.stories.tsx +0 -5
  75. package/src/components/forms/timePicker/TimePicker.tsx +5 -0
  76. package/src/components/forms/toggle/Toggle.stories.tsx +0 -7
  77. package/src/components/forms/toggle/Toggle.tsx +7 -0
  78. package/src/components/icons/Icon.stories.tsx +0 -7
  79. package/src/components/icons/types.ts +5 -0
  80. package/src/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +0 -5
  81. package/src/components/loading-indicators/BarSpinner/BarSpinner.tsx +4 -0
  82. package/src/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +0 -3
  83. package/src/components/loading-indicators/CirclePulse/CirclePulse.tsx +2 -0
  84. package/src/components/menu/Menu.stories.tsx +0 -3
  85. package/src/components/menu/Menu.tsx +1 -0
  86. package/src/components/modal/Modal.stories.tsx +1 -25
  87. package/src/components/modal/types.ts +22 -0
  88. package/src/components/pagination/Pagination.stories.tsx +0 -4
  89. package/src/components/pagination/types.ts +4 -0
  90. package/src/components/pill/Pill.mdx +6 -2
  91. package/src/components/pill/Pill.stories.tsx +50 -61
  92. package/src/components/pill/Pill.tsx +4 -2
  93. package/src/components/pill/__tests__/Pill.test.tsx +28 -10
  94. package/src/components/pill/styles/Pill.scss +12 -129
  95. package/src/components/pill/types.ts +8 -2
  96. package/src/components/skeleton/Skeleton.stories.tsx +0 -7
  97. package/src/components/skeleton/Skeleton.tsx +5 -0
  98. package/src/components/stepper/Stepper.stories.tsx +0 -19
  99. package/src/components/stepper/types.ts +9 -0
  100. package/src/components/table/Table.stories.tsx +0 -35
  101. package/src/components/table/types.ts +9 -0
  102. package/src/components/tanstackTable/TankstackTable.types.ts +25 -0
  103. package/src/components/tanstackTable/TanstackTable.stories.tsx +0 -29
  104. package/src/components/tanstackTable/components/ActionBar/ActionBar.stories.tsx +0 -4
  105. package/src/components/tanstackTable/components/ActionBar/ActionBar.tsx +4 -0
  106. package/src/components/tooltip/Tooltip.stories.tsx +0 -8
  107. package/src/components/tooltip/Tooltip.tsx +6 -0
  108. package/src/components/truncate/Truncate.stories.tsx +0 -8
  109. package/src/components/truncate/types.ts +4 -0
  110. package/src/styles/_colors.scss +9 -0
  111. package/src/styles/globals.scss +22 -0
  112. package/src/styles/index.scss +11 -10
  113. package/src/styles/variables/_colors.scss +269 -2
  114. package/src/types.ts +12 -8
  115. package/src/styles/variables/themes/dark.scss +0 -267
  116. package/src/styles/variables/themes/light.scss +0 -266
@@ -1,13 +1,21 @@
1
1
  import { ReactNode } from 'react';
2
2
  export interface StepperProps {
3
+ /** An array of step objects that define the stepper navigation. */
3
4
  steps: Step[];
4
5
  currentStep?: number;
6
+ /** The header content for the legend. */
5
7
  legendHeader?: ReactNode;
8
+ /** The footer content for the legend. */
6
9
  legendFooter?: ReactNode;
10
+ /** The function to call when the back button is clicked. */
7
11
  onBackClick: () => void;
12
+ /** The function to call when the next button is clicked. */
8
13
  onNextClick: () => void;
14
+ /** The function to call when the finish button is clicked. */
9
15
  onFinishClick: () => void;
16
+ /** Any item passed to this component as a child will be rendered as a step. */
10
17
  children: React.ReactNode;
18
+ /** The function to call when a step is clicked ont he legend. */
11
19
  onStepClick: (step: number) => void;
12
20
  }
13
21
  export interface StepperLegendProps {
@@ -16,6 +24,7 @@ export interface StepperLegendProps {
16
24
  onStepClick: (step: number) => void;
17
25
  }
18
26
  export interface Step {
27
+ /** Display text for the step in the sidebar/legend */
19
28
  label: string;
20
29
  isCompleted?: boolean;
21
30
  isNextDisabled?: boolean;
@@ -10,13 +10,22 @@ export interface PinnableColumn<T> extends RDTTableColumn<T> {
10
10
  }
11
11
  export type TableColumn<T> = PinnableColumn<T>;
12
12
  export interface TableProps<T> extends Omit<IDataTableProps<T>, 'paginationComponent' | 'direction' | 'subHeaderAlign'> {
13
+ /** The columns to display in the table. All columns require a unique id property. For pinned columns, please see the pinned example below. */
13
14
  columns: TableColumn<T>[];
15
+ /** Disables the Table section */
14
16
  isDisabled?: boolean;
17
+ /** It sets the loading of the table */
15
18
  isLoading?: boolean;
19
+ /** Accepts: ltr, rtl, or auto. When set to auto (default), RDT will attempt to detect direction by checking the HTML and DIV tags. For cases where you need to force rtl, or ltr just set this option manually (i.e. SSR). */
16
20
  direction?: Direction;
21
+ /** Show a sub header between the table and table header */
17
22
  subHeaderAlign?: 'left' | 'right' | 'center';
23
+ /** Enables height to be set to the full height of the container */
18
24
  isFullHeight?: boolean;
25
+ /** The text to display in the total entries section. This is hidden if 1. No pagination exists, 2. No string is passed. */
19
26
  totalEntriesText?: string;
27
+ /** Allows the pinning of columns to the left hand side. This is required when using the column pin API */
20
28
  canPinColumns?: boolean;
29
+ /** Callback that receives the IDs of the pinned columns when they change. */
21
30
  onPinnedColumnsChange?: (pinnedColumnIds: any[]) => void;
22
31
  }
@@ -1,9 +1,14 @@
1
1
  import { Row, ColumnDef, SortingState } from '@tanstack/react-table';
2
2
  export type WithPaginationProps = {
3
+ /** Number of rows to display per pagination page. */
3
4
  rowsPerPage: number;
5
+ /** Total number of rows in the table. */
4
6
  rowCount: number;
7
+ /** Callback when the page changes. */
5
8
  onChangePage: (page: number) => void;
9
+ /** Current page number. */
6
10
  currentPage: number;
11
+ /** Text to display for the total number of entries. */
7
12
  totalEntriesText?: string;
8
13
  showPagination: true;
9
14
  };
@@ -17,32 +22,52 @@ export type WithoutPaginationProps = {
17
22
  };
18
23
  export type PaginationProps = WithPaginationProps | WithoutPaginationProps;
19
24
  export type Props<T extends object> = {
25
+ /** Array of data items. These are the items that will be displayed in the table cell. */
20
26
  data: T[];
27
+ /** Striped rows */
21
28
  isStriped?: boolean;
29
+ /** Column definitions including an `id` field. This is how you define your table structure. */
22
30
  columns: ColumnDef<T & {
23
31
  id: string;
24
32
  }>[];
33
+ /** Additional option for class names. */
25
34
  className?: string;
35
+ /** class name for styling the action bar. */
26
36
  actionBarClassName?: string;
37
+ /** Component for table actions with selected items. */
27
38
  TableActions?: React.ComponentType<{
28
39
  selectedItems: Row<any>[];
29
40
  unselectRows: () => void;
30
41
  }>;
42
+ /** Error state of the table. */
31
43
  error?: {
32
44
  hasError: boolean;
33
45
  errorMessage?: string;
34
46
  };
47
+ /** Enables row selection or defines selection conditions. */
35
48
  enableRowSelection?: boolean | ((row: Row<T>) => boolean);
49
+ /** Function to clear applied filters. */
36
50
  clearFilters?: () => void;
51
+ /** Indicates if filters are applied. */
37
52
  hasFilters?: boolean;
53
+ /** When this is true, the table is considered to be in a loading state. */
38
54
  isLoading?: boolean;
55
+ /** Message to display when the table is loading. */
39
56
  isLoadingMessage?: string;
57
+ /** Columns that are pinned by default. */
40
58
  defaultPinnedColumns?: string[];
59
+ /** Callback when a row is clicked. */
41
60
  onClickRow?: ((row: Row<T>) => void) | null;
61
+ /** Callback when a row is clicked. */
42
62
  onRowClick?: (row: T) => void;
63
+ /** Array of active rows. */
43
64
  activeRows?: string[];
65
+ /** Row selection state. */
44
66
  rowSelection?: Record<string, boolean>;
67
+ /** Callback when a row is selected. */
45
68
  onRowSelectionChange?: (updater: Record<string, boolean>) => void;
69
+ /** Callback when all rows are selected. */
46
70
  onSelectAllChange?: (isSelected: boolean) => void;
71
+ /** 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. */
47
72
  defaultSorting?: SortingState;
48
73
  } & PaginationProps;
@@ -1,16 +1,20 @@
1
1
  import React from 'react';
2
2
  import { Row, Table } from '@tanstack/react-table';
3
3
  type Props<T extends object> = {
4
+ /** Table instance. */
4
5
  table: Table<T & {
5
6
  id: string;
6
7
  }>;
8
+ /** Component for table actions with selected items. */
7
9
  TableActions?: React.ComponentType<{
8
10
  selectedItems: Row<T & {
9
11
  id: string;
10
12
  }>[];
11
13
  unselectRows: () => void;
12
14
  }>;
15
+ /** class name for styling. */
13
16
  className?: string;
17
+ /** React node to display in the action bar. */
14
18
  children?: React.ReactNode;
15
19
  };
16
20
  export declare function ActionBar<T extends object>({ table, TableActions, className, children, }: Props<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,18 @@
1
1
  import { PlacesType } from 'react-tooltip';
2
2
  interface TooltipProps {
3
3
  id: string;
4
+ /** Whether the tooltip should be shown on click */
4
5
  clickToShow?: boolean;
6
+ /** The delay in milliseconds before the tooltip is shown */
5
7
  delayShow?: number;
8
+ /** The delay in milliseconds before the tooltip is hidden */
6
9
  delayHide?: number;
7
10
  children: React.ReactNode;
11
+ /** This is an override for the z-index of the tooltip */
8
12
  zIndex?: number;
13
+ /** The placement of the tooltip */
9
14
  place?: PlacesType;
15
+ /** The content of the tooltip */
10
16
  [key: string]: any;
11
17
  }
12
18
  export declare const Tooltip: ({ id, clickToShow, delayShow, delayHide, children, zIndex, place, ...rest }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,11 @@
1
1
  export interface TruncateProps {
2
+ /** The number of lines to truncate the text to. If left blank, it will default to 1 line. */
2
3
  lineClamp?: number;
4
+ /** The string to truncate. This value will also be displayed in the tooltip when the text is truncated. */
3
5
  truncateString: string;
6
+ /** Whether to show the tooltip. If left blank, it will default to true. If set to false, the tooltip will not be shown. */
4
7
  hasTooltip?: boolean;
8
+ /** The id of the tooltip. If an ID is not provided, it will generate one from uuid */
5
9
  tooltipId?: string;
6
10
  [key: string]: any;
7
11
  }