@hitachivantara/uikit-react-core 5.19.0 → 5.19.2
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/cjs/components/Dialog/Actions/Actions.cjs +14 -7
- package/dist/cjs/components/Dialog/Actions/Actions.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Actions/Actions.styles.cjs +18 -38
- package/dist/cjs/components/Dialog/Actions/Actions.styles.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Content/Content.cjs +11 -6
- package/dist/cjs/components/Dialog/Content/Content.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Content/Content.styles.cjs +13 -32
- package/dist/cjs/components/Dialog/Content/Content.styles.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.cjs +55 -53
- package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.styles.cjs +0 -31
- package/dist/cjs/components/Dialog/Dialog.styles.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Title/Title.cjs +22 -11
- package/dist/cjs/components/Dialog/Title/Title.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Title/Title.styles.cjs +18 -64
- package/dist/cjs/components/Dialog/Title/Title.styles.cjs.map +1 -1
- package/dist/cjs/components/Drawer/Drawer.cjs +4 -5
- package/dist/cjs/components/Drawer/Drawer.cjs.map +1 -1
- package/dist/cjs/components/InlineEditor/InlineEditor.cjs +5 -10
- package/dist/cjs/components/InlineEditor/InlineEditor.cjs.map +1 -1
- package/dist/cjs/components/Input/Input.cjs +10 -10
- package/dist/cjs/components/Input/Input.cjs.map +1 -1
- package/dist/cjs/components/Pagination/Pagination.cjs.map +1 -1
- package/dist/cjs/components/QueryBuilder/QueryBuilder.cjs.map +1 -1
- package/dist/cjs/components/Snackbar/SnackbarContentWrapper/SnackbarContentWrapper.cjs.map +1 -1
- package/dist/cjs/components/Snackbar/SnackbarProvider/SnackbarProvider.cjs +1 -1
- package/dist/cjs/components/Snackbar/SnackbarProvider/SnackbarProvider.cjs.map +1 -1
- package/dist/cjs/components/Table/TableCell/TableCell.cjs +6 -6
- package/dist/cjs/components/Table/TableCell/TableCell.cjs.map +1 -1
- package/dist/cjs/components/Table/TableRow/TableRow.cjs +6 -5
- package/dist/cjs/components/Table/TableRow/TableRow.cjs.map +1 -1
- package/dist/cjs/index.cjs +10 -10
- package/dist/cjs/utils/theme.cjs +6 -7
- package/dist/cjs/utils/theme.cjs.map +1 -1
- package/dist/esm/components/Dialog/Actions/Actions.js +15 -9
- package/dist/esm/components/Dialog/Actions/Actions.js.map +1 -1
- package/dist/esm/components/Dialog/Actions/Actions.styles.js +18 -35
- package/dist/esm/components/Dialog/Actions/Actions.styles.js.map +1 -1
- package/dist/esm/components/Dialog/Content/Content.js +14 -8
- package/dist/esm/components/Dialog/Content/Content.js.map +1 -1
- package/dist/esm/components/Dialog/Content/Content.styles.js +13 -30
- package/dist/esm/components/Dialog/Content/Content.styles.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +55 -54
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.styles.js +0 -29
- package/dist/esm/components/Dialog/Dialog.styles.js.map +1 -1
- package/dist/esm/components/Dialog/Title/Title.js +23 -13
- package/dist/esm/components/Dialog/Title/Title.js.map +1 -1
- package/dist/esm/components/Dialog/Title/Title.styles.js +18 -61
- package/dist/esm/components/Dialog/Title/Title.styles.js.map +1 -1
- package/dist/esm/components/Drawer/Drawer.js +4 -5
- package/dist/esm/components/Drawer/Drawer.js.map +1 -1
- package/dist/esm/components/InlineEditor/InlineEditor.js +5 -10
- package/dist/esm/components/InlineEditor/InlineEditor.js.map +1 -1
- package/dist/esm/components/Input/Input.js +10 -10
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/QueryBuilder/QueryBuilder.js.map +1 -1
- package/dist/esm/components/Snackbar/SnackbarContentWrapper/SnackbarContentWrapper.js.map +1 -1
- package/dist/esm/components/Snackbar/SnackbarProvider/SnackbarProvider.js +1 -1
- package/dist/esm/components/Snackbar/SnackbarProvider/SnackbarProvider.js.map +1 -1
- package/dist/esm/components/Table/TableCell/TableCell.js +6 -6
- package/dist/esm/components/Table/TableCell/TableCell.js.map +1 -1
- package/dist/esm/components/Table/TableRow/TableRow.js +6 -5
- package/dist/esm/components/Table/TableRow/TableRow.js.map +1 -1
- package/dist/esm/index.js +218 -218
- package/dist/esm/utils/theme.js +6 -7
- package/dist/esm/utils/theme.js.map +1 -1
- package/dist/types/index.d.ts +144 -120
- package/package.json +5 -5
- package/dist/cjs/components/Dialog/Actions/actionsClasses.cjs +0 -8
- package/dist/cjs/components/Dialog/Actions/actionsClasses.cjs.map +0 -1
- package/dist/cjs/components/Dialog/Content/contentClasses.cjs +0 -8
- package/dist/cjs/components/Dialog/Content/contentClasses.cjs.map +0 -1
- package/dist/cjs/components/Dialog/Title/titleClasses.cjs +0 -8
- package/dist/cjs/components/Dialog/Title/titleClasses.cjs.map +0 -1
- package/dist/esm/components/Dialog/Actions/actionsClasses.js +0 -8
- package/dist/esm/components/Dialog/Actions/actionsClasses.js.map +0 -1
- package/dist/esm/components/Dialog/Content/contentClasses.js +0 -8
- package/dist/esm/components/Dialog/Content/contentClasses.js.map +0 -1
- package/dist/esm/components/Dialog/Title/titleClasses.js +0 -8
- package/dist/esm/components/Dialog/Title/titleClasses.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import MuiDialogTitle from "@mui/material/DialogTitle";
|
|
2
|
+
import { useClasses } from "./Title.styles.js";
|
|
3
|
+
import { staticClasses } from "./Title.styles.js";
|
|
4
4
|
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
5
5
|
import iconVariant from "../../../utils/iconVariant.js";
|
|
6
6
|
import { useTheme } from "../../../hooks/useTheme.js";
|
|
7
7
|
import { HvTypography } from "../../Typography/Typography.js";
|
|
8
8
|
const HvDialogTitle = ({
|
|
9
|
-
classes,
|
|
9
|
+
classes: classesProp,
|
|
10
10
|
className,
|
|
11
11
|
children,
|
|
12
12
|
variant = "default",
|
|
@@ -14,6 +14,11 @@ const HvDialogTitle = ({
|
|
|
14
14
|
customIcon = null,
|
|
15
15
|
...others
|
|
16
16
|
}) => {
|
|
17
|
+
const {
|
|
18
|
+
classes,
|
|
19
|
+
css,
|
|
20
|
+
cx
|
|
21
|
+
} = useClasses(classesProp);
|
|
17
22
|
const {
|
|
18
23
|
activeTheme
|
|
19
24
|
} = useTheme();
|
|
@@ -23,15 +28,19 @@ const HvDialogTitle = ({
|
|
|
23
28
|
} = others;
|
|
24
29
|
delete others.fullscreen;
|
|
25
30
|
const icon = customIcon || showIcon && iconVariant(variant);
|
|
26
|
-
return /* @__PURE__ */ jsx(
|
|
27
|
-
className:
|
|
28
|
-
|
|
31
|
+
return /* @__PURE__ */ jsx(MuiDialogTitle, {
|
|
32
|
+
className: cx(!fullscreen && css({
|
|
33
|
+
flex: 1
|
|
34
|
+
}), classes.root, {
|
|
35
|
+
[classes.fullscreen]: fullscreen
|
|
36
|
+
}, className),
|
|
29
37
|
...others,
|
|
30
|
-
children: /* @__PURE__ */ jsxs(
|
|
31
|
-
className:
|
|
32
|
-
children: [icon, /* @__PURE__ */ jsxs(
|
|
33
|
-
className:
|
|
34
|
-
|
|
38
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
39
|
+
className: classes.messageContainer,
|
|
40
|
+
children: [icon, /* @__PURE__ */ jsxs("div", {
|
|
41
|
+
className: cx({
|
|
42
|
+
[classes.textWithIcon]: !!icon
|
|
43
|
+
}),
|
|
35
44
|
children: [!isString && children, isString && /* @__PURE__ */ jsx(HvTypography, {
|
|
36
45
|
variant: activeTheme == null ? void 0 : activeTheme.dialog.titleVariant,
|
|
37
46
|
children
|
|
@@ -41,6 +50,7 @@ const HvDialogTitle = ({
|
|
|
41
50
|
});
|
|
42
51
|
};
|
|
43
52
|
export {
|
|
44
|
-
HvDialogTitle
|
|
53
|
+
HvDialogTitle,
|
|
54
|
+
staticClasses as dialogTitleClasses
|
|
45
55
|
};
|
|
46
56
|
//# sourceMappingURL=Title.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Title.js","sources":["../../../../../src/components/Dialog/Title/Title.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Title.js","sources":["../../../../../src/components/Dialog/Title/Title.tsx"],"sourcesContent":["import MuiDialogTitle, {\n DialogTitleProps as MuiDialogTitleProps,\n} from \"@mui/material/DialogTitle\";\n\nimport { HvTypography } from \"@core/components\";\nimport { HvBaseProps } from \"@core/types\";\nimport { ExtractNames, iconVariant } from \"@core/utils\";\nimport { useTheme } from \"@core/hooks\";\n\nimport { staticClasses, useClasses } from \"./Title.styles\";\n\nexport { staticClasses as dialogTitleClasses };\n\nexport type HvDialogTitleClasses = ExtractNames<typeof useClasses>;\n\nexport type HvDialogTitleVariant =\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\"\n | \"default\";\n\nexport interface HvDialogTitleProps\n extends Omit<MuiDialogTitleProps, \"variant\" | \"classes\">,\n HvBaseProps<HTMLSpanElement, \"color\"> {\n /** Variant of the Dialog. */\n variant?: HvDialogTitleVariant;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n classes?: HvDialogTitleClasses;\n}\n\nexport const HvDialogTitle = ({\n classes: classesProp,\n className,\n children,\n variant = \"default\",\n showIcon = true,\n customIcon = null,\n ...others\n}: HvDialogTitleProps) => {\n const { classes, css, cx } = useClasses(classesProp);\n\n const { activeTheme } = useTheme();\n\n const isString = typeof children === \"string\";\n\n const { fullscreen } = others as any;\n delete (others as any).fullscreen;\n\n const icon = customIcon || (showIcon && iconVariant(variant));\n\n return (\n <MuiDialogTitle\n className={cx(\n !fullscreen && css({ flex: 1 }),\n classes.root,\n {\n [classes.fullscreen]: fullscreen,\n },\n className\n )}\n {...others}\n >\n <div className={classes.messageContainer}>\n {icon}\n <div className={cx({ [classes.textWithIcon]: !!icon })}>\n {!isString && children}\n {isString && (\n <HvTypography variant={activeTheme?.dialog.titleVariant}>\n {children}\n </HvTypography>\n )}\n </div>\n </div>\n </MuiDialogTitle>\n );\n};\n"],"names":["HvDialogTitle","classes","classesProp","className","children","variant","showIcon","customIcon","others","css","cx","useClasses","activeTheme","useTheme","isString","fullscreen","icon","iconVariant","MuiDialogTitle","flex","root","messageContainer","_jsxs","textWithIcon","HvTypography","dialog","titleVariant"],"mappings":";;;;;;;AAkCO,MAAMA,gBAAgBA,CAAC;AAAA,EAC5BC,SAASC;AAAAA,EACTC;AAAAA,EACAC;AAAAA,EACAC,UAAU;AAAA,EACVC,WAAW;AAAA,EACXC,aAAa;AAAA,EACb,GAAGC;AACe,MAAM;AAClB,QAAA;AAAA,IAAEP;AAAAA,IAASQ;AAAAA,IAAKC;AAAAA,EAAAA,IAAOC,WAAWT,WAAW;AAE7C,QAAA;AAAA,IAAEU;AAAAA,MAAgBC,SAAS;AAE3BC,QAAAA,WAAW,OAAOV,aAAa;AAE/B,QAAA;AAAA,IAAEW;AAAAA,EAAeP,IAAAA;AACvB,SAAQA,OAAeO;AAEvB,QAAMC,OAAOT,cAAeD,YAAYW,YAAYZ,OAAO;AAE3D,6BACGa,gBAAc;AAAA,IACbf,WAAWO,GACT,CAACK,cAAcN,IAAI;AAAA,MAAEU,MAAM;AAAA,IAAA,CAAG,GAC9BlB,QAAQmB,MACR;AAAA,MACE,CAACnB,QAAQc,UAAU,GAAGA;AAAAA,OAExBZ,SACF;AAAA,IAAE,GACEK;AAAAA,IAAMJ,+BAEV,OAAA;AAAA,MAAKD,WAAWF,QAAQoB;AAAAA,MAAiBjB,UAAA,CACtCY,MACDM,qBAAA,OAAA;AAAA,QAAKnB,WAAWO,GAAG;AAAA,UAAE,CAACT,QAAQsB,YAAY,GAAG,CAAC,CAACP;AAAAA,QAAAA,CAAM;AAAA,QAAEZ,UAAA,CACpD,CAACU,YAAYV,UACbU,gCACEU,cAAY;AAAA,UAACnB,SAASO,2CAAaa,OAAOC;AAAAA,UAAatB;AAAAA,QAAAA,CAE1C,CACf;AAAA,MAAA,CACE,CAAC;AAAA,IAAA,CACH;AAAA,EAAA,CACS;AAEpB;"}
|
|
@@ -1,69 +1,26 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
1
|
import { theme } from "@hitachivantara/uikit-styles";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
return _extends.apply(this, arguments);
|
|
21
|
-
}
|
|
22
|
-
const StyledTitle = /* @__PURE__ */ _styled(DialogTitle, process.env.NODE_ENV === "production" ? _extends({}, {
|
|
23
|
-
target: "eo9hglt2"
|
|
24
|
-
}, transientOptions) : _extends({}, {
|
|
25
|
-
target: "eo9hglt2",
|
|
26
|
-
label: "StyledTitle"
|
|
27
|
-
}, transientOptions))(({
|
|
28
|
-
$fullscreen
|
|
29
|
-
}) => ({
|
|
30
|
-
padding: theme.space.sm,
|
|
31
|
-
margin: 0,
|
|
32
|
-
...!$fullscreen && {
|
|
33
|
-
flex: 1
|
|
34
|
-
}
|
|
35
|
-
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvRGlhbG9nL1RpdGxlL1RpdGxlLnN0e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KCh7ICRoYXNJY29uIH06IHsgJGhhc0ljb246IGJvb2xlYW4gfSkgPT4gKHtcbiAgLi4uKCRoYXNJY29uICYmIHtcbiAgICBtYXJnaW5MZWZ0OiB0aGVtZS5zcGFjZS54cyxcbiAgICAvLyAzMnB4IGlzIHRoZSBpY29uIHdpZHRoXG4gICAgbWFyZ2luUmlnaHQ6IGBjYWxjKDMycHggKyAke3RoZW1lLnNwYWNlLnhzfSlgLFxuICB9KSxcbn0pKTtcbiJdfQ== */");
|
|
36
|
-
const StyledMessageContainer = /* @__PURE__ */ _styled("div", process.env.NODE_ENV === "production" ? {
|
|
37
|
-
target: "eo9hglt1"
|
|
38
|
-
} : {
|
|
39
|
-
target: "eo9hglt1",
|
|
40
|
-
label: "StyledMessageContainer"
|
|
41
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
42
|
-
name: "s5xdrg",
|
|
43
|
-
styles: "display:flex;align-items:center"
|
|
44
|
-
} : {
|
|
45
|
-
name: "s5xdrg",
|
|
46
|
-
styles: "display:flex;align-items:center",
|
|
47
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvRGlhbG9nL1RpdGxlL1RpdGxlLnN0eWxlcy50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0JzQyIsImZpbGUiOiIvaG9tZS9ydW5uZXIvd29yay9odi11aWtpdC1yZWFjdC9odi11aWtpdC1yZWFjdC9wYWNrYWdlcy9jb3JlL3NyYy9jb21wb25lbnRzL0RpYWxvZy9UaXRsZS9UaXRsZS5zdHlsZXMudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tIFwiQGVtb3Rpb24vc3R5bGVkXCI7XG5pbXBvcnQg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STRINGIFIED_CSS_ERROR__
|
|
49
|
-
});
|
|
50
|
-
const StyledTextWithIcon = /* @__PURE__ */ _styled("div", process.env.NODE_ENV === "production" ? _extends({}, {
|
|
51
|
-
target: "eo9hglt0"
|
|
52
|
-
}, transientOptions) : _extends({}, {
|
|
53
|
-
target: "eo9hglt0",
|
|
54
|
-
label: "StyledTextWithIcon"
|
|
55
|
-
}, transientOptions))(({
|
|
56
|
-
$hasIcon
|
|
57
|
-
}) => ({
|
|
58
|
-
...$hasIcon && {
|
|
2
|
+
import { createClasses } from "../../../utils/classes.js";
|
|
3
|
+
const {
|
|
4
|
+
staticClasses,
|
|
5
|
+
useClasses
|
|
6
|
+
} = createClasses("HvDialog-Title", {
|
|
7
|
+
root: {
|
|
8
|
+
padding: theme.space.sm,
|
|
9
|
+
margin: 0
|
|
10
|
+
},
|
|
11
|
+
fullscreen: {},
|
|
12
|
+
messageContainer: {
|
|
13
|
+
display: "flex",
|
|
14
|
+
alignItems: "center"
|
|
15
|
+
},
|
|
16
|
+
textWithIcon: {
|
|
59
17
|
marginLeft: theme.space.xs,
|
|
60
18
|
// 32px is the icon width
|
|
61
19
|
marginRight: `calc(32px + ${theme.space.xs})`
|
|
62
20
|
}
|
|
63
|
-
})
|
|
21
|
+
});
|
|
64
22
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
StyledTitle
|
|
23
|
+
staticClasses,
|
|
24
|
+
useClasses
|
|
68
25
|
};
|
|
69
26
|
//# sourceMappingURL=Title.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Title.styles.js","sources":["../../../../../src/components/Dialog/Title/Title.styles.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Title.styles.js","sources":["../../../../../src/components/Dialog/Title/Title.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"@core/utils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDialog-Title\", {\n root: { padding: theme.space.sm, margin: 0 },\n fullscreen: {},\n messageContainer: { display: \"flex\", alignItems: \"center\" },\n textWithIcon: {\n marginLeft: theme.space.xs,\n // 32px is the icon width\n marginRight: `calc(32px + ${theme.space.xs})`,\n },\n});\n"],"names":["staticClasses","useClasses","createClasses","root","padding","theme","space","sm","margin","fullscreen","messageContainer","display","alignItems","textWithIcon","marginLeft","xs","marginRight"],"mappings":";;AAIa,MAAA;AAAA,EAAEA;AAAAA,EAAeC;AAAW,IAAIC,cAAc,kBAAkB;AAAA,EAC3EC,MAAM;AAAA,IAAEC,SAASC,MAAMC,MAAMC;AAAAA,IAAIC,QAAQ;AAAA,EAAE;AAAA,EAC3CC,YAAY,CAAC;AAAA,EACbC,kBAAkB;AAAA,IAAEC,SAAS;AAAA,IAAQC,YAAY;AAAA,EAAS;AAAA,EAC1DC,cAAc;AAAA,IACZC,YAAYT,MAAMC,MAAMS;AAAAA;AAAAA,IAExBC,aAAc,eAAcX,MAAMC,MAAMS;AAAAA,EAC1C;AACF,CAAC;"}
|
|
@@ -26,7 +26,6 @@ const HvDrawer = ({
|
|
|
26
26
|
buttonTitle = "Close",
|
|
27
27
|
...others
|
|
28
28
|
}) => {
|
|
29
|
-
var _a;
|
|
30
29
|
const {
|
|
31
30
|
classes,
|
|
32
31
|
css,
|
|
@@ -34,18 +33,18 @@ const HvDrawer = ({
|
|
|
34
33
|
} = useClasses(classesProp);
|
|
35
34
|
const {
|
|
36
35
|
activeTheme,
|
|
37
|
-
|
|
36
|
+
rootId
|
|
38
37
|
} = useTheme();
|
|
39
|
-
const [backgroundColorValue, setBackgroundColorValue] = useState(getVarValue(theme.drawer.backDropBackgroundColor));
|
|
38
|
+
const [backgroundColorValue, setBackgroundColorValue] = useState(getVarValue(theme.drawer.backDropBackgroundColor, rootId) || "");
|
|
40
39
|
const closeButtonDisplay = () => /* @__PURE__ */ jsx(Close, {
|
|
41
40
|
role: "presentation"
|
|
42
41
|
});
|
|
43
42
|
const CloseButtonTooltipWrapper = buttonTitle ? withTooltip(closeButtonDisplay, buttonTitle, "top") : closeButtonDisplay;
|
|
44
43
|
const [backgroundColor, setBackgroundColor] = useState(getBackgroundColor(backgroundColorValue));
|
|
45
44
|
useEffect(() => {
|
|
46
|
-
setBackgroundColorValue(getVarValue(theme.drawer.backDropBackgroundColor));
|
|
45
|
+
setBackgroundColorValue(getVarValue(theme.drawer.backDropBackgroundColor, rootId) || (activeTheme == null ? void 0 : activeTheme.drawer.backDropBackgroundColor) || "");
|
|
47
46
|
setBackgroundColor(getBackgroundColor(backgroundColorValue));
|
|
48
|
-
}, [
|
|
47
|
+
}, [activeTheme == null ? void 0 : activeTheme.colors.modes.selectedMode, backgroundColorValue, setBackgroundColor, rootId, activeTheme == null ? void 0 : activeTheme.drawer.backDropBackgroundColor]);
|
|
49
48
|
return /* @__PURE__ */ jsxs(Drawer, {
|
|
50
49
|
className: cx(classes.root, className),
|
|
51
50
|
id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","sources":["../../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import {\n Drawer as MuiDrawer,\n DrawerProps as MuiDrawerProps,\n} from \"@mui/material\";\nimport { Close } from \"@hitachivantara/uikit-react-icons\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { withTooltip } from \"@core/hocs\";\nimport {\n
|
|
1
|
+
{"version":3,"file":"Drawer.js","sources":["../../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import {\n Drawer as MuiDrawer,\n DrawerProps as MuiDrawerProps,\n} from \"@mui/material\";\nimport { Close } from \"@hitachivantara/uikit-react-icons\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { withTooltip } from \"@core/hocs\";\nimport {\n hexToRgbA,\n setId,\n checkValidHexColorValue,\n ExtractNames,\n getVarValue,\n} from \"@core/utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\nimport { HvButton } from \"@core/components\";\nimport { useEffect, useState } from \"react\";\nimport { useTheme } from \"@core/hooks\";\nimport { staticClasses, useClasses } from \"./Drawer.styles\";\n\nexport { staticClasses as drawerClasses };\n\nexport type HvDrawerClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvDrawerProps\n extends MuiDrawerProps,\n Omit<MuiDrawerProps, \"classes\">,\n HvBaseProps<HTMLDivElement> {\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes?: HvDrawerClasses;\n /**\n * Components of the Drawer.\n */\n children?: React.ReactNode;\n /**\n * Current state of the Drawer.\n */\n open?: boolean;\n /**\n * Function executed on close.\n * Extended from Modal from material-ui\n *\n */\n onClose?: (\n event: React.SyntheticEvent,\n reason?: \"escapeKeyDown\" | \"backdropClick\"\n ) => void;\n /**\n * The side the drawer opens from.\n */\n anchor?: \"left\" | \"top\" | \"right\" | \"bottom\";\n /**\n * Title for the button close.\n */\n buttonTitle?: string;\n}\n\nconst getBackgroundColor = (color: string) => {\n return checkValidHexColorValue(color) ? hexToRgbA(color, 0.8) : color;\n};\n\n/**\n * The Drawer component provides a foundation to create a sliding pane.\n * It only provides the pane with a close button, the rest of the\n * content can be customized.\n */\nexport const HvDrawer = ({\n className,\n classes: classesProp,\n id,\n children,\n open,\n onClose,\n anchor = \"right\",\n buttonTitle = \"Close\",\n ...others\n}: HvDrawerProps) => {\n const { classes, css, cx } = useClasses(classesProp);\n const { activeTheme, rootId } = useTheme();\n\n const [backgroundColorValue, setBackgroundColorValue] = useState<string>(\n getVarValue(theme.drawer.backDropBackgroundColor, rootId) || \"\"\n );\n\n const closeButtonDisplay = () => <Close role=\"presentation\" />;\n\n const CloseButtonTooltipWrapper = buttonTitle\n ? withTooltip(closeButtonDisplay, buttonTitle, \"top\")\n : closeButtonDisplay;\n\n const [backgroundColor, setBackgroundColor] = useState(\n getBackgroundColor(backgroundColorValue)\n );\n\n useEffect(() => {\n setBackgroundColorValue(\n getVarValue(theme.drawer.backDropBackgroundColor, rootId) ||\n activeTheme?.drawer.backDropBackgroundColor ||\n \"\"\n );\n\n setBackgroundColor(getBackgroundColor(backgroundColorValue));\n }, [\n activeTheme?.colors.modes.selectedMode,\n backgroundColorValue,\n setBackgroundColor,\n rootId,\n activeTheme?.drawer.backDropBackgroundColor,\n ]);\n\n return (\n <MuiDrawer\n className={cx(classes.root, className)}\n id={id}\n anchor={anchor}\n open={open}\n PaperProps={{\n classes: {\n root: classes.paper,\n },\n }}\n BackdropProps={{\n classes: {\n root: cx(css({ backgroundColor }), classes.background),\n },\n }}\n onClose={onClose}\n {...others}\n >\n <HvButton\n id={setId(id, \"close\")}\n className={classes.closeButton}\n variant=\"primaryGhost\"\n onClick={onClose}\n aria-label={buttonTitle}\n >\n <CloseButtonTooltipWrapper />\n </HvButton>\n {children}\n </MuiDrawer>\n );\n};\n"],"names":["getBackgroundColor","color","checkValidHexColorValue","hexToRgbA","HvDrawer","className","classes","classesProp","id","children","open","onClose","anchor","buttonTitle","others","css","cx","useClasses","activeTheme","rootId","useTheme","backgroundColorValue","setBackgroundColorValue","useState","getVarValue","theme","drawer","backDropBackgroundColor","closeButtonDisplay","_jsx","Close","role","CloseButtonTooltipWrapper","withTooltip","backgroundColor","setBackgroundColor","useEffect","colors","modes","selectedMode","MuiDrawer","root","PaperProps","paper","BackdropProps","background","HvButton","setId","closeButton","variant","onClick"],"mappings":";;;;;;;;;;;;;;AAmEA,MAAMA,qBAAqBA,CAACC,UAAkB;AAC5C,SAAOC,wBAAwBD,KAAK,IAAIE,KAAUF,OAAO,GAAG,IAAIA;AAClE;AAOO,MAAMG,WAAWA,CAAC;AAAA,EACvBC;AAAAA,EACAC,SAASC;AAAAA,EACTC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,SAAS;AAAA,EACTC,cAAc;AAAA,EACd,GAAGC;AACU,MAAM;AACb,QAAA;AAAA,IAAER;AAAAA,IAASS;AAAAA,IAAKC;AAAAA,EAAAA,IAAOC,WA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cAAYE;AAAAA,MAAYJ,UAExBoB,oBAACG,2BAA2B,EAAA;AAAA,IACpB,CAAA,GACTvB,QAAQ;AAAA,EAAA,CACA;AAEf;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useRef, useLayoutEffect } from "react";
|
|
2
|
-
import { theme } from "@hitachivantara/uikit-styles";
|
|
3
2
|
import { Edit } from "@hitachivantara/uikit-react-icons";
|
|
3
|
+
import { useTheme } from "@hitachivantara/uikit-react-core";
|
|
4
4
|
import { useClasses } from "./InlineEditor.styles.js";
|
|
5
5
|
import { staticClasses } from "./InlineEditor.styles.js";
|
|
6
6
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
@@ -8,16 +8,8 @@ import { useControlled } from "../../hooks/useControlled.js";
|
|
|
8
8
|
import { HvInput } from "../Input/Input.js";
|
|
9
9
|
import { HvButton } from "../Button/Button.js";
|
|
10
10
|
import { HvTypography } from "../Typography/Typography.js";
|
|
11
|
-
import { getVarValue } from "../../utils/theme.js";
|
|
12
11
|
import { isKeypress } from "../../utils/keyboardUtils/keyCheck.js";
|
|
13
12
|
import { keyboardCodes } from "../../utils/keyboardUtils/keyboardCodes.js";
|
|
14
|
-
const getTypographyStyles = (typography) => {
|
|
15
|
-
const typographyStyles = {};
|
|
16
|
-
Object.keys(typography).forEach((k) => {
|
|
17
|
-
typographyStyles[k] = getVarValue(typography[k]);
|
|
18
|
-
});
|
|
19
|
-
return typographyStyles;
|
|
20
|
-
};
|
|
21
13
|
const HvInlineEditor = ({
|
|
22
14
|
className,
|
|
23
15
|
classes: classesProp,
|
|
@@ -42,7 +34,10 @@ const HvInlineEditor = ({
|
|
|
42
34
|
const [editMode, setEditMode] = useState(false);
|
|
43
35
|
const [cachedValue, setCachedValue] = useState(value);
|
|
44
36
|
const inputRef = useRef();
|
|
45
|
-
const
|
|
37
|
+
const {
|
|
38
|
+
activeTheme
|
|
39
|
+
} = useTheme();
|
|
40
|
+
const typographyStyles = (activeTheme == null ? void 0 : activeTheme.typography[variant]) || {};
|
|
46
41
|
const {
|
|
47
42
|
lineHeight
|
|
48
43
|
} = typographyStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineEditor.js","sources":["../../../../src/components/InlineEditor/InlineEditor.tsx"],"sourcesContent":["import React, { useLayoutEffect, useRef, useState } from \"react\";\nimport { HvBaseProps } from \"@core/types\";\nimport { useControlled } from \"@core/hooks\";\nimport {
|
|
1
|
+
{"version":3,"file":"InlineEditor.js","sources":["../../../../src/components/InlineEditor/InlineEditor.tsx"],"sourcesContent":["import React, { useLayoutEffect, useRef, useState } from \"react\";\nimport { HvBaseProps } from \"@core/types\";\nimport { useControlled } from \"@core/hooks\";\nimport { ExtractNames, isKeypress, keyboardCodes } from \"@core/utils\";\nimport {\n HvButtonProps,\n HvTypographyVariants,\n HvTypographyProps,\n HvInput,\n HvButton,\n HvTypography,\n HvInputProps,\n} from \"@core/components\";\nimport { Edit } from \"@hitachivantara/uikit-react-icons\";\nimport { useTheme } from \"@hitachivantara/uikit-react-core\";\nimport { staticClasses, useClasses } from \"./InlineEditor.styles\";\n\nexport { staticClasses as inlineEditorClasses };\n\nexport type HvInlineEditorClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvInlineEditorProps\n extends HvBaseProps<HTMLDivElement, \"onBlur\" | \"onChange\"> {\n /** The value of the form element. */\n value?: string;\n /** Whether the Edit icon should always be visible */\n showIcon?: boolean;\n /** Component to use as the input. The component \"inherit\" from `HvBaseInput` (such as `HvInput` or `HvTextArea`) */\n component?: React.ElementType;\n /** Variant of the HvTypography to display */\n variant?: HvTypographyVariants;\n /** Called when the input is blurred. */\n onBlur?: (\n event: React.FocusEvent<HTMLTextAreaElement | HTMLInputElement>,\n value: string\n ) => void;\n /** Called when the input value changes. */\n onChange?: (event: React.SyntheticEvent, value: string) => void;\n /** Props passed to the HvButton component */\n buttonProps?: HvButtonProps;\n /** Props passed to the HvTypography text component */\n typographyProps?: HvTypographyProps;\n /** A Jss Object used to override or extend the styles applied to the empty state component. */\n classes?: HvInlineEditorClasses;\n}\n\n/**\n * An Inline Editor allows the user to edit a record without making a major switch\n * between viewing and editing, making it an efficient method of updating a record.\n */\nexport const HvInlineEditor = ({\n className,\n classes: classesProp,\n value: valueProp,\n defaultValue,\n showIcon,\n component: InputComponent = HvInput,\n variant = \"body\",\n placeholder = \"Enter text\",\n onBlur,\n onChange,\n onKeyDown,\n buttonProps,\n typographyProps,\n ...others\n}: HvInlineEditorProps) => {\n const { classes, cx } = useClasses(classesProp);\n const [value, setValue] = useControlled(valueProp, defaultValue);\n const [editMode, setEditMode] = useState(false);\n const [cachedValue, setCachedValue] = useState(value);\n const inputRef = useRef<HTMLInputElement>();\n const { activeTheme } = useTheme();\n\n const typographyStyles = activeTheme?.typography[variant] || {};\n const { lineHeight } = typographyStyles;\n\n useLayoutEffect(() => {\n const input = inputRef.current;\n if (editMode && input) {\n input.focus();\n input.select();\n }\n }, [editMode]);\n\n const handleClick = () => {\n setEditMode(true);\n setCachedValue(value);\n };\n\n const handleBlur: HvInputProps[\"onBlur\"] = (event) => {\n setEditMode(false);\n\n const newValue = value || cachedValue; // empty values should be ignored\n setValue(newValue);\n onBlur?.(event, newValue);\n };\n\n const handleKeyDown: HvInputProps[\"onKeyDown\"] = (event) => {\n if (isKeypress(event, keyboardCodes.Esc)) {\n setEditMode(false);\n setValue(cachedValue);\n }\n onKeyDown?.(event as any);\n };\n\n const handleChange: HvInputProps[\"onChange\"] = (event, val) => {\n setValue(val);\n onChange?.(event, val);\n };\n\n return (\n <div className={cx(className, classes.root)}>\n {editMode ? (\n <InputComponent\n inputRef={inputRef}\n classes={{\n root: classes.inputRoot,\n input: classes.input,\n inputBorderContainer: classes.inputBorderContainer,\n }}\n inputProps={{\n style: {\n ...typographyStyles,\n height: InputComponent === HvInput ? lineHeight : undefined,\n },\n }}\n value={value}\n onBlur={handleBlur}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n {...others}\n />\n ) : (\n <HvButton\n variant=\"secondaryGhost\"\n overrideIconColors={false}\n endIcon={\n <Edit\n color=\"secondary_60\"\n role=\"presentation\"\n className={cx(classes.icon, { [classes.iconVisible]: showIcon })}\n />\n }\n className={cx(classes.button, {\n [classes.largeText]: parseInt(lineHeight as string, 10) >= 28,\n })}\n onClick={handleClick}\n {...buttonProps}\n >\n <HvTypography\n variant={variant}\n noWrap\n className={cx(classes.text, { [classes.textEmpty]: !value })}\n {...typographyProps}\n >\n {value || placeholder}\n </HvTypography>\n </HvButton>\n )}\n </div>\n );\n};\n"],"names":["HvInlineEditor","className","classes","classesProp","value","valueProp","defaultValue","showIcon","component","InputComponent","HvInput","variant","placeholder","onBlur","onChange","onKeyDown","buttonProps","typographyProps","others","cx","useClasses","setValue","useControlled","editMode","setEditMode","useState","cachedValue","setCachedValue","inputRef","useRef","activeTheme","useTheme","typographyStyles","typography","lineHeight","useLayoutEffect","input","current","focus","select","handleClick","handleBlur","event","newValue","handleKeyDown","isKeypress","keyboardCodes","Esc","handleChange","val","root","children","_jsx","inputRoot","inputBorderContainer","inputProps","style","height","undefined","HvButton","overrideIconColors","endIcon","Edit","color","role","icon","iconVisible","button","largeText","parseInt","onClick","HvTypography","noWrap","text","textEmpty"],"mappings":";;;;;;;;;;;;AAkDO,MAAMA,iBAAiBA,CAAC;AAAA,EAC7BC;AAAAA,EACAC,SAASC;AAAAA,EACTC,OAAOC;AAAAA,EACPC;AAAAA,EACAC;AAAAA,EACAC,WAAWC,iBAAiBC;AAAAA,EAC5BC,UAAU;AAAA,EACVC,cAAc;AAAA,EACdC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACA,GAAGC;AACgB,MAAM;AACnB,QAAA;AAAA,IAAEhB;AAAAA,IAASiB;AAAAA,EAAAA,IAAOC,WAAWjB,WAAW;AAC9C,QAAM,CAACC,OAAOiB,QAAQ,IAAIC,cAAcjB,WAAWC,YAAY;AAC/D,QAAM,CAACiB,UAAUC,WAAW,I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HyB,QAAQhD,mBAAmBC,UAAUwB,aAAawB;AAAAA,QACpD;AAAA,MACF;AAAA,MACAtD;AAAAA,MACAS,QAAQ4B;AAAAA,MACR3B,UAAUkC;AAAAA,MACVjC,WAAW6B;AAAAA,MAAc,GACrB1B;AAAAA,IAAAA,CACL,IAEDkC,oBAACO,UAAQ;AAAA,MACPhD,SAAQ;AAAA,MACRiD,oBAAoB;AAAA,MACpBC,6BACGC,MAAI;AAAA,QACHC,OAAM;AAAA,QACNC,MAAK;AAAA,QACL/D,WAAWkB,GAAGjB,QAAQ+D,MAAM;AAAA,UAAE,CAAC/D,QAAQgE,WAAW,GAAG3D;AAAAA,QAAAA,CAAU;AAAA,MAAA,CAChE;AAAA,MAEHN,WAAWkB,GAAGjB,QAAQiE,QAAQ;AAAA,QAC5B,CAACjE,QAAQkE,SAAS,GAAGC,SAASnC,YAAsB,EAAE,KAAK;AAAA,MAAA,CAC5D;AAAA,MACDoC,SAAS9B;AAAAA,MAAY,GACjBxB;AAAAA,MAAWmC,8BAEdoB,cAAY;AAAA,QACX5D;AAAAA,QACA6D,QAAM;AAAA,QACNvE,WAAWkB,GAAGjB,QAAQuE,MAAM;AAAA,UAAE,CAACvE,QAAQwE,SAAS,GAAG,CAACtE;AAAAA,QAAAA,CAAO;AAAA,QAAE,GACzDa;AAAAA,QAAekC,UAElB/C,SAASQ;AAAAA,MAAAA,CACE;AAAA,IAAA,CACN;AAAA,EAAA,CAET;AAET;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var _a;
|
|
2
1
|
import React__default, { forwardRef, useRef, useState, useMemo, useCallback, isValidElement, useEffect } from "react";
|
|
3
2
|
import { useForkRef } from "@mui/material";
|
|
4
3
|
import { CloseXS, Search, PreviewOff, Preview, Success } from "@hitachivantara/uikit-react-icons";
|
|
@@ -35,16 +34,17 @@ const getFocusedElement = (event) => isBrowser("ie") ? document.activeElement :
|
|
|
35
34
|
function eventTargetIsInsideContainer(container, event) {
|
|
36
35
|
return container != null && container.contains(getFocusedElement(event));
|
|
37
36
|
}
|
|
38
|
-
const setInputValue = (_a = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")) == null ? void 0 : _a.set;
|
|
39
37
|
const changeInputValue = (input, value = "") => {
|
|
38
|
+
var _a;
|
|
40
39
|
const event = new Event("input", {
|
|
41
40
|
bubbles: true
|
|
42
41
|
});
|
|
42
|
+
const setInputValue = (_a = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")) == null ? void 0 : _a.set;
|
|
43
43
|
setInputValue == null ? void 0 : setInputValue.call(input, value);
|
|
44
44
|
input == null ? void 0 : input.dispatchEvent(event);
|
|
45
45
|
};
|
|
46
46
|
const HvInput = forwardRef((props, ref) => {
|
|
47
|
-
var
|
|
47
|
+
var _a;
|
|
48
48
|
const {
|
|
49
49
|
classes: classesProp,
|
|
50
50
|
className,
|
|
@@ -134,8 +134,8 @@ const HvInput = forwardRef((props, ref) => {
|
|
|
134
134
|
const hasLabel = label != null;
|
|
135
135
|
const hasDescription = description != null;
|
|
136
136
|
const focusInput = () => {
|
|
137
|
-
var
|
|
138
|
-
(
|
|
137
|
+
var _a2;
|
|
138
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
139
139
|
};
|
|
140
140
|
const isMounted = useIsMounted();
|
|
141
141
|
const suggestionClearHandler = () => {
|
|
@@ -144,9 +144,9 @@ const HvInput = forwardRef((props, ref) => {
|
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
146
|
const suggestionHandler = (val) => {
|
|
147
|
-
var
|
|
147
|
+
var _a2;
|
|
148
148
|
const suggestionsArray = suggestionListCallback == null ? void 0 : suggestionListCallback(val);
|
|
149
|
-
if ((
|
|
149
|
+
if ((_a2 = suggestionsArray == null ? void 0 : suggestionsArray[0]) == null ? void 0 : _a2.label) {
|
|
150
150
|
setSuggestionValues(suggestionsArray);
|
|
151
151
|
} else {
|
|
152
152
|
suggestionClearHandler();
|
|
@@ -182,9 +182,9 @@ const HvInput = forwardRef((props, ref) => {
|
|
|
182
182
|
onFocus == null ? void 0 : onFocus(event, value);
|
|
183
183
|
};
|
|
184
184
|
const getSuggestions = (li) => {
|
|
185
|
-
var
|
|
185
|
+
var _a2;
|
|
186
186
|
const listEl = document.getElementById(setId(elementId, "suggestions-list") || "");
|
|
187
|
-
return li != null ? (
|
|
187
|
+
return li != null ? (_a2 = listEl == null ? void 0 : listEl.getElementsByTagName("li")) == null ? void 0 : _a2[li] : listEl;
|
|
188
188
|
};
|
|
189
189
|
const onSuggestionKeyDown = (event) => {
|
|
190
190
|
if (isKeypress(event, keyboardCodes.Esc)) {
|
|
@@ -379,7 +379,7 @@ const HvInput = forwardRef((props, ref) => {
|
|
|
379
379
|
list: classes.suggestionList
|
|
380
380
|
},
|
|
381
381
|
expanded: hasSuggestions,
|
|
382
|
-
anchorEl: (
|
|
382
|
+
anchorEl: (_a = inputRef.current) == null ? void 0 : _a.parentElement,
|
|
383
383
|
onClose: suggestionClearHandler,
|
|
384
384
|
onKeyDown: onSuggestionKeyDown,
|
|
385
385
|
onSuggestionSelected: suggestionSelectedHandler,
|