@ultraviolet/ui 1.28.0 → 1.29.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/README.md +14 -7
- package/dist/index.d.ts +51 -2
- package/dist/src/components/ActionBar/index.js +22 -37
- package/dist/src/components/Alert/index.js +27 -41
- package/dist/src/components/Avatar/index.js +48 -69
- package/dist/src/components/Badge/index.js +29 -49
- package/dist/src/components/Banner/index.js +42 -62
- package/dist/src/components/BarChart/Tooltip.js +35 -50
- package/dist/src/components/BarChart/index.js +13 -14
- package/dist/src/components/BarStack/index.js +100 -191
- package/dist/src/components/Breadcrumbs/index.js +29 -39
- package/dist/src/components/Bullet/index.js +42 -55
- package/dist/src/components/Button/index.js +73 -99
- package/dist/src/components/Card/index.js +39 -57
- package/dist/src/components/Carousel/index.js +32 -60
- package/dist/src/components/Checkbox/index.js +153 -341
- package/dist/src/components/CheckboxGroup/index.js +25 -27
- package/dist/src/components/CopyButton/index.js +11 -12
- package/dist/src/components/DateInput/index.js +141 -268
- package/dist/src/components/EmptyState/index.js +68 -83
- package/dist/src/components/Expandable/index.js +13 -20
- package/dist/src/components/GlobalAlert/GlobalAlertLink.js +12 -13
- package/dist/src/components/GlobalAlert/index.js +19 -32
- package/dist/src/components/LineChart/CustomLegend.js +80 -89
- package/dist/src/components/LineChart/Tooltip.js +32 -47
- package/dist/src/components/LineChart/helpers.js +15 -50
- package/dist/src/components/LineChart/index.js +23 -33
- package/dist/src/components/Link/index.js +46 -65
- package/dist/src/components/List/Body.js +9 -15
- package/dist/src/components/List/Cell.js +6 -7
- package/dist/src/components/List/HeaderCell.js +28 -56
- package/dist/src/components/List/HeaderRow.js +9 -16
- package/dist/src/components/List/ListContext.js +5 -6
- package/dist/src/components/List/Row.js +44 -90
- package/dist/src/components/List/SelectBar.js +9 -13
- package/dist/src/components/List/SkeletonRows.js +5 -6
- package/dist/src/components/List/index.js +15 -25
- package/dist/src/components/Loader/index.js +18 -25
- package/dist/src/components/Menu/Item.js +39 -49
- package/dist/src/components/Menu/index.js +31 -56
- package/dist/src/components/MenuV2/Item.js +39 -49
- package/dist/src/components/MenuV2/index.js +28 -47
- package/dist/src/components/Meter/index.js +25 -47
- package/dist/src/components/Modal/Dialog.js +33 -58
- package/dist/src/components/Modal/Disclosure.js +8 -9
- package/dist/src/components/Modal/index.js +26 -33
- package/dist/src/components/Notice/index.js +21 -27
- package/dist/src/components/NumberInput/index.js +73 -137
- package/dist/src/components/Pagination/getPageNumbers.js +1 -4
- package/dist/src/components/Pagination/index.js +17 -27
- package/dist/src/components/PasswordCheck/index.js +26 -32
- package/dist/src/components/PasswordStrengthMeter/index.js +25 -44
- package/dist/src/components/PieChart/Legends.js +71 -107
- package/dist/src/components/PieChart/Tooltip.js +33 -36
- package/dist/src/components/PieChart/index.js +13 -17
- package/dist/src/components/Popover/index.js +58 -75
- package/dist/src/components/Popup/helpers.js +13 -15
- package/dist/src/components/Popup/index.js +55 -98
- package/dist/src/components/ProgressBar/index.js +31 -49
- package/dist/src/components/Radio/index.js +58 -113
- package/dist/src/components/RadioGroup/index.js +26 -28
- package/dist/src/components/Row/index.js +25 -31
- package/dist/src/components/SelectInput/index.js +357 -410
- package/dist/src/components/SelectableCard/index.js +73 -115
- package/dist/src/components/Separator/index.js +52 -73
- package/dist/src/components/Skeleton/Block.js +23 -41
- package/dist/src/components/Skeleton/Blocks.js +23 -41
- package/dist/src/components/Skeleton/BoxWithIcon.js +21 -36
- package/dist/src/components/Skeleton/Donut.js +3 -6
- package/dist/src/components/Skeleton/IconSkeleton.js +13 -31
- package/dist/src/components/Skeleton/Line.js +5 -11
- package/dist/src/components/Skeleton/List.js +22 -31
- package/dist/src/components/Skeleton/Slider.js +25 -46
- package/dist/src/components/Skeleton/Square.js +3 -6
- package/dist/src/components/Skeleton/index.js +17 -33
- package/dist/src/components/Snippet/index.js +82 -137
- package/dist/src/components/Stack/index.js +11 -14
- package/dist/src/components/Status/index.js +48 -78
- package/dist/src/components/StepList/index.js +45 -63
- package/dist/src/components/Stepper/index.js +74 -129
- package/dist/src/components/SwitchButton/FocusOverlay.js +13 -23
- package/dist/src/components/SwitchButton/index.js +36 -62
- package/dist/src/components/Table/Body.js +5 -8
- package/dist/src/components/Table/Cell.js +14 -20
- package/dist/src/components/Table/Header.js +8 -14
- package/dist/src/components/Table/HeaderCell.js +40 -56
- package/dist/src/components/Table/HeaderRow.js +4 -5
- package/dist/src/components/Table/Row.js +10 -14
- package/dist/src/components/Table/SelectBar.js +9 -13
- package/dist/src/components/Table/SkeletonRows.js +5 -6
- package/dist/src/components/Table/TableContext.js +6 -7
- package/dist/src/components/Table/index.js +44 -50
- package/dist/src/components/Tabs/Tab.js +57 -118
- package/dist/src/components/Tabs/TabMenu.js +32 -38
- package/dist/src/components/Tabs/TabMenuItem.js +9 -13
- package/dist/src/components/Tabs/index.js +24 -43
- package/dist/src/components/Tag/index.js +57 -74
- package/dist/src/components/TagInput/index.js +63 -94
- package/dist/src/components/TagList/index.js +22 -35
- package/dist/src/components/Text/index.js +29 -31
- package/dist/src/components/TextArea/index.js +240 -0
- package/dist/src/components/TextInput/index.js +166 -260
- package/dist/src/components/TimeInput/index.js +10 -13
- package/dist/src/components/Toaster/index.js +51 -67
- package/dist/src/components/Toggle/index.js +62 -129
- package/dist/src/components/ToggleGroup/index.js +21 -23
- package/dist/src/components/Tooltip/index.js +28 -31
- package/dist/src/components/VerificationCode/index.js +55 -90
- package/dist/src/index.js +1 -0
- package/dist/src/utils/ids.js +1 -6
- package/package.json +3 -3
|
@@ -25,36 +25,27 @@ const StyledLine = /*#__PURE__*/_styled("div", {
|
|
|
25
25
|
});
|
|
26
26
|
const StyledList = /*#__PURE__*/_styled("ul", {
|
|
27
27
|
target: "e639qnr0"
|
|
28
|
-
})("list-style:none;padding:0;margin:0;>", StyledItem, ":nth-of-type(even){background-color:",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} = _ref3;
|
|
51
|
-
return jsx(StyledList, {
|
|
52
|
-
children: Array.from({
|
|
53
|
-
length
|
|
54
|
-
}, (_, i) => jsx(Item, {
|
|
55
|
-
col: col
|
|
56
|
-
}, `skeleton-list-${i}`))
|
|
57
|
-
});
|
|
58
|
-
};
|
|
28
|
+
})("list-style:none;padding:0;margin:0;>", StyledItem, ":nth-of-type(even){background-color:", ({
|
|
29
|
+
theme
|
|
30
|
+
}) => theme.colors.neutral.backgroundDisabled, ";}");
|
|
31
|
+
const Item = ({
|
|
32
|
+
col = 3
|
|
33
|
+
}) => jsx(StyledItem, {
|
|
34
|
+
children: Array.from({
|
|
35
|
+
length: col
|
|
36
|
+
}, (_, i) => jsx(StyledLine, {
|
|
37
|
+
children: jsx(Line, {})
|
|
38
|
+
}, `skeleton-list-col-${i}`))
|
|
39
|
+
});
|
|
40
|
+
const List = ({
|
|
41
|
+
length = 3,
|
|
42
|
+
col = 3
|
|
43
|
+
}) => jsx(StyledList, {
|
|
44
|
+
children: Array.from({
|
|
45
|
+
length
|
|
46
|
+
}, (_, i) => jsx(Item, {
|
|
47
|
+
col: col
|
|
48
|
+
}, `skeleton-list-${i}`))
|
|
49
|
+
});
|
|
59
50
|
|
|
60
51
|
export { List };
|
|
@@ -3,55 +3,34 @@ import { jsx } from '@emotion/react/jsx-runtime';
|
|
|
3
3
|
|
|
4
4
|
const StyledContainer = /*#__PURE__*/_styled("div", {
|
|
5
5
|
target: "e1yrvvrg2"
|
|
6
|
-
})("height:277px;display:grid;grid-template-columns:repeat(",
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}, ", 1fr);gap:", _ref2 => {
|
|
12
|
-
let {
|
|
13
|
-
theme
|
|
14
|
-
} = _ref2;
|
|
15
|
-
return theme.space['2'];
|
|
16
|
-
}, ";overflow:auto;");
|
|
6
|
+
})("height:277px;display:grid;grid-template-columns:repeat(", ({
|
|
7
|
+
length
|
|
8
|
+
}) => length, ", 1fr);gap:", ({
|
|
9
|
+
theme
|
|
10
|
+
}) => theme.space['2'], ";overflow:auto;");
|
|
17
11
|
const StyledCard = /*#__PURE__*/_styled("div", {
|
|
18
12
|
target: "e1yrvvrg1"
|
|
19
|
-
})("border:1px solid ",
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, ";border-radius:", _ref4 => {
|
|
25
|
-
let {
|
|
26
|
-
theme
|
|
27
|
-
} = _ref4;
|
|
28
|
-
return theme.radii.default;
|
|
29
|
-
}, ";width:239px;height:261px;overflow:hidden;");
|
|
13
|
+
})("border:1px solid ", ({
|
|
14
|
+
theme
|
|
15
|
+
}) => theme.colors.neutral.borderWeak, ";border-radius:", ({
|
|
16
|
+
theme
|
|
17
|
+
}) => theme.radii.default, ";width:239px;height:261px;overflow:hidden;");
|
|
30
18
|
const StyledBanner = /*#__PURE__*/_styled("div", {
|
|
31
19
|
target: "e1yrvvrg0"
|
|
32
|
-
})("border:1px solid ",
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return jsx(StyledContainer, {
|
|
48
|
-
length: length,
|
|
49
|
-
children: Array.from({
|
|
50
|
-
length
|
|
51
|
-
}, (_, i) => jsx(StyledCard, {
|
|
52
|
-
children: jsx(StyledBanner, {})
|
|
53
|
-
}, `skeleton-slider-card-${i}`))
|
|
54
|
-
});
|
|
55
|
-
};
|
|
20
|
+
})("border:1px solid ", ({
|
|
21
|
+
theme
|
|
22
|
+
}) => theme.colors.neutral.borderWeak, ";background-color:", ({
|
|
23
|
+
theme
|
|
24
|
+
}) => theme.colors.neutral.borderWeak, ";width:100%;height:33%;");
|
|
25
|
+
const Slider = ({
|
|
26
|
+
length = 4
|
|
27
|
+
}) => jsx(StyledContainer, {
|
|
28
|
+
length: length,
|
|
29
|
+
children: Array.from({
|
|
30
|
+
length
|
|
31
|
+
}, (_, i) => jsx(StyledCard, {
|
|
32
|
+
children: jsx(StyledBanner, {})
|
|
33
|
+
}, `skeleton-slider-card-${i}`))
|
|
34
|
+
});
|
|
56
35
|
|
|
57
36
|
export { Slider };
|
|
@@ -2,11 +2,8 @@ import _styled from '@emotion/styled/base';
|
|
|
2
2
|
|
|
3
3
|
const Square = /*#__PURE__*/_styled("div", {
|
|
4
4
|
target: "e1uz28830"
|
|
5
|
-
})("height:100%;width:100%;max-width:100%;background-color:",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} = _ref;
|
|
9
|
-
return theme.colors.neutral.borderWeak;
|
|
10
|
-
}, ";");
|
|
5
|
+
})("height:100%;width:100%;max-width:100%;background-color:", ({
|
|
6
|
+
theme
|
|
7
|
+
}) => theme.colors.neutral.borderWeak, ";");
|
|
11
8
|
|
|
12
9
|
export { Square };
|
|
@@ -31,32 +31,17 @@ const StyledContainer = /*#__PURE__*/_styled("div", {
|
|
|
31
31
|
});
|
|
32
32
|
const StyledDiv = /*#__PURE__*/_styled("div", {
|
|
33
33
|
target: "e183x2r80"
|
|
34
|
-
})("position:absolute;top:0;height:100%;width:25%;opacity:0.8;background:linear-gradient(\n 90deg,\n ",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, "
|
|
45
|
-
let {
|
|
46
|
-
theme
|
|
47
|
-
} = _ref3;
|
|
48
|
-
return theme.colors.neutral.backgroundWeak;
|
|
49
|
-
}, "66,\n ", _ref4 => {
|
|
50
|
-
let {
|
|
51
|
-
theme
|
|
52
|
-
} = _ref4;
|
|
53
|
-
return theme.colors.neutral.backgroundWeak;
|
|
54
|
-
}, "4D,\n ", _ref5 => {
|
|
55
|
-
let {
|
|
56
|
-
theme
|
|
57
|
-
} = _ref5;
|
|
58
|
-
return theme.colors.neutral.backgroundWeak;
|
|
59
|
-
}, "00\n );animation:", shineAnimation, " 1s linear infinite;animation-direction:alternate;@media (prefers-reduced-motion: reduce){animation:unset;}");
|
|
34
|
+
})("position:absolute;top:0;height:100%;width:25%;opacity:0.8;background:linear-gradient(\n 90deg,\n ", ({
|
|
35
|
+
theme
|
|
36
|
+
}) => theme.colors.neutral.backgroundWeak, "00,\n ", ({
|
|
37
|
+
theme
|
|
38
|
+
}) => theme.colors.neutral.backgroundWeak, "4D,\n ", ({
|
|
39
|
+
theme
|
|
40
|
+
}) => theme.colors.neutral.backgroundWeak, "66,\n ", ({
|
|
41
|
+
theme
|
|
42
|
+
}) => theme.colors.neutral.backgroundWeak, "4D,\n ", ({
|
|
43
|
+
theme
|
|
44
|
+
}) => theme.colors.neutral.backgroundWeak, "00\n );animation:", shineAnimation, " 1s linear infinite;animation-direction:alternate;@media (prefers-reduced-motion: reduce){animation:unset;}");
|
|
60
45
|
const variants = {
|
|
61
46
|
block: Block,
|
|
62
47
|
blocks: Blocks,
|
|
@@ -72,13 +57,12 @@ const variants = {
|
|
|
72
57
|
* It is used to provide a better user experience by showing a temporary placeholder reflecting the dimensions of the
|
|
73
58
|
* content that will eventually be loaded on the screen.
|
|
74
59
|
*/
|
|
75
|
-
const Skeleton =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
} = _ref6;
|
|
60
|
+
const Skeleton = ({
|
|
61
|
+
variant = 'blocks',
|
|
62
|
+
length,
|
|
63
|
+
col,
|
|
64
|
+
className
|
|
65
|
+
}) => {
|
|
82
66
|
const Component = variants[variant];
|
|
83
67
|
return jsxs(StyledContainer, {
|
|
84
68
|
className: className,
|
|
@@ -12,43 +12,26 @@ const LINES_BREAK_REGEX = /\r\n|\r|\n/;
|
|
|
12
12
|
const PreText = /*#__PURE__*/_styled(Text, {
|
|
13
13
|
shouldForwardProp: prop => !['multiline', 'hasShowMoreButton', 'showMore'].includes(prop),
|
|
14
14
|
target: "e1q0gj908"
|
|
15
|
-
})("margin:0;padding:",
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, ";overflow-x:", _ref3 => {
|
|
26
|
-
let {
|
|
27
|
-
hasShowMoreButton,
|
|
28
|
-
showMore
|
|
29
|
-
} = _ref3;
|
|
30
|
-
return hasShowMoreButton && !showMore ? 'hidden' : 'auto';
|
|
31
|
-
}, ";overflow-y:hidden;", _ref4 => {
|
|
32
|
-
let {
|
|
33
|
-
multiline
|
|
34
|
-
} = _ref4;
|
|
35
|
-
return !multiline ? 'white-space: nowrap;' : '';
|
|
36
|
-
}, " height:auto;counter-reset:section;");
|
|
15
|
+
})("margin:0;padding:", ({
|
|
16
|
+
theme
|
|
17
|
+
}) => theme.space['2'], ";padding-right:", ({
|
|
18
|
+
theme
|
|
19
|
+
}) => theme.space['9'], ";overflow-x:", ({
|
|
20
|
+
hasShowMoreButton,
|
|
21
|
+
showMore
|
|
22
|
+
}) => hasShowMoreButton && !showMore ? 'hidden' : 'auto', ";overflow-y:hidden;", ({
|
|
23
|
+
multiline
|
|
24
|
+
}) => !multiline ? 'white-space: nowrap;' : '', " height:auto;counter-reset:section;");
|
|
37
25
|
const StyledSpan = /*#__PURE__*/_styled('span', {
|
|
38
26
|
shouldForwardProp: prop => !['linePrefix', 'multiline', 'prefix'].includes(prop),
|
|
39
27
|
target: "e1q0gj907"
|
|
40
|
-
})("display:block;&:after{content:'';",
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
let {
|
|
48
|
-
prefix,
|
|
49
|
-
theme
|
|
50
|
-
} = _ref6;
|
|
51
|
-
return prefix ? `
|
|
28
|
+
})("display:block;&:after{content:'';", ({
|
|
29
|
+
theme,
|
|
30
|
+
multiline
|
|
31
|
+
}) => multiline ? `padding: ${theme.space['4']}` : `padding-right: ${theme.space['8']}`, ";}", ({
|
|
32
|
+
prefix,
|
|
33
|
+
theme
|
|
34
|
+
}) => prefix ? `
|
|
52
35
|
&:before {
|
|
53
36
|
color: ${theme.colors.neutral.textWeak};
|
|
54
37
|
width: ${prefix === 'lines' ? '35px' : ''};
|
|
@@ -58,27 +41,17 @@ const StyledSpan = /*#__PURE__*/_styled('span', {
|
|
|
58
41
|
content: ${prefix === 'lines' ? 'counter(section)' : "'$'"};
|
|
59
42
|
padding-right: ${theme.space['1']};
|
|
60
43
|
}
|
|
61
|
-
` : null;
|
|
62
|
-
}, ";");
|
|
44
|
+
` : null, ";");
|
|
63
45
|
const Container = /*#__PURE__*/_styled('div', {
|
|
64
46
|
shouldForwardProp: prop => !['multiline'].includes(prop),
|
|
65
47
|
target: "e1q0gj906"
|
|
66
|
-
})("position:relative;display:flex;justify-content:start;max-width:100%;",
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
theme
|
|
74
|
-
} = _ref8;
|
|
75
|
-
return theme.colors.neutral.backgroundWeak;
|
|
76
|
-
}, ";border-radius:", _ref9 => {
|
|
77
|
-
let {
|
|
78
|
-
theme
|
|
79
|
-
} = _ref9;
|
|
80
|
-
return theme.radii.default;
|
|
81
|
-
}, ";");
|
|
48
|
+
})("position:relative;display:flex;justify-content:start;max-width:100%;", ({
|
|
49
|
+
multiline
|
|
50
|
+
}) => multiline ? 'width: 100%;' : '', " background:", ({
|
|
51
|
+
theme
|
|
52
|
+
}) => theme.colors.neutral.backgroundWeak, ";border-radius:", ({
|
|
53
|
+
theme
|
|
54
|
+
}) => theme.radii.default, ";");
|
|
82
55
|
const StyledStack = /*#__PURE__*/_styled(Stack, {
|
|
83
56
|
target: "e1q0gj905"
|
|
84
57
|
})(process.env.NODE_ENV === "production" ? {
|
|
@@ -92,53 +65,32 @@ const StyledStack = /*#__PURE__*/_styled(Stack, {
|
|
|
92
65
|
const ButtonContainer = /*#__PURE__*/_styled('div', {
|
|
93
66
|
shouldForwardProp: prop => !['multiline'].includes(prop),
|
|
94
67
|
target: "e1q0gj904"
|
|
95
|
-
})("position:absolute;top:0;right:0;padding:",
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}, ";border-radius:", _ref12 => {
|
|
107
|
-
let {
|
|
108
|
-
theme
|
|
109
|
-
} = _ref12;
|
|
110
|
-
return theme.radii.default;
|
|
111
|
-
}, ";border:2px solid transparent;", _ref13 => {
|
|
112
|
-
let {
|
|
113
|
-
multiline,
|
|
114
|
-
theme
|
|
115
|
-
} = _ref13;
|
|
116
|
-
return !multiline ? `box-shadow: -27px 0 19px -11px ${theme.colors.neutral.backgroundWeak}` : '';
|
|
117
|
-
}, ";");
|
|
68
|
+
})("position:absolute;top:0;right:0;padding:", ({
|
|
69
|
+
theme,
|
|
70
|
+
multiline
|
|
71
|
+
}) => `${theme.space[multiline ? '2' : '1']} ${theme.space['2']} 0 0`, ";background:", ({
|
|
72
|
+
theme
|
|
73
|
+
}) => theme.colors.neutral.backgroundWeak, ";border-radius:", ({
|
|
74
|
+
theme
|
|
75
|
+
}) => theme.radii.default, ";border:2px solid transparent;", ({
|
|
76
|
+
multiline,
|
|
77
|
+
theme
|
|
78
|
+
}) => !multiline ? `box-shadow: -27px 0 19px -11px ${theme.colors.neutral.backgroundWeak}` : '', ";");
|
|
118
79
|
const ShowMoreContainer = /*#__PURE__*/_styled('div', {
|
|
119
80
|
shouldForwardProp: prop => !['showMore'].includes(prop),
|
|
120
81
|
target: "e1q0gj903"
|
|
121
|
-
})("width:100%;box-shadow:",
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return !showMore ? `0px -22px 19px -6px
|
|
127
|
-
${theme.colors.neutral.backgroundWeak}` : 'none';
|
|
128
|
-
}, ";");
|
|
82
|
+
})("width:100%;box-shadow:", ({
|
|
83
|
+
theme,
|
|
84
|
+
showMore
|
|
85
|
+
}) => !showMore ? `0px -22px 19px -6px
|
|
86
|
+
${theme.colors.neutral.backgroundWeak}` : 'none', ";");
|
|
129
87
|
const StyledButton = /*#__PURE__*/_styled("button", {
|
|
130
88
|
target: "e1q0gj902"
|
|
131
|
-
})("width:100%;background:none;border:none;padding:",
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}, ";padding-top:", _ref16 => {
|
|
137
|
-
let {
|
|
138
|
-
theme
|
|
139
|
-
} = _ref16;
|
|
140
|
-
return theme.space['1'];
|
|
141
|
-
}, ";cursor:pointer;");
|
|
89
|
+
})("width:100%;background:none;border:none;padding:", ({
|
|
90
|
+
theme
|
|
91
|
+
}) => theme.space['2'], ";padding-top:", ({
|
|
92
|
+
theme
|
|
93
|
+
}) => theme.space['1'], ";cursor:pointer;");
|
|
142
94
|
const AlignCenterText = /*#__PURE__*/_styled(Text, {
|
|
143
95
|
target: "e1q0gj901"
|
|
144
96
|
})(process.env.NODE_ENV === "production" ? {
|
|
@@ -152,53 +104,46 @@ const AlignCenterText = /*#__PURE__*/_styled(Text, {
|
|
|
152
104
|
const AnimatedArrowIcon = /*#__PURE__*/_styled(Icon, {
|
|
153
105
|
shouldForwardProp: prop => !['showMore'].includes(prop),
|
|
154
106
|
target: "e1q0gj900"
|
|
155
|
-
})("transform:",
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
})) : jsx(StyledSpan, {
|
|
181
|
-
prefix: prefix,
|
|
182
|
-
children: children
|
|
183
|
-
})
|
|
184
|
-
});
|
|
185
|
-
};
|
|
107
|
+
})("transform:", ({
|
|
108
|
+
showMore
|
|
109
|
+
}) => showMore ? 'rotate(180deg)' : 'rotate(0deg)', ";transform-origin:center;transition:transform 300ms ease-in-out;");
|
|
110
|
+
const CodeContent = ({
|
|
111
|
+
children,
|
|
112
|
+
prefix,
|
|
113
|
+
multiline,
|
|
114
|
+
showMore,
|
|
115
|
+
hasShowMoreButton,
|
|
116
|
+
lines
|
|
117
|
+
}) => jsx(PreText, {
|
|
118
|
+
as: "pre",
|
|
119
|
+
variant: "code",
|
|
120
|
+
multiline: multiline,
|
|
121
|
+
hasShowMoreButton: hasShowMoreButton,
|
|
122
|
+
showMore: showMore,
|
|
123
|
+
children: multiline ? Children.map(lines, child => jsx(StyledSpan, {
|
|
124
|
+
multiline: true,
|
|
125
|
+
prefix: prefix,
|
|
126
|
+
children: child
|
|
127
|
+
})) : jsx(StyledSpan, {
|
|
128
|
+
prefix: prefix,
|
|
129
|
+
children: children
|
|
130
|
+
})
|
|
131
|
+
});
|
|
186
132
|
/**
|
|
187
133
|
* Snippet component is used to display code snippets with the ability to copy the code.
|
|
188
134
|
* It also has the ability to show/hide the code snippet if it has more than 4 lines.
|
|
189
135
|
*/
|
|
190
|
-
const Snippet =
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
} = _ref19;
|
|
136
|
+
const Snippet = ({
|
|
137
|
+
children,
|
|
138
|
+
copyText,
|
|
139
|
+
copiedText,
|
|
140
|
+
showText = 'Show',
|
|
141
|
+
hideText = 'Hide',
|
|
142
|
+
prefix,
|
|
143
|
+
className,
|
|
144
|
+
'data-testid': dataTestId,
|
|
145
|
+
initiallyExpanded
|
|
146
|
+
}) => {
|
|
202
147
|
const [showMore, setShowMore] = useReducer(value => !value, initiallyExpanded ?? false);
|
|
203
148
|
const lines = children.split(LINES_BREAK_REGEX).filter(Boolean);
|
|
204
149
|
const numberOfLines = lines.length;
|
|
@@ -7,18 +7,16 @@ import _styled from '@emotion/styled/base';
|
|
|
7
7
|
const Stack = /*#__PURE__*/_styled('div', {
|
|
8
8
|
shouldForwardProp: prop => !['gap', 'direction', 'alignItems', 'justifyContent', 'wrap', 'width'].includes(prop),
|
|
9
9
|
target: "ehpbis70"
|
|
10
|
-
})("display:flex;",
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = _ref;
|
|
21
|
-
return `
|
|
10
|
+
})("display:flex;", ({
|
|
11
|
+
theme,
|
|
12
|
+
gap = 0,
|
|
13
|
+
direction = 'column',
|
|
14
|
+
alignItems = 'normal',
|
|
15
|
+
justifyContent = 'normal',
|
|
16
|
+
wrap = 'nowrap',
|
|
17
|
+
width,
|
|
18
|
+
flex
|
|
19
|
+
}) => `
|
|
22
20
|
gap: ${theme.space[gap]};
|
|
23
21
|
flex-direction: ${direction};
|
|
24
22
|
align-items: ${alignItems};
|
|
@@ -26,7 +24,6 @@ const Stack = /*#__PURE__*/_styled('div', {
|
|
|
26
24
|
flex-wrap: ${typeof wrap === 'boolean' ? 'wrap' : wrap};
|
|
27
25
|
${flex ? `flex: ${flex};` : ''}
|
|
28
26
|
${width ? `width: ${width};` : ''}
|
|
29
|
-
|
|
30
|
-
}, ";");
|
|
27
|
+
`, ";");
|
|
31
28
|
|
|
32
29
|
export { Stack };
|
|
@@ -6,99 +6,69 @@ import { ping } from '../../utils/animations.js';
|
|
|
6
6
|
const HEIGHT = '10px';
|
|
7
7
|
const WIDTH = '10px';
|
|
8
8
|
const sentiments = {
|
|
9
|
-
danger:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = _ref;
|
|
13
|
-
return `
|
|
9
|
+
danger: ({
|
|
10
|
+
theme
|
|
11
|
+
}) => `
|
|
14
12
|
background-color: ${theme.colors.danger.backgroundStrong};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
theme
|
|
20
|
-
} = _ref2;
|
|
21
|
-
return `
|
|
13
|
+
`,
|
|
14
|
+
info: ({
|
|
15
|
+
theme
|
|
16
|
+
}) => `
|
|
22
17
|
background-color: ${theme.colors.info.backgroundStrong};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
theme
|
|
28
|
-
} = _ref3;
|
|
29
|
-
return `
|
|
18
|
+
`,
|
|
19
|
+
neutral: ({
|
|
20
|
+
theme
|
|
21
|
+
}) => `
|
|
30
22
|
background-color: ${theme.colors.neutral.backgroundStronger};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
theme
|
|
36
|
-
} = _ref4;
|
|
37
|
-
return `
|
|
23
|
+
`,
|
|
24
|
+
success: ({
|
|
25
|
+
theme
|
|
26
|
+
}) => `
|
|
38
27
|
background-color: ${theme.colors.success.backgroundStrong};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
theme
|
|
44
|
-
} = _ref5;
|
|
45
|
-
return `
|
|
28
|
+
`,
|
|
29
|
+
warning: ({
|
|
30
|
+
theme
|
|
31
|
+
}) => `
|
|
46
32
|
background-color: ${theme.colors.warning.backgroundStrong};
|
|
47
|
-
|
|
48
|
-
}
|
|
33
|
+
`
|
|
49
34
|
};
|
|
50
35
|
const StyledCircle = /*#__PURE__*/_styled("span", {
|
|
51
36
|
target: "eny0xmn2"
|
|
52
|
-
})("display:inline-block;width:", WIDTH, ";height:", HEIGHT, ";border-radius:",
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, ";", _ref7 => {
|
|
58
|
-
let {
|
|
59
|
-
sentiment
|
|
60
|
-
} = _ref7;
|
|
61
|
-
return sentiments[sentiment];
|
|
62
|
-
}, ";");
|
|
37
|
+
})("display:inline-block;width:", WIDTH, ";height:", HEIGHT, ";border-radius:", ({
|
|
38
|
+
theme
|
|
39
|
+
}) => theme.radii.circle, ";", ({
|
|
40
|
+
sentiment
|
|
41
|
+
}) => sentiments[sentiment], ";");
|
|
63
42
|
const StyledAnimatedCircle = /*#__PURE__*/_styled("span", {
|
|
64
43
|
target: "eny0xmn1"
|
|
65
|
-
})("position:absolute;width:", WIDTH, ";height:", HEIGHT, ";opacity:0.75;border-radius:",
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}, ";animation:", ping, " 1.1s cubic-bezier(0, 0, 0.2, 1) infinite;", _ref9 => {
|
|
71
|
-
let {
|
|
72
|
-
sentiment
|
|
73
|
-
} = _ref9;
|
|
74
|
-
return sentiments[sentiment];
|
|
75
|
-
}, ";");
|
|
44
|
+
})("position:absolute;width:", WIDTH, ";height:", HEIGHT, ";opacity:0.75;border-radius:", ({
|
|
45
|
+
theme
|
|
46
|
+
}) => theme.radii.circle, ";animation:", ping, " 1.1s cubic-bezier(0, 0, 0.2, 1) infinite;", ({
|
|
47
|
+
sentiment
|
|
48
|
+
}) => sentiments[sentiment], ";");
|
|
76
49
|
const Container = /*#__PURE__*/_styled("span", {
|
|
77
50
|
target: "eny0xmn0"
|
|
78
51
|
})("display:flex;width:", WIDTH, ";height:", HEIGHT, ";");
|
|
79
52
|
/**
|
|
80
53
|
* Status component used to display a colored circle with a tooltip for additional information.
|
|
81
54
|
*/
|
|
82
|
-
const Status =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
})
|
|
101
|
-
});
|
|
102
|
-
};
|
|
55
|
+
const Status = ({
|
|
56
|
+
animated = false,
|
|
57
|
+
className,
|
|
58
|
+
tooltip,
|
|
59
|
+
sentiment,
|
|
60
|
+
'data-testid': dataTestId
|
|
61
|
+
}) => jsx(Tooltip, {
|
|
62
|
+
text: tooltip,
|
|
63
|
+
children: jsxs(Container, {
|
|
64
|
+
className: className,
|
|
65
|
+
"data-testid": dataTestId,
|
|
66
|
+
children: [animated ? jsx(StyledAnimatedCircle, {
|
|
67
|
+
sentiment: sentiment
|
|
68
|
+
}) : null, jsx(StyledCircle, {
|
|
69
|
+
sentiment: sentiment
|
|
70
|
+
})]
|
|
71
|
+
})
|
|
72
|
+
});
|
|
103
73
|
|
|
104
74
|
export { Status };
|