carbon-react 142.9.0 → 142.10.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__/character-count/character-count.component.js +3 -1
- package/esm/__internal__/label/label.style.js +1 -2
- package/esm/components/dialog-full-screen/dialog-full-screen.component.js +1 -0
- package/esm/components/duelling-picklist/duelling-picklist.component.js +3 -2
- package/esm/components/duelling-picklist/picklist/picklist.component.js +1 -0
- package/esm/components/duelling-picklist/picklist-group/picklist-group.component.js +1 -0
- package/esm/components/duelling-picklist/picklist-item/picklist-item.component.js +1 -0
- package/esm/components/form/__internal__/form-summary.component.js +3 -1
- package/esm/components/form/form.component.js +5 -0
- package/esm/components/inline-inputs/inline-inputs.component.d.ts +1 -1
- package/esm/components/inline-inputs/inline-inputs.component.js +2 -0
- package/esm/components/link-preview/link-preview.style.js +1 -2
- package/esm/components/pager/__internal__/pager-navigation.component.js +1 -0
- package/esm/components/pager/pager.component.js +1 -0
- package/esm/components/pages/pages.component.js +1 -0
- package/esm/components/preview/preview.component.d.ts +14 -4
- package/esm/components/preview/preview.component.js +19 -7
- package/esm/components/preview/preview.style.d.ts +10 -1
- package/esm/components/preview/preview.style.js +78 -4
- package/esm/components/search/search.component.js +3 -2
- package/esm/components/tile-select/__internal__/accordion/accordion.component.js +3 -1
- package/esm/components/tile-select/tile-select-group/tile-select-group.component.js +2 -1
- package/esm/components/tile-select/tile-select.component.js +10 -3
- package/lib/__internal__/character-count/character-count.component.js +3 -1
- package/lib/__internal__/label/label.style.js +1 -2
- package/lib/components/dialog-full-screen/dialog-full-screen.component.js +1 -0
- package/lib/components/duelling-picklist/duelling-picklist.component.js +3 -2
- package/lib/components/duelling-picklist/picklist/picklist.component.js +1 -0
- package/lib/components/duelling-picklist/picklist-group/picklist-group.component.js +1 -0
- package/lib/components/duelling-picklist/picklist-item/picklist-item.component.js +1 -0
- package/lib/components/form/__internal__/form-summary.component.js +3 -1
- package/lib/components/form/form.component.js +5 -0
- package/lib/components/inline-inputs/inline-inputs.component.d.ts +1 -1
- package/lib/components/inline-inputs/inline-inputs.component.js +2 -0
- package/lib/components/link-preview/link-preview.style.js +2 -3
- package/lib/components/pager/__internal__/pager-navigation.component.js +1 -0
- package/lib/components/pager/pager.component.js +1 -0
- package/lib/components/pages/pages.component.js +1 -0
- package/lib/components/preview/preview.component.d.ts +14 -4
- package/lib/components/preview/preview.component.js +18 -6
- package/lib/components/preview/preview.style.d.ts +10 -1
- package/lib/components/preview/preview.style.js +81 -5
- package/lib/components/search/search.component.js +3 -2
- package/lib/components/tile-select/__internal__/accordion/accordion.component.js +3 -1
- package/lib/components/tile-select/tile-select-group/tile-select-group.component.js +2 -1
- package/lib/components/tile-select/tile-select.component.js +10 -3
- package/package.json +4 -4
- package/esm/components/preview/__internal__/preview-placeholder.component.d.ts +0 -10
- package/esm/components/preview/__internal__/preview-placeholder.component.js +0 -19
- package/esm/components/preview/__internal__/preview-placeholder.style.d.ts +0 -7
- package/esm/components/preview/__internal__/preview-placeholder.style.js +0 -23
- package/lib/components/preview/__internal__/preview-placeholder.component.d.ts +0 -10
- package/lib/components/preview/__internal__/preview-placeholder.component.js +0 -26
- package/lib/components/preview/__internal__/preview-placeholder.style.d.ts +0 -7
- package/lib/components/preview/__internal__/preview-placeholder.style.js +0 -31
|
@@ -19,11 +19,13 @@ const CharacterCount = ({
|
|
|
19
19
|
const getFormatNumber = (rawValue, locale) => new Intl.NumberFormat(locale).format(rawValue);
|
|
20
20
|
return /*#__PURE__*/React.createElement(StyledCharacterCountWrapper, null, /*#__PURE__*/React.createElement(VisuallyHiddenHint, {
|
|
21
21
|
"data-element": "visually-hidden-hint",
|
|
22
|
+
"data-role": "visually-hidden-hint",
|
|
22
23
|
id: visuallyHiddenHintId
|
|
23
24
|
}, l.characterCount.visuallyHiddenHint(getFormatNumber(limit, l.locale()))), /*#__PURE__*/React.createElement(StyledCharacterCount, {
|
|
24
25
|
"aria-hidden": "true",
|
|
25
26
|
isOverLimit: isOverLimit,
|
|
26
|
-
"data-element": "character-count"
|
|
27
|
+
"data-element": "character-count",
|
|
28
|
+
"data-role": "character-count"
|
|
27
29
|
}, !isOverLimit ? l.characterCount.charactersLeft(limitMinusValue, getFormatNumber(limitMinusValue, l.locale())) : l.characterCount.tooManyCharacters(valueMinusLimit, getFormatNumber(valueMinusLimit, l.locale()))), /*#__PURE__*/React.createElement(VisuallyHiddenCharacterCount, {
|
|
28
30
|
"data-element": "visually-hidden-character-count",
|
|
29
31
|
"data-role": "visually-hidden-character-count",
|
|
@@ -21,7 +21,6 @@ const StyledLabel = styled.label`
|
|
|
21
21
|
color: var(--colorsUtilityYin030);
|
|
22
22
|
`}
|
|
23
23
|
`;
|
|
24
|
-
const DEFAULT_CONTAINER_WIDTH = 30;
|
|
25
24
|
export const StyledLabelContainer = styled.div`
|
|
26
25
|
display: flex;
|
|
27
26
|
align-items: center;
|
|
@@ -43,7 +42,7 @@ export const StyledLabelContainer = styled.div`
|
|
|
43
42
|
padding-left: var(${pl === 1 ? "--spacing100" : "--spacing200"});
|
|
44
43
|
`};
|
|
45
44
|
justify-content: ${align === "right" ? "flex-end" : "flex-start"};
|
|
46
|
-
width: ${width
|
|
45
|
+
width: ${width}%;
|
|
47
46
|
`}
|
|
48
47
|
|
|
49
48
|
${({
|
|
@@ -106,6 +106,7 @@ export const DialogFullScreen = ({
|
|
|
106
106
|
}), dialogTitle(), closeIcon(), /*#__PURE__*/React.createElement(StyledContent, {
|
|
107
107
|
hasHeader: title !== undefined,
|
|
108
108
|
"data-element": "content",
|
|
109
|
+
"data-role": "dialog-full-screen-content",
|
|
109
110
|
ref: contentRef,
|
|
110
111
|
disableContentPadding: disableContentPadding
|
|
111
112
|
}, children))));
|
|
@@ -40,7 +40,8 @@ export const DuellingPicklist = ({
|
|
|
40
40
|
});
|
|
41
41
|
return /*#__PURE__*/React.createElement(StyledDuellingPicklistOverlay, _extends({
|
|
42
42
|
disabled: disabled,
|
|
43
|
-
"data-component": "duelling-picklist"
|
|
43
|
+
"data-component": "duelling-picklist",
|
|
44
|
+
"data-role": "duelling-picklist-overlay"
|
|
44
45
|
}, filterStyledSystemMarginProps(rest)), shouldDisplayLabels && /*#__PURE__*/React.createElement(StyledLabelContainer, null, /*#__PURE__*/React.createElement(StyledLabel, {
|
|
45
46
|
"data-element": "picklist-left-label"
|
|
46
47
|
}, leftLabel), /*#__PURE__*/React.createElement(StyledLabel, {
|
|
@@ -48,7 +49,7 @@ export const DuellingPicklist = ({
|
|
|
48
49
|
}, rightLabel)), shouldDisplayControls && /*#__PURE__*/React.createElement(StyledControlsContainer, null, /*#__PURE__*/React.createElement(StyledControl, {
|
|
49
50
|
"data-element": "picklist-left-control"
|
|
50
51
|
}, leftControls), /*#__PURE__*/React.createElement(StyledControl, {
|
|
51
|
-
"data-element": "picklist-right-
|
|
52
|
+
"data-element": "picklist-right-control"
|
|
52
53
|
}, rightControls)), /*#__PURE__*/React.createElement(FocusContext.Provider, {
|
|
53
54
|
value: {
|
|
54
55
|
setElementToFocus: addElementToFocus,
|
|
@@ -57,6 +57,7 @@ export const Picklist = ({
|
|
|
57
57
|
}, [elementToFocus, index, refs, setElementToFocus]);
|
|
58
58
|
return /*#__PURE__*/React.createElement(StyledPicklist, {
|
|
59
59
|
"data-element": "picklist",
|
|
60
|
+
"data-role": "picklist",
|
|
60
61
|
scrollVariant: "light",
|
|
61
62
|
onKeyDown: handleKeyDown
|
|
62
63
|
}, isEmpty && /*#__PURE__*/React.createElement(StyledEmptyContainer, null, placeholder), /*#__PURE__*/React.createElement(TransitionGroup, {
|
|
@@ -71,6 +71,7 @@ const PicklistGroup = /*#__PURE__*/React.forwardRef(({
|
|
|
71
71
|
onKeyDown: handleKeydown,
|
|
72
72
|
"data-element": "picklist-group"
|
|
73
73
|
}, title, /*#__PURE__*/React.createElement(StyledGroupButton, {
|
|
74
|
+
"data-role": "picklist-group-button",
|
|
74
75
|
buttonType: "secondary",
|
|
75
76
|
destructive: type === "remove",
|
|
76
77
|
iconType: type,
|
|
@@ -75,6 +75,7 @@ const PicklistItem = /*#__PURE__*/React.forwardRef(({
|
|
|
75
75
|
locked: locked,
|
|
76
76
|
ref: picklistItemNodeRef
|
|
77
77
|
}, children, !locked && /*#__PURE__*/React.createElement(StyledButton, {
|
|
78
|
+
"data-role": "picklist-item-button",
|
|
78
79
|
buttonType: "primary",
|
|
79
80
|
destructive: type === "remove",
|
|
80
81
|
iconType: type,
|
|
@@ -18,7 +18,8 @@ export const Summary = ({
|
|
|
18
18
|
if (messages[`${type}Count`]) {
|
|
19
19
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledMessagePrefix, null, message?.[0]), /*#__PURE__*/React.createElement(StyledInternalSummary, {
|
|
20
20
|
type: type,
|
|
21
|
-
"data-element": `${type}s
|
|
21
|
+
"data-element": `${type}s`,
|
|
22
|
+
"data-role": "internal-summary"
|
|
22
23
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
23
24
|
type: type
|
|
24
25
|
}), /*#__PURE__*/React.createElement("span", null, message?.[1])));
|
|
@@ -32,6 +33,7 @@ const FormSummary = ({
|
|
|
32
33
|
return /*#__PURE__*/React.createElement(StyledFormSummary, {
|
|
33
34
|
showSummary: !!(props.errorCount || props.warningCount),
|
|
34
35
|
"data-element": "form-summary",
|
|
36
|
+
"data-role": "form-summary",
|
|
35
37
|
fullWidth: fullWidth
|
|
36
38
|
}, /*#__PURE__*/React.createElement(Summary, _extends({
|
|
37
39
|
type: "error"
|
|
@@ -47,6 +47,7 @@ export const Form = ({
|
|
|
47
47
|
isInModal: isInModal
|
|
48
48
|
}, rest), /*#__PURE__*/React.createElement(StyledFormContent, {
|
|
49
49
|
"data-element": "form-content",
|
|
50
|
+
"data-role": "form-content",
|
|
50
51
|
className: stickyFooter ? "sticky" : "",
|
|
51
52
|
stickyFooter: stickyFooter,
|
|
52
53
|
isInModal: isInModal
|
|
@@ -54,20 +55,24 @@ export const Form = ({
|
|
|
54
55
|
marginBottom: formSpacing[fieldSpacing]
|
|
55
56
|
}, children)), !fullWidthButtons && renderFooter && /*#__PURE__*/React.createElement(StyledFormFooter, _extends({
|
|
56
57
|
"data-element": "form-footer",
|
|
58
|
+
"data-role": "form-footer",
|
|
57
59
|
className: classNames,
|
|
58
60
|
ref: formFooterRef,
|
|
59
61
|
stickyFooter: stickyFooter,
|
|
60
62
|
buttonAlignment: buttonAlignment,
|
|
61
63
|
isInModal: isInModal
|
|
62
64
|
}, footerPadding), leftSideButtons && /*#__PURE__*/React.createElement(StyledLeftButtons, {
|
|
65
|
+
"data-role": "form-left-buttons",
|
|
63
66
|
buttonAlignment: buttonAlignment
|
|
64
67
|
}, leftSideButtons), /*#__PURE__*/React.createElement(FormSummary, {
|
|
65
68
|
errorCount: errorCount,
|
|
66
69
|
warningCount: warningCount
|
|
67
70
|
}, saveButton), rightSideButtons && /*#__PURE__*/React.createElement(StyledRightButtons, {
|
|
71
|
+
"data-role": "form-right-buttons",
|
|
68
72
|
buttonAlignment: buttonAlignment
|
|
69
73
|
}, rightSideButtons)), fullWidthButtons && renderFooter && /*#__PURE__*/React.createElement(StyledFormFooter, _extends({
|
|
70
74
|
"data-element": "form-footer",
|
|
75
|
+
"data-role": "form-footer",
|
|
71
76
|
className: classNames,
|
|
72
77
|
ref: formFooterRef,
|
|
73
78
|
stickyFooter: stickyFooter,
|
|
@@ -16,7 +16,7 @@ export interface InlineInputsProps extends MarginProps, StyledContentContainerPr
|
|
|
16
16
|
labelAlign?: "left" | "right";
|
|
17
17
|
/**
|
|
18
18
|
* Custom label id, could be used in combination with aria-labelledby prop of each input,
|
|
19
|
-
* to make them
|
|
19
|
+
* to make them accessible for screen readers.
|
|
20
20
|
*/
|
|
21
21
|
labelId?: string;
|
|
22
22
|
/** Flag to configure component as mandatory. */
|
|
@@ -57,6 +57,7 @@ const InlineInputs = ({
|
|
|
57
57
|
return /*#__PURE__*/React.createElement(StyledInlineInputs, _extends({
|
|
58
58
|
gutter: gutter,
|
|
59
59
|
"data-component": "inline-inputs",
|
|
60
|
+
"data-role": "inline-inputs",
|
|
60
61
|
className: className,
|
|
61
62
|
labelWidth: labelWidth,
|
|
62
63
|
labelInline: inlineLabel,
|
|
@@ -64,6 +65,7 @@ const InlineInputs = ({
|
|
|
64
65
|
}, marginProps), renderLabel(), /*#__PURE__*/React.createElement(StyledContentContainer, {
|
|
65
66
|
gutter: gutter,
|
|
66
67
|
"data-element": "inline-inputs-container",
|
|
68
|
+
"data-role": "inline-inputs-container",
|
|
67
69
|
inputWidth: inputWidth
|
|
68
70
|
}, /*#__PURE__*/React.createElement(FormSpacingProvider, {
|
|
69
71
|
marginBottom: undefined
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import { StyledPreview } from "../preview/preview.style";
|
|
3
|
-
import { StyledPreviewPlaceholder } from "../preview/__internal__/preview-placeholder.style";
|
|
2
|
+
import { StyledPreview, StyledPreviewPlaceholder } from "../preview/preview.style";
|
|
4
3
|
import addFocusStyling from "../../style/utils/add-focus-styling";
|
|
5
4
|
import baseTheme from "../../style/themes/base";
|
|
6
5
|
const oldFocusStyling = `
|
|
@@ -88,6 +88,7 @@ const PagerNavigation = ({
|
|
|
88
88
|
onKeyUp: ev => Events.isEnterKey(ev) ? handlePageInputChange(ev) : false
|
|
89
89
|
}), /*#__PURE__*/React.createElement(StyledPagerNoSelect, null, l.pager.ofY(pageCount))) : /*#__PURE__*/React.createElement(StyledPagerNavLabel, {
|
|
90
90
|
"data-element": "current-page-label",
|
|
91
|
+
"data-role": "current-page-label",
|
|
91
92
|
id: currentPageId,
|
|
92
93
|
"aria-live": "polite"
|
|
93
94
|
}, navLabelString)), !hasOnePage && renderButtonsAfterCount());
|
|
@@ -125,6 +125,7 @@ export const Pager = ({
|
|
|
125
125
|
const renderTotalRecords = () => showTotalRecords && l.pager.records(totalRecords);
|
|
126
126
|
return /*#__PURE__*/React.createElement(StyledPagerContainer, _extends({
|
|
127
127
|
"data-component": "pager",
|
|
128
|
+
"data-role": "pager",
|
|
128
129
|
variant: variant
|
|
129
130
|
}, rest), /*#__PURE__*/React.createElement(StyledPagerSizeOptions, null, renderPageSizeOptions()), /*#__PURE__*/React.createElement(PagerNavigation, {
|
|
130
131
|
pageSize: currentPageSize,
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
|
-
|
|
4
|
-
export interface PreviewProps extends
|
|
3
|
+
export declare type Shapes = "text" | "rectangle" | "rectangle-round" | "circle";
|
|
4
|
+
export interface PreviewProps extends MarginProps {
|
|
5
5
|
/** Children content to render in the component. */
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
-
/**
|
|
7
|
+
/** Sets loading state. */
|
|
8
8
|
loading?: boolean;
|
|
9
|
+
/** Sets the height of the Preview. */
|
|
10
|
+
height?: string;
|
|
11
|
+
/** Sets the width of the Preview. */
|
|
12
|
+
width?: string;
|
|
13
|
+
/** The number of placeholder shapes to render. */
|
|
14
|
+
lines?: number;
|
|
15
|
+
/** Sets the preview's shape. */
|
|
16
|
+
shape?: Shapes;
|
|
17
|
+
/** Removes Preview's animation, is true when prefer reduce-motion is on. */
|
|
18
|
+
disableAnimation?: boolean;
|
|
9
19
|
}
|
|
10
|
-
export declare const Preview: ({ children, loading, lines, ...props }: PreviewProps) => React.JSX.Element;
|
|
20
|
+
export declare const Preview: ({ children, loading, lines, height, width, shape, disableAnimation, ...props }: PreviewProps) => React.JSX.Element;
|
|
11
21
|
export default Preview;
|
|
@@ -1,25 +1,37 @@
|
|
|
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
2
|
import React from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import
|
|
5
|
-
import { StyledPreview } from "./preview.style";
|
|
4
|
+
import { StyledPreview, StyledPreviewPlaceholder } from "./preview.style";
|
|
6
5
|
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
6
|
+
import useMediaQuery from "../../hooks/useMediaQuery";
|
|
7
7
|
export const Preview = ({
|
|
8
8
|
children,
|
|
9
9
|
loading,
|
|
10
10
|
lines = 1,
|
|
11
|
+
height,
|
|
12
|
+
width,
|
|
13
|
+
shape = "text",
|
|
14
|
+
disableAnimation,
|
|
11
15
|
...props
|
|
12
16
|
}) => {
|
|
13
17
|
const marginProps = filterStyledSystemMarginProps(props);
|
|
14
|
-
const hasPlaceholder = loading
|
|
18
|
+
const hasPlaceholder = loading ?? !children;
|
|
19
|
+
const isLastLine = index => {
|
|
20
|
+
return lines > 1 && lines === index + 1;
|
|
21
|
+
};
|
|
22
|
+
const reduceMotion = !useMediaQuery("screen and (prefers-reduced-motion: no-preference)");
|
|
15
23
|
if (hasPlaceholder) {
|
|
16
24
|
const placeholders = [];
|
|
17
|
-
for (let i =
|
|
18
|
-
placeholders.push( /*#__PURE__*/React.createElement(
|
|
25
|
+
for (let i = 0; i < lines; i++) {
|
|
26
|
+
placeholders.push( /*#__PURE__*/React.createElement(StyledPreviewPlaceholder, _extends({
|
|
27
|
+
"data-component": "preview",
|
|
19
28
|
"data-role": "preview-placeholder",
|
|
20
29
|
key: i,
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
height: height,
|
|
31
|
+
width: width,
|
|
32
|
+
isLastLine: isLastLine(i),
|
|
33
|
+
shape: shape,
|
|
34
|
+
disableAnimation: disableAnimation || reduceMotion
|
|
23
35
|
}, props)));
|
|
24
36
|
}
|
|
25
37
|
return /*#__PURE__*/React.createElement(StyledPreview, marginProps, placeholders);
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
import { Shapes } from "./preview.component";
|
|
1
2
|
declare const StyledPreview: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
|
|
3
|
+
interface StyledPreviewPlaceholderProps {
|
|
4
|
+
height?: string;
|
|
5
|
+
width?: string;
|
|
6
|
+
shape: Shapes;
|
|
7
|
+
disableAnimation?: boolean;
|
|
8
|
+
isLastLine: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const StyledPreviewPlaceholder: import("styled-components").StyledComponent<"span", any, StyledPreviewPlaceholderProps, never>;
|
|
11
|
+
export { StyledPreview, StyledPreviewPlaceholder };
|
|
@@ -1,12 +1,86 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
1
|
+
import styled, { css, keyframes } from "styled-components";
|
|
2
2
|
import { margin } from "styled-system";
|
|
3
3
|
import baseTheme from "../../style/themes/base";
|
|
4
4
|
const StyledPreview = styled.div`
|
|
5
5
|
${margin}
|
|
6
6
|
`;
|
|
7
|
+
const shimmer = keyframes`
|
|
8
|
+
0% {
|
|
9
|
+
opacity: 0.1
|
|
10
|
+
}
|
|
11
|
+
70% {
|
|
12
|
+
opacity: 1
|
|
13
|
+
}
|
|
14
|
+
100% {
|
|
15
|
+
opacity: 0.1
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
function getBorderRadius(shape) {
|
|
19
|
+
switch (shape) {
|
|
20
|
+
case "rectangle-round":
|
|
21
|
+
return "var(--borderRadius400)";
|
|
22
|
+
case "circle":
|
|
23
|
+
return "var(--borderRadiusCircle)";
|
|
24
|
+
default:
|
|
25
|
+
return "var(--borderRadius100)";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function getHeight(shape) {
|
|
29
|
+
if (shape.includes("rectangle")) {
|
|
30
|
+
return "var(--sizing400)";
|
|
31
|
+
}
|
|
32
|
+
switch (shape) {
|
|
33
|
+
case "circle":
|
|
34
|
+
return "var(--sizing700)";
|
|
35
|
+
default:
|
|
36
|
+
return "var(--sizing175)";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function getWidth(shape) {
|
|
40
|
+
if (shape.includes("rectangle")) {
|
|
41
|
+
return "var(--sizing1500)";
|
|
42
|
+
}
|
|
43
|
+
return "100%";
|
|
44
|
+
}
|
|
45
|
+
const StyledPreviewPlaceholder = styled.span`
|
|
46
|
+
${({
|
|
47
|
+
shape,
|
|
48
|
+
disableAnimation,
|
|
49
|
+
isLastLine,
|
|
50
|
+
height,
|
|
51
|
+
width
|
|
52
|
+
}) => {
|
|
53
|
+
return css`
|
|
54
|
+
display: block;
|
|
55
|
+
background: linear-gradient(
|
|
56
|
+
135deg,
|
|
57
|
+
var(--colorsUtilityMajor100),
|
|
58
|
+
var(--colorsUtilityMajor040)
|
|
59
|
+
);
|
|
60
|
+
border-radius: ${getBorderRadius(shape)};
|
|
61
|
+
height: ${height || getHeight(shape)};
|
|
62
|
+
width: ${width || getWidth(shape)};
|
|
63
|
+
animation: ${shimmer} 2s ease infinite;
|
|
64
|
+
|
|
65
|
+
${isLastLine && shape === "text" && css`
|
|
66
|
+
width: calc(${width || getWidth(shape)}*0.8);
|
|
67
|
+
`}
|
|
68
|
+
|
|
69
|
+
${shape === "circle" && css`
|
|
70
|
+
width: ${height || getHeight(shape)};
|
|
71
|
+
`}
|
|
72
|
+
|
|
73
|
+
${disableAnimation && css`
|
|
74
|
+
animation: none;
|
|
75
|
+
`}
|
|
76
|
+
|
|
77
|
+
& + & {
|
|
78
|
+
margin-top: 6px;
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
}}
|
|
82
|
+
`;
|
|
7
83
|
StyledPreview.defaultProps = {
|
|
8
84
|
theme: baseTheme
|
|
9
85
|
};
|
|
10
|
-
|
|
11
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
12
|
-
export { StyledPreview };
|
|
86
|
+
export { StyledPreview, StyledPreviewPlaceholder };
|
|
@@ -3,7 +3,6 @@ import React, { useState, useRef, useImperativeHandle } from "react";
|
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import invariant from "invariant";
|
|
5
5
|
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
6
|
-
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
7
6
|
import StyledSearch from "./search.style";
|
|
8
7
|
import StyledSearchButton from "./search-button.style";
|
|
9
8
|
import Icon from "../icon";
|
|
@@ -141,7 +140,9 @@ const Search = /*#__PURE__*/React.forwardRef(({
|
|
|
141
140
|
showSearchButton: !!searchButton,
|
|
142
141
|
variant: variant,
|
|
143
142
|
mb: 0
|
|
144
|
-
}, filterStyledSystemMarginProps(rest),
|
|
143
|
+
}, filterStyledSystemMarginProps(rest), {
|
|
144
|
+
"data-component": "search",
|
|
145
|
+
"data-role": "search",
|
|
145
146
|
id: id,
|
|
146
147
|
name: name
|
|
147
148
|
}, rest), /*#__PURE__*/React.createElement(Textbox, {
|
|
@@ -19,10 +19,12 @@ const Accordion = ({
|
|
|
19
19
|
return /*#__PURE__*/React.createElement(StyledContentContainer, {
|
|
20
20
|
"aria-expanded": expanded,
|
|
21
21
|
isExpanded: expanded,
|
|
22
|
-
maxHeight: contentHeight
|
|
22
|
+
maxHeight: contentHeight,
|
|
23
|
+
"data-role": "tile-select-accordion-content-container"
|
|
23
24
|
}, /*#__PURE__*/React.createElement(StyledContent, {
|
|
24
25
|
role: "region",
|
|
25
26
|
"data-element": "tile-select-accordion-content",
|
|
27
|
+
"data-role": "tile-select-accordion-content",
|
|
26
28
|
ref: contentRef,
|
|
27
29
|
id: contentId,
|
|
28
30
|
"aria-labelledby": controlId
|
|
@@ -24,7 +24,8 @@ export const TileSelectGroup = ({
|
|
|
24
24
|
name: name,
|
|
25
25
|
onBlur: onBlur,
|
|
26
26
|
onChange: onChange,
|
|
27
|
-
value: value
|
|
27
|
+
value: value,
|
|
28
|
+
"data-role": "tile-select-group-radio-button-mapper"
|
|
28
29
|
}, React.Children.map(children, child => {
|
|
29
30
|
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
30
31
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
@@ -50,6 +50,7 @@ const TileSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
const renderActionButton = () => /*#__PURE__*/React.createElement(StyledDeselectWrapper, {
|
|
53
|
+
"data-role": "deselect-wrapper",
|
|
53
54
|
hasActionAdornment: !!actionButtonAdornment
|
|
54
55
|
}, customActionButton && customActionButton(handleDeselect), !customActionButton && checked && /*#__PURE__*/React.createElement(Button, {
|
|
55
56
|
buttonType: "tertiary",
|
|
@@ -70,6 +71,7 @@ const TileSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
70
71
|
className: className,
|
|
71
72
|
disabled: disabled
|
|
72
73
|
}, tagComponent("tile-select", rest), filterStyledSystemMarginProps(rest)), /*#__PURE__*/React.createElement(StyledFocusWrapper, {
|
|
74
|
+
"data-role": "focus-wrapper",
|
|
73
75
|
hasFocus: hasFocus,
|
|
74
76
|
checked: checked
|
|
75
77
|
}, /*#__PURE__*/React.createElement(StyledTileSelectInput, _extends({
|
|
@@ -104,13 +106,18 @@ const TileSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
104
106
|
}, title), subtitle && /*#__PURE__*/React.createElement(StyledSubtitle, {
|
|
105
107
|
as: checkPropTypeIsNode(subtitle) ? "div" : undefined
|
|
106
108
|
}, subtitle), titleAdornment && /*#__PURE__*/React.createElement(StyledAdornment, {
|
|
107
|
-
hasAdditionalInformation: !!additionalInformation
|
|
109
|
+
hasAdditionalInformation: !!additionalInformation,
|
|
110
|
+
"data-role": "title-adornment"
|
|
108
111
|
}, titleAdornment && /*#__PURE__*/React.createElement("div", null, titleAdornment))), additionalInformation && /*#__PURE__*/React.createElement("div", null, additionalInformation), /*#__PURE__*/React.createElement(StyledDescription, {
|
|
109
112
|
as: checkPropTypeIsNode(description) ? "div" : undefined
|
|
110
|
-
}, description), footer && /*#__PURE__*/React.createElement(StyledFooterWrapper,
|
|
111
|
-
|
|
113
|
+
}, description), footer && /*#__PURE__*/React.createElement(StyledFooterWrapper, {
|
|
114
|
+
"data-role": "tile-select-footer"
|
|
115
|
+
}, footer), accordionContent && accordionControl && /*#__PURE__*/React.createElement(StyledAccordionFooterWrapper, {
|
|
116
|
+
accordionExpanded: accordionExpanded,
|
|
117
|
+
"data-role": "accordion-footer"
|
|
112
118
|
}, accordionControl(controlId, contentId))), prefixAdornment && /*#__PURE__*/React.createElement(Box, {
|
|
113
119
|
"data-element": "prefix-adornment",
|
|
120
|
+
"data-role": "prefix-adornment",
|
|
114
121
|
mr: 3,
|
|
115
122
|
opacity: disabled ? "0.3" : undefined
|
|
116
123
|
}, prefixAdornment))), accordionContent && /*#__PURE__*/React.createElement(Accordion, {
|
|
@@ -26,11 +26,13 @@ const CharacterCount = ({
|
|
|
26
26
|
const getFormatNumber = (rawValue, locale) => new Intl.NumberFormat(locale).format(rawValue);
|
|
27
27
|
return /*#__PURE__*/_react.default.createElement(_characterCount.StyledCharacterCountWrapper, null, /*#__PURE__*/_react.default.createElement(_characterCount.VisuallyHiddenHint, {
|
|
28
28
|
"data-element": "visually-hidden-hint",
|
|
29
|
+
"data-role": "visually-hidden-hint",
|
|
29
30
|
id: visuallyHiddenHintId
|
|
30
31
|
}, l.characterCount.visuallyHiddenHint(getFormatNumber(limit, l.locale()))), /*#__PURE__*/_react.default.createElement(_characterCount.StyledCharacterCount, {
|
|
31
32
|
"aria-hidden": "true",
|
|
32
33
|
isOverLimit: isOverLimit,
|
|
33
|
-
"data-element": "character-count"
|
|
34
|
+
"data-element": "character-count",
|
|
35
|
+
"data-role": "character-count"
|
|
34
36
|
}, !isOverLimit ? l.characterCount.charactersLeft(limitMinusValue, getFormatNumber(limitMinusValue, l.locale())) : l.characterCount.tooManyCharacters(valueMinusLimit, getFormatNumber(valueMinusLimit, l.locale()))), /*#__PURE__*/_react.default.createElement(_characterCount.VisuallyHiddenCharacterCount, {
|
|
35
37
|
"data-element": "visually-hidden-character-count",
|
|
36
38
|
"data-role": "visually-hidden-character-count",
|
|
@@ -29,7 +29,6 @@ const StyledLabel = _styledComponents.default.label`
|
|
|
29
29
|
color: var(--colorsUtilityYin030);
|
|
30
30
|
`}
|
|
31
31
|
`;
|
|
32
|
-
const DEFAULT_CONTAINER_WIDTH = 30;
|
|
33
32
|
const StyledLabelContainer = exports.StyledLabelContainer = _styledComponents.default.div`
|
|
34
33
|
display: flex;
|
|
35
34
|
align-items: center;
|
|
@@ -51,7 +50,7 @@ const StyledLabelContainer = exports.StyledLabelContainer = _styledComponents.de
|
|
|
51
50
|
padding-left: var(${pl === 1 ? "--spacing100" : "--spacing200"});
|
|
52
51
|
`};
|
|
53
52
|
justify-content: ${align === "right" ? "flex-end" : "flex-start"};
|
|
54
|
-
width: ${width
|
|
53
|
+
width: ${width}%;
|
|
55
54
|
`}
|
|
56
55
|
|
|
57
56
|
${({
|
|
@@ -115,6 +115,7 @@ const DialogFullScreen = ({
|
|
|
115
115
|
}), dialogTitle(), closeIcon(), /*#__PURE__*/_react.default.createElement(_content.default, {
|
|
116
116
|
hasHeader: title !== undefined,
|
|
117
117
|
"data-element": "content",
|
|
118
|
+
"data-role": "dialog-full-screen-content",
|
|
118
119
|
ref: contentRef,
|
|
119
120
|
disableContentPadding: disableContentPadding
|
|
120
121
|
}, children))));
|
|
@@ -49,7 +49,8 @@ const DuellingPicklist = ({
|
|
|
49
49
|
});
|
|
50
50
|
return /*#__PURE__*/_react.default.createElement(_duellingPicklist.StyledDuellingPicklistOverlay, _extends({
|
|
51
51
|
disabled: disabled,
|
|
52
|
-
"data-component": "duelling-picklist"
|
|
52
|
+
"data-component": "duelling-picklist",
|
|
53
|
+
"data-role": "duelling-picklist-overlay"
|
|
53
54
|
}, (0, _utils.filterStyledSystemMarginProps)(rest)), shouldDisplayLabels && /*#__PURE__*/_react.default.createElement(_duellingPicklist.StyledLabelContainer, null, /*#__PURE__*/_react.default.createElement(_duellingPicklist.StyledLabel, {
|
|
54
55
|
"data-element": "picklist-left-label"
|
|
55
56
|
}, leftLabel), /*#__PURE__*/_react.default.createElement(_duellingPicklist.StyledLabel, {
|
|
@@ -57,7 +58,7 @@ const DuellingPicklist = ({
|
|
|
57
58
|
}, rightLabel)), shouldDisplayControls && /*#__PURE__*/_react.default.createElement(_duellingPicklist.StyledControlsContainer, null, /*#__PURE__*/_react.default.createElement(_duellingPicklist.StyledControl, {
|
|
58
59
|
"data-element": "picklist-left-control"
|
|
59
60
|
}, leftControls), /*#__PURE__*/_react.default.createElement(_duellingPicklist.StyledControl, {
|
|
60
|
-
"data-element": "picklist-right-
|
|
61
|
+
"data-element": "picklist-right-control"
|
|
61
62
|
}, rightControls)), /*#__PURE__*/_react.default.createElement(_duellingPicklist2.default.Provider, {
|
|
62
63
|
value: {
|
|
63
64
|
setElementToFocus: addElementToFocus,
|
|
@@ -66,6 +66,7 @@ const Picklist = ({
|
|
|
66
66
|
}, [elementToFocus, index, refs, setElementToFocus]);
|
|
67
67
|
return /*#__PURE__*/_react.default.createElement(_picklist.StyledPicklist, {
|
|
68
68
|
"data-element": "picklist",
|
|
69
|
+
"data-role": "picklist",
|
|
69
70
|
scrollVariant: "light",
|
|
70
71
|
onKeyDown: handleKeyDown
|
|
71
72
|
}, isEmpty && /*#__PURE__*/_react.default.createElement(_picklist.StyledEmptyContainer, null, placeholder), /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.TransitionGroup, {
|
|
@@ -80,6 +80,7 @@ const PicklistGroup = exports.PicklistGroup = /*#__PURE__*/_react.default.forwar
|
|
|
80
80
|
onKeyDown: handleKeydown,
|
|
81
81
|
"data-element": "picklist-group"
|
|
82
82
|
}, title, /*#__PURE__*/_react.default.createElement(_picklistGroup.StyledGroupButton, {
|
|
83
|
+
"data-role": "picklist-group-button",
|
|
83
84
|
buttonType: "secondary",
|
|
84
85
|
destructive: type === "remove",
|
|
85
86
|
iconType: type,
|
|
@@ -84,6 +84,7 @@ const PicklistItem = exports.PicklistItem = /*#__PURE__*/_react.default.forwardR
|
|
|
84
84
|
locked: locked,
|
|
85
85
|
ref: picklistItemNodeRef
|
|
86
86
|
}, children, !locked && /*#__PURE__*/_react.default.createElement(_picklistItem.StyledButton, {
|
|
87
|
+
"data-role": "picklist-item-button",
|
|
87
88
|
buttonType: "primary",
|
|
88
89
|
destructive: type === "remove",
|
|
89
90
|
iconType: type,
|
|
@@ -27,7 +27,8 @@ const Summary = ({
|
|
|
27
27
|
if (messages[`${type}Count`]) {
|
|
28
28
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_formSummary.StyledMessagePrefix, null, message?.[0]), /*#__PURE__*/_react.default.createElement(_formSummary.StyledInternalSummary, {
|
|
29
29
|
type: type,
|
|
30
|
-
"data-element": `${type}s
|
|
30
|
+
"data-element": `${type}s`,
|
|
31
|
+
"data-role": "internal-summary"
|
|
31
32
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
32
33
|
type: type
|
|
33
34
|
}), /*#__PURE__*/_react.default.createElement("span", null, message?.[1])));
|
|
@@ -42,6 +43,7 @@ const FormSummary = ({
|
|
|
42
43
|
return /*#__PURE__*/_react.default.createElement(_formSummary.StyledFormSummary, {
|
|
43
44
|
showSummary: !!(props.errorCount || props.warningCount),
|
|
44
45
|
"data-element": "form-summary",
|
|
46
|
+
"data-role": "form-summary",
|
|
45
47
|
fullWidth: fullWidth
|
|
46
48
|
}, /*#__PURE__*/_react.default.createElement(Summary, _extends({
|
|
47
49
|
type: "error"
|
|
@@ -56,6 +56,7 @@ const Form = ({
|
|
|
56
56
|
isInModal: isInModal
|
|
57
57
|
}, rest), /*#__PURE__*/_react.default.createElement(_form.StyledFormContent, {
|
|
58
58
|
"data-element": "form-content",
|
|
59
|
+
"data-role": "form-content",
|
|
59
60
|
className: stickyFooter ? "sticky" : "",
|
|
60
61
|
stickyFooter: stickyFooter,
|
|
61
62
|
isInModal: isInModal
|
|
@@ -63,20 +64,24 @@ const Form = ({
|
|
|
63
64
|
marginBottom: _form2.formSpacing[fieldSpacing]
|
|
64
65
|
}, children)), !fullWidthButtons && renderFooter && /*#__PURE__*/_react.default.createElement(_form.StyledFormFooter, _extends({
|
|
65
66
|
"data-element": "form-footer",
|
|
67
|
+
"data-role": "form-footer",
|
|
66
68
|
className: classNames,
|
|
67
69
|
ref: formFooterRef,
|
|
68
70
|
stickyFooter: stickyFooter,
|
|
69
71
|
buttonAlignment: buttonAlignment,
|
|
70
72
|
isInModal: isInModal
|
|
71
73
|
}, footerPadding), leftSideButtons && /*#__PURE__*/_react.default.createElement(_form.StyledLeftButtons, {
|
|
74
|
+
"data-role": "form-left-buttons",
|
|
72
75
|
buttonAlignment: buttonAlignment
|
|
73
76
|
}, leftSideButtons), /*#__PURE__*/_react.default.createElement(_formSummary.default, {
|
|
74
77
|
errorCount: errorCount,
|
|
75
78
|
warningCount: warningCount
|
|
76
79
|
}, saveButton), rightSideButtons && /*#__PURE__*/_react.default.createElement(_form.StyledRightButtons, {
|
|
80
|
+
"data-role": "form-right-buttons",
|
|
77
81
|
buttonAlignment: buttonAlignment
|
|
78
82
|
}, rightSideButtons)), fullWidthButtons && renderFooter && /*#__PURE__*/_react.default.createElement(_form.StyledFormFooter, _extends({
|
|
79
83
|
"data-element": "form-footer",
|
|
84
|
+
"data-role": "form-footer",
|
|
80
85
|
className: classNames,
|
|
81
86
|
ref: formFooterRef,
|
|
82
87
|
stickyFooter: stickyFooter,
|
|
@@ -16,7 +16,7 @@ export interface InlineInputsProps extends MarginProps, StyledContentContainerPr
|
|
|
16
16
|
labelAlign?: "left" | "right";
|
|
17
17
|
/**
|
|
18
18
|
* Custom label id, could be used in combination with aria-labelledby prop of each input,
|
|
19
|
-
* to make them
|
|
19
|
+
* to make them accessible for screen readers.
|
|
20
20
|
*/
|
|
21
21
|
labelId?: string;
|
|
22
22
|
/** Flag to configure component as mandatory. */
|
|
@@ -66,6 +66,7 @@ const InlineInputs = ({
|
|
|
66
66
|
return /*#__PURE__*/_react.default.createElement(_inlineInputs.default, _extends({
|
|
67
67
|
gutter: gutter,
|
|
68
68
|
"data-component": "inline-inputs",
|
|
69
|
+
"data-role": "inline-inputs",
|
|
69
70
|
className: className,
|
|
70
71
|
labelWidth: labelWidth,
|
|
71
72
|
labelInline: inlineLabel,
|
|
@@ -73,6 +74,7 @@ const InlineInputs = ({
|
|
|
73
74
|
}, marginProps), renderLabel(), /*#__PURE__*/_react.default.createElement(_inlineInputs.StyledContentContainer, {
|
|
74
75
|
gutter: gutter,
|
|
75
76
|
"data-element": "inline-inputs-container",
|
|
77
|
+
"data-role": "inline-inputs-container",
|
|
76
78
|
inputWidth: inputWidth
|
|
77
79
|
}, /*#__PURE__*/_react.default.createElement(_formSpacingProvider.default, {
|
|
78
80
|
marginBottom: undefined
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.StyledUrl = exports.StyledTitle = exports.StyledPreviewWrapper = exports.StyledLinkPreview = exports.StyledDescription = exports.StyledCloseIconWrapper = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
8
|
var _preview = require("../preview/preview.style");
|
|
9
|
-
var _previewPlaceholder = require("../preview/__internal__/preview-placeholder.style");
|
|
10
9
|
var _addFocusStyling = _interopRequireDefault(require("../../style/utils/add-focus-styling"));
|
|
11
10
|
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -64,11 +63,11 @@ const StyledPreviewWrapper = exports.StyledPreviewWrapper = _styledComponents.de
|
|
|
64
63
|
}
|
|
65
64
|
`}
|
|
66
65
|
|
|
67
|
-
${
|
|
66
|
+
${_preview.StyledPreviewPlaceholder}:first-of-type {
|
|
68
67
|
margin-top: 8px;
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
${
|
|
70
|
+
${_preview.StyledPreviewPlaceholder}:not(:first-of-type) {
|
|
72
71
|
margin-top: 16px;
|
|
73
72
|
}
|
|
74
73
|
`;
|
|
@@ -97,6 +97,7 @@ const PagerNavigation = ({
|
|
|
97
97
|
onKeyUp: ev => _events.default.isEnterKey(ev) ? handlePageInputChange(ev) : false
|
|
98
98
|
}), /*#__PURE__*/_react.default.createElement(_pager.StyledPagerNoSelect, null, l.pager.ofY(pageCount))) : /*#__PURE__*/_react.default.createElement(_pager.StyledPagerNavLabel, {
|
|
99
99
|
"data-element": "current-page-label",
|
|
100
|
+
"data-role": "current-page-label",
|
|
100
101
|
id: currentPageId,
|
|
101
102
|
"aria-live": "polite"
|
|
102
103
|
}, navLabelString)), !hasOnePage && renderButtonsAfterCount());
|
|
@@ -134,6 +134,7 @@ const Pager = ({
|
|
|
134
134
|
const renderTotalRecords = () => showTotalRecords && l.pager.records(totalRecords);
|
|
135
135
|
return /*#__PURE__*/_react.default.createElement(_pager.StyledPagerContainer, _extends({
|
|
136
136
|
"data-component": "pager",
|
|
137
|
+
"data-role": "pager",
|
|
137
138
|
variant: variant
|
|
138
139
|
}, rest), /*#__PURE__*/_react.default.createElement(_pager.StyledPagerSizeOptions, null, renderPageSizeOptions()), /*#__PURE__*/_react.default.createElement(_pagerNavigation.default, {
|
|
139
140
|
pageSize: currentPageSize,
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
|
-
|
|
4
|
-
export interface PreviewProps extends
|
|
3
|
+
export declare type Shapes = "text" | "rectangle" | "rectangle-round" | "circle";
|
|
4
|
+
export interface PreviewProps extends MarginProps {
|
|
5
5
|
/** Children content to render in the component. */
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
-
/**
|
|
7
|
+
/** Sets loading state. */
|
|
8
8
|
loading?: boolean;
|
|
9
|
+
/** Sets the height of the Preview. */
|
|
10
|
+
height?: string;
|
|
11
|
+
/** Sets the width of the Preview. */
|
|
12
|
+
width?: string;
|
|
13
|
+
/** The number of placeholder shapes to render. */
|
|
14
|
+
lines?: number;
|
|
15
|
+
/** Sets the preview's shape. */
|
|
16
|
+
shape?: Shapes;
|
|
17
|
+
/** Removes Preview's animation, is true when prefer reduce-motion is on. */
|
|
18
|
+
disableAnimation?: boolean;
|
|
9
19
|
}
|
|
10
|
-
export declare const Preview: ({ children, loading, lines, ...props }: PreviewProps) => React.JSX.Element;
|
|
20
|
+
export declare const Preview: ({ children, loading, lines, height, width, shape, disableAnimation, ...props }: PreviewProps) => React.JSX.Element;
|
|
11
21
|
export default Preview;
|
|
@@ -6,27 +6,39 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.Preview = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _previewPlaceholder = _interopRequireDefault(require("./__internal__/preview-placeholder.component"));
|
|
10
9
|
var _preview = require("./preview.style");
|
|
11
10
|
var _utils = require("../../style/utils");
|
|
11
|
+
var _useMediaQuery = _interopRequireDefault(require("../../hooks/useMediaQuery"));
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
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); }
|
|
14
14
|
const Preview = ({
|
|
15
15
|
children,
|
|
16
16
|
loading,
|
|
17
17
|
lines = 1,
|
|
18
|
+
height,
|
|
19
|
+
width,
|
|
20
|
+
shape = "text",
|
|
21
|
+
disableAnimation,
|
|
18
22
|
...props
|
|
19
23
|
}) => {
|
|
20
24
|
const marginProps = (0, _utils.filterStyledSystemMarginProps)(props);
|
|
21
|
-
const hasPlaceholder = loading
|
|
25
|
+
const hasPlaceholder = loading ?? !children;
|
|
26
|
+
const isLastLine = index => {
|
|
27
|
+
return lines > 1 && lines === index + 1;
|
|
28
|
+
};
|
|
29
|
+
const reduceMotion = !(0, _useMediaQuery.default)("screen and (prefers-reduced-motion: no-preference)");
|
|
22
30
|
if (hasPlaceholder) {
|
|
23
31
|
const placeholders = [];
|
|
24
|
-
for (let i =
|
|
25
|
-
placeholders.push( /*#__PURE__*/_react.default.createElement(
|
|
32
|
+
for (let i = 0; i < lines; i++) {
|
|
33
|
+
placeholders.push( /*#__PURE__*/_react.default.createElement(_preview.StyledPreviewPlaceholder, _extends({
|
|
34
|
+
"data-component": "preview",
|
|
26
35
|
"data-role": "preview-placeholder",
|
|
27
36
|
key: i,
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
height: height,
|
|
38
|
+
width: width,
|
|
39
|
+
isLastLine: isLastLine(i),
|
|
40
|
+
shape: shape,
|
|
41
|
+
disableAnimation: disableAnimation || reduceMotion
|
|
30
42
|
}, props)));
|
|
31
43
|
}
|
|
32
44
|
return /*#__PURE__*/_react.default.createElement(_preview.StyledPreview, marginProps, placeholders);
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
import { Shapes } from "./preview.component";
|
|
1
2
|
declare const StyledPreview: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
|
|
3
|
+
interface StyledPreviewPlaceholderProps {
|
|
4
|
+
height?: string;
|
|
5
|
+
width?: string;
|
|
6
|
+
shape: Shapes;
|
|
7
|
+
disableAnimation?: boolean;
|
|
8
|
+
isLastLine: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const StyledPreviewPlaceholder: import("styled-components").StyledComponent<"span", any, StyledPreviewPlaceholderProps, never>;
|
|
11
|
+
export { StyledPreview, StyledPreviewPlaceholder };
|
|
@@ -3,16 +3,92 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StyledPreview = void 0;
|
|
7
|
-
var _styledComponents =
|
|
6
|
+
exports.StyledPreviewPlaceholder = exports.StyledPreview = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
8
|
var _styledSystem = require("styled-system");
|
|
9
9
|
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
13
|
const StyledPreview = exports.StyledPreview = _styledComponents.default.div`
|
|
12
14
|
${_styledSystem.margin}
|
|
13
15
|
`;
|
|
16
|
+
const shimmer = (0, _styledComponents.keyframes)`
|
|
17
|
+
0% {
|
|
18
|
+
opacity: 0.1
|
|
19
|
+
}
|
|
20
|
+
70% {
|
|
21
|
+
opacity: 1
|
|
22
|
+
}
|
|
23
|
+
100% {
|
|
24
|
+
opacity: 0.1
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
function getBorderRadius(shape) {
|
|
28
|
+
switch (shape) {
|
|
29
|
+
case "rectangle-round":
|
|
30
|
+
return "var(--borderRadius400)";
|
|
31
|
+
case "circle":
|
|
32
|
+
return "var(--borderRadiusCircle)";
|
|
33
|
+
default:
|
|
34
|
+
return "var(--borderRadius100)";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function getHeight(shape) {
|
|
38
|
+
if (shape.includes("rectangle")) {
|
|
39
|
+
return "var(--sizing400)";
|
|
40
|
+
}
|
|
41
|
+
switch (shape) {
|
|
42
|
+
case "circle":
|
|
43
|
+
return "var(--sizing700)";
|
|
44
|
+
default:
|
|
45
|
+
return "var(--sizing175)";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function getWidth(shape) {
|
|
49
|
+
if (shape.includes("rectangle")) {
|
|
50
|
+
return "var(--sizing1500)";
|
|
51
|
+
}
|
|
52
|
+
return "100%";
|
|
53
|
+
}
|
|
54
|
+
const StyledPreviewPlaceholder = exports.StyledPreviewPlaceholder = _styledComponents.default.span`
|
|
55
|
+
${({
|
|
56
|
+
shape,
|
|
57
|
+
disableAnimation,
|
|
58
|
+
isLastLine,
|
|
59
|
+
height,
|
|
60
|
+
width
|
|
61
|
+
}) => {
|
|
62
|
+
return (0, _styledComponents.css)`
|
|
63
|
+
display: block;
|
|
64
|
+
background: linear-gradient(
|
|
65
|
+
135deg,
|
|
66
|
+
var(--colorsUtilityMajor100),
|
|
67
|
+
var(--colorsUtilityMajor040)
|
|
68
|
+
);
|
|
69
|
+
border-radius: ${getBorderRadius(shape)};
|
|
70
|
+
height: ${height || getHeight(shape)};
|
|
71
|
+
width: ${width || getWidth(shape)};
|
|
72
|
+
animation: ${shimmer} 2s ease infinite;
|
|
73
|
+
|
|
74
|
+
${isLastLine && shape === "text" && (0, _styledComponents.css)`
|
|
75
|
+
width: calc(${width || getWidth(shape)}*0.8);
|
|
76
|
+
`}
|
|
77
|
+
|
|
78
|
+
${shape === "circle" && (0, _styledComponents.css)`
|
|
79
|
+
width: ${height || getHeight(shape)};
|
|
80
|
+
`}
|
|
81
|
+
|
|
82
|
+
${disableAnimation && (0, _styledComponents.css)`
|
|
83
|
+
animation: none;
|
|
84
|
+
`}
|
|
85
|
+
|
|
86
|
+
& + & {
|
|
87
|
+
margin-top: 6px;
|
|
88
|
+
}
|
|
89
|
+
`;
|
|
90
|
+
}}
|
|
91
|
+
`;
|
|
14
92
|
StyledPreview.defaultProps = {
|
|
15
93
|
theme: _base.default
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
94
|
+
};
|
|
@@ -8,7 +8,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _invariant = _interopRequireDefault(require("invariant"));
|
|
10
10
|
var _utils = require("../../style/utils");
|
|
11
|
-
var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags/tags"));
|
|
12
11
|
var _search = _interopRequireDefault(require("./search.style"));
|
|
13
12
|
var _searchButton = _interopRequireDefault(require("./search-button.style"));
|
|
14
13
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
@@ -150,7 +149,9 @@ const Search = exports.Search = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
150
149
|
showSearchButton: !!searchButton,
|
|
151
150
|
variant: variant,
|
|
152
151
|
mb: 0
|
|
153
|
-
}, (0, _utils.filterStyledSystemMarginProps)(rest),
|
|
152
|
+
}, (0, _utils.filterStyledSystemMarginProps)(rest), {
|
|
153
|
+
"data-component": "search",
|
|
154
|
+
"data-role": "search",
|
|
154
155
|
id: id,
|
|
155
156
|
name: name
|
|
156
157
|
}, rest), /*#__PURE__*/_react.default.createElement(_textbox.default, {
|
|
@@ -28,10 +28,12 @@ const Accordion = ({
|
|
|
28
28
|
return /*#__PURE__*/_react.default.createElement(_accordion.StyledContentContainer, {
|
|
29
29
|
"aria-expanded": expanded,
|
|
30
30
|
isExpanded: expanded,
|
|
31
|
-
maxHeight: contentHeight
|
|
31
|
+
maxHeight: contentHeight,
|
|
32
|
+
"data-role": "tile-select-accordion-content-container"
|
|
32
33
|
}, /*#__PURE__*/_react.default.createElement(_accordion.StyledContent, {
|
|
33
34
|
role: "region",
|
|
34
35
|
"data-element": "tile-select-accordion-content",
|
|
36
|
+
"data-role": "tile-select-accordion-content",
|
|
35
37
|
ref: contentRef,
|
|
36
38
|
id: contentId,
|
|
37
39
|
"aria-labelledby": controlId
|
|
@@ -31,7 +31,8 @@ const TileSelectGroup = ({
|
|
|
31
31
|
name: name,
|
|
32
32
|
onBlur: onBlur,
|
|
33
33
|
onChange: onChange,
|
|
34
|
-
value: value
|
|
34
|
+
value: value,
|
|
35
|
+
"data-role": "tile-select-group-radio-button-mapper"
|
|
35
36
|
}, _react.default.Children.map(children, child => {
|
|
36
37
|
if ( /*#__PURE__*/_react.default.isValidElement(child)) {
|
|
37
38
|
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
@@ -59,6 +59,7 @@ const TileSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
const renderActionButton = () => /*#__PURE__*/_react.default.createElement(_tileSelect.StyledDeselectWrapper, {
|
|
62
|
+
"data-role": "deselect-wrapper",
|
|
62
63
|
hasActionAdornment: !!actionButtonAdornment
|
|
63
64
|
}, customActionButton && customActionButton(handleDeselect), !customActionButton && checked && /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
64
65
|
buttonType: "tertiary",
|
|
@@ -79,6 +80,7 @@ const TileSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
79
80
|
className: className,
|
|
80
81
|
disabled: disabled
|
|
81
82
|
}, (0, _tags.default)("tile-select", rest), (0, _utils.filterStyledSystemMarginProps)(rest)), /*#__PURE__*/_react.default.createElement(_tileSelect.StyledFocusWrapper, {
|
|
83
|
+
"data-role": "focus-wrapper",
|
|
82
84
|
hasFocus: hasFocus,
|
|
83
85
|
checked: checked
|
|
84
86
|
}, /*#__PURE__*/_react.default.createElement(_tileSelect.StyledTileSelectInput, _extends({
|
|
@@ -113,13 +115,18 @@ const TileSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
113
115
|
}, title), subtitle && /*#__PURE__*/_react.default.createElement(_tileSelect.StyledSubtitle, {
|
|
114
116
|
as: checkPropTypeIsNode(subtitle) ? "div" : undefined
|
|
115
117
|
}, subtitle), titleAdornment && /*#__PURE__*/_react.default.createElement(_tileSelect.StyledAdornment, {
|
|
116
|
-
hasAdditionalInformation: !!additionalInformation
|
|
118
|
+
hasAdditionalInformation: !!additionalInformation,
|
|
119
|
+
"data-role": "title-adornment"
|
|
117
120
|
}, titleAdornment && /*#__PURE__*/_react.default.createElement("div", null, titleAdornment))), additionalInformation && /*#__PURE__*/_react.default.createElement("div", null, additionalInformation), /*#__PURE__*/_react.default.createElement(_tileSelect.StyledDescription, {
|
|
118
121
|
as: checkPropTypeIsNode(description) ? "div" : undefined
|
|
119
|
-
}, description), footer && /*#__PURE__*/_react.default.createElement(_tileSelect.StyledFooterWrapper,
|
|
120
|
-
|
|
122
|
+
}, description), footer && /*#__PURE__*/_react.default.createElement(_tileSelect.StyledFooterWrapper, {
|
|
123
|
+
"data-role": "tile-select-footer"
|
|
124
|
+
}, footer), accordionContent && accordionControl && /*#__PURE__*/_react.default.createElement(_tileSelect.StyledAccordionFooterWrapper, {
|
|
125
|
+
accordionExpanded: accordionExpanded,
|
|
126
|
+
"data-role": "accordion-footer"
|
|
121
127
|
}, accordionControl(controlId, contentId))), prefixAdornment && /*#__PURE__*/_react.default.createElement(_box.default, {
|
|
122
128
|
"data-element": "prefix-adornment",
|
|
129
|
+
"data-role": "prefix-adornment",
|
|
123
130
|
mr: 3,
|
|
124
131
|
opacity: disabled ? "0.3" : undefined
|
|
125
132
|
}, prefixAdornment))), accordionContent && /*#__PURE__*/_react.default.createElement(_accordion.default, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "142.
|
|
3
|
+
"version": "142.10.0",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"styled-components": "^4.4.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@axe-core/playwright": "~4.
|
|
59
|
+
"@axe-core/playwright": "~4.10.0",
|
|
60
60
|
"@babel/cli": "^7.23.4",
|
|
61
61
|
"@babel/core": "^7.23.3",
|
|
62
62
|
"@babel/eslint-parser": "^7.23.3",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"@babel/types": "^7.23.4",
|
|
70
70
|
"@commitlint/cli": "^17.6.3",
|
|
71
71
|
"@commitlint/config-conventional": "^17.6.3",
|
|
72
|
-
"@playwright/experimental-ct-react17": "~1.
|
|
73
|
-
"@playwright/test": "~1.
|
|
72
|
+
"@playwright/experimental-ct-react17": "~1.47.0",
|
|
73
|
+
"@playwright/test": "~1.47.0",
|
|
74
74
|
"@sage/design-tokens": "~4.29.0",
|
|
75
75
|
"@semantic-release/changelog": "^6.0.3",
|
|
76
76
|
"@semantic-release/exec": "^6.0.3",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { StyledPreviewPlaceholderProps } from "./preview-placeholder.style";
|
|
3
|
-
export interface PreviewPlaceholderProps extends StyledPreviewPlaceholderProps {
|
|
4
|
-
index: number;
|
|
5
|
-
/** The number of lines to render. */
|
|
6
|
-
lines: number;
|
|
7
|
-
loading?: boolean;
|
|
8
|
-
}
|
|
9
|
-
declare const PreviewPlaceholder: ({ height, index, lines, width, ...props }: PreviewPlaceholderProps) => React.JSX.Element;
|
|
10
|
-
export default PreviewPlaceholder;
|
|
@@ -1,19 +0,0 @@
|
|
|
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 { StyledPreviewPlaceholder } from "./preview-placeholder.style";
|
|
6
|
-
const PreviewPlaceholder = ({
|
|
7
|
-
height,
|
|
8
|
-
index,
|
|
9
|
-
lines,
|
|
10
|
-
width,
|
|
11
|
-
...props
|
|
12
|
-
}) => {
|
|
13
|
-
const isLastLine = lines > 1 && lines === index;
|
|
14
|
-
return /*#__PURE__*/React.createElement(StyledPreviewPlaceholder, _extends({
|
|
15
|
-
height: height,
|
|
16
|
-
width: !width && isLastLine ? "80%" : width
|
|
17
|
-
}, tagComponent("preview", props)));
|
|
18
|
-
};
|
|
19
|
-
export default PreviewPlaceholder;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface StyledPreviewPlaceholderProps {
|
|
2
|
-
/** A custom height to be applied to the component. */
|
|
3
|
-
height?: string;
|
|
4
|
-
/** A custom width */
|
|
5
|
-
width?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const StyledPreviewPlaceholder: import("styled-components").StyledComponent<"span", any, StyledPreviewPlaceholderProps, never>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import styled, { keyframes } from "styled-components";
|
|
2
|
-
const shimmer = keyframes`
|
|
3
|
-
0% { opacity:0.1 }
|
|
4
|
-
70% { opacity:0.6 }
|
|
5
|
-
100% { opacity:0.1 }
|
|
6
|
-
`;
|
|
7
|
-
export const StyledPreviewPlaceholder = styled.span`
|
|
8
|
-
animation: ${shimmer} 2s ease infinite;
|
|
9
|
-
background: var(--colorsUtilityMajor150);
|
|
10
|
-
display: block;
|
|
11
|
-
height: ${({
|
|
12
|
-
height
|
|
13
|
-
}) => height || "15px"};
|
|
14
|
-
opacity: 0.6;
|
|
15
|
-
width: ${({
|
|
16
|
-
width
|
|
17
|
-
}) => width || "100%"};
|
|
18
|
-
border-radius: var(--borderRadius050);
|
|
19
|
-
|
|
20
|
-
& + & {
|
|
21
|
-
margin-top: 3px;
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { StyledPreviewPlaceholderProps } from "./preview-placeholder.style";
|
|
3
|
-
export interface PreviewPlaceholderProps extends StyledPreviewPlaceholderProps {
|
|
4
|
-
index: number;
|
|
5
|
-
/** The number of lines to render. */
|
|
6
|
-
lines: number;
|
|
7
|
-
loading?: boolean;
|
|
8
|
-
}
|
|
9
|
-
declare const PreviewPlaceholder: ({ height, index, lines, width, ...props }: PreviewPlaceholderProps) => React.JSX.Element;
|
|
10
|
-
export default PreviewPlaceholder;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _tags = _interopRequireDefault(require("../../../__internal__/utils/helpers/tags/tags"));
|
|
10
|
-
var _previewPlaceholder = require("./preview-placeholder.style");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
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); }
|
|
13
|
-
const PreviewPlaceholder = ({
|
|
14
|
-
height,
|
|
15
|
-
index,
|
|
16
|
-
lines,
|
|
17
|
-
width,
|
|
18
|
-
...props
|
|
19
|
-
}) => {
|
|
20
|
-
const isLastLine = lines > 1 && lines === index;
|
|
21
|
-
return /*#__PURE__*/_react.default.createElement(_previewPlaceholder.StyledPreviewPlaceholder, _extends({
|
|
22
|
-
height: height,
|
|
23
|
-
width: !width && isLastLine ? "80%" : width
|
|
24
|
-
}, (0, _tags.default)("preview", props)));
|
|
25
|
-
};
|
|
26
|
-
var _default = exports.default = PreviewPlaceholder;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface StyledPreviewPlaceholderProps {
|
|
2
|
-
/** A custom height to be applied to the component. */
|
|
3
|
-
height?: string;
|
|
4
|
-
/** A custom width */
|
|
5
|
-
width?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const StyledPreviewPlaceholder: import("styled-components").StyledComponent<"span", any, StyledPreviewPlaceholderProps, never>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.StyledPreviewPlaceholder = void 0;
|
|
7
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
-
const shimmer = (0, _styledComponents.keyframes)`
|
|
11
|
-
0% { opacity:0.1 }
|
|
12
|
-
70% { opacity:0.6 }
|
|
13
|
-
100% { opacity:0.1 }
|
|
14
|
-
`;
|
|
15
|
-
const StyledPreviewPlaceholder = exports.StyledPreviewPlaceholder = _styledComponents.default.span`
|
|
16
|
-
animation: ${shimmer} 2s ease infinite;
|
|
17
|
-
background: var(--colorsUtilityMajor150);
|
|
18
|
-
display: block;
|
|
19
|
-
height: ${({
|
|
20
|
-
height
|
|
21
|
-
}) => height || "15px"};
|
|
22
|
-
opacity: 0.6;
|
|
23
|
-
width: ${({
|
|
24
|
-
width
|
|
25
|
-
}) => width || "100%"};
|
|
26
|
-
border-radius: var(--borderRadius050);
|
|
27
|
-
|
|
28
|
-
& + & {
|
|
29
|
-
margin-top: 3px;
|
|
30
|
-
}
|
|
31
|
-
`;
|