carbon-react 142.3.1 → 142.4.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__/checkable-input/checkable-input.component.d.ts +3 -3
- package/esm/__internal__/checkable-input/checkable-input.component.js +6 -2
- package/esm/components/checkbox/checkbox-group/checkbox-group.component.d.ts +3 -3
- package/esm/components/checkbox/checkbox-group/checkbox-group.component.js +2 -6
- package/esm/components/checkbox/checkbox.component.d.ts +2 -2
- package/esm/components/checkbox/checkbox.component.js +12 -10
- package/esm/components/checkbox/checkbox.style.js +4 -3
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.component.d.ts +3 -2
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.component.js +7 -2
- package/esm/components/flat-table/flat-table-header/flat-table-header.component.d.ts +3 -2
- package/esm/components/flat-table/flat-table-header/flat-table-header.component.js +9 -3
- package/esm/components/flat-table/flat-table-row/flat-table-row.component.js +2 -0
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.component.d.ts +1 -1
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.component.js +10 -9
- package/esm/components/grouped-character/grouped-character.component.js +1 -1
- package/esm/components/loader-star/index.d.ts +2 -0
- package/esm/components/loader-star/index.js +1 -0
- package/esm/components/loader-star/internal/star.component.d.ts +9 -0
- package/esm/components/loader-star/internal/star.component.js +40 -0
- package/esm/components/loader-star/internal/star.style.d.ts +4 -0
- package/esm/components/loader-star/internal/star.style.js +126 -0
- package/esm/components/loader-star/loader-star.component.d.ts +14 -0
- package/esm/components/loader-star/loader-star.component.js +46 -0
- package/esm/components/loader-star/loader-star.style.d.ts +8 -0
- package/esm/components/loader-star/loader-star.style.js +15 -0
- package/esm/components/radio-button/radio-button-group/radio-button-group.component.d.ts +2 -2
- package/esm/components/radio-button/radio-button-group/radio-button-group.component.js +1 -8
- package/esm/components/radio-button/radio-button.component.d.ts +2 -2
- package/esm/components/radio-button/radio-button.component.js +12 -16
- package/esm/locales/de-de.js +3 -0
- package/esm/locales/en-gb.js +3 -0
- package/esm/locales/es-es.js +3 -0
- package/esm/locales/fr-ca.js +3 -0
- package/esm/locales/fr-fr.js +3 -0
- package/esm/locales/locale.d.ts +3 -0
- package/lib/__internal__/checkable-input/checkable-input.component.d.ts +3 -3
- package/lib/__internal__/checkable-input/checkable-input.component.js +5 -1
- package/lib/components/checkbox/checkbox-group/checkbox-group.component.d.ts +3 -3
- package/lib/components/checkbox/checkbox-group/checkbox-group.component.js +2 -6
- package/lib/components/checkbox/checkbox.component.d.ts +2 -2
- package/lib/components/checkbox/checkbox.component.js +12 -10
- package/lib/components/checkbox/checkbox.style.js +4 -3
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.component.d.ts +3 -2
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.component.js +7 -2
- package/lib/components/flat-table/flat-table-header/flat-table-header.component.d.ts +3 -2
- package/lib/components/flat-table/flat-table-header/flat-table-header.component.js +9 -3
- package/lib/components/flat-table/flat-table-row/flat-table-row.component.js +2 -0
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.component.d.ts +1 -1
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.component.js +10 -9
- package/lib/components/grouped-character/grouped-character.component.js +1 -1
- package/lib/components/loader-star/index.d.ts +2 -0
- package/lib/components/loader-star/index.js +13 -0
- package/lib/components/loader-star/internal/star.component.d.ts +9 -0
- package/lib/components/loader-star/internal/star.component.js +47 -0
- package/lib/components/loader-star/internal/star.style.d.ts +4 -0
- package/lib/components/loader-star/internal/star.style.js +134 -0
- package/lib/components/loader-star/loader-star.component.d.ts +14 -0
- package/lib/components/loader-star/loader-star.component.js +53 -0
- package/lib/components/loader-star/loader-star.style.d.ts +8 -0
- package/lib/components/loader-star/loader-star.style.js +22 -0
- package/lib/components/loader-star/package.json +6 -0
- package/lib/components/radio-button/radio-button-group/radio-button-group.component.d.ts +2 -2
- package/lib/components/radio-button/radio-button-group/radio-button-group.component.js +1 -8
- package/lib/components/radio-button/radio-button.component.d.ts +2 -2
- package/lib/components/radio-button/radio-button.component.js +12 -16
- package/lib/locales/de-de.js +3 -0
- package/lib/locales/en-gb.js +3 -0
- package/lib/locales/es-es.js +3 -0
- package/lib/locales/fr-ca.js +3 -0
- package/lib/locales/fr-fr.js +3 -0
- package/lib/locales/locale.d.ts +3 -0
- package/package.json +1 -1
|
@@ -6,10 +6,10 @@ export interface CommonCheckableInputProps extends ValidationProps, CommonHidden
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
/** @private @ignore */
|
|
8
8
|
loading?: boolean;
|
|
9
|
-
/** Help content to be displayed under an input */
|
|
9
|
+
/** [Legacy] Help content to be displayed under an input */
|
|
10
10
|
fieldHelp?: React.ReactNode;
|
|
11
11
|
/**
|
|
12
|
-
* If true, the FieldHelp will be displayed inline
|
|
12
|
+
* [Legacy] If true, the FieldHelp will be displayed inline
|
|
13
13
|
* To be used with labelInline prop set to true
|
|
14
14
|
*/
|
|
15
15
|
fieldHelpInline?: boolean;
|
|
@@ -19,7 +19,7 @@ export interface CommonCheckableInputProps extends ValidationProps, CommonHidden
|
|
|
19
19
|
inputWidth?: number;
|
|
20
20
|
/** Label content */
|
|
21
21
|
label?: React.ReactNode;
|
|
22
|
-
/** The content for the help tooltip, to appear next to the Label */
|
|
22
|
+
/** [Legacy] The content for the help tooltip, to appear next to the Label */
|
|
23
23
|
labelHelp?: React.ReactNode;
|
|
24
24
|
/** Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8) */
|
|
25
25
|
labelSpacing?: 1 | 2;
|
|
@@ -1,5 +1,5 @@
|
|
|
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 } from "react";
|
|
2
|
+
import React, { useRef, useContext } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { StyledCheckableInput, StyledCheckableInputWrapper } from "./checkable-input.style";
|
|
5
5
|
import { InputBehaviour } from "../input-behaviour";
|
|
@@ -7,6 +7,7 @@ import FormField from "../form-field";
|
|
|
7
7
|
import HiddenCheckableInput from "./hidden-checkable-input.component";
|
|
8
8
|
import guid from "../utils/helpers/guid";
|
|
9
9
|
import useInputAccessibility from "../../hooks/__internal__/useInputAccessibility";
|
|
10
|
+
import NewValidationContext from "../../components/carbon-provider/__internal__/new-validation.context";
|
|
10
11
|
const CheckableInput = /*#__PURE__*/React.forwardRef(({
|
|
11
12
|
ariaLabelledBy,
|
|
12
13
|
autoFocus,
|
|
@@ -41,6 +42,9 @@ const CheckableInput = /*#__PURE__*/React.forwardRef(({
|
|
|
41
42
|
const {
|
|
42
43
|
current: id
|
|
43
44
|
} = useRef(inputId || guid());
|
|
45
|
+
const {
|
|
46
|
+
validationRedesignOptIn
|
|
47
|
+
} = useContext(NewValidationContext);
|
|
44
48
|
const {
|
|
45
49
|
labelId,
|
|
46
50
|
fieldHelpId,
|
|
@@ -76,7 +80,7 @@ const CheckableInput = /*#__PURE__*/React.forwardRef(({
|
|
|
76
80
|
// However, we still want the input element to receive the required prop
|
|
77
81
|
isRequired: required,
|
|
78
82
|
isOptional,
|
|
79
|
-
useValidationIcon: validationOnLabel
|
|
83
|
+
useValidationIcon: validationRedesignOptIn ? false : validationOnLabel
|
|
80
84
|
};
|
|
81
85
|
const inputProps = {
|
|
82
86
|
ariaDescribedBy,
|
|
@@ -5,8 +5,8 @@ export interface CheckboxGroupProps extends ValidationProps, MarginProps {
|
|
|
5
5
|
/** The content for the CheckboxGroup Legend */
|
|
6
6
|
legend?: string;
|
|
7
7
|
/**
|
|
8
|
-
* The content for the CheckboxGroup
|
|
9
|
-
* will be rendered
|
|
8
|
+
* The content for the CheckboxGroup hint text,
|
|
9
|
+
* will only be rendered when `validationRedesignOptIn` is true.
|
|
10
10
|
*/
|
|
11
11
|
legendHelp?: string;
|
|
12
12
|
/** [Legacy] When true, legend is placed inline with the checkboxes */
|
|
@@ -27,7 +27,7 @@ export interface CheckboxGroupProps extends ValidationProps, MarginProps {
|
|
|
27
27
|
isOptional?: boolean;
|
|
28
28
|
/** [Legacy] Overrides the default tooltip */
|
|
29
29
|
tooltipPosition?: "top" | "bottom" | "left" | "right";
|
|
30
|
-
/** When true, Checkboxes are
|
|
30
|
+
/** When true, Checkboxes are inline */
|
|
31
31
|
inline?: boolean;
|
|
32
32
|
}
|
|
33
33
|
export declare const CheckboxGroup: {
|
|
@@ -35,12 +35,8 @@ export const CheckboxGroup = props => {
|
|
|
35
35
|
return /*#__PURE__*/React.createElement(React.Fragment, null, validationRedesignOptIn ? /*#__PURE__*/React.createElement(Fieldset, _extends({
|
|
36
36
|
legend: legend,
|
|
37
37
|
inline: legendInline,
|
|
38
|
-
legendWidth: legendWidth,
|
|
39
|
-
legendAlign: legendAlign,
|
|
40
|
-
legendSpacing: legendSpacing,
|
|
41
38
|
error: error,
|
|
42
39
|
warning: warning,
|
|
43
|
-
info: info,
|
|
44
40
|
isRequired: required,
|
|
45
41
|
isOptional: isOptional
|
|
46
42
|
}, tagComponent("checkboxgroup", props), {
|
|
@@ -56,7 +52,6 @@ export const CheckboxGroup = props => {
|
|
|
56
52
|
}), /*#__PURE__*/React.createElement(StyledCheckboxGroup, {
|
|
57
53
|
"data-component": "checkbox-group",
|
|
58
54
|
"data-role": "checkbox-group",
|
|
59
|
-
legendInline: legendInline,
|
|
60
55
|
inline: inline
|
|
61
56
|
}, /*#__PURE__*/React.createElement(CheckboxGroupContext.Provider, {
|
|
62
57
|
value: {
|
|
@@ -83,7 +78,8 @@ export const CheckboxGroup = props => {
|
|
|
83
78
|
}, filterStyledSystemMarginProps(props)), /*#__PURE__*/React.createElement(StyledCheckboxGroup, {
|
|
84
79
|
"data-component": "checkbox-group",
|
|
85
80
|
"data-role": "checkbox-group",
|
|
86
|
-
legendInline: legendInline
|
|
81
|
+
legendInline: legendInline,
|
|
82
|
+
inline: inline
|
|
87
83
|
}, /*#__PURE__*/React.createElement(CheckboxGroupContext.Provider, {
|
|
88
84
|
value: {
|
|
89
85
|
error: !!error,
|
|
@@ -12,13 +12,13 @@ export interface CheckboxProps extends CommonCheckableInputProps, MarginProps {
|
|
|
12
12
|
"data-element"?: string;
|
|
13
13
|
/** Identifier used for testing purposes, applied to the root element of the component. */
|
|
14
14
|
"data-role"?: string;
|
|
15
|
-
/** Aria label for rendered help component */
|
|
15
|
+
/** [Legacy] Aria label for rendered help component */
|
|
16
16
|
helpAriaLabel?: string;
|
|
17
17
|
/** When true label is inline */
|
|
18
18
|
labelInline?: boolean;
|
|
19
19
|
/** Accepts a callback function which is triggered on click event */
|
|
20
20
|
onClick?: (ev: React.MouseEvent<HTMLInputElement>) => void;
|
|
21
|
-
/** Overrides the default tooltip position */
|
|
21
|
+
/** [Legacy] Overrides the default tooltip position */
|
|
22
22
|
tooltipPosition?: "top" | "bottom" | "left" | "right";
|
|
23
23
|
/** The value of the checkbox, passed on form submit */
|
|
24
24
|
value?: string;
|
|
@@ -61,6 +61,13 @@ const Checkbox = /*#__PURE__*/React.forwardRef(({
|
|
|
61
61
|
deprecateUncontrolledWarnTriggered = true;
|
|
62
62
|
Logger.deprecate("Uncontrolled behaviour in `Checkbox` is deprecated and support will soon be removed. Please make sure all your inputs are controlled.");
|
|
63
63
|
}
|
|
64
|
+
const commonProps = {
|
|
65
|
+
fieldHelpInline,
|
|
66
|
+
labelSpacing,
|
|
67
|
+
labelHelp,
|
|
68
|
+
fieldHelp
|
|
69
|
+
};
|
|
70
|
+
const isInGroup = Object.keys(checkboxGroupContext).length !== 0;
|
|
64
71
|
const inputProps = {
|
|
65
72
|
ariaLabelledBy,
|
|
66
73
|
onClick,
|
|
@@ -74,28 +81,23 @@ const Checkbox = /*#__PURE__*/React.forwardRef(({
|
|
|
74
81
|
type: "checkbox",
|
|
75
82
|
name,
|
|
76
83
|
reverse: !reverse,
|
|
77
|
-
fieldHelp,
|
|
78
84
|
autoFocus,
|
|
79
|
-
labelHelp,
|
|
80
|
-
labelSpacing,
|
|
81
85
|
required,
|
|
82
86
|
isOptional,
|
|
83
|
-
fieldHelpInline,
|
|
84
87
|
checked,
|
|
85
88
|
disabled,
|
|
86
89
|
inputWidth,
|
|
87
90
|
labelWidth,
|
|
88
91
|
ref,
|
|
89
|
-
...rest
|
|
92
|
+
...rest,
|
|
93
|
+
...(isInGroup && validationRedesignOptIn ? {} : {
|
|
94
|
+
...commonProps
|
|
95
|
+
})
|
|
90
96
|
};
|
|
91
97
|
const validationProps = {
|
|
92
98
|
error: contextError || error,
|
|
93
99
|
warning: contextWarning || warning,
|
|
94
|
-
|
|
95
|
-
validationOnLabel: false
|
|
96
|
-
} : {
|
|
97
|
-
info: contextInfo || info
|
|
98
|
-
})
|
|
100
|
+
info: contextInfo || info
|
|
99
101
|
};
|
|
100
102
|
const marginProps = useFormSpacing(rest);
|
|
101
103
|
const componentToRender = /*#__PURE__*/React.createElement(CheckboxStyle, _extends({
|
|
@@ -41,11 +41,12 @@ const StyledCheckbox = styled.div`
|
|
|
41
41
|
${!disabled && css`
|
|
42
42
|
border: 1px solid var(--colorsUtilityMajor300);
|
|
43
43
|
|
|
44
|
-
${info && `border: 1px solid var(--colorsSemanticInfo500);`}
|
|
45
|
-
${warning && `border: 1px solid var(--colorsSemanticCaution500);`}
|
|
46
44
|
${error && `border: 2px solid var(--colorsSemanticNegative500);`}
|
|
47
45
|
|
|
48
|
-
${
|
|
46
|
+
${!applyNewValidation && css`
|
|
47
|
+
${info && `border: 1px solid var(--colorsSemanticInfo500);`}
|
|
48
|
+
${warning && `border: 1px solid var(--colorsSemanticCaution500);`}
|
|
49
|
+
`}
|
|
49
50
|
`}
|
|
50
51
|
}
|
|
51
52
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { PaddingProps } from "styled-system";
|
|
3
3
|
import { TableBorderSize, TableCellAlign } from "..";
|
|
4
|
-
|
|
4
|
+
import { TagProps } from "../../../__internal__/utils/helpers/tags";
|
|
5
|
+
export interface FlatTableCellProps extends PaddingProps, Omit<TagProps, "data-component"> {
|
|
5
6
|
/** Content alignment */
|
|
6
7
|
align?: TableCellAlign;
|
|
7
8
|
/** Cell content */
|
|
@@ -24,7 +25,7 @@ export interface FlatTableCellProps extends PaddingProps {
|
|
|
24
25
|
id?: string;
|
|
25
26
|
}
|
|
26
27
|
export declare const FlatTableCell: {
|
|
27
|
-
({ align, children, pl, width, truncate, title, colspan, rowspan, id, ...rest }: FlatTableCellProps): React.JSX.Element;
|
|
28
|
+
({ align, children, pl, width, truncate, title, colspan, rowspan, id, "data-element": dataElement, "data-role": dataRole, ...rest }: FlatTableCellProps): React.JSX.Element;
|
|
28
29
|
displayName: string;
|
|
29
30
|
};
|
|
30
31
|
export default FlatTableCell;
|
|
@@ -15,6 +15,8 @@ export const FlatTableCell = ({
|
|
|
15
15
|
colspan,
|
|
16
16
|
rowspan,
|
|
17
17
|
id,
|
|
18
|
+
"data-element": dataElement,
|
|
19
|
+
"data-role": dataRole,
|
|
18
20
|
...rest
|
|
19
21
|
}) => {
|
|
20
22
|
const internalId = useRef(id || guid());
|
|
@@ -41,7 +43,9 @@ export const FlatTableCell = ({
|
|
|
41
43
|
makeCellSticky: makeCellSticky,
|
|
42
44
|
className: makeCellSticky ? "isSticky" : undefined,
|
|
43
45
|
align: align,
|
|
44
|
-
"data-
|
|
46
|
+
"data-component": "flat-table-cell",
|
|
47
|
+
"data-element": dataElement || "flat-table-cell",
|
|
48
|
+
"data-role": dataRole,
|
|
45
49
|
pl: pl,
|
|
46
50
|
onClick: isExpandableCell ? onClick : undefined,
|
|
47
51
|
tabIndex: isExpandableCell ? tabIndex : undefined,
|
|
@@ -61,7 +65,8 @@ export const FlatTableCell = ({
|
|
|
61
65
|
onFocus: handleOnFocus
|
|
62
66
|
}), /*#__PURE__*/React.createElement(StyledCellContent, {
|
|
63
67
|
title: truncate && !title && typeof children === "string" ? children : title,
|
|
64
|
-
expandable: expandable
|
|
68
|
+
expandable: expandable,
|
|
69
|
+
"data-role": "flat-table-cell-content"
|
|
65
70
|
}, expandable && isFirstCell && /*#__PURE__*/React.createElement(Icon, {
|
|
66
71
|
type: "chevron_down_thick",
|
|
67
72
|
mr: "8px"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { PaddingProps } from "styled-system";
|
|
3
|
+
import { TagProps } from "../../../__internal__/utils/helpers/tags";
|
|
3
4
|
import { TableBorderSize, TableCellAlign } from "..";
|
|
4
|
-
export interface FlatTableHeaderProps extends PaddingProps {
|
|
5
|
+
export interface FlatTableHeaderProps extends PaddingProps, Omit<TagProps, "data-component"> {
|
|
5
6
|
/** Content alignment */
|
|
6
7
|
align?: TableCellAlign;
|
|
7
8
|
/** If true sets alternative background color */
|
|
@@ -22,7 +23,7 @@ export interface FlatTableHeaderProps extends PaddingProps {
|
|
|
22
23
|
id?: string;
|
|
23
24
|
}
|
|
24
25
|
export declare const FlatTableHeader: {
|
|
25
|
-
({ align, children, colspan, rowspan, width, py, px, id, ...rest }: FlatTableHeaderProps): React.JSX.Element;
|
|
26
|
+
({ align, children, colspan, rowspan, width, py, px, id, "data-element": dataElement, "data-role": dataRole, ...rest }: FlatTableHeaderProps): React.JSX.Element;
|
|
26
27
|
displayName: string;
|
|
27
28
|
};
|
|
28
29
|
export default FlatTableHeader;
|
|
@@ -14,6 +14,8 @@ export const FlatTableHeader = ({
|
|
|
14
14
|
py,
|
|
15
15
|
px,
|
|
16
16
|
id,
|
|
17
|
+
"data-element": dataElement,
|
|
18
|
+
"data-role": dataRole,
|
|
17
19
|
...rest
|
|
18
20
|
}) => {
|
|
19
21
|
const ref = useRef(null);
|
|
@@ -33,8 +35,7 @@ export const FlatTableHeader = ({
|
|
|
33
35
|
makeCellSticky: makeCellSticky,
|
|
34
36
|
className: makeCellSticky ? "isSticky" : undefined,
|
|
35
37
|
align: align,
|
|
36
|
-
colorTheme: colorTheme
|
|
37
|
-
"data-element": "flat-table-header"
|
|
38
|
+
colorTheme: colorTheme
|
|
38
39
|
}, colspan !== undefined && {
|
|
39
40
|
colSpan: Number(colspan)
|
|
40
41
|
}, rowspan !== undefined && {
|
|
@@ -44,8 +45,13 @@ export const FlatTableHeader = ({
|
|
|
44
45
|
py: py,
|
|
45
46
|
px: px
|
|
46
47
|
}, rest, {
|
|
48
|
+
"data-component": "flat-table-header",
|
|
49
|
+
"data-element": dataElement || "flat-table-header",
|
|
50
|
+
"data-role": dataRole,
|
|
47
51
|
id: internalId.current
|
|
48
|
-
}), /*#__PURE__*/React.createElement("div",
|
|
52
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
"data-role": "flat-table-header-content"
|
|
54
|
+
}, children));
|
|
49
55
|
};
|
|
50
56
|
FlatTableHeader.displayName = "FlatTableHeader";
|
|
51
57
|
export default FlatTableHeader;
|
|
@@ -131,6 +131,8 @@ const FlatTableRow = /*#__PURE__*/React.forwardRef(({
|
|
|
131
131
|
}
|
|
132
132
|
function handleCellKeyDown(ev) {
|
|
133
133
|
const isEnterOrSpaceKey = Event.isEnterKey(ev) || Event.isSpaceKey(ev);
|
|
134
|
+
|
|
135
|
+
/* istanbul ignore else */
|
|
134
136
|
if (isEnterOrSpaceKey) {
|
|
135
137
|
ev.preventDefault();
|
|
136
138
|
toggleExpanded();
|
package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.component.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { PaddingProps } from "styled-system";
|
|
3
3
|
import { TableBorderSize, TableCellAlign } from "..";
|
|
4
4
|
import { TagProps } from "../../../__internal__/utils/helpers/tags/tags";
|
|
5
|
-
export interface FlatTableRowHeaderProps extends PaddingProps, TagProps {
|
|
5
|
+
export interface FlatTableRowHeaderProps extends PaddingProps, Omit<TagProps, "data-component"> {
|
|
6
6
|
/** Content alignment */
|
|
7
7
|
align?: TableCellAlign;
|
|
8
8
|
/** RowHeader content */
|
|
@@ -41,6 +41,7 @@ export const FlatTableRowHeader = ({
|
|
|
41
41
|
bringToFront(ev, "TH");
|
|
42
42
|
};
|
|
43
43
|
const handleOnKeyDown = useCallback(ev => {
|
|
44
|
+
/* istanbul ignore else */
|
|
44
45
|
if (isExpandableCell && onKeyDown) {
|
|
45
46
|
onKeyDown(ev);
|
|
46
47
|
}
|
|
@@ -48,11 +49,7 @@ export const FlatTableRowHeader = ({
|
|
|
48
49
|
return /*#__PURE__*/React.createElement(StyledFlatTableRowHeader, _extends({
|
|
49
50
|
leftPosition: stickyAlignment === "left" ? leftPosition || 0 : undefined,
|
|
50
51
|
rightPosition: stickyAlignment === "right" ? rightPosition || 0 : undefined,
|
|
51
|
-
align: align
|
|
52
|
-
}, tagComponent("flat-table-row-header", {
|
|
53
|
-
"data-element": "flat-table-row-header",
|
|
54
|
-
...rest
|
|
55
|
-
}), {
|
|
52
|
+
align: align,
|
|
56
53
|
width: width,
|
|
57
54
|
py: py || "10px",
|
|
58
55
|
px: px || 3,
|
|
@@ -68,13 +65,17 @@ export const FlatTableRowHeader = ({
|
|
|
68
65
|
rowSpan: Number(rowspan)
|
|
69
66
|
}, {
|
|
70
67
|
"data-selected": isInSelectedRow && isExpandableCell,
|
|
71
|
-
"data-highlighted": isInHighlightedRow && isExpandableCell
|
|
72
|
-
}, rest, {
|
|
73
|
-
id: internalId.current,
|
|
68
|
+
"data-highlighted": isInHighlightedRow && isExpandableCell,
|
|
74
69
|
onFocus: handleOnFocus
|
|
70
|
+
}, rest, tagComponent("flat-table-row-header", {
|
|
71
|
+
"data-element": "flat-table-row-header",
|
|
72
|
+
...rest
|
|
73
|
+
}), {
|
|
74
|
+
id: internalId.current
|
|
75
75
|
}), /*#__PURE__*/React.createElement(StyledFlatTableRowHeaderContent, {
|
|
76
76
|
title: truncate && !title && typeof children === "string" ? children : title,
|
|
77
|
-
expandable: expandable
|
|
77
|
+
expandable: expandable,
|
|
78
|
+
"data-role": "flat-table-row-header-content"
|
|
78
79
|
}, expandable && isFirstCell && /*#__PURE__*/React.createElement(Icon, {
|
|
79
80
|
type: "chevron_down_thick",
|
|
80
81
|
mr: "8px"
|
|
@@ -50,7 +50,7 @@ const GroupedCharacter = /*#__PURE__*/React.forwardRef(({
|
|
|
50
50
|
const {
|
|
51
51
|
selectionEnd
|
|
52
52
|
} = target;
|
|
53
|
-
let newCursorPos = selectionEnd ?? 0;
|
|
53
|
+
let newCursorPos = selectionEnd ?? /* istanbul ignore next */0;
|
|
54
54
|
const rawValue = sanitizeValue(target.value);
|
|
55
55
|
const formattedValue = formatValue(rawValue);
|
|
56
56
|
const isLastPosition = target.value.length === newCursorPos;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./loader-star.component";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface StarProps {
|
|
2
|
+
starContainerClassName: "star-1" | "star-2" | "star-3";
|
|
3
|
+
gradientId: "gradient1" | "gradient2" | "gradient3";
|
|
4
|
+
}
|
|
5
|
+
declare const Star: {
|
|
6
|
+
({ starContainerClassName, gradientId, }: StarProps): JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
export default Star;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { GradientStopBottom, GradientStopTop, StyledLoaderStarContainer, StyledStarSVG } from "./star.style";
|
|
4
|
+
const Star = ({
|
|
5
|
+
starContainerClassName,
|
|
6
|
+
gradientId
|
|
7
|
+
}) => {
|
|
8
|
+
return /*#__PURE__*/React.createElement(StyledLoaderStarContainer, {
|
|
9
|
+
"data-component": "star",
|
|
10
|
+
role: "presentation",
|
|
11
|
+
className: starContainerClassName
|
|
12
|
+
}, /*#__PURE__*/React.createElement(StyledStarSVG, {
|
|
13
|
+
className: "ai-star-svg",
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
+
viewBox: "0 0 217 216"
|
|
16
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
17
|
+
className: "ai-star-path",
|
|
18
|
+
fill: "#000",
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
d: "M108.502 215.994c-.166.006-.334.006-.502.006-7.218 0-11.975-3.217-15.497-8.335-4.396-5.656-7.56-13.591-10.338-21.896l-.597-1.807-.667-2.063-.91-2.87-1.225-3.904c-1.831-5.82-3.65-11.42-5.751-16.135-1.456-2.661-3.075-5.078-4.921-7.146-.356-.391-.72-.777-1.094-1.156-4.054-4.038-9.808-7.093-16.262-9.726-14.49-4.937-33.33-8.698-43.486-17.634C2.766 119.712 0 114.918 0 108l.003-.413c.108-6.697 2.852-11.372 7.25-14.916 10.155-8.935 28.995-12.696 43.485-17.633C57.192 72.405 62.946 69.35 67 65.312c.373-.38.738-.765 1.094-1.156 1.846-2.068 3.465-4.485 4.922-7.145 2.567-5.764 4.713-12.849 6.976-20.04l.91-2.87.666-2.063.338-1.028c2.84-8.586 6.063-16.843 10.598-22.675C95.954 3.32 100.592.13 107.57.004L108 0c.168 0 .336 0 .502.006L109 0l.405.003c6.999.119 11.645 3.316 15.102 8.347 5.071 6.529 8.5 16.09 11.592 25.75l.335 1.054 2.362 7.501c1.645 5.178 3.304 10.125 5.19 14.358 1.456 2.66 3.074 5.075 4.92 7.142.356.392.72.778 1.094 1.157 4.054 4.038 9.808 7.093 16.262 9.726 14.49 4.937 33.33 8.698 43.486 17.634C214.234 96.288 217 101.082 217 108c0 6.918-2.766 11.712-7.252 15.328-10.156 8.936-28.996 12.697-43.486 17.634-6.454 2.633-12.208 5.688-16.262 9.726-.373.38-.738.765-1.094 1.157-1.846 2.067-3.464 4.482-4.92 7.142-1.886 4.233-3.545 9.18-5.19 14.358l-2.362 7.5-.335 1.054c-3.091 9.66-6.521 19.222-11.592 25.751-3.524 5.127-8.282 8.35-15.507 8.35l-.498-.006Z"
|
|
21
|
+
}), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
|
22
|
+
id: gradientId,
|
|
23
|
+
x1: "0%",
|
|
24
|
+
y1: "0%",
|
|
25
|
+
x2: "100%",
|
|
26
|
+
y2: "100%"
|
|
27
|
+
}, /*#__PURE__*/React.createElement(GradientStopTop, {
|
|
28
|
+
offset: "0%"
|
|
29
|
+
}), /*#__PURE__*/React.createElement(GradientStopBottom, {
|
|
30
|
+
offset: "100%"
|
|
31
|
+
})))));
|
|
32
|
+
};
|
|
33
|
+
if (process.env.NODE_ENV !== "production") {
|
|
34
|
+
Star.propTypes = {
|
|
35
|
+
"gradientId": PropTypes.oneOf(["gradient1", "gradient2", "gradient3"]).isRequired,
|
|
36
|
+
"starContainerClassName": PropTypes.oneOf(["star-1", "star-2", "star-3"]).isRequired
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
Star.displayName = "Star";
|
|
40
|
+
export default Star;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const StyledStarSVG: import("styled-components").StyledComponent<"svg", any, {}, never>;
|
|
2
|
+
export declare const GradientStopTop: import("styled-components").StyledComponent<"stop", any, {}, never>;
|
|
3
|
+
export declare const GradientStopBottom: import("styled-components").StyledComponent<"stop", any, {}, never>;
|
|
4
|
+
export declare const StyledLoaderStarContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import styled, { keyframes } from "styled-components";
|
|
2
|
+
const animateStar = keyframes`
|
|
3
|
+
0% {
|
|
4
|
+
transform: translate3d(0px, 0px, 0px) scale(0.3);
|
|
5
|
+
opacity: 0;
|
|
6
|
+
}
|
|
7
|
+
10% {
|
|
8
|
+
transform: translate3d(0px, 0px, 0px) scale(0.3);
|
|
9
|
+
opacity: 0;
|
|
10
|
+
}
|
|
11
|
+
20% {
|
|
12
|
+
transform: translate3d(0px, 0px, 0px) scale(0.6);
|
|
13
|
+
opacity: 1;
|
|
14
|
+
}
|
|
15
|
+
35% {
|
|
16
|
+
transform: translate3d(0px, 0px, 0px) scale(0.6);
|
|
17
|
+
opacity: 1;
|
|
18
|
+
}
|
|
19
|
+
55% {
|
|
20
|
+
transform: translate3d(16px, -12px, 0px) scale(1.4);
|
|
21
|
+
opacity: 1;
|
|
22
|
+
}
|
|
23
|
+
60% {
|
|
24
|
+
transform: translate3d(16px, -12px, 0px) scale(1.4);
|
|
25
|
+
opacity: 1;
|
|
26
|
+
}
|
|
27
|
+
90% {
|
|
28
|
+
transform: translate3d(0px, -24px, 0px) scale(0.8);
|
|
29
|
+
opacity: 1;
|
|
30
|
+
}
|
|
31
|
+
100% {
|
|
32
|
+
transform: translate3d(0px, -24px, 0px) scale(0.6);
|
|
33
|
+
opacity: 0;
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
const animateStopTop = keyframes`
|
|
37
|
+
0% { stop-color: #13a038; }
|
|
38
|
+
10% { stop-color: #13a038; }
|
|
39
|
+
50% { stop-color: #0092db; }
|
|
40
|
+
90% { stop-color: #8f49fe; }
|
|
41
|
+
100% { stop-color: #8f49fe; }
|
|
42
|
+
`;
|
|
43
|
+
const animateStopBottom = keyframes`
|
|
44
|
+
0% { stop-color: #13a038; }
|
|
45
|
+
10% { stop-color: #13a038; }
|
|
46
|
+
50% { stop-color: #13a038; }
|
|
47
|
+
90% { stop-color: #0092db; }
|
|
48
|
+
100% { stop-color: #0092db; }
|
|
49
|
+
`;
|
|
50
|
+
const time = "3s";
|
|
51
|
+
export const StyledStarSVG = styled.svg`
|
|
52
|
+
animation: ${animateStar} ${time} ease-in-out forwards infinite;
|
|
53
|
+
height: var(--sizing200);
|
|
54
|
+
opacity: 0;
|
|
55
|
+
width: var(--sizing200);
|
|
56
|
+
`;
|
|
57
|
+
export const GradientStopTop = styled.stop`
|
|
58
|
+
animation: ${animateStopTop} ${time} ease-in-out forwards infinite;
|
|
59
|
+
`;
|
|
60
|
+
export const GradientStopBottom = styled.stop`
|
|
61
|
+
animation: ${animateStopBottom} ${time} ease-in-out forwards infinite;
|
|
62
|
+
`;
|
|
63
|
+
export const StyledLoaderStarContainer = styled.div`
|
|
64
|
+
bottom: 0;
|
|
65
|
+
height: var(--sizing200);
|
|
66
|
+
left: 0;
|
|
67
|
+
position: absolute;
|
|
68
|
+
width: var(--sizing200);
|
|
69
|
+
|
|
70
|
+
&.star-1 {
|
|
71
|
+
.ai-star-path {
|
|
72
|
+
fill: url(#gradient1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
${StyledStarSVG} {
|
|
76
|
+
animation-delay: -2s;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
#gradient1 {
|
|
80
|
+
${GradientStopTop} {
|
|
81
|
+
animation-delay: -2s;
|
|
82
|
+
}
|
|
83
|
+
${GradientStopBottom} {
|
|
84
|
+
animation-delay: -2s;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&.star-2 {
|
|
90
|
+
.ai-star-path {
|
|
91
|
+
fill: url(#gradient2);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
${StyledStarSVG} {
|
|
95
|
+
animation-delay: -1s;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
#gradient2 {
|
|
99
|
+
${GradientStopTop} {
|
|
100
|
+
animation-delay: -1s;
|
|
101
|
+
}
|
|
102
|
+
${GradientStopBottom} {
|
|
103
|
+
animation-delay: -1s;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&.star-3 {
|
|
109
|
+
.ai-star-path {
|
|
110
|
+
fill: url(#gradient3);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
${StyledStarSVG} {
|
|
114
|
+
animation-delay: 0s;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
#gradient3 {
|
|
118
|
+
${GradientStopTop} {
|
|
119
|
+
animation-delay: 0s;
|
|
120
|
+
}
|
|
121
|
+
${GradientStopBottom} {
|
|
122
|
+
animation-delay: 0s;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
|
|
2
|
+
export interface LoaderStarProps extends Omit<TagProps, "data-component"> {
|
|
3
|
+
/**
|
|
4
|
+
* The loaderStarLabel prop allows a specific label to be set.
|
|
5
|
+
* This label will be present if the user has `reduce-motion` enabled and will also be available to assistive technologies.
|
|
6
|
+
* By default the label will be `Loading...`.
|
|
7
|
+
*/
|
|
8
|
+
loaderStarLabel?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const LoaderStar: {
|
|
11
|
+
({ loaderStarLabel, ...rest }: LoaderStarProps): JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export default LoaderStar;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
5
|
+
import { StyledLoaderStarWrapper, StyledLabel, StyledStars } from "./loader-star.style";
|
|
6
|
+
import useLocale from "../../hooks/__internal__/useLocale";
|
|
7
|
+
import useMediaQuery from "../../hooks/useMediaQuery";
|
|
8
|
+
import Star from "./internal/star.component";
|
|
9
|
+
import Typography from "../typography";
|
|
10
|
+
const LoaderStar = ({
|
|
11
|
+
loaderStarLabel,
|
|
12
|
+
...rest
|
|
13
|
+
}) => {
|
|
14
|
+
const locale = useLocale();
|
|
15
|
+
const reduceMotion = !useMediaQuery("screen and (prefers-reduced-motion: no-preference)");
|
|
16
|
+
const label = /*#__PURE__*/React.createElement(StyledLabel, {
|
|
17
|
+
"data-role": "visible-label",
|
|
18
|
+
variant: "span",
|
|
19
|
+
fontWeight: "500"
|
|
20
|
+
}, loaderStarLabel || locale.loaderStar.loading());
|
|
21
|
+
return /*#__PURE__*/React.createElement(StyledLoaderStarWrapper, _extends({
|
|
22
|
+
role: "status"
|
|
23
|
+
}, tagComponent("loader-star", rest)), reduceMotion ? label : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledStars, null, /*#__PURE__*/React.createElement(Star, {
|
|
24
|
+
starContainerClassName: "star-1",
|
|
25
|
+
gradientId: "gradient1"
|
|
26
|
+
}), /*#__PURE__*/React.createElement(Star, {
|
|
27
|
+
starContainerClassName: "star-2",
|
|
28
|
+
gradientId: "gradient2"
|
|
29
|
+
}), /*#__PURE__*/React.createElement(Star, {
|
|
30
|
+
starContainerClassName: "star-3",
|
|
31
|
+
gradientId: "gradient3"
|
|
32
|
+
})), /*#__PURE__*/React.createElement(Typography, {
|
|
33
|
+
"data-role": "hidden-label",
|
|
34
|
+
variant: "span",
|
|
35
|
+
screenReaderOnly: true
|
|
36
|
+
}, loaderStarLabel || locale.loaderStar.loading())));
|
|
37
|
+
};
|
|
38
|
+
if (process.env.NODE_ENV !== "production") {
|
|
39
|
+
LoaderStar.propTypes = {
|
|
40
|
+
"data-element": PropTypes.string,
|
|
41
|
+
"data-role": PropTypes.string,
|
|
42
|
+
"loaderStarLabel": PropTypes.string
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
LoaderStar.displayName = "LoaderStar";
|
|
46
|
+
export default LoaderStar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LoaderStarProps } from "./loader-star.component";
|
|
3
|
+
export declare const StyledLoaderStarWrapper: import("styled-components").StyledComponent<"div", any, LoaderStarProps, never>;
|
|
4
|
+
export declare const StyledLabel: import("styled-components").StyledComponent<{
|
|
5
|
+
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordBreak, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: import("../typography").TypographyProps): import("react").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
}, any, {}, never>;
|
|
8
|
+
export declare const StyledStars: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import Typography from "../typography";
|
|
3
|
+
export const StyledLoaderStarWrapper = styled.div`
|
|
4
|
+
position: relative;
|
|
5
|
+
width: max-content;
|
|
6
|
+
`;
|
|
7
|
+
export const StyledLabel = styled(Typography)`
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
text-align: center;
|
|
11
|
+
`;
|
|
12
|
+
export const StyledStars = styled.div`
|
|
13
|
+
width: 40px;
|
|
14
|
+
height: 40px;
|
|
15
|
+
`;
|
|
@@ -15,8 +15,8 @@ export interface RadioButtonGroupProps extends ValidationProps, MarginProps {
|
|
|
15
15
|
/** The content for the RadioGroup Legend */
|
|
16
16
|
legend?: string;
|
|
17
17
|
/**
|
|
18
|
-
* The content for the RadioButtonGroup
|
|
19
|
-
* will be rendered
|
|
18
|
+
* The content for the RadioButtonGroup hint text,
|
|
19
|
+
* will only be rendered when `validationRedesignOptIn` is true.
|
|
20
20
|
*/
|
|
21
21
|
legendHelp?: string;
|
|
22
22
|
/** [Legacy] Text alignment of legend when inline */
|