carbon-react 153.7.1 → 154.0.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.
- package/esm/__internal__/utils/{createStrictContext.js → createStrictContext/createStrictContext.js} +1 -1
- package/esm/__internal__/utils/createStrictContext/index.d.ts +1 -0
- package/esm/__internal__/utils/createStrictContext/index.js +1 -0
- package/esm/components/action-popover/__internal__/action-popover.context.d.ts +4 -3
- package/esm/components/action-popover/__internal__/action-popover.context.js +9 -3
- package/esm/components/action-popover/action-popover-item/action-popover-item.component.js +3 -5
- package/esm/components/action-popover/action-popover-menu/action-popover-menu.component.js +3 -5
- package/esm/components/action-popover/action-popover.component.js +2 -2
- package/esm/components/breadcrumbs/__internal__/breadcrumbs.context.d.ts +3 -3
- package/esm/components/breadcrumbs/__internal__/breadcrumbs.context.js +8 -4
- package/esm/components/breadcrumbs/breadcrumbs.component.js +2 -2
- package/esm/components/breadcrumbs/crumb/crumb.component.js +3 -3
- package/esm/components/button-toggle/button-toggle-group/__internal__/button-toggle-group.context.d.ts +5 -5
- package/esm/components/button-toggle/button-toggle-group/__internal__/button-toggle-group.context.js +14 -9
- package/esm/components/button-toggle/button-toggle-group/button-toggle-group.component.js +10 -4
- package/esm/components/button-toggle/button-toggle.component.d.ts +4 -1
- package/esm/components/button-toggle/button-toggle.component.js +17 -32
- package/esm/components/card/__internal__/card.context.d.ts +4 -4
- package/esm/components/card/__internal__/card.context.js +10 -4
- package/esm/components/card/card-column/card-column.component.d.ts +1 -1
- package/esm/components/card/card-footer/card-footer.component.d.ts +1 -1
- package/esm/components/card/card-footer/card-footer.component.js +3 -3
- package/esm/components/card/card-footer/card-footer.style.d.ts +2 -7
- package/esm/components/card/card-footer/card-footer.style.js +1 -1
- package/esm/components/card/card-row/card-row.component.d.ts +1 -1
- package/esm/components/card/card-row/card-row.component.js +3 -3
- package/esm/components/card/card.component.d.ts +1 -1
- package/esm/components/card/card.component.js +2 -2
- package/esm/components/definition-list/__internal__/dl.context.d.ts +4 -12
- package/esm/components/definition-list/__internal__/dl.context.js +11 -2
- package/esm/components/definition-list/dd/dd.component.js +3 -3
- package/esm/components/definition-list/dl.component.d.ts +8 -2
- package/esm/components/definition-list/dl.component.js +2 -2
- package/esm/components/definition-list/dt/dt.component.js +3 -3
- package/esm/components/flat-table/__internal__/flat-table.context.d.ts +6 -8
- package/esm/components/flat-table/__internal__/flat-table.context.js +6 -5
- package/esm/components/flat-table/__internal__/strict-flat-table.context.d.ts +7 -0
- package/esm/components/flat-table/__internal__/strict-flat-table.context.js +9 -0
- package/esm/components/flat-table/__internal__/use-table-cell.js +2 -2
- package/esm/components/flat-table/flat-table-header/flat-table-header.component.js +3 -3
- package/esm/components/flat-table/flat-table-row/flat-table-row.component.js +2 -2
- package/esm/components/flat-table/flat-table.component.js +7 -3
- package/esm/components/flat-table/sort/sort.component.js +3 -3
- package/esm/components/step-flow/__internal__/step-flow.context.d.ts +3 -3
- package/esm/components/step-flow/__internal__/step-flow.context.js +7 -3
- package/esm/components/step-flow/step-flow-title/step-flow-title.component.js +3 -3
- package/esm/components/step-flow/step-flow.component.js +2 -2
- package/esm/components/step-sequence/__internal__/step-sequence.context.d.ts +6 -0
- package/esm/components/step-sequence/__internal__/step-sequence.context.js +9 -0
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.component.js +3 -3
- package/esm/components/step-sequence/step-sequence.component.d.ts +0 -3
- package/esm/components/step-sequence/step-sequence.component.js +2 -4
- package/esm/components/text-editor/__internal__/helpers.js +1 -1
- package/esm/components/text-editor/__internal__/plugins/EditorRef/editor-ref.plugin.d.ts +5 -0
- package/esm/components/text-editor/__internal__/plugins/EditorRef/editor-ref.plugin.js +17 -0
- package/esm/components/text-editor/__internal__/plugins/EditorRef/index.d.ts +1 -0
- package/esm/components/text-editor/__internal__/plugins/EditorRef/index.js +1 -0
- package/esm/components/text-editor/__internal__/plugins/Toolbar/toolbar.component.js +0 -1
- package/esm/components/text-editor/text-editor.component.d.ts +5 -1
- package/esm/components/text-editor/text-editor.component.js +19 -11
- package/esm/components/tile/__internal__/tile.context.d.ts +4 -4
- package/esm/components/tile/__internal__/tile.context.js +10 -4
- package/esm/components/tile/tile-content/tile-content.component.js +3 -3
- package/esm/components/tile/tile.component.js +2 -2
- package/esm/components/vertical-menu/__internal__/vertical-menu.context.d.ts +6 -0
- package/esm/components/vertical-menu/__internal__/vertical-menu.context.js +9 -0
- package/esm/components/vertical-menu/vertical-menu-full-screen/vertical-menu-full-screen.component.js +2 -2
- package/esm/components/vertical-menu/vertical-menu-item/vertical-menu-item.component.js +2 -2
- package/esm/components/vertical-menu/vertical-menu.component.js +6 -1
- package/lib/__internal__/utils/{createStrictContext.js → createStrictContext/createStrictContext.js} +1 -1
- package/lib/__internal__/utils/createStrictContext/index.d.ts +1 -0
- package/lib/__internal__/utils/createStrictContext/index.js +13 -0
- package/lib/__internal__/utils/createStrictContext/package.json +6 -0
- package/lib/components/action-popover/__internal__/action-popover.context.d.ts +4 -3
- package/lib/components/action-popover/__internal__/action-popover.context.js +11 -4
- package/lib/components/action-popover/action-popover-item/action-popover-item.component.js +2 -4
- package/lib/components/action-popover/action-popover-menu/action-popover-menu.component.js +2 -4
- package/lib/components/action-popover/action-popover.component.js +2 -2
- package/lib/components/breadcrumbs/__internal__/breadcrumbs.context.d.ts +3 -3
- package/lib/components/breadcrumbs/__internal__/breadcrumbs.context.js +10 -5
- package/lib/components/breadcrumbs/breadcrumbs.component.js +2 -2
- package/lib/components/breadcrumbs/crumb/crumb.component.js +3 -5
- package/lib/components/button-toggle/button-toggle-group/__internal__/button-toggle-group.context.d.ts +5 -5
- package/lib/components/button-toggle/button-toggle-group/__internal__/button-toggle-group.context.js +16 -10
- package/lib/components/button-toggle/button-toggle-group/button-toggle-group.component.js +10 -4
- package/lib/components/button-toggle/button-toggle.component.d.ts +4 -1
- package/lib/components/button-toggle/button-toggle.component.js +17 -32
- package/lib/components/card/__internal__/card.context.d.ts +4 -4
- package/lib/components/card/__internal__/card.context.js +12 -5
- package/lib/components/card/card-column/card-column.component.d.ts +1 -1
- package/lib/components/card/card-footer/card-footer.component.d.ts +1 -1
- package/lib/components/card/card-footer/card-footer.component.js +3 -5
- package/lib/components/card/card-footer/card-footer.style.d.ts +2 -7
- package/lib/components/card/card-footer/card-footer.style.js +1 -1
- package/lib/components/card/card-row/card-row.component.d.ts +1 -1
- package/lib/components/card/card-row/card-row.component.js +2 -2
- package/lib/components/card/card.component.d.ts +1 -1
- package/lib/components/card/card.component.js +2 -2
- package/lib/components/definition-list/__internal__/dl.context.d.ts +4 -12
- package/lib/components/definition-list/__internal__/dl.context.js +13 -3
- package/lib/components/definition-list/dd/dd.component.js +3 -5
- package/lib/components/definition-list/dl.component.d.ts +8 -2
- package/lib/components/definition-list/dl.component.js +2 -2
- package/lib/components/definition-list/dt/dt.component.js +3 -5
- package/lib/components/flat-table/__internal__/flat-table.context.d.ts +6 -8
- package/lib/components/flat-table/__internal__/flat-table.context.js +6 -6
- package/lib/components/flat-table/__internal__/strict-flat-table.context.d.ts +7 -0
- package/lib/components/flat-table/__internal__/strict-flat-table.context.js +17 -0
- package/lib/components/flat-table/__internal__/use-table-cell.js +2 -2
- package/lib/components/flat-table/flat-table-header/flat-table-header.component.js +2 -2
- package/lib/components/flat-table/flat-table-row/flat-table-row.component.js +2 -2
- package/lib/components/flat-table/flat-table.component.js +7 -3
- package/lib/components/flat-table/sort/sort.component.js +2 -2
- package/lib/components/step-flow/__internal__/step-flow.context.d.ts +3 -3
- package/lib/components/step-flow/__internal__/step-flow.context.js +9 -4
- package/lib/components/step-flow/step-flow-title/step-flow-title.component.js +3 -5
- package/lib/components/step-flow/step-flow.component.js +2 -2
- package/lib/components/step-sequence/__internal__/step-sequence.context.d.ts +6 -0
- package/lib/components/step-sequence/__internal__/step-sequence.context.js +17 -0
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.js +3 -5
- package/lib/components/step-sequence/step-sequence.component.d.ts +0 -3
- package/lib/components/step-sequence/step-sequence.component.js +3 -5
- package/lib/components/text-editor/__internal__/helpers.js +1 -1
- package/lib/components/text-editor/__internal__/plugins/EditorRef/editor-ref.plugin.d.ts +5 -0
- package/lib/components/text-editor/__internal__/plugins/EditorRef/editor-ref.plugin.js +24 -0
- package/lib/components/text-editor/__internal__/plugins/EditorRef/index.d.ts +1 -0
- package/lib/components/text-editor/__internal__/plugins/EditorRef/index.js +13 -0
- package/lib/components/text-editor/__internal__/plugins/EditorRef/package.json +6 -0
- package/lib/components/text-editor/__internal__/plugins/Toolbar/toolbar.component.js +0 -1
- package/lib/components/text-editor/text-editor.component.d.ts +5 -1
- package/lib/components/text-editor/text-editor.component.js +19 -11
- package/lib/components/tile/__internal__/tile.context.d.ts +4 -4
- package/lib/components/tile/__internal__/tile.context.js +13 -5
- package/lib/components/tile/tile-content/tile-content.component.js +3 -5
- package/lib/components/tile/tile.component.js +2 -2
- package/lib/components/vertical-menu/__internal__/vertical-menu.context.d.ts +6 -0
- package/lib/components/vertical-menu/__internal__/vertical-menu.context.js +17 -0
- package/lib/components/vertical-menu/vertical-menu-full-screen/vertical-menu-full-screen.component.js +2 -2
- package/lib/components/vertical-menu/vertical-menu-item/vertical-menu-item.component.js +2 -2
- package/lib/components/vertical-menu/vertical-menu.component.js +6 -1
- package/package.json +1 -1
- package/esm/components/vertical-menu/vertical-menu-full-screen/__internal__/vertical-menu-full-screen.context.d.ts +0 -5
- package/esm/components/vertical-menu/vertical-menu-full-screen/__internal__/vertical-menu-full-screen.context.js +0 -5
- package/lib/components/vertical-menu/vertical-menu-full-screen/__internal__/vertical-menu-full-screen.context.d.ts +0 -5
- package/lib/components/vertical-menu/vertical-menu-full-screen/__internal__/vertical-menu-full-screen.context.js +0 -12
- /package/esm/__internal__/utils/{createStrictContext.d.ts → createStrictContext/createStrictContext.d.ts} +0 -0
- /package/lib/__internal__/utils/{createStrictContext.d.ts → createStrictContext/createStrictContext.d.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SpaceProps } from "styled-system";
|
|
3
|
-
import { DlContextProps } from "./__internal__/dl.context";
|
|
4
3
|
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
5
|
-
|
|
4
|
+
type ElementAlignment = "left" | "center" | "right";
|
|
5
|
+
export interface DlProps extends SpaceProps, TagProps {
|
|
6
6
|
/** HTML id attribute of the input */
|
|
7
7
|
id?: string;
|
|
8
8
|
/** prop to render children. */
|
|
@@ -11,6 +11,12 @@ export interface DlProps extends SpaceProps, DlContextProps, TagProps {
|
|
|
11
11
|
by the `StyledDdDiv`. This prop has no effect when `asSingleColumn` is set.
|
|
12
12
|
*/
|
|
13
13
|
w?: number;
|
|
14
|
+
/** Render the DefinitionList as a single column */
|
|
15
|
+
asSingleColumn?: boolean;
|
|
16
|
+
/** This string will specify the text align styling of the `<dt></dt>`. */
|
|
17
|
+
dtTextAlign?: ElementAlignment;
|
|
18
|
+
/** This string will specify the text align styling of the `<dd></dd>`. */
|
|
19
|
+
ddTextAlign?: ElementAlignment;
|
|
14
20
|
}
|
|
15
21
|
declare const Dl: {
|
|
16
22
|
({ children, w, dtTextAlign, ddTextAlign, asSingleColumn, ...rest }: DlProps): React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { StyledDl } from "./definition-list.style";
|
|
4
|
-
import
|
|
4
|
+
import { DlProvider } from "./__internal__/dl.context";
|
|
5
5
|
import tagComponent from "../../__internal__/utils/helpers/tags";
|
|
6
6
|
const Dl = ({
|
|
7
7
|
children,
|
|
@@ -14,7 +14,7 @@ const Dl = ({
|
|
|
14
14
|
return /*#__PURE__*/React.createElement(StyledDl, _extends({
|
|
15
15
|
w: w,
|
|
16
16
|
asSingleColumn: asSingleColumn
|
|
17
|
-
}, rest, tagComponent("dl", rest)), /*#__PURE__*/React.createElement(
|
|
17
|
+
}, rest, tagComponent("dl", rest)), /*#__PURE__*/React.createElement(DlProvider, {
|
|
18
18
|
value: {
|
|
19
19
|
asSingleColumn,
|
|
20
20
|
dtTextAlign,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { StyledDt } from "../definition-list.style";
|
|
4
|
-
import
|
|
4
|
+
import { useDlContext } from "../__internal__/dl.context";
|
|
5
5
|
import tagComponent from "../../../__internal__/utils/helpers/tags";
|
|
6
6
|
const Dt = ({
|
|
7
7
|
children,
|
|
@@ -10,7 +10,7 @@ const Dt = ({
|
|
|
10
10
|
const {
|
|
11
11
|
asSingleColumn,
|
|
12
12
|
dtTextAlign
|
|
13
|
-
} =
|
|
13
|
+
} = useDlContext();
|
|
14
14
|
const {
|
|
15
15
|
mb,
|
|
16
16
|
pr
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isInFlatTable?: boolean;
|
|
6
|
-
setHasOpenDatePicker?: Dispatch<SetStateAction<boolean>>;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface FlatTableContextType {
|
|
3
|
+
isInFlatTable: boolean;
|
|
4
|
+
setHasOpenDatePicker?: (value: boolean) => void;
|
|
7
5
|
}
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
6
|
+
declare const FlatTableContext: import("react").Context<FlatTableContextType>;
|
|
7
|
+
export default FlatTableContext;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
const FlatTableContext = /*#__PURE__*/createContext({
|
|
3
|
+
isInFlatTable: false,
|
|
4
|
+
setHasOpenDatePicker: undefined
|
|
5
|
+
});
|
|
6
|
+
export default FlatTableContext;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FlatTableProps } from "../flat-table.component";
|
|
3
|
+
export interface StrictFlatTableContextType extends Pick<FlatTableProps, "colorTheme" | "size"> {
|
|
4
|
+
getTabStopElementId: () => string;
|
|
5
|
+
}
|
|
6
|
+
declare const StrictFlatTableProvider: import("react").Provider<StrictFlatTableContextType | null>, useStrictFlatTableContext: () => StrictFlatTableContextType;
|
|
7
|
+
export { StrictFlatTableProvider, useStrictFlatTableContext };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import createStrictContext from "../../../__internal__/utils/createStrictContext";
|
|
2
|
+
const [StrictFlatTableProvider, useStrictFlatTableContext] = createStrictContext({
|
|
3
|
+
name: "FlatTableContext",
|
|
4
|
+
errorMessage: "Carbon FlatTable: Context not found. Have you wrapped your Carbon subcomponents properly? See stack trace for more details.",
|
|
5
|
+
defaultValue: {
|
|
6
|
+
getTabStopElementId: () => ""
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { StrictFlatTableProvider, useStrictFlatTableContext };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useContext, useEffect, useState } from "react";
|
|
2
2
|
import FlatTableRowContext from "../flat-table-row/__internal__/flat-table-row.context";
|
|
3
|
-
import
|
|
3
|
+
import { useStrictFlatTableContext } from "./strict-flat-table.context";
|
|
4
4
|
export default id => {
|
|
5
5
|
const {
|
|
6
6
|
getTabStopElementId
|
|
7
|
-
} =
|
|
7
|
+
} = useStrictFlatTableContext();
|
|
8
8
|
const [tabIndex, setTabIndex] = useState(-1);
|
|
9
9
|
const {
|
|
10
10
|
expandable,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useRef
|
|
2
|
+
import React, { useRef } from "react";
|
|
3
3
|
import StyledFlatTableHeader from "./flat-table-header.style";
|
|
4
|
-
import
|
|
4
|
+
import { useStrictFlatTableContext } from "../__internal__/strict-flat-table.context";
|
|
5
5
|
import guid from "../../../__internal__/utils/helpers/guid";
|
|
6
6
|
import useTableCell from "../__internal__/use-table-cell";
|
|
7
7
|
export const FlatTableHeader = ({
|
|
@@ -21,7 +21,7 @@ export const FlatTableHeader = ({
|
|
|
21
21
|
const internalId = useRef(id || guid());
|
|
22
22
|
const {
|
|
23
23
|
colorTheme
|
|
24
|
-
} =
|
|
24
|
+
} = useStrictFlatTableContext();
|
|
25
25
|
const {
|
|
26
26
|
leftPosition,
|
|
27
27
|
rightPosition,
|
|
@@ -6,7 +6,7 @@ import StyledFlatTableRow from "./flat-table-row.style";
|
|
|
6
6
|
import DrawerSidebarContext from "../../drawer/__internal__/drawer-sidebar.context";
|
|
7
7
|
import FlatTableRowHeader from "../flat-table-row-header";
|
|
8
8
|
import FlatTableRowDraggable from "./__internal__/flat-table-row-draggable.component";
|
|
9
|
-
import
|
|
9
|
+
import { useStrictFlatTableContext } from "../__internal__/strict-flat-table.context";
|
|
10
10
|
import guid from "../../../__internal__/utils/helpers/guid";
|
|
11
11
|
import FlatTableRowContext from "./__internal__/flat-table-row.context";
|
|
12
12
|
import SubRowProvider, { SubRowContext } from "./__internal__/sub-row-provider";
|
|
@@ -95,7 +95,7 @@ export const FlatTableRow = /*#__PURE__*/React.forwardRef(({
|
|
|
95
95
|
colorTheme,
|
|
96
96
|
size,
|
|
97
97
|
getTabStopElementId
|
|
98
|
-
} =
|
|
98
|
+
} = useStrictFlatTableContext();
|
|
99
99
|
const {
|
|
100
100
|
isInSidebar
|
|
101
101
|
} = useContext(DrawerSidebarContext);
|
|
@@ -3,6 +3,7 @@ import React, { useLayoutEffect, useRef, useState, useContext } from "react";
|
|
|
3
3
|
import { StyledFlatTableWrapper, StyledFlatTable, StyledFlatTableFooter, StyledTableContainer } from "./flat-table.style";
|
|
4
4
|
import DrawerSidebarContext from "../drawer/__internal__/drawer-sidebar.context";
|
|
5
5
|
import Events from "../../__internal__/utils/helpers/events/events";
|
|
6
|
+
import { StrictFlatTableProvider } from "./__internal__/strict-flat-table.context";
|
|
6
7
|
import FlatTableContext from "./__internal__/flat-table.context";
|
|
7
8
|
const FOCUSABLE_ROW_AND_CELL_QUERY = "tbody tr[tabindex], tbody tr td[tabindex], tbody tr th[tabindex]";
|
|
8
9
|
export const FlatTable = ({
|
|
@@ -186,15 +187,18 @@ export const FlatTable = ({
|
|
|
186
187
|
}, /*#__PURE__*/React.createElement(StyledFlatTable, _extends({
|
|
187
188
|
ref: tableRef,
|
|
188
189
|
"data-component": "flat-table"
|
|
189
|
-
}, tableStylingProps), caption ? /*#__PURE__*/React.createElement("caption", null, caption) : null, /*#__PURE__*/React.createElement(
|
|
190
|
+
}, tableStylingProps), caption ? /*#__PURE__*/React.createElement("caption", null, caption) : null, /*#__PURE__*/React.createElement(StrictFlatTableProvider, {
|
|
190
191
|
value: {
|
|
191
192
|
colorTheme,
|
|
192
193
|
size,
|
|
193
|
-
getTabStopElementId
|
|
194
|
+
getTabStopElementId
|
|
195
|
+
}
|
|
196
|
+
}, /*#__PURE__*/React.createElement(FlatTableContext.Provider, {
|
|
197
|
+
value: {
|
|
194
198
|
isInFlatTable: true,
|
|
195
199
|
setHasOpenDatePicker
|
|
196
200
|
}
|
|
197
|
-
}, children))), footer && /*#__PURE__*/React.createElement(StyledFlatTableFooter, {
|
|
201
|
+
}, children)))), footer && /*#__PURE__*/React.createElement(StyledFlatTableFooter, {
|
|
198
202
|
hasStickyFooter: hasStickyFooter,
|
|
199
203
|
"data-role": "flat-table-footer"
|
|
200
204
|
}, footer));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { useRef
|
|
1
|
+
import React, { useRef } from "react";
|
|
2
2
|
import Event from "../../../__internal__/utils/helpers/events";
|
|
3
3
|
import Typography from "../../typography";
|
|
4
4
|
import { StyledSort, StyledSpaceHolder, StyledSortIcon } from "./sort.style";
|
|
5
5
|
import guid from "../../../__internal__/utils/helpers/guid";
|
|
6
6
|
import useLocale from "../../../hooks/__internal__/useLocale";
|
|
7
|
-
import
|
|
7
|
+
import { useStrictFlatTableContext } from "../__internal__/strict-flat-table.context";
|
|
8
8
|
export const Sort = ({
|
|
9
9
|
children,
|
|
10
10
|
onClick,
|
|
@@ -24,7 +24,7 @@ export const Sort = ({
|
|
|
24
24
|
};
|
|
25
25
|
const {
|
|
26
26
|
colorTheme
|
|
27
|
-
} =
|
|
27
|
+
} = useStrictFlatTableContext();
|
|
28
28
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
|
|
29
29
|
screenReaderOnly: true,
|
|
30
30
|
id: id.current
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
export type StepFlowContextType = {
|
|
3
3
|
validatedCurrentStep?: number;
|
|
4
4
|
totalSteps?: number;
|
|
@@ -6,5 +6,5 @@ export type StepFlowContextType = {
|
|
|
6
6
|
category?: string;
|
|
7
7
|
titleRef?: React.RefObject<HTMLDivElement>;
|
|
8
8
|
};
|
|
9
|
-
declare const
|
|
10
|
-
export
|
|
9
|
+
declare const StepFlowProvider: import("react").Provider<StepFlowContextType | null>, useStepFlowContext: () => StepFlowContextType;
|
|
10
|
+
export { StepFlowProvider, useStepFlowContext };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
import createStrictContext from "../../../__internal__/utils/createStrictContext";
|
|
2
|
+
const [StepFlowProvider, useStepFlowContext] = createStrictContext({
|
|
3
|
+
name: "StepFlowContext",
|
|
4
|
+
errorMessage: "Carbon StepFlow: Context not found. Have you wrapped your Carbon subcomponents properly? See stack trace for more details.",
|
|
5
|
+
defaultValue: {}
|
|
6
|
+
});
|
|
7
|
+
export { StepFlowProvider, useStepFlowContext };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import Typography from "../../typography";
|
|
3
3
|
import useLocale from "../../../hooks/__internal__/useLocale";
|
|
4
|
-
import
|
|
4
|
+
import { useStepFlowContext } from "../__internal__/step-flow.context";
|
|
5
5
|
import { StyledTitleFocusWrapper } from "../step-flow.style";
|
|
6
6
|
export const StepFlowTitle = ({
|
|
7
7
|
titleString,
|
|
@@ -15,7 +15,7 @@ export const StepFlowTitle = ({
|
|
|
15
15
|
totalSteps,
|
|
16
16
|
category,
|
|
17
17
|
titleVariant: titleVariantContext
|
|
18
|
-
} =
|
|
18
|
+
} = useStepFlowContext();
|
|
19
19
|
return /*#__PURE__*/React.createElement(StyledTitleFocusWrapper, {
|
|
20
20
|
"data-role": "title-text-wrapper",
|
|
21
21
|
"data-element": "title-text-wrapper",
|
|
@@ -6,7 +6,7 @@ import { StyledStepFlow, StyledStepContent, StyledStepContentText, StyledStepLab
|
|
|
6
6
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
7
7
|
import Typography from "../typography";
|
|
8
8
|
import useLocale from "../../hooks/__internal__/useLocale";
|
|
9
|
-
import
|
|
9
|
+
import { StepFlowProvider } from "./__internal__/step-flow.context";
|
|
10
10
|
import StepFlowTitle from "./step-flow-title/step-flow-title.component";
|
|
11
11
|
export const StepFlow = /*#__PURE__*/forwardRef(({
|
|
12
12
|
category,
|
|
@@ -72,7 +72,7 @@ export const StepFlow = /*#__PURE__*/forwardRef(({
|
|
|
72
72
|
titleRef.current?.focus();
|
|
73
73
|
}
|
|
74
74
|
}), []);
|
|
75
|
-
const stepFlowTitle = /*#__PURE__*/React.createElement(
|
|
75
|
+
const stepFlowTitle = /*#__PURE__*/React.createElement(StepFlowProvider, {
|
|
76
76
|
value: {
|
|
77
77
|
validatedCurrentStep,
|
|
78
78
|
totalSteps,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface StepSequenceContextType {
|
|
3
|
+
orientation: "horizontal" | "vertical";
|
|
4
|
+
}
|
|
5
|
+
declare const StepSequenceProvider: import("react").Provider<StepSequenceContextType | null>, useStepSequenceContext: () => StepSequenceContextType;
|
|
6
|
+
export { StepSequenceProvider, useStepSequenceContext };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import createStrictContext from "../../../__internal__/utils/createStrictContext";
|
|
2
|
+
const [StepSequenceProvider, useStepSequenceContext] = createStrictContext({
|
|
3
|
+
name: "StepSequenceContext",
|
|
4
|
+
errorMessage: "Carbon StepSequence: Context not found. Have you wrapped your Carbon subcomponents properly? See stack trace for more details.",
|
|
5
|
+
defaultValue: {
|
|
6
|
+
orientation: "horizontal"
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { StepSequenceProvider, useStepSequenceContext };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { StyledStepSequenceItem, StyledStepSequenceItemContent, StyledStepSequenceItemIndicator, StyledStepSequenceItemHiddenLabel } from "./step-sequence-item.style";
|
|
4
4
|
import Icon from "../../icon";
|
|
5
|
-
import {
|
|
5
|
+
import { useStepSequenceContext } from "../__internal__/step-sequence.context";
|
|
6
6
|
import tagComponent from "../../../__internal__/utils/helpers/tags";
|
|
7
7
|
export const StepSequenceItem = ({
|
|
8
8
|
hideIndicator = false,
|
|
@@ -16,7 +16,7 @@ export const StepSequenceItem = ({
|
|
|
16
16
|
}) => {
|
|
17
17
|
const {
|
|
18
18
|
orientation
|
|
19
|
-
} =
|
|
19
|
+
} = useStepSequenceContext();
|
|
20
20
|
const indicatorText = () => {
|
|
21
21
|
return !hideIndicator ? /*#__PURE__*/React.createElement(StyledStepSequenceItemIndicator, null, indicator) : null;
|
|
22
22
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SpaceProps } from "styled-system";
|
|
3
3
|
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
4
|
-
export declare const StepSequenceContext: React.Context<{
|
|
5
|
-
orientation: "horizontal" | "vertical";
|
|
6
|
-
}>;
|
|
7
4
|
export interface StepSequenceProps extends SpaceProps, TagProps {
|
|
8
5
|
/** Step sequence items to be rendered */
|
|
9
6
|
children: React.ReactNode;
|
|
@@ -2,9 +2,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import tagComponent from "../../__internal__/utils/helpers/tags";
|
|
4
4
|
import StyledStepSequence from "./step-sequence.style";
|
|
5
|
-
|
|
6
|
-
orientation: "horizontal"
|
|
7
|
-
});
|
|
5
|
+
import { StepSequenceProvider } from "./__internal__/step-sequence.context";
|
|
8
6
|
export const StepSequence = ({
|
|
9
7
|
children,
|
|
10
8
|
orientation = "horizontal",
|
|
@@ -13,7 +11,7 @@ export const StepSequence = ({
|
|
|
13
11
|
return /*#__PURE__*/React.createElement(StyledStepSequence, _extends({
|
|
14
12
|
orientation: orientation,
|
|
15
13
|
p: 0
|
|
16
|
-
}, props, tagComponent("step-sequence", props)), /*#__PURE__*/React.createElement(
|
|
14
|
+
}, props, tagComponent("step-sequence", props)), /*#__PURE__*/React.createElement(StepSequenceProvider, {
|
|
17
15
|
value: {
|
|
18
16
|
orientation
|
|
19
17
|
}
|
|
@@ -14,7 +14,7 @@ import { markdownNodes, theme } from "./constants";
|
|
|
14
14
|
const SerializeLexical = editor => {
|
|
15
15
|
let htmlString;
|
|
16
16
|
let json;
|
|
17
|
-
editor.
|
|
17
|
+
editor.read(() => {
|
|
18
18
|
// Get the current editor state
|
|
19
19
|
const editorState = editor.getEditorState();
|
|
20
20
|
// Serialize the editor state to JSON
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This plugin allows retrieval of a reference to the current editor. It's useful
|
|
3
|
+
* for testing purposes, where tests might need to directly interact with the editor to
|
|
4
|
+
* emulate e.g. blurring.
|
|
5
|
+
*/
|
|
6
|
+
import { useEffect } from "react";
|
|
7
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
8
|
+
const EditorRefPlugin = ({
|
|
9
|
+
setEditorRef
|
|
10
|
+
}) => {
|
|
11
|
+
const [editor] = useLexicalComposerContext();
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setEditorRef(editor);
|
|
14
|
+
}, [editor, setEditorRef]);
|
|
15
|
+
return null;
|
|
16
|
+
};
|
|
17
|
+
export default EditorRefPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./editor-ref.plugin";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./editor-ref.plugin";
|
|
@@ -85,7 +85,6 @@ const Toolbar = ({
|
|
|
85
85
|
"aria-label": locale.textEditor.toolbarAriaLabel(),
|
|
86
86
|
"data-role": `${namespace}-toolbar`,
|
|
87
87
|
id: `${namespace}-toolbar`,
|
|
88
|
-
onFocus: e => e.stopPropagation(),
|
|
89
88
|
ref: toolbarRef
|
|
90
89
|
}, /*#__PURE__*/React.createElement(FormattingButtons, {
|
|
91
90
|
"data-role": `${namespace}-formatting-buttons`
|
|
@@ -23,10 +23,14 @@ export interface TextEditorProps extends MarginProps, TagProps {
|
|
|
23
23
|
labelText: string;
|
|
24
24
|
/** The identifier for the Text Editor. This allows for the using of multiple Text Editors on a screen */
|
|
25
25
|
namespace?: string;
|
|
26
|
+
/** The callback to fire when the editor loses focus */
|
|
27
|
+
onBlur?: (ev: React.FocusEvent<HTMLElement>) => void;
|
|
26
28
|
/** The callback to fire when the Cancel button within the editor is pressed */
|
|
27
29
|
onCancel?: () => void;
|
|
28
30
|
/** The callback to fire when a change is registered within the editor */
|
|
29
31
|
onChange?: (value: string, formattedValues: EditorFormattedValues) => void;
|
|
32
|
+
/** The callback to fire when the editor gains focus */
|
|
33
|
+
onFocus?: (ev: React.FocusEvent<HTMLElement>) => void;
|
|
30
34
|
/** The callback to fire when a link is added into the editor */
|
|
31
35
|
onLinkAdded?: (link: string, state: string) => void;
|
|
32
36
|
/** The callback to fire when the Save button within the editor is pressed */
|
|
@@ -46,5 +50,5 @@ export interface TextEditorProps extends MarginProps, TagProps {
|
|
|
46
50
|
/** The initial value of the editor, as a HTML string, or JSON */
|
|
47
51
|
value?: string | undefined;
|
|
48
52
|
}
|
|
49
|
-
export declare const TextEditor: ({ characterLimit, error, footer, header, inputHint, isOptional, labelText, namespace, onCancel, onChange, onLinkAdded, onSave, placeholder, previews, readOnly, required, rows, warning, value, ...rest }: TextEditorProps) => React.JSX.Element;
|
|
53
|
+
export declare const TextEditor: ({ characterLimit, error, footer, header, inputHint, isOptional, labelText, namespace, onBlur, onCancel, onChange, onFocus, onLinkAdded, onSave, placeholder, previews, readOnly, required, rows, warning, value, ...rest }: TextEditorProps) => React.JSX.Element;
|
|
50
54
|
export default TextEditor;
|
|
@@ -13,7 +13,6 @@ import { $getRoot } from "lexical";
|
|
|
13
13
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
14
14
|
import { SerializeLexical, validateUrl } from "./__internal__/helpers";
|
|
15
15
|
import Label from "../../__internal__/label";
|
|
16
|
-
import useDebounce from "../../hooks/__internal__/useDebounce";
|
|
17
16
|
import useLocale from "../../hooks/__internal__/useLocale";
|
|
18
17
|
import Logger from "../../__internal__/utils/logger";
|
|
19
18
|
import { COMPONENT_PREFIX, markdownNodes, theme } from "./__internal__/constants";
|
|
@@ -34,8 +33,10 @@ export const TextEditor = ({
|
|
|
34
33
|
isOptional = false,
|
|
35
34
|
labelText,
|
|
36
35
|
namespace = COMPONENT_PREFIX,
|
|
36
|
+
onBlur,
|
|
37
37
|
onCancel,
|
|
38
38
|
onChange,
|
|
39
|
+
onFocus,
|
|
39
40
|
onLinkAdded,
|
|
40
41
|
onSave,
|
|
41
42
|
placeholder,
|
|
@@ -74,7 +75,6 @@ export const TextEditor = ({
|
|
|
74
75
|
return cleanup;
|
|
75
76
|
}, [contentEditorRef]);
|
|
76
77
|
const [cancelTrigger, setCancelTrigger] = useState(false);
|
|
77
|
-
const debounceWaitTime = 500;
|
|
78
78
|
const initialConfig = useMemo(() => {
|
|
79
79
|
return {
|
|
80
80
|
namespace,
|
|
@@ -88,7 +88,7 @@ export const TextEditor = ({
|
|
|
88
88
|
|
|
89
89
|
// OnChangePlugin is tested separately
|
|
90
90
|
/* istanbul ignore next */
|
|
91
|
-
const handleChange =
|
|
91
|
+
const handleChange = useCallback(newState => {
|
|
92
92
|
const currentTextContent = newState.read(() => $getRoot().getTextContent());
|
|
93
93
|
if (onChange) {
|
|
94
94
|
const formattedValues = editorRef.current ? SerializeLexical(editorRef.current) : {};
|
|
@@ -101,11 +101,10 @@ export const TextEditor = ({
|
|
|
101
101
|
// If the character limit has been exceeded, show the character limit warning
|
|
102
102
|
setCharacterLimitWarning(currentDiff < 0 ? locale.textEditor.characterLimit(Math.abs(currentDiff)) : undefined);
|
|
103
103
|
}
|
|
104
|
-
},
|
|
104
|
+
}, [characterLimit, locale.textEditor, onChange]);
|
|
105
105
|
const handleCancel = useCallback(() => {
|
|
106
|
-
const editor = editorRef.current;
|
|
107
106
|
/* istanbul ignore next */
|
|
108
|
-
const isEditable =
|
|
107
|
+
const isEditable = editorRef.current?.isEditable() || false;
|
|
109
108
|
/* istanbul ignore if */
|
|
110
109
|
if (!isEditable) return;
|
|
111
110
|
|
|
@@ -118,13 +117,12 @@ export const TextEditor = ({
|
|
|
118
117
|
|
|
119
118
|
// Reset the value of the editor when the cancel trigger is updated (implements reset on cancel)
|
|
120
119
|
useEffect(() => {
|
|
121
|
-
const editor = editorRef.current;
|
|
122
120
|
const safeValue = value || createEmpty();
|
|
123
121
|
|
|
124
122
|
/* istanbul ignore else */
|
|
125
|
-
if (
|
|
126
|
-
const newEditorState =
|
|
127
|
-
|
|
123
|
+
if (editorRef.current) {
|
|
124
|
+
const newEditorState = editorRef.current.parseEditorState(safeValue);
|
|
125
|
+
editorRef.current.setEditorState(newEditorState);
|
|
128
126
|
}
|
|
129
127
|
}, [cancelTrigger, value]);
|
|
130
128
|
const toolbarProps = useMemo(() => ({
|
|
@@ -133,7 +131,17 @@ export const TextEditor = ({
|
|
|
133
131
|
onSave
|
|
134
132
|
}), [handleCancel, namespace, onCancel, onSave]);
|
|
135
133
|
return /*#__PURE__*/React.createElement(StyledTextEditorWrapper, _extends({
|
|
136
|
-
"data-role": `${namespace}-editor-wrapper
|
|
134
|
+
"data-role": `${namespace}-editor-wrapper`,
|
|
135
|
+
onBlur: ev => {
|
|
136
|
+
if (!ev.currentTarget.contains(ev.relatedTarget)) {
|
|
137
|
+
onBlur?.(ev);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
onFocus: ev => {
|
|
141
|
+
if (!ev.currentTarget.contains(ev.relatedTarget)) {
|
|
142
|
+
onFocus?.(ev);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
137
145
|
}, filterStyledSystemMarginProps(rest), tagComponent("text-editor", rest)), /*#__PURE__*/React.createElement(TextEditorContext.Provider, {
|
|
138
146
|
value: {
|
|
139
147
|
onLinkAdded
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PaddingProps } from "styled-system";
|
|
3
|
-
interface
|
|
4
|
-
isHorizontal
|
|
3
|
+
interface TileContextType {
|
|
4
|
+
isHorizontal: boolean;
|
|
5
5
|
paddingPropsFromTile: PaddingProps;
|
|
6
6
|
}
|
|
7
|
-
declare const
|
|
8
|
-
export
|
|
7
|
+
declare const TileProvider: import("react").Provider<TileContextType | null>, useTileContext: () => TileContextType;
|
|
8
|
+
export { TileProvider, useTileContext };
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import createStrictContext from "../../../__internal__/utils/createStrictContext";
|
|
2
|
+
const [TileProvider, useTileContext] = createStrictContext({
|
|
3
|
+
name: "TileContext",
|
|
4
|
+
errorMessage: "Carbon Tile: Context not found. Have you wrapped your Carbon subcomponents properly? See stack trace for more details.",
|
|
5
|
+
defaultValue: {
|
|
6
|
+
paddingPropsFromTile: {},
|
|
7
|
+
isHorizontal: false
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
export { TileProvider, useTileContext };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React
|
|
2
|
+
import React from "react";
|
|
3
3
|
import StyledTileContent from "./tile-content.style";
|
|
4
|
-
import
|
|
4
|
+
import { useTileContext } from "../__internal__/tile.context";
|
|
5
5
|
import tagComponent from "../../../__internal__/utils/helpers/tags";
|
|
6
6
|
import filterStyledSystemPaddingProps from "../../../style/utils/filter-styled-system-padding-props";
|
|
7
7
|
import filterStyledSystemMarginProps from "../../../style/utils/filter-styled-system-margin-props";
|
|
@@ -14,7 +14,7 @@ const TileContent = ({
|
|
|
14
14
|
const {
|
|
15
15
|
isHorizontal,
|
|
16
16
|
paddingPropsFromTile
|
|
17
|
-
} =
|
|
17
|
+
} = useTileContext();
|
|
18
18
|
if (!children) {
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React from "react";
|
|
3
3
|
import StyledTile from "./tile.style";
|
|
4
|
-
import
|
|
4
|
+
import { TileProvider } from "./__internal__/tile.context";
|
|
5
5
|
import filterStyledSystemPaddingProps from "../../style/utils/filter-styled-system-padding-props";
|
|
6
6
|
import filterStyledSystemMarginProps from "../../style/utils/filter-styled-system-margin-props";
|
|
7
7
|
import computeContentPadding from "./__internal__/compute-content-padding";
|
|
@@ -36,7 +36,7 @@ export const Tile = ({
|
|
|
36
36
|
highlightVariant: highlightVariant,
|
|
37
37
|
borderWidth: borderWidth,
|
|
38
38
|
borderVariant: borderVariant
|
|
39
|
-
}, paddingProps, marginProps, tagComponent("tile", rest)), /*#__PURE__*/React.createElement(
|
|
39
|
+
}, paddingProps, marginProps, tagComponent("tile", rest)), /*#__PURE__*/React.createElement(TileProvider, {
|
|
40
40
|
value: {
|
|
41
41
|
isHorizontal,
|
|
42
42
|
paddingPropsFromTile: contentPaddingProps
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface VerticalMenuContextType {
|
|
3
|
+
isFullScreen: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const VerticalMenuProvider: import("react").Provider<VerticalMenuContextType | null>, useVerticalMenuContext: () => VerticalMenuContextType;
|
|
6
|
+
export { VerticalMenuProvider, useVerticalMenuContext };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import createStrictContext from "../../../__internal__/utils/createStrictContext";
|
|
2
|
+
const [VerticalMenuProvider, useVerticalMenuContext] = createStrictContext({
|
|
3
|
+
name: "VerticalMenuContext",
|
|
4
|
+
errorMessage: "Carbon VerticalMenu: Context not found. Have you wrapped your Carbon subcomponents properly? See stack trace for more details.",
|
|
5
|
+
defaultValue: {
|
|
6
|
+
isFullScreen: false
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { VerticalMenuProvider, useVerticalMenuContext };
|
|
@@ -8,7 +8,7 @@ import IconButton from "../../icon-button";
|
|
|
8
8
|
import Icon from "../../icon";
|
|
9
9
|
import Box from "../../box";
|
|
10
10
|
import { StyledList, StyledVerticalMenuFullScreen } from "../vertical-menu.style";
|
|
11
|
-
import
|
|
11
|
+
import { VerticalMenuProvider } from "../__internal__/vertical-menu.context";
|
|
12
12
|
import { getDocument } from "../../../__internal__/dom/globals";
|
|
13
13
|
import Events from "../../../__internal__/utils/helpers/events/events";
|
|
14
14
|
import useModalManager from "../../../hooks/__internal__/useModalManager";
|
|
@@ -64,7 +64,7 @@ export const VerticalMenuFullScreen = ({
|
|
|
64
64
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
65
65
|
type: "close",
|
|
66
66
|
color: "var(--colorsComponentsLeftnavWinterStandardContent)"
|
|
67
|
-
}))), /*#__PURE__*/React.createElement(
|
|
67
|
+
}))), /*#__PURE__*/React.createElement(VerticalMenuProvider, {
|
|
68
68
|
value: {
|
|
69
69
|
isFullScreen: true
|
|
70
70
|
}
|