@ultraviolet/ui 1.10.0 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +9 -1
- package/dist/src/components/Button/index.js +2 -0
- package/dist/src/components/Modal/Disclosure.js +2 -1
- package/dist/src/components/Modal/Modal.js +2 -1
- package/dist/src/components/Tooltip/index.js +2 -0
- package/dist/src/internalComponents/Popup/index.js +8 -6
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1408,6 +1408,10 @@ type ModalState = {
|
|
|
1408
1408
|
toggle: () => void;
|
|
1409
1409
|
visible: boolean;
|
|
1410
1410
|
modalId: string;
|
|
1411
|
+
/**
|
|
1412
|
+
* @deprecated use onClose
|
|
1413
|
+
*/
|
|
1414
|
+
hide: () => void;
|
|
1411
1415
|
};
|
|
1412
1416
|
|
|
1413
1417
|
type ModalProps = {
|
|
@@ -1617,6 +1621,10 @@ type TooltipProps$1 = {
|
|
|
1617
1621
|
*/
|
|
1618
1622
|
text?: ReactNode;
|
|
1619
1623
|
className?: string;
|
|
1624
|
+
/**
|
|
1625
|
+
* It will add `width: 100%` to the tooltip container.
|
|
1626
|
+
*/
|
|
1627
|
+
containerFullWidth?: boolean;
|
|
1620
1628
|
/**
|
|
1621
1629
|
* It will force display tooltip. This can be useful if you need to always display the tooltip without hover needed.
|
|
1622
1630
|
*/
|
|
@@ -2297,7 +2305,7 @@ type ToggleProps = {
|
|
|
2297
2305
|
};
|
|
2298
2306
|
declare const Toggle: react.ForwardRefExoticComponent<ToggleProps & react.RefAttributes<HTMLInputElement>>;
|
|
2299
2307
|
|
|
2300
|
-
type TooltipProps = Pick<ComponentProps<typeof Popup>, 'id' | 'children' | 'maxWidth' | 'placement' | 'text' | 'className' | 'visible' | 'innerRef' | 'role' | 'data-testid'>;
|
|
2308
|
+
type TooltipProps = Pick<ComponentProps<typeof Popup>, 'id' | 'children' | 'maxWidth' | 'placement' | 'text' | 'className' | 'visible' | 'innerRef' | 'role' | 'data-testid' | 'containerFullWidth'>;
|
|
2301
2309
|
declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLDivElement>>;
|
|
2302
2310
|
|
|
2303
2311
|
type VerificationCodeProps = {
|
|
@@ -260,6 +260,7 @@ const Button = /*#__PURE__*/forwardRef((_ref10, ref) => {
|
|
|
260
260
|
const Component = VARIANTS_COMPONENTS[variant].link;
|
|
261
261
|
return jsx(Tooltip, {
|
|
262
262
|
text: tooltip,
|
|
263
|
+
containerFullWidth: fullWidth,
|
|
263
264
|
children: jsx(Component, {
|
|
264
265
|
role: role,
|
|
265
266
|
className: className,
|
|
@@ -289,6 +290,7 @@ const Button = /*#__PURE__*/forwardRef((_ref10, ref) => {
|
|
|
289
290
|
const Component = VARIANTS_COMPONENTS[variant].button;
|
|
290
291
|
return jsx(Tooltip, {
|
|
291
292
|
text: tooltip,
|
|
293
|
+
containerFullWidth: fullWidth,
|
|
292
294
|
children: jsx(Component, {
|
|
293
295
|
role: role,
|
|
294
296
|
className: className,
|
|
@@ -90,7 +90,8 @@ const Modal = _ref3 => {
|
|
|
90
90
|
onClose: handleClose,
|
|
91
91
|
onOpen: handleOpen,
|
|
92
92
|
toggle: handleToggle,
|
|
93
|
-
modalId: finalId
|
|
93
|
+
modalId: finalId,
|
|
94
|
+
hide: handleClose
|
|
94
95
|
}) : children, jsx(StyledContainer, {
|
|
95
96
|
children: isClosable ? jsx(Button, {
|
|
96
97
|
"data-testid": dataTestId ? `${dataTestId}-close-button` : undefined,
|
|
@@ -9,6 +9,7 @@ const Tooltip = /*#__PURE__*/forwardRef((_ref, tooltipRef) => {
|
|
|
9
9
|
placement = 'auto',
|
|
10
10
|
id,
|
|
11
11
|
className,
|
|
12
|
+
containerFullWidth,
|
|
12
13
|
maxWidth = 232,
|
|
13
14
|
visible,
|
|
14
15
|
innerRef,
|
|
@@ -21,6 +22,7 @@ const Tooltip = /*#__PURE__*/forwardRef((_ref, tooltipRef) => {
|
|
|
21
22
|
role: role,
|
|
22
23
|
"data-testid": dataTestId,
|
|
23
24
|
className: className,
|
|
25
|
+
containerFullWidth: containerFullWidth,
|
|
24
26
|
maxWidth: maxWidth,
|
|
25
27
|
visible: visible,
|
|
26
28
|
placement: placement,
|
|
@@ -57,7 +57,7 @@ const StyledTooltip = /*#__PURE__*/_styled('div', {
|
|
|
57
57
|
maxWidth
|
|
58
58
|
} = _ref5;
|
|
59
59
|
return maxWidth;
|
|
60
|
-
}, "px;font-size:0.8rem;inset:0 auto auto 0;top:0;left:0;transform:", _ref6 => {
|
|
60
|
+
}, "px;word-break:break-all;font-size:0.8rem;inset:0 auto auto 0;top:0;left:0;transform:", _ref6 => {
|
|
61
61
|
let {
|
|
62
62
|
positions
|
|
63
63
|
} = _ref6;
|
|
@@ -97,11 +97,11 @@ const StyledTooltip = /*#__PURE__*/_styled('div', {
|
|
|
97
97
|
const StyledChildrenContainer = /*#__PURE__*/_styled("div", {
|
|
98
98
|
target: "efkq4700"
|
|
99
99
|
})(process.env.NODE_ENV === "production" ? {
|
|
100
|
-
name: "
|
|
101
|
-
styles: "display:inherit"
|
|
100
|
+
name: "jhu4ja",
|
|
101
|
+
styles: "display:inherit;&[data-container-full-width='true']{width:100%;}"
|
|
102
102
|
} : {
|
|
103
|
-
name: "
|
|
104
|
-
styles: "display:inherit",
|
|
103
|
+
name: "jhu4ja",
|
|
104
|
+
styles: "display:inherit;&[data-container-full-width='true']{width:100%;}",
|
|
105
105
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
106
106
|
});
|
|
107
107
|
const Popup = /*#__PURE__*/forwardRef((_ref13, tooltipRef) => {
|
|
@@ -111,6 +111,7 @@ const Popup = /*#__PURE__*/forwardRef((_ref13, tooltipRef) => {
|
|
|
111
111
|
placement = 'auto',
|
|
112
112
|
id,
|
|
113
113
|
className,
|
|
114
|
+
containerFullWidth,
|
|
114
115
|
maxWidth = 232,
|
|
115
116
|
visible,
|
|
116
117
|
innerRef,
|
|
@@ -250,9 +251,10 @@ const Popup = /*#__PURE__*/forwardRef((_ref13, tooltipRef) => {
|
|
|
250
251
|
ref: childrenRef,
|
|
251
252
|
tabIndex: 0,
|
|
252
253
|
onKeyDown: onKeyDown,
|
|
254
|
+
"data-container-full-width": containerFullWidth,
|
|
253
255
|
children: children
|
|
254
256
|
});
|
|
255
|
-
}, [children, generatedId, isControlled, onKeyDown, onPointerEvent]);
|
|
257
|
+
}, [children, containerFullWidth, generatedId, isControlled, onKeyDown, onPointerEvent]);
|
|
256
258
|
if (!text) {
|
|
257
259
|
if (typeof children === 'function') return null;
|
|
258
260
|
return jsx(Fragment, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultraviolet/ui",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "Ultraviolet UI",
|
|
5
5
|
"homepage": "https://github.com/scaleway/ultraviolet#readme",
|
|
6
6
|
"repository": {
|
|
@@ -43,9 +43,9 @@
|
|
|
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.
|
|
46
|
+
"@types/react": "18.2.14",
|
|
47
47
|
"@types/react-datepicker": "4.15.0",
|
|
48
|
-
"@types/react-dom": "18.2.
|
|
48
|
+
"@types/react-dom": "18.2.6",
|
|
49
49
|
"react": "18.2.0",
|
|
50
50
|
"react-dom": "18.2.0"
|
|
51
51
|
},
|