carbon-react 117.6.1 → 117.7.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/components/modal/__internal__/modal-manager.d.ts +1 -7
- package/esm/global.d.ts +19 -3
- package/esm/hooks/__internal__/useScrollBlock/scroll-block-manager.d.ts +0 -11
- package/esm/style/utils/filter-out-styled-system-spacing-props.d.ts +2 -1
- package/esm/style/utils/filter-out-styled-system-spacing-props.js +3 -2
- package/esm/style/utils/filter-styled-system-padding-props.d.ts +1 -1
- package/esm/style/utils/filter-styled-system-padding-props.js +1 -3
- package/esm/style/utils/visually-hidden.js +1 -0
- package/lib/components/modal/__internal__/modal-manager.d.ts +1 -7
- package/lib/global.d.ts +19 -3
- package/lib/hooks/__internal__/useScrollBlock/scroll-block-manager.d.ts +0 -11
- package/lib/style/utils/filter-out-styled-system-spacing-props.d.ts +2 -1
- package/lib/style/utils/filter-out-styled-system-spacing-props.js +3 -3
- package/lib/style/utils/filter-styled-system-padding-props.d.ts +1 -1
- package/lib/style/utils/filter-styled-system-padding-props.js +1 -3
- package/lib/style/utils/visually-hidden.js +1 -0
- package/package.json +6 -4
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
declare type SetTriggerRefocusFlag = (boolean: boolean) => void;
|
|
2
|
-
declare type ModalList = {
|
|
2
|
+
export declare type ModalList = {
|
|
3
3
|
modal: HTMLElement;
|
|
4
4
|
setTriggerRefocusFlag?: SetTriggerRefocusFlag;
|
|
5
5
|
}[];
|
|
6
|
-
declare global {
|
|
7
|
-
interface Window {
|
|
8
|
-
__CARBON_INTERNALS_MODAL_LIST?: ModalList;
|
|
9
|
-
__CARBON_INTERNALS_MODAL_SETTER_LIST?: ((topModal: HTMLElement | null) => void)[];
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
6
|
declare class ModalManagerInstance {
|
|
13
7
|
private modalList;
|
|
14
8
|
constructor();
|
package/esm/global.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare
|
|
1
|
+
import { ModalList } from "components/modal/__internal__/modal-manager";
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
module "*.png";
|
|
5
|
+
module "*.svg";
|
|
6
|
+
interface Window {
|
|
7
|
+
__CARBON_INTERNALS_MODAL_LIST?: ModalList;
|
|
8
|
+
__CARBON_INTERNALS_MODAL_SETTER_LIST?: ((
|
|
9
|
+
topModal: HTMLElement | null
|
|
10
|
+
) => void)[];
|
|
11
|
+
__CARBON_INTERNALS_SCROLL_BLOCKERS?: {
|
|
12
|
+
components: {
|
|
13
|
+
[key: string]: boolean;
|
|
14
|
+
};
|
|
15
|
+
originalValues: string[];
|
|
16
|
+
restoreValues?: (() => void) | null;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
interface Window {
|
|
3
|
-
__CARBON_INTERNALS_SCROLL_BLOCKERS?: {
|
|
4
|
-
components: {
|
|
5
|
-
[key: string]: boolean;
|
|
6
|
-
};
|
|
7
|
-
originalValues: string[];
|
|
8
|
-
restoreValues?: (() => void) | null;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
1
|
declare class ScrollBlockManager {
|
|
13
2
|
components: {
|
|
14
3
|
[key: string]: boolean;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { SpaceProps } from "styled-system";
|
|
2
|
+
declare const filterOutStyledSystemSpacingProps: (props: Record<string, unknown> | SpaceProps) => Record<string, unknown>;
|
|
2
3
|
export default filterOutStyledSystemSpacingProps;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { marginPropertyNames } from "./filter-styled-system-margin-props";
|
|
2
|
+
import { paddingPropertyNames } from "./filter-styled-system-padding-props";
|
|
2
3
|
|
|
3
|
-
const filterOutStyledSystemSpacingProps = props => Object.fromEntries(Object.entries(props).filter(([key]) => !
|
|
4
|
+
const filterOutStyledSystemSpacingProps = props => Object.fromEntries(Object.entries(props).filter(([key]) => ![...marginPropertyNames, ...paddingPropertyNames].includes(key)));
|
|
4
5
|
|
|
5
6
|
export default filterOutStyledSystemSpacingProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PaddingProps } from "styled-system";
|
|
2
2
|
export declare const paddingPropertyNames: string[];
|
|
3
|
-
export default function filterStyledSystemPaddingProps(props: Record<string,
|
|
3
|
+
export default function filterStyledSystemPaddingProps(props: Record<string, unknown> | PaddingProps): PaddingProps;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import filterObjectProperties from "../../__internal__/filter-object-properties";
|
|
2
2
|
export const paddingPropertyNames = ["padding", "p", "paddingLeft", "pl", "paddingRight", "pr", "paddingTop", "pt", "paddingBottom", "pb", "paddingX", "px", "paddingY", "py"];
|
|
3
|
-
export default function filterStyledSystemPaddingProps(
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
-
props) {
|
|
3
|
+
export default function filterStyledSystemPaddingProps(props) {
|
|
6
4
|
return filterObjectProperties(props, paddingPropertyNames);
|
|
7
5
|
}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
declare type SetTriggerRefocusFlag = (boolean: boolean) => void;
|
|
2
|
-
declare type ModalList = {
|
|
2
|
+
export declare type ModalList = {
|
|
3
3
|
modal: HTMLElement;
|
|
4
4
|
setTriggerRefocusFlag?: SetTriggerRefocusFlag;
|
|
5
5
|
}[];
|
|
6
|
-
declare global {
|
|
7
|
-
interface Window {
|
|
8
|
-
__CARBON_INTERNALS_MODAL_LIST?: ModalList;
|
|
9
|
-
__CARBON_INTERNALS_MODAL_SETTER_LIST?: ((topModal: HTMLElement | null) => void)[];
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
6
|
declare class ModalManagerInstance {
|
|
13
7
|
private modalList;
|
|
14
8
|
constructor();
|
package/lib/global.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare
|
|
1
|
+
import { ModalList } from "components/modal/__internal__/modal-manager";
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
module "*.png";
|
|
5
|
+
module "*.svg";
|
|
6
|
+
interface Window {
|
|
7
|
+
__CARBON_INTERNALS_MODAL_LIST?: ModalList;
|
|
8
|
+
__CARBON_INTERNALS_MODAL_SETTER_LIST?: ((
|
|
9
|
+
topModal: HTMLElement | null
|
|
10
|
+
) => void)[];
|
|
11
|
+
__CARBON_INTERNALS_SCROLL_BLOCKERS?: {
|
|
12
|
+
components: {
|
|
13
|
+
[key: string]: boolean;
|
|
14
|
+
};
|
|
15
|
+
originalValues: string[];
|
|
16
|
+
restoreValues?: (() => void) | null;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
interface Window {
|
|
3
|
-
__CARBON_INTERNALS_SCROLL_BLOCKERS?: {
|
|
4
|
-
components: {
|
|
5
|
-
[key: string]: boolean;
|
|
6
|
-
};
|
|
7
|
-
originalValues: string[];
|
|
8
|
-
restoreValues?: (() => void) | null;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
1
|
declare class ScrollBlockManager {
|
|
13
2
|
components: {
|
|
14
3
|
[key: string]: boolean;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { SpaceProps } from "styled-system";
|
|
2
|
+
declare const filterOutStyledSystemSpacingProps: (props: Record<string, unknown> | SpaceProps) => Record<string, unknown>;
|
|
2
3
|
export default filterOutStyledSystemSpacingProps;
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _filterStyledSystemMarginProps = require("./filter-styled-system-margin-props");
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
var _filterStyledSystemPaddingProps = require("./filter-styled-system-padding-props");
|
|
11
11
|
|
|
12
|
-
const filterOutStyledSystemSpacingProps = props => Object.fromEntries(Object.entries(props).filter(([key]) => !
|
|
12
|
+
const filterOutStyledSystemSpacingProps = props => Object.fromEntries(Object.entries(props).filter(([key]) => ![..._filterStyledSystemMarginProps.marginPropertyNames, ..._filterStyledSystemPaddingProps.paddingPropertyNames].includes(key)));
|
|
13
13
|
|
|
14
14
|
var _default = filterOutStyledSystemSpacingProps;
|
|
15
15
|
exports.default = _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PaddingProps } from "styled-system";
|
|
2
2
|
export declare const paddingPropertyNames: string[];
|
|
3
|
-
export default function filterStyledSystemPaddingProps(props: Record<string,
|
|
3
|
+
export default function filterStyledSystemPaddingProps(props: Record<string, unknown> | PaddingProps): PaddingProps;
|
|
@@ -13,8 +13,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
13
13
|
const paddingPropertyNames = ["padding", "p", "paddingLeft", "pl", "paddingRight", "pr", "paddingTop", "pt", "paddingBottom", "pb", "paddingX", "px", "paddingY", "py"];
|
|
14
14
|
exports.paddingPropertyNames = paddingPropertyNames;
|
|
15
15
|
|
|
16
|
-
function filterStyledSystemPaddingProps(
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
-
props) {
|
|
16
|
+
function filterStyledSystemPaddingProps(props) {
|
|
19
17
|
return (0, _filterObjectProperties.default)(props, paddingPropertyNames);
|
|
20
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "117.
|
|
3
|
+
"version": "117.7.0",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"scripts/check_rfcs/index.js"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"start": "node ./scripts/check_node_version.js && NODE_OPTIONS=--openssl-legacy-provider start-storybook -p 9001 -c .storybook",
|
|
12
|
+
"start": "node ./scripts/check_node_version.js && cross-env NODE_OPTIONS=--openssl-legacy-provider start-storybook -p 9001 -c .storybook",
|
|
13
13
|
"start:debug-theme": "cross-env STORYBOOK_DEBUG_THEME=true npm run start",
|
|
14
14
|
"test": "jest --config=./jest.config.json",
|
|
15
15
|
"test-update": "jest --config=./jest.config.json --updateSnapshot",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"clean-lib": "rimraf ./lib && rimraf ./esm",
|
|
31
31
|
"commit": "git-cz",
|
|
32
32
|
"generate-metadata": "node ./scripts/generate_metadata/index.mjs",
|
|
33
|
-
"type-check": "tsc --noEmit",
|
|
34
|
-
"type-check:watch": "
|
|
33
|
+
"type-check": "tsc --noEmit && tsc -p ./cypress/tsconfig.json",
|
|
34
|
+
"type-check:watch": "concurrently --names 'src,cypress' -c 'cyan,yellow' 'tsc --noEmit --watch' 'tsc -p ./cypress/tsconfig.json --watch'",
|
|
35
35
|
"build:types": "tsc -p tsconfig-build.json --emitDeclarationOnly --outDir ./lib && tsc -p tsconfig-build.json --emitDeclarationOnly --outDir ./esm"
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
"@testing-library/react-hooks": "^8.0.1",
|
|
85
85
|
"@testing-library/user-event": "^14.4.3",
|
|
86
86
|
"@types/crypto-js": "^4.1.1",
|
|
87
|
+
"@types/cypress": "^1.1.3",
|
|
87
88
|
"@types/draft-js": "^0.11.7",
|
|
88
89
|
"@types/enzyme": "^3.10.3",
|
|
89
90
|
"@types/invariant": "^2.2.35",
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
"browserslist": "^4.21.5",
|
|
109
110
|
"chromatic": "^6.0.5",
|
|
110
111
|
"commitizen": "^4.2.5",
|
|
112
|
+
"concurrently": "^8.0.1",
|
|
111
113
|
"conventional-changelog-conventionalcommits": "^4.5.0",
|
|
112
114
|
"core-js": "^3.20.3",
|
|
113
115
|
"cross-env": "^5.2.0",
|