@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
package/README.md CHANGED
@@ -13,8 +13,14 @@ $ pnpm add @ultraviolet/ui @emotion/react @emotion/styled
13
13
  You will also need to import fonts in your project by adding:
14
14
 
15
15
  ```html
16
- <link href="https://fonts.cdnfonts.com/css/inter?styles=29139,29137,29140" rel="stylesheet">
17
- <link href="https://fonts.cdnfonts.com/css/jetbrains-mono-2?styles=156604" rel="stylesheet">
16
+ <link
17
+ href="https://fonts.cdnfonts.com/css/inter?styles=29139,29137,29140"
18
+ rel="stylesheet"
19
+ />
20
+ <link
21
+ href="https://fonts.cdnfonts.com/css/jetbrains-mono-2?styles=156604"
22
+ rel="stylesheet"
23
+ />
18
24
  ```
19
25
 
20
26
  ### Usage
@@ -25,10 +31,12 @@ import { Button, normalize, theme } from '@ultraviolet/ui'
25
31
 
26
32
  const App = () => (
27
33
  <ThemeProvider theme={theme}>
28
- <Global styles={css`${normalize()}`} />
29
- <Button onClick={() => console.log('clicked')}>
30
- Click Me
31
- </Button>
34
+ <Global
35
+ styles={css`
36
+ ${normalize()}
37
+ `}
38
+ />
39
+ <Button onClick={() => console.log('clicked')}>Click Me</Button>
32
40
  </ThemeProvider>
33
41
  )
