carbon-react 142.3.2 → 142.4.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/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/menu/__internal__/submenu/submenu.style.js +0 -1
- package/esm/components/pager/pager.style.js +1 -1
- package/esm/components/select/__internal__/select-list/select-list.component.d.ts +0 -2
- package/esm/components/select/__internal__/select-list/select-list.component.js +3 -8
- package/esm/components/select/__internal__/select-textbox/select-textbox.component.d.ts +1 -3
- package/esm/components/select/__internal__/select-textbox/select-textbox.component.js +24 -56
- package/esm/components/select/__internal__/{select-text/select-text.style.d.ts → select-textbox/select-textbox.style.d.ts} +2 -3
- package/esm/components/select/filterable-select/filterable-select.component.d.ts +1 -1
- package/esm/components/select/filterable-select/filterable-select.component.js +4 -7
- package/esm/components/select/multi-select/multi-select.component.d.ts +1 -1
- package/esm/components/select/multi-select/multi-select.component.js +4 -7
- package/esm/components/select/simple-select/simple-select.component.d.ts +1 -1
- package/esm/components/select/simple-select/simple-select.component.js +4 -7
- 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/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/{select/__internal__/select-text → loader-star}/index.js +2 -2
- 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/menu/__internal__/submenu/submenu.style.js +0 -1
- package/lib/components/pager/pager.style.js +2 -2
- package/lib/components/select/__internal__/select-list/select-list.component.d.ts +0 -2
- package/lib/components/select/__internal__/select-list/select-list.component.js +3 -8
- package/lib/components/select/__internal__/select-textbox/select-textbox.component.d.ts +1 -3
- package/lib/components/select/__internal__/select-textbox/select-textbox.component.js +24 -58
- package/lib/components/select/__internal__/{select-text/select-text.style.d.ts → select-textbox/select-textbox.style.d.ts} +2 -3
- package/lib/components/select/filterable-select/filterable-select.component.d.ts +1 -1
- package/lib/components/select/filterable-select/filterable-select.component.js +4 -7
- package/lib/components/select/multi-select/multi-select.component.d.ts +1 -1
- package/lib/components/select/multi-select/multi-select.component.js +4 -7
- package/lib/components/select/simple-select/simple-select.component.d.ts +1 -1
- package/lib/components/select/simple-select/simple-select.component.js +4 -7
- 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
- package/esm/components/select/__internal__/select-text/index.d.ts +0 -2
- package/esm/components/select/__internal__/select-text/index.js +0 -1
- package/esm/components/select/__internal__/select-text/select-text.component.d.ts +0 -22
- package/esm/components/select/__internal__/select-text/select-text.component.js +0 -27
- package/lib/components/select/__internal__/select-text/index.d.ts +0 -2
- package/lib/components/select/__internal__/select-text/package.json +0 -6
- package/lib/components/select/__internal__/select-text/select-text.component.d.ts +0 -22
- package/lib/components/select/__internal__/select-text/select-text.component.js +0 -34
- /package/esm/components/select/__internal__/{select-text/select-text.style.js → select-textbox/select-textbox.style.js} +0 -0
- /package/lib/components/select/__internal__/{select-text/select-text.style.js → select-textbox/select-textbox.style.js} +0 -0
|
@@ -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
|
+
`;
|
|
@@ -3,7 +3,7 @@ import StyledInput from "../../__internal__/input/input.style";
|
|
|
3
3
|
import StyledInputPresentation from "../../__internal__/input/input-presentation.style";
|
|
4
4
|
import StyledFormField from "../../__internal__/form-field/form-field.style";
|
|
5
5
|
import InputIconToggleStyle from "../../__internal__/input-icon-toggle/input-icon-toggle.style";
|
|
6
|
-
import { StyledSelectText } from "../select/__internal__/select-
|
|
6
|
+
import { StyledSelectText } from "../select/__internal__/select-textbox/select-textbox.style";
|
|
7
7
|
import Link from "../link";
|
|
8
8
|
const StyledSelectContainer = styled.div`
|
|
9
9
|
height: 26px;
|
|
@@ -37,8 +37,6 @@ export interface SelectListProps {
|
|
|
37
37
|
tableHeader?: React.ReactNode;
|
|
38
38
|
/** When true component will work in multi column mode, children should consist of OptionRow components in this mode */
|
|
39
39
|
multiColumn?: boolean;
|
|
40
|
-
/** Data role for loader component */
|
|
41
|
-
loaderDataRole?: string;
|
|
42
40
|
/** Placement of the select list relative to the input element */
|
|
43
41
|
listPlacement?: Side;
|
|
44
42
|
/** Use the opposite list placement if the set placement does not fit */
|
|
@@ -38,7 +38,6 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
|
|
|
38
38
|
onListScrollBottom,
|
|
39
39
|
multiColumn,
|
|
40
40
|
tableHeader,
|
|
41
|
-
loaderDataRole,
|
|
42
41
|
listPlacement = "bottom",
|
|
43
42
|
flipEnabled = true,
|
|
44
43
|
isOpen,
|
|
@@ -172,9 +171,6 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
|
|
|
172
171
|
start
|
|
173
172
|
}) => {
|
|
174
173
|
const child = childrenList[index];
|
|
175
|
-
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
176
|
-
return child;
|
|
177
|
-
}
|
|
178
174
|
const optionChildIndex = optionChildrenList.indexOf(child);
|
|
179
175
|
const isOption = optionChildIndex > -1;
|
|
180
176
|
const newProps = {
|
|
@@ -384,9 +380,7 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
|
|
|
384
380
|
})] : [])], [flipEnabled]);
|
|
385
381
|
const loader = isLoading ? /*#__PURE__*/React.createElement(StyledSelectLoaderContainer, {
|
|
386
382
|
key: "loader"
|
|
387
|
-
}, /*#__PURE__*/React.createElement(Loader,
|
|
388
|
-
"data-role": loaderDataRole
|
|
389
|
-
})) : undefined;
|
|
383
|
+
}, /*#__PURE__*/React.createElement(Loader, null)) : undefined;
|
|
390
384
|
let selectListContent = renderedChildren;
|
|
391
385
|
const listBoxProps = {
|
|
392
386
|
role: "listbox",
|
|
@@ -423,11 +417,13 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
|
|
|
423
417
|
animationFrame: true
|
|
424
418
|
}, /*#__PURE__*/React.createElement(StyledSelectListContainer, _extends({
|
|
425
419
|
"data-element": "select-list-wrapper",
|
|
420
|
+
"data-role": "select-list-wrapper",
|
|
426
421
|
isLoading: isLoading
|
|
427
422
|
}, listProps), /*#__PURE__*/React.createElement(StyledScrollableContainer, {
|
|
428
423
|
ref: listContainerRef,
|
|
429
424
|
maxHeight: listMaxHeight,
|
|
430
425
|
"data-component": "select-list-scrollable-container",
|
|
426
|
+
"data-role": "select-list-scrollable-container",
|
|
431
427
|
hasActionButton: !!listActionButton
|
|
432
428
|
}, /*#__PURE__*/React.createElement(StyledSelectList, _extends({
|
|
433
429
|
as: multiColumn ? "div" : "ul",
|
|
@@ -463,7 +459,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
463
459
|
"listActionButton": PropTypes.node,
|
|
464
460
|
"listMaxHeight": PropTypes.number,
|
|
465
461
|
"listPlacement": PropTypes.oneOf(["bottom", "left", "right", "top"]),
|
|
466
|
-
"loaderDataRole": PropTypes.string,
|
|
467
462
|
"multiColumn": PropTypes.bool,
|
|
468
463
|
"multiselectValues": PropTypes.arrayOf(PropTypes.string),
|
|
469
464
|
"onListAction": PropTypes.func,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { CustomSelectChangeEvent } from "../../simple-select/simple-select.component";
|
|
2
3
|
import { CommonTextboxProps } from "../../../textbox";
|
|
3
4
|
import { ValidationProps } from "../../../../__internal__/validations";
|
|
4
|
-
import { CustomSelectChangeEvent } from "../../simple-select/simple-select.component";
|
|
5
5
|
export interface FormInputPropTypes extends ValidationProps, Omit<CommonTextboxProps, "onClick" | "onChange"> {
|
|
6
6
|
/** Breakpoint for adaptive label (inline labels change to top aligned). Enables the adaptive behaviour when set */
|
|
7
7
|
adaptiveLabelBreakpoint?: number;
|
|
@@ -74,8 +74,6 @@ export interface SelectTextboxProps extends FormInputPropTypes {
|
|
|
74
74
|
/** Value of the Select Input */
|
|
75
75
|
selectedValue?: string | Record<string, unknown> | string[] | Record<string, unknown>[];
|
|
76
76
|
/** @private @ignore */
|
|
77
|
-
textboxRef?: HTMLInputElement | null;
|
|
78
|
-
/** @private @ignore */
|
|
79
77
|
transparent?: boolean;
|
|
80
78
|
/** @private @ignore */
|
|
81
79
|
activeDescendantId?: string;
|