@indico-data/design-system 2.49.0 → 2.51.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 (83) hide show
  1. package/lib/components/tanstackTable/TankstackTable.types.d.ts +40 -0
  2. package/lib/components/tanstackTable/TanstackTable.stories.d.ts +15 -0
  3. package/lib/components/tanstackTable/TanstakTable.d.ts +4 -0
  4. package/lib/components/tanstackTable/__tests__/TanstackTable.test.d.ts +1 -0
  5. package/lib/components/tanstackTable/__tests__/__mocks__/test-mock-data.d.ts +8 -0
  6. package/lib/components/tanstackTable/components/ActionBar/ActionBar.d.ts +17 -0
  7. package/lib/components/tanstackTable/components/ActionBar/ActionBar.stories.d.ts +10 -0
  8. package/lib/components/tanstackTable/components/ActionBar/__tests__/ActionBar.test.d.ts +1 -0
  9. package/lib/components/tanstackTable/components/ActionBar/index.d.ts +1 -0
  10. package/lib/components/tanstackTable/components/NoResults/NoResults.d.ts +7 -0
  11. package/lib/components/tanstackTable/components/NoResults/__tests__/NoResult.test.d.ts +1 -0
  12. package/lib/components/tanstackTable/components/NoResults/index.d.ts +1 -0
  13. package/lib/components/tanstackTable/components/TableBody/TableBody.d.ts +12 -0
  14. package/lib/components/tanstackTable/components/TableBody/index.d.ts +1 -0
  15. package/lib/components/tanstackTable/components/TableHeader/TableHeader.d.ts +6 -0
  16. package/lib/components/tanstackTable/components/TableHeader/index.d.ts +1 -0
  17. package/lib/components/tanstackTable/components/TablePagination/TablePagination.d.ts +9 -0
  18. package/lib/components/tanstackTable/components/TablePagination/__tests__/TablePagination.test.d.ts +1 -0
  19. package/lib/components/tanstackTable/components/TablePagination/index.d.ts +1 -0
  20. package/lib/components/tanstackTable/docs/pinnedColumns/PinnedColumn.stories.d.ts +7 -0
  21. package/lib/components/tanstackTable/docs/withRowClick/WithRowClick.stories.d.ts +7 -0
  22. package/lib/components/tanstackTable/helpers.d.ts +830 -0
  23. package/lib/components/tanstackTable/index.d.ts +2 -0
  24. package/lib/components/tanstackTable/mock-data/mock-data.d.ts +14 -0
  25. package/lib/components/tanstackTable/mock-data/table-configuration.d.ts +3 -0
  26. package/lib/components/tanstackTable/useTanstackTable.d.ts +16 -0
  27. package/lib/index.css +407 -80
  28. package/lib/index.d.ts +62 -17
  29. package/lib/index.esm.css +407 -80
  30. package/lib/index.esm.js +20455 -56
  31. package/lib/index.esm.js.map +1 -1
  32. package/lib/index.js +20455 -55
  33. package/lib/index.js.map +1 -1
  34. package/lib/stylesAndAnimations/utilityClasses/UtilityClassesData.d.ts +7 -0
  35. package/lib/stylesAndAnimations/utilityClasses/UtilityClassesTable.d.ts +1 -0
  36. package/lib/stylesAndAnimations/utilityClasses/UtilityClassesTable.stories.d.ts +6 -0
  37. package/package.json +2 -1
  38. package/src/components/tanstackTable/TankstackTable.types.ts +39 -0
  39. package/src/components/tanstackTable/TanstackTable.mdx +122 -0
  40. package/src/components/tanstackTable/TanstackTable.stories.tsx +260 -0
  41. package/src/components/tanstackTable/TanstakTable.tsx +157 -0
  42. package/src/components/tanstackTable/__tests__/TanstackTable.test.tsx +87 -0
  43. package/src/components/tanstackTable/__tests__/__mocks__/test-mock-data.tsx +83 -0
  44. package/src/components/tanstackTable/components/ActionBar/ActionBar.mdx +10 -0
  45. package/src/components/tanstackTable/components/ActionBar/ActionBar.scss +30 -0
  46. package/src/components/tanstackTable/components/ActionBar/ActionBar.stories.tsx +98 -0
  47. package/src/components/tanstackTable/components/ActionBar/ActionBar.tsx +51 -0
  48. package/src/components/tanstackTable/components/ActionBar/__tests__/ActionBar.test.tsx +87 -0
  49. package/src/components/tanstackTable/components/ActionBar/index.ts +1 -0
  50. package/src/components/tanstackTable/components/NoResults/NoResults.scss +24 -0
  51. package/src/components/tanstackTable/components/NoResults/NoResults.tsx +22 -0
  52. package/src/components/tanstackTable/components/NoResults/__tests__/NoResult.test.tsx +25 -0
  53. package/src/components/tanstackTable/components/NoResults/index.ts +1 -0
  54. package/src/components/tanstackTable/components/TableBody/TableBody.tsx +87 -0
  55. package/src/components/tanstackTable/components/TableBody/index.ts +1 -0
  56. package/src/components/tanstackTable/components/TableHeader/TableHeader.tsx +49 -0
  57. package/src/components/tanstackTable/components/TableHeader/index.ts +1 -0
  58. package/src/components/tanstackTable/components/TablePagination/TablePagination.tsx +45 -0
  59. package/src/components/tanstackTable/components/TablePagination/__tests__/TablePagination.test.tsx +18 -0
  60. package/src/components/tanstackTable/components/TablePagination/index.ts +1 -0
  61. package/src/components/tanstackTable/docs/pinnedColumns/PinnedColumn.mdx +34 -0
  62. package/src/components/tanstackTable/docs/pinnedColumns/PinnedColumn.stories.tsx +40 -0
  63. package/src/components/tanstackTable/docs/withRowClick/WithRowClick.mdx +48 -0
  64. package/src/components/tanstackTable/docs/withRowClick/WithRowClick.stories.tsx +32 -0
  65. package/src/components/tanstackTable/helpers.ts +45 -0
  66. package/src/components/tanstackTable/index.ts +2 -0
  67. package/src/components/tanstackTable/mock-data/mock-data.ts +256 -0
  68. package/src/components/tanstackTable/mock-data/table-configuration.tsx +219 -0
  69. package/src/components/tanstackTable/styles/_variables.scss +35 -0
  70. package/src/components/tanstackTable/styles/table.scss +204 -0
  71. package/src/components/tanstackTable/styles/test.scss +19 -0
  72. package/src/components/tanstackTable/tanstack-table.d.ts +18 -0
  73. package/src/components/tanstackTable/useTanstackTable.tsx +42 -0
  74. package/src/index.ts +1 -0
  75. package/src/legacy/components/loading-indicators/CirclePulse/CirclePulse.tsx +1 -0
  76. package/src/storybookDocs/Permafrost.mdx +22 -11
  77. package/src/styles/_borders.scss +2 -1
  78. package/src/styles/index.scss +1 -0
  79. package/src/stylesAndAnimations/borders/BorderColor.tsx +14 -6
  80. package/src/stylesAndAnimations/utilityClasses/UtilityClasses.mdx +24 -0
  81. package/src/stylesAndAnimations/utilityClasses/UtilityClassesData.ts +230 -0
  82. package/src/stylesAndAnimations/utilityClasses/UtilityClassesTable.stories.tsx +13 -0
  83. package/src/stylesAndAnimations/utilityClasses/UtilityClassesTable.tsx +146 -0
