@ultraviolet/ui 1.35.0 → 1.37.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/dist/index.d.ts +17 -4
- package/dist/src/components/Breadcrumbs/index.js +4 -4
- package/dist/src/components/NumberInput/index.js +1 -2
- package/dist/src/components/NumberInputV2/index.js +1 -1
- package/dist/src/components/RadioGroup/index.js +2 -3
- package/dist/src/components/SelectableCard/index.js +25 -5
- package/dist/src/components/Table/Row.js +30 -3
- package/dist/src/components/TagInput/index.js +1 -1
- package/dist/src/components/Toaster/index.js +5 -4
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -529,6 +529,14 @@ declare const extendTheme: (extendedTheme: RecursivePartial<UltravioletUITheme>)
|
|
|
529
529
|
fillWeak: string;
|
|
530
530
|
fillWeakDisabled: string;
|
|
531
531
|
};
|
|
532
|
+
original: {
|
|
533
|
+
fill: string;
|
|
534
|
+
fillDisabled: string;
|
|
535
|
+
fillStrong: string;
|
|
536
|
+
fillStrongDisabled: string;
|
|
537
|
+
fillWeak: string;
|
|
538
|
+
fillWeakDisabled: string;
|
|
539
|
+
};
|
|
532
540
|
primary: {
|
|
533
541
|
fill: string;
|
|
534
542
|
fillDisabled: string;
|
|
@@ -2041,8 +2049,7 @@ type NumberInputProps = {
|
|
|
2041
2049
|
error?: string | boolean;
|
|
2042
2050
|
} & Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'onChange' | 'value' | 'defaultValue'>;
|
|
2043
2051
|
/**
|
|
2044
|
-
*
|
|
2045
|
-
* by typing into input.
|
|
2052
|
+
* @deprecated This component is deprecated. Please use `NumberInputV2` instead.
|
|
2046
2053
|
*/
|
|
2047
2054
|
declare const NumberInput: ({ disabled, maxValue, minValue, name, onChange, onFocus, onBlur, onMaxCrossed, onMinCrossed, size, step, text, defaultValue, value, disabledTooltip, className, label, id, placeholder, error, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "data-testid": dataTestId, }: NumberInputProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
2048
2055
|
|
|
@@ -2690,12 +2697,13 @@ declare const Table: react.ForwardRefExoticComponent<TableProps & react.RefAttri
|
|
|
2690
2697
|
Body: ({ children }: {
|
|
2691
2698
|
children: ReactNode;
|
|
2692
2699
|
}) => _emotion_react_jsx_runtime.JSX.Element;
|
|
2693
|
-
Row: ({ children, className, id, selectDisabled, "data-testid": dataTestid, }: {
|
|
2700
|
+
Row: ({ children, className, id, selectDisabled, highlightAnimation, "data-testid": dataTestid, }: {
|
|
2694
2701
|
children: ReactNode;
|
|
2695
2702
|
className?: string | undefined;
|
|
2696
2703
|
id: string;
|
|
2697
2704
|
'data-testid'?: string | undefined;
|
|
2698
2705
|
selectDisabled?: string | boolean | undefined;
|
|
2706
|
+
highlightAnimation?: boolean | undefined;
|
|
2699
2707
|
}) => _emotion_react_jsx_runtime.JSX.Element;
|
|
2700
2708
|
Cell: ({ children, className, colSpan, rowSpan }: {
|
|
2701
2709
|
children?: ReactNode;
|
|
@@ -3200,7 +3208,12 @@ type VerificationCodeProps = {
|
|
|
3200
3208
|
*/
|
|
3201
3209
|
declare const VerificationCode: ({ disabled, className, error, fields, initialValue, inputId, inputStyle, size, onChange, onComplete, placeholder, required, type, "data-testid": dataTestId, "aria-label": ariaLabel, }: VerificationCodeProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
3202
3210
|
|
|
3203
|
-
type RadioGroupRadioProps = Omit<ComponentProps<typeof Radio>, 'onChange' | 'checked' | 'required'
|
|
3211
|
+
type RadioGroupRadioProps = Omit<ComponentProps<typeof Radio>, 'onChange' | 'checked' | 'required'> & {
|
|
3212
|
+
/**
|
|
3213
|
+
* @deprecated you don't need to use `name` anymore, the name will be passed from the parent `RadioGroup`.
|
|
3214
|
+
*/
|
|
3215
|
+
name?: string;
|
|
3216
|
+
};
|
|
3204
3217
|
type RadioGroupProps = {
|
|
3205
3218
|
legend: string;
|
|
3206
3219
|
value: string | number;
|
|
@@ -13,11 +13,11 @@ const contractString = str => {
|
|
|
13
13
|
const StyledOl = /*#__PURE__*/_styled("ol", {
|
|
14
14
|
target: "ej0p0s41"
|
|
15
15
|
})(process.env.NODE_ENV === "production" ? {
|
|
16
|
-
name: "
|
|
17
|
-
styles: "list-style:none;margin:0;padding:0;display:flex;align-items:center"
|
|
16
|
+
name: "105zz11",
|
|
17
|
+
styles: "list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;align-items:center"
|
|
18
18
|
} : {
|
|
19
|
-
name: "
|
|
20
|
-
styles: "list-style:none;margin:0;padding:0;display:flex;align-items:center",
|
|
19
|
+
name: "105zz11",
|
|
20
|
+
styles: "list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;align-items:center",
|
|
21
21
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
22
22
|
});
|
|
23
23
|
const ItemContainer = /*#__PURE__*/_styled("li", {
|
|
@@ -79,8 +79,7 @@ const StyledContainer = /*#__PURE__*/_styled('div', {
|
|
|
79
79
|
theme
|
|
80
80
|
}) => theme.colors.primary.borderHover, ";}}");
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
83
|
-
* by typing into input.
|
|
82
|
+
* @deprecated This component is deprecated. Please use `NumberInputV2` instead.
|
|
84
83
|
*/
|
|
85
84
|
const NumberInput = ({
|
|
86
85
|
disabled = false,
|
|
@@ -31,15 +31,14 @@ const RadioGroupRadio = ({
|
|
|
31
31
|
onChange,
|
|
32
32
|
groupValue
|
|
33
33
|
} = context;
|
|
34
|
-
const radioName = `${groupName}-${name ?? ''}`;
|
|
35
34
|
return jsx(Radio, {
|
|
36
35
|
onChange: onChange,
|
|
37
|
-
checked:
|
|
36
|
+
checked: groupValue === value,
|
|
38
37
|
onFocus: onFocus,
|
|
39
38
|
onBlur: onBlur,
|
|
40
39
|
disabled: disabled,
|
|
41
40
|
error: error,
|
|
42
|
-
name:
|
|
41
|
+
name: groupName ?? name,
|
|
43
42
|
value: value,
|
|
44
43
|
label: label,
|
|
45
44
|
helper: helper,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import _styled from '@emotion/styled/base';
|
|
2
|
-
import { forwardRef, useRef } from 'react';
|
|
2
|
+
import { forwardRef, useRef, useCallback } from 'react';
|
|
3
3
|
import { Checkbox } from '../Checkbox/index.js';
|
|
4
4
|
import { Radio } from '../Radio/index.js';
|
|
5
|
+
import { Stack } from '../Stack/index.js';
|
|
5
6
|
import { Tooltip } from '../Tooltip/index.js';
|
|
6
7
|
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
7
8
|
|
|
8
9
|
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)."; }
|
|
9
|
-
const Container = /*#__PURE__*/_styled(
|
|
10
|
+
const Container = /*#__PURE__*/_styled(Stack, {
|
|
10
11
|
target: "e1s5n3hj2"
|
|
11
|
-
})("
|
|
12
|
+
})("padding:", ({
|
|
12
13
|
theme
|
|
13
14
|
}) => theme.space['2'], ";border-radius:", ({
|
|
14
15
|
theme
|
|
@@ -87,8 +88,23 @@ const SelectableCard = /*#__PURE__*/forwardRef(({
|
|
|
87
88
|
'data-testid': dataTestId
|
|
88
89
|
}, ref) => {
|
|
89
90
|
const innerRef = useRef(null);
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
const ParentContainer = useCallback(({
|
|
92
|
+
children: subChildren
|
|
93
|
+
}) => {
|
|
94
|
+
if (tooltip) {
|
|
95
|
+
return jsx(Stack, {
|
|
96
|
+
flex: 1,
|
|
97
|
+
children: jsx(Tooltip, {
|
|
98
|
+
text: tooltip,
|
|
99
|
+
children: subChildren
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return jsx(Tooltip, {
|
|
104
|
+
children: subChildren
|
|
105
|
+
});
|
|
106
|
+
}, [tooltip]);
|
|
107
|
+
return jsx(ParentContainer, {
|
|
92
108
|
children: jsxs(Container, {
|
|
93
109
|
onClick: () => {
|
|
94
110
|
if (innerRef?.current) {
|
|
@@ -102,6 +118,10 @@ const SelectableCard = /*#__PURE__*/forwardRef(({
|
|
|
102
118
|
"data-testid": dataTestId,
|
|
103
119
|
"data-type": type,
|
|
104
120
|
ref: ref,
|
|
121
|
+
alignItems: "start",
|
|
122
|
+
direction: "column",
|
|
123
|
+
gap: 0.5,
|
|
124
|
+
flex: 1,
|
|
105
125
|
children: [type === 'radio' ? jsx(StyledRadio, {
|
|
106
126
|
name: name,
|
|
107
127
|
value: value,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _styled from '@emotion/styled/base';
|
|
2
|
+
import { keyframes } from '@emotion/react';
|
|
2
3
|
import { useEffect } from 'react';
|
|
3
4
|
import { Checkbox } from '../Checkbox/index.js';
|
|
4
5
|
import { Tooltip } from '../Tooltip/index.js';
|
|
@@ -6,16 +7,41 @@ import { Cell } from './Cell.js';
|
|
|
6
7
|
import { useTableContext } from './TableContext.js';
|
|
7
8
|
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
8
9
|
|
|
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)."; }
|
|
9
11
|
const StyledCheckboxContainer = /*#__PURE__*/_styled("div", {
|
|
12
|
+
target: "e1qvrbgq1"
|
|
13
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
14
|
+
name: "zjik7",
|
|
15
|
+
styles: "display:flex"
|
|
16
|
+
} : {
|
|
17
|
+
name: "zjik7",
|
|
18
|
+
styles: "display:flex",
|
|
19
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// We start at 5% and finish at 80% to leave the original background color
|
|
23
|
+
// as we can't know if the table will be stripped or not
|
|
24
|
+
const colorChange = theme => keyframes`
|
|
25
|
+
5% {
|
|
26
|
+
background-color: ${theme.colors.primary.background};
|
|
27
|
+
}
|
|
28
|
+
80% {
|
|
29
|
+
background-color: ${theme.colors.primary.background};
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const StyledTr = /*#__PURE__*/_styled('tr', {
|
|
33
|
+
shouldForwardProp: prop => !['highlightAnimation'].includes(prop),
|
|
10
34
|
target: "e1qvrbgq0"
|
|
11
|
-
})("
|
|
35
|
+
})("animation:", ({
|
|
36
|
+
highlightAnimation,
|
|
12
37
|
theme
|
|
13
|
-
}) => theme
|
|
38
|
+
}) => highlightAnimation ? colorChange(theme) : undefined, " 3s linear;");
|
|
14
39
|
const Row = ({
|
|
15
40
|
children,
|
|
16
41
|
className,
|
|
17
42
|
id,
|
|
18
43
|
selectDisabled,
|
|
44
|
+
highlightAnimation,
|
|
19
45
|
'data-testid': dataTestid
|
|
20
46
|
}) => {
|
|
21
47
|
const {
|
|
@@ -33,9 +59,10 @@ const Row = ({
|
|
|
33
59
|
}
|
|
34
60
|
return undefined;
|
|
35
61
|
}, [id, registerSelectableRow, selectDisabled]);
|
|
36
|
-
return jsxs(
|
|
62
|
+
return jsxs(StyledTr, {
|
|
37
63
|
className: className,
|
|
38
64
|
"data-testid": dataTestid,
|
|
65
|
+
highlightAnimation: highlightAnimation,
|
|
39
66
|
children: [selectable ? jsx(Cell, {
|
|
40
67
|
children: jsx(StyledCheckboxContainer, {
|
|
41
68
|
"data-visibility": allRowSelectValue === false ? 'hover' : undefined,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _styled from '@emotion/styled/base';
|
|
2
2
|
import { useTheme, Global, ClassNames, css } from '@emotion/react';
|
|
3
|
-
import { toast as toast$1, ToastContainer as ToastContainer$1 } from 'react-toastify';
|
|
3
|
+
import { toast as toast$1, ToastContainer as ToastContainer$1, Slide } from 'react-toastify';
|
|
4
4
|
import css_248z from '../../../react-toastify/dist/ReactToastify.min.css.js';
|
|
5
5
|
import { Button } from '../Button/index.js';
|
|
6
6
|
import { Stack } from '../Stack/index.js';
|
|
@@ -12,7 +12,7 @@ const PREFIX = '.Toastify';
|
|
|
12
12
|
const AUTOCLOSE_DELAY = 6000; // Delay to close the toast in ms
|
|
13
13
|
|
|
14
14
|
const styles = {
|
|
15
|
-
toast: theme => /*#__PURE__*/css("border-radius:", theme.radii.default, ";min-height:52px;
|
|
15
|
+
toast: theme => /*#__PURE__*/css("border-radius:", theme.radii.default, ";min-height:52px;", PREFIX, "__toast-container{width:344px;}", PREFIX, "__toast-body{margin:0;padding:0;}&", PREFIX, "__toast--success{background-color:", theme.colors.neutral.backgroundStronger, ";color:", theme.colors.neutral.textStronger, ";padding:", theme.space['2'], ";}&", PREFIX, "__toast--info{background-color:", theme.colors.info.backgroundStrong, ";color:", theme.colors.neutral.textStronger, ";padding:", theme.space['2'], ";}&", PREFIX, "__toast--error{background-color:", theme.colors.danger.backgroundStrong, ";color:", theme.colors.neutral.textStronger, ";padding:", theme.space['2'], ";}&", PREFIX, "__toast--warning{background-color:", theme.colors.warning.backgroundStrong, ";color:", theme.colors.warning.textStrong, ";padding:", theme.space['2'], ";}")
|
|
16
16
|
};
|
|
17
17
|
const StyledButton = /*#__PURE__*/_styled(Button, {
|
|
18
18
|
target: "e1eb63990"
|
|
@@ -40,7 +40,7 @@ const Content = ({
|
|
|
40
40
|
gap: 2,
|
|
41
41
|
direction: "row",
|
|
42
42
|
children: jsx(Text, {
|
|
43
|
-
variant: "
|
|
43
|
+
variant: "bodySmallStrong",
|
|
44
44
|
as: "span",
|
|
45
45
|
children: children
|
|
46
46
|
})
|
|
@@ -116,7 +116,8 @@ const ToastContainer = ({
|
|
|
116
116
|
position: position,
|
|
117
117
|
stacked: true,
|
|
118
118
|
hideProgressBar: true,
|
|
119
|
-
className: className
|
|
119
|
+
className: className,
|
|
120
|
+
transition: Slide
|
|
120
121
|
})
|
|
121
122
|
})]
|
|
122
123
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultraviolet/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.37.0",
|
|
4
4
|
"description": "Ultraviolet UI",
|
|
5
5
|
"homepage": "https://github.com/scaleway/ultraviolet#readme",
|
|
6
6
|
"repository": {
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"react-toastify": "10.0.4",
|
|
67
67
|
"react-use-clipboard": "1.0.9",
|
|
68
68
|
"reakit": "1.3.11",
|
|
69
|
-
"@ultraviolet/themes": "1.
|
|
70
|
-
"@ultraviolet/icons": "2.
|
|
69
|
+
"@ultraviolet/themes": "1.9.0",
|
|
70
|
+
"@ultraviolet/icons": "2.9.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "rollup -c ../../rollup.config.mjs",
|