carbon-react 110.1.2 → 110.2.1
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__/character-count/character-count.component.d.ts +8 -25
- package/esm/__internal__/character-count/character-count.component.js +12 -18
- package/esm/__internal__/character-count/character-count.style.d.ts +3 -1
- package/esm/__internal__/character-count/character-count.style.js +4 -0
- package/esm/__internal__/form-field/form-field.component.d.ts +5 -1
- package/esm/__internal__/form-field/form-field.component.js +8 -5
- package/esm/__internal__/input/index.d.ts +1 -1
- package/esm/__internal__/utils/helpers/tags/tags.d.ts +5 -2
- package/esm/__spec_helper__/test-utils.d.ts +3 -2
- package/esm/__spec_helper__/test-utils.js +17 -1
- package/esm/components/box/box.component.d.ts +4 -2
- package/esm/components/box/box.component.js +2 -1
- package/esm/components/dismissible-box/dismissible-box.component.js +398 -0
- package/esm/components/numeral-date/numeral-date-context.d.ts +6 -0
- package/esm/components/portal/portal.d.ts +15 -12
- package/esm/components/portal/portal.js +3 -13
- package/esm/components/select/multi-select/multi-select.component.js +1 -1
- package/esm/components/select/select-list/select-list.component.js +20 -11
- package/esm/components/textarea/textarea.component.js +6 -27
- package/esm/components/textarea/textarea.d.ts +2 -1
- package/esm/components/textbox/__internal__/prefix.style.d.ts +2 -0
- package/esm/components/textbox/index.d.ts +2 -1
- package/esm/components/textbox/index.js +1 -1
- package/esm/components/textbox/textbox.component.d.ts +92 -0
- package/esm/components/textbox/textbox.component.js +533 -197
- package/esm/components/textbox/textbox.style.d.ts +5 -0
- package/esm/components/textbox/textbox.style.js +0 -12
- package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +1 -1
- package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.js +7 -6
- package/esm/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +6 -5
- package/esm/style/utils/filter-out-position-props.d.ts +3 -0
- package/esm/style/utils/filter-out-position-props.js +5 -0
- package/lib/__internal__/character-count/character-count.component.d.ts +8 -25
- package/lib/__internal__/character-count/character-count.component.js +13 -23
- package/lib/__internal__/character-count/character-count.style.d.ts +3 -1
- package/lib/__internal__/character-count/character-count.style.js +7 -0
- package/lib/__internal__/form-field/form-field.component.d.ts +5 -1
- package/lib/__internal__/form-field/form-field.component.js +8 -5
- package/lib/__internal__/input/index.d.ts +1 -1
- package/lib/__internal__/utils/helpers/tags/tags.d.ts +5 -2
- package/lib/__spec_helper__/test-utils.d.ts +3 -2
- package/lib/__spec_helper__/test-utils.js +20 -2
- package/lib/components/box/box.component.d.ts +4 -2
- package/lib/components/box/box.component.js +1 -0
- package/lib/components/dismissible-box/dismissible-box.component.js +398 -0
- package/lib/components/numeral-date/numeral-date-context.d.ts +6 -0
- package/lib/components/portal/portal.d.ts +15 -12
- package/lib/components/portal/portal.js +3 -14
- package/lib/components/select/multi-select/multi-select.component.js +1 -1
- package/lib/components/select/select-list/select-list.component.js +20 -11
- package/lib/components/textarea/textarea.component.js +6 -27
- package/lib/components/textarea/textarea.d.ts +2 -1
- package/lib/components/textbox/__internal__/prefix.style.d.ts +2 -0
- package/lib/components/textbox/index.d.ts +2 -1
- package/lib/components/textbox/index.js +2 -10
- package/lib/components/textbox/textbox.component.d.ts +92 -0
- package/lib/components/textbox/textbox.component.js +534 -201
- package/lib/components/textbox/textbox.style.d.ts +5 -0
- package/lib/components/textbox/textbox.style.js +1 -16
- package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +1 -1
- package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.js +7 -6
- package/lib/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +6 -5
- package/lib/style/utils/filter-out-position-props.d.ts +3 -0
- package/lib/style/utils/filter-out-position-props.js +18 -0
- package/package.json +1 -1
- package/esm/components/textbox/textbox.d.ts +0 -125
- package/lib/components/textbox/textbox.d.ts +0 -125
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default _default;
|
|
8
|
-
import React from "react";
|
|
9
|
-
export function CharacterCount({ value, limit, theme, ...props }: {
|
|
10
|
-
[x: string]: any;
|
|
11
|
-
value: any;
|
|
12
|
-
limit: any;
|
|
13
|
-
theme: any;
|
|
14
|
-
}): JSX.Element;
|
|
15
|
-
export namespace CharacterCount {
|
|
16
|
-
namespace propTypes {
|
|
17
|
-
const value: PropTypes.Validator<string>;
|
|
18
|
-
const limit: PropTypes.Validator<string>;
|
|
19
|
-
const theme: PropTypes.Requireable<object>;
|
|
20
|
-
}
|
|
21
|
-
namespace defaultProps {
|
|
22
|
-
export { baseTheme as theme };
|
|
23
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface CharacterCountProps {
|
|
3
|
+
value: string;
|
|
4
|
+
limit: string;
|
|
5
|
+
isOverLimit: boolean;
|
|
6
|
+
"data-element"?: string;
|
|
24
7
|
}
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
declare const CharacterCount: ({ value, limit, isOverLimit, "data-element": dataElement, }: CharacterCountProps) => JSX.Element;
|
|
9
|
+
export default CharacterCount;
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
import React from "react";
|
|
4
2
|
import PropTypes from "prop-types";
|
|
5
|
-
import { withTheme } from "styled-components";
|
|
6
|
-
import baseTheme from "../../style/themes/base";
|
|
7
3
|
import StyledCharacterCount from "./character-count.style";
|
|
8
4
|
|
|
9
5
|
const CharacterCount = ({
|
|
10
6
|
value,
|
|
11
7
|
limit,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}) => /*#__PURE__*/React.createElement(StyledCharacterCount,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
isOverLimit,
|
|
9
|
+
"data-element": dataElement
|
|
10
|
+
}) => /*#__PURE__*/React.createElement(StyledCharacterCount, {
|
|
11
|
+
"aria-live": "polite",
|
|
12
|
+
isOverLimit: isOverLimit,
|
|
13
|
+
"data-element": dataElement
|
|
14
|
+
}, `${value}/${limit}`);
|
|
18
15
|
|
|
19
16
|
CharacterCount.propTypes = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
CharacterCount.defaultProps = {
|
|
25
|
-
theme: baseTheme
|
|
17
|
+
"data-element": PropTypes.string,
|
|
18
|
+
"isOverLimit": PropTypes.bool.isRequired,
|
|
19
|
+
"limit": PropTypes.string.isRequired,
|
|
20
|
+
"value": PropTypes.string.isRequired
|
|
26
21
|
};
|
|
27
|
-
export default
|
|
28
|
-
export { CharacterCount };
|
|
22
|
+
export default CharacterCount;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
declare const StyledCharacterCount: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
isOverLimit: boolean;
|
|
3
|
+
}, never>;
|
|
1
4
|
export default StyledCharacterCount;
|
|
2
|
-
declare const StyledCharacterCount: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
+
import baseTheme from "../../style/themes/base";
|
|
2
3
|
const StyledCharacterCount = styled.div`
|
|
3
4
|
text-align: right;
|
|
4
5
|
font-size: 12px;
|
|
@@ -14,4 +15,7 @@ const StyledCharacterCount = styled.div`
|
|
|
14
15
|
font-weight: 700;
|
|
15
16
|
`}
|
|
16
17
|
`;
|
|
18
|
+
StyledCharacterCount.defaultProps = {
|
|
19
|
+
theme: baseTheme
|
|
20
|
+
};
|
|
17
21
|
export default StyledCharacterCount;
|
|
@@ -32,6 +32,10 @@ interface CommonFormFieldProps extends MarginProps, ValidationProps {
|
|
|
32
32
|
reverse?: boolean;
|
|
33
33
|
/** Id of the validation icon */
|
|
34
34
|
validationIconId?: string;
|
|
35
|
+
/**
|
|
36
|
+
* @private @ignore
|
|
37
|
+
* Flag dedicating if latest validation design should be used */
|
|
38
|
+
validationRedesignOptIn?: boolean;
|
|
35
39
|
}
|
|
36
40
|
export interface FormFieldProps extends CommonFormFieldProps, TagProps {
|
|
37
41
|
/** Breakpoint for adaptive label (inline labels change to top aligned). Enables the adaptive behaviour when set */
|
|
@@ -53,7 +57,7 @@ export interface FormFieldProps extends CommonFormFieldProps, TagProps {
|
|
|
53
57
|
useValidationIcon?: boolean;
|
|
54
58
|
}
|
|
55
59
|
declare const FormField: {
|
|
56
|
-
({ children, disabled, fieldHelp: fieldHelpContent, fieldHelpInline, error, warning, info, tooltipId, fieldHelpId, label, labelId, labelAlign, labelHelp, labelHelpIcon, labelInline, labelSpacing, labelWidth, id, reverse, isOptional, useValidationIcon, adaptiveLabelBreakpoint, isRequired, validationIconId, ...rest }: FormFieldProps): JSX.Element;
|
|
60
|
+
({ children, "data-component": dataComponent, disabled, fieldHelp: fieldHelpContent, fieldHelpInline, error, warning, info, tooltipId, fieldHelpId, label, labelId, labelAlign, labelHelp, labelHelpIcon, labelInline, labelSpacing, labelWidth, id, reverse, isOptional, useValidationIcon, adaptiveLabelBreakpoint, isRequired, validationIconId, validationRedesignOptIn, ...rest }: FormFieldProps): JSX.Element;
|
|
57
61
|
displayName: string;
|
|
58
62
|
};
|
|
59
63
|
export default FormField;
|
|
@@ -13,6 +13,7 @@ import useIsAboveBreakpoint from "../../hooks/__internal__/useIsAboveBreakpoint"
|
|
|
13
13
|
|
|
14
14
|
const FormField = ({
|
|
15
15
|
children,
|
|
16
|
+
"data-component": dataComponent,
|
|
16
17
|
disabled,
|
|
17
18
|
fieldHelp: fieldHelpContent,
|
|
18
19
|
fieldHelpInline,
|
|
@@ -36,6 +37,7 @@ const FormField = ({
|
|
|
36
37
|
adaptiveLabelBreakpoint,
|
|
37
38
|
isRequired,
|
|
38
39
|
validationIconId,
|
|
40
|
+
validationRedesignOptIn,
|
|
39
41
|
...rest
|
|
40
42
|
}) => {
|
|
41
43
|
const invalidValidationProp = useMemo(() => {
|
|
@@ -71,15 +73,15 @@ const FormField = ({
|
|
|
71
73
|
labelWidth: labelWidth,
|
|
72
74
|
id: fieldHelpId
|
|
73
75
|
}, fieldHelpContent) : null;
|
|
74
|
-
return /*#__PURE__*/React.createElement(FormFieldStyle, _extends({}, tagComponent(
|
|
76
|
+
return /*#__PURE__*/React.createElement(FormFieldStyle, _extends({}, tagComponent(dataComponent, rest), marginProps), /*#__PURE__*/React.createElement(FieldLineStyle, {
|
|
75
77
|
inline: inlineLabel
|
|
76
78
|
}, reverse && children, label && /*#__PURE__*/React.createElement(Label, {
|
|
77
79
|
labelId: labelId,
|
|
78
80
|
align: labelAlign,
|
|
79
81
|
disabled: disabled,
|
|
80
|
-
error: !
|
|
81
|
-
warning: !
|
|
82
|
-
info: !
|
|
82
|
+
error: !validationRedesignOptIn && error,
|
|
83
|
+
warning: !validationRedesignOptIn && warning,
|
|
84
|
+
info: !validationRedesignOptIn && info,
|
|
83
85
|
help: labelHelp,
|
|
84
86
|
tooltipId: tooltipId,
|
|
85
87
|
htmlFor: id,
|
|
@@ -98,7 +100,7 @@ const FormField = ({
|
|
|
98
100
|
FormField.propTypes = {
|
|
99
101
|
"adaptiveLabelBreakpoint": PropTypes.number,
|
|
100
102
|
"children": PropTypes.node,
|
|
101
|
-
"data-component": PropTypes.string
|
|
103
|
+
"data-component": PropTypes.string,
|
|
102
104
|
"data-element": PropTypes.string,
|
|
103
105
|
"data-role": PropTypes.string,
|
|
104
106
|
"disabled": PropTypes.bool,
|
|
@@ -276,6 +278,7 @@ FormField.propTypes = {
|
|
|
276
278
|
"tooltipId": PropTypes.string,
|
|
277
279
|
"useValidationIcon": PropTypes.bool,
|
|
278
280
|
"validationIconId": PropTypes.string,
|
|
281
|
+
"validationRedesignOptIn": PropTypes.bool,
|
|
279
282
|
"warning": PropTypes.oneOfType([PropTypes.string, PropTypes.bool])
|
|
280
283
|
};
|
|
281
284
|
FormField.displayName = "FormField";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Input from "./input.component";
|
|
2
2
|
import InputPresentation from "./input-presentation.component";
|
|
3
|
-
export type { InputProps } from "./input.component";
|
|
3
|
+
export type { InputProps, CommonInputProps } from "./input.component";
|
|
4
4
|
export { Input, InputPresentation };
|
|
5
5
|
export default Input;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
interface DataProps {
|
|
2
|
+
/** Identifier used for testing purposes, applied to the root element of the component. */
|
|
2
3
|
"data-element"?: string;
|
|
4
|
+
/** Identifier used for testing purposes, applied to the root element of the component. */
|
|
3
5
|
"data-role"?: string;
|
|
4
6
|
[restKeys: string]: any;
|
|
5
7
|
}
|
|
6
8
|
export interface TagProps extends DataProps {
|
|
7
|
-
|
|
9
|
+
/** Identifier used for testing purposes, applied to the root element of the component. */
|
|
10
|
+
"data-component"?: string;
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
10
13
|
* Builds props object containing top level data tags
|
|
11
14
|
*/
|
|
12
|
-
declare function tagComponent(componentName: string, props: DataProps): TagProps;
|
|
15
|
+
declare function tagComponent(componentName: string | undefined, props: DataProps): TagProps;
|
|
13
16
|
export default tagComponent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ReactWrapper, ShallowWrapper } from "enzyme";
|
|
3
|
-
import { LayoutProps, FlexboxProps, BackgroundProps } from "styled-system";
|
|
3
|
+
import { LayoutProps, FlexboxProps, BackgroundProps, PositionProps } from "styled-system";
|
|
4
4
|
import { ReactTestRendererJSON } from "react-test-renderer";
|
|
5
5
|
import { mockMatchMedia } from "./mock-match-media";
|
|
6
6
|
declare const toCSSCase: (str: string) => string;
|
|
@@ -47,5 +47,6 @@ declare const testStyledSystemWidth: (component: (widthProperties?: {
|
|
|
47
47
|
declare const testStyledSystemLayout: (component: (layoutProperties?: LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined) => JSX.Element, styleContainer?: ((wrapper: ReactWrapper) => ReactWrapper) | undefined) => void;
|
|
48
48
|
declare const testStyledSystemFlexBox: (component: (flexboxProperties?: FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined) => JSX.Element, styleContainer?: ((wrapper: ReactWrapper) => ReactWrapper) | undefined) => void;
|
|
49
49
|
declare const testStyledSystemBackground: (component: (backgroundProperties?: BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>> | undefined) => JSX.Element, styleContainer?: ((wrapper: ReactWrapper) => ReactWrapper) | undefined) => void;
|
|
50
|
+
declare const testStyledSystemPosition: (component: (positionProperties?: PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined) => JSX.Element, styleContainer?: ((wrapper: ReactWrapper) => ReactWrapper) | undefined) => void;
|
|
50
51
|
declare const expectConsoleOutput: (message: string, type?: "warn" | "error") => () => void;
|
|
51
|
-
export { assertStyleMatch, toCSSCase, hoverList, selectedItemOf, childrenFrom, makeArrayKeys, keyboard, assertKeyboardTraversal, assertHoverTraversal, listFrom, click, simulate, carbonThemesJestTable, mockMatchMedia, testStyledSystemSpacing, testStyledSystemMargin, testStyledSystemPadding, testStyledSystemColor, testStyledSystemWidth, testStyledSystemLayout, testStyledSystemFlexBox, testStyledSystemBackground, expectConsoleOutput, };
|
|
52
|
+
export { assertStyleMatch, toCSSCase, hoverList, selectedItemOf, childrenFrom, makeArrayKeys, keyboard, assertKeyboardTraversal, assertHoverTraversal, listFrom, click, simulate, carbonThemesJestTable, mockMatchMedia, testStyledSystemSpacing, testStyledSystemMargin, testStyledSystemPadding, testStyledSystemColor, testStyledSystemWidth, testStyledSystemLayout, testStyledSystemFlexBox, testStyledSystemBackground, testStyledSystemPosition, expectConsoleOutput, };
|
|
@@ -109,6 +109,7 @@ const widthProps = ["width", "width", "200px"];
|
|
|
109
109
|
const layoutProps = [widthProps, ["height", "height", "200px"], ["minWidth", "min-width", "120px"], ["maxWidth", "max-width", "120px"], ["minHeight", "min-height", "120px"], ["maxHeight", "max-height", "120px"], ["size", "width", "120px"], ["size", "height", "120px"], ["display", "display", "inline-block"], ["verticalAlign", "vertical-align", "baseline"], ["overflow", "overflow", "hidden"], ["overflowX", "overflow-x", "hidden"], ["overflowY", "overflow-y", "hidden"]];
|
|
110
110
|
const flexBoxProps = [["alignItems", "alignItems", "center"], ["alignContent", "alignContent", "center"], ["justifyItems", "justifyItems", "center"], ["justifyContent", "justifyContent", "center"], ["flexWrap", "flexWrap", "wrap"], ["flexDirection", "flexDirection", "row-reverse"], ["flex", "flex", "1"], ["flexGrow", "flexGrow", "1"], ["flexShrink", "flexShrink", "1"], ["flexBasis", "flexBasis", "100px"], ["justifySelf", "justifySelf", "center"], ["alignSelf", "alignSelf", "center"], ["order", "order", "1"]];
|
|
111
111
|
const backgroundProps = [["background", "background", "lightblue url('foo.jpg') no-repeat fixed center"], ["backgroundImage", "background-image", "url(foo.jpg)"], ["backgroundSize", "background-size", "center"], ["backgroundRepeat", "background-repeat", "no-repeat"]];
|
|
112
|
+
const positionProps = [["top", "0px"], ["bottom", "0px"], ["right", "0px"], ["left", "0px"], ["position", "fixed"], ["position", "sticky"], ["position", "absolute"], ["position", "static"], ["position", "relative"]];
|
|
112
113
|
export const getDefaultValue = value => {
|
|
113
114
|
const spaceArrayLength = space.length - 1;
|
|
114
115
|
if (value === undefined) return value;
|
|
@@ -302,6 +303,21 @@ const testStyledSystemBackground = (component, styleContainer) => {
|
|
|
302
303
|
}, styleContainer ? styleContainer(wrapper) : wrapper);
|
|
303
304
|
});
|
|
304
305
|
});
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
const testStyledSystemPosition = (component, styleContainer) => {
|
|
309
|
+
describe.each(positionProps)('when a prop is specified using the "%s" styled system props', (styledSystemProp, value) => {
|
|
310
|
+
it(`then ${styledSystemProp} should have been set correctly`, () => {
|
|
311
|
+
const props = {
|
|
312
|
+
[styledSystemProp]: value
|
|
313
|
+
};
|
|
314
|
+
const wrapper = mount(component({ ...props
|
|
315
|
+
}));
|
|
316
|
+
assertStyleMatch({
|
|
317
|
+
[styledSystemProp]: value
|
|
318
|
+
}, styleContainer ? styleContainer(wrapper) : wrapper);
|
|
319
|
+
});
|
|
320
|
+
});
|
|
305
321
|
}; // this util will catch that a console output occurred without polluting the output when running the unit tests
|
|
306
322
|
|
|
307
323
|
|
|
@@ -335,4 +351,4 @@ const expectConsoleOutput = (message, type = "error") => {
|
|
|
335
351
|
};
|
|
336
352
|
};
|
|
337
353
|
|
|
338
|
-
export { assertStyleMatch, toCSSCase, hoverList, selectedItemOf, childrenFrom, makeArrayKeys, keyboard, assertKeyboardTraversal, assertHoverTraversal, listFrom, click, simulate, carbonThemesJestTable, mockMatchMedia, testStyledSystemSpacing, testStyledSystemMargin, testStyledSystemPadding, testStyledSystemColor, testStyledSystemWidth, testStyledSystemLayout, testStyledSystemFlexBox, testStyledSystemBackground, expectConsoleOutput };
|
|
354
|
+
export { assertStyleMatch, toCSSCase, hoverList, selectedItemOf, childrenFrom, makeArrayKeys, keyboard, assertKeyboardTraversal, assertHoverTraversal, listFrom, click, simulate, carbonThemesJestTable, mockMatchMedia, testStyledSystemSpacing, testStyledSystemMargin, testStyledSystemPadding, testStyledSystemColor, testStyledSystemWidth, testStyledSystemLayout, testStyledSystemFlexBox, testStyledSystemBackground, testStyledSystemPosition, expectConsoleOutput };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { SpaceProps, LayoutProps, FlexboxProps, ColorProps } from "styled-system";
|
|
2
|
+
import { SpaceProps, LayoutProps, FlexboxProps, ColorProps, PositionProps } from "styled-system";
|
|
3
3
|
export declare type OverflowWrap = "break-word" | "anywhere";
|
|
4
4
|
export declare type ScrollVariant = "light" | "dark";
|
|
5
5
|
export declare type BoxSizing = "content-box" | "border-box";
|
|
6
|
-
export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorProps {
|
|
6
|
+
export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorProps, Omit<PositionProps, "zIndex"> {
|
|
7
7
|
as?: keyof JSX.IntrinsicElements | React.ComponentType<any>;
|
|
8
8
|
/** String to set Box content break strategy. Note "anywhere" is not supported in Safari */
|
|
9
9
|
overflowWrap?: OverflowWrap;
|
|
@@ -11,6 +11,8 @@ export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorPr
|
|
|
11
11
|
scrollVariant?: ScrollVariant;
|
|
12
12
|
/** set the box-sizing attribute of the Box component */
|
|
13
13
|
boxSizing?: BoxSizing;
|
|
14
|
+
/** Allows a tabindex to be specified */
|
|
15
|
+
tabIndex?: number | string;
|
|
14
16
|
}
|
|
15
17
|
declare const Box: import("styled-components").StyledComponent<"div", any, BoxProps, never>;
|
|
16
18
|
export default Box;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import { space, layout, flexbox } from "styled-system";
|
|
2
|
+
import { space, layout, flexbox, position } from "styled-system";
|
|
3
3
|
import BaseTheme from "../../style/themes/base";
|
|
4
4
|
import styledColor from "../../style/utils/color";
|
|
5
5
|
import boxConfig from "./box.config";
|
|
@@ -7,6 +7,7 @@ const Box = styled.div`
|
|
|
7
7
|
${space}
|
|
8
8
|
${layout}
|
|
9
9
|
${flexbox}
|
|
10
|
+
${position}
|
|
10
11
|
${({
|
|
11
12
|
color,
|
|
12
13
|
bg,
|