package/lib/index.d.ts CHANGED
@@ -6,8 +6,9 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { ContainerProps, RowProps, ColProps } from 'react-grid-system';
7
7
  import { IDataTableProps, Direction as Direction$1, TableColumn as TableColumn$1 } from 'react-data-table-component';
8
8
  import { CSSObject } from 'styled-components';
9
- import { Props as Props$7 } from 'react-select';
9
+ import { Props as Props$8 } from 'react-select';
10
10
  import { DateRange, OnSelectHandler, Mode, CustomComponents, Matcher, Formatters, MonthChangeEventHandler, DayEventHandler } from 'react-day-picker';
11
+ import { ColumnDef, Row as Row$1 } from '@tanstack/react-table';
11
12
 
12
13
  declare const registerFontAwesomeIcons: (...icons: IconDefinition[]) => void;
13
14
 
@@ -222,28 +223,28 @@ type PermafrostComponent = {
222
223
 
223
224
  type SemanticColor = 'primary' | 'secondary' | 'warning' | 'error' | 'success' | 'info' | 'pending';
224
225
 
225
- type Props$6 = PermafrostComponent & {
226
+ type Props$7 = PermafrostComponent & {
226
227
  ariaLabel?: string;
227
228
  size?: IconSizes;
228
229
  style?: React$1.CSSProperties;
229
230
  fill?: string;
230
231
  };
231
- declare function CircleSpinner(props: Props$6): React$1.ReactElement;
232
+ declare function CircleSpinner(props: Props$7): React$1.ReactElement;
232
233
 
233
- type Props$5 = PermafrostComponent & {
234
+ type Props$6 = PermafrostComponent & {
234
235
  width?: string;
235
236
  };
236
- declare function BarSpinner(props: Props$5): React$1.ReactElement;
237
+ declare function BarSpinner(props: Props$6): React$1.ReactElement;
237
238
 
238
- type Props$4 = PermafrostComponent & {
239
+ type Props$5 = PermafrostComponent & {
239
240
  color?: string;
240
241
  overallSize?: string | number;
241
242
  rippleSize?: string | number;
242
243
  showRandomMessage?: boolean;
243
244
  };
244
- declare function CirclePulse(props: Props$4): React$1.ReactElement;
245
+ declare function CirclePulse(props: Props$5): React$1.ReactElement;
245
246
 
246
- type Props$3 = PermafrostComponent & {
247
+ type Props$4 = PermafrostComponent & {
247
248
  questionMark?: boolean;
248
249
  for?: string | null;
249
250
  place?: string;
@@ -254,7 +255,7 @@ type Props$3 = PermafrostComponent & {
254
255
  children: React$1.ReactNode;
255
256
  block?: boolean;
256
257
  };
257
- declare const Tooltip: (props: Props$3) => react_jsx_runtime.JSX.Element;
258
+ declare const Tooltip: (props: Props$4) => react_jsx_runtime.JSX.Element;
258
259
 
259
260
  declare const Container: ({ ref: _ref, ...rest }: ContainerProps) => react_jsx_runtime.JSX.Element;
260
261
 
@@ -390,7 +391,7 @@ interface PasswordInputProps extends LabelProps {
390
391
  }
391
392
  declare const LabeledPasswordInput: React$1.ForwardRefExoticComponent<Omit<Omit<PasswordInputProps, "ref"> & React$1.RefAttributes<HTMLInputElement> & LabelProps, "ref"> & React$1.RefAttributes<any>>;
392
393
 
393
- interface SelectProps<OptionType extends SelectOption> extends Props$7<OptionType> {
394
+ interface SelectProps<OptionType extends SelectOption> extends Props$8<OptionType> {
394
395
  options: OptionType[];
395
396
  }
396
397
  declare const Select: <OptionType extends SelectOption>({ classNamePrefix, className, components: customComponents, ...props }: SelectProps<OptionType>) => react_jsx_runtime.JSX.Element;
@@ -424,7 +425,7 @@ interface DatePickerProps {
424
425
 
425
426
  declare const DatePicker: (props: DatePickerProps) => react_jsx_runtime.JSX.Element;
426
427
 
427
- interface Props$2 {
428
+ interface Props$3 {
428
429
  mode?: Mode;
429
430
  ariaLabel: string;
430
431
  disableBeforeDate?: Date;
@@ -442,7 +443,7 @@ interface Props$2 {
442
443
  initialMonth?: Date;
443
444
  'data-testid'?: string;
444
445
  }
445
- declare const IconTriggerDatePicker: (props: Props$2) => react_jsx_runtime.JSX.Element;
446
+ declare const IconTriggerDatePicker: (props: Props$3) => react_jsx_runtime.JSX.Element;
446
447
 
447
448
  interface SingleInputDatePickerProps {
448
449
  ariaLabel: string;
@@ -480,23 +481,23 @@ interface FormProps {
480
481
  }
481
482
  declare const Form: ({ children, onSubmit, action, method, target, autocomplete, noValidate, enctype, rel, ...rest }: FormProps) => react_jsx_runtime.JSX.Element;
482
483
 
483
- type Props$1 = {
484
+ type Props$2 = {
484
485
  className?: string;
485
486
  height?: number | string;
486
487
  width?: number | string;
487
488
  isCircle?: boolean;
488
489
  isFullHeight?: boolean;
489
490
  };
490
- declare const Skeleton: ({ className, height, width, isCircle, isFullHeight, ...rest }: Props$1) => react_jsx_runtime.JSX.Element;
491
+ declare const Skeleton: ({ className, height, width, isCircle, isFullHeight, ...rest }: Props$2) => react_jsx_runtime.JSX.Element;
491
492
 
492
- type Props = {
493
+ type Props$1 = {
493
494
  className?: string;
494
495
  children: React$1.ReactNode;
495
496
  title?: string;
496
497
  subtitle?: string;
497
498
  hasBoxShadow?: boolean;
498
499
  };
499
- declare const Card: React$1.FC<Props>;
500
+ declare const Card: React$1.FC<Props$1>;
500
501
 
501
502
  type FloatUIProps = {
502
503
  children: [ReactElement, ReactElement];
@@ -549,4 +550,48 @@ interface ModalProps {
549
550
 
550
551
  declare const Modal: ({ className, children, isOpen, onRequestClose, portalClassName, overlayClassName, appElement, shouldCloseOnOverlayClick, shouldCloseOnEsc, testId, contentElement, overlayElement, position, parentSelector, ...rest }: ModalProps) => react_jsx_runtime.JSX.Element;
551
552
 
552
- export { Badge, BarSpinner, Button, Card, Checkbox, CirclePulse, CircleSpinner, Col, Container, DatePicker, FloatUI, Form, Icon, IconTriggerDatePicker, LabeledInput as Input, Menu, Modal, LabeledPasswordInput as PasswordInput, Pill, Radio as RadioInput, Row, Select as SelectInput, SingleInputDatePicker, Skeleton, Table, LabeledTextarea as Textarea, Toggle as ToggleInput, Tooltip, registerFontAwesomeIcons };
553
+ type WithPaginationProps = {
554
+ rowsPerPage: number;
555
+ rowCount: number;
556
+ onChangePage: (page: number, perPage: number) => void;
557
+ currentPage: number;
558
+ totalEntriesText?: string;
559
+ showPagination: true;
560
+ };
561
+ type WithoutPaginationProps = {
562
+ rowsPerPage?: number;
563
+ rowCount?: number;
564
+ onChangePage?: (page: number, perPage: number) => void;
565
+ currentPage?: number;
566
+ totalEntriesText?: string;
567
+ showPagination?: false;
568
+ };
569
+ type PaginationProps = WithPaginationProps | WithoutPaginationProps;
570
+ type Props<T extends object> = {
571
+ data: T[];
572
+ columns: ColumnDef<T & {
573
+ id: string;
574
+ }>[];
575
+ className?: string;
576
+ actionBarClassName?: string;
577
+ TableActions?: React.ComponentType<{
578
+ selectedItems: Row$1<any>[];
579
+ unselectRows: () => void;
580
+ }>;
581
+ error?: {
582
+ hasError: boolean;
583
+ errorMessage?: string;
584
+ };
585
+ enableRowSelection?: boolean | ((row: Row$1<T>) => boolean);
586
+ clearFilters?: () => void;
587
+ hasFilters?: boolean;
588
+ isLoading?: boolean;
589
+ defaultPinnedColumns?: string[];
590
+ onClickRow?: ((row: Row$1<T>) => void) | null;
591
+ } & PaginationProps;
592
+
593
+ declare function TanstackTable<T extends object>({ columns: defaultColumns, data, className, currentPage, rowCount, rowsPerPage, onChangePage, totalEntriesText, TableActions, error, enableRowSelection, clearFilters, hasFilters, showPagination, isLoading, defaultPinnedColumns, onClickRow, actionBarClassName, }: Props<T & {
594
+ id: string;
595
+ }>): react_jsx_runtime.JSX.Element;
596
+
597
+ export { Badge, BarSpinner, Button, Card, Checkbox, CirclePulse, CircleSpinner, Col, Container, DatePicker, FloatUI, Form, Icon, IconTriggerDatePicker, LabeledInput as Input, Menu, Modal, LabeledPasswordInput as PasswordInput, Pill, Radio as RadioInput, Row, Select as SelectInput, SingleInputDatePicker, Skeleton, Table, TanstackTable, LabeledTextarea as Textarea, Toggle as ToggleInput, Tooltip, registerFontAwesomeIcons };