@ultraviolet/ui 1.28.0 → 1.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +14 -7
  2. package/dist/index.d.ts +61 -12
  3. package/dist/react-datepicker/dist/react-datepicker.min.css.js +1 -1
  4. package/dist/src/components/ActionBar/index.js +22 -37
  5. package/dist/src/components/Alert/index.js +27 -41
  6. package/dist/src/components/Avatar/index.js +48 -69
  7. package/dist/src/components/Badge/index.js +29 -49
  8. package/dist/src/components/Banner/index.js +42 -62
  9. package/dist/src/components/BarChart/Tooltip.js +35 -50
  10. package/dist/src/components/BarChart/index.js +13 -14
  11. package/dist/src/components/BarStack/index.js +100 -191
  12. package/dist/src/components/Breadcrumbs/index.js +29 -39
  13. package/dist/src/components/Bullet/index.js +42 -55
  14. package/dist/src/components/Button/index.js +73 -99
  15. package/dist/src/components/Card/index.js +39 -57
  16. package/dist/src/components/Carousel/index.js +32 -60
  17. package/dist/src/components/Checkbox/index.js +153 -341
  18. package/dist/src/components/CheckboxGroup/index.js +25 -27
  19. package/dist/src/components/CopyButton/index.js +11 -12
  20. package/dist/src/components/DateInput/index.js +141 -268
  21. package/dist/src/components/EmptyState/index.js +68 -83
  22. package/dist/src/components/Expandable/index.js +13 -20
  23. package/dist/src/components/GlobalAlert/GlobalAlertLink.js +12 -13
  24. package/dist/src/components/GlobalAlert/index.js +19 -32
  25. package/dist/src/components/LineChart/CustomLegend.js +80 -89
  26. package/dist/src/components/LineChart/Tooltip.js +32 -47
  27. package/dist/src/components/LineChart/helpers.js +15 -50
  28. package/dist/src/components/LineChart/index.js +23 -33
  29. package/dist/src/components/Link/index.js +46 -65
  30. package/dist/src/components/List/Body.js +9 -15
  31. package/dist/src/components/List/Cell.js +6 -7
  32. package/dist/src/components/List/HeaderCell.js +28 -56
  33. package/dist/src/components/List/HeaderRow.js +9 -16
  34. package/dist/src/components/List/ListContext.js +5 -6
  35. package/dist/src/components/List/Row.js +44 -90
  36. package/dist/src/components/List/SelectBar.js +9 -13
  37. package/dist/src/components/List/SkeletonRows.js +5 -6
  38. package/dist/src/components/List/index.js +15 -25
  39. package/dist/src/components/Loader/index.js +18 -25
  40. package/dist/src/components/Menu/Item.js +39 -49
  41. package/dist/src/components/Menu/index.js +31 -56
  42. package/dist/src/components/MenuV2/Item.js +39 -49
  43. package/dist/src/components/MenuV2/index.js +28 -47
  44. package/dist/src/components/Meter/index.js +25 -47
  45. package/dist/src/components/Modal/Dialog.js +33 -58
  46. package/dist/src/components/Modal/Disclosure.js +8 -9
  47. package/dist/src/components/Modal/index.js +26 -33
  48. package/dist/src/components/Notice/index.js +21 -27
  49. package/dist/src/components/NumberInput/index.js +73 -137
  50. package/dist/src/components/Pagination/getPageNumbers.js +1 -4
  51. package/dist/src/components/Pagination/index.js +17 -27
  52. package/dist/src/components/PasswordCheck/index.js +26 -32
  53. package/dist/src/components/PasswordStrengthMeter/index.js +25 -44
  54. package/dist/src/components/PieChart/Legends.js +71 -107
  55. package/dist/src/components/PieChart/Tooltip.js +33 -36
  56. package/dist/src/components/PieChart/index.js +13 -17
  57. package/dist/src/components/Popover/index.js +58 -75
  58. package/dist/src/components/Popup/helpers.js +13 -15
  59. package/dist/src/components/Popup/index.js +55 -98
  60. package/dist/src/components/ProgressBar/index.js +31 -49
  61. package/dist/src/components/Radio/index.js +58 -113
  62. package/dist/src/components/RadioGroup/index.js +26 -28
  63. package/dist/src/components/Row/index.js +25 -31
  64. package/dist/src/components/SelectInput/index.js +357 -410
  65. package/dist/src/components/SelectableCard/index.js +60 -111
  66. package/dist/src/components/Separator/index.js +52 -73
  67. package/dist/src/components/Skeleton/Block.js +23 -41
  68. package/dist/src/components/Skeleton/Blocks.js +23 -41
  69. package/dist/src/components/Skeleton/BoxWithIcon.js +21 -36
  70. package/dist/src/components/Skeleton/Donut.js +3 -6
  71. package/dist/src/components/Skeleton/IconSkeleton.js +13 -31
  72. package/dist/src/components/Skeleton/Line.js +5 -11
  73. package/dist/src/components/Skeleton/List.js +22 -31
  74. package/dist/src/components/Skeleton/Slider.js +25 -46
  75. package/dist/src/components/Skeleton/Square.js +3 -6
  76. package/dist/src/components/Skeleton/index.js +17 -33
  77. package/dist/src/components/Snippet/index.js +82 -137
  78. package/dist/src/components/Stack/index.js +11 -14
  79. package/dist/src/components/Status/index.js +48 -78
  80. package/dist/src/components/StepList/index.js +45 -63
  81. package/dist/src/components/Stepper/index.js +74 -129
  82. package/dist/src/components/SwitchButton/FocusOverlay.js +13 -23
  83. package/dist/src/components/SwitchButton/index.js +36 -62
  84. package/dist/src/components/Table/Body.js +5 -8
  85. package/dist/src/components/Table/Cell.js +14 -20
  86. package/dist/src/components/Table/Header.js +8 -14
  87. package/dist/src/components/Table/HeaderCell.js +40 -56
  88. package/dist/src/components/Table/HeaderRow.js +4 -5
  89. package/dist/src/components/Table/Row.js +10 -14
  90. package/dist/src/components/Table/SelectBar.js +9 -13
  91. package/dist/src/components/Table/SkeletonRows.js +5 -6
  92. package/dist/src/components/Table/TableContext.js +6 -7
  93. package/dist/src/components/Table/index.js +44 -50
  94. package/dist/src/components/Tabs/Tab.js +57 -118
  95. package/dist/src/components/Tabs/TabMenu.js +32 -38
  96. package/dist/src/components/Tabs/TabMenuItem.js +9 -13
  97. package/dist/src/components/Tabs/index.js +24 -43
  98. package/dist/src/components/Tag/index.js +57 -74
  99. package/dist/src/components/TagInput/index.js +63 -94
  100. package/dist/src/components/TagList/index.js +22 -35
  101. package/dist/src/components/Text/index.js +29 -31
  102. package/dist/src/components/TextArea/index.js +240 -0
  103. package/dist/src/components/TextInput/index.js +166 -260
  104. package/dist/src/components/TimeInput/index.js +10 -13
  105. package/dist/src/components/Toaster/index.js +51 -67
  106. package/dist/src/components/Toggle/index.js +62 -129
  107. package/dist/src/components/ToggleGroup/index.js +21 -23
  108. package/dist/src/components/Tooltip/index.js +28 -31
  109. package/dist/src/components/VerificationCode/index.js +55 -90
  110. package/dist/src/index.js +1 -0
  111. package/dist/src/utils/ids.js +1 -6
  112. package/package.json +6 -6
