carbon-react 106.0.2 → 106.0.3
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__/input/index.d.ts +5 -5
- package/esm/__internal__/input/input-presentation.component.d.ts +21 -27
- package/esm/__internal__/input/input-presentation.component.js +7 -20
- package/esm/__internal__/input/input-presentation.style.d.ts +5 -8
- package/esm/__internal__/input/input-presentation.style.js +37 -53
- package/esm/__internal__/input/input-sizes.style.d.ts +8 -18
- package/esm/__internal__/input/input-sizes.style.js +3 -2
- package/esm/__internal__/input/input.component.d.ts +39 -2
- package/esm/__internal__/input/input.component.js +84 -66
- package/esm/__internal__/input/input.style.d.ts +2 -1
- package/esm/__internal__/input/input.style.js +0 -4
- package/esm/__internal__/input-behaviour/index.d.ts +2 -1
- package/esm/__internal__/input-behaviour/input-behaviour.component.d.ts +7 -10
- package/esm/__internal__/input-behaviour/input-behaviour.component.js +2 -7
- package/esm/__internal__/input-behaviour/input-group-behaviour.component.d.ts +8 -12
- package/esm/__internal__/input-behaviour/input-group-behaviour.component.js +1 -7
- package/esm/__internal__/input-behaviour/useInputBehaviour.d.ts +14 -10
- package/esm/__internal__/label/label.d.ts +1 -1
- package/esm/components/badge/badge.component.d.ts +10 -13
- package/esm/components/badge/badge.component.js +60 -24
- package/esm/components/badge/badge.style.d.ts +7 -5
- package/esm/components/badge/index.d.ts +2 -1
- package/esm/components/carbon-provider/carbon-provider.component.d.ts +8 -14
- package/esm/components/carbon-provider/carbon-provider.component.js +110 -14
- package/esm/components/carbon-provider/index.d.ts +2 -1
- package/esm/components/date-range/date-range.style.js +2 -2
- package/esm/components/decimal/decimal.component.js +2 -1
- package/esm/components/heading/heading.style.d.ts +1 -2
- package/esm/components/inline-inputs/index.d.ts +2 -1
- package/esm/components/inline-inputs/index.js +1 -1
- package/esm/components/inline-inputs/inline-inputs.component.d.ts +25 -22
- package/esm/components/inline-inputs/inline-inputs.component.js +96 -60
- package/esm/components/inline-inputs/inline-inputs.config.d.ts +1 -1
- package/esm/components/inline-inputs/inline-inputs.style.d.ts +5 -3
- package/esm/components/inline-inputs/inline-inputs.style.js +2 -2
- package/esm/components/link/index.d.ts +1 -2
- package/esm/components/link/link.component.d.ts +37 -2
- package/esm/components/link/link.component.js +1243 -124
- package/esm/components/link/link.config.d.ts +2 -2
- package/esm/components/link/link.style.d.ts +7 -2
- package/esm/components/link/link.style.js +0 -5
- package/esm/components/pager/pager.style.d.ts +1 -2
- package/esm/components/pod/pod.style.d.ts +1 -2
- package/esm/components/simple-color-picker/simple-color-input/simple-color-input.style.d.ts +1 -1
- package/esm/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +1 -2
- package/esm/components/tile-select/tile-select.style.d.ts +1 -1
- package/lib/__internal__/input/index.d.ts +5 -5
- package/lib/__internal__/input/input-presentation.component.d.ts +21 -27
- package/lib/__internal__/input/input-presentation.component.js +7 -23
- package/lib/__internal__/input/input-presentation.style.d.ts +5 -8
- package/lib/__internal__/input/input-presentation.style.js +37 -54
- package/lib/__internal__/input/input-sizes.style.d.ts +8 -18
- package/lib/__internal__/input/input-sizes.style.js +2 -1
- package/lib/__internal__/input/input.component.d.ts +39 -2
- package/lib/__internal__/input/input.component.js +85 -69
- package/lib/__internal__/input/input.style.d.ts +2 -1
- package/lib/__internal__/input/input.style.js +0 -7
- package/lib/__internal__/input-behaviour/index.d.ts +2 -1
- package/lib/__internal__/input-behaviour/input-behaviour.component.d.ts +7 -10
- package/lib/__internal__/input-behaviour/input-behaviour.component.js +3 -10
- package/lib/__internal__/input-behaviour/input-group-behaviour.component.d.ts +8 -12
- package/lib/__internal__/input-behaviour/input-group-behaviour.component.js +2 -10
- package/lib/__internal__/input-behaviour/useInputBehaviour.d.ts +14 -10
- package/lib/__internal__/label/label.d.ts +1 -1
- package/lib/components/badge/badge.component.d.ts +10 -13
- package/lib/components/badge/badge.component.js +51 -29
- package/lib/components/badge/badge.style.d.ts +7 -5
- package/lib/components/badge/index.d.ts +2 -1
- package/lib/components/carbon-provider/carbon-provider.component.d.ts +8 -14
- package/lib/components/carbon-provider/carbon-provider.component.js +115 -20
- package/lib/components/carbon-provider/index.d.ts +2 -1
- package/lib/components/date-range/date-range.style.js +4 -4
- package/lib/components/decimal/decimal.component.js +2 -1
- package/lib/components/heading/heading.style.d.ts +1 -2
- package/lib/components/inline-inputs/index.d.ts +2 -1
- package/lib/components/inline-inputs/index.js +10 -2
- package/lib/components/inline-inputs/inline-inputs.component.d.ts +25 -22
- package/lib/components/inline-inputs/inline-inputs.component.js +143 -68
- package/lib/components/inline-inputs/inline-inputs.config.d.ts +1 -1
- package/lib/components/inline-inputs/inline-inputs.style.d.ts +5 -3
- package/lib/components/inline-inputs/inline-inputs.style.js +2 -2
- package/lib/components/link/index.d.ts +1 -2
- package/lib/components/link/link.component.d.ts +37 -2
- package/lib/components/link/link.component.js +764 -146
- package/lib/components/link/link.config.d.ts +2 -2
- package/lib/components/link/link.style.d.ts +7 -2
- package/lib/components/link/link.style.js +0 -6
- package/lib/components/pager/pager.style.d.ts +1 -2
- package/lib/components/pod/pod.style.d.ts +1 -2
- package/lib/components/simple-color-picker/simple-color-input/simple-color-input.style.d.ts +1 -1
- package/lib/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +1 -2
- package/lib/components/tile-select/tile-select.style.d.ts +1 -1
- package/package.json +1 -1
- package/esm/__internal__/input/extract-props/extract-props.d.ts +0 -1
- package/esm/__internal__/input/extract-props/extract-props.js +0 -11
- package/esm/__internal__/input/extract-props/index.d.ts +0 -1
- package/esm/__internal__/input/extract-props/index.js +0 -1
- package/esm/__internal__/input/input-presentation.d.ts +0 -24
- package/esm/__internal__/input/input.d.ts +0 -54
- package/esm/components/badge/badge.d.ts +0 -14
- package/esm/components/carbon-provider/carbon-provider.d.ts +0 -12
- package/esm/components/inline-inputs/inline-inputs.d.ts +0 -30
- package/esm/components/link/link.d.ts +0 -47
- package/lib/__internal__/input/extract-props/extract-props.d.ts +0 -1
- package/lib/__internal__/input/extract-props/extract-props.js +0 -18
- package/lib/__internal__/input/extract-props/index.d.ts +0 -1
- package/lib/__internal__/input/extract-props/index.js +0 -15
- package/lib/__internal__/input/extract-props/package.json +0 -6
- package/lib/__internal__/input/input-presentation.d.ts +0 -24
- package/lib/__internal__/input/input.d.ts +0 -54
- package/lib/components/badge/badge.d.ts +0 -14
- package/lib/components/carbon-provider/carbon-provider.d.ts +0 -12
- package/lib/components/inline-inputs/inline-inputs.d.ts +0 -30
- package/lib/components/link/link.d.ts +0 -47
|
@@ -7,10 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
15
11
|
|
|
16
12
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -54,8 +50,5 @@ const StyledInput = _styledComponents.default.input`
|
|
|
54
50
|
color: var(--colorsActionMinorYin090);
|
|
55
51
|
`}
|
|
56
52
|
`;
|
|
57
|
-
StyledInput.propTypes = {
|
|
58
|
-
disabled: _propTypes.default.bool
|
|
59
|
-
};
|
|
60
53
|
var _default = StyledInput;
|
|
61
54
|
exports.default = _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { InputBehaviour, InputContext } from "./input-behaviour.component";
|
|
2
|
-
export { InputGroupBehaviour, InputGroupContext } from "./input-group-behaviour.component";
|
|
2
|
+
export { InputGroupBehaviour, InputGroupContext, } from "./input-group-behaviour.component";
|
|
3
|
+
export type { InputContextProps } from "./useInputBehaviour";
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
export const InputContext: React.Context<{}>;
|
|
2
|
-
export function InputBehaviour({ children }: {
|
|
3
|
-
children: any;
|
|
4
|
-
}): JSX.Element;
|
|
5
|
-
export namespace InputBehaviour {
|
|
6
|
-
namespace propTypes {
|
|
7
|
-
const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
1
|
import React from "react";
|
|
11
|
-
import
|
|
2
|
+
import { InputContextProps } from "./useInputBehaviour";
|
|
3
|
+
declare const InputContext: React.Context<InputContextProps>;
|
|
4
|
+
export interface InputBehaviourProps {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const InputBehaviour: ({ children }: InputBehaviourProps) => JSX.Element;
|
|
8
|
+
export { InputContext, InputBehaviour };
|
|
@@ -7,9 +7,7 @@ exports.InputBehaviour = exports.InputContext = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var _inlineInputs = require("../../components/inline-inputs/inline-inputs.component");
|
|
10
|
+
var _inlineInputs = require("../../components/inline-inputs");
|
|
13
11
|
|
|
14
12
|
var _useInputBehaviour = _interopRequireDefault(require("./useInputBehaviour"));
|
|
15
13
|
|
|
@@ -19,9 +17,7 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
19
17
|
|
|
20
18
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
19
|
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const InputContext = /*#__PURE__*/_react.default.createContext(defaultValue);
|
|
20
|
+
const InputContext = /*#__PURE__*/_react.default.createContext({});
|
|
25
21
|
|
|
26
22
|
exports.InputContext = InputContext;
|
|
27
23
|
|
|
@@ -39,7 +35,4 @@ const InputBehaviour = ({
|
|
|
39
35
|
}, children);
|
|
40
36
|
};
|
|
41
37
|
|
|
42
|
-
exports.InputBehaviour = InputBehaviour;
|
|
43
|
-
InputBehaviour.propTypes = {
|
|
44
|
-
children: _propTypes.default.node
|
|
45
|
-
};
|
|
38
|
+
exports.InputBehaviour = InputBehaviour;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
export const InputGroupContext: React.Context<{}>;
|
|
2
|
-
export function InputGroupBehaviour({ children, blockGroupBehaviour }: {
|
|
3
|
-
children: any;
|
|
4
|
-
blockGroupBehaviour: any;
|
|
5
|
-
}): JSX.Element;
|
|
6
|
-
export namespace InputGroupBehaviour {
|
|
7
|
-
namespace propTypes {
|
|
8
|
-
const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
9
|
-
const blockGroupBehaviour: PropTypes.Requireable<boolean>;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
1
|
import React from "react";
|
|
13
|
-
import
|
|
2
|
+
import { InputContextProps } from "./useInputBehaviour";
|
|
3
|
+
import { InputBehaviourProps } from "./input-behaviour.component";
|
|
4
|
+
declare const InputGroupContext: React.Context<InputContextProps>;
|
|
5
|
+
export interface InputGroupBehaviourProps extends InputBehaviourProps {
|
|
6
|
+
blockGroupBehaviour?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const InputGroupBehaviour: ({ children, blockGroupBehaviour, }: InputGroupBehaviourProps) => JSX.Element;
|
|
9
|
+
export { InputGroupContext, InputGroupBehaviour };
|
|
@@ -7,15 +7,11 @@ exports.InputGroupBehaviour = exports.InputGroupContext = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _useInputBehaviour = _interopRequireDefault(require("./useInputBehaviour"));
|
|
13
11
|
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
13
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const InputGroupContext = /*#__PURE__*/_react.default.createContext(defaultValue);
|
|
14
|
+
const InputGroupContext = /*#__PURE__*/_react.default.createContext({});
|
|
19
15
|
|
|
20
16
|
exports.InputGroupContext = InputGroupContext;
|
|
21
17
|
|
|
@@ -29,8 +25,4 @@ const InputGroupBehaviour = ({
|
|
|
29
25
|
}, children);
|
|
30
26
|
};
|
|
31
27
|
|
|
32
|
-
exports.InputGroupBehaviour = InputGroupBehaviour;
|
|
33
|
-
InputGroupBehaviour.propTypes = {
|
|
34
|
-
children: _propTypes.default.node,
|
|
35
|
-
blockGroupBehaviour: _propTypes.default.bool
|
|
36
|
-
};
|
|
28
|
+
exports.InputGroupBehaviour = InputGroupBehaviour;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
export interface InputContextProps {
|
|
2
|
+
hasFocus?: boolean;
|
|
3
|
+
hasMouseOver?: boolean;
|
|
4
|
+
onFocus?: () => void;
|
|
5
|
+
onBlur?: () => void;
|
|
6
|
+
onMouseDown?: () => void;
|
|
7
|
+
onMouseEnter?: () => void;
|
|
8
|
+
onMouseLeave?: () => void;
|
|
9
|
+
inputRef?: (input: {
|
|
10
|
+
current: HTMLInputElement | null;
|
|
11
|
+
}) => void;
|
|
12
|
+
ariaLabelledBy?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const useInputBehaviour: (blockGroupBehaviour?: boolean | undefined) => InputContextProps;
|
|
1
15
|
export default useInputBehaviour;
|
|
2
|
-
declare function useInputBehaviour(blockGroupBehaviour: any): {
|
|
3
|
-
hasFocus: boolean;
|
|
4
|
-
hasMouseOver: boolean;
|
|
5
|
-
onFocus: (() => void) | undefined;
|
|
6
|
-
onBlur: (() => void) | undefined;
|
|
7
|
-
onMouseDown: () => void;
|
|
8
|
-
onMouseEnter: (() => void) | undefined;
|
|
9
|
-
onMouseLeave: (() => void) | undefined;
|
|
10
|
-
inputRef: (input: any) => void;
|
|
11
|
-
};
|
|
@@ -29,7 +29,7 @@ export interface LabelPropTypes extends ValidationPropTypes {
|
|
|
29
29
|
/** Whether to show the validation icon */
|
|
30
30
|
useValidationIcon?: boolean;
|
|
31
31
|
/** A string that represents the ID of another form element */
|
|
32
|
-
htmlFor
|
|
32
|
+
htmlFor?: string;
|
|
33
33
|
/** Padding right, integer multiplied by base spacing constant (8) */
|
|
34
34
|
pr?: 1 | 2;
|
|
35
35
|
/** Padding left, integer multiplied by base spacing constant (8) */
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
10
|
-
const counter: PropTypes.Requireable<string | number>;
|
|
11
|
-
const onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
12
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface BadgeProps {
|
|
3
|
+
/** The badge will be added to this element */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** The number rendered in the badge component */
|
|
6
|
+
counter?: string | number;
|
|
7
|
+
/** Callback fired when badge is clicked */
|
|
8
|
+
onClick?: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
13
9
|
}
|
|
14
|
-
|
|
10
|
+
export declare const Badge: ({ children, counter, onClick }: BadgeProps) => JSX.Element;
|
|
11
|
+
export default Badge;
|
|
@@ -1,44 +1,66 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
4
|
+
value: true,
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
exports.default = exports.Badge = void 0;
|
|
9
8
|
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
12
|
var _badge = require("./badge.style");
|
|
13
13
|
|
|
14
|
-
function _interopRequireDefault(obj) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
14
|
+
function _interopRequireDefault(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Badge = ({ children, counter = 0, onClick }) => {
|
|
19
|
+
return /*#__PURE__*/ _react.default.createElement(
|
|
20
|
+
_badge.StyledBadgeWrapper,
|
|
21
|
+
null,
|
|
22
|
+
counter > 0 &&
|
|
23
|
+
/*#__PURE__*/ _react.default.createElement(
|
|
24
|
+
_badge.StyledButton,
|
|
25
|
+
{
|
|
26
|
+
"data-component": "badge",
|
|
27
|
+
buttonType: "secondary",
|
|
28
|
+
onClick: onClick,
|
|
29
|
+
},
|
|
30
|
+
/*#__PURE__*/ _react.default.createElement(_badge.StyledCrossIcon, {
|
|
31
|
+
"data-element": "badge-cross-icon",
|
|
32
|
+
type: "cross",
|
|
33
|
+
}),
|
|
34
|
+
/*#__PURE__*/ _react.default.createElement(
|
|
35
|
+
_badge.StyledCounter,
|
|
36
|
+
{
|
|
37
|
+
"data-element": "badge-counter",
|
|
38
|
+
},
|
|
39
|
+
counter > 99 ? 99 : counter
|
|
40
|
+
)
|
|
41
|
+
),
|
|
42
|
+
children
|
|
43
|
+
);
|
|
31
44
|
};
|
|
32
45
|
|
|
33
46
|
Badge.propTypes = {
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
/**
|
|
48
|
+
* The badge will be added to this element
|
|
49
|
+
*/
|
|
50
|
+
children: _propTypes.default.node,
|
|
51
|
+
/**
|
|
52
|
+
* The number rendered in the badge component
|
|
53
|
+
*/
|
|
54
|
+
counter: _propTypes.default.oneOfType([
|
|
55
|
+
_propTypes.default.number,
|
|
56
|
+
_propTypes.default.string,
|
|
57
|
+
]),
|
|
58
|
+
/**
|
|
59
|
+
* Callback fired when badge is clicked
|
|
60
|
+
*/
|
|
61
|
+
onClick: _propTypes.default.func,
|
|
42
62
|
};
|
|
63
|
+
|
|
64
|
+
exports.Badge = Badge;
|
|
43
65
|
var _default = Badge;
|
|
44
|
-
exports.default = _default;
|
|
66
|
+
exports.default = _default;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import Icon from "../icon";
|
|
3
|
+
declare const StyledBadgeWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
declare const StyledCounter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
declare const StyledButton: import("styled-components").StyledComponent<{
|
|
3
6
|
({ size, subtext, as, children, forwardRef, "aria-label": ariaLabel, disabled, destructive, buttonType: buttonTypeProp, iconType, iconPosition, href, m, px, noWrap, target, rel, iconTooltipMessage, iconTooltipPosition, fullWidth, ...rest }: import("../button").ButtonProps): JSX.Element;
|
|
4
7
|
displayName: string;
|
|
5
8
|
}, any, {}, never>;
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
import Icon from "../icon";
|
|
9
|
+
declare const StyledCrossIcon: import("styled-components").StyledComponent<typeof Icon, any, {}, never>;
|
|
10
|
+
export { StyledBadgeWrapper, StyledButton, StyledCrossIcon, StyledCounter };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./badge";
|
|
1
|
+
export { default } from "./badge.component";
|
|
2
|
+
export type { BadgeProps } from "./badge.component";
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
export const NewValidationContext: React.Context<{}>;
|
|
2
|
-
export default CarbonProvider;
|
|
3
1
|
import React from "react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
theme?:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
declare namespace CarbonProvider {
|
|
10
|
-
namespace propTypes {
|
|
11
|
-
const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
12
|
-
const theme: PropTypes.Requireable<object>;
|
|
13
|
-
const validationRedesignOptIn: PropTypes.Requireable<boolean>;
|
|
14
|
-
}
|
|
2
|
+
import { ThemeObject } from "../../style/themes/base";
|
|
3
|
+
export interface CarbonProviderProps {
|
|
4
|
+
theme?: ThemeObject;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
validationRedesignOptIn?: boolean;
|
|
15
7
|
}
|
|
16
|
-
|
|
8
|
+
export declare const NewValidationContext: React.Context<Pick<CarbonProviderProps, "validationRedesignOptIn">>;
|
|
9
|
+
export declare const CarbonProvider: ({ children, theme, validationRedesignOptIn, }: CarbonProviderProps) => JSX.Element;
|
|
10
|
+
export default CarbonProvider;
|
|
@@ -1,45 +1,140 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
4
|
+
value: true,
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.NewValidationContext = void 0;
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
exports.default = exports.CarbonProvider = exports.NewValidationContext = void 0;
|
|
9
8
|
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
12
|
var _styledComponents = require("styled-components");
|
|
13
13
|
|
|
14
14
|
var _mint = _interopRequireDefault(require("../../style/themes/mint"));
|
|
15
15
|
|
|
16
|
-
var _carbonScopedTokensProvider = _interopRequireDefault(
|
|
16
|
+
var _carbonScopedTokensProvider = _interopRequireDefault(
|
|
17
|
+
require("../../style/design-tokens/carbon-scoped-tokens-provider")
|
|
18
|
+
);
|
|
17
19
|
|
|
18
|
-
function _interopRequireDefault(obj) {
|
|
20
|
+
function _interopRequireDefault(obj) {
|
|
21
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
22
|
+
}
|
|
19
23
|
|
|
20
|
-
function _getRequireWildcardCache() {
|
|
24
|
+
function _getRequireWildcardCache() {
|
|
25
|
+
if (typeof WeakMap !== "function") return null;
|
|
26
|
+
var cache = new WeakMap();
|
|
27
|
+
_getRequireWildcardCache = function () {
|
|
28
|
+
return cache;
|
|
29
|
+
};
|
|
30
|
+
return cache;
|
|
31
|
+
}
|
|
21
32
|
|
|
22
|
-
function _interopRequireWildcard(obj) {
|
|
33
|
+
function _interopRequireWildcard(obj) {
|
|
34
|
+
if (obj && obj.__esModule) {
|
|
35
|
+
return obj;
|
|
36
|
+
}
|
|
37
|
+
if (obj === null || (typeof obj !== "object" && typeof obj !== "function")) {
|
|
38
|
+
return { default: obj };
|
|
39
|
+
}
|
|
40
|
+
var cache = _getRequireWildcardCache();
|
|
41
|
+
if (cache && cache.has(obj)) {
|
|
42
|
+
return cache.get(obj);
|
|
43
|
+
}
|
|
44
|
+
var newObj = {};
|
|
45
|
+
var hasPropertyDescriptor =
|
|
46
|
+
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
47
|
+
for (var key in obj) {
|
|
48
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
49
|
+
var desc = hasPropertyDescriptor
|
|
50
|
+
? Object.getOwnPropertyDescriptor(obj, key)
|
|
51
|
+
: null;
|
|
52
|
+
if (desc && (desc.get || desc.set)) {
|
|
53
|
+
Object.defineProperty(newObj, key, desc);
|
|
54
|
+
} else {
|
|
55
|
+
newObj[key] = obj[key];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
newObj.default = obj;
|
|
60
|
+
if (cache) {
|
|
61
|
+
cache.set(obj, newObj);
|
|
62
|
+
}
|
|
63
|
+
return newObj;
|
|
64
|
+
}
|
|
23
65
|
|
|
24
|
-
const NewValidationContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
66
|
+
const NewValidationContext = /*#__PURE__*/ (0, _react.createContext)({});
|
|
25
67
|
exports.NewValidationContext = NewValidationContext;
|
|
26
68
|
|
|
27
69
|
const CarbonProvider = ({
|
|
28
70
|
children,
|
|
29
71
|
theme = _mint.default,
|
|
30
|
-
validationRedesignOptIn = false
|
|
31
|
-
}) =>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
72
|
+
validationRedesignOptIn = false,
|
|
73
|
+
}) =>
|
|
74
|
+
/*#__PURE__*/ _react.default.createElement(
|
|
75
|
+
_styledComponents.ThemeProvider,
|
|
76
|
+
{
|
|
77
|
+
theme: theme,
|
|
78
|
+
},
|
|
79
|
+
/*#__PURE__*/ _react.default.createElement(
|
|
80
|
+
_carbonScopedTokensProvider.default,
|
|
81
|
+
null,
|
|
82
|
+
/*#__PURE__*/ _react.default.createElement(
|
|
83
|
+
NewValidationContext.Provider,
|
|
84
|
+
{
|
|
85
|
+
value: {
|
|
86
|
+
validationRedesignOptIn,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
children
|
|
90
|
+
)
|
|
91
|
+
)
|
|
92
|
+
);
|
|
38
93
|
|
|
39
94
|
CarbonProvider.propTypes = {
|
|
40
|
-
children: _propTypes.default.node
|
|
41
|
-
theme: _propTypes.default.
|
|
42
|
-
|
|
95
|
+
children: _propTypes.default.node,
|
|
96
|
+
theme: _propTypes.default.shape({
|
|
97
|
+
colors: _propTypes.default.shape({
|
|
98
|
+
destructive: _propTypes.default.shape({
|
|
99
|
+
hover: _propTypes.default.string.isRequired,
|
|
100
|
+
}).isRequired,
|
|
101
|
+
error: _propTypes.default.string.isRequired,
|
|
102
|
+
focus: _propTypes.default.string.isRequired,
|
|
103
|
+
info: _propTypes.default.string.isRequired,
|
|
104
|
+
loadingBarBackground: _propTypes.default.string.isRequired,
|
|
105
|
+
placeholder: _propTypes.default.string.isRequired,
|
|
106
|
+
primary: _propTypes.default.string.isRequired,
|
|
107
|
+
secondary: _propTypes.default.string.isRequired,
|
|
108
|
+
tertiary: _propTypes.default.string.isRequired,
|
|
109
|
+
warning: _propTypes.default.string.isRequired,
|
|
110
|
+
warningText: _propTypes.default.string.isRequired,
|
|
111
|
+
white: _propTypes.default.oneOf(["#FFFFFF"]).isRequired,
|
|
112
|
+
}).isRequired,
|
|
113
|
+
disabled: _propTypes.default.shape({
|
|
114
|
+
background: _propTypes.default.string.isRequired,
|
|
115
|
+
}).isRequired,
|
|
116
|
+
name: _propTypes.default.string.isRequired,
|
|
117
|
+
palette: _propTypes.default.shape({
|
|
118
|
+
blackOpacity: _propTypes.default.func.isRequired,
|
|
119
|
+
whiteOpacity: _propTypes.default.func.isRequired,
|
|
120
|
+
}).isRequired,
|
|
121
|
+
space: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
122
|
+
spacing: _propTypes.default.number.isRequired,
|
|
123
|
+
zIndex: _propTypes.default.shape({
|
|
124
|
+
aboveAll: _propTypes.default.number.isRequired,
|
|
125
|
+
fullScreenModal: _propTypes.default.number.isRequired,
|
|
126
|
+
header: _propTypes.default.number.isRequired,
|
|
127
|
+
modal: _propTypes.default.number.isRequired,
|
|
128
|
+
nav: _propTypes.default.number.isRequired,
|
|
129
|
+
notification: _propTypes.default.number.isRequired,
|
|
130
|
+
overlay: _propTypes.default.number.isRequired,
|
|
131
|
+
popover: _propTypes.default.number.isRequired,
|
|
132
|
+
smallOverlay: _propTypes.default.number.isRequired,
|
|
133
|
+
}).isRequired,
|
|
134
|
+
}),
|
|
135
|
+
validationRedesignOptIn: _propTypes.default.bool,
|
|
43
136
|
};
|
|
137
|
+
|
|
138
|
+
exports.CarbonProvider = CarbonProvider;
|
|
44
139
|
var _default = CarbonProvider;
|
|
45
|
-
exports.default = _default;
|
|
140
|
+
exports.default = _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./carbon-provider";
|
|
1
|
+
export { default } from "./carbon-provider.component";
|
|
2
|
+
export type { CarbonProviderProps } from "./carbon-provider.component";
|
|
@@ -11,9 +11,9 @@ var _styledSystem = require("styled-system");
|
|
|
11
11
|
|
|
12
12
|
var _date = _interopRequireDefault(require("../date/date.style"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _label = require("../../__internal__/label/label.style");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _inputPresentation = require("../../__internal__/input/input-presentation.style");
|
|
17
17
|
|
|
18
18
|
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
19
19
|
|
|
@@ -34,11 +34,11 @@ const StyledDateRange = _styledComponents.default.div`
|
|
|
34
34
|
margin-right: var(--spacing300);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
${
|
|
37
|
+
${_label.StyledLabelContainer} {
|
|
38
38
|
width: auto;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
${
|
|
41
|
+
${_inputPresentation.StyledInputPresentationContainer} {
|
|
42
42
|
flex: auto;
|
|
43
43
|
}
|
|
44
44
|
`;
|
|
@@ -211,7 +211,8 @@ const Decimal = ({
|
|
|
211
211
|
onChange: handleOnChange,
|
|
212
212
|
onBlur: handleOnBlur,
|
|
213
213
|
value: stateValue,
|
|
214
|
-
"data-component": "decimal"
|
|
214
|
+
"data-component": "decimal",
|
|
215
|
+
id: id
|
|
215
216
|
}, rest)), /*#__PURE__*/_react.default.createElement("input", {
|
|
216
217
|
name: name,
|
|
217
218
|
value: toStandardDecimal(stateValue),
|
|
@@ -7,9 +7,8 @@ export const StyledHeaderHelp: import("styled-components").StyledComponent<typeo
|
|
|
7
7
|
export const StyledHeadingTitle: import("styled-components").StyledComponent<typeof Typography, any, {}, never>;
|
|
8
8
|
export const StyledDivider: import("styled-components").StyledComponent<({ adaptiveMxBreakpoint, ml, mr, ...rest }: import("../hr/hr.component").HrProps) => JSX.Element, any, {}, never>;
|
|
9
9
|
export const StyledHeaderContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
-
export const StyledHeadingBackButton: import("styled-components").StyledComponent<
|
|
10
|
+
export const StyledHeadingBackButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../link/link.component").LinkProps & import("react").RefAttributes<HTMLLinkElement | HTMLButtonElement>>, any, {}, never>;
|
|
11
11
|
export const StyledHeadingPills: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
12
12
|
import Icon from "../icon";
|
|
13
13
|
import Help from "../help";
|
|
14
14
|
import Typography from "../typography";
|
|
15
|
-
import Link from "../link";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./inline-inputs";
|
|
1
|
+
export { default, InlineInputsContext } from "./inline-inputs.component";
|
|
2
|
+
export type { InlineInputsProps } from "./inline-inputs.component";
|
|
@@ -9,7 +9,15 @@ Object.defineProperty(exports, "default", {
|
|
|
9
9
|
return _inlineInputs.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "InlineInputsContext", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _inlineInputs.InlineInputsContext;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _inlineInputs = _interopRequireWildcard(require("./inline-inputs.component"));
|
|
12
20
|
|
|
13
|
-
|
|
21
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
14
22
|
|
|
15
|
-
function
|
|
23
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
export const InlineInputsContext: React.Context<{}>;
|
|
2
|
-
export default InlineInputs;
|
|
3
1
|
import React from "react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
interface InlineInputsContextProps {
|
|
3
|
+
ariaLabelledBy?: string;
|
|
4
|
+
}
|
|
5
|
+
declare type GutterOptions = "none" | "extra-small" | "small" | "medium-small" | "medium" | "medium-large" | "large" | "extra-large";
|
|
6
|
+
export interface InlineInputsProps {
|
|
7
|
+
/** Children elements */
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
/** [Legacy prop] A custom class name for the component. */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Gutter prop gets passed down to Row component if false gutter value is "none" */
|
|
12
|
+
gutter?: GutterOptions;
|
|
13
|
+
/** The id of the corresponding input control for the label */
|
|
14
|
+
htmlFor?: string;
|
|
15
|
+
/** Width of the inline inputs container in percentage */
|
|
16
|
+
inputWidth?: number;
|
|
17
|
+
/** Defines the label text for the heading. */
|
|
18
|
+
label?: string;
|
|
19
|
+
/** Width of a label in percentage */
|
|
20
|
+
labelWidth?: number;
|
|
23
21
|
}
|
|
24
|
-
|
|
22
|
+
export declare const InlineInputsContext: React.Context<InlineInputsContextProps>;
|
|
23
|
+
declare const InlineInputs: {
|
|
24
|
+
({ label, htmlFor, children, className, gutter, inputWidth, labelWidth, }: InlineInputsProps): JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
export default InlineInputs;
|