@ultraviolet/ui 1.22.0 → 1.24.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
CHANGED
|
@@ -1953,6 +1953,8 @@ declare const Popover: react.ForwardRefExoticComponent<{
|
|
|
1953
1953
|
onClose?: (() => void) | undefined;
|
|
1954
1954
|
className?: string | undefined;
|
|
1955
1955
|
'data-testid'?: string | undefined;
|
|
1956
|
+
maxWidth?: string | undefined;
|
|
1957
|
+
maxHeight?: string | undefined;
|
|
1956
1958
|
} & Pick<{
|
|
1957
1959
|
id?: string | undefined;
|
|
1958
1960
|
children: ReactNode | ((renderProps: {
|
|
@@ -1963,7 +1965,7 @@ declare const Popover: react.ForwardRefExoticComponent<{
|
|
|
1963
1965
|
onPointerLeave: () => void;
|
|
1964
1966
|
ref: react.RefObject<HTMLDivElement>;
|
|
1965
1967
|
}) => ReactNode);
|
|
1966
|
-
maxWidth?: number | undefined;
|
|
1968
|
+
maxWidth?: string | number | undefined;
|
|
1967
1969
|
placement?: PopupPlacement | undefined;
|
|
1968
1970
|
text?: ReactNode;
|
|
1969
1971
|
className?: string | undefined;
|
|
@@ -1979,6 +1981,8 @@ declare const Popover: react.ForwardRefExoticComponent<{
|
|
|
1979
1981
|
'aria-haspopup'?: boolean | "menu" | "dialog" | "grid" | "listbox" | "tree" | "false" | "true" | undefined;
|
|
1980
1982
|
hideOnClickOutside?: boolean | undefined;
|
|
1981
1983
|
needDebounce?: boolean | undefined;
|
|
1984
|
+
maxHeight?: string | number | undefined;
|
|
1985
|
+
disableAnimation?: boolean | undefined;
|
|
1982
1986
|
} & react.RefAttributes<HTMLDivElement>, "placement"> & react.RefAttributes<HTMLDivElement>>;
|
|
1983
1987
|
|
|
1984
1988
|
type PopupProps = {
|
|
@@ -1994,7 +1998,7 @@ type PopupProps = {
|
|
|
1994
1998
|
onPointerLeave: () => void;
|
|
1995
1999
|
ref: RefObject<HTMLDivElement>;
|
|
1996
2000
|
}) => ReactNode);
|
|
1997
|
-
maxWidth?: number;
|
|
2001
|
+
maxWidth?: number | string;
|
|
1998
2002
|
/**
|
|
1999
2003
|
* `auto` placement will change the position of the tooltip if it doesn't fit in the viewport.
|
|
2000
2004
|
*/
|
|
@@ -2022,6 +2026,14 @@ type PopupProps = {
|
|
|
2022
2026
|
'aria-haspopup'?: HTMLAttributes<HTMLDivElement>['aria-haspopup'];
|
|
2023
2027
|
hideOnClickOutside?: boolean;
|
|
2024
2028
|
needDebounce?: boolean;
|
|
2029
|
+
/**
|
|
2030
|
+
* If you set a max height keep in mind that the animation is disabled, or it will not work properly on some browsers.
|
|
2031
|
+
*/
|
|
2032
|
+
maxHeight?: string | number;
|
|
2033
|
+
/**
|
|
2034
|
+
* Will remove the animation on the popup if set to false.
|
|
2035
|
+
*/
|
|
2036
|
+
disableAnimation?: boolean;
|
|
2025
2037
|
};
|
|
2026
2038
|
/**
|
|
2027
2039
|
* @experimental This component is experimental and may be subject to breaking changes in the future.
|
|
@@ -2332,12 +2344,14 @@ type StepperProps = {
|
|
|
2332
2344
|
selected?: number;
|
|
2333
2345
|
children: ReactNode[];
|
|
2334
2346
|
className?: string;
|
|
2347
|
+
labelPosition?: 'bottom' | 'right';
|
|
2348
|
+
size?: 'small' | 'medium';
|
|
2335
2349
|
'data-testid'?: string;
|
|
2336
2350
|
};
|
|
2337
2351
|
/**
|
|
2338
2352
|
* Stepper component to show the progress of a process in a linear way.
|
|
2339
2353
|
*/
|
|
2340
|
-
declare const Stepper: ({ children, selected, animated, className, "data-testid": dataTestId, }: StepperProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
2354
|
+
declare const Stepper: ({ children, selected, animated, className, labelPosition, size, "data-testid": dataTestId, }: StepperProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
2341
2355
|
|
|
2342
2356
|
type SwitchButtonProps = {
|
|
2343
2357
|
name: string;
|
|
@@ -2857,6 +2871,8 @@ type MenuProps = {
|
|
|
2857
2871
|
hasArrow?: boolean;
|
|
2858
2872
|
visible?: boolean;
|
|
2859
2873
|
'data-testid'?: string;
|
|
2874
|
+
maxHeight?: string;
|
|
2875
|
+
maxWidth?: string;
|
|
2860
2876
|
};
|
|
2861
2877
|
/**
|
|
2862
2878
|
* A menu is a widget that offers a list of choices to the user, such as a set of actions or functions.
|
|
@@ -51,7 +51,9 @@ const FwdMenu = /*#__PURE__*/forwardRef((_ref7, ref) => {
|
|
|
51
51
|
placement = 'bottom',
|
|
52
52
|
visible = false,
|
|
53
53
|
className,
|
|
54
|
-
'data-testid': dataTestId
|
|
54
|
+
'data-testid': dataTestId,
|
|
55
|
+
maxHeight,
|
|
56
|
+
maxWidth
|
|
55
57
|
} = _ref7;
|
|
56
58
|
const [isVisible, setIsVisible] = useState(visible);
|
|
57
59
|
const popupRef = useRef(null);
|
|
@@ -105,6 +107,8 @@ const FwdMenu = /*#__PURE__*/forwardRef((_ref7, ref) => {
|
|
|
105
107
|
ref: popupRef,
|
|
106
108
|
onClose: onClose,
|
|
107
109
|
tabIndex: -1,
|
|
110
|
+
maxHeight: maxHeight,
|
|
111
|
+
maxWidth: maxWidth,
|
|
108
112
|
text: jsx(MenuList, {
|
|
109
113
|
"data-testid": dataTestId,
|
|
110
114
|
className: className,
|
|
@@ -120,6 +120,8 @@ const Popover = /*#__PURE__*/forwardRef((_ref7, ref) => {
|
|
|
120
120
|
size = 'medium',
|
|
121
121
|
onClose,
|
|
122
122
|
className,
|
|
123
|
+
maxWidth,
|
|
124
|
+
maxHeight,
|
|
123
125
|
'data-testid': dataTestId
|
|
124
126
|
} = _ref7;
|
|
125
127
|
const innerRef = useRef(null);
|
|
@@ -165,6 +167,8 @@ const Popover = /*#__PURE__*/forwardRef((_ref7, ref) => {
|
|
|
165
167
|
innerRef: innerRef,
|
|
166
168
|
onClose: localOnClose,
|
|
167
169
|
onKeyDown: onKeyDownSpace,
|
|
170
|
+
maxWidth: maxWidth,
|
|
171
|
+
maxHeight: maxHeight,
|
|
168
172
|
children: children
|
|
169
173
|
});
|
|
170
174
|
});
|
|
@@ -6,8 +6,8 @@ import { DEFAULT_POSITIONS, computePositions, ARROW_WIDTH } from './helpers.js';
|
|
|
6
6
|
import { jsx, Fragment, jsxs } from '@emotion/react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
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
|
|
10
|
-
const
|
|
9
|
+
const DEFAULT_ANIMATION_DURATION = 230; // in ms
|
|
10
|
+
const DEFAULT_DEBOUNCE_DURATION = 200;
|
|
11
11
|
function noop() {}
|
|
12
12
|
const animation = positions => keyframes`
|
|
13
13
|
0% {
|
|
@@ -30,7 +30,7 @@ const exitAnimation = positions => keyframes`
|
|
|
30
30
|
}
|
|
31
31
|
`;
|
|
32
32
|
const StyledTooltip = /*#__PURE__*/_styled('div', {
|
|
33
|
-
shouldForwardProp: prop => !['maxWidth', 'positions', 'reverseAnimation'].includes(prop),
|
|
33
|
+
shouldForwardProp: prop => !['maxWidth', 'positions', 'reverseAnimation', 'maxHeight', 'animationDuration'].includes(prop),
|
|
34
34
|
target: "e4h1g861"
|
|
35
35
|
})("background:", _ref => {
|
|
36
36
|
let {
|
|
@@ -56,42 +56,54 @@ const StyledTooltip = /*#__PURE__*/_styled('div', {
|
|
|
56
56
|
let {
|
|
57
57
|
maxWidth
|
|
58
58
|
} = _ref5;
|
|
59
|
-
return maxWidth;
|
|
60
|
-
}, "
|
|
59
|
+
return typeof maxWidth === 'number' ? `${maxWidth}px` : maxWidth;
|
|
60
|
+
}, ";max-height:", _ref6 => {
|
|
61
61
|
let {
|
|
62
|
-
|
|
62
|
+
maxHeight
|
|
63
63
|
} = _ref6;
|
|
64
|
-
return
|
|
65
|
-
}, ";
|
|
64
|
+
return typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight;
|
|
65
|
+
}, ";overflow:", _ref7 => {
|
|
66
66
|
let {
|
|
67
|
-
|
|
68
|
-
reverseAnimation
|
|
67
|
+
maxHeight
|
|
69
68
|
} = _ref7;
|
|
70
|
-
return
|
|
71
|
-
}, "
|
|
69
|
+
return maxHeight ? 'auto' : undefined;
|
|
70
|
+
}, ";overflow-wrap:break-word;font-size:0.8rem;inset:0 auto auto 0;top:0;left:0;transform:", _ref8 => {
|
|
72
71
|
let {
|
|
73
72
|
positions
|
|
74
73
|
} = _ref8;
|
|
74
|
+
return positions.tooltipPosition;
|
|
75
|
+
}, ";animation:", _ref9 => {
|
|
76
|
+
let {
|
|
77
|
+
positions,
|
|
78
|
+
reverseAnimation,
|
|
79
|
+
maxHeight,
|
|
80
|
+
animationDuration
|
|
81
|
+
} = _ref9;
|
|
82
|
+
return maxHeight || animationDuration === 0 || animationDuration === undefined ? undefined : /*#__PURE__*/css(animationDuration, "ms ", !reverseAnimation ? animation(positions) : exitAnimation(positions), " forwards;");
|
|
83
|
+
}, ";&[data-has-arrow='true']{&::after{content:' ';position:absolute;top:", _ref10 => {
|
|
84
|
+
let {
|
|
85
|
+
positions
|
|
86
|
+
} = _ref10;
|
|
75
87
|
return positions.arrowTop;
|
|
76
|
-
}, "px;left:",
|
|
88
|
+
}, "px;left:", _ref11 => {
|
|
77
89
|
let {
|
|
78
90
|
positions
|
|
79
|
-
} =
|
|
91
|
+
} = _ref11;
|
|
80
92
|
return positions.arrowLeft;
|
|
81
|
-
}, "px;transform:",
|
|
93
|
+
}, "px;transform:", _ref12 => {
|
|
82
94
|
let {
|
|
83
95
|
positions
|
|
84
|
-
} =
|
|
96
|
+
} = _ref12;
|
|
85
97
|
return positions.arrowTransform;
|
|
86
|
-
}, " rotate(",
|
|
98
|
+
}, " rotate(", _ref13 => {
|
|
87
99
|
let {
|
|
88
100
|
positions
|
|
89
|
-
} =
|
|
101
|
+
} = _ref13;
|
|
90
102
|
return positions.rotate;
|
|
91
|
-
}, "deg);margin-left:-", ARROW_WIDTH, "px;border-width:", ARROW_WIDTH, "px;border-style:solid;border-color:",
|
|
103
|
+
}, "deg);margin-left:-", ARROW_WIDTH, "px;border-width:", ARROW_WIDTH, "px;border-style:solid;border-color:", _ref14 => {
|
|
92
104
|
let {
|
|
93
105
|
theme
|
|
94
|
-
} =
|
|
106
|
+
} = _ref14;
|
|
95
107
|
return theme.colors.neutral.backgroundStronger;
|
|
96
108
|
}, " transparent transparent transparent;pointer-events:none;}}");
|
|
97
109
|
const StyledChildrenContainer = /*#__PURE__*/_styled("div", {
|
|
@@ -107,7 +119,7 @@ const StyledChildrenContainer = /*#__PURE__*/_styled("div", {
|
|
|
107
119
|
/**
|
|
108
120
|
* @experimental This component is experimental and may be subject to breaking changes in the future.
|
|
109
121
|
*/
|
|
110
|
-
const Popup = /*#__PURE__*/forwardRef((
|
|
122
|
+
const Popup = /*#__PURE__*/forwardRef((_ref15, ref) => {
|
|
111
123
|
let {
|
|
112
124
|
children,
|
|
113
125
|
text = '',
|
|
@@ -116,6 +128,7 @@ const Popup = /*#__PURE__*/forwardRef((_ref13, ref) => {
|
|
|
116
128
|
className,
|
|
117
129
|
containerFullWidth,
|
|
118
130
|
maxWidth = 232,
|
|
131
|
+
maxHeight,
|
|
119
132
|
visible,
|
|
120
133
|
innerRef,
|
|
121
134
|
role = 'tooltip',
|
|
@@ -126,14 +139,18 @@ const Popup = /*#__PURE__*/forwardRef((_ref13, ref) => {
|
|
|
126
139
|
onKeyDown,
|
|
127
140
|
'aria-haspopup': ariaHasPopup,
|
|
128
141
|
hideOnClickOutside = false,
|
|
129
|
-
needDebounce = true
|
|
130
|
-
|
|
142
|
+
needDebounce = true,
|
|
143
|
+
disableAnimation = false
|
|
144
|
+
} = _ref15;
|
|
131
145
|
const childrenRef = useRef(null);
|
|
132
146
|
useImperativeHandle(innerRef, () => childrenRef.current);
|
|
133
147
|
const innerTooltipRef = useRef(null);
|
|
134
148
|
useImperativeHandle(ref, () => innerTooltipRef.current);
|
|
135
149
|
const timer = useRef();
|
|
136
150
|
|
|
151
|
+
// There are some issue when mixing animation and maxHeight on some browsers, so we disable animation if maxHeight is set.
|
|
152
|
+
const animationDuration = disableAnimation || maxHeight ? 0 : DEFAULT_ANIMATION_DURATION;
|
|
153
|
+
|
|
137
154
|
// Debounce timer will be used to prevent the tooltip from flickering when the user moves the mouse out and in the children element.
|
|
138
155
|
const debounceTimer = useRef();
|
|
139
156
|
const [visibleInDom, setVisibleInDom] = useState(false);
|
|
@@ -184,9 +201,9 @@ const Popup = /*#__PURE__*/forwardRef((_ref13, ref) => {
|
|
|
184
201
|
timer.current = setTimeout(() => {
|
|
185
202
|
unmountTooltip();
|
|
186
203
|
onClose?.();
|
|
187
|
-
},
|
|
188
|
-
}, needDebounce ?
|
|
189
|
-
}, [needDebounce, onClose, unmountTooltip]);
|
|
204
|
+
}, animationDuration);
|
|
205
|
+
}, needDebounce && !disableAnimation ? DEFAULT_DEBOUNCE_DURATION : 0);
|
|
206
|
+
}, [animationDuration, disableAnimation, needDebounce, onClose, unmountTooltip]);
|
|
190
207
|
|
|
191
208
|
/**
|
|
192
209
|
* When mouse hover or stop hovering children this function display or hide tooltip. A timeout is set to allow animation
|
|
@@ -334,6 +351,7 @@ const Popup = /*#__PURE__*/forwardRef((_ref13, ref) => {
|
|
|
334
351
|
ref: innerTooltipRef,
|
|
335
352
|
positions: positions,
|
|
336
353
|
maxWidth: maxWidth,
|
|
354
|
+
maxHeight: maxHeight,
|
|
337
355
|
role: role,
|
|
338
356
|
id: generatedId,
|
|
339
357
|
className: className,
|
|
@@ -341,6 +359,7 @@ const Popup = /*#__PURE__*/forwardRef((_ref13, ref) => {
|
|
|
341
359
|
"data-testid": dataTestId,
|
|
342
360
|
"data-has-arrow": hasArrow,
|
|
343
361
|
onClick: stopClickPropagation,
|
|
362
|
+
animationDuration: animationDuration,
|
|
344
363
|
children: text
|
|
345
364
|
}), document.body) : null]
|
|
346
365
|
});
|
|
@@ -7,6 +7,10 @@ import { Text } from '../Text/index.js';
|
|
|
7
7
|
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
8
8
|
|
|
9
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)."; }
|
|
10
|
+
const LINE_HEIGHT_SIZES = {
|
|
11
|
+
small: 2,
|
|
12
|
+
medium: 4
|
|
13
|
+
};
|
|
10
14
|
const loadingAnimation = keyframes`
|
|
11
15
|
from {
|
|
12
16
|
width: 0;
|
|
@@ -16,7 +20,7 @@ const loadingAnimation = keyframes`
|
|
|
16
20
|
}
|
|
17
21
|
`;
|
|
18
22
|
const StyledStepContainer = /*#__PURE__*/_styled("div", {
|
|
19
|
-
target: "
|
|
23
|
+
target: "e19ft7rb4"
|
|
20
24
|
})(process.env.NODE_ENV === "production" ? {
|
|
21
25
|
name: "b8wmnj",
|
|
22
26
|
styles: "display:flex;flex-direction:column;align-items:center;justify-content:flex-start"
|
|
@@ -26,99 +30,128 @@ const StyledStepContainer = /*#__PURE__*/_styled("div", {
|
|
|
26
30
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
27
31
|
});
|
|
28
32
|
const StyledText = /*#__PURE__*/_styled(Text, {
|
|
29
|
-
target: "
|
|
33
|
+
target: "e19ft7rb3"
|
|
30
34
|
})("margin-top:", _ref => {
|
|
31
35
|
let {
|
|
32
36
|
theme
|
|
33
37
|
} = _ref;
|
|
34
38
|
return theme.space['1'];
|
|
35
39
|
}, ";");
|
|
40
|
+
const StyledBullet = /*#__PURE__*/_styled(Bullet, {
|
|
41
|
+
target: "e19ft7rb2"
|
|
42
|
+
})("margin-top:", _ref2 => {
|
|
43
|
+
let {
|
|
44
|
+
theme,
|
|
45
|
+
size
|
|
46
|
+
} = _ref2;
|
|
47
|
+
return size === 'small' ? theme.space['0.5'] : 0;
|
|
48
|
+
}, ";");
|
|
36
49
|
const loadingStyle = /*#__PURE__*/css("animation:", loadingAnimation, " 1s linear infinite;");
|
|
37
50
|
const StyledLine = /*#__PURE__*/_styled("div", {
|
|
38
51
|
target: "e19ft7rb1"
|
|
39
|
-
})("border-radius:",
|
|
52
|
+
})("border-radius:", _ref3 => {
|
|
40
53
|
let {
|
|
41
54
|
theme
|
|
42
|
-
} =
|
|
55
|
+
} = _ref3;
|
|
43
56
|
return theme.radii.default;
|
|
44
|
-
}, ";flex-grow:1;border-radius:",
|
|
57
|
+
}, ";flex-grow:1;border-radius:", _ref4 => {
|
|
45
58
|
let {
|
|
46
59
|
theme
|
|
47
|
-
} =
|
|
60
|
+
} = _ref4;
|
|
48
61
|
return theme.radii.default;
|
|
49
|
-
}, ";background-color:",
|
|
62
|
+
}, ";background-color:", _ref5 => {
|
|
50
63
|
let {
|
|
51
64
|
theme
|
|
52
|
-
} =
|
|
65
|
+
} = _ref5;
|
|
53
66
|
return theme.colors.neutral.backgroundStrong;
|
|
54
|
-
}, ";position:relative;::after{content:'';position:absolute;left:0;top:0;height:100%;border-radius:",
|
|
67
|
+
}, ";position:relative;::after{content:'';position:absolute;left:0;top:0;height:100%;border-radius:", _ref6 => {
|
|
55
68
|
let {
|
|
56
69
|
theme
|
|
57
|
-
} =
|
|
70
|
+
} = _ref6;
|
|
58
71
|
return theme.radii.default;
|
|
59
|
-
}, ";background-color:",
|
|
72
|
+
}, ";background-color:", _ref7 => {
|
|
60
73
|
let {
|
|
61
74
|
theme
|
|
62
|
-
} =
|
|
75
|
+
} = _ref7;
|
|
63
76
|
return theme.colors.primary.backgroundStrong;
|
|
64
|
-
}, ";",
|
|
77
|
+
}, ";", _ref8 => {
|
|
65
78
|
let {
|
|
66
79
|
temporal
|
|
67
|
-
} =
|
|
80
|
+
} = _ref8;
|
|
68
81
|
return temporal === 'previous' && `width: 100%;`;
|
|
69
|
-
}, " ",
|
|
82
|
+
}, " ", _ref9 => {
|
|
70
83
|
let {
|
|
71
84
|
temporal,
|
|
72
85
|
animated
|
|
73
|
-
} =
|
|
86
|
+
} = _ref9;
|
|
74
87
|
return temporal === 'current' && animated && loadingStyle;
|
|
75
88
|
}, ";}");
|
|
76
89
|
const StyledContainer = /*#__PURE__*/_styled("div", {
|
|
77
90
|
target: "e19ft7rb0"
|
|
78
|
-
})("display:flex;flex-direction:row;justify-content:center;align-items:flex-start;gap:0 ",
|
|
79
|
-
let {
|
|
80
|
-
theme
|
|
81
|
-
} = _ref9;
|
|
82
|
-
return theme.space['1'];
|
|
83
|
-
}, ";", StyledStepContainer, "{width:", _ref10 => {
|
|
91
|
+
})("display:flex;flex-direction:row;justify-content:center;align-items:flex-start;gap:0 ", _ref10 => {
|
|
84
92
|
let {
|
|
85
93
|
theme
|
|
86
94
|
} = _ref10;
|
|
87
|
-
return theme.space['
|
|
88
|
-
}, ";
|
|
95
|
+
return theme.space['1'];
|
|
96
|
+
}, ";gap:", _ref11 => {
|
|
89
97
|
let {
|
|
90
|
-
theme
|
|
98
|
+
theme,
|
|
99
|
+
labelPosition,
|
|
100
|
+
size
|
|
91
101
|
} = _ref11;
|
|
92
|
-
return theme.space['0.
|
|
93
|
-
}, ";
|
|
102
|
+
return size === 'medium' && labelPosition === 'bottom' ? theme.space['0'] : theme.space['1'];
|
|
103
|
+
}, ";", StyledStepContainer, "{display:flex;flex-direction:", _ref12 => {
|
|
94
104
|
let {
|
|
95
|
-
|
|
105
|
+
labelPosition
|
|
96
106
|
} = _ref12;
|
|
107
|
+
return labelPosition === 'bottom' ? 'column' : 'row';
|
|
108
|
+
}, ";align-items:", _ref13 => {
|
|
109
|
+
let {
|
|
110
|
+
labelPosition
|
|
111
|
+
} = _ref13;
|
|
112
|
+
return labelPosition === 'bottom' ? 'center' : 'baseline';
|
|
113
|
+
}, ";gap:", _ref14 => {
|
|
114
|
+
let {
|
|
115
|
+
theme,
|
|
116
|
+
labelPosition
|
|
117
|
+
} = _ref14;
|
|
118
|
+
return labelPosition === 'bottom' ? theme.space['0.5'] : theme.space['1'];
|
|
119
|
+
}, ";white-space:nowrap;}", StyledLine, "{height:", _ref15 => {
|
|
120
|
+
let {
|
|
121
|
+
size
|
|
122
|
+
} = _ref15;
|
|
123
|
+
return LINE_HEIGHT_SIZES[size];
|
|
124
|
+
}, "px;margin-top:", _ref16 => {
|
|
125
|
+
let {
|
|
126
|
+
theme
|
|
127
|
+
} = _ref16;
|
|
97
128
|
return theme.space['2'];
|
|
98
|
-
}, ";margin-bottom:",
|
|
129
|
+
}, ";margin-bottom:", _ref17 => {
|
|
99
130
|
let {
|
|
100
131
|
theme
|
|
101
|
-
} =
|
|
132
|
+
} = _ref17;
|
|
102
133
|
return theme.space['2'];
|
|
103
134
|
}, ";}");
|
|
104
|
-
const StepperNumbers =
|
|
135
|
+
const StepperNumbers = _ref18 => {
|
|
105
136
|
let {
|
|
106
137
|
temporal,
|
|
107
138
|
children,
|
|
108
|
-
CurrentStep
|
|
109
|
-
|
|
139
|
+
CurrentStep,
|
|
140
|
+
size = 'medium'
|
|
141
|
+
} = _ref18;
|
|
110
142
|
return jsxs(StyledStepContainer, {
|
|
111
|
-
children: [jsx(
|
|
143
|
+
children: [jsx(StyledBullet, {
|
|
112
144
|
sentiment: temporal === 'next' ? 'neutral' : 'primary',
|
|
113
145
|
...(temporal === 'previous' ? {
|
|
114
146
|
icon: 'check'
|
|
115
147
|
} : {
|
|
116
148
|
text: CurrentStep.toString()
|
|
117
149
|
}),
|
|
118
|
-
prominence: temporal !== 'current' ? 'default' : 'strong'
|
|
150
|
+
prominence: temporal !== 'current' ? 'default' : 'strong',
|
|
151
|
+
size: size
|
|
119
152
|
}), jsx(StyledText, {
|
|
120
153
|
as: "span",
|
|
121
|
-
variant:
|
|
154
|
+
variant: size === 'medium' ? 'body' : 'bodySmall',
|
|
122
155
|
prominence: temporal === 'next' ? 'weak' : 'default',
|
|
123
156
|
children: children
|
|
124
157
|
})]
|
|
@@ -127,18 +160,22 @@ const StepperNumbers = _ref14 => {
|
|
|
127
160
|
/**
|
|
128
161
|
* Stepper component to show the progress of a process in a linear way.
|
|
129
162
|
*/
|
|
130
|
-
const Stepper =
|
|
163
|
+
const Stepper = _ref19 => {
|
|
131
164
|
let {
|
|
132
165
|
children,
|
|
133
166
|
selected = 0,
|
|
134
167
|
animated = false,
|
|
135
168
|
className,
|
|
169
|
+
labelPosition = 'bottom',
|
|
170
|
+
size = 'medium',
|
|
136
171
|
'data-testid': dataTestId
|
|
137
|
-
} =
|
|
172
|
+
} = _ref19;
|
|
138
173
|
const lastStep = Children.count(children) - 1;
|
|
139
174
|
return jsx(StyledContainer, {
|
|
140
175
|
className: className,
|
|
141
176
|
"data-testid": dataTestId,
|
|
177
|
+
labelPosition: labelPosition,
|
|
178
|
+
size: size,
|
|
142
179
|
children: flattenChildren(children).map((child, index) => {
|
|
143
180
|
const getTemporal = () => {
|
|
144
181
|
if (selected > index) return 'previous';
|
|
@@ -153,6 +190,7 @@ const Stepper = _ref15 => {
|
|
|
153
190
|
children: [jsx(StepperNumbers, {
|
|
154
191
|
CurrentStep: index + 1,
|
|
155
192
|
temporal: temporal,
|
|
193
|
+
size: size,
|
|
156
194
|
children: child
|
|
157
195
|
}), isNotLast ? jsx(StyledLine, {
|
|
158
196
|
temporal: temporal,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultraviolet/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"description": "Ultraviolet UI",
|
|
5
5
|
"homepage": "https://github.com/scaleway/ultraviolet#readme",
|
|
6
6
|
"repository": {
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@emotion/babel-plugin": "11.11.0",
|
|
44
44
|
"@emotion/react": "11.11.1",
|
|
45
45
|
"@emotion/styled": "11.11.0",
|
|
46
|
-
"@types/react": "18.2.
|
|
47
|
-
"@types/react-datepicker": "4.19.
|
|
46
|
+
"@types/react": "18.2.33",
|
|
47
|
+
"@types/react-datepicker": "4.19.1",
|
|
48
48
|
"@types/react-dom": "18.2.14",
|
|
49
49
|
"react": "18.2.0",
|
|
50
50
|
"react-dom": "18.2.0"
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
"@scaleway/random-name": "4.0.2",
|
|
61
61
|
"@scaleway/use-media": "2.0.1",
|
|
62
62
|
"deepmerge": "4.3.1",
|
|
63
|
-
"react-datepicker": "4.
|
|
63
|
+
"react-datepicker": "4.21.0",
|
|
64
64
|
"react-flatten-children": "1.1.2",
|
|
65
65
|
"react-select": "5.7.7",
|
|
66
66
|
"react-toastify": "9.1.3",
|
|
67
67
|
"react-use-clipboard": "1.0.9",
|
|
68
68
|
"reakit": "1.3.11",
|
|
69
69
|
"@ultraviolet/themes": "1.3.0",
|
|
70
|
-
"@ultraviolet/icons": "2.5.
|
|
70
|
+
"@ultraviolet/icons": "2.5.1"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "rollup -c ../../rollup.config.mjs"
|