@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.
Files changed (111) hide show
  1. package/README.md +14 -7
  2. package/dist/index.d.ts +51 -2
  3. package/dist/src/components/ActionBar/index.js +22 -37
  4. package/dist/src/components/Alert/index.js +27 -41
  5. package/dist/src/components/Avatar/index.js +48 -69
  6. package/dist/src/components/Badge/index.js +29 -49
  7. package/dist/src/components/Banner/index.js +42 -62
  8. package/dist/src/components/BarChart/Tooltip.js +35 -50
  9. package/dist/src/components/BarChart/index.js +13 -14
  10. package/dist/src/components/BarStack/index.js +100 -191
  11. package/dist/src/components/Breadcrumbs/index.js +29 -39
  12. package/dist/src/components/Bullet/index.js +42 -55
  13. package/dist/src/components/Button/index.js +73 -99
  14. package/dist/src/components/Card/index.js +39 -57
  15. package/dist/src/components/Carousel/index.js +32 -60
  16. package/dist/src/components/Checkbox/index.js +153 -341
  17. package/dist/src/components/CheckboxGroup/index.js +25 -27
  18. package/dist/src/components/CopyButton/index.js +11 -12
  19. package/dist/src/components/DateInput/index.js +141 -268
  20. package/dist/src/components/EmptyState/index.js +68 -83
  21. package/dist/src/components/Expandable/index.js +13 -20
  22. package/dist/src/components/GlobalAlert/GlobalAlertLink.js +12 -13
  23. package/dist/src/components/GlobalAlert/index.js +19 -32
  24. package/dist/src/components/LineChart/CustomLegend.js +80 -89
  25. package/dist/src/components/LineChart/Tooltip.js +32 -47
  26. package/dist/src/components/LineChart/helpers.js +15 -50
  27. package/dist/src/components/LineChart/index.js +23 -33
  28. package/dist/src/components/Link/index.js +46 -65
  29. package/dist/src/components/List/Body.js +9 -15
  30. package/dist/src/components/List/Cell.js +6 -7
  31. package/dist/src/components/List/HeaderCell.js +28 -56
  32. package/dist/src/components/List/HeaderRow.js +9 -16
  33. package/dist/src/components/List/ListContext.js +5 -6
  34. package/dist/src/components/List/Row.js +44 -90
  35. package/dist/src/components/List/SelectBar.js +9 -13
  36. package/dist/src/components/List/SkeletonRows.js +5 -6
  37. package/dist/src/components/List/index.js +15 -25
  38. package/dist/src/components/Loader/index.js +18 -25
  39. package/dist/src/components/Menu/Item.js +39 -49
  40. package/dist/src/components/Menu/index.js +31 -56
  41. package/dist/src/components/MenuV2/Item.js +39 -49
  42. package/dist/src/components/MenuV2/index.js +28 -47
  43. package/dist/src/components/Meter/index.js +25 -47
  44. package/dist/src/components/Modal/Dialog.js +33 -58
  45. package/dist/src/components/Modal/Disclosure.js +8 -9
  46. package/dist/src/components/Modal/index.js +26 -33
  47. package/dist/src/components/Notice/index.js +21 -27
  48. package/dist/src/components/NumberInput/index.js +73 -137
  49. package/dist/src/components/Pagination/getPageNumbers.js +1 -4
  50. package/dist/src/components/Pagination/index.js +17 -27
  51. package/dist/src/components/PasswordCheck/index.js +26 -32
  52. package/dist/src/components/PasswordStrengthMeter/index.js +25 -44
  53. package/dist/src/components/PieChart/Legends.js +71 -107
  54. package/dist/src/components/PieChart/Tooltip.js +33 -36
  55. package/dist/src/components/PieChart/index.js +13 -17
  56. package/dist/src/components/Popover/index.js +58 -75
  57. package/dist/src/components/Popup/helpers.js +13 -15
  58. package/dist/src/components/Popup/index.js +55 -98
  59. package/dist/src/components/ProgressBar/index.js +31 -49
  60. package/dist/src/components/Radio/index.js +58 -113
  61. package/dist/src/components/RadioGroup/index.js +26 -28
  62. package/dist/src/components/Row/index.js +25 -31
  63. package/dist/src/components/SelectInput/index.js +357 -410
  64. package/dist/src/components/SelectableCard/index.js +73 -115
  65. package/dist/src/components/Separator/index.js +52 -73
  66. package/dist/src/components/Skeleton/Block.js +23 -41
  67. package/dist/src/components/Skeleton/Blocks.js +23 -41
  68. package/dist/src/components/Skeleton/BoxWithIcon.js +21 -36
  69. package/dist/src/components/Skeleton/Donut.js +3 -6
  70. package/dist/src/components/Skeleton/IconSkeleton.js +13 -31
  71. package/dist/src/components/Skeleton/Line.js +5 -11
  72. package/dist/src/components/Skeleton/List.js +22 -31
  73. package/dist/src/components/Skeleton/Slider.js +25 -46
  74. package/dist/src/components/Skeleton/Square.js +3 -6
  75. package/dist/src/components/Skeleton/index.js +17 -33
  76. package/dist/src/components/Snippet/index.js +82 -137
  77. package/dist/src/components/Stack/index.js +11 -14
  78. package/dist/src/components/Status/index.js +48 -78
  79. package/dist/src/components/StepList/index.js +45 -63
  80. package/dist/src/components/Stepper/index.js +74 -129
  81. package/dist/src/components/SwitchButton/FocusOverlay.js +13 -23
  82. package/dist/src/components/SwitchButton/index.js +36 -62
  83. package/dist/src/components/Table/Body.js +5 -8
  84. package/dist/src/components/Table/Cell.js +14 -20
  85. package/dist/src/components/Table/Header.js +8 -14
  86. package/dist/src/components/Table/HeaderCell.js +40 -56
  87. package/dist/src/components/Table/HeaderRow.js +4 -5
  88. package/dist/src/components/Table/Row.js +10 -14
  89. package/dist/src/components/Table/SelectBar.js +9 -13
  90. package/dist/src/components/Table/SkeletonRows.js +5 -6
  91. package/dist/src/components/Table/TableContext.js +6 -7
  92. package/dist/src/components/Table/index.js +44 -50
  93. package/dist/src/components/Tabs/Tab.js +57 -118
  94. package/dist/src/components/Tabs/TabMenu.js +32 -38
  95. package/dist/src/components/Tabs/TabMenuItem.js +9 -13
  96. package/dist/src/components/Tabs/index.js +24 -43
  97. package/dist/src/components/Tag/index.js +57 -74
  98. package/dist/src/components/TagInput/index.js +63 -94
  99. package/dist/src/components/TagList/index.js +22 -35
  100. package/dist/src/components/Text/index.js +29 -31
  101. package/dist/src/components/TextArea/index.js +240 -0
  102. package/dist/src/components/TextInput/index.js +166 -260
  103. package/dist/src/components/TimeInput/index.js +10 -13
  104. package/dist/src/components/Toaster/index.js +51 -67
  105. package/dist/src/components/Toggle/index.js +62 -129
  106. package/dist/src/components/ToggleGroup/index.js +21 -23
  107. package/dist/src/components/Tooltip/index.js +28 -31
  108. package/dist/src/components/VerificationCode/index.js +55 -90
  109. package/dist/src/index.js +1 -0
  110. package/dist/src/utils/ids.js +1 -6
  111. package/package.json +3 -3
