carbon-react 119.4.0 → 119.4.2

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 (141) hide show
  1. package/esm/__spec_helper__/mock-resize-observer.js +20 -5
  2. package/esm/__spec_helper__/test-utils.d.ts +1 -1
  3. package/esm/components/flat-table/cell-sizes.style.d.ts +28 -0
  4. package/esm/components/flat-table/flat-table-body/flat-table-body.component.d.ts +7 -0
  5. package/esm/components/flat-table/flat-table-body/flat-table-body.component.js +3 -2
  6. package/esm/components/flat-table/flat-table-body/index.d.ts +2 -2
  7. package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.d.ts +9 -0
  8. package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.js +6 -16
  9. package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.d.ts +4 -0
  10. package/esm/components/flat-table/flat-table-body-draggable/index.d.ts +2 -2
  11. package/esm/components/flat-table/flat-table-cell/flat-table-cell.component.d.ts +69 -0
  12. package/esm/components/flat-table/flat-table-cell/flat-table-cell.component.js +7 -69
  13. package/esm/components/flat-table/flat-table-cell/flat-table-cell.style.d.ts +10 -0
  14. package/esm/components/flat-table/flat-table-cell/index.d.ts +2 -2
  15. package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.d.ts +45 -0
  16. package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.js +1 -39
  17. package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.d.ts +6 -0
  18. package/esm/components/flat-table/flat-table-checkbox/index.d.ts +2 -2
  19. package/esm/components/flat-table/flat-table-head/flat-table-head.component.d.ts +7 -0
  20. package/esm/components/flat-table/flat-table-head/flat-table-head.component.js +8 -13
  21. package/esm/components/flat-table/flat-table-head/flat-table-head.style.d.ts +2 -0
  22. package/esm/components/flat-table/flat-table-head/index.d.ts +2 -2
  23. package/esm/components/flat-table/flat-table-header/flat-table-header-utils.d.ts +3 -0
  24. package/esm/components/flat-table/flat-table-header/flat-table-header.component.d.ts +55 -0
  25. package/esm/components/flat-table/flat-table-header/flat-table-header.component.js +7 -49
  26. package/esm/components/flat-table/flat-table-header/flat-table-header.style.d.ts +10 -0
  27. package/esm/components/flat-table/flat-table-header/index.d.ts +2 -2
  28. package/esm/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.component.d.ts +18 -0
  29. package/esm/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.component.js +13 -19
  30. package/esm/components/flat-table/flat-table-row/flat-table-row.component.d.ts +56 -0
  31. package/esm/components/flat-table/flat-table-row/flat-table-row.component.js +43 -67
  32. package/esm/components/flat-table/flat-table-row/flat-table-row.style.d.ts +18 -0
  33. package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +2 -3
  34. package/esm/components/flat-table/flat-table-row/index.d.ts +2 -2
  35. package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.component.d.ts +71 -0
  36. package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.component.js +9 -51
  37. package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.style.d.ts +6 -0
  38. package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +7 -7
  39. package/esm/components/flat-table/flat-table-row-header/index.d.ts +2 -2
  40. package/esm/components/flat-table/flat-table.component.d.ts +42 -0
  41. package/esm/components/flat-table/flat-table.component.js +51 -92
  42. package/esm/components/flat-table/flat-table.config.d.ts +2 -0
  43. package/esm/components/flat-table/flat-table.style.d.ts +15 -0
  44. package/esm/components/flat-table/flat-table.style.js +36 -59
  45. package/esm/components/flat-table/index.d.ts +22 -13
  46. package/esm/components/flat-table/sort/index.d.ts +2 -2
  47. package/esm/components/flat-table/sort/sort.component.d.ts +11 -0
  48. package/esm/components/flat-table/sort/sort.component.js +1 -10
  49. package/esm/components/flat-table/sort/sort.style.d.ts +4 -0
  50. package/esm/components/global-header/global-header.component.js +6 -29
  51. package/esm/components/menu/__internal__/submenu/submenu.component.js +6 -1
  52. package/esm/components/menu/__internal__/submenu/submenu.style.d.ts +1 -0
  53. package/esm/components/menu/__internal__/submenu/submenu.style.js +4 -1
  54. package/esm/components/navigation-bar/fixed-navigation-bar.context.d.ts +11 -0
  55. package/esm/components/navigation-bar/fixed-navigation-bar.context.js +31 -0
  56. package/esm/components/navigation-bar/navigation-bar.component.d.ts +3 -1
  57. package/esm/components/navigation-bar/navigation-bar.component.js +20 -8
  58. package/esm/components/navigation-bar/navigation-bar.style.d.ts +4 -0
  59. package/esm/components/navigation-bar/navigation-bar.style.js +3 -2
  60. package/lib/__spec_helper__/mock-resize-observer.js +20 -5
  61. package/lib/__spec_helper__/test-utils.d.ts +1 -1
  62. package/lib/components/flat-table/cell-sizes.style.d.ts +28 -0
  63. package/lib/components/flat-table/flat-table-body/flat-table-body.component.d.ts +7 -0
  64. package/lib/components/flat-table/flat-table-body/flat-table-body.component.js +4 -3
  65. package/lib/components/flat-table/flat-table-body/index.d.ts +2 -2
  66. package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.d.ts +9 -0
  67. package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.js +7 -16
  68. package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.d.ts +4 -0
  69. package/lib/components/flat-table/flat-table-body-draggable/index.d.ts +2 -2
  70. package/lib/components/flat-table/flat-table-cell/flat-table-cell.component.d.ts +69 -0
  71. package/lib/components/flat-table/flat-table-cell/flat-table-cell.component.js +8 -69
  72. package/lib/components/flat-table/flat-table-cell/flat-table-cell.style.d.ts +10 -0
  73. package/lib/components/flat-table/flat-table-cell/index.d.ts +2 -2
  74. package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.d.ts +45 -0
  75. package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.js +2 -39
  76. package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.d.ts +6 -0
  77. package/lib/components/flat-table/flat-table-checkbox/index.d.ts +2 -2
  78. package/lib/components/flat-table/flat-table-head/flat-table-head.component.d.ts +7 -0
  79. package/lib/components/flat-table/flat-table-head/flat-table-head.component.js +8 -12
  80. package/lib/components/flat-table/flat-table-head/flat-table-head.style.d.ts +2 -0
  81. package/lib/components/flat-table/flat-table-head/index.d.ts +2 -2
  82. package/lib/components/flat-table/flat-table-header/flat-table-header-utils.d.ts +3 -0
  83. package/lib/components/flat-table/flat-table-header/flat-table-header.component.d.ts +55 -0
  84. package/lib/components/flat-table/flat-table-header/flat-table-header.component.js +8 -49
  85. package/lib/components/flat-table/flat-table-header/flat-table-header.style.d.ts +10 -0
  86. package/lib/components/flat-table/flat-table-header/index.d.ts +2 -2
  87. package/lib/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.component.d.ts +18 -0
  88. package/lib/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.component.js +14 -20
  89. package/lib/components/flat-table/flat-table-row/flat-table-row.component.d.ts +56 -0
  90. package/lib/components/flat-table/flat-table-row/flat-table-row.component.js +44 -68
  91. package/lib/components/flat-table/flat-table-row/flat-table-row.style.d.ts +18 -0
  92. package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +2 -3
  93. package/lib/components/flat-table/flat-table-row/index.d.ts +2 -2
  94. package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.component.d.ts +71 -0
  95. package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.component.js +10 -51
  96. package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.style.d.ts +6 -0
  97. package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +7 -7
  98. package/lib/components/flat-table/flat-table-row-header/index.d.ts +2 -2
  99. package/lib/components/flat-table/flat-table.component.d.ts +42 -0
  100. package/lib/components/flat-table/flat-table.component.js +51 -91
  101. package/lib/components/flat-table/flat-table.config.d.ts +2 -0
  102. package/lib/components/flat-table/flat-table.style.d.ts +15 -0
  103. package/lib/components/flat-table/flat-table.style.js +36 -59
  104. package/lib/components/flat-table/index.d.ts +22 -13
  105. package/lib/components/flat-table/sort/index.d.ts +2 -2
  106. package/lib/components/flat-table/sort/sort.component.d.ts +11 -0
  107. package/lib/components/flat-table/sort/sort.component.js +1 -10
  108. package/lib/components/flat-table/sort/sort.style.d.ts +4 -0
  109. package/lib/components/global-header/global-header.component.js +6 -31
  110. package/lib/components/menu/__internal__/submenu/submenu.component.js +6 -1
  111. package/lib/components/menu/__internal__/submenu/submenu.style.d.ts +1 -0
  112. package/lib/components/menu/__internal__/submenu/submenu.style.js +4 -1
  113. package/lib/components/navigation-bar/fixed-navigation-bar.context.d.ts +11 -0
  114. package/lib/components/navigation-bar/fixed-navigation-bar.context.js +42 -0
  115. package/lib/components/navigation-bar/navigation-bar.component.d.ts +3 -1
  116. package/lib/components/navigation-bar/navigation-bar.component.js +22 -8
  117. package/lib/components/navigation-bar/navigation-bar.style.d.ts +4 -0
  118. package/lib/components/navigation-bar/navigation-bar.style.js +3 -2
  119. package/package.json +1 -1
  120. package/esm/components/flat-table/flat-table-body/flat-table-body.d.ts +0 -10
  121. package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.d.ts +0 -14
  122. package/esm/components/flat-table/flat-table-cell/flat-table-cell.d.ts +0 -28
  123. package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.d.ts +0 -20
  124. package/esm/components/flat-table/flat-table-head/flat-table-head.d.ts +0 -10
  125. package/esm/components/flat-table/flat-table-header/flat-table-header.d.ts +0 -27
  126. package/esm/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.d.ts +0 -20
  127. package/esm/components/flat-table/flat-table-row/flat-table-row.d.ts +0 -31
  128. package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.d.ts +0 -28
  129. package/esm/components/flat-table/flat-table.d.ts +0 -37
  130. package/esm/components/flat-table/sort/sort.d.ts +0 -14
  131. package/lib/components/flat-table/flat-table-body/flat-table-body.d.ts +0 -10
  132. package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.d.ts +0 -14
  133. package/lib/components/flat-table/flat-table-cell/flat-table-cell.d.ts +0 -28
  134. package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.d.ts +0 -20
  135. package/lib/components/flat-table/flat-table-head/flat-table-head.d.ts +0 -10
  136. package/lib/components/flat-table/flat-table-header/flat-table-header.d.ts +0 -27
  137. package/lib/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.d.ts +0 -20
  138. package/lib/components/flat-table/flat-table-row/flat-table-row.d.ts +0 -31
  139. package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.d.ts +0 -28
  140. package/lib/components/flat-table/flat-table.d.ts +0 -37
  141. package/lib/components/flat-table/sort/sort.d.ts +0 -14
