@economic/taco 2.22.1 → 2.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. package/dist/components/OverflowGroup/OverflowGroup.d.ts +1 -1
  2. package/dist/components/Report/Report.d.ts +2 -0
  3. package/dist/components/Report/components/Body/EmptyStateBody.d.ts +7 -0
  4. package/dist/components/Report/components/Cell/util.d.ts +1 -1
  5. package/dist/components/Report/types.d.ts +2 -0
  6. package/dist/components/Report/useReport.d.ts +1 -0
  7. package/dist/components/Select2/components/Trigger.d.ts +1 -0
  8. package/dist/components/Truncate/Truncate.d.ts +2 -2
  9. package/dist/esm/index.css +73 -75
  10. package/dist/esm/packages/taco/src/components/Card/Card.js +6 -3
  11. package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
  12. package/dist/esm/packages/taco/src/components/Field/Field.js +4 -15
  13. package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
  14. package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js +2 -2
  15. package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js.map +1 -1
  16. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +13 -6
  17. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
  18. package/dist/esm/packages/taco/src/components/Report/Report.js +9 -6
  19. package/dist/esm/packages/taco/src/components/Report/Report.js.map +1 -1
  20. package/dist/esm/packages/taco/src/components/Report/components/Body/EmptyStateBody.js +18 -0
  21. package/dist/esm/packages/taco/src/components/Report/components/Body/EmptyStateBody.js.map +1 -0
  22. package/dist/esm/packages/taco/src/components/Report/components/Cell/util.js +6 -2
  23. package/dist/esm/packages/taco/src/components/Report/components/Cell/util.js.map +1 -1
  24. package/dist/esm/packages/taco/src/components/Report/styles/useCssGridStylesheet.js +3 -2
  25. package/dist/esm/packages/taco/src/components/Report/styles/useCssGridStylesheet.js.map +1 -1
  26. package/dist/esm/packages/taco/src/components/Select2/Select2.js +1 -0
  27. package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
  28. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +9 -4
  29. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
  30. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +2 -2
  31. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
  32. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +1 -0
  33. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js.map +1 -1
  34. package/dist/esm/packages/taco/src/components/Toast/Toaster.js +4 -3
  35. package/dist/esm/packages/taco/src/components/Toast/Toaster.js.map +1 -1
  36. package/dist/esm/packages/taco/src/components/Truncate/Truncate.js +34 -0
  37. package/dist/esm/packages/taco/src/components/Truncate/Truncate.js.map +1 -0
  38. package/dist/esm/packages/taco/src/index.js +1 -0
  39. package/dist/esm/packages/taco/src/index.js.map +1 -1
  40. package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
  41. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableSettings.js +48 -6
  42. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableSettings.js.map +1 -1
  43. package/dist/esm/packages/taco/src/primitives/Table/useTable/useTable.js +4 -1
  44. package/dist/esm/packages/taco/src/primitives/Table/useTable/useTable.js.map +1 -1
  45. package/dist/esm/packages/taco/src/primitives/Table/useTable/util/presets.js +5 -5
  46. package/dist/esm/packages/taco/src/primitives/Table/useTable/util/presets.js.map +1 -1
  47. package/dist/esm/packages/taco/src/primitives/Table/useTable/util/search.js +14 -1
  48. package/dist/esm/packages/taco/src/primitives/Table/useTable/util/search.js.map +1 -1
  49. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js +127 -3
  50. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js.map +1 -1
  51. package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js +4 -4
  52. package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js.map +1 -1
  53. package/dist/index.css +73 -75
  54. package/dist/index.d.ts +1 -0
  55. package/dist/primitives/Table/types.d.ts +13 -1
  56. package/dist/primitives/Table/useTable/features/useTableSettings.d.ts +2 -2
  57. package/dist/primitives/Table/useTable/useTable.d.ts +1 -0
  58. package/dist/taco.cjs.development.js +306 -71
  59. package/dist/taco.cjs.development.js.map +1 -1
  60. package/dist/taco.cjs.production.min.js +1 -1
  61. package/dist/taco.cjs.production.min.js.map +1 -1
  62. package/dist/utils/hooks/useTruncated.d.ts +1 -1
  63. package/package.json +2 -2
  64. package/types.json +8672 -8382
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { ButtonProps } from '../Button/Button';
3
3
  export declare const OverflowGroup: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
4
- moreButton?: React.ReactElement<ButtonProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
4
+ moreButton?: ((moreButtonText: string) => React.ReactElement<ButtonProps>) | undefined;
5
5
  } & React.RefAttributes<HTMLDivElement>>;
@@ -6,11 +6,13 @@ declare function Column<TType = unknown>(_: ReportColumnProps<TType>): null;
6
6
  declare function Group(_: ReportGroupProps): null;