@@ -2,19 +2,18 @@ import { useTheme } from '@emotion/react';
2
2
  import { Link } from '../Link/index.js';
3
3
  import { jsx } from '@emotion/react/jsx-runtime';
4
4
 
5
- const GlobalAlertLink = _ref => {
6
- let {
7
- children,
8
- href,
9
- target,
10
- download,
11
- rel,
12
- className,
13
- onClick,
14
- 'aria-label': ariaLabel,
15
- oneLine = false,
16
- 'data-testid': dataTestId
17
- } = _ref;
5
+ const GlobalAlertLink = ({
6
+ children,
7
+ href,
8
+ target,
9
+ download,
10
+ rel,
11
+ className,
12
+ onClick,
13
+ 'aria-label': ariaLabel,
14
+ oneLine = false,
15
+ 'data-testid': dataTestId
16
+ }) => {
18
17
  const {
19
18
  theme
20
19
  } = useTheme();
@@ -12,42 +12,29 @@ const CloseButton = /*#__PURE__*/_styled(Button, {
12
12
  })("background:none;position:absolute;right:", SIZE_HEIGHT.xsmall, "px;&:hover,&:focus,&:active{background:none;}");
13
13
  const Container = /*#__PURE__*/_styled(Stack, {
14
14
  target: "ewvyccp0"
15
- })("width:100%;height:56px;padding:0 ", _ref => {
16
- let {
17
- theme
18
- } = _ref;
19
- return theme.space['2'];
20
- }, ";&[data-variant='info']{background-color:", _ref2 => {
21
- let {
22
- theme
23
- } = _ref2;
24
- return theme.colors.info.backgroundStrong;
25
- }, ";}&[data-variant='danger']{background-color:", _ref3 => {
26
- let {
27
- theme
28
- } = _ref3;
29
- return theme.colors.danger.backgroundStrong;
30
- }, ";}&[data-variant='promotional']{background:", _ref4 => {
31
- let {
32
- theme
33
- } = _ref4;
34
- return theme.colors.other.gradients.background.aqua;
35
- }, ";}");
15
+ })("width:100%;height:56px;padding:0 ", ({
16
+ theme
17
+ }) => theme.space['2'], ";&[data-variant='info']{background-color:", ({
18
+ theme
19
+ }) => theme.colors.info.backgroundStrong, ";}&[data-variant='danger']{background-color:", ({
20
+ theme
21
+ }) => theme.colors.danger.backgroundStrong, ";}&[data-variant='promotional']{background:", ({
22
+ theme
23
+ }) => theme.colors.other.gradients.background.aqua, ";}");
36
24
  /**
37
25
  * GlobalAlert is a component that is used to display a global alert message.
38
26
  * It has its own internal state and can be closed by clicking on the close button.
39
27
  */
40
- const GlobalAlert = _ref5 => {
41
- let {
42
- children,
43
- variant = 'info',
44
- onClose,
45
- closable = true,
46
- buttonText,
47
- onClickButton,
48
- className,
49
- 'data-testid': dataTestId
50
- } = _ref5;
28
+ const GlobalAlert = ({
29
+ children,
30
+ variant = 'info',
31
+ onClose,
32
+ closable = true,
33
+ buttonText,
34
+ onClickButton,
35
+ className,
36
+ 'data-testid': dataTestId
37
+ }) => {
51
38
  const {
52
39
  theme
53
40
  } = useTheme();
@@ -30,18 +30,15 @@ const StyledText = /*#__PURE__*/_styled(Text, {
30
30
  styles: "text-align:right;flex:1;min-width:72px;align-self:center",
31
31
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
32
32
  });
33
- const Cell = _ref => {
34
- let {
35
- value,
36
- variant
37
- } = _ref;
38
- return jsx(StyledText, {
39
- variant: variant,
40
- color: "neutral",
41
- as: "span",
42
- children: value
43
- });
44
- };
33
+ const Cell = ({
34
+ value,
35
+ variant
36
+ }) => jsx(StyledText, {
37
+ variant: variant,
38
+ color: "neutral",
39
+ as: "span",
40
+ children: value
41
+ });
45
42
  const CellValueContainer = /*#__PURE__*/_styled("div", {
46
43
  target: "erndk5t2"
47
44
  })(process.env.NODE_ENV === "production" ? {
@@ -65,83 +62,77 @@ const LongContainer = /*#__PURE__*/_styled("div", {
65
62
  const noop = value => value.toString();
66
63
  const StyledContainer = /*#__PURE__*/_styled("div", {
67
64
  target: "erndk5t0"
68
- })("margin-top:", _ref2 => {
69
- let {
70
- theme
71
- } = _ref2;
72
- return theme.space[2];
73
- }, ";");
74
- const CustomLegend = _ref3 => {
75
- let {
76
- axisTransformer = noop,
77
- data,
78
- selected,
79
- setSelected,
80
- className,
81
- 'data-testid': dataTestId
82
- } = _ref3;
83
- return jsxs(StyledContainer, {
84
- className: className,
85
- "data-testid": dataTestId,
86
- children: [jsxs("div", {
87
- css: styles.head,
88
- children: [jsx(LongContainer, {
89
- children: "Legend"
90
- }), jsx(Cell, {
91
- variant: "body",
92
- value: "Minimum"
93
- }), jsx(Cell, {
94
- variant: "body",
95
- value: "Maximum"
96
- }), jsx(Cell, {
97
- variant: "body",
98
- value: "Average"
99
- }), jsx(Cell, {
100
- variant: "body",
101
- value: "Current"
102
- })]
103
- }), jsx("div", {
104
- css: styles.body,
105
- children: data?.map((row, index) => {
106
- const values = row.data.map(val => val.y);
107
- const labelIndexed = `${row.id}${index}`;
108
- const id = row.id.toString();
109
- return jsxs("div", {
110
- css: styles.row,
111
- children: [jsx(LongContainer, {
112
- children: jsx(Checkbox, {
113
- checked: selected.includes(labelIndexed),
114
- name: id,
115
- onChange: () => setSelected([...getSelected(id, index, selected)]),
116
- children: jsxs(CellValueContainer, {
117
- children: [jsx(Text, {
118
- as: "span",
119
- variant: "bodySmall",
120
- sentiment: "neutral",
121
- children: row?.['label']
122
- }), jsx("div", {
123
- "data-testid": `label-${id}`,
124
- css: styles.legend(index)
125
- })]
126
- })
127
- })
128
- }), jsx(Cell, {
129
- variant: "bodySmall",
130
- value: axisTransformer(getMin(values))
131
- }), jsx(Cell, {
132
- variant: "bodySmall",
133
- value: axisTransformer(getMax(values))
134
- }), jsx(Cell, {
135
- variant: "bodySmall",
136
- value: axisTransformer(getAverage(values))
137
- }), jsx(Cell, {
138
- variant: "bodySmall",
139
- value: axisTransformer(getCurrent(values))
140
- })]
141
- }, labelIndexed);
142
- })
65
+ })("margin-top:", ({
66
+ theme
67
+ }) => theme.space[2], ";");
68
+ const CustomLegend = ({
69
+ axisTransformer = noop,
70
+ data,
71
+ selected,
72
+ setSelected,
73
+ className,
74
+ 'data-testid': dataTestId
75
+ }) => jsxs(StyledContainer, {
76
+ className: className,
77
+ "data-testid": dataTestId,
78
+ children: [jsxs("div", {
79
+ css: styles.head,
80
+ children: [jsx(LongContainer, {
81
+ children: "Legend"
82
+ }), jsx(Cell, {
83
+ variant: "body",
84
+ value: "Minimum"
85
+ }), jsx(Cell, {
86
+ variant: "body",
87
+ value: "Maximum"
88
+ }), jsx(Cell, {
89
+ variant: "body",
90
+ value: "Average"
91
+ }), jsx(Cell, {
92
+ variant: "body",
93
+ value: "Current"
143
94
  })]
144
- });
145
- };
95
+ }), jsx("div", {
96
+ css: styles.body,
97
+ children: data?.map((row, index) => {
98
+ const values = row.data.map(val => val.y);
99
+ const labelIndexed = `${row.id}${index}`;
100
+ const id = row.id.toString();
101
+ return jsxs("div", {
102
+ css: styles.row,
103
+ children: [jsx(LongContainer, {
104
+ children: jsx(Checkbox, {
105
+ checked: selected.includes(labelIndexed),
106
+ name: id,
107
+ onChange: () => setSelected([...getSelected(id, index, selected)]),
108
+ children: jsxs(CellValueContainer, {
109
+ children: [jsx(Text, {
110
+ as: "span",
111
+ variant: "bodySmall",
112
+ sentiment: "neutral",
113
+ children: row?.['label']
114
+ }), jsx("div", {
115
+ "data-testid": `label-${id}`,
116
+ css: styles.legend(index)
117
+ })]
118
+ })
119
+ })
120
+ }), jsx(Cell, {
121
+ variant: "bodySmall",
122
+ value: axisTransformer(getMin(values))
123
+ }), jsx(Cell, {
124
+ variant: "bodySmall",
125
+ value: axisTransformer(getMax(values))
126
+ }), jsx(Cell, {
127
+ variant: "bodySmall",
128
+ value: axisTransformer(getAverage(values))
129
+ }), jsx(Cell, {
130
+ variant: "bodySmall",
131
+ value: axisTransformer(getCurrent(values))
132
+ })]
133
+ }, labelIndexed);
134
+ })
135
+ })]
136
+ });
146
137
 
147
138
  export { CustomLegend };
@@ -4,55 +4,40 @@ import { jsxs, jsx } from '@emotion/react/jsx-runtime';
4
4
 
5
5
  const LineTooltipContainer = /*#__PURE__*/_styled("div", {
6
6
  target: "e11niu3b1"
7
- })("display:flex;background:", _ref => {
8
- let {
9
- theme
10
- } = _ref;
11
- return theme.colors.neutral.backgroundStronger;
12
- }, ";border-radius:", _ref2 => {
13
- let {
14
- theme
15
- } = _ref2;
16
- return theme.radii.small;
17
- }, ";box-shadow:", _ref3 => {
18
- let {
19
- theme
20
- } = _ref3;
21
- return theme.shadows.tooltip;
22
- }, ";padding:5px 9px;align-items:center;");
7
+ })("display:flex;background:", ({
8
+ theme
9
+ }) => theme.colors.neutral.backgroundStronger, ";border-radius:", ({
10
+ theme
11
+ }) => theme.radii.small, ";box-shadow:", ({
12
+ theme
13
+ }) => theme.shadows.tooltip, ";padding:5px 9px;align-items:center;");
23
14
  const LineColorSquare = /*#__PURE__*/_styled("span", {
24
15
  target: "e11niu3b0"
25
- })("display:block;width:12px;height:12px;background:", _ref4 => {
26
- let {
27
- color
28
- } = _ref4;
29
- return color;
30
- }, ";margin-right:12px;");
31
- const LineChartTooltip = _ref5 => {
32
- let {
33
- point
34
- } = _ref5;
35
- return jsxs(LineTooltipContainer, {
36
- children: [jsx("div", {
37
- children: jsx(LineColorSquare, {
38
- color: point.serieColor
39
- })
40
- }), jsxs("div", {
41
- children: [jsx(Text, {
42
- variant: "bodyStronger",
43
- sentiment: "neutral",
44
- prominence: "stronger",
45
- as: "div",
46
- children: point.data.yFormatted
47
- }), jsx(Text, {
48
- variant: "bodySmall",
49
- sentiment: "neutral",
50
- prominence: "stronger",
51
- as: "div",
52
- children: point.data.xFormatted
53
- })]
16
+ })("display:block;width:12px;height:12px;background:", ({
17
+ color
18
+ }) => color, ";margin-right:12px;");
19
+ const LineChartTooltip = ({
20
+ point
21
+ }) => jsxs(LineTooltipContainer, {
22
+ children: [jsx("div", {
23
+ children: jsx(LineColorSquare, {
24
+ color: point.serieColor
25
+ })
26
+ }), jsxs("div", {
27
+ children: [jsx(Text, {
28
+ variant: "bodyStronger",
29
+ sentiment: "neutral",
30
+ prominence: "stronger",
31
+ as: "div",
32
+ children: point.data.yFormatted
33
+ }), jsx(Text, {
34
+ variant: "bodySmall",
35
+ sentiment: "neutral",
36
+ prominence: "stronger",
37
+ as: "div",
38
+ children: point.data.xFormatted
54
39
  })]
55
- });
56
- };
40
+ })]
41
+ });
57
42
 
58
43
  export { LineChartTooltip };
@@ -4,64 +4,29 @@ const parse = data => {
4
4
  if (data instanceof Date) return data.getTime();
5
5
  return 0;
6
6
  };
7
- const getMin = function (values) {
8
- if (values === void 0) {
9
- values = [];
10
- }
11
- return values.length ? Math.min(...values.map(parse)) : 0;
12
- };
13
- const getMax = function (values) {
14
- if (values === void 0) {
15
- values = [];
16
- }
17
- return values.length ? Math.max(...values.map(parse)) : 0;
18
- };
19
- const getAverage = function (values) {
20
- if (values === void 0) {
21
- values = [];
22
- }
23
- return values.length ? Math.round(values.reduce((sum, curr) => sum + parse(curr), 0) / values.length * 100) / 100 : 0;
24
- };
7
+ const getMin = (values = []) => values.length ? Math.min(...values.map(parse)) : 0;
8
+ const getMax = (values = []) => values.length ? Math.max(...values.map(parse)) : 0;
9
+ const getAverage = (values = []) => values.length ? Math.round(values.reduce((sum, curr) => sum + parse(curr), 0) / values.length * 100) / 100 : 0;
25
10
  const getMaxChartValue = preppedData => {
26
11
  if (!preppedData?.length) return 0;
27
- const maximum = Math.max(...preppedData.map(_ref => {
28
- let {
29
- data
30
- } = _ref;
31
- return getMax(data.map(_ref2 => {
32
- let {
33
- y
34
- } = _ref2;
35
- return y || 0;
36
- }));
37
- }));
12
+ const maximum = Math.max(...preppedData.map(({
13
+ data
14
+ }) => getMax(data.map(({
15
+ y
16
+ }) => y || 0))));
38
17
  return Math.ceil(maximum + maximum * 0.1);
39
18
  };
40
19
  const getMinChartValue = preppedData => {
41
20
  if (!preppedData?.length) return 0;
42
- const minimum = Math.min(...preppedData.map(_ref3 => {
43
- let {
44
- data
45
- } = _ref3;
46
- return getMin(data.map(_ref4 => {
47
- let {
48
- y
49
- } = _ref4;
50
- return y || 0;
51
- }));
52
- }));
21
+ const minimum = Math.min(...preppedData.map(({
22
+ data
23
+ }) => getMin(data.map(({
24
+ y
25
+ }) => y || 0))));
53
26
  return Math.floor(minimum - minimum * 0.1);
54
27
  };
55
- const getCurrent = function (values) {
56
- if (values === void 0) {
57
- values = [];
58
- }
59
- return values.length ? values[values.length - 1] : 0;
60
- };
61
- const getSelected = function (label, index, selected) {
62
- if (selected === void 0) {
63
- selected = [];
64
- }
28
+ const getCurrent = (values = []) => values.length ? values[values.length - 1] : 0;
29
+ const getSelected = (label, index, selected = []) => {
65
30
  const labelIndexed = label + index.toString();
66
31
  const found = selected.indexOf(labelIndexed);
67
32
  if (found > -1) {
@@ -30,21 +30,20 @@ const DEFAULT_CHARTPROPS = {};
30
30
  * See https://nivo.rocks/line/ for more information.
31
31
  * @experimental This component is experimental and may be subject to breaking changes in the future.
32
32
  */
33
- const LineChart = _ref => {
34
- let {
35
- height = '537px',
36
- // to maintain aspect ratio based on our standard 1074px width
37
- margin = DEFAULT_MARGIN,
38
- xScale = DEFAULT_XSCALE,
39
- yScale = DEFAULT_YSCALE,
40
- data,
41
- withLegend = false,
42
- axisFormatters,
43
- pointFormatters,
44
- tickValues,
45
- chartProps = DEFAULT_CHARTPROPS,
46
- 'data-testid': dataTestId
47
- } = _ref;
33
+ const LineChart = ({
34
+ height = '537px',
35
+ // to maintain aspect ratio based on our standard 1074px width
36
+ margin = DEFAULT_MARGIN,
37
+ xScale = DEFAULT_XSCALE,
38
+ yScale = DEFAULT_YSCALE,
39
+ data,
40
+ withLegend = false,
41
+ axisFormatters,
42
+ pointFormatters,
43
+ tickValues,
44
+ chartProps = DEFAULT_CHARTPROPS,
45
+ 'data-testid': dataTestId
46
+ }) => {
48
47
  const theme = useTheme();
49
48
  const dataset = {
50
49
  datasets: data?.map(d => ({
@@ -66,28 +65,19 @@ const LineChart = _ref => {
66
65
  fontSize: 12,
67
66
  textColor: theme.colors.neutral.textWeak
68
67
  };
69
- const [selected, setSelected] = useState(dataset.datasets?.map((_ref2, index) => {
70
- let {
71
- id
72
- } = _ref2;
73
- return `${id}${index}`;
74
- }));
75
- const finalData = dataset.datasets?.filter((_ref3, index) => {
76
- let {
77
- id
78
- } = _ref3;
79
- return selected ? selected.includes(`${id}${index}`) : false;
80
- });
68
+ const [selected, setSelected] = useState(dataset.datasets?.map(({
69
+ id
70
+ }, index) => `${id}${index}`));
71
+ const finalData = dataset.datasets?.filter(({
72
+ id
73
+ }, index) => selected ? selected.includes(`${id}${index}`) : false);
81
74
  useEffect(() => {
82
75
  if (selected !== undefined) {
83
76
  return;
84
77
  }
85
- setSelected(dataset.datasets?.map((_ref4, index) => {
86
- let {
87
- id
88
- } = _ref4;
89
- return `${id}${index}`;
90
- }));
78
+ setSelected(dataset.datasets?.map(({
79
+ id
80
+ }, index) => `${id}${index}`));
91
81
  }, [dataset.datasets, selected]);
92
82
  const localColors = getLegendColor(theme);
93
83
  return jsxs(Fragment, {
@@ -20,43 +20,32 @@ const BLANK_TARGET_ICON_SIZE = 14;
20
20
  const TRANSITION_DURATION = 250;
21
21
  const StyledExternalIconContainer = /*#__PURE__*/_styled("span", {
22
22
  target: "e1afnb7a1"
23
- })("display:inline-flex;padding-bottom:", _ref => {
24
- let {
25
- theme
26
- } = _ref;
27
- return theme.space['0.5'];
28
- }, ";");
23
+ })("display:inline-flex;padding-bottom:", ({
24
+ theme
25
+ }) => theme.space['0.5'], ";");
29
26
  const StyledLink = /*#__PURE__*/_styled('a', {
30
27
  shouldForwardProp: prop => !['sentiment', 'iconPosition', 'as', 'oneLine'].includes(prop),
31
28
  target: "e1afnb7a0"
32
- })("background-color:transparent;border:none;padding:0;color:", _ref2 => {
33
- let {
34
- theme,
35
- sentiment,
36
- prominence
37
- } = _ref2;
29
+ })("background-color:transparent;border:none;padding:0;color:", ({
30
+ theme,
31
+ sentiment,
32
+ prominence
33
+ }) => {
38
34
  const definedProminence = capitalize(PROMINENCES[prominence ?? 'default']);
39
35
  theme.colors[sentiment];
40
36
  const text = `text${definedProminence}`;
41
37
  return theme.colors[sentiment]?.[text] ?? theme.colors.neutral.text;
42
- }, ";text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px;text-decoration-color:transparent;display:inline-flex;flex-direction:row;align-items:center;transition:text-decoration-color ", TRANSITION_DURATION, "ms ease-out;", StyledIcon, "{transition:transform ", TRANSITION_DURATION, "ms ease-out;}gap:", _ref3 => {
43
- let {
44
- theme
45
- } = _ref3;
46
- return theme.space['1'];
47
- }, ";position:relative;cursor:pointer;>*{pointer-events:none;}", _ref4 => {
48
- let {
49
- oneLine
50
- } = _ref4;
51
- return oneLine ? `white-space: nowrap;
38
+ }, ";text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px;text-decoration-color:transparent;display:inline-flex;flex-direction:row;align-items:center;transition:text-decoration-color ", TRANSITION_DURATION, "ms ease-out;", StyledIcon, "{transition:transform ", TRANSITION_DURATION, "ms ease-out;}gap:", ({
39
+ theme
40
+ }) => theme.space['1'], ";position:relative;cursor:pointer;>*{pointer-events:none;}", ({
41
+ oneLine
42
+ }) => oneLine ? `white-space: nowrap;
52
43
  text-overflow: ellipsis;
53
44
  overflow: hidden;
54
- display: block;` : 'width: fit-content;';
55
- }, " ", _ref5 => {
56
- let {
57
- size,
58
- theme
59
- } = _ref5;
45
+ display: block;` : 'width: fit-content;', " ", ({
46
+ size,
47
+ theme
48
+ }) => {
60
49
  const variant = size === 'small' ? 'bodySmallStrong' : 'bodyStrong';
61
50
  return `
62
51
  font-size: ${theme.typography[variant].fontSize};
@@ -67,53 +56,45 @@ const StyledLink = /*#__PURE__*/_styled('a', {
67
56
  paragraph-spacing: ${theme.typography[variant].paragraphSpacing};
68
57
  text-case: ${theme.typography[variant].textCase};
69
58
  `;
70
- }, " &:hover,&:focus{outline:none;text-decoration:underline;text-decoration-thickness:1px;", _ref6 => {
71
- let {
72
- theme,
73
- sentiment,
74
- prominence
75
- } = _ref6;
59
+ }, " &:hover,&:focus{outline:none;text-decoration:underline;text-decoration-thickness:1px;", ({
60
+ theme,
61
+ sentiment,
62
+ prominence
63
+ }) => {
76
64
  const definedProminence = capitalize(PROMINENCES[prominence ?? 'default']);
77
65
  theme.colors[sentiment];
78
66
  const text = `text${definedProminence}Hover`;
79
67
  return `
80
68
  color: ${theme.colors[sentiment]?.[text] ?? theme.colors.neutral.textHover};
81
69
  text-decoration-color: ${theme.colors[sentiment]?.[text] ?? theme.colors.neutral.textHover};`;
82
- }, ";", StyledIcon, "{transform:", _ref7 => {
83
- let {
84
- theme,
85
- iconPosition
86
- } = _ref7;
87
- return iconPosition === 'left' ? `translate(${theme.space['0.5']}, 0)` : `translate(-${theme.space['0.5']}, 0)`;
88
- }, ";}}&[data-variant='inline']{text-decoration:underline;text-decoration-thickness:1px;}&:hover::after,&:focus::after{background-color:", _ref8 => {
89
- let {
90
- theme,
91
- sentiment
92
- } = _ref8;
93
- return theme.colors[sentiment]?.text ?? theme.colors.neutral.text;
94
- }, ";}&:active{text-decoration-thickness:2px;}");
70
+ }, ";", StyledIcon, "{transform:", ({
71
+ theme,
72
+ iconPosition
73
+ }) => iconPosition === 'left' ? `translate(${theme.space['0.5']}, 0)` : `translate(-${theme.space['0.5']}, 0)`, ";}}&[data-variant='inline']{text-decoration:underline;text-decoration-thickness:1px;}&:hover::after,&:focus::after{background-color:", ({
74
+ theme,
75
+ sentiment
76
+ }) => theme.colors[sentiment]?.text ?? theme.colors.neutral.text, ";}&:active{text-decoration-thickness:2px;}");
95
77
 
96
78
  /**
97
79
  * Link is a component used to navigate between pages or to external websites.
98
80
  */
99
- const Link = /*#__PURE__*/forwardRef((_ref9, ref) => {
100
- let {
101
- children,
102
- href,
103
- target,
104
- download,
105
- sentiment = 'info',
106
- prominence,
107
- size = 'large',
108
- iconPosition,
109
- rel,
110
- className,
111
- onClick,
112
- 'aria-label': ariaLabel,
113
- oneLine = false,
114
- 'data-testid': dataTestId,
115
- variant = 'standalone'
116
- } = _ref9;
81
+ const Link = /*#__PURE__*/forwardRef(({
82
+ children,
83
+ href,
84
+ target,
85
+ download,
86
+ sentiment = 'info',
87
+ prominence,
88
+ size = 'large',
89
+ iconPosition,
90
+ rel,
91
+ className,
92
+ onClick,
93
+ 'aria-label': ariaLabel,
94
+ oneLine = false,
95
+ 'data-testid': dataTestId,
96
+ variant = 'standalone'
97
+ }, ref) => {
117
98
  const isBlank = target === '_blank';
118
99
  const computedRel = rel || (isBlank ? 'noopener noreferrer' : undefined);
119
100
  const [isTruncated, setIsTruncated] = useState(false);