@@ -1,28 +0,0 @@
1
- import * as React from "react";
2
- import { PaddingProps } from "styled-system";
3
- import { TableBorderSize } from "..";
4
-
5
- export interface FlatTableCellProps extends PaddingProps {
6
- /** Content alignment */
7
- align?: "left" | "center" | "right";
8
- /** Cell content */
9
- children?: React.ReactNode | string;
10
- /** Number of columns that a cell should span */
11
- colspan?: number | string;
12
- /** Number of rows that a cell should span */
13
- rowspan?: number | string;
14
- /** Column width, pass a number to set a fixed width in pixels */
15
- width?: number;
16
- /** Truncate cell content and add ellipsis to any text that overflows */
17
- truncate?: boolean;
18
- /** Title text to display if cell content truncates */
19
- title?: string;
20
- /** Sets a custom vertical right border */
21
- verticalBorder?: TableBorderSize;
22
- /** Sets the color of the right border */
23
- verticalBorderColor?: string;
24
- }
25
-
26
- declare function FlatTableCell(props: FlatTableCellProps): JSX.Element;
27
-
28
- export default FlatTableCell;
@@ -1,20 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface FlatTableCheckboxProps {
4
- /** Prop to polymorphically render either a 'th' or 'td' element */
5
- as?: "td" | "th";
6
- /** Prop to set checked prop on Checkbox */
7
- checked?: boolean;
8
- /** Callback to be called onChange in Checkbox */
9
- onChange?: (ev: React.ChangeEvent<HTMLElement>) => void;
10
- /** Whether to render the checkbox or not, defaults to true */
11
- selectable?: boolean;
12
- /** Callback function to be called when click event received */
13
- onClick?: (ev: React.MouseEvent<HTMLElement>) => void;
14
- /** The id of the element that labels the input */
15
- ariaLabelledBy?: string;
16
- }
17
-
18
- declare function FlatTableCheckbox(props: FlatTableCheckboxProps): JSX.Element;
19
-
20
- export default FlatTableCheckbox;
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface FlatTableHeadProps {
4
- /** Array of FlatTableRow. */
5
- children: React.ReactNode;
6
- }
7
-
8
- declare function FlatTableHead(props: FlatTableHeadProps): JSX.Element;
9
-
10
- export default FlatTableHead;
@@ -1,27 +0,0 @@
1
- import * as React from "react";
2
- import { PaddingProps } from "styled-system";
3
-
4
- import { TableBorderSize } from "..";
5
-
6
- export interface FlatTableHeaderProps extends PaddingProps {
7
- /** Content alignment */
8
- align?: "left" | "center" | "right";
9
- /** If true sets alternative background color */
10
- alternativeBgColor?: boolean;
11
- /** Header content */
12
- children?: React.ReactNode | string;
13
- /** Number of columns that a header cell should span */
14
- colspan?: number | string;
15
- /** Number of rows that a header cell should span */
16
- rowspan?: number | string;
17
- /** Sets a custom vertical right border */
18
- verticalBorder?: TableBorderSize;
19
- /** Sets the color of the right border */
20
- verticalBorderColor?: string;
21
- /** Column width, pass a number to set a fixed width in pixels */
22
- width?: number;
23
- }
24
-
25
- declare function FlatTableHeader(props: FlatTableHeaderProps): JSX.Element;
26
-
27
- export default FlatTableHeader;
@@ -1,20 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface FlatTableRowDraggableProps {
4
- /** Array of FlatTableRow. */
5
- children: React.ReactNode;
6
- /** ID for use in drag and drop functionality */
7
- id?: number | string;
8
- /** function to find an item in the list of draggable items */
9
- findItem: () => Record<string, unknown>;
10
- /** function to reposition an item in the list of draggable items */
11
- moveItem: () => void;
12
- /** item is draggable */
13
- draggable?: boolean;
14
- }
15
-
16
- declare function FlatTableRowDraggable(
17
- props: FlatTableRowDraggableProps
18
- ): JSX.Element;
19
-
20
- export default FlatTableRowDraggable;
@@ -1,31 +0,0 @@
1
- import * as React from "react";
2
- import { TableBorderSize } from "..";
3
-
4
- export interface FlatTableRowProps {
5
- /** Array of FlatTableHeader or FlatTableCell. FlatTableRowHeader could also be passed. */
6
- children: React.ReactNode;
7
- /** Allows the row to be expanded, must be used with the `subRows` prop. */
8
- expandable?: boolean;
9
- /** Sets an expandable row to be expanded on start */
10
- expanded?: boolean;
11
- /** Area to click to open sub rows when expandable. Default is `wholeRow` */
12
- expandableArea?: "wholeRow" | "firstColumn";
13
- /** Allows developers to manually control highlighted state for the row. */
14
- highlighted?: boolean;
15
- /** Sets the color of the bottom border in the row */
16
- horizontalBorderColor?: string;
17
- /** Sets the weight of the bottom border in the row */
18
- horizontalBorderSize?: TableBorderSize;
19
- /** Function to handle click event. If provided the Component could be focused with tab key. */
20
- onClick?: (ev: React.MouseEvent<HTMLElement>) => void;
21
- /** Allows developers to manually control selected state for the row. */
22
- selected?: boolean;
23
- /** Sub rows to be shown when the row is expanded, must be used with the `expandable` prop. */
24
- subRows?: React.ReactNodeArray;
25
- }
26
-
27
- declare function FlatTableRow(
28
- props: FlatTableRowProps & React.RefAttributes<HTMLHRElement>
29
- ): JSX.Element;
30
-
31
- export default FlatTableRow;
@@ -1,28 +0,0 @@
1
- import * as React from "react";
2
- import { PaddingProps } from "styled-system";
3
- import { TableBorderSize } from "..";
4
-
5
- export interface FlatTableRowHeaderProps extends PaddingProps {
6
- /** Content alignment */
7
- align?: string;
8
- /** RowHeader content */
9
- children?: React.ReactNode | string;
10
- /** Column width, pass a number to set a fixed width in pixels */
11
- width?: number;
12
- /** Truncate cell content and add ellipsis to any text that overflows */
13
- truncate?: boolean;
14
- /** Title text to display if cell content truncates */
15
- title?: string;
16
- /** Sets a custom vertical right border */
17
- verticalBorder?: TableBorderSize;
18
- /** Sets the color of the right border */
19
- verticalBorderColor?: string;
20
- /** Defines whether the column should be sticky on the left or right hand side of the Table */
21
- stickyAlignment?: "left" | "right";
22
- }
23
-
24
- declare function FlatTableRowHeader(
25
- props: FlatTableRowHeaderProps
26
- ): JSX.Element;
27
-
28
- export default FlatTableRowHeader;
@@ -1,37 +0,0 @@
1
- import * as React from "react";
2
- import { MarginProps } from "styled-system";
3
-
4
- export interface FlatTableProps extends MarginProps {
5
- /** The HTML id of the element that contains a description of this table. */
6
- ariaDescribedby?: string;
7
- /** A string to render as the table's caption */
8
- caption?: string;
9
- /** FlatTableHead and FlatTableBody */
10
- children: React.ReactNode;
11
- /** `FlatTable` color theme */
12
- colorTheme?: "light" | "transparent-base" | "transparent-white" | "dark";
13
- /** Content to be rendered at the foot of the table */
14
- footer?: React.ReactNode;
15
- /** If true, the header does not scroll with the content */
16
- hasStickyFooter?: boolean;
17
- /** If true, the header does not scroll with the content */
18
- hasStickyHead?: boolean;
19
- /** Set the height of the table. String can be any valid CSS string, numbers will be converted to pixels. */
20
- height?: string | number;
21
- /** Set the min-height of the table. String can be any valid CSS string, numbers will be converted to pixels. */
22
- minHeight?: string | number;
23
- /** Toggles the zebra striping for the table rows */
24
- isZebra?: boolean;
25
- /** Used to define the tables size Renders as: 'compact', 'small', 'medium', 'large' and 'extraLarge' */
26
- size?: "compact" | "small" | "medium" | "large" | "extraLarge";
27
- /** Applies max-height of 100% to FlatTable if true */
28
- hasMaxHeight?: boolean;
29
- /** Set the overflow X of the table wrapper. Any valid CSS string */
30
- overflowX?: string;
31
- /** Width of the table. Any valid CSS string */
32
- width?: string;
33
- }
34
-
35
- declare function FlatTable(props: FlatTableProps): JSX.Element;
36
-
37
- export default FlatTable;
@@ -1,14 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface SortProps {
4
- /** if `asc` it will show `sort_up` icon, if `desc` it will show `sort_down` */
5
- sortType?: "ascending" | "descending" | false;
6
- /** Callback fired when the `FlatTableSortHeader` is clicked */
7
- onClick?: () => void;
8
- /** Sets the content of `FlatTableSortHeader` */
9
- children?: React.ReactNode | string;
10
- }
11
-
12
- declare function Sort(props: SortProps): JSX.Element;
13
-
14
- export default Sort;