@@ -26,11 +26,10 @@ const PROMINENCES = {
26
26
  /**
27
27
  * Generate all styles available for badge based on prominence and sentiments
28
28
  */
29
- const generateStyles = _ref => {
30
- let {
31
- prominence,
32
- theme
33
- } = _ref;
29
+ const generateStyles = ({
30
+ prominence,
31
+ theme
32
+ }) => {
34
33
  const definedProminence = prominence === PROMINENCES.strong ? capitalize(PROMINENCES.strong) : '';
35
34
  const text = `text${definedProminence}`;
36
35
  const background = `background${definedProminence}`;
@@ -58,53 +57,34 @@ const generateStyles = _ref => {
58
57
  const StyledSpan = /*#__PURE__*/_styled(Text, {
59
58
  shouldForwardProp: prop => !['sentimentStyles', 'size', 'fontSize'].includes(prop),
60
59
  target: "ej33bna0"
61
- })("display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;border-radius:", _ref2 => {
62
- let {
63
- theme
64
- } = _ref2;
65
- return theme.radii.xlarge;
66
- }, ";padding:0 ", _ref3 => {
67
- let {
68
- theme,
69
- size
70
- } = _ref3;
71
- return size === SIZES.small ? theme.space['1'] : theme.space['2'];
72
- }, ";gap:", _ref4 => {
73
- let {
74
- theme,
75
- size
76
- } = _ref4;
77
- return size === SIZES.small ? theme.space['0.5'] : theme.space['1'];
78
- }, ";width:fit-content;height:", _ref5 => {
79
- let {
80
- size
81
- } = _ref5;
82
- return size;
83
- }, "px;text-transform:uppercase;font-size:", _ref6 => {
84
- let {
85
- fontSize
86
- } = _ref6;
87
- return fontSize;
88
- }, "px;color:inherit;", _ref7 => {
89
- let {
90
- sentimentStyles
91
- } = _ref7;
92
- return sentimentStyles;
93
- }, ";");
60
+ })("display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;border-radius:", ({
61
+ theme
62
+ }) => theme.radii.xlarge, ";padding:0 ", ({
63
+ theme,
64
+ size
65
+ }) => size === SIZES.small ? theme.space['1'] : theme.space['2'], ";gap:", ({
66
+ theme,
67
+ size
68
+ }) => size === SIZES.small ? theme.space['0.5'] : theme.space['1'], ";width:fit-content;height:", ({
69
+ size
70
+ }) => size, "px;text-transform:uppercase;font-size:", ({
71
+ fontSize
72
+ }) => fontSize, "px;color:inherit;", ({
73
+ sentimentStyles
74
+ }) => sentimentStyles, ";");
94
75
  /**
95
76
  * Badge component is used to display a status or a label in a small container.
96
77
  */
97
- const Badge = _ref8 => {
98
- let {
99
- sentiment = 'neutral',
100
- size = 'medium',
101
- prominence = 'default',
102
- icon,
103
- disabled = false,
104
- className,
105
- children,
106
- 'data-testid': dataTestId
107
- } = _ref8;
78
+ const Badge = ({
79
+ sentiment = 'neutral',
80
+ size = 'medium',
81
+ prominence = 'default',
82
+ icon,
83
+ disabled = false,
84
+ className,
85
+ children,
86
+ 'data-testid': dataTestId
87
+ }) => {
108
88
  const theme = useTheme();
109
89
 
110
90
  /**
@@ -9,12 +9,11 @@ import defaultIllustrationSmall from './assets/default-image-small.svg.js';
9
9
  import defaultIllustration from './assets/default-image.svg.js';
10
10
  import { jsxs, jsx } from '@emotion/react/jsx-runtime';
11
11
 
12
- const styles = _ref => {
13
- let {
14
- theme,
15
- variant,
16
- size
17
- } = _ref;
12
+ const styles = ({
13
+ theme,
14
+ variant,
15
+ size
16
+ }) => {
18
17
  if (size === 'small') {
19
18
  if (variant === 'intro') {
20
19
  return /*#__PURE__*/css("background:", theme.colors.primary.background, ";background-position:left,right;background-repeat:no-repeat,no-repeat;background-size:contain,contain;");
@@ -36,68 +35,49 @@ const styles = _ref => {
36
35
  const Container = /*#__PURE__*/_styled('div', {
37
36
  shouldForwardProp: prop => !['variant', 'size', 'padding'].includes(prop),
38
37
  target: "e1kdwp5x1"
39
- })("padding:", _ref2 => {
40
- let {
41
- theme,
42
- size
43
- } = _ref2;
44
- return theme.space[size === 'small' ? '2' : '3'];
45
- }, ";border-radius:", _ref3 => {
46
- let {
47
- theme
48
- } = _ref3;
49
- return theme.radii.large;
50
- }, ";display:flex;flex-direction:row;justify-content:space-between;gap:", _ref4 => {
51
- let {
52
- theme
53
- } = _ref4;
54
- return theme.space['2'];
55
- }, ";", _ref5 => {
56
- let {
57
- theme,
58
- variant,
59
- size
60
- } = _ref5;
61
- return styles({
62
- theme,
63
- variant,
64
- size
65
- });
66
- }, ";>svg:first-child,>img{height:", _ref6 => {
67
- let {
68
- size
69
- } = _ref6;
70
- return size === 'medium' ? '140px' : '100px';
71
- }, ";align-self:center;}button[name='close']{background:none;&:hover{background:none;}}");
38
+ })("padding:", ({
39
+ theme,
40
+ size
41
+ }) => theme.space[size === 'small' ? '2' : '3'], ";border-radius:", ({
42
+ theme
43
+ }) => theme.radii.large, ";display:flex;flex-direction:row;justify-content:space-between;gap:", ({
44
+ theme
45
+ }) => theme.space['2'], ";", ({
46
+ theme,
47
+ variant,
48
+ size
49
+ }) => styles({
50
+ theme,
51
+ variant,
52
+ size
53
+ }), ";>svg:first-child,>img{height:", ({
54
+ size
55
+ }) => size === 'medium' ? '140px' : '100px', ";align-self:center;}button[name='close']{background:none;&:hover{background:none;}}");
72
56
  const ImageStack = /*#__PURE__*/_styled(Stack, {
73
57
  shouldForwardProp: prop => !['size'].includes(prop),
74
58
  target: "e1kdwp5x0"
75
- })("width:", _ref7 => {
76
- let {
77
- size
78
- } = _ref7;
79
- return size === 'medium' ? '140px' : '74px';
80
- }, ";");
59
+ })("width:", ({
60
+ size
61
+ }) => size === 'medium' ? '140px' : '74px', ";");
81
62
  /**
82
63
  * Banner component is used to display an informative message to the user with style.
83
64
  */
84
- const Banner = _ref8 => {
85
- let {
86
- variant = 'intro',
87
- size = 'medium',
88
- title,
89
- children,
90
- direction = 'column',
91
- onClose,
92
- buttonText,
93
- onClickButton,
94
- linkText,
95
- linkHref,
96
- image,
97
- className,
98
- closable = true,
99
- 'data-testid': dataTestId
100
- } = _ref8;
65
+ const Banner = ({
66
+ variant = 'intro',
67
+ size = 'medium',
68
+ title,
69
+ children,
70
+ direction = 'column',
71
+ onClose,
72
+ buttonText,
73
+ onClickButton,
74
+ linkText,
75
+ linkHref,
76
+ image,
77
+ className,
78
+ closable = true,
79
+ 'data-testid': dataTestId
80
+ }) => {
101
81
  const {
102
82
  theme
103
83
  } = useTheme();
@@ -4,60 +4,45 @@ import { jsxs, jsx } from '@emotion/react/jsx-runtime';
4
4
 
5
5
  const BarToolTipContainer = /*#__PURE__*/_styled("div", {
6
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;");
7
+ })("display:flex;background:", ({
8
+ theme
9
+ }) => theme.colors.neutral.backgroundWeakElevated, ";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 BarColorSquare = /*#__PURE__*/_styled('span', {
24
15
  shouldForwardProp: prop => !['color'].includes(prop),
25
16
  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
- sentiment: "primary",
52
- children: formattedValue
53
- }), jsx(Text, {
54
- variant: "bodySmall",
55
- as: "p",
56
- children: indexValue
57
- })]
17
+ })("display:block;width:12px;height:12px;background:", ({
18
+ color
19
+ }) => color, ";margin-right:12px;");
20
+ const BarChartToolTip = ({
21
+ formattedValue,
22
+ indexValue,
23
+ color,
24
+ className,
25
+ 'data-testid': dataTestId
26
+ }) => jsxs(BarToolTipContainer, {
27
+ className: className,
28
+ "data-testid": dataTestId,
29
+ children: [jsx("div", {
30
+ children: jsx(BarColorSquare, {
31
+ color: color
32
+ })
33
+ }), jsxs("div", {
34
+ children: [jsx(Text, {
35
+ variant: "bodyStronger",
36
+ as: "p",
37
+ sentiment: "primary",
38
+ children: formattedValue
39
+ }), jsx(Text, {
40
+ variant: "bodySmall",
41
+ as: "p",
42
+ children: indexValue
58
43
  })]
59
- });
60
- };
44
+ })]
45
+ });
61
46
  var BarChartTooltip = BarChartToolTip;
