@digital-ai/dot-components 4.4.2 → 4.5.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/index.esm.js +18 -4
- package/package.json +1 -1
- package/src/lib/hooks/useKeyPress.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -237,6 +237,10 @@ const StyledTextField = styled(TextField)`
|
|
|
237
237
|
}
|
|
238
238
|
.MuiOutlinedInput-input {
|
|
239
239
|
padding: ${InputProps.startAdornment ? `18px 12px 18px 0px` : `18px 12px`};
|
|
240
|
+
&::placeholder {
|
|
241
|
+
opacity: 1;
|
|
242
|
+
color: ${theme.palette.figma.typography.gray};
|
|
243
|
+
}
|
|
240
244
|
}
|
|
241
245
|
.MuiInputBase-inputSizeSmall {
|
|
242
246
|
padding-top: 10.5px;
|
|
@@ -303,8 +307,13 @@ const StyledTextField = styled(TextField)`
|
|
|
303
307
|
}
|
|
304
308
|
}
|
|
305
309
|
|
|
310
|
+
.MuiInputLabel-root,
|
|
306
311
|
.MuiInputLabel-root.Mui-error {
|
|
307
|
-
color: ${theme.palette.figma.typography.
|
|
312
|
+
color: ${theme.palette.figma.typography.gray};
|
|
313
|
+
|
|
314
|
+
&.MuiInputLabel-shrink {
|
|
315
|
+
color: ${theme.palette.figma.typography.black};
|
|
316
|
+
}
|
|
308
317
|
}
|
|
309
318
|
|
|
310
319
|
.MuiInputBase-root {
|
|
@@ -4231,12 +4240,17 @@ const DotClickAwayListener = ({
|
|
|
4231
4240
|
});
|
|
4232
4241
|
};
|
|
4233
4242
|
|
|
4243
|
+
const TYPEABLE_INPUTS_TYPES = ['date', 'datetime-local', 'email', 'month', 'number', 'password', 'search', 'tel', 'text', 'time', 'url', 'week'];
|
|
4244
|
+
const isTypableElement = element => {
|
|
4245
|
+
const type = element.getAttribute('type');
|
|
4246
|
+
return element.nodeName === 'TEXTAREA' || element.nodeName === 'INPUT' && (!type || TYPEABLE_INPUTS_TYPES.includes(type));
|
|
4247
|
+
};
|
|
4234
4248
|
const useKeyPress = (key, callback, dependencies) => {
|
|
4235
4249
|
useEffect(() => {
|
|
4236
4250
|
if (!key) return;
|
|
4237
4251
|
const handleKeyPress = event => {
|
|
4238
4252
|
const element = event.target;
|
|
4239
|
-
if (event.key === key && !
|
|
4253
|
+
if (event.key === key && !isTypableElement(element) && !element.isContentEditable) {
|
|
4240
4254
|
callback();
|
|
4241
4255
|
}
|
|
4242
4256
|
};
|
|
@@ -12513,7 +12527,7 @@ function DotDashboardBanner({
|
|
|
12513
12527
|
});
|
|
12514
12528
|
}
|
|
12515
12529
|
function getDashboardBanner(dashboard, isEdit, onExitEditMode, onPublishChanges, currentUser, modifiedAuthorUser) {
|
|
12516
|
-
if (dashboard.is_being_modified && currentUser) {
|
|
12530
|
+
if (dashboard.is_being_modified && currentUser && isEdit) {
|
|
12517
12531
|
if (dashboard.modified_author_id === currentUser.id) {
|
|
12518
12532
|
// We're in Edit mode for a published dashboard, and the dashboard is being modified by the current user.
|
|
12519
12533
|
return jsx(DotDashboardBanner, {
|
|
@@ -12762,7 +12776,7 @@ const DotEmptyFilterState = ({
|
|
|
12762
12776
|
ariaLabel,
|
|
12763
12777
|
className,
|
|
12764
12778
|
'data-testid': dataTestId,
|
|
12765
|
-
illustrationId = '
|
|
12779
|
+
illustrationId = 'no-filters',
|
|
12766
12780
|
imageAltText = 'no results found'
|
|
12767
12781
|
}) => {
|
|
12768
12782
|
return jsx(DotEmptyState, {
|
package/package.json
CHANGED