7
7
  export declare const Report: (<TType = unknown>(props: (import("../../primitives/Table/types").useTableClientProps<TType> & {
8
8
  customSettings?: import("./types").ReportCustomSettingsRenderer | undefined;
9
+ emptyState?: import("./types").ReportEmptyStateRenderer | undefined;
9
10
  toolbarLeft?: JSX.Element | undefined;
10
11
  toolbarRight?: JSX.Element | undefined;
11
12
  toolbarPanel?: JSX.Element | undefined;
12
13
  } & React.RefAttributes<TableRef>) | (import("../../primitives/Table/types").useTableServerProps<TType> & {
13
14
  customSettings?: import("./types").ReportCustomSettingsRenderer | undefined;
15
+ emptyState?: import("./types").ReportEmptyStateRenderer | undefined;
14
16
  toolbarLeft?: JSX.Element | undefined;
15
17
  toolbarRight?: JSX.Element | undefined;
16
18
  toolbarPanel?: JSX.Element | undefined;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ReportEmptyStateRenderer } from '../../types';
3
+ declare type EmptyStateProps = React.HTMLAttributes<HTMLTableSectionElement> & {
4
+ emptyState?: ReportEmptyStateRenderer;
5
+ };
6
+ export declare function EmptyStateBody(props: EmptyStateProps): JSX.Element;
7
+ export {};
@@ -13,6 +13,6 @@ export declare function getCellAttributes<TType = unknown>(cell: ReactTableCell<
13
13
  className: string | undefined;
14
14
  style: {};
15
15
  };
16
- export declare function useSearchHighlighting<TType = unknown>(cell: ReactTableCell<TType, unknown>, index: number, ref: React.RefObject<HTMLTableCellElement>): true | "current" | undefined;
16
+ export declare function useSearchHighlighting<TType = unknown>(cell: ReactTableCell<TType, unknown>, cellIndex: number, ref: React.RefObject<HTMLTableCellElement>): true | "current" | undefined;
17
17
  export declare function getCurrentRowCellElement(index: number, tableEl: HTMLElement): Element | null;
18
18
  export declare function scrollColumnIntoView(columnIndex: number, frozenColumnIndex: number, column: HTMLElement, tableEl: HTMLElement): void;
@@ -2,8 +2,10 @@
2
2
  import { TableColumnProps, TableGroupProps, TableSettings, useTableProps } from '../../primitives/Table/types';
3
3
  import { MenuItemProps } from '../Menu/components/Item';
4
4
  export type { TableFilterComparator, TableFilterValue, TableFilter, TableColumnAlignment, TableColumnClassNameHandler, TableColumnDataType, TableColumnFilter, TableColumnMenu, TableColumnRenderer, TableColumnRendererAggregate, TableColumnRendererControl, TableColumnRendererControlProps, TableColumnRendererHeader, TableColumnRendererFooter, TableColumnSort, TableColumnSortDirection, TableColumnSortFn, TableColumnWidth, TableRowActionRenderer, TableRowActionGroupRenderer, TableRowClickHandler, TableRowGotoHandler, TableRowHeight, TableRowSelectHandler, TableShortcutHandlerFn, TableShortcutHandlerObject, TableFilterHandler, TableFontSize, TablePreset, TableRowExpansionRenderer, TableScrollToIndexHandler, TableServerLoadPageHandler, TableServerLoadAllHandler, TableServerLoadAllState, TableSettingsHandler, TableShortcuts, TableSortHandler, TableSettings, TableFeatureProps, } from '../../primitives/Table/types';
5
+ export declare type ReportEmptyStateRenderer = () => JSX.Element | null;
5
6
  export declare type ReportProps<TType = unknown> = useTableProps<TType> & {
6
7
  customSettings?: ReportCustomSettingsRenderer;
8
+ emptyState?: ReportEmptyStateRenderer;
7
9
  toolbarLeft?: JSX.Element;
8
10
  toolbarRight?: JSX.Element;
9
11
  toolbarPanel?: JSX.Element;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { ReportProps } from './types';
3
3
  import { TableRef } from '../../primitives/Table/types';
4
4
  export declare function useReport<TType>(props: ReportProps<TType>, ref: React.RefObject<TableRef>): {
5
+ id: string;
5
6
  instance: import("@tanstack/table-core").Table<TType>;
6
7
  length: number;
7
8
  meta: import("@tanstack/table-core").TableMeta<TType>;
@@ -4,4 +4,5 @@ export declare const Trigger: React.ForwardRefExoticComponent<Pick<React.HTMLAtt
4
4
  emptyValue?: string | number | boolean | null | undefined;
5
5
  placeholder?: string | undefined;
6
6
  children: React.ReactElement<Select2OptionProps>[];
7
+ fontSize?: "small" | "medium" | "large" | undefined;
7
8
  } & React.RefAttributes<HTMLButtonElement>>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  export declare type TruncateProps = {
3
- tooltip: string;
4
3
  children: React.ReactElement;
4
+ tooltip: string;
5
5
  };
6
- export declare const Truncate: ({ tooltip, children }: TruncateProps) => JSX.Element;
6
+ export declare const Truncate: ({ children, tooltip }: TruncateProps) => JSX.Element;
@@ -903,88 +903,80 @@ table[data-taco='report'][data-table-font-size='large']
903
903
  }
904
904
 
905
905
  /* row/cell backgrounds -- we have to be specific so that nested tables don't inherit */
906
-
907
906
  /* normal rows */
908
- table[data-taco='report'] > tbody > tr:not([data-row-selected='true']) > td {
909
- @apply bg-white;
910
- }
907
+ table[data-taco='report'] > tbody > tr:not([data-row-selected]) > td {
908
+ @apply bg-white;
909
+ }
910
+ table[data-taco='report'] > tbody > tr:not([data-row-selected]):hover > td,
911
+ table[data-taco='report'] > tbody > tr:not([data-row-selected])[data-row-active] > td,
912
+ table[data-taco='report'] > tbody > tr:not([data-row-selected])[data-row-group] > td {
913
+ --table-row-actions-shadow: theme(colors.grey.100);
914
+ @apply bg-grey-100;
915
+ }
911
916
  /* search highlighting */
912
- table[data-taco='report'] > tbody > tr:not([data-row-selected='true']) > td[data-cell-highlighted='true'] {
913
- @apply bg-[#e9f2ff];
917
+ table[data-taco='report'] > tbody > tr:not([data-row-selected]) > td[data-cell-highlighted='true'] {
918
+ --table-row-actions-shadow: #e9f2ff;
919
+ @apply !bg-[#e9f2ff];
914
920
  }
915
- table[data-taco='report'] > tbody > tr:not([data-row-selected='true']) > td[data-cell-highlighted='current'] {
916
- @apply !bg-[#bfd9ff];
921
+ table[data-taco='report'] > tbody > tr:not([data-row-selected]) > td[data-cell-highlighted='current'] {
922
+ --table-row-actions-shadow: #bdd7fc;
923
+ @apply !bg-[#bdd7fc];
924
+ }
925
+ /* selected rows */
926
+ table[data-taco='report'] > tbody > tr[data-row-selected] > td {
927
+ @apply bg-blue-100;
928
+ }
929
+ table[data-taco='report'] > tbody > tr[data-row-selected]:hover > td,
930
+ table[data-taco='report'] > tbody > tr[data-row-selected][data-row-active] > td,
931
+ table[data-taco='report'] > tbody > tr[data-row-selected][data-row-group] > td {
932
+ --table-row-actions-shadow: #d6e3f6;
933
+ @apply bg-[#d6e3f6];
917
934
  }
918
- table[data-taco='report'] > tbody > tr:not([data-row-selected='true'])[data-row-group] > td {
919
- @apply bg-grey-100;
920
- }
921
- table[data-taco='report'] > tbody > tr:not([data-row-selected='true']):hover > td,
922
- table[data-taco='report'] > tbody > tr:not([data-row-selected='true'])[data-row-active='true'] > td,
923
- table[data-taco='report'] > tbody > tr:not([data-row-selected='true'])[data-row-active='true']:hover > td {
924
- --table-row-actions-shadow: theme(colors.grey.100);
925
- @apply bg-grey-100;
926
- }
927
935
  /* search highlighting */
928
- table[data-taco='report'] > tbody > tr:not([data-row-selected='true']):hover > td[data-cell-highlighted='true'], table[data-taco='report'] > tbody > tr:not([data-row-selected='true'])[data-row-active='true'] > td[data-cell-highlighted='true'], table[data-taco='report'] > tbody > tr:not([data-row-selected='true'])[data-row-active='true']:hover > td[data-cell-highlighted='true'] {
929
- @apply bg-[#e2ebf8];
936
+ table[data-taco='report'] > tbody > tr[data-row-selected] > td[data-cell-highlighted] {
937
+ --table-row-actions-shadow: #b4d2fd;
938
+ @apply !bg-[#b4d2fd];
930
939
  }
931
- /* normal rows when focus is inside the table */
932
- table[data-taco='report']:focus-within > tbody > tr[data-row-active='true']:not([data-row-selected='true']) > td {
933
- --table-row-actions-shadow: theme(colors.grey.200);
934
- @apply !bg-grey-200;
935
- }
936
940
 
937
- /* normal rows when hover is paused */
938
- table[data-taco='report'][data-table-pause-hover='true'] > tbody > tr:not([data-row-selected='true']):hover:not([data-row-active='true']) > td {
939
- --table-row-actions-shadow: theme(colors.white);
940
- @apply !bg-white;
941
- }
942
- table[data-taco='report'][data-table-pause-hover='true'] > tbody > tr:not([data-row-selected='true']):hover[data-row-active='true'] > td {
943
- --table-row-actions-shadow: theme(colors.grey.200);
944
- @apply !bg-grey-200;
945
- }
941
+ /* normal rows */
942
+
943
+ table[data-taco='report']:focus-within > tbody > tr:not([data-row-selected])[data-row-active] > td {
944
+ --table-row-actions-shadow: theme(colors.grey.200);
945
+ @apply bg-grey-200;
946
+ }
946
947
 
947
948
  /* selected rows */
948
- table[data-taco='report'] > tbody > tr[data-row-selected='true'] > td {
949
- @apply bg-blue-100;
950
- }
951
- /* search highlighting */
952
- table[data-taco='report'] > tbody > tr[data-row-selected='true'] > td[data-cell-highlighted='true'] {
953
- @apply bg-[#d0e4ff];
949
+
950
+ table[data-taco='report']:focus-within > tbody > tr[data-row-selected][data-row-active] > td {
951
+ --table-row-actions-shadow: #ccd8eb;
952
+ @apply bg-[#ccd8eb];
953
+ }
954
+
955
+ /* normal rows */
956
+
957
+ table[data-taco='report'][data-table-pause-hover='true'] > tbody > tr:hover:not([data-row-selected]):not([data-row-active]) > td {
958
+ --table-row-actions-shadow: theme(colors.white);
959
+ @apply bg-white;
954
960
  }
955
- table[data-taco='report'] > tbody > tr[data-row-selected='true'] > td[data-cell-highlighted='current'] {
956
- @apply !bg-[#b6d4ff];
961
+
962
+ table[data-taco='report'][data-table-pause-hover='true'] > tbody > tr:hover:not([data-row-selected])[data-row-active] > td {
963
+ --table-row-actions-shadow: theme(colors.grey.200);
964
+ @apply bg-grey-200;
957
965
  }
958
- table[data-taco='report'] > tbody > tr[data-row-selected='true']:hover > td,
959
- table[data-taco='report'] > tbody > tr[data-row-selected='true'][data-row-active='true'] > td,
960
- table[data-taco='report'] > tbody > tr[data-row-selected='true'][data-row-active='true']:hover > td {
961
- --table-row-actions-shadow: #d6e3f6;
962
- @apply bg-[#D6E3F6];
963
- }
964
- /* search highlighting */
965
- table[data-taco='report'] > tbody > tr[data-row-selected='true']:hover > td[data-cell-highlighted='true'], table[data-taco='report'] > tbody > tr[data-row-selected='true'][data-row-active='true'] > td[data-cell-highlighted='true'], table[data-taco='report'] > tbody > tr[data-row-selected='true'][data-row-active='true']:hover > td[data-cell-highlighted='true'] {
966
- @apply bg-[#cadef9];
966
+
967
+ /* selected rows */
968
+
969
+ table[data-taco='report'][data-table-pause-hover='true'] > tbody > tr:hover[data-row-selected]:not([data-row-active]) > td {
970
+ --table-row-actions-shadow: theme(colors.blue.100);
971
+ @apply bg-blue-100;
967
972
  }
968
- table[data-taco='report'] > tbody > tr[data-row-selected='true']:hover > td[data-cell-highlighted='current'], table[data-taco='report'] > tbody > tr[data-row-selected='true'][data-row-active='true'] > td[data-cell-highlighted='current'], table[data-taco='report'] > tbody > tr[data-row-selected='true'][data-row-active='true']:hover > td[data-cell-highlighted='current'] {
969
- @apply !bg-[#b4d2fd];
973
+
974
+ table[data-taco='report'][data-table-pause-hover='true'] > tbody > tr:hover[data-row-selected][data-row-active] > td {
975
+ --table-row-actions-shadow: #ccd8eb;
976
+ @apply bg-[#CCD8EB];
970
977
  }
971
- /* selected rows when focus is inside the table */
972
- table[data-taco='report']:focus-within > tbody > tr[data-row-active='true'][data-row-selected='true'] > td {
973
- --table-row-actions-shadow: #ccd8eb;
974
- @apply bg-[#CCD8EB];
975
- }
976
- /* selected rows when hover is paused */
977
- table[data-taco='report'][data-table-pause-hover='true'] > tbody > tr[data-row-selected='true']:hover:not([data-row-active='true']) > td {
978
- --table-row-actions-shadow: theme(colors.blue.100);
979
- @apply !bg-blue-100;
980
- }
981
- table[data-taco='report'][data-table-pause-hover='true'] > tbody > tr[data-row-selected='true']:hover[data-row-active='true'] > td {
982
- --table-row-actions-shadow: #ccd8eb;
983
- @apply !bg-[#CCD8EB];
984
- }
985
978
 
986
979
  /* row metadata */
987
-
988
980
  table[data-taco='report'] tbody tr[data-row-meta-layout='heading']:not([data-row-group='true']) td {
989
981
  @apply !border-b-0 border-t font-bold;
990
982
  }
@@ -1335,7 +1327,7 @@ table[data-taco='report'] [data-cell-id^='__'] {
1335
1327
  }
1336
1328
 
1337
1329
  [data-font-size='small'] [role='cell'] [data-taco='tag'] {
1338
- @apply !-my-1;
1330
+ @apply h-4 min-h-[theme(spacing.4)];
1339
1331
  }
1340
1332
 
1341
1333
  [data-font-size='small'] [role='cell'] [data-taco='Select2'],
@@ -1391,7 +1383,7 @@ table[data-taco='report'] [data-cell-id^='__'] {
1391
1383
  }
1392
1384
 
1393
1385
  /* When cell is editable and highlighted, the padding should apply to highlight wrapper and remove 1px border-width,
1394
- because it should take all the available space in the cell */
1386
+ because it should take all the available space in the cell */
1395
1387
 
1396
1388
  [data-font-size='small'] [role='cell'][data-editable][data-highlighted='true'] [data-taco='highlight'] {
1397
1389
  @apply px-[calc(var(--table3-cell-padding-x)_-_6px_-_1px)];
@@ -1414,8 +1406,8 @@ table[data-taco='report'] [data-cell-id^='__'] {
1414
1406
  @apply !-my-0.5;
1415
1407
  }
1416
1408
 
1417
- [data-font-size='medium'] [role='cell'] [data-taco='tag'] {
1418
- @apply !-my-0.5;
1409
+ [data-font-size='medium'] [role='cell'] [data-taco='Select2'] {
1410
+ @apply !px-2;
1419
1411
  }
1420
1412
 
1421
1413
  [data-font-size='medium'] [role='cell'] [data-taco='Select2'],
@@ -1430,7 +1422,7 @@ table[data-taco='report'] [data-cell-id^='__'] {
1430
1422
  }
1431
1423
 
1432
1424
  /* When cell is editable and highlighted, the padding should apply to highlight wrapper and remove 1px border-width,
1433
- because it should take all the available space in the cell */
1425
+ because it should take all the available space in the cell */
1434
1426
 
1435
1427
  [data-font-size='medium'] [role='cell'][data-editable][data-highlighted='true'] [data-taco='highlight'] {
1436
1428
  @apply px-[calc(var(--table3-cell-padding-x)_-_8px_-_1px)];
@@ -1460,8 +1452,8 @@ table[data-taco='report'] [data-cell-id^='__'] {
1460
1452
  @apply !-my-0.5;
1461
1453
  }
1462
1454
 
1463
- [data-font-size='large'] [role='cell'] [data-taco='tag'] {
1464
- @apply !-my-0.5;
1455
+ [data-font-size='large'] [role='cell'] [data-taco='Select2'] {
1456
+ @apply !px-2.5;
1465
1457
  }
1466
1458
 
1467
1459
  [data-font-size='large'] [role='cell'] [data-taco='Select2'],
@@ -1502,7 +1494,7 @@ table[data-taco='report'] [data-cell-id^='__'] {
1502
1494
  }
1503
1495
 
1504
1496
  /* When cell is editable and highlighted, the padding should apply to highlight wrapper and remove 1px border-width,
1505
- because it should take all the available space in the cell */
1497
+ because it should take all the available space in the cell */
1506
1498
 
1507
1499
  [data-font-size='large'] [role='cell'][data-editable][data-highlighted='true'] [data-taco='highlight'] {
1508
1500
  @apply px-[calc(var(--table3-cell-padding-x)_-_10px_-_1px)];
@@ -1520,3 +1512,9 @@ table[data-taco='report'] [data-cell-id^='__'] {
1520
1512
  [data-font-size='large'] [role='columnheader'] button {
1521
1513
  @apply !text-sm;
1522
1514
  }
1515
+
1516
+ /* When spinner is rendered in the last cell of the table, it slightly pushes the edge of the table(while rotating),
1517
+ and making horisontal scroll bar jump */
1518
+ [data-editing='true'] [role='cell']:last-child [data-taco='spinner'] {
1519
+ overflow: hidden;
1520
+ }
@@ -1,6 +1,7 @@
1
1
  import { forwardRef, createElement } from 'react';
2
2
  import cn from 'clsx';
3
3
  import { IconButton } from '../IconButton/IconButton.js';
4
+ import { Truncate } from '../Truncate/Truncate.js';
4
5
 
5
6
  const Content = /*#__PURE__*/forwardRef(function CardContent(externalProps, ref) {
6
7
  const {
@@ -28,9 +29,11 @@ const Card = /*#__PURE__*/forwardRef(function Card(props, ref) {
28
29
  ref: ref
29
30
  }, /*#__PURE__*/createElement("div", {
30
31
  className: "mx-4 mb-2 mt-4 flex"
31
- }, title && /*#__PURE__*/createElement("h4", {
32
- className: "mb-0 flex-grow text-left"
33
- }, title), menu ? /*#__PURE__*/createElement(IconButton, {
32
+ }, title && ( /*#__PURE__*/createElement(Truncate, {
33
+ tooltip: title
34
+ }, /*#__PURE__*/createElement("h4", {
35
+ className: "mb-0 flex-grow truncate text-left"
36
+ }, title))), menu ? /*#__PURE__*/createElement(IconButton, {
34
37
  icon: "ellipsis-horizontal",
35
38
  appearance: "discrete",
36
39
  menu: menu,
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../../../../../src/components/Card/Card.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\n\nimport { MenuProps } from '../Menu/Menu';\nimport { IconButton } from '../IconButton/IconButton';\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\n noPadding?: boolean;\n};\n\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\n const { noPadding, ...props } = externalProps;\n const className = cn(\n 'flex-grow overflow-auto',\n {\n 'mx-4 mb-4': !noPadding,\n },\n props.className\n );\n return <div {...props} className={className} ref={ref} />;\n});\n\nexport type CardProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Title of the Card */\n title: string | React.ReactElement;\n /** Menu component associated with the Card */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n};\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\n const { title, menu, children } = props;\n const className = cn(\n 'bg-white flex flex-col rounded-xl border border-solid border-radius-[12px] border-grey-300 hover:border-grey-500 [&_[data-taco=\"table2\"]]:!border-0',\n props.className\n );\n\n return (\n <div className={className} data-taco=\"card\" ref={ref}>\n <div className=\"mx-4 mb-2 mt-4 flex\">\n {title && <h4 className=\"mb-0 flex-grow text-left\">{title}</h4>}\n {menu ? <IconButton icon=\"ellipsis-horizontal\" appearance=\"discrete\" menu={menu} className=\"-mt-[4px]\" /> : null}\n </div>\n {children}\n </div>\n );\n}) as React.ForwardRefExoticComponent<CardProps> & {\n Content: React.ForwardRefExoticComponent<CardContentProps>;\n};\nCard.Content = Content;\n"],"names":["Content","React","CardContent","externalProps","ref","noPadding","props","className","cn","Card","title","menu","children","IconButton","icon","appearance"],"mappings":";;;;AAUA,MAAMA,OAAO,gBAAGC,UAAgB,CAAmC,SAASC,WAAWA,CAACC,aAAa,EAAEC,GAAG;EACtG,MAAM;IAAEC,SAAS;IAAE,GAAGC;GAAO,GAAGH,aAAa;EAC7C,MAAMI,SAAS,GAAGC,EAAE,CAChB,yBAAyB,EACzB;IACI,WAAW,EAAE,CAACH;GACjB,EACDC,KAAK,CAACC,SAAS,CAClB;EACD,oBAAON,uCAASK,KAAK;IAAEC,SAAS,EAAEA,SAAS;IAAEH,GAAG,EAAEA;KAAO;AAC7D,CAAC,CAAC;MASWK,IAAI,gBAAGR,UAAgB,CAA4B,SAASQ,IAAIA,CAACH,KAAK,EAAEF,GAAG;EACpF,MAAM;IAAEM,KAAK;IAAEC,IAAI;IAAEC;GAAU,GAAGN,KAAK;EACvC,MAAMC,SAAS,GAAGC,EAAE,CAChB,qJAAqJ,EACrJF,KAAK,CAACC,SAAS,CAClB;EAED,oBACIN;IAAKM,SAAS,EAAEA,SAAS;iBAAY,MAAM;IAACH,GAAG,EAAEA;kBAC7CH;IAAKM,SAAS,EAAC;KACVG,KAAK,iBAAIT;IAAIM,SAAS,EAAC;KAA4BG,KAAK,CAAM,EAC9DC,IAAI,gBAAGV,cAACY,UAAU;IAACC,IAAI,EAAC,qBAAqB;IAACC,UAAU,EAAC,UAAU;IAACJ,IAAI,EAAEA,IAAI;IAAEJ,SAAS,EAAC;IAAc,GAAG,IAAI,CAC9G,EACLK,QAAQ,CACP;AAEd,CAAC;AAGDH,IAAI,CAACT,OAAO,GAAGA,OAAO;;;;"}
1
+ {"version":3,"file":"Card.js","sources":["../../../../../../../src/components/Card/Card.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\n\nimport { MenuProps } from '../Menu/Menu';\nimport { IconButton } from '../IconButton/IconButton';\nimport { Truncate } from '../Truncate/Truncate';\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\n noPadding?: boolean;\n};\n\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\n const { noPadding, ...props } = externalProps;\n const className = cn(\n 'flex-grow overflow-auto',\n {\n 'mx-4 mb-4': !noPadding,\n },\n props.className\n );\n return <div {...props} className={className} ref={ref} />;\n});\n\nexport type CardProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Title of the Card */\n title: string | React.ReactElement;\n /** Menu component associated with the Card */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n};\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\n const { title, menu, children } = props;\n const className = cn(\n 'bg-white flex flex-col rounded-xl border border-solid border-radius-[12px] border-grey-300 hover:border-grey-500 [&_[data-taco=\"table2\"]]:!border-0',\n props.className\n );\n\n return (\n <div className={className} data-taco=\"card\" ref={ref}>\n <div className=\"mx-4 mb-2 mt-4 flex\">\n {title && (\n <Truncate tooltip={title}>\n <h4 className=\"mb-0 flex-grow truncate text-left\">{title}</h4>\n </Truncate>\n )}\n {menu ? <IconButton icon=\"ellipsis-horizontal\" appearance=\"discrete\" menu={menu} className=\"-mt-[4px]\" /> : null}\n </div>\n {children}\n </div>\n );\n}) as React.ForwardRefExoticComponent<CardProps> & {\n Content: React.ForwardRefExoticComponent<CardContentProps>;\n};\nCard.Content = Content;\n"],"names":["Content","React","CardContent","externalProps","ref","noPadding","props","className","cn","Card","title","menu","children","Truncate","tooltip","IconButton","icon","appearance"],"mappings":";;;;;AAWA,MAAMA,OAAO,gBAAGC,UAAgB,CAAmC,SAASC,WAAWA,CAACC,aAAa,EAAEC,GAAG;EACtG,MAAM;IAAEC,SAAS;IAAE,GAAGC;GAAO,GAAGH,aAAa;EAC7C,MAAMI,SAAS,GAAGC,EAAE,CAChB,yBAAyB,EACzB;IACI,WAAW,EAAE,CAACH;GACjB,EACDC,KAAK,CAACC,SAAS,CAClB;EACD,oBAAON,uCAASK,KAAK;IAAEC,SAAS,EAAEA,SAAS;IAAEH,GAAG,EAAEA;KAAO;AAC7D,CAAC,CAAC;MASWK,IAAI,gBAAGR,UAAgB,CAA4B,SAASQ,IAAIA,CAACH,KAAK,EAAEF,GAAG;EACpF,MAAM;IAAEM,KAAK;IAAEC,IAAI;IAAEC;GAAU,GAAGN,KAAK;EACvC,MAAMC,SAAS,GAAGC,EAAE,CAChB,qJAAqJ,EACrJF,KAAK,CAACC,SAAS,CAClB;EAED,oBACIN;IAAKM,SAAS,EAAEA,SAAS;iBAAY,MAAM;IAACH,GAAG,EAAEA;kBAC7CH;IAAKM,SAAS,EAAC;KACVG,KAAK,mBACFT,cAACY,QAAQ;IAACC,OAAO,EAAEJ;kBACfT;IAAIM,SAAS,EAAC;KAAqCG,KAAK,CAAM,CACvD,CACd,EACAC,IAAI,gBAAGV,cAACc,UAAU;IAACC,IAAI,EAAC,qBAAqB;IAACC,UAAU,EAAC,UAAU;IAACN,IAAI,EAAEA,IAAI;IAAEJ,SAAS,EAAC;IAAc,GAAG,IAAI,CAC9G,EACLK,QAAQ,CACP;AAEd,CAAC;AAGDH,IAAI,CAACT,OAAO,GAAGA,OAAO;;;;"}
@@ -1,16 +1,9 @@
1
- import { forwardRef, useState, useRef, useEffect, createElement } from 'react';
1
+ import { forwardRef, useRef, createElement } from 'react';
2
2
  import cn from 'clsx';
3
- import { Tooltip } from '../Tooltip/Tooltip.js';
4
- import { useTruncated } from '../../utils/hooks/useTruncated.js';
3
+ import { Truncate } from '../Truncate/Truncate.js';
5
4
 
6
5
  const Field = /*#__PURE__*/forwardRef(function Field(props, ref) {
7
- const [showTooltip, setShowTooltip] = useState(false);
8
6
  const messageRef = useRef(null);
9
- useEffect(() => {
10
- // refs are null on the first render so setting showTooltip state forces the rerender to see if message is
11
- // truncated or not
12
- setShowTooltip(true);
13
- }, []);
14
7
  const {
15
8
  disabled,
16
9
  children,
@@ -28,16 +21,12 @@ const Field = /*#__PURE__*/forwardRef(function Field(props, ref) {
28
21
  'text-yellow-700': warning && !invalid,
29
22
  'opacity-50': disabled
30
23
  });
31
- const {
32
- truncated: isMessageTrucated
33
- } = useTruncated(messageRef.current, [message, showTooltip]);
34
24
  return /*#__PURE__*/createElement("label", Object.assign({}, otherProps, {
35
25
  className: className,
36
26
  "data-taco": "label",
37
27
  ref: ref
38
- }), children, message && ( /*#__PURE__*/createElement(Tooltip, {
39
- title: message,
40
- hide: !isMessageTrucated
28
+ }), children, message && ( /*#__PURE__*/createElement(Truncate, {
29
+ tooltip: message
41
30
  }, /*#__PURE__*/createElement("span", {
42
31
  className: messageClassName,
43
32
  ref: messageRef,
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","sources":["../../../../../../../src/components/Field/Field.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\n\nimport './Field.css';\nimport { useTruncated } from '../../utils/hooks/useTruncated';\nimport { Tooltip } from '../Tooltip/Tooltip';\n\nexport type FieldProps = React.LabelHTMLAttributes<HTMLLabelElement> & {\n /** Content of the field */\n children: React.ReactNode;\n /**\tChanges the style to indicate the element is disabled */\n disabled?: boolean;\n /* Whether the input is in an invalid state */\n invalid?: boolean;\n /* Whether the input is in a warning state */\n warning?: boolean;\n /**\n * Text displayed below the children of Field.\n * Should be a short text that indicates feedback for user.\n */\n message?: string;\n};\n\nexport const Field = React.forwardRef(function Field(props: FieldProps, ref: React.Ref<HTMLLabelElement>) {\n const [showTooltip, setShowTooltip] = React.useState(false);\n const messageRef = React.useRef<HTMLSpanElement>(null);\n\n React.useEffect(() => {\n // refs are null on the first render so setting showTooltip state forces the rerender to see if message is\n // truncated or not\n setShowTooltip(true);\n }, []);\n\n const { disabled, children, invalid = false, warning = false, message, ...otherProps } = props;\n const className = cn(\n 'flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]',\n {\n 'text-grey-300': disabled,\n },\n props.className\n );\n const messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {\n 'text-grey-700': !invalid && !warning,\n 'text-red-500': invalid,\n 'text-yellow-700': warning && !invalid,\n 'opacity-50': disabled,\n });\n\n const { truncated: isMessageTrucated } = useTruncated(messageRef.current, [message, showTooltip]);\n\n return (\n <label {...otherProps} className={className} data-taco=\"label\" ref={ref}>\n {children}\n {message && (\n <Tooltip title={message} hide={!isMessageTrucated}>\n <span className={messageClassName} ref={messageRef} role={invalid ? 'alert' : undefined}>\n {message}\n </span>\n </Tooltip>\n )}\n </label>\n );\n});\n"],"names":["Field","React","props","ref","showTooltip","setShowTooltip","messageRef","disabled","children","invalid","warning","message","otherProps","className","cn","messageClassName","truncated","isMessageTrucated","useTruncated","current","Tooltip","title","hide","role","undefined"],"mappings":";;;;;MAuBaA,KAAK,gBAAGC,UAAgB,CAAC,SAASD,KAAKA,CAACE,KAAiB,EAAEC,GAAgC;EACpG,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGJ,QAAc,CAAC,KAAK,CAAC;EAC3D,MAAMK,UAAU,GAAGL,MAAY,CAAkB,IAAI,CAAC;EAEtDA,SAAe,CAAC;;;IAGZI,cAAc,CAAC,IAAI,CAAC;GACvB,EAAE,EAAE,CAAC;EAEN,MAAM;IAAEE,QAAQ;IAAEC,QAAQ;IAAEC,OAAO,GAAG,KAAK;IAAEC,OAAO,GAAG,KAAK;IAAEC,OAAO;IAAE,GAAGC;GAAY,GAAGV,KAAK;EAC9F,MAAMW,SAAS,GAAGC,EAAE,CAChB,8EAA8E,EAC9E;IACI,eAAe,EAAEP;GACpB,EACDL,KAAK,CAACW,SAAS,CAClB;EACD,MAAME,gBAAgB,GAAGD,EAAE,CAAC,iEAAiE,EAAE;IAC3F,eAAe,EAAE,CAACL,OAAO,IAAI,CAACC,OAAO;IACrC,cAAc,EAAED,OAAO;IACvB,iBAAiB,EAAEC,OAAO,IAAI,CAACD,OAAO;IACtC,YAAY,EAAEF;GACjB,CAAC;EAEF,MAAM;IAAES,SAAS,EAAEC;GAAmB,GAAGC,YAAY,CAACZ,UAAU,CAACa,OAAO,EAAE,CAACR,OAAO,EAAEP,WAAW,CAAC,CAAC;EAEjG,oBACIH,yCAAWW,UAAU;IAAEC,SAAS,EAAEA,SAAS;iBAAY,OAAO;IAACV,GAAG,EAAEA;MAC/DK,QAAQ,EACRG,OAAO,mBACJV,cAACmB,OAAO;IAACC,KAAK,EAAEV,OAAO;IAAEW,IAAI,EAAE,CAACL;kBAC5BhB;IAAMY,SAAS,EAAEE,gBAAgB;IAAEZ,GAAG,EAAEG,UAAU;IAAEiB,IAAI,EAAEd,OAAO,GAAG,OAAO,GAAGe;KACzEb,OAAO,CACL,CACD,CACb,CACG;AAEhB,CAAC;;;;"}
1
+ {"version":3,"file":"Field.js","sources":["../../../../../../../src/components/Field/Field.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\n\nimport './Field.css';\nimport { Truncate } from '../Truncate/Truncate';\n\nexport type FieldProps = React.LabelHTMLAttributes<HTMLLabelElement> & {\n /** Content of the field */\n children: React.ReactNode;\n /**\tChanges the style to indicate the element is disabled */\n disabled?: boolean;\n /* Whether the input is in an invalid state */\n invalid?: boolean;\n /* Whether the input is in a warning state */\n warning?: boolean;\n /**\n * Text displayed below the children of Field.\n * Should be a short text that indicates feedback for user.\n */\n message?: string;\n};\n\nexport const Field = React.forwardRef(function Field(props: FieldProps, ref: React.Ref<HTMLLabelElement>) {\n const messageRef = React.useRef<HTMLSpanElement>(null);\n\n const { disabled, children, invalid = false, warning = false, message, ...otherProps } = props;\n const className = cn(\n 'flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]',\n {\n 'text-grey-300': disabled,\n },\n props.className\n );\n const messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {\n 'text-grey-700': !invalid && !warning,\n 'text-red-500': invalid,\n 'text-yellow-700': warning && !invalid,\n 'opacity-50': disabled,\n });\n\n return (\n <label {...otherProps} className={className} data-taco=\"label\" ref={ref}>\n {children}\n {message && (\n <Truncate tooltip={message}>\n <span className={messageClassName} ref={messageRef} role={invalid ? 'alert' : undefined}>\n {message}\n </span>\n </Truncate>\n )}\n </label>\n );\n});\n"],"names":["Field","React","props","ref","messageRef","disabled","children","invalid","warning","message","otherProps","className","cn","messageClassName","Truncate","tooltip","role","undefined"],"mappings":";;;;MAsBaA,KAAK,gBAAGC,UAAgB,CAAC,SAASD,KAAKA,CAACE,KAAiB,EAAEC,GAAgC;EACpG,MAAMC,UAAU,GAAGH,MAAY,CAAkB,IAAI,CAAC;EAEtD,MAAM;IAAEI,QAAQ;IAAEC,QAAQ;IAAEC,OAAO,GAAG,KAAK;IAAEC,OAAO,GAAG,KAAK;IAAEC,OAAO;IAAE,GAAGC;GAAY,GAAGR,KAAK;EAC9F,MAAMS,SAAS,GAAGC,EAAE,CAChB,8EAA8E,EAC9E;IACI,eAAe,EAAEP;GACpB,EACDH,KAAK,CAACS,SAAS,CAClB;EACD,MAAME,gBAAgB,GAAGD,EAAE,CAAC,iEAAiE,EAAE;IAC3F,eAAe,EAAE,CAACL,OAAO,IAAI,CAACC,OAAO;IACrC,cAAc,EAAED,OAAO;IACvB,iBAAiB,EAAEC,OAAO,IAAI,CAACD,OAAO;IACtC,YAAY,EAAEF;GACjB,CAAC;EAEF,oBACIJ,yCAAWS,UAAU;IAAEC,SAAS,EAAEA,SAAS;iBAAY,OAAO;IAACR,GAAG,EAAEA;MAC/DG,QAAQ,EACRG,OAAO,mBACJR,cAACa,QAAQ;IAACC,OAAO,EAAEN;kBACfR;IAAMU,SAAS,EAAEE,gBAAgB;IAAEV,GAAG,EAAEC,UAAU;IAAEY,IAAI,EAAET,OAAO,GAAG,OAAO,GAAGU;KACzER,OAAO,CACL,CACA,CACd,CACG;AAEhB,CAAC;;;;"}
@@ -12,9 +12,9 @@ const PrimaryNavigation = /*#__PURE__*/React__default.forwardRef(function Primar
12
12
  } = useLocalization();
13
13
  const internalRef = useMergedRef(ref);
14
14
  const className = cn('flex h-full w-full flex-grow items-center overflow-hidden active:outline-none relative', props.className);
15
- const moreButton = /*#__PURE__*/React__default.createElement(Button, {
15
+ const moreButton = () => ( /*#__PURE__*/React__default.createElement(Button, {
16
16
  className: cn(getLinkClasses(), '!bg-transparent aria-expanded:!bg-white/[.08]')
17
- }, texts.header.more);
17
+ }, texts.header.more));
18
18
  return /*#__PURE__*/React__default.createElement("nav", Object.assign({}, props, {
19
19
  className: className,
20
20
  ref: internalRef
@@ -1 +1 @@
1
- {"version":3,"file":"PrimaryNavigation.js","sources":["../../../../../../../../src/components/Header/components/PrimaryNavigation.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { getLinkClasses } from './Link';\nimport { useLocalization } from '../../Provider/Localization';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { Button } from '../../Button/Button';\nimport { OverflowGroup } from '../../OverflowGroup/OverflowGroup';\n\nexport type PrimaryNavigationProps = React.HTMLAttributes<HTMLElement>;\n\nexport const PrimaryNavigation = React.forwardRef<HTMLElement, PrimaryNavigationProps>(function PrimaryNavigation(props, ref) {\n const { texts } = useLocalization();\n const internalRef = useMergedRef<HTMLDivElement>(ref);\n\n const className = cn(\n 'flex h-full w-full flex-grow items-center overflow-hidden active:outline-none relative',\n props.className\n );\n\n const moreButton = (\n <Button className={cn(getLinkClasses(), '!bg-transparent aria-expanded:!bg-white/[.08]')}>{texts.header.more}</Button>\n );\n return (\n <nav {...props} className={className} ref={internalRef}>\n <OverflowGroup className=\"h-full flex-grow items-center gap-1 px-1\" moreButton={moreButton}>\n {props.children}\n </OverflowGroup>\n </nav>\n );\n});\n"],"names":["PrimaryNavigation","React","forwardRef","props","ref","texts","useLocalization","internalRef","useMergedRef","className","cn","moreButton","Button","getLinkClasses","header","more","OverflowGroup","children"],"mappings":";;;;;;;;MAUaA,iBAAiB,gBAAGC,cAAK,CAACC,UAAU,CAAsC,SAASF,iBAAiBA,CAACG,KAAK,EAAEC,GAAG;EACxH,MAAM;IAAEC;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,WAAW,GAAGC,YAAY,CAAiBJ,GAAG,CAAC;EAErD,MAAMK,SAAS,GAAGC,EAAE,CAChB,wFAAwF,EACxFP,KAAK,CAACM,SAAS,CAClB;EAED,MAAME,UAAU,gBACZV,6BAACW,MAAM;IAACH,SAAS,EAAEC,EAAE,CAACG,cAAc,EAAE,EAAE,+CAA+C;KAAIR,KAAK,CAACS,MAAM,CAACC,IAAI,CAC/G;EACD,oBACId,sDAASE,KAAK;IAAEM,SAAS,EAAEA,SAAS;IAAEL,GAAG,EAAEG;mBACvCN,6BAACe,aAAa;IAACP,SAAS,EAAC,0CAA0C;IAACE,UAAU,EAAEA;KAC3ER,KAAK,CAACc,QAAQ,CACH,CACd;AAEd,CAAC;;;;"}
1
+ {"version":3,"file":"PrimaryNavigation.js","sources":["../../../../../../../../src/components/Header/components/PrimaryNavigation.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { getLinkClasses } from './Link';\nimport { useLocalization } from '../../Provider/Localization';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { Button } from '../../Button/Button';\nimport { OverflowGroup } from '../../OverflowGroup/OverflowGroup';\n\nexport type PrimaryNavigationProps = React.HTMLAttributes<HTMLElement>;\n\nexport const PrimaryNavigation = React.forwardRef<HTMLElement, PrimaryNavigationProps>(function PrimaryNavigation(props, ref) {\n const { texts } = useLocalization();\n const internalRef = useMergedRef<HTMLDivElement>(ref);\n\n const className = cn(\n 'flex h-full w-full flex-grow items-center overflow-hidden active:outline-none relative',\n props.className\n );\n\n const moreButton = () => (\n <Button className={cn(getLinkClasses(), '!bg-transparent aria-expanded:!bg-white/[.08]')}>{texts.header.more}</Button>\n );\n return (\n <nav {...props} className={className} ref={internalRef}>\n <OverflowGroup className=\"h-full flex-grow items-center gap-1 px-1\" moreButton={moreButton}>\n {props.children}\n </OverflowGroup>\n </nav>\n );\n});\n"],"names":["PrimaryNavigation","React","forwardRef","props","ref","texts","useLocalization","internalRef","useMergedRef","className","cn","moreButton","Button","getLinkClasses","header","more","OverflowGroup","children"],"mappings":";;;;;;;;MAUaA,iBAAiB,gBAAGC,cAAK,CAACC,UAAU,CAAsC,SAASF,iBAAiBA,CAACG,KAAK,EAAEC,GAAG;EACxH,MAAM;IAAEC;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,WAAW,GAAGC,YAAY,CAAiBJ,GAAG,CAAC;EAErD,MAAMK,SAAS,GAAGC,EAAE,CAChB,wFAAwF,EACxFP,KAAK,CAACM,SAAS,CAClB;EAED,MAAME,UAAU,GAAGA,qBACfV,6BAACW,MAAM;IAACH,SAAS,EAAEC,EAAE,CAACG,cAAc,EAAE,EAAE,+CAA+C;KAAIR,KAAK,CAACS,MAAM,CAACC,IAAI,CAAU,CACzH;EACD,oBACId,sDAASE,KAAK;IAAEM,SAAS,EAAEA,SAAS;IAAEL,GAAG,EAAEG;mBACvCN,6BAACe,aAAa;IAACP,SAAS,EAAC,0CAA0C;IAACE,UAAU,EAAEA;KAC3ER,KAAK,CAACc,QAAQ,CACH,CACd;AAEd,CAAC;;;;"}
@@ -2,6 +2,7 @@ import React__default from 'react';
2
2
  import cn from 'clsx';
3
3
  import { useMergedRef } from '../../hooks/useMergedRef.js';
4
4
  import { IconButton } from '../IconButton/IconButton.js';
5
+ import { useLocalization } from '../Provider/Localization.js';
5
6
  import { Menu } from '../Menu/Menu.js';
6
7
  import { useIntersectionObserver } from '../../hooks/useIntersectionObserver.js';
7
8
 
@@ -36,8 +37,9 @@ const sanitizeButtonPropsForMenuItem = (button, index) => {
36
37
  };
37
38
  const DEFAULT_OFFSET = 32 + 8;
38
39
  const OverflowGroup = /*#__PURE__*/React__default.forwardRef(function OverflowGroup(props, ref) {
40
+ var _moreButton;
39
41
  const {
40
- moreButton: MoreButton,
42
+ moreButton,
41
43
  ...attributes
42
44
  } = props;
43
45
  const internalRef = useMergedRef(ref);
@@ -47,12 +49,17 @@ const OverflowGroup = /*#__PURE__*/React__default.forwardRef(function OverflowGr
47
49
  var _el$getBoundingClient;
48
50
  return setButtonWidth(el === null || el === void 0 ? void 0 : (_el$getBoundingClient = el.getBoundingClientRect()) === null || _el$getBoundingClient === void 0 ? void 0 : _el$getBoundingClient.width);
49
51
  }, []);
50
- const button = MoreButton !== null && MoreButton !== void 0 ? MoreButton : /*#__PURE__*/React__default.createElement(IconButton, {
51
- icon: "more"
52
- });
52
+ const {
53
+ texts
54
+ } = useLocalization();
53
55
  const intersectedChildIndex = useIntersectionObserver(internalRef, buttonWidth);
54
56
  const children = React__default.Children.toArray(props.children);
55
57
  const hiddenChildren = intersectedChildIndex !== undefined ? children.slice(intersectedChildIndex) : [];
58
+ const hiddenChildrenCount = hiddenChildren.length;
59
+ const moreButtonText = hiddenChildrenCount ? `${hiddenChildrenCount} ${texts.header.more}` : '';
60
+ const MoreButton = (_moreButton = moreButton === null || moreButton === void 0 ? void 0 : moreButton(moreButtonText)) !== null && _moreButton !== void 0 ? _moreButton : /*#__PURE__*/React__default.createElement(IconButton, {
61
+ icon: "more"
62
+ });
56
63
  const className = cn('flex overflow-hidden', props.className);
57
64
  return /*#__PURE__*/React__default.createElement("div", Object.assign({}, attributes, {
58
65
  className: className,
@@ -63,8 +70,8 @@ const OverflowGroup = /*#__PURE__*/React__default.forwardRef(function OverflowGr
63
70
  visible: intersectedChildIndex === undefined || index < intersectedChildIndex,
64
71
  'invisible order-[100] pointer-events-none': intersectedChildIndex !== undefined && index >= intersectedChildIndex
65
72
  })
66
- })), hiddenChildren.length ? /*#__PURE__*/React__default.cloneElement(button, {
67
- className: cn('sticky right-0 order-[99]', button.props.className),
73
+ })), hiddenChildren.length ? /*#__PURE__*/React__default.cloneElement(MoreButton, {
74
+ className: cn('sticky right-0 order-[99]', MoreButton.props.className),
68
75
  'data-observer-ignore': true,
69
76
  menu: menuProps => ( /*#__PURE__*/React__default.createElement(Menu, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu.Content, null, hiddenChildren.map(sanitizeButtonPropsForMenuItem)))),
70
77
  ref: buttonRefCallback
@@ -1 +1 @@
1
- {"version":3,"file":"OverflowGroup.js","sources":["../../../../../../../src/components/OverflowGroup/OverflowGroup.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { ButtonProps } from '../Button/Button';\nimport { Menu } from '../Menu/Menu';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport { IconButton } from '../IconButton/IconButton';\n\nconst sanitizeButtonPropsForMenuItem = (button: any, index) => {\n const href: string | undefined = button.props.to || button.props.href;\n const Tag = href ? Menu.Link : Menu.Item;\n\n // Removing className prop so that custom styling cannot be applied on Menu.Link\n const {\n as,\n className: _,\n appearance: _1,\n drawer: _2,\n fluid: _3,\n hanger: _4,\n menu: _5,\n popover: _6,\n tooltip: _7,\n ...attributes\n } = button.props;\n\n const props = {\n ...attributes,\n key: index,\n target: href ? (href.startsWith('http') ? '_blank' : '_self') : undefined,\n };\n\n if (as) {\n return React.cloneElement(button, { as: Tag, ...props });\n }\n\n return <Tag {...props} />;\n};\n\ntype OverflowGroupProps = React.HTMLAttributes<HTMLElement> & {\n moreButton?: React.ReactElement<ButtonProps>;\n};\n\nconst DEFAULT_OFFSET = 32 + 8;\n\nexport const OverflowGroup = React.forwardRef(function OverflowGroup(props: OverflowGroupProps, ref: React.Ref<HTMLDivElement>) {\n const { moreButton: MoreButton, ...attributes } = props;\n const internalRef = useMergedRef<HTMLDivElement>(ref);\n // determine width of more button, to add intersection observer margin\n const [buttonWidth, setButtonWidth] = React.useState(DEFAULT_OFFSET);\n const buttonRefCallback = React.useCallback((el: HTMLElement) => setButtonWidth(el?.getBoundingClientRect()?.width), []);\n const button = MoreButton ?? <IconButton icon=\"more\" />;\n\n const intersectedChildIndex = useIntersectionObserver(internalRef, buttonWidth);\n const children = React.Children.toArray(props.children) as React.ReactElement<ButtonProps>[];\n const hiddenChildren = intersectedChildIndex !== undefined ? children.slice(intersectedChildIndex) : [];\n\n const className = cn('flex overflow-hidden', props.className);\n\n return (\n <div {...attributes} className={className} data-taco=\"overflow-group\" ref={internalRef}>\n {children.map((child, index) =>\n React.cloneElement(child, {\n className: cn(child.props.className, {\n visible: intersectedChildIndex === undefined || index < intersectedChildIndex,\n 'invisible order-[100] pointer-events-none':\n intersectedChildIndex !== undefined && index >= intersectedChildIndex,\n }),\n })\n )}\n {hiddenChildren.length\n ? React.cloneElement(button, {\n className: cn('sticky right-0 order-[99]', button.props.className),\n 'data-observer-ignore': true,\n menu: menuProps => (\n <Menu {...menuProps}>\n <Menu.Content>{hiddenChildren.map(sanitizeButtonPropsForMenuItem)}</Menu.Content>\n </Menu>\n ),\n ref: buttonRefCallback,\n })\n : null}\n </div>\n );\n});\n"],"names":["sanitizeButtonPropsForMenuItem","button","index","href","props","to","Tag","Menu","Link","Item","as","className","_","appearance","_1","drawer","_2","fluid","_3","hanger","_4","menu","_5","popover","_6","tooltip","_7","attributes","key","target","startsWith","undefined","React","cloneElement","DEFAULT_OFFSET","OverflowGroup","forwardRef","ref","moreButton","MoreButton","internalRef","useMergedRef","buttonWidth","setButtonWidth","useState","buttonRefCallback","useCallback","el","_el$getBoundingClient","getBoundingClientRect","width","IconButton","icon","intersectedChildIndex","useIntersectionObserver","children","Children","toArray","hiddenChildren","slice","cn","map","child","visible","length","menuProps","Content"],"mappings":"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"}
1
+ {"version":3,"file":"OverflowGroup.js","sources":["../../../../../../../src/components/OverflowGroup/OverflowGroup.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { ButtonProps } from '../Button/Button';\nimport { Menu } from '../Menu/Menu';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport { IconButton } from '../IconButton/IconButton';\nimport { useLocalization } from '../Provider/Localization';\n\nconst sanitizeButtonPropsForMenuItem = (button: any, index) => {\n const href: string | undefined = button.props.to || button.props.href;\n const Tag = href ? Menu.Link : Menu.Item;\n\n // Removing className prop so that custom styling cannot be applied on Menu.Link\n const {\n as,\n className: _,\n appearance: _1,\n drawer: _2,\n fluid: _3,\n hanger: _4,\n menu: _5,\n popover: _6,\n tooltip: _7,\n ...attributes\n } = button.props;\n\n const props = {\n ...attributes,\n key: index,\n target: href ? (href.startsWith('http') ? '_blank' : '_self') : undefined,\n };\n\n if (as) {\n return React.cloneElement(button, { as: Tag, ...props });\n }\n\n return <Tag {...props} />;\n};\n\ntype OverflowGroupProps = React.HTMLAttributes<HTMLElement> & {\n moreButton?: (moreButtonText: string) => React.ReactElement<ButtonProps>;\n};\n\nconst DEFAULT_OFFSET = 32 + 8;\n\nexport const OverflowGroup = React.forwardRef(function OverflowGroup(props: OverflowGroupProps, ref: React.Ref<HTMLDivElement>) {\n const { moreButton, ...attributes } = props;\n const internalRef = useMergedRef<HTMLDivElement>(ref);\n // determine width of more button, to add intersection observer margin\n const [buttonWidth, setButtonWidth] = React.useState(DEFAULT_OFFSET);\n const buttonRefCallback = React.useCallback((el: HTMLElement) => setButtonWidth(el?.getBoundingClientRect()?.width), []);\n const { texts } = useLocalization();\n\n const intersectedChildIndex = useIntersectionObserver(internalRef, buttonWidth);\n const children = React.Children.toArray(props.children) as React.ReactElement<ButtonProps>[];\n const hiddenChildren = intersectedChildIndex !== undefined ? children.slice(intersectedChildIndex) : [];\n const hiddenChildrenCount = hiddenChildren.length;\n const moreButtonText = hiddenChildrenCount ? `${hiddenChildrenCount} ${texts.header.more}` : '';\n\n const MoreButton = moreButton?.(moreButtonText) ?? <IconButton icon=\"more\" />;\n\n const className = cn('flex overflow-hidden', props.className);\n\n return (\n <div {...attributes} className={className} data-taco=\"overflow-group\" ref={internalRef}>\n {children.map((child, index) =>\n React.cloneElement(child, {\n className: cn(child.props.className, {\n visible: intersectedChildIndex === undefined || index < intersectedChildIndex,\n 'invisible order-[100] pointer-events-none':\n intersectedChildIndex !== undefined && index >= intersectedChildIndex,\n }),\n })\n )}\n {hiddenChildren.length\n ? React.cloneElement(MoreButton, {\n className: cn('sticky right-0 order-[99]', MoreButton.props.className),\n 'data-observer-ignore': true,\n menu: menuProps => (\n <Menu {...menuProps}>\n <Menu.Content>{hiddenChildren.map(sanitizeButtonPropsForMenuItem)}</Menu.Content>\n </Menu>\n ),\n ref: buttonRefCallback,\n })\n : null}\n </div>\n );\n});\n"],"names":["sanitizeButtonPropsForMenuItem","button","index","href","props","to","Tag","Menu","Link","Item","as","className","_","appearance","_1","drawer","_2","fluid","_3","hanger","_4","menu","_5","popover","_6","tooltip","_7","attributes","key","target","startsWith","undefined","React","cloneElement","DEFAULT_OFFSET","OverflowGroup","forwardRef","ref","moreButton","internalRef","useMergedRef","buttonWidth","setButtonWidth","useState","buttonRefCallback","useCallback","el","_el$getBoundingClient","getBoundingClientRect","width","texts","useLocalization","intersectedChildIndex","useIntersectionObserver","children","Children","toArray","hiddenChildren","slice","hiddenChildrenCount","length","moreButtonText","header","more","MoreButton","_moreButton","IconButton","icon","cn","map","child","visible","menuProps","Content"],"mappings":"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"}
@@ -11,6 +11,7 @@ import { Toolbar } from './components/Toolbar/Toolbar.js';
11
11
  import { useStylesheet } from './styles/useStylesheet.js';
12
12
  import { useTableRenderer } from './util/useTableRenderer.js';
13
13
  import { useTableGlobalShortcuts } from './util/useTableGlobalShortcuts.js';
14
+ import { EmptyStateBody } from './components/Body/EmptyStateBody.js';
14
15
 
15
16
  function Column(_) {
16
17
  return null;
@@ -19,11 +20,11 @@ function Group(_) {
19
20
  return null;
20
21
  }
21
22
  const Report = /*#__PURE__*/fixedForwardRef(function Report(props, ref) {
22
- var _report$state$groupin;
23
+ var _report$state$groupin, _renderer$rows;
23
24
  const tableRef = useMergedRef(ref);
24
25
  const report = useReport(props, tableRef);
25
26
  const renderer = useTableRenderer(report.instance, tableRef, props.defaultRowActiveIndex);
26
- const stylesheet = useStylesheet(props.id, report.instance);
27
+ const stylesheet = useStylesheet(report.id, report.instance);
27
28
  useTableGlobalShortcuts(report.instance, tableRef, renderer.scrollToIndex);
28
29
  const handleFocus = report.meta.rowActive.rowActiveIndex === undefined ? event => {
29
30
  report.meta.rowActive.handleFocus(event, report.length, renderer.scrollToIndex);
@@ -35,12 +36,12 @@ const Report = /*#__PURE__*/fixedForwardRef(function Report(props, ref) {
35
36
  right: props.toolbarRight,
36
37
  scrollToIndex: renderer.scrollToIndex,
37
38
  table: report.instance,
38
- tableId: props.id,
39
+ tableId: report.id,
39
40
  tableRef: tableRef
40
41
  }), props.toolbarPanel ? /*#__PURE__*/React__default.createElement("div", {
41
42
  className: "mb-4"
42
43
  }, props.toolbarPanel) : undefined, /*#__PURE__*/React__default.createElement(FocusScope, null, /*#__PURE__*/React__default.createElement("table", {
43
- id: props.id,
44
+ id: report.id,
44
45
  "data-taco": "report",
45
46
  "data-table-font-size": report.meta.fontSize.size,
46
47
  "data-table-horizontally-scrolled": report.meta.columnFreezing.isHorizontallyScrolled ? true : undefined,
@@ -54,11 +55,13 @@ const Report = /*#__PURE__*/fixedForwardRef(function Report(props, ref) {
54
55
  tabIndex: -1
55
56
  }, /*#__PURE__*/React__default.createElement("thead", null, report.instance.getHeaderGroups().map(headerGroup => ( /*#__PURE__*/React__default.createElement("tr", {
56
57
  key: headerGroup.id
57
- }, headerGroup.headers.map(Header))))), /*#__PURE__*/React__default.createElement(Body, {
58
+ }, headerGroup.headers.map(Header))))), (_renderer$rows = renderer.rows) !== null && _renderer$rows !== void 0 && _renderer$rows.length ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Body, {
58
59
  length: report.length,
59
60
  table: report.instance,
60
61
  style: renderer.style
61
- }, renderer.rows), report.meta.footer.isEnabled ? ( /*#__PURE__*/React__default.createElement("tfoot", null, /*#__PURE__*/React__default.createElement("tr", null, report.instance.getFooterGroups()[0].headers.map(Footer)))) : null), report.meta.footer.isEnabled ? /*#__PURE__*/React__default.createElement(Summary, {
62
+ }, renderer.rows), report.meta.footer.isEnabled ? ( /*#__PURE__*/React__default.createElement("tfoot", null, /*#__PURE__*/React__default.createElement("tr", null, report.instance.getFooterGroups()[0].headers.map(Footer)))) : null)) : ( /*#__PURE__*/React__default.createElement(EmptyStateBody, {
63
+ emptyState: props.emptyState
64
+ }))), report.meta.footer.isEnabled ? /*#__PURE__*/React__default.createElement(Summary, {
62
65
  length: report.length,
63
66
  table: report.instance
64
67
  }) : null));