62
47
 
63
48
  export { BarChartTooltip as default };
@@ -20,20 +20,19 @@ const DEFAULT_KEYS = ['value'];
20
20
  * See https://nivo.rocks/bar/ for more information.
21
21
  * @experimental This component is experimental and may be subject to breaking changes in the future.
22
22
  */
23
- const BarChart = _ref => {
24
- let {
25
- height = '537px',
26
- // to maintain aspect ratio based on our standard 1074px width,
27
- margin = DEFAULT_MARGIN,
28
- data = DEFAULT_DATA,
29
- axisFormatters = DEFAULT_AXISFORMATTER,
30
- tickValues,
31
- keys = DEFAULT_KEYS,
32
- tooltipFunction,
33
- chartProps,
34
- className,
35
- 'data-testid': dataTestId
36
- } = _ref;
23
+ const BarChart = ({
24
+ height = '537px',
25
+ // to maintain aspect ratio based on our standard 1074px width,
26
+ margin = DEFAULT_MARGIN,
27
+ data = DEFAULT_DATA,
28
+ axisFormatters = DEFAULT_AXISFORMATTER,
29
+ tickValues,
30
+ keys = DEFAULT_KEYS,
31
+ tooltipFunction,
32
+ chartProps,
33
+ className,
34
+ 'data-testid': dataTestId
35
+ }) => {
37
36
  const theme = useTheme();
38
37
  const chartTheme = {
39
38
  axis: {