@ultraviolet/ui 1.28.0 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -7
- package/dist/index.d.ts +51 -2
- package/dist/src/components/ActionBar/index.js +22 -37
- package/dist/src/components/Alert/index.js +27 -41
- package/dist/src/components/Avatar/index.js +48 -69
- package/dist/src/components/Badge/index.js +29 -49
- package/dist/src/components/Banner/index.js +42 -62
- package/dist/src/components/BarChart/Tooltip.js +35 -50
- package/dist/src/components/BarChart/index.js +13 -14
- package/dist/src/components/BarStack/index.js +100 -191
- package/dist/src/components/Breadcrumbs/index.js +29 -39
- package/dist/src/components/Bullet/index.js +42 -55
- package/dist/src/components/Button/index.js +73 -99
- package/dist/src/components/Card/index.js +39 -57
- package/dist/src/components/Carousel/index.js +32 -60
- package/dist/src/components/Checkbox/index.js +153 -341
- package/dist/src/components/CheckboxGroup/index.js +25 -27
- package/dist/src/components/CopyButton/index.js +11 -12
- package/dist/src/components/DateInput/index.js +141 -268
- package/dist/src/components/EmptyState/index.js +68 -83
- package/dist/src/components/Expandable/index.js +13 -20
- package/dist/src/components/GlobalAlert/GlobalAlertLink.js +12 -13
- package/dist/src/components/GlobalAlert/index.js +19 -32
- package/dist/src/components/LineChart/CustomLegend.js +80 -89
- package/dist/src/components/LineChart/Tooltip.js +32 -47
- package/dist/src/components/LineChart/helpers.js +15 -50
- package/dist/src/components/LineChart/index.js +23 -33
- package/dist/src/components/Link/index.js +46 -65
- package/dist/src/components/List/Body.js +9 -15
- package/dist/src/components/List/Cell.js +6 -7
- package/dist/src/components/List/HeaderCell.js +28 -56
- package/dist/src/components/List/HeaderRow.js +9 -16
- package/dist/src/components/List/ListContext.js +5 -6
- package/dist/src/components/List/Row.js +44 -90
- package/dist/src/components/List/SelectBar.js +9 -13
- package/dist/src/components/List/SkeletonRows.js +5 -6
- package/dist/src/components/List/index.js +15 -25
- package/dist/src/components/Loader/index.js +18 -25
- package/dist/src/components/Menu/Item.js +39 -49
- package/dist/src/components/Menu/index.js +31 -56
- package/dist/src/components/MenuV2/Item.js +39 -49
- package/dist/src/components/MenuV2/index.js +28 -47
- package/dist/src/components/Meter/index.js +25 -47
- package/dist/src/components/Modal/Dialog.js +33 -58
- package/dist/src/components/Modal/Disclosure.js +8 -9
- package/dist/src/components/Modal/index.js +26 -33
- package/dist/src/components/Notice/index.js +21 -27
- package/dist/src/components/NumberInput/index.js +73 -137
- package/dist/src/components/Pagination/getPageNumbers.js +1 -4
- package/dist/src/components/Pagination/index.js +17 -27
- package/dist/src/components/PasswordCheck/index.js +26 -32
- package/dist/src/components/PasswordStrengthMeter/index.js +25 -44
- package/dist/src/components/PieChart/Legends.js +71 -107
- package/dist/src/components/PieChart/Tooltip.js +33 -36
- package/dist/src/components/PieChart/index.js +13 -17
- package/dist/src/components/Popover/index.js +58 -75
- package/dist/src/components/Popup/helpers.js +13 -15
- package/dist/src/components/Popup/index.js +55 -98
- package/dist/src/components/ProgressBar/index.js +31 -49
- package/dist/src/components/Radio/index.js +58 -113
- package/dist/src/components/RadioGroup/index.js +26 -28
- package/dist/src/components/Row/index.js +25 -31
- package/dist/src/components/SelectInput/index.js +357 -410
- package/dist/src/components/SelectableCard/index.js +73 -115
- package/dist/src/components/Separator/index.js +52 -73
- package/dist/src/components/Skeleton/Block.js +23 -41
- package/dist/src/components/Skeleton/Blocks.js +23 -41
- package/dist/src/components/Skeleton/BoxWithIcon.js +21 -36
- package/dist/src/components/Skeleton/Donut.js +3 -6
- package/dist/src/components/Skeleton/IconSkeleton.js +13 -31
- package/dist/src/components/Skeleton/Line.js +5 -11
- package/dist/src/components/Skeleton/List.js +22 -31
- package/dist/src/components/Skeleton/Slider.js +25 -46
- package/dist/src/components/Skeleton/Square.js +3 -6
- package/dist/src/components/Skeleton/index.js +17 -33
- package/dist/src/components/Snippet/index.js +82 -137
- package/dist/src/components/Stack/index.js +11 -14
- package/dist/src/components/Status/index.js +48 -78
- package/dist/src/components/StepList/index.js +45 -63
- package/dist/src/components/Stepper/index.js +74 -129
- package/dist/src/components/SwitchButton/FocusOverlay.js +13 -23
- package/dist/src/components/SwitchButton/index.js +36 -62
- package/dist/src/components/Table/Body.js +5 -8
- package/dist/src/components/Table/Cell.js +14 -20
- package/dist/src/components/Table/Header.js +8 -14
- package/dist/src/components/Table/HeaderCell.js +40 -56
- package/dist/src/components/Table/HeaderRow.js +4 -5
- package/dist/src/components/Table/Row.js +10 -14
- package/dist/src/components/Table/SelectBar.js +9 -13
- package/dist/src/components/Table/SkeletonRows.js +5 -6
- package/dist/src/components/Table/TableContext.js +6 -7
- package/dist/src/components/Table/index.js +44 -50
- package/dist/src/components/Tabs/Tab.js +57 -118
- package/dist/src/components/Tabs/TabMenu.js +32 -38
- package/dist/src/components/Tabs/TabMenuItem.js +9 -13
- package/dist/src/components/Tabs/index.js +24 -43
- package/dist/src/components/Tag/index.js +57 -74
- package/dist/src/components/TagInput/index.js +63 -94
- package/dist/src/components/TagList/index.js +22 -35
- package/dist/src/components/Text/index.js +29 -31
- package/dist/src/components/TextArea/index.js +240 -0
- package/dist/src/components/TextInput/index.js +166 -260
- package/dist/src/components/TimeInput/index.js +10 -13
- package/dist/src/components/Toaster/index.js +51 -67
- package/dist/src/components/Toggle/index.js +62 -129
- package/dist/src/components/ToggleGroup/index.js +21 -23
- package/dist/src/components/Tooltip/index.js +28 -31
- package/dist/src/components/VerificationCode/index.js +55 -90
- package/dist/src/index.js +1 -0
- package/dist/src/utils/ids.js +1 -6
- package/package.json +3 -3
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
|
|
17
|
-
|
|
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
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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:",
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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 =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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 =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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:",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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:",
|
|
42
|
-
|
|
43
|
-
|
|
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:",
|
|
60
|
-
|
|
61
|
-
|
|
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 =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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:",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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:",
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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 =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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 =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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:",
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}, ";
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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 =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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 =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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:",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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:",
|
|
76
|
-
|
|
77
|
-
|
|
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 =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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();
|