@ultraviolet/ui 1.0.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 (115) hide show
  1. package/LICENSE +189 -0
  2. package/README.md +64 -0
  3. package/dist/index.d.ts +2427 -0
  4. package/dist/react-datepicker/dist/react-datepicker.min.css.js +3 -0
  5. package/dist/react-toastify/dist/ReactToastify.min.css.js +3 -0
  6. package/dist/src/components/ActionBar/index.js +55 -0
  7. package/dist/src/components/Alert/index.js +144 -0
  8. package/dist/src/components/Avatar/index.js +90 -0
  9. package/dist/src/components/Badge/index.js +143 -0
  10. package/dist/src/components/Banner/index.js +117 -0
  11. package/dist/src/components/BarChart/Tooltip.js +63 -0
  12. package/dist/src/components/BarChart/index.js +94 -0
  13. package/dist/src/components/BarStack/index.js +223 -0
  14. package/dist/src/components/Breadcrumbs/index.js +89 -0
  15. package/dist/src/components/Bullet/index.js +137 -0
  16. package/dist/src/components/Button/index.js +303 -0
  17. package/dist/src/components/Card/index.js +81 -0
  18. package/dist/src/components/Carousel/index.js +162 -0
  19. package/dist/src/components/Checkbox/index.js +338 -0
  20. package/dist/src/components/CopyButton/index.js +92 -0
  21. package/dist/src/components/DateInput/index.js +250 -0
  22. package/dist/src/components/EmptyState/index.js +124 -0
  23. package/dist/src/components/Expandable/index.js +84 -0
  24. package/dist/src/components/Icon/index.js +350 -0
  25. package/dist/src/components/LineChart/CustomLegend.js +147 -0
  26. package/dist/src/components/LineChart/Tooltip.js +58 -0
  27. package/dist/src/components/LineChart/helpers.js +75 -0
  28. package/dist/src/components/LineChart/index.js +139 -0
  29. package/dist/src/components/Link/index.js +159 -0
  30. package/dist/src/components/List/Body.js +22 -0
  31. package/dist/src/components/List/Cell.js +38 -0
  32. package/dist/src/components/List/HeaderCell.js +118 -0
  33. package/dist/src/components/List/HeaderRow.js +47 -0
  34. package/dist/src/components/List/ListContext.js +120 -0
  35. package/dist/src/components/List/Row.js +211 -0
  36. package/dist/src/components/List/SelectBar.js +52 -0
  37. package/dist/src/components/List/SkeletonRows.js +54 -0
  38. package/dist/src/components/List/constants.js +3 -0
  39. package/dist/src/components/List/index.js +77 -0
  40. package/dist/src/components/Loader/index.js +87 -0
  41. package/dist/src/components/Menu/Item.js +122 -0
  42. package/dist/src/components/Menu/index.js +143 -0
  43. package/dist/src/components/Modal/index.js +279 -0
  44. package/dist/src/components/Notice/index.js +33 -0
  45. package/dist/src/components/NumberInput/helpers.js +6 -0
  46. package/dist/src/components/NumberInput/index.js +366 -0
  47. package/dist/src/components/Pagination/getPageNumbers.js +32 -0
  48. package/dist/src/components/Pagination/index.js +118 -0
  49. package/dist/src/components/PasswordCheck/index.js +42 -0
  50. package/dist/src/components/PasswordStrengthMeter/index.js +116 -0
  51. package/dist/src/components/PieChart/Legends.js +183 -0
  52. package/dist/src/components/PieChart/Tooltip.js +64 -0
  53. package/dist/src/components/PieChart/index.js +133 -0
  54. package/dist/src/components/PieChart/patterns.js +9 -0
  55. package/dist/src/components/Popover/index.js +131 -0
  56. package/dist/src/components/ProgressBar/index.js +72 -0
  57. package/dist/src/components/Radio/index.js +231 -0
  58. package/dist/src/components/Row/index.js +43 -0
  59. package/dist/src/components/SelectInput/index.js +662 -0
  60. package/dist/src/components/SelectableCard/index.js +154 -0
  61. package/dist/src/components/Separator/index.js +91 -0
  62. package/dist/src/components/Skeleton/Block.js +53 -0
  63. package/dist/src/components/Skeleton/Blocks.js +52 -0
  64. package/dist/src/components/Skeleton/BoxWithIcon.js +47 -0
  65. package/dist/src/components/Skeleton/Donut.js +58 -0
  66. package/dist/src/components/Skeleton/IconSkeleton.js +37 -0
  67. package/dist/src/components/Skeleton/Line.js +19 -0
  68. package/dist/src/components/Skeleton/List.js +60 -0
  69. package/dist/src/components/Skeleton/Slider.js +57 -0
  70. package/dist/src/components/Skeleton/index.js +85 -0
  71. package/dist/src/components/Snippet/index.js +250 -0
  72. package/dist/src/components/Stack/index.js +24 -0
  73. package/dist/src/components/Status/index.js +101 -0
  74. package/dist/src/components/StepList/index.js +81 -0
  75. package/dist/src/components/Stepper/index.js +217 -0
  76. package/dist/src/components/SwitchButton/FocusOverlay.js +47 -0
  77. package/dist/src/components/SwitchButton/index.js +131 -0
  78. package/dist/src/components/Table/Body.js +12 -0
  79. package/dist/src/components/Table/Cell.js +27 -0
  80. package/dist/src/components/Table/Header.js +21 -0
  81. package/dist/src/components/Table/HeaderCell.js +119 -0
  82. package/dist/src/components/Table/HeaderRow.js +35 -0
  83. package/dist/src/components/Table/Row.js +70 -0
  84. package/dist/src/components/Table/SelectBar.js +52 -0
  85. package/dist/src/components/Table/SkeletonRows.js +52 -0
  86. package/dist/src/components/Table/TableContext.js +91 -0
  87. package/dist/src/components/Table/index.js +84 -0
  88. package/dist/src/components/Tabs/Tab.js +165 -0
  89. package/dist/src/components/Tabs/TabMenu.js +46 -0
  90. package/dist/src/components/Tabs/TabMenuItem.js +40 -0
  91. package/dist/src/components/Tabs/TabsContext.js +6 -0
  92. package/dist/src/components/Tabs/index.js +117 -0
  93. package/dist/src/components/Tag/index.js +177 -0
  94. package/dist/src/components/TagInput/index.js +277 -0
  95. package/dist/src/components/TagList/index.js +110 -0
  96. package/dist/src/components/Text/index.js +106 -0
  97. package/dist/src/components/TextInput/index.js +529 -0
  98. package/dist/src/components/TimeInput/index.js +38 -0
  99. package/dist/src/components/Toaster/index.js +116 -0
  100. package/dist/src/components/Toggle/index.js +192 -0
  101. package/dist/src/components/Tooltip/helpers.js +131 -0
  102. package/dist/src/components/Tooltip/index.js +275 -0
  103. package/dist/src/components/VerificationCode/index.js +203 -0
  104. package/dist/src/helpers/isJSON.js +11 -0
  105. package/dist/src/helpers/legend.js +13 -0
  106. package/dist/src/helpers/recursivelyGetChildrenString.js +12 -0
  107. package/dist/src/index.js +63 -0
  108. package/dist/src/theme/index.js +25 -0
  109. package/dist/src/utils/animations.js +250 -0
  110. package/dist/src/utils/capitalize.js +4 -0
  111. package/dist/src/utils/ids.js +12 -0
  112. package/dist/src/utils/normalize.js +36 -0
  113. package/dist/src/utils/responsive/Breakpoint.js +12 -0
  114. package/dist/src/utils/responsive/utilities.js +12 -0
  115. package/package.json +70 -0