34
42
  ```
@@ -64,7 +72,6 @@ declare module '@emotion/react' {
64
72
 
65
73
  Checkout our [documentation website](https://storybook.ultraviolet.scaleway.com/).
66
74
 
67
-
68
75
  ## Contributing
69
76
 
70
77
  📝 You can participate in the development and [start contributing](/CONTRIBUTING.md) to it.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import react__default, { ReactNode, ComponentProps, ButtonHTMLAttributes, AriaRole, MouseEventHandler, JSX, MouseEvent, InputHTMLAttributes, FocusEvent, HTMLAttributeAnchorTarget, AnchorHTMLAttributes, ReactElement, Ref, RefObject, KeyboardEventHandler, HTMLAttributes, CSSProperties, ChangeEventHandler, FocusEventHandler, ForwardRefExoticComponent, ForwardedRef, ElementType, TextareaHTMLAttributes } from 'react';
2
+ import react__default, { ReactNode, ComponentProps, ButtonHTMLAttributes, AriaRole, MouseEventHandler, JSX, MouseEvent, InputHTMLAttributes, FocusEvent, HTMLAttributeAnchorTarget, AnchorHTMLAttributes, ReactElement, Ref, RefObject, KeyboardEventHandler, HTMLAttributes, CSSProperties, ChangeEventHandler, FocusEventHandler, ForwardRefExoticComponent, ForwardedRef, ElementType, DOMAttributes, TextareaHTMLAttributes } from 'react';
3
3
  import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
4
4
  import * as _emotion_styled from '@emotion/styled';
5
5
  import * as _emotion_react from '@emotion/react';
@@ -2662,6 +2662,55 @@ type TextProps = {
2662
2662
  */
2663
2663
  declare const Text: ({ variant, children, as, color, sentiment, oneLine, placement, prominence, className, disabled, italic, underline, id, dir, htmlFor, "data-testid": dataTestId, }: TextProps) => _emotion_react_jsx_runtime.JSX.Element;
2664
2664
 
2665
+ type TextAreaProps = {
2666
+ id?: string;
2667
+ className?: string;
2668
+ tabIndex?: number;
2669
+ autoFocus?: boolean;
2670
+ label: string;
2671
+ value?: string;
2672
+ onChange: (newValue: string) => void;
2673
+ placeholder?: string;
2674
+ /**
2675
+ * Override others properties : readyOnly, success, error.
2676
+ */
2677
+ disabled?: boolean;
2678
+ /**
2679
+ * Override others properties : success, error.
2680
+ * Ignored if following props are provided : disabled.
2681
+ */
2682
+ readOnly?: boolean;
2683
+ /**
2684
+ * Override others properties : error, helper.
2685
+ * Ignored if following props are provided : disabled, readyOnly.
2686
+ */
2687
+ success?: string;
2688
+ /**
2689
+ * Override others properties : helper.
2690
+ * Ignored if following props are provided : disabled, readyOnly, success.
2691
+ */
2692
+ error?: string;
2693
+ /**
2694
+ * Ignored if following props are provided : readyOnly, success.
2695
+ */
2696
+ helper?: ReactNode;
2697
+ rows?: number;
2698
+ minLength?: number;
2699
+ maxLength?: number;
2700
+ tooltip?: string;
2701
+ required?: boolean;
2702
+ 'data-testid'?: string;
2703
+ name?: string;
2704
+ onFocus?: DOMAttributes<HTMLTextAreaElement>['onFocus'];
2705
+ onBlur?: DOMAttributes<HTMLTextAreaElement>['onBlur'];
2706
+ clearable?: boolean;
2707
+ labelDescription?: ReactNode;
2708
+ };
2709
+ /**
2710
+ * This component offers an extended textarea HTML
2711
+ */
2712
+ declare const TextArea: react.ForwardRefExoticComponent<TextAreaProps & react.RefAttributes<HTMLTextAreaElement>>;
2713
+
2665
2714
  declare const inputSizes: {
2666
2715
  medium: {
2667
2716
  default: string;
@@ -3011,4 +3060,4 @@ declare const down: (size: ScreenSize, rules: string) => string;
3011
3060
 
3012
3061
  declare const normalize: () => string;
3013
3062
 
3014
- export { ActionBar, Alert, Avatar, Badge, Banner, BarChart, BarStack, Breadcrumbs, Breakpoint, Bullet, Button, Card, Carousel, Checkbox, CheckboxGroup, CheckboxGroupCheckbox, CopyButton, DateInput, EmptyState, Expandable, GlobalAlert, LineChart, Link, List, Loader, Menu, MenuV2, Meter, Modal, Notice, NumberInput, Pagination, PasswordCheck, PasswordStrengthMeter, PieChart, Popover, Popup, ProgressBar, Radio, RadioGroup, Row, type SCWUITheme, SelectInput, SelectableCard, Separator, Skeleton, Snippet, Stack, Status, StepList, Stepper, SwitchButton, Table, Tabs, Tag, TagInput, TagList, Text, TextInput, TimeInput, ToastContainer, Toggle, ToggleGroup, Tooltip, type UltravioletUITheme, VerificationCode, bounce, down, extendTheme, fadeIn, fadeOut, flash, getUUID, normalize, ping, pulse, quickScaleDown, scaleBack, scaleDown, scaleForward, scaleUp, sketchIn, sketchOut, slideDownLarge, slideFromBottom, slideFromLeft, slideFromRight, slideFromTop, slideToBottom, slideToLeft, slideToRight, slideToTop, slideUpLarge, toast, unfoldIn, unfoldOut, up, zoomIn, zoomOut };
3063
+ export { ActionBar, Alert, Avatar, Badge, Banner, BarChart, BarStack, Breadcrumbs, Breakpoint, Bullet, Button, Card, Carousel, Checkbox, CheckboxGroup, CheckboxGroupCheckbox, CopyButton, DateInput, EmptyState, Expandable, GlobalAlert, LineChart, Link, List, Loader, Menu, MenuV2, Meter, Modal, Notice, NumberInput, Pagination, PasswordCheck, PasswordStrengthMeter, PieChart, Popover, Popup, ProgressBar, Radio, RadioGroup, Row, type SCWUITheme, SelectInput, SelectableCard, Separator, Skeleton, Snippet, Stack, Status, StepList, Stepper, SwitchButton, Table, Tabs, Tag, TagInput, TagList, Text, TextArea, TextInput, TimeInput, ToastContainer, Toggle, ToggleGroup, Tooltip, type UltravioletUITheme, VerificationCode, bounce, down, extendTheme, fadeIn, fadeOut, flash, getUUID, normalize, ping, pulse, quickScaleDown, scaleBack, scaleDown, scaleForward, scaleUp, sketchIn, sketchOut, slideDownLarge, slideFromBottom, slideFromLeft, slideFromRight, slideFromTop, slideToBottom, slideToLeft, slideToRight, slideToTop, slideUpLarge, toast, unfoldIn, unfoldOut, up, zoomIn, zoomOut };
@@ -7,27 +7,15 @@ const HEIGHT = 56;
7
7
  const SPACING = 20;
8
8
  const StyledDiv = /*#__PURE__*/_styled("div", {
9
9
  target: "enye6lh0"
10
- })("background:", _ref => {
11
- let {
12
- theme
13
- } = _ref;
14
- return theme.colors.neutral.backgroundWeakElevated;
15
- }, ";border-radius:", _ref2 => {
16
- let {
17
- theme
18
- } = _ref2;
19
- return theme.radii.default;
20
- }, ";bottom:", _ref3 => {
21
- let {
22
- rank
23
- } = _ref3;
24
- return SPACING + rank * (HEIGHT + SPACING);
25
- }, "px;box-shadow:", _ref4 => {
26
- let {
27
- theme
28
- } = _ref4;
29
- return theme.shadows.defaultShadow;
30
- }, ";height:", HEIGHT, "px;left:50%;position:fixed;transform:translate(-50%, 0);width:600px;animation:", fadeIn, " 0.2s ease-in-out;");
10
+ })("background:", ({
11
+ theme
12
+ }) => theme.colors.neutral.backgroundWeakElevated, ";border-radius:", ({
13
+ theme
14
+ }) => theme.radii.default, ";bottom:", ({
15
+ rank
16
+ }) => SPACING + rank * (HEIGHT + SPACING), "px;box-shadow:", ({
17
+ theme
18
+ }) => theme.shadows.defaultShadow, ";height:", HEIGHT, "px;left:50%;position:fixed;transform:translate(-50%, 0);width:600px;animation:", fadeIn, " 0.2s ease-in-out;");
31
19
  /**
32
20
  * The ActionBar is a floating bar that appears at the bottom of a page.
33
21
  * It can be used to display important actions or information to the user, and can be configured to display a variety of different content types.
@@ -35,21 +23,18 @@ const StyledDiv = /*#__PURE__*/_styled("div", {
35
23
  * **Note:** ActionBar is added into a portal at the end of the body element. This means that it will always be on top of other elements without `z-index`,
36
24
  * and will not be affected by the layout of the page it is on.
37
25
  */
38
- const ActionBar = _ref5 => {
39
- let {
40
- children,
41
- role = 'dialog',
42
- rank = 0,
43
- className,
44
- 'data-testid': dataTestId
45
- } = _ref5;
46
- return /*#__PURE__*/createPortal(jsx(StyledDiv, {
47
- rank: rank,
48
- role: role,
49
- className: className,
50
- "data-testid": dataTestId,
51
- children: children
52
- }), document.body);
53
- };
26
+ const ActionBar = ({
27
+ children,
28
+ role = 'dialog',
29
+ rank = 0,
30
+ className,
31
+ 'data-testid': dataTestId
32
+ }) => /*#__PURE__*/createPortal(jsx(StyledDiv, {
33
+ rank: rank,
34
+ role: role,
35
+ className: className,
36
+ "data-testid": dataTestId,
37
+ children: children
38
+ }), document.body);
54
39
 
55
40
  export { ActionBar };
@@ -8,11 +8,10 @@ import { Text } from '../Text/index.js';
8
8
  import { jsxs, jsx } from '@emotion/react/jsx-runtime';
9
9
 
10
10
  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)."; }
11
- const alertStyles = _ref => {
12
- let {
13
- theme,
14
- sentiment
15
- } = _ref;
11
+ const alertStyles = ({
12
+ theme,
13
+ sentiment
14
+ }) => {
16
15
  const sentimentColor = theme.colors[sentiment];
17
16
  return /*#__PURE__*/css("background-color:", sentimentColor.background, ";color:", sentimentColor.text, ";border-left:4px solid ", sentimentColor.border, ";");
18
17
  };
@@ -25,25 +24,16 @@ const typesDefaultIcons = {
25
24
  const StyledStackContainer = /*#__PURE__*/_styled(Stack, {
26
25
  shouldForwardProp: prop => !['sentiment'].includes(prop),
27
26
  target: "e17p0ih04"
28
- })("border-radius:", _ref2 => {
29
- let {
30
- theme
31
- } = _ref2;
32
- return theme.radii.default;
33
- }, ";padding:", _ref3 => {
34
- let {
35
- theme
36
- } = _ref3;
37
- return theme.space['2'];
38
- }, ";", alertStyles, ";");
27
+ })("border-radius:", ({
28
+ theme
29
+ }) => theme.radii.default, ";padding:", ({
30
+ theme
31
+ }) => theme.space['2'], ";", alertStyles, ";");
39
32
  const TextStack = /*#__PURE__*/_styled(Stack, {
40
33
  target: "e17p0ih03"
41
- })("color:", _ref4 => {
42
- let {
43
- theme
44
- } = _ref4;
45
- return theme.colors.neutral.text;
46
- }, ";flex-wrap:wrap;");
34
+ })("color:", ({
35
+ theme
36
+ }) => theme.colors.neutral.text, ";flex-wrap:wrap;");
47
37
  const WrapStack = /*#__PURE__*/_styled(Stack, {
48
38
  target: "e17p0ih02"
49
39
  })(process.env.NODE_ENV === "production" ? {
@@ -56,12 +46,9 @@ const WrapStack = /*#__PURE__*/_styled(Stack, {
56
46
  });
57
47
  const StyledButton = /*#__PURE__*/_styled(Button, {
58
48
  target: "e17p0ih01"
59
- })("margin-left:", _ref5 => {
60
- let {
61
- theme
62
- } = _ref5;
63
- return theme.space['5'];
64
- }, ";");
49
+ })("margin-left:", ({
50
+ theme
51
+ }) => theme.space['5'], ";");
65
52
  const CloseButton = /*#__PURE__*/_styled(Button, {
66
53
  target: "e17p0ih00"
67
54
  })(process.env.NODE_ENV === "production" ? {
@@ -75,19 +62,18 @@ const CloseButton = /*#__PURE__*/_styled(Button, {
75
62
  /**
76
63
  * Alert component is used to display a short, important message in a way that attracts the user's attention without interrupting the user's task.
77
64
  */
78
- const Alert = _ref6 => {
79
- let {
80
- children,
81
- title,
82
- sentiment = 'danger',
83
- buttonText,
84
- onClickButton,
85
- closable,
86
- onClose,
87
- className,
88
- disabled,
89
- 'data-testid': dataTestId
90
- } = _ref6;
65
+ const Alert = ({
66
+ children,
67
+ title,
68
+ sentiment = 'danger',
69
+ buttonText,
70
+ onClickButton,
71
+ closable,
72
+ onClose,
73
+ className,
74
+ disabled,
75
+ 'data-testid': dataTestId
76
+ }) => {
91
77
  const [opened, setOpened] = useState(true);
92
78
  if (!opened) return null;
93
79
  return jsxs(StyledStackContainer, {
@@ -15,80 +15,59 @@ const formatTextToAvatar = text => {
15
15
  };
16
16
  const StyledTextAvatar = /*#__PURE__*/_styled("span", {
17
17
  target: "ec0473m1"
18
- })("align-items:center;background-color:", _ref => {
19
- let {
20
- lock,
21
- theme,
22
- textBgColor
23
- } = _ref;
24
- return lock ? theme.colors.neutral.backgroundStrong : theme.colors[textBgColor]?.backgroundStrong || textBgColor;
25
- }, ";border-radius:", _ref2 => {
26
- let {
27
- theme
28
- } = _ref2;
29
- return theme.radii.circle;
30
- }, ";color:", _ref3 => {
31
- let {
32
- theme,
33
- textColor
34
- } = _ref3;
35
- return theme.colors[textColor]?.textStronger || theme.colors[textColor]?.textStrong || textColor;
36
- }, ";font-size:", _ref4 => {
37
- let {
38
- textSize
39
- } = _ref4;
40
- return textSize;
41
- }, "px;display:flex;height:100%;justify-content:center;width:100%;");
18
+ })("align-items:center;background-color:", ({
19
+ lock,
20
+ theme,
21
+ textBgColor
22
+ }) => lock ? theme.colors.neutral.backgroundStrong : theme.colors[textBgColor]?.backgroundStrong || textBgColor, ";border-radius:", ({
23
+ theme
24
+ }) => theme.radii.circle, ";color:", ({
25
+ theme,
26
+ textColor
27
+ }) => theme.colors[textColor]?.textStronger || theme.colors[textColor]?.textStrong || textColor, ";font-size:", ({
28
+ textSize
29
+ }) => textSize, "px;display:flex;height:100%;justify-content:center;width:100%;");
42
30
  const AvatarContainer = /*#__PURE__*/_styled("div", {
43
31
  target: "ec0473m0"
44
- })("height:", _ref5 => {
45
- let {
46
- size
47
- } = _ref5;
48
- return size;
49
- }, "px;width:", _ref6 => {
50
- let {
51
- size
52
- } = _ref6;
53
- return size;
54
- }, "px;");
32
+ })("height:", ({
33
+ size
34
+ }) => size, "px;width:", ({
35
+ size
36
+ }) => size, "px;");
55
37
 
56
38
  /**
57
39
  * Avatar component is used to display a user's profile picture or initials.
58
40
  */
59
- const Avatar = _ref7 => {
60
- let {
61
- image,
62
- size = 32,
63
- text,
64
- textBgColor = 'secondary',
65
- textColor = 'neutral',
66
- textSize = 10,
67
- lock = false,
68
- className,
69
- 'data-testid': dataTestId
70
- } = _ref7;
71
- return jsx(AvatarContainer, {
72
- size: size,
73
- className: className,
74
- "data-testid": dataTestId,
75
- children: text || !text && !image ? jsx(StyledTextAvatar, {
76
- lock: lock,
77
- textBgColor: textBgColor,
78
- textColor: textColor,
79
- textSize: textSize,
80
- children: lock ? jsx(Icon, {
81
- name: "lock",
82
- color: "neutral",
83
- prominence: "weak"
84
- }) : formatTextToAvatar(text)
85
- }) : jsx("img", {
86
- width: "100%",
87
- height: "100%",
88
- src: image ?? '',
89
- alt: ""
90
- })
91
- });
92
- };
41
+ const Avatar = ({
42
+ image,
43
+ size = 32,
44
+ text,
45
+ textBgColor = 'secondary',
46
+ textColor = 'neutral',
47
+ textSize = 10,
48
+ lock = false,
49
+ className,
50
+ 'data-testid': dataTestId
51
+ }) => jsx(AvatarContainer, {
52
+ size: size,
53
+ className: className,
54
+ "data-testid": dataTestId,
55
+ children: text || !text && !image ? jsx(StyledTextAvatar, {
56
+ lock: lock,
57
+ textBgColor: textBgColor,
58
+ textColor: textColor,
59
+ textSize: textSize,
60
+ children: lock ? jsx(Icon, {
61
+ name: "lock",
62
+ color: "neutral",
63
+ prominence: "weak"
64
+ }) : formatTextToAvatar(text)
65
+ }) : jsx("img", {
66
+ width: "100%",
67
+ height: "100%",
68
+ src: image ?? '',
69
+ alt: ""
70
+ })
71
+ });
93
72
 
94
73
  export { Avatar };
@@ -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();