@ultraviolet/ui 1.21.1 → 1.22.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
|
@@ -1153,12 +1153,14 @@ type BannerProps = {
|
|
|
1153
1153
|
linkText?: string;
|
|
1154
1154
|
linkHref?: string;
|
|
1155
1155
|
image?: ReactNode;
|
|
1156
|
+
closable?: boolean;
|
|
1156
1157
|
className?: string;
|
|
1158
|
+
['data-testid']?: string;
|
|
1157
1159
|
};
|
|
1158
1160
|
/**
|
|
1159
1161
|
* Banner component is used to display an informative message to the user with style.
|
|
1160
1162
|
*/
|
|
1161
|
-
declare const Banner: ({ variant, size, title, children, direction, onClose, buttonText, onClickButton, linkText, linkHref, image, className, }: BannerProps) => _emotion_react_jsx_runtime.JSX.Element | null;
|
|
1163
|
+
declare const Banner: ({ variant, size, title, children, direction, onClose, buttonText, onClickButton, linkText, linkHref, image, className, closable, "data-testid": dataTestId, }: BannerProps) => _emotion_react_jsx_runtime.JSX.Element | null;
|
|
1162
1164
|
|
|
1163
1165
|
type BarChartToolTipProps = {
|
|
1164
1166
|
color: string;
|
|
@@ -2842,11 +2844,14 @@ type DisclosureProps = {
|
|
|
2842
2844
|
type DisclosureElement = ((disclosure: DisclosureProps) => ReactElement<ButtonHTMLAttributes<HTMLButtonElement>>) | (ReactElement<ButtonHTMLAttributes<HTMLButtonElement>> & {
|
|
2843
2845
|
ref?: Ref<HTMLButtonElement>;
|
|
2844
2846
|
});
|
|
2847
|
+
type ChildMenuProps = {
|
|
2848
|
+
toggle: () => void;
|
|
2849
|
+
};
|
|
2845
2850
|
type MenuProps = {
|
|
2846
2851
|
id?: string;
|
|
2847
2852
|
ariaLabel?: string;
|
|
2848
2853
|
placement?: ComponentProps<typeof Popup>['placement'];
|
|
2849
|
-
children?: ReactNode;
|
|
2854
|
+
children?: ReactNode | (({ toggle }: ChildMenuProps) => ReactNode);
|
|
2850
2855
|
className?: string;
|
|
2851
2856
|
disclosure: DisclosureElement;
|
|
2852
2857
|
hasArrow?: boolean;
|
|
@@ -40,7 +40,7 @@ const styles = _ref => {
|
|
|
40
40
|
return null;
|
|
41
41
|
};
|
|
42
42
|
const Container = /*#__PURE__*/_styled('div', {
|
|
43
|
-
shouldForwardProp: prop => !['variant', 'size'].includes(prop),
|
|
43
|
+
shouldForwardProp: prop => !['variant', 'size', 'padding'].includes(prop),
|
|
44
44
|
target: "e1kdwp5x1"
|
|
45
45
|
})("padding:", _ref2 => {
|
|
46
46
|
let {
|
|
@@ -100,7 +100,9 @@ const Banner = _ref8 => {
|
|
|
100
100
|
linkText,
|
|
101
101
|
linkHref,
|
|
102
102
|
image,
|
|
103
|
-
className
|
|
103
|
+
className,
|
|
104
|
+
closable = true,
|
|
105
|
+
'data-testid': dataTestId
|
|
104
106
|
} = _ref8;
|
|
105
107
|
const {
|
|
106
108
|
theme
|
|
@@ -112,6 +114,7 @@ const Banner = _ref8 => {
|
|
|
112
114
|
variant: variant,
|
|
113
115
|
size: size,
|
|
114
116
|
className: className,
|
|
117
|
+
"data-testid": dataTestId,
|
|
115
118
|
children: [jsx(ImageStack, {
|
|
116
119
|
size: size,
|
|
117
120
|
justifyContent: "center",
|
|
@@ -165,7 +168,7 @@ const Banner = _ref8 => {
|
|
|
165
168
|
children: linkText
|
|
166
169
|
}) : null]
|
|
167
170
|
})]
|
|
168
|
-
}), jsx(Button, {
|
|
171
|
+
}), closable ? jsx(Button, {
|
|
169
172
|
icon: "close",
|
|
170
173
|
size: "small",
|
|
171
174
|
name: "close",
|
|
@@ -175,7 +178,7 @@ const Banner = _ref8 => {
|
|
|
175
178
|
setOpened(false);
|
|
176
179
|
onClose?.();
|
|
177
180
|
}
|
|
178
|
-
})]
|
|
181
|
+
}) : null]
|
|
179
182
|
});
|
|
180
183
|
};
|
|
181
184
|
|
|
@@ -109,7 +109,9 @@ const FwdMenu = /*#__PURE__*/forwardRef((_ref7, ref) => {
|
|
|
109
109
|
"data-testid": dataTestId,
|
|
110
110
|
className: className,
|
|
111
111
|
role: "menu",
|
|
112
|
-
children: children
|
|
112
|
+
children: typeof children === 'function' ? children({
|
|
113
|
+
toggle: toggleVisible
|
|
114
|
+
}) : children
|
|
113
115
|
}),
|
|
114
116
|
children: finalDisclosure
|
|
115
117
|
});
|
|
@@ -13,7 +13,7 @@ const SIZES_WIDTH = {
|
|
|
13
13
|
};
|
|
14
14
|
const StyledPopup = /*#__PURE__*/_styled(Popup, {
|
|
15
15
|
shouldForwardProp: prop => !['sentiment', 'size'].includes(prop),
|
|
16
|
-
target: "
|
|
16
|
+
target: "ejpxv5a1"
|
|
17
17
|
})("padding:", _ref => {
|
|
18
18
|
let {
|
|
19
19
|
theme
|
|
@@ -55,18 +55,28 @@ const StyledPopup = /*#__PURE__*/_styled(Popup, {
|
|
|
55
55
|
}
|
|
56
56
|
`;
|
|
57
57
|
}, ";");
|
|
58
|
-
|
|
58
|
+
|
|
59
|
+
// This is to avoid having text inherit color from popup (which is white on white background)
|
|
60
|
+
const StyledStack = /*#__PURE__*/_styled(Stack, {
|
|
61
|
+
target: "ejpxv5a0"
|
|
62
|
+
})("color:", _ref5 => {
|
|
63
|
+
let {
|
|
64
|
+
theme
|
|
65
|
+
} = _ref5;
|
|
66
|
+
return theme.colors.neutral.text;
|
|
67
|
+
}, ";");
|
|
68
|
+
const ContentWrapper = _ref6 => {
|
|
59
69
|
let {
|
|
60
70
|
title,
|
|
61
71
|
onClose,
|
|
62
72
|
children,
|
|
63
73
|
sentiment
|
|
64
|
-
} =
|
|
74
|
+
} = _ref6;
|
|
65
75
|
const buttonRef = useRef(null);
|
|
66
76
|
useEffect(() => {
|
|
67
77
|
buttonRef.current?.focus();
|
|
68
78
|
}, []);
|
|
69
|
-
return jsxs(
|
|
79
|
+
return jsxs(StyledStack, {
|
|
70
80
|
gap: 1,
|
|
71
81
|
children: [jsxs(Stack, {
|
|
72
82
|
direction: "row",
|
|
@@ -99,7 +109,7 @@ const ContentWrapper = _ref5 => {
|
|
|
99
109
|
* Popover component is used to display additional information or actions on top of the main content of the page.
|
|
100
110
|
* It is usually triggered by clicking on a button. It includes a title, a close button and a content area.
|
|
101
111
|
*/
|
|
102
|
-
const Popover = /*#__PURE__*/forwardRef((
|
|
112
|
+
const Popover = /*#__PURE__*/forwardRef((_ref7, ref) => {
|
|
103
113
|
let {
|
|
104
114
|
visible = false,
|
|
105
115
|
children,
|
|
@@ -111,7 +121,7 @@ const Popover = /*#__PURE__*/forwardRef((_ref6, ref) => {
|
|
|
111
121
|
onClose,
|
|
112
122
|
className,
|
|
113
123
|
'data-testid': dataTestId
|
|
114
|
-
} =
|
|
124
|
+
} = _ref7;
|
|
115
125
|
const innerRef = useRef(null);
|
|
116
126
|
const [localVisible, setLocalVisible] = useState(visible);
|
|
117
127
|
|
|
@@ -99,26 +99,31 @@ const TagInputContainer = /*#__PURE__*/_styled('div', {
|
|
|
99
99
|
}, ";");
|
|
100
100
|
const StyledInput = /*#__PURE__*/_styled("input", {
|
|
101
101
|
target: "ea7vc6o0"
|
|
102
|
-
})("font-size:
|
|
102
|
+
})("display:flex;flex:1;font-size:", _ref6 => {
|
|
103
|
+
let {
|
|
104
|
+
theme
|
|
105
|
+
} = _ref6;
|
|
106
|
+
return theme.typography.body.fontSize;
|
|
107
|
+
}, ";color:", _ref7 => {
|
|
103
108
|
let {
|
|
104
109
|
theme: {
|
|
105
110
|
colors
|
|
106
111
|
}
|
|
107
|
-
} =
|
|
112
|
+
} = _ref7;
|
|
108
113
|
return colors.neutral.text;
|
|
109
|
-
}, ";border:none;outline:none;background-color:",
|
|
114
|
+
}, ";border:none;outline:none;background-color:", _ref8 => {
|
|
110
115
|
let {
|
|
111
116
|
theme: {
|
|
112
117
|
colors
|
|
113
118
|
}
|
|
114
|
-
} =
|
|
119
|
+
} = _ref8;
|
|
115
120
|
return colors.neutral.background;
|
|
116
|
-
}, ";&::placeholder{color:",
|
|
121
|
+
}, ";&::placeholder{color:", _ref9 => {
|
|
117
122
|
let {
|
|
118
123
|
theme: {
|
|
119
124
|
colors
|
|
120
125
|
}
|
|
121
|
-
} =
|
|
126
|
+
} = _ref9;
|
|
122
127
|
return colors.neutral.textWeak;
|
|
123
128
|
}, ";}");
|
|
124
129
|
const convertTagArrayToTagStateArray = tags => (tags || [])?.map((tag, index) => typeof tag === 'object' ? {
|
|
@@ -132,7 +137,7 @@ const convertTagArrayToTagStateArray = tags => (tags || [])?.map((tag, index) =>
|
|
|
132
137
|
* TagInput is a component that allows users to input tags.
|
|
133
138
|
* @experimental This component is experimental and may be subject to breaking changes in the future.
|
|
134
139
|
*/
|
|
135
|
-
const TagInput =
|
|
140
|
+
const TagInput = _ref10 => {
|
|
136
141
|
let {
|
|
137
142
|
disabled = false,
|
|
138
143
|
id,
|
|
@@ -145,7 +150,7 @@ const TagInput = _ref9 => {
|
|
|
145
150
|
variant = 'base',
|
|
146
151
|
className,
|
|
147
152
|
'data-testid': dataTestId
|
|
148
|
-
} =
|
|
153
|
+
} = _ref10;
|
|
149
154
|
const [tagInputState, setTagInput] = useState(convertTagArrayToTagStateArray(tags ?? []));
|
|
150
155
|
const [input, setInput] = useState('');
|
|
151
156
|
const [status, setStatus] = useState({});
|
|
@@ -189,10 +194,10 @@ const TagInput = _ref9 => {
|
|
|
189
194
|
setStatus({
|
|
190
195
|
[tagIndex]: STATUS.LOADING
|
|
191
196
|
});
|
|
192
|
-
const findIndex = tagInputState.findIndex(
|
|
197
|
+
const findIndex = tagInputState.findIndex(_ref11 => {
|
|
193
198
|
let {
|
|
194
199
|
index
|
|
195
|
-
} =
|
|
200
|
+
} = _ref11;
|
|
196
201
|
return index === tagIndex;
|
|
197
202
|
});
|
|
198
203
|
const newTagInput = [...tagInputState];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultraviolet/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"description": "Ultraviolet UI",
|
|
5
5
|
"homepage": "https://github.com/scaleway/ultraviolet#readme",
|
|
6
6
|
"repository": {
|
|
@@ -67,7 +67,7 @@
|
|
|
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.
|
|
70
|
+
"@ultraviolet/icons": "2.5.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "rollup -c ../../rollup.config.mjs"
|