@@ -0,0 +1,63 @@
1
+ import _styled from '@emotion/styled/base';
2
+ import { Text } from '../Text/index.js';
3
+ import { jsxs, jsx } from '@emotion/react/jsx-runtime';
4
+
5
+ const BarToolTipContainer = /*#__PURE__*/_styled("div", {
6
+ target: "e1ilr3nn1"
7
+ })("display:flex;background:", _ref => {
8
+ let {
9
+ theme
10
+ } = _ref;
11
+ return theme.colors.neutral.backgroundWeakElevated;
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;");
23
+ const BarColorSquare = /*#__PURE__*/_styled('span', {
24
+ shouldForwardProp: prop => !['color'].includes(prop),
25
+ target: "e1ilr3nn0"
26
+ })("display:block;width:12px;height:12px;background:", _ref4 => {
27
+ let {
28
+ color
29
+ } = _ref4;
30
+ return color;
31
+ }, ";margin-right:12px;");
32
+ const BarChartToolTip = _ref5 => {
33
+ let {
34
+ formattedValue,
35
+ indexValue,
36
+ color,
37
+ className,
38
+ 'data-testid': dataTestId
39
+ } = _ref5;
40
+ return jsxs(BarToolTipContainer, {
41
+ className: className,
42
+ "data-testid": dataTestId,
43
+ children: [jsx("div", {
44
+ children: jsx(BarColorSquare, {
45
+ color: color
46
+ })
47
+ }), jsxs("div", {
48
+ children: [jsx(Text, {
49
+ variant: "bodyStronger",
50
+ as: "p",
51
+ color: "primary",
52
+ children: formattedValue
53
+ }), jsx(Text, {
54
+ variant: "bodySmall",
55
+ as: "p",
56
+ children: indexValue
57
+ })]
58
+ })]
59
+ });
60
+ };
61
+ var BarChartTooltip = BarChartToolTip;
62
+
63
+ export { BarChartTooltip as default };
@@ -0,0 +1,94 @@
1
+ import { useTheme } from '@emotion/react';
2
+ import { ResponsiveBar } from '@nivo/bar';
3
+ import { useCallback } from 'react';
4
+ import { getLegendColor } from '../../helpers/legend.js';
5
+ import BarChartTooltip from './Tooltip.js';
6
+ import { jsx } from '@emotion/react/jsx-runtime';
7
+
8
+ const DEFAULT_MARGIN = {
9
+ bottom: 50,
10
+ left: 60,
11
+ right: 25,
12
+ top: 50
13
+ };
14
+ const DEFAULT_DATA = [];
15
+ const DEFAULT_AXISFORMATTER = {};
16
+ const DEFAULT_KEYS = ['value'];
17
+
18
+ /**
19
+ * @experimental This component is experimental and may be subject to breaking changes in the future.
20
+ */
21
+ const BarChart = _ref => {
22
+ let {
23
+ height = '537px',
24
+ // to maintain aspect ratio based on our standard 1074px width,
25
+ margin = DEFAULT_MARGIN,
26
+ data = DEFAULT_DATA,
27
+ axisFormatters = DEFAULT_AXISFORMATTER,
28
+ tickValues,
29
+ keys = DEFAULT_KEYS,
30
+ tooltipFunction,
31
+ chartProps,
32
+ className,
33
+ 'data-testid': dataTestId
34
+ } = _ref;
35
+ const theme = useTheme();
36
+ const chartTheme = {
37
+ axis: {
38
+ ticks: {
39
+ line: {
40
+ stroke: theme.colors.neutral.backgroundStrong,
41
+ strokeWidth: 1
42
+ }
43
+ }
44
+ },
45
+ fontFamily: theme.typography.body.fontFamily,
46
+ fontSize: 12,
47
+ textColor: theme.colors.neutral.textWeak
48
+ };
49
+ const tooltip = useCallback(props => {
50
+ const {
51
+ indexValue,
52
+ formattedValue,
53
+ color
54
+ } = tooltipFunction ? tooltipFunction(props) : props;
55
+ return jsx(BarChartTooltip, {
56
+ formattedValue: formattedValue,
57
+ indexValue: indexValue.toString(),
58
+ color: color
59
+ });
60
+ }, [tooltipFunction]);
61
+ return jsx("div", {
62
+ style: {
63
+ height
64
+ },
65
+ className: className,
66
+ "data-testid": dataTestId,
67
+ children: jsx(ResponsiveBar, {
68
+ colors: getLegendColor(theme),
69
+ data: data,
70
+ margin: margin,
71
+ axisBottom: {
72
+ format: axisFormatters?.bottom,
73
+ tickPadding: 5,
74
+ tickRotation: 0,
75
+ tickSize: 5,
76
+ tickValues: tickValues?.bottom
77
+ },
78
+ axisLeft: {
79
+ format: axisFormatters?.left,
80
+ tickPadding: 5,
81
+ tickRotation: 0,
82
+ tickSize: 5,
83
+ tickValues: tickValues?.left
84
+ },
85
+ theme: chartTheme,
86
+ tooltip: tooltip,
87
+ keys: keys,
88
+ enableLabel: false,
89
+ ...chartProps
90
+ })
91
+ });
92
+ };
93
+
94
+ export { BarChart };
@@ -0,0 +1,223 @@
1
+ import _styled from '@emotion/styled/base';
2
+ import { useMemo } from 'react';
3
+ import { Tooltip } from '../Tooltip/index.js';
4
+ import { jsx } from '@emotion/react/jsx-runtime';
5
+
6
+ const StyledBarWrapper = /*#__PURE__*/_styled("div", {
7
+ target: "ezikjce2"
8
+ })("width:0px;transition:width 500ms;background-color:", _ref => {
9
+ let {
10
+ theme
11
+ } = _ref;
12
+ return theme.colors.neutral.backgroundWeak;
13
+ }, ";");
14
+ const StyledBar = /*#__PURE__*/_styled("div", {
15
+ target: "ezikjce1"
16
+ })("height:50px;font-weight:600;color:", _ref2 => {
17
+ let {
18
+ theme
19
+ } = _ref2;
20
+ return theme.colors.neutral.backgroundWeak;
21
+ }, ";font-size:14px;display:flex;align-items:center;padding:", _ref3 => {
22
+ let {
23
+ theme
24
+ } = _ref3;
25
+ return theme.space[1];
26
+ }, ";width:100%;white-space:nowrap;overflow:hidden;text-shadow:-1px 0 ", _ref4 => {
27
+ let {
28
+ theme
29
+ } = _ref4;
30
+ return theme.colors.neutral.backgroundStronger;
31
+ }, "B3,0 1px ", _ref5 => {
32
+ let {
33
+ theme
34
+ } = _ref5;
35
+ return theme.colors.neutral.backgroundStronger;
36
+ }, "B3,1px 0 ", _ref6 => {
37
+ let {
38
+ theme
39
+ } = _ref6;
40
+ return theme.colors.neutral.backgroundStronger;
41
+ }, "B3,0 -1px ", _ref7 => {
42
+ let {
43
+ theme
44
+ } = _ref7;
45
+ return theme.colors.neutral.backgroundStronger;
46
+ }, "B3;");
47
+ const StyledContainer = /*#__PURE__*/_styled("div", {
48
+ target: "ezikjce0"
49
+ })("width:100%;display:flex;background-color:", _ref8 => {
50
+ let {
51
+ theme
52
+ } = _ref8;
53
+ return theme.colors.neutral.backgroundWeak;
54
+ }, ";border-radius:", _ref9 => {
55
+ let {
56
+ theme
57
+ } = _ref9;
58
+ return theme.radii.default;
59
+ }, ";box-shadow:", _ref10 => {
60
+ let {
61
+ theme
62
+ } = _ref10;
63
+ return theme.shadows.defaultShadow;
64
+ }, ";overflow:hidden;", StyledBarWrapper, ":nth-child(5n+1){", _ref11 => {
65
+ let {
66
+ theme
67
+ } = _ref11;
68
+ return `background: linear-gradient(-45deg, ${theme.colors.neutral.backgroundWeak}1A 25%,
69
+ ${theme.colors.primary.backgroundStrong} 25%, ${theme.colors.primary.backgroundStrong} 50%,
70
+ ${theme.colors.neutral.backgroundWeak}1A 50%, ${theme.colors.neutral.backgroundWeak}1A 75%, ${theme.colors.primary.backgroundStrong}
71
+ 75%);`;
72
+ }, " background-size:30px 30px;background-color:", _ref12 => {
73
+ let {
74
+ theme
75
+ } = _ref12;
76
+ return theme.colors.primary.backgroundStrong;
77
+ }, ";}", StyledBarWrapper, ":nth-child(5n+2){background-color:", _ref13 => {
78
+ let {
79
+ theme
80
+ } = _ref13;
81
+ return theme.colors.primary.backgroundStrong;
82
+ }, "D9;background-image:linear-gradient(\n 135deg,\n ", _ref14 => {
83
+ let {
84
+ theme
85
+ } = _ref14;
86
+ return theme.colors.neutral.backgroundStrong;
87
+ }, "33 25%,\n transparent 25%\n ),linear-gradient(\n 225deg,\n ", _ref15 => {
88
+ let {
89
+ theme
90
+ } = _ref15;
91
+ return theme.colors.neutral.backgroundStrong;
92
+ }, "33 25%,\n transparent 25%\n ),linear-gradient(\n 45deg,\n ", _ref16 => {
93
+ let {
94
+ theme
95
+ } = _ref16;
96
+ return theme.colors.neutral.backgroundStrong;
97
+ }, "33 25%,\n transparent 25%\n ),linear-gradient(\n 315deg,\n ", _ref17 => {
98
+ let {
99
+ theme
100
+ } = _ref17;
101
+ return theme.colors.neutral.backgroundStrong;
102
+ }, "33 25%,\n ", _ref18 => {
103
+ let {
104
+ theme
105
+ } = _ref18;
106
+ return theme.colors.primary.backgroundStrong;
107
+ }, "12 25%\n );background-position:10px 0,10px 0,0 0,0 0;background-size:10px 10px;background-repeat:repeat;}", StyledBarWrapper, ":nth-child(5n+3){", _ref19 => {
108
+ let {
109
+ theme
110
+ } = _ref19;
111
+ return `background: linear-gradient(-45deg, ${theme.colors.neutral.backgroundWeak}1A 25%,
112
+ ${theme.colors.primary.backgroundStrong}4D 25%, ${theme.colors.primary.backgroundStrong}4D 50%,
113
+ ${theme.colors.neutral.backgroundWeak}1A 50%, ${theme.colors.neutral.backgroundWeak}1A 75%, ${theme.colors.primary.backgroundStrong}4D
114
+ 75%);`;
115
+ }, " background-size:30px 30px;background-color:", _ref20 => {
116
+ let {
117
+ theme
118
+ } = _ref20;
119
+ return theme.colors.secondary.backgroundStrong;
120
+ }, ";}", StyledBarWrapper, ":nth-child(5n+4){background-color:", _ref21 => {
121
+ let {
122
+ theme
123
+ } = _ref21;
124
+ return theme.colors.secondary.backgroundStrong;
125
+ }, ";background-image:linear-gradient(\n 135deg,\n ", _ref22 => {
126
+ let {
127
+ theme
128
+ } = _ref22;
129
+ return theme.colors.neutral.backgroundWeak;
130
+ }, "33 25%,\n transparent 25%\n ),linear-gradient(\n 225deg,\n ", _ref23 => {
131
+ let {
132
+ theme
133
+ } = _ref23;
134
+ return theme.colors.neutral.backgroundWeak;
135
+ }, "33 25%,\n transparent 25%\n ),linear-gradient(\n 45deg,\n ", _ref24 => {
136
+ let {
137
+ theme
138
+ } = _ref24;
139
+ return theme.colors.neutral.backgroundWeak;
140
+ }, "33 25%,\n transparent 25%\n ),linear-gradient(\n 315deg,\n ", _ref25 => {
141
+ let {
142
+ theme
143
+ } = _ref25;
144
+ return theme.colors.neutral.backgroundWeak;
145
+ }, "33 25%,\n ", _ref26 => {
146
+ let {
147
+ theme
148
+ } = _ref26;
149
+ return theme.colors.secondary.backgroundStrong;
150
+ }, " 25%\n );background-position:10px 0,10px 0,0 0,0 0;background-size:10px 10px;background-repeat:repeat;}", StyledBarWrapper, ":nth-child(5n+5){", _ref27 => {
151
+ let {
152
+ theme
153
+ } = _ref27;
154
+ return `background: linear-gradient(-45deg, ${theme.colors.neutral.backgroundWeak}40 25%,
155
+ ${theme.colors.secondary.backgroundStrong}40 25%, ${theme.colors.secondary.backgroundStrong}40 50%,
156
+ ${theme.colors.neutral.backgroundWeak}40 50%, ${theme.colors.neutral.backgroundWeak}40 75%, ${theme.colors.secondary.backgroundStrong}40
157
+ 75%);`;
158
+ }, " background-size:30px 30px;background-color:", _ref28 => {
159
+ let {
160
+ theme
161
+ } = _ref28;
162
+ return theme.colors.secondary.backgroundStrong;
163
+ }, "BF;}");
164
+ const BarStack = _ref29 => {
165
+ let {
166
+ data,
167
+ total,
168
+ className,
169
+ 'data-testid': dataTestId
170
+ } = _ref29;
171
+ const computedTotal = useMemo(() => total ?? data.reduce((acc, _ref30) => {
172
+ let {
173
+ value
174
+ } = _ref30;
175
+ return acc + value;
176
+ }, 0), [total, data]);
177
+ return jsx(StyledContainer, {
178
+ "data-testid": dataTestId,
179
+ className: className,
180
+ children: data.map(_ref31 => {
181
+ let {
182
+ id,
183
+ value,
184
+ text,
185
+ onClick,
186
+ onDoubleClick,
187
+ onMouseEnter,
188
+ onMouseLeave,
189
+ onMouseDown,
190
+ onMouseUp,
191
+ tooltip
192
+ } = _ref31;
193
+ return jsx(StyledBarWrapper, {
194
+ style: {
195
+ width: `${value / computedTotal * 100}%`
196
+ },
197
+ children: tooltip ? jsx(Tooltip, {
198
+ id: `tooltip-${id}`,
199
+ text: tooltip,
200
+ children: jsx(StyledBar, {
201
+ onMouseDown: onMouseDown,
202
+ onMouseUp: onMouseUp,
203
+ onClick: onClick,
204
+ onDoubleClick: onDoubleClick,
205
+ onMouseEnter: onMouseEnter,
206
+ onMouseLeave: onMouseLeave,
207
+ children: text
208
+ })
209
+ }) : jsx(StyledBar, {
210
+ onMouseDown: onMouseDown,
211
+ onMouseUp: onMouseUp,
212
+ onClick: onClick,
213
+ onDoubleClick: onDoubleClick,
214
+ onMouseEnter: onMouseEnter,
215
+ onMouseLeave: onMouseLeave,
216
+ children: text
217
+ })
218
+ }, id);
219
+ })
220
+ });
221
+ };
222
+
223
+ export { BarStack };
@@ -0,0 +1,89 @@
1
+ import _styled from '@emotion/styled/base';
2
+ import { Children, isValidElement, cloneElement } from 'react';
3
+ import { Link } from '../Link/index.js';
4
+ import { jsx } from '@emotion/react/jsx-runtime';
5
+
6
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
7
+ const contractString = str => {
8
+ if (typeof str === 'string' && str.length > 30) {
9
+ return `${str.slice(0, 15)}...${str.slice(-15)}`;
10
+ }
11
+ return str;
12
+ };
13
+ const StyledOl = /*#__PURE__*/_styled("ol", {
14
+ target: "ej0p0s41"
15
+ })(process.env.NODE_ENV === "production" ? {
16
+ name: "v28fi1",
17
+ styles: "list-style:none;margin:0;padding:0;display:flex"
18
+ } : {
19
+ name: "v28fi1",
20
+ styles: "list-style:none;margin:0;padding:0;display:flex",
21
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
22
+ });
23
+ const ItemContainer = /*#__PURE__*/_styled("li", {
24
+ target: "ej0p0s40"
25
+ })("display:inline;&[aria-current='page']{color:", _ref => {
26
+ let {
27
+ theme
28
+ } = _ref;
29
+ return theme.colors.neutral.textWeak;
30
+ }, ";}&:not(:last-child)::after{content:'\u203A';margin:0 8px;}", _ref2 => {
31
+ let {
32
+ onClick
33
+ } = _ref2;
34
+ return onClick ? `
35
+ cursor: pointer;
36
+ &[aria-disabled="true"] {
37
+ pointer-events: none;
38
+ }
39
+ ` : ``;
40
+ }, ";");
41
+ const Item = _ref3 => {
42
+ let {
43
+ to,
44
+ children,
45
+ disabled = false,
46
+ 'aria-current': ariaCurrent,
47
+ onClick,
48
+ step
49
+ } = _ref3;
50
+ return jsx(ItemContainer, {
51
+ "aria-disabled": disabled,
52
+ onClick: onClick ? event => onClick(event, step ?? -1) : undefined,
53
+ "aria-current": ariaCurrent,
54
+ children: to ? jsx(Link, {
55
+ sentiment: "primary",
56
+ href: to,
57
+ children: contractString(children)
58
+ }) : contractString(children)
59
+ });
60
+ };
61
+ const Breadcrumbs = _ref4 => {
62
+ let {
63
+ children,
64
+ selected: selectedProp,
65
+ className,
66
+ 'data-testid': dataTestId
67
+ } = _ref4;
68
+ const selected = selectedProp !== undefined ? selectedProp : Children.count(children) - 1;
69
+ return jsx("nav", {
70
+ "aria-label": "breadcrumb",
71
+ className: className,
72
+ "data-testid": dataTestId,
73
+ children: jsx(StyledOl, {
74
+ children: Children.map(children, (child, index) => {
75
+ if (! /*#__PURE__*/isValidElement(child)) {
76
+ return child;
77
+ }
78
+ const active = selected === index;
79
+ return /*#__PURE__*/cloneElement(child, {
80
+ 'aria-current': active ? 'page' : undefined,
81
+ step: index
82
+ });
83
+ })
84
+ })
85
+ });
86
+ };
87
+ Breadcrumbs.Item = Item;
88
+
89
+ export { Breadcrumbs, Item };
@@ -0,0 +1,137 @@
1
+ import _styled from '@emotion/styled/base';
2
+ import { Icon } from '../Icon/index.js';
3
+ import { Tooltip } from '../Tooltip/index.js';
4
+ import { jsx } from '@emotion/react/jsx-runtime';
5
+
6
+ const sentiments = {
7
+ danger: _ref => {
8
+ let {
9
+ theme
10
+ } = _ref;
11
+ return `
12
+ background-color: ${theme.colors.danger.background};
13
+ color: ${theme.colors.danger.text};
14
+ `;
15
+ },
16
+ neutral: _ref2 => {
17
+ let {
18
+ theme
19
+ } = _ref2;
20
+ return `
21
+ border: 1px solid ${theme.colors.neutral.borderWeak};
22
+ background-color: ${theme.colors.neutral.background};
23
+ color: ${theme.colors.neutral.text};
24
+ `;
25
+ },
26
+ disabled: _ref3 => {
27
+ let {
28
+ theme
29
+ } = _ref3;
30
+ return `
31
+ border: 1px solid ${theme.colors.neutral.borderWeak};
32
+ background-color: ${theme.colors.neutral.background};
33
+ color: ${theme.colors.neutral.textWeak};
34
+ `;
35
+ },
36
+ info: _ref4 => {
37
+ let {
38
+ theme
39
+ } = _ref4;
40
+ return `
41
+ background-color: ${theme.colors.info.background};
42
+ color: ${theme.colors.info.text};
43
+ `;
44
+ },
45
+ primary: _ref5 => {
46
+ let {
47
+ theme
48
+ } = _ref5;
49
+ return `
50
+ background-color: ${theme.colors.primary.background};
51
+ color: ${theme.colors.primary.text};
52
+ `;
53
+ },
54
+ success: _ref6 => {
55
+ let {
56
+ theme
57
+ } = _ref6;
58
+ return `
59
+ background-color: ${theme.colors.success.background};
60
+ color: ${theme.colors.success.text};
61
+ `;
62
+ },
63
+ warning: _ref7 => {
64
+ let {
65
+ theme
66
+ } = _ref7;
67
+ return `
68
+ background-color: ${theme.colors.warning.background};
69
+ color: ${theme.colors.warning.text};
70
+ `;
71
+ }
72
+ };
73
+ const sizes = {
74
+ medium: `
75
+ width: 32px;
76
+ height: 32px;
77
+ font-size: 16px;
78
+ `,
79
+ small: `
80
+ width: 24px;
81
+ height: 24px;
82
+ font-size: 14px;
83
+ `
84
+ };
85
+ const sentimentStyles = _ref8 => {
86
+ let {
87
+ sentiment
88
+ } = _ref8;
89
+ return sentiments[sentiment];
90
+ };
91
+ const sizeStyles = _ref9 => {
92
+ let {
93
+ size
94
+ } = _ref9;
95
+ return sizes[size];
96
+ };
97
+ const StyledContainer = /*#__PURE__*/_styled('div', {
98
+ target: "e11loam60"
99
+ })("display:inline-flex;border-radius:", _ref10 => {
100
+ let {
101
+ theme
102
+ } = _ref10;
103
+ return theme.radii.circle;
104
+ }, ";justify-content:center;align-items:center;font-weight:", _ref11 => {
105
+ let {
106
+ theme
107
+ } = _ref11;
108
+ return theme.typography.bodyStrong.weight;
109
+ }, ";", sentimentStyles, " ", sizeStyles, ";");
110
+ const Bullet = _ref12 => {
111
+ let {
112
+ className,
113
+ sentiment = 'neutral',
114
+ size = 'medium',
115
+ icon,
116
+ text,
117
+ tooltip,
118
+ tooltipBaseId,
119
+ 'data-testid': dataTestId
120
+ } = _ref12;
121
+ return jsx(Tooltip, {
122
+ id: tooltipBaseId,
123
+ text: tooltip,
124
+ children: jsx(StyledContainer, {
125
+ sentiment: sentiment,
126
+ size: size,
127
+ className: className,
128
+ "data-testid": dataTestId,
129
+ children: icon ? jsx(Icon, {
130
+ name: icon,
131
+ size: "50%"
132
+ }) : text
133
+ })
134
+ });
135
+ };
136
+
137
+ export { Bullet };