@hitachivantara/uikit-react-core 3.67.6 → 3.67.9
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/BaseInput/styles.js +32 -6
- package/dist/BaseInput/styles.js.map +1 -1
- package/dist/Forms/WarningText/WarningText.d.ts +1 -2
- package/dist/Forms/WarningText/WarningText.js +1 -6
- package/dist/Forms/WarningText/WarningText.js.map +1 -1
- package/dist/Forms/WarningText/styles.js +0 -6
- package/dist/Forms/WarningText/styles.js.map +1 -1
- package/dist/Input/styles.js +0 -6
- package/dist/Input/styles.js.map +1 -1
- package/dist/Provider/Provider.d.ts +15 -0
- package/dist/Provider/Provider.js +34 -6
- package/dist/Provider/Provider.js.map +1 -1
- package/dist/VerticalNavigation/Navigation/Navigation.d.ts +8 -0
- package/dist/VerticalNavigation/Navigation/Navigation.js +4 -2
- package/dist/VerticalNavigation/Navigation/Navigation.js.map +1 -1
- package/dist/VerticalNavigation/TreeView/TreeViewItem.js +2 -1
- package/dist/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
- package/dist/VerticalNavigation/TreeView/styles.js +0 -1
- package/dist/VerticalNavigation/TreeView/styles.js.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/legacy/BaseInput/styles.js +32 -6
- package/dist/legacy/BaseInput/styles.js.map +1 -1
- package/dist/legacy/Forms/WarningText/WarningText.d.ts +1 -2
- package/dist/legacy/Forms/WarningText/WarningText.js +1 -6
- package/dist/legacy/Forms/WarningText/WarningText.js.map +1 -1
- package/dist/legacy/Forms/WarningText/styles.js +0 -6
- package/dist/legacy/Forms/WarningText/styles.js.map +1 -1
- package/dist/legacy/Input/styles.js +0 -6
- package/dist/legacy/Input/styles.js.map +1 -1
- package/dist/legacy/Provider/Provider.d.ts +15 -0
- package/dist/legacy/Provider/Provider.js +34 -7
- package/dist/legacy/Provider/Provider.js.map +1 -1
- package/dist/legacy/VerticalNavigation/Navigation/Navigation.d.ts +8 -0
- package/dist/legacy/VerticalNavigation/Navigation/Navigation.js +4 -2
- package/dist/legacy/VerticalNavigation/Navigation/Navigation.js.map +1 -1
- package/dist/legacy/VerticalNavigation/TreeView/TreeViewItem.js +2 -1
- package/dist/legacy/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
- package/dist/legacy/VerticalNavigation/TreeView/styles.js +0 -1
- package/dist/legacy/VerticalNavigation/TreeView/styles.js.map +1 -1
- package/dist/legacy/index.js +2 -1
- package/dist/legacy/index.js.map +1 -1
- package/dist/legacy/theme/CssBaseline.d.ts +1 -0
- package/dist/legacy/theme/CssBaseline.js +11 -32
- package/dist/legacy/theme/CssBaseline.js.map +1 -1
- package/dist/legacy/theme/ScopedCssBaseline.d.ts +13 -0
- package/dist/legacy/theme/ScopedCssBaseline.js +67 -0
- package/dist/legacy/theme/ScopedCssBaseline.js.map +1 -0
- package/dist/legacy/theme/index.d.ts +2 -1
- package/dist/legacy/theme/index.js +2 -1
- package/dist/legacy/theme/index.js.map +1 -1
- package/dist/modern/BaseInput/styles.js +32 -6
- package/dist/modern/BaseInput/styles.js.map +1 -1
- package/dist/modern/Forms/WarningText/WarningText.d.ts +1 -2
- package/dist/modern/Forms/WarningText/WarningText.js +1 -6
- package/dist/modern/Forms/WarningText/WarningText.js.map +1 -1
- package/dist/modern/Forms/WarningText/styles.js +0 -6
- package/dist/modern/Forms/WarningText/styles.js.map +1 -1
- package/dist/modern/Input/styles.js +0 -6
- package/dist/modern/Input/styles.js.map +1 -1
- package/dist/modern/Provider/Provider.d.ts +15 -0
- package/dist/modern/Provider/Provider.js +32 -7
- package/dist/modern/Provider/Provider.js.map +1 -1
- package/dist/modern/VerticalNavigation/Navigation/Navigation.d.ts +8 -0
- package/dist/modern/VerticalNavigation/Navigation/Navigation.js +4 -2
- package/dist/modern/VerticalNavigation/Navigation/Navigation.js.map +1 -1
- package/dist/modern/VerticalNavigation/TreeView/TreeViewItem.js +2 -1
- package/dist/modern/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
- package/dist/modern/VerticalNavigation/TreeView/styles.js +0 -1
- package/dist/modern/VerticalNavigation/TreeView/styles.js.map +1 -1
- package/dist/modern/index.js +2 -1
- package/dist/modern/index.js.map +1 -1
- package/dist/modern/theme/CssBaseline.d.ts +1 -0
- package/dist/modern/theme/CssBaseline.js +11 -32
- package/dist/modern/theme/CssBaseline.js.map +1 -1
- package/dist/modern/theme/ScopedCssBaseline.d.ts +13 -0
- package/dist/modern/theme/ScopedCssBaseline.js +59 -0
- package/dist/modern/theme/ScopedCssBaseline.js.map +1 -0
- package/dist/modern/theme/index.d.ts +2 -1
- package/dist/modern/theme/index.js +2 -1
- package/dist/modern/theme/index.js.map +1 -1
- package/dist/theme/CssBaseline.d.ts +1 -0
- package/dist/theme/CssBaseline.js +12 -29
- package/dist/theme/CssBaseline.js.map +1 -1
- package/dist/theme/ScopedCssBaseline.d.ts +13 -0
- package/dist/theme/ScopedCssBaseline.js +105 -0
- package/dist/theme/ScopedCssBaseline.js.map +1 -0
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.js +9 -1
- package/dist/theme/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import "core-js/modules/es.object.keys.js";
|
|
2
|
+
import "core-js/modules/es.symbol.js";
|
|
3
|
+
import "core-js/modules/es.array.filter.js";
|
|
4
|
+
import "core-js/modules/es.object.to-string.js";
|
|
5
|
+
import "core-js/modules/es.object.get-own-property-descriptor.js";
|
|
6
|
+
import "core-js/modules/web.dom-collections.for-each.js";
|
|
7
|
+
import "core-js/modules/es.object.get-own-property-descriptors.js";
|
|
8
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
9
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
10
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
11
|
+
var _excluded = ["component", "className", "children"];
|
|
12
|
+
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
+
|
|
17
|
+
import * as React from "react";
|
|
18
|
+
import PropTypes from "prop-types";
|
|
19
|
+
import clsx from "clsx";
|
|
20
|
+
import { makeStyles } from "@material-ui/core/styles";
|
|
21
|
+
import { html, body } from "./CssBaseline";
|
|
22
|
+
var useStyles = makeStyles(function (theme) {
|
|
23
|
+
return {
|
|
24
|
+
/* Styles applied to the root element. */
|
|
25
|
+
root: _objectSpread(_objectSpread(_objectSpread({}, html), body(theme)), {}, {
|
|
26
|
+
"& *, & *::before, & *::after": {
|
|
27
|
+
boxSizing: "inherit"
|
|
28
|
+
},
|
|
29
|
+
"& strong, & b": {
|
|
30
|
+
fontWeight: theme.hv.typography.highlightText.fontWeight
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
var ScopedCssBaseline = /*#__PURE__*/React.forwardRef(function ScopedCssBaseline(props, ref) {
|
|
36
|
+
var _props$component = props.component,
|
|
37
|
+
RootComponent = _props$component === void 0 ? "div" : _props$component,
|
|
38
|
+
className = props.className,
|
|
39
|
+
children = props.children,
|
|
40
|
+
other = _objectWithoutProperties(props, _excluded);
|
|
41
|
+
|
|
42
|
+
var classes = useStyles();
|
|
43
|
+
return /*#__PURE__*/React.createElement(RootComponent, _extends({
|
|
44
|
+
className: clsx(classes.root, className),
|
|
45
|
+
ref: ref
|
|
46
|
+
}, other), children);
|
|
47
|
+
});
|
|
48
|
+
process.env.NODE_ENV !== "production" ? ScopedCssBaseline.propTypes = {
|
|
49
|
+
/**
|
|
50
|
+
* The content of the component.
|
|
51
|
+
*/
|
|
52
|
+
children: PropTypes.node,
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The component used for the root node.
|
|
56
|
+
* Either a string to use a HTML element or a component.
|
|
57
|
+
* Defaults to `div`.
|
|
58
|
+
*/
|
|
59
|
+
component: PropTypes.elementType,
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @ignore
|
|
63
|
+
*/
|
|
64
|
+
className: PropTypes.string
|
|
65
|
+
} : void 0;
|
|
66
|
+
export default ScopedCssBaseline;
|
|
67
|
+
//# sourceMappingURL=ScopedCssBaseline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScopedCssBaseline.js","names":["React","PropTypes","clsx","makeStyles","html","body","useStyles","theme","root","boxSizing","fontWeight","hv","typography","highlightText","ScopedCssBaseline","forwardRef","props","ref","component","RootComponent","className","children","other","classes","propTypes","node","elementType","string"],"sources":["../../../src/theme/ScopedCssBaseline.js"],"sourcesContent":["import * as React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { makeStyles } from \"@material-ui/core/styles\";\n\nimport { html, body } from \"./CssBaseline\";\n\nconst useStyles = makeStyles((theme) => ({\n /* Styles applied to the root element. */\n root: {\n ...html,\n ...body(theme),\n \"& *, & *::before, & *::after\": {\n boxSizing: \"inherit\",\n },\n \"& strong, & b\": {\n fontWeight: theme.hv.typography.highlightText.fontWeight,\n },\n },\n}));\n\nconst ScopedCssBaseline = React.forwardRef(function ScopedCssBaseline(props, ref) {\n const { component: RootComponent = \"div\", className, children, ...other } = props;\n\n const classes = useStyles();\n\n return (\n <RootComponent className={clsx(classes.root, className)} ref={ref} {...other}>\n {children}\n </RootComponent>\n );\n});\n\nScopedCssBaseline.propTypes = {\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n * Defaults to `div`.\n */\n component: PropTypes.elementType,\n /**\n * @ignore\n */\n className: PropTypes.string,\n};\n\nexport default ScopedCssBaseline;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AAEA,SAASC,UAAT,QAA2B,0BAA3B;AAEA,SAASC,IAAT,EAAeC,IAAf,QAA2B,eAA3B;AAEA,IAAMC,SAAS,GAAGH,UAAU,CAAC,UAACI,KAAD;EAAA,OAAY;IACvC;IACAC,IAAI,gDACCJ,IADD,GAECC,IAAI,CAACE,KAAD,CAFL;MAGF,gCAAgC;QAC9BE,SAAS,EAAE;MADmB,CAH9B;MAMF,iBAAiB;QACfC,UAAU,EAAEH,KAAK,CAACI,EAAN,CAASC,UAAT,CAAoBC,aAApB,CAAkCH;MAD/B;IANf;EAFmC,CAAZ;AAAA,CAAD,CAA5B;AAcA,IAAMI,iBAAiB,gBAAGd,KAAK,CAACe,UAAN,CAAiB,SAASD,iBAAT,CAA2BE,KAA3B,EAAkCC,GAAlC,EAAuC;EAChF,uBAA4ED,KAA5E,CAAQE,SAAR;EAAA,IAAmBC,aAAnB,iCAAmC,KAAnC;EAAA,IAA0CC,SAA1C,GAA4EJ,KAA5E,CAA0CI,SAA1C;EAAA,IAAqDC,QAArD,GAA4EL,KAA5E,CAAqDK,QAArD;EAAA,IAAkEC,KAAlE,4BAA4EN,KAA5E;;EAEA,IAAMO,OAAO,GAAGjB,SAAS,EAAzB;EAEA,oBACE,oBAAC,aAAD;IAAe,SAAS,EAAEJ,IAAI,CAACqB,OAAO,CAACf,IAAT,EAAeY,SAAf,CAA9B;IAAyD,GAAG,EAAEH;EAA9D,GAAuEK,KAAvE,GACGD,QADH,CADF;AAKD,CAVyB,CAA1B;AAYA,wCAAAP,iBAAiB,CAACU,SAAlB,GAA8B;EAC5B;AACF;AACA;EACEH,QAAQ,EAAEpB,SAAS,CAACwB,IAJQ;;EAK5B;AACF;AACA;AACA;AACA;EACEP,SAAS,EAAEjB,SAAS,CAACyB,WAVO;;EAW5B;AACF;AACA;EACEN,SAAS,EAAEnB,SAAS,CAAC0B;AAdO,CAA9B;AAiBA,eAAeb,iBAAf"}
|
|
@@ -149,4 +149,5 @@ export function getTheme(theme: string): object;
|
|
|
149
149
|
export default Theme;
|
|
150
150
|
|
|
151
151
|
export { default as createGenerateClassName } from "./createGenerateClassName";
|
|
152
|
-
export { default as
|
|
152
|
+
export { default as HvCssBaseline } from "./CssBaseline";
|
|
153
|
+
export { default as HvScopedCssBaseline } from "./ScopedCssBaseline";
|
|
@@ -81,7 +81,8 @@ var themeBuilder = function themeBuilder(theme) {
|
|
|
81
81
|
|
|
82
82
|
var defaultTheme = themeBuilder(getTheme("dawn"));
|
|
83
83
|
export { default as createGenerateClassName } from "./createGenerateClassName";
|
|
84
|
-
export { default as
|
|
84
|
+
export { default as HvCssBaseline } from "./CssBaseline";
|
|
85
|
+
export { default as HvScopedCssBaseline } from "./ScopedCssBaseline";
|
|
85
86
|
export { getTheme };
|
|
86
87
|
export { themeBuilder };
|
|
87
88
|
export default defaultTheme;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["createTheme","dawnTheme","wickedTheme","muiAppBarOverrides","muiToolbarOverrides","muiIconButtonOverrides","createTypography","createPalette","createSpacing","hvSpacing","getTheme","uiKitTheme","themeBuilder","theme","themeSpacing","themePalette","themeTypography","shadows","Array","fill","spacing","palette","typography","shape","borderRadius","breakpoints","values","xs","sm","md","lg","xl","props","MuiButtonBase","disableRipple","MuiInput","disableUnderline","overrides","MuiPaper","root","backgroundColor","atmosphere","atmo1","MuiAppBar","MuiToolbar","MuiIconButton","hv","defaultTheme","default","createGenerateClassName","
|
|
1
|
+
{"version":3,"file":"index.js","names":["createTheme","dawnTheme","wickedTheme","muiAppBarOverrides","muiToolbarOverrides","muiIconButtonOverrides","createTypography","createPalette","createSpacing","hvSpacing","getTheme","uiKitTheme","themeBuilder","theme","themeSpacing","themePalette","themeTypography","shadows","Array","fill","spacing","palette","typography","shape","borderRadius","breakpoints","values","xs","sm","md","lg","xl","props","MuiButtonBase","disableRipple","MuiInput","disableUnderline","overrides","MuiPaper","root","backgroundColor","atmosphere","atmo1","MuiAppBar","MuiToolbar","MuiIconButton","hv","defaultTheme","default","createGenerateClassName","HvCssBaseline","HvScopedCssBaseline"],"sources":["../../../src/theme/index.js"],"sourcesContent":["import { createTheme } from \"@material-ui/core/styles\";\nimport dawnTheme from \"@hitachivantara/uikit-common-themes/dist/dawn\";\nimport wickedTheme from \"@hitachivantara/uikit-common-themes/dist/wicked\";\nimport muiAppBarOverrides from \"./overrides/muiAppBar\";\nimport muiToolbarOverrides from \"./overrides/muiToolbar\";\nimport muiIconButtonOverrides from \"./overrides/muiIconButton\";\nimport createTypography from \"./typography\";\nimport createPalette from \"./palette\";\nimport createSpacing, { hvSpacing } from \"./spacing\";\n\nconst getTheme = (uiKitTheme) => {\n switch (uiKitTheme) {\n default:\n case \"dawn\":\n return dawnTheme;\n case \"wicked\":\n return wickedTheme;\n }\n};\n\nconst themeBuilder = (theme) => {\n const themeSpacing = createSpacing(theme);\n const themePalette = createPalette(theme);\n const themeTypography = createTypography(themePalette, theme);\n\n return createTheme({\n shadows: Array(25).fill(\"none\"),\n\n // MUI's spacing doesn't cover our use cases because of regression:\n // https://github.com/mui-org/material-ui/issues/21278\n spacing: themeSpacing,\n hvSpacing: hvSpacing(themeSpacing),\n\n palette: themePalette,\n typography: themeTypography,\n shape: {\n borderRadius: 0,\n },\n breakpoints: {\n values: {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1270,\n xl: 1920,\n },\n },\n props: {\n MuiButtonBase: {\n disableRipple: true,\n },\n MuiInput: {\n disableUnderline: true,\n },\n },\n overrides: {\n MuiPaper: {\n root: {\n backgroundColor: theme.palette.atmosphere.atmo1,\n },\n },\n MuiAppBar: {\n ...muiAppBarOverrides(theme),\n },\n MuiToolbar: {\n ...muiToolbarOverrides(theme),\n },\n MuiIconButton: {\n ...muiIconButtonOverrides(theme),\n },\n },\n hv: theme,\n });\n};\n\nconst defaultTheme = themeBuilder(getTheme(\"dawn\"));\n\nexport { default as createGenerateClassName } from \"./createGenerateClassName\";\nexport { default as HvCssBaseline } from \"./CssBaseline\";\nexport { default as HvScopedCssBaseline } from \"./ScopedCssBaseline\";\nexport { getTheme };\n\nexport { themeBuilder };\nexport default defaultTheme;\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAASA,WAAT,QAA4B,0BAA5B;AACA,OAAOC,SAAP,MAAsB,+CAAtB;AACA,OAAOC,WAAP,MAAwB,iDAAxB;AACA,OAAOC,kBAAP,MAA+B,uBAA/B;AACA,OAAOC,mBAAP,MAAgC,wBAAhC;AACA,OAAOC,sBAAP,MAAmC,2BAAnC;AACA,OAAOC,gBAAP,MAA6B,cAA7B;AACA,OAAOC,aAAP,MAA0B,WAA1B;AACA,OAAOC,aAAP,IAAwBC,SAAxB,QAAyC,WAAzC;;AAEA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CAACC,UAAD,EAAgB;EAC/B,QAAQA,UAAR;IACE;IACA,KAAK,MAAL;MACE,OAAOV,SAAP;;IACF,KAAK,QAAL;MACE,OAAOC,WAAP;EALJ;AAOD,CARD;;AAUA,IAAMU,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAW;EAC9B,IAAMC,YAAY,GAAGN,aAAa,CAACK,KAAD,CAAlC;EACA,IAAME,YAAY,GAAGR,aAAa,CAACM,KAAD,CAAlC;EACA,IAAMG,eAAe,GAAGV,gBAAgB,CAACS,YAAD,EAAeF,KAAf,CAAxC;EAEA,OAAOb,WAAW,CAAC;IACjBiB,OA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"& $input": {
|
|
41
41
|
border: `1px solid ${theme.hv.palette.accent.acce1}`
|
|
42
42
|
}
|
|
43
|
+
},
|
|
44
|
+
"@global": {
|
|
45
|
+
"input:-webkit-autofill": {
|
|
46
|
+
"-webkit-box-shadow": `0 0 0px 1000px ${theme.hv.palette.atmosphere.atmo1} inset`,
|
|
47
|
+
"-webkit-text-fill-color": theme.hv.typography.normalText.color
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
/* clears input's clear and reveal buttons from IE */
|
|
51
|
+
"input[type=search]::-ms-clear": {
|
|
52
|
+
display: "none",
|
|
53
|
+
width: 0,
|
|
54
|
+
height: 0
|
|
55
|
+
},
|
|
56
|
+
"input[type=search]::-ms-reveal": {
|
|
57
|
+
display: "none",
|
|
58
|
+
width: 0,
|
|
59
|
+
height: 0
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
/* clears input's clear button from Chrome */
|
|
63
|
+
"input[type=search]::-webkit-search-decoration": {
|
|
64
|
+
display: "none"
|
|
65
|
+
},
|
|
66
|
+
"input[type=search]::-webkit-search-cancel-button": {
|
|
67
|
+
display: "none"
|
|
68
|
+
},
|
|
69
|
+
"input[type=search]::-webkit-search-results-button": {
|
|
70
|
+
display: "none"
|
|
71
|
+
},
|
|
72
|
+
"input[type=search]::-webkit-search-results-decoration": {
|
|
73
|
+
display: "none"
|
|
74
|
+
}
|
|
43
75
|
}
|
|
44
76
|
},
|
|
45
77
|
resizable: {
|
|
@@ -191,12 +223,6 @@ const styles = theme => ({
|
|
|
191
223
|
top: "31px",
|
|
192
224
|
left: "2px",
|
|
193
225
|
backgroundColor: theme.hv.palette.atmosphere.atmo4
|
|
194
|
-
},
|
|
195
|
-
"@global": {
|
|
196
|
-
"input:-webkit-autofill": {
|
|
197
|
-
"-webkit-box-shadow": `0 0 0px 1000px ${theme.hv.palette.atmosphere.atmo1} inset`,
|
|
198
|
-
"-webkit-text-fill-color": theme.hv.typography.normalText.color
|
|
199
|
-
}
|
|
200
226
|
}
|
|
201
227
|
});
|
|
202
228
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["outlineStyles","styles","theme","root","display","width","position","overflow","border","hv","palette","accent","acce1","backgroundColor","resizable","readOnly","disabled","atmosphere","atmo4","atmo3","invalid","semantic","sema4","inputRoot","margin","borderRadius","atmo1","inputRootFocused","background","inputRootDisabled","cursor","inputRootMultiline","padding","height","minHeight","marginLeft","marginRight","input","spacing","xs","typography","normalText","textOverflow","outline","placeholderText","opacity","flexGrow","inputDisabled","color","atmo5","inputResizable","resize","inputBorderContainer","top","left"],"sources":["../../../src/BaseInput/styles.js"],"sourcesContent":["import { outlineStyles } from \"../Focus/styles\";\n\nconst styles = (theme) => ({\n root: {\n display: \"inline-block\",\n width: \"100%\",\n position: \"relative\",\n \"& $inputRootMultiline\": {\n overflow: \"auto\",\n border: \"none\",\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.accent.acce1}`,\n },\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n \"&:focus-within $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.accent.acce1}`,\n },\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.accent.acce1}`,\n },\n },\n },\n resizable: {\n width: \"auto\",\n },\n readOnly: {\n \"& $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n \"&:focus-within $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n\n // multiline\n \"& $inputRootMultiline\": {\n \"& $input\": {\n border: \"1px solid transparent\",\n },\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: \"1px solid transparent\",\n },\n },\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: \"1px solid transparent\",\n },\n },\n },\n disabled: {\n \"& $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n },\n \"& $inputRootMultiline\": {\n \"& $input\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n border: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n },\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n border: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n },\n },\n },\n invalid: {\n \"&:not($disabled)\": {\n \"& $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.semantic.sema4,\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.semantic.sema4,\n },\n \"& $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n },\n },\n\n inputRoot: {\n margin: 0,\n width: \"100%\",\n borderRadius: \"2px\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n },\n inputRootFocused: {\n background: theme.hv.palette.atmosphere.atmo1,\n ...outlineStyles,\n \"&:hover\": {\n background: theme.hv.palette.atmosphere.atmo1,\n },\n },\n inputRootDisabled: {\n background: theme.hv.palette.atmosphere.atmo3,\n \"&:hover\": {\n background: theme.hv.palette.atmosphere.atmo3,\n cursor: \"not-allowed\",\n },\n cursor: \"not-allowed\",\n },\n inputRootMultiline: {\n padding: 0,\n backgroundColor: \"transparent\",\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n borderRadius: \"2px\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n height: \"auto\",\n minHeight: \"21px\",\n padding: \"5px 10px\",\n overflow: \"auto\",\n marginLeft: \"0px\",\n marginRight: \"0px\",\n },\n },\n\n input: {\n height: \"21px\",\n marginLeft: theme.hv.spacing.xs,\n marginRight: theme.hv.spacing.xs,\n padding: \"6px 0 5px\",\n ...theme.hv.typography.normalText,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n outline: \"none\",\n \"&::placeholder\": {\n ...theme.hv.typography.placeholderText,\n opacity: 1,\n },\n \"&::-ms-clear\": {\n display: \"none\",\n },\n width: \"initial\",\n flexGrow: 1,\n },\n inputDisabled: {\n color: theme.hv.palette.atmosphere.atmo5,\n },\n inputResizable: {\n resize: \"both\",\n width: \"100%\",\n },\n\n inputBorderContainer: {\n position: \"absolute\",\n width: \"calc(100% - 4px)\",\n height: \"1px\",\n top: \"31px\",\n left: \"2px\",\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n },\n\n \"@global\": {\n \"input:-webkit-autofill\": {\n \"-webkit-box-shadow\": `0 0 0px 1000px ${theme.hv.palette.atmosphere.atmo1} inset`,\n \"-webkit-text-fill-color\": theme.hv.typography.normalText.color,\n },\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;AAAA,SAASA,aAAT,QAA8B,iBAA9B;;AAEA,MAAMC,MAAM,GAAIC,KAAD,KAAY;EACzBC,IAAI,EAAE;IACJC,OAAO,EAAE,cADL;IAEJC,KAAK,EAAE,MAFH;IAGJC,QAAQ,EAAE,UAHN;IAIJ,yBAAyB;MACvBC,QAAQ,EAAE,MADa;MAEvBC,MAAM,EA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CAAZ,CAAf;;AAwMA,eAAe/C,MAAf"}
|
|
1
|
+
{"version":3,"file":"styles.js","names":["outlineStyles","styles","theme","root","display","width","position","overflow","border","hv","palette","accent","acce1","backgroundColor","atmosphere","atmo1","typography","normalText","color","height","resizable","readOnly","disabled","atmo4","atmo3","invalid","semantic","sema4","inputRoot","margin","borderRadius","inputRootFocused","background","inputRootDisabled","cursor","inputRootMultiline","padding","minHeight","marginLeft","marginRight","input","spacing","xs","textOverflow","outline","placeholderText","opacity","flexGrow","inputDisabled","atmo5","inputResizable","resize","inputBorderContainer","top","left"],"sources":["../../../src/BaseInput/styles.js"],"sourcesContent":["import { outlineStyles } from \"../Focus/styles\";\n\nconst styles = (theme) => ({\n root: {\n display: \"inline-block\",\n width: \"100%\",\n position: \"relative\",\n \"& $inputRootMultiline\": {\n overflow: \"auto\",\n border: \"none\",\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.accent.acce1}`,\n },\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n \"&:focus-within $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.accent.acce1}`,\n },\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.accent.acce1}`,\n },\n },\n\n \"@global\": {\n \"input:-webkit-autofill\": {\n \"-webkit-box-shadow\": `0 0 0px 1000px ${theme.hv.palette.atmosphere.atmo1} inset`,\n \"-webkit-text-fill-color\": theme.hv.typography.normalText.color,\n },\n\n /* clears input's clear and reveal buttons from IE */\n \"input[type=search]::-ms-clear\": { display: \"none\", width: 0, height: 0 },\n \"input[type=search]::-ms-reveal\": { display: \"none\", width: 0, height: 0 },\n\n /* clears input's clear button from Chrome */\n \"input[type=search]::-webkit-search-decoration\": { display: \"none\" },\n \"input[type=search]::-webkit-search-cancel-button\": { display: \"none\" },\n \"input[type=search]::-webkit-search-results-button\": { display: \"none\" },\n \"input[type=search]::-webkit-search-results-decoration\": { display: \"none\" },\n },\n },\n resizable: {\n width: \"auto\",\n },\n readOnly: {\n \"& $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n \"&:focus-within $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n\n // multiline\n \"& $inputRootMultiline\": {\n \"& $input\": {\n border: \"1px solid transparent\",\n },\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: \"1px solid transparent\",\n },\n },\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: \"1px solid transparent\",\n },\n },\n },\n disabled: {\n \"& $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n },\n \"& $inputRootMultiline\": {\n \"& $input\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n border: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n },\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n border: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n },\n },\n },\n invalid: {\n \"&:not($disabled)\": {\n \"& $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.semantic.sema4,\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.semantic.sema4,\n },\n \"& $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n },\n },\n\n inputRoot: {\n margin: 0,\n width: \"100%\",\n borderRadius: \"2px\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n },\n inputRootFocused: {\n background: theme.hv.palette.atmosphere.atmo1,\n ...outlineStyles,\n \"&:hover\": {\n background: theme.hv.palette.atmosphere.atmo1,\n },\n },\n inputRootDisabled: {\n background: theme.hv.palette.atmosphere.atmo3,\n \"&:hover\": {\n background: theme.hv.palette.atmosphere.atmo3,\n cursor: \"not-allowed\",\n },\n cursor: \"not-allowed\",\n },\n inputRootMultiline: {\n padding: 0,\n backgroundColor: \"transparent\",\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n borderRadius: \"2px\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n height: \"auto\",\n minHeight: \"21px\",\n padding: \"5px 10px\",\n overflow: \"auto\",\n marginLeft: \"0px\",\n marginRight: \"0px\",\n },\n },\n\n input: {\n height: \"21px\",\n marginLeft: theme.hv.spacing.xs,\n marginRight: theme.hv.spacing.xs,\n padding: \"6px 0 5px\",\n ...theme.hv.typography.normalText,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n outline: \"none\",\n \"&::placeholder\": {\n ...theme.hv.typography.placeholderText,\n opacity: 1,\n },\n \"&::-ms-clear\": {\n display: \"none\",\n },\n width: \"initial\",\n flexGrow: 1,\n },\n inputDisabled: {\n color: theme.hv.palette.atmosphere.atmo5,\n },\n inputResizable: {\n resize: \"both\",\n width: \"100%\",\n },\n\n inputBorderContainer: {\n position: \"absolute\",\n width: \"calc(100% - 4px)\",\n height: \"1px\",\n top: \"31px\",\n left: \"2px\",\n backg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QAAQ,EAAE,QANP;IAOHoC,YAAY,EAAE,UAPX;IAQHC,OAAO,EAAE,MARN;IASH,kDACK1C,KAAK,CAACO,EAAN,CAASO,UAAT,CAAoB6B,eADzB;MAEEC,OAAO,EAAE;IAFX,EATG;IAaH,gBAAgB;MACd1C,OAAO,EAAE;IADK,CAbb;IAgBHC,KAAK,EAAE,SAhBJ;IAiBH0C,QAAQ,EAAE;EAjBP,EA7KoB;EAgMzBC,aAAa,EAAE;IACb9B,KAAK,EAAEhB,KAAK,CAACO,EAAN,CAASC,OAAT,CAAiBI,UAAjB,CAA4BmC;EADtB,CAhMU;EAmMzBC,cAAc,EAAE;IACdC,MAAM,EAAE,MADM;IAEd9C,KAAK,EAAE;EAFO,CAnMS;EAwMzB+C,oBAAoB,EAAE;IACpB9C,QAAQ,EAAE,UADU;IAEpBD,KAAK,EAAE,kBAFa;IAGpBc,MAAM,EAAE,KAHY;IAIpBkC,GAAG,EAAE,MAJe;IAKpBC,IAAI,EAAE,KALc;IAMpBzC,eAAe,EAAEX,KAAK,CAACO,EAAN,CAASC,OAAT,CAAiBI,UAAjB,CAA4BS;EANzB;AAxMG,CAAZ,CAAf;;AAkNA,eAAetB,MAAf"}
|
|
@@ -6,8 +6,7 @@ export type HvWarningTextClassKey =
|
|
|
6
6
|
| "topBorder"
|
|
7
7
|
| "topGutter"
|
|
8
8
|
| "showText"
|
|
9
|
-
| "defaultIcon"
|
|
10
|
-
| "@global";
|
|
9
|
+
| "defaultIcon";
|
|
11
10
|
|
|
12
11
|
export interface HvWarningTextProps
|
|
13
12
|
extends StandardProps<React.HTMLAttributes<HTMLDivElement>, HvWarningTextClassKey> {
|
|
@@ -111,12 +111,7 @@ process.env.NODE_ENV !== "production" ? HvWarningText.propTypes = {
|
|
|
111
111
|
* Styles applied to the text when the error are is active
|
|
112
112
|
* but the text is to be not visible.
|
|
113
113
|
*/
|
|
114
|
-
hideText: PropTypes.string
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* IE11 specific styling.
|
|
118
|
-
*/
|
|
119
|
-
"@global": PropTypes.string
|
|
114
|
+
hideText: PropTypes.string
|
|
120
115
|
}).isRequired,
|
|
121
116
|
|
|
122
117
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarningText.js","names":["React","useContext","PropTypes","clsx","isNil","Fail","withStyles","HvFormElementContext","HvTypography","setId","styles","HvWarningText","props","children","adornment","isVisible","classes","className","id","disabled","disableGutter","disableBorder","disableAdornment","hideText","others","elementId","elementStatus","elementDisabled","localDisabled","localVisible","localId","showWarning","content","localAdornment","defaultIcon","root","show","topBorder","warningText","topGutter","formElementType","propTypes","string","node","shape","isRequired","bool","name"],"sources":["../../../../src/Forms/WarningText/WarningText.js"],"sourcesContent":["import React, { useContext } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport isNil from \"lodash/isNil\";\nimport { Fail } from \"@hitachivantara/uikit-react-icons\";\nimport { withStyles } from \"@material-ui/core\";\nimport { HvFormElementContext } from \"../FormElement\";\nimport { HvTypography } from \"../..\";\nimport { setId } from \"../../utils\";\nimport styles from \"./styles\";\n\n/**\n * Provides the user with a descriptive text, signaling an error, for when the form element is in an invalid state.\n */\nconst HvWarningText = (props) => {\n const {\n children,\n adornment,\n isVisible,\n classes,\n className,\n id,\n disabled,\n disableGutter = false,\n disableBorder = false,\n disableAdornment = false,\n hideText = false,\n ...others\n } = props;\n\n const { elementId, elementStatus, elementDisabled } = useContext(HvFormElementContext);\n const localDisabled = disabled || elementDisabled;\n const localVisible = !isNil(isVisible) ? isVisible : elementStatus === \"invalid\";\n const localId = id ?? setId(elementId, \"error\");\n const showWarning = localVisible && !localDisabled;\n const content = showWarning ? children : \"\";\n const localAdornment = adornment || <Fail className={classes.defaultIcon} semantic=\"sema4\" />;\n\n return (\n <div\n className={clsx(className, classes.root, {\n [classes.show]: showWarning,\n [classes.topBorder]: !disableBorder,\n })}\n >\n {!disableAdornment && localAdornment}\n <HvTypography\n id={localId}\n className={clsx(classes.warningText, {\n [classes.topGutter]: !disableGutter,\n [classes.hideText]: hideText,\n })}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n aria-relevant=\"additions text\"\n {...others}\n >\n {showWarning && content}\n </HvTypography>\n </div>\n );\n};\n\nHvWarningText.formElementType = \"errormessage\";\n\nHvWarningText.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * The description to be shown by this helper text\n */\n children: PropTypes.node,\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the component styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the default icon.\n */\n defaultIcon: PropTypes.string,\n /**\n * Styles applied to the warning text.\n */\n warningText: PropTypes.string,\n /**\n * Styles applied when the text should be shown.\n */\n show: PropTypes.string,\n /**\n * Separation between text and upper element.\n */\n topGutter: PropTypes.string,\n /**\n * The top border.\n */\n topBorder: PropTypes.string,\n /**\n * Styles applied to the text when the error are is active\n * but the text is to be not visible.\n */\n hideText: PropTypes.string,\n
|
|
1
|
+
{"version":3,"file":"WarningText.js","names":["React","useContext","PropTypes","clsx","isNil","Fail","withStyles","HvFormElementContext","HvTypography","setId","styles","HvWarningText","props","children","adornment","isVisible","classes","className","id","disabled","disableGutter","disableBorder","disableAdornment","hideText","others","elementId","elementStatus","elementDisabled","localDisabled","localVisible","localId","showWarning","content","localAdornment","defaultIcon","root","show","topBorder","warningText","topGutter","formElementType","propTypes","string","node","shape","isRequired","bool","name"],"sources":["../../../../src/Forms/WarningText/WarningText.js"],"sourcesContent":["import React, { useContext } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport isNil from \"lodash/isNil\";\nimport { Fail } from \"@hitachivantara/uikit-react-icons\";\nimport { withStyles } from \"@material-ui/core\";\nimport { HvFormElementContext } from \"../FormElement\";\nimport { HvTypography } from \"../..\";\nimport { setId } from \"../../utils\";\nimport styles from \"./styles\";\n\n/**\n * Provides the user with a descriptive text, signaling an error, for when the form element is in an invalid state.\n */\nconst HvWarningText = (props) => {\n const {\n children,\n adornment,\n isVisible,\n classes,\n className,\n id,\n disabled,\n disableGutter = false,\n disableBorder = false,\n disableAdornment = false,\n hideText = false,\n ...others\n } = props;\n\n const { elementId, elementStatus, elementDisabled } = useContext(HvFormElementContext);\n const localDisabled = disabled || elementDisabled;\n const localVisible = !isNil(isVisible) ? isVisible : elementStatus === \"invalid\";\n const localId = id ?? setId(elementId, \"error\");\n const showWarning = localVisible && !localDisabled;\n const content = showWarning ? children : \"\";\n const localAdornment = adornment || <Fail className={classes.defaultIcon} semantic=\"sema4\" />;\n\n return (\n <div\n className={clsx(className, classes.root, {\n [classes.show]: showWarning,\n [classes.topBorder]: !disableBorder,\n })}\n >\n {!disableAdornment && localAdornment}\n <HvTypography\n id={localId}\n className={clsx(classes.warningText, {\n [classes.topGutter]: !disableGutter,\n [classes.hideText]: hideText,\n })}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n aria-relevant=\"additions text\"\n {...others}\n >\n {showWarning && content}\n </HvTypography>\n </div>\n );\n};\n\nHvWarningText.formElementType = \"errormessage\";\n\nHvWarningText.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * The description to be shown by this helper text\n */\n children: PropTypes.node,\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the component styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the default icon.\n */\n defaultIcon: PropTypes.string,\n /**\n * Styles applied to the warning text.\n */\n warningText: PropTypes.string,\n /**\n * Styles applied when the text should be shown.\n */\n show: PropTypes.string,\n /**\n * Separation between text and upper element.\n */\n topGutter: PropTypes.string,\n /**\n * The top border.\n */\n topBorder: PropTypes.string,\n /**\n * Styles applied to the text when the error are is active\n * but the text is to be not visible.\n */\n hideText: PropTypes.string,\n }).isRequired,\n /**\n * Icon to be rendered alongside the warning text.\n */\n adornment: PropTypes.node,\n /**\n * If `true` the text is not rendered.\n */\n isVisible: PropTypes.bool,\n /**\n * If `true` the text is disabled.\n */\n disabled: PropTypes.bool,\n /**\n * If `true` the text won't include a gutter.\n */\n disableGutter: PropTypes.bool,\n /**\n * If `true` the text won't include the top border.\n */\n disableBorder: PropTypes.bool,\n /**\n * If `true` the adornment icon isn't shown.\n */\n disableAdornment: PropTypes.bool,\n /**\n * If `true` the text isn't shown.\n */\n hideText: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvWarningText\" })(HvWarningText);\n"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,UAAhB,QAAkC,OAAlC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,OAAOC,KAAP,MAAkB,cAAlB;AACA,SAASC,IAAT,QAAqB,mCAArB;AACA,SAASC,UAAT,QAA2B,mBAA3B;AACA,SAASC,oBAAT,QAAqC,gBAArC;AACA,SAASC,YAAT,QAA6B,OAA7B;AACA,SAASC,KAAT,QAAsB,aAAtB;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA;AACA;AACA;;AACA,MAAMC,aAAa,GAAIC,KAAD,IAAW;EAC/B,MAAM;IACJC,QADI;IAEJC,SAFI;IAGJC,SAHI;IAIJC,OAJI;IAKJC,SALI;IAMJC,EANI;IAOJC,QAPI;IAQJC,aAAa,GAAG,KARZ;IASJC,aAAa,GAAG,KATZ;IAUJC,gBAAgB,GAAG,KAVf;IAWJC,QAAQ,GAAG;EAXP,IAaFX,KAbJ;EAAA,MAYKY,MAZL,4BAaIZ,KAbJ;;EAeA,MAAM;IAAEa,SAAF;IAAaC,aAAb;IAA4BC;EAA5B,IAAgD1B,UAAU,CAACM,oBAAD,CAAhE;EACA,MAAMqB,aAAa,GAAGT,QAAQ,IAAIQ,eAAlC;EACA,MAAME,YAAY,GAAG,CAACz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IACvB;AACJ;AACA;IACIT,IAAI,EAAEjC,SAAS,CAACwC,MAJO;;IAKvB;AACJ;AACA;IACIR,WAAW,EAAEhC,SAAS,CAACwC,MARA;;IASvB;AACJ;AACA;IACIJ,WAAW,EAAEpC,SAAS,CAACwC,MAZA;;IAavB;AACJ;AACA;IACIN,IAAI,EAAElC,SAAS,CAACwC,MAhBO;;IAiBvB;AACJ;AACA;IACIH,SAAS,EAAErC,SAAS,CAACwC,MApBE;;IAqBvB;AACJ;AACA;IACIL,SAAS,EAAEnC,SAAS,CAACwC,MAxBE;;IAyBvB;AACJ;AACA;AACA;IACInB,QAAQ,EAAErB,SAAS,CAACwC;EA7BG,CAAhB,EA8BNG,UA9CqB;;EA+CxB;AACF;AACA;EACE/B,SAAS,EAAEZ,SAAS,CAACyC,IAlDG;;EAmDxB;AACF;AACA;EACE5B,SAAS,EAAEb,SAAS,CAAC4C,IAtDG;;EAuDxB;AACF;AACA;EACE3B,QAAQ,EAAEjB,SAAS,CAAC4C,IA1DI;;EA2DxB;AACF;AACA;EACE1B,aAAa,EAAElB,SAAS,CAAC4C,IA9DD;;EA+DxB;AACF;AACA;EACEzB,aAAa,EAAEnB,SAAS,CAAC4C,IAlED;;EAmExB;AACF;AACA;EACExB,gBAAgB,EAAEpB,SAAS,CAAC4C,IAtEJ;;EAuExB;AACF;AACA;EACEvB,QAAQ,EAAErB,SAAS,CAAC4C;AA1EI,CAA1B;AA6EA,eAAexC,UAAU,CAACI,MAAD,EAAS;EAAEqC,IAAI,EAAE;AAAR,CAAT,CAAV,CAA8CpC,aAA9C,CAAf"}
|
|
@@ -29,12 +29,6 @@ const styles = theme => ({
|
|
|
29
29
|
padding: 0,
|
|
30
30
|
margin: 0,
|
|
31
31
|
overflow: "hidden"
|
|
32
|
-
},
|
|
33
|
-
"@global": {
|
|
34
|
-
"input:-webkit-autofill": {
|
|
35
|
-
"-webkit-box-shadow": `0 0 0px 1000px ${theme.hv.palette.atmosphere.atmo1} inset`,
|
|
36
|
-
"-webkit-text-fill-color": theme.hv.typography.normalText.color
|
|
37
|
-
}
|
|
38
32
|
}
|
|
39
33
|
});
|
|
40
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","display","topBorder","borderTop","hv","palette","semantic","sema4","topGutter","paddingTop","warningText","color","paddingRight","spacing","xs","paddingLeft","defaultIcon","minWidth","show","hideText","width","height","padding","margin","overflow"
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","display","topBorder","borderTop","hv","palette","semantic","sema4","topGutter","paddingTop","warningText","color","paddingRight","spacing","xs","paddingLeft","defaultIcon","minWidth","show","hideText","width","height","padding","margin","overflow"],"sources":["../../../../src/Forms/WarningText/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n display: \"none\",\n },\n topBorder: {\n borderTop: `solid 1px ${theme.hv.palette.semantic.sema4}`,\n },\n topGutter: { paddingTop: 8 },\n warningText: {\n color: theme.hv.palette.semantic.sema4,\n paddingRight: theme.hv.spacing.xs,\n \"&:first-child\": {\n paddingLeft: theme.hv.spacing.xs,\n },\n },\n defaultIcon: {\n minWidth: \"32px\",\n },\n show: {\n display: \"flex\",\n },\n hideText: {\n // display none or visibility hidden prevents\n // browser to trigger the aria-alert\n width: 0,\n height: 0,\n padding: 0,\n margin: 0,\n overflow: \"hidden\",\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAIC,KAAD,KAAY;EACzBC,IAAI,EAAE;IACJC,OAAO,EAAE;EADL,CADmB;EAIzBC,SAAS,EAAE;IACTC,SAAS,EAAG,aAAYJ,KAAK,CAACK,EAAN,CAASC,OAAT,CAAiBC,QAAjB,CAA0BC,KAAM;EAD/C,CAJc;EAOzBC,SAAS,EAAE;IAAEC,UAAU,EAAE;EAAd,CAPc;EAQzBC,WAAW,EAAE;IACXC,KAAK,EAAEZ,KAAK,CAACK,EAAN,CAASC,OAAT,CAAiBC,QAAjB,CAA0BC,KADtB;IAEXK,YAAY,EAAEb,KAAK,CAACK,EAAN,CAASS,OAAT,CAAiBC,EAFpB;IAGX,iBAAiB;MACfC,WAAW,EAAEhB,KAAK,CAACK,EAAN,CAASS,OAAT,CAAiBC;IADf;EAHN,CARY;EAezBE,WAAW,EAAE;IACXC,QAAQ,EAAE;EADC,CAfY;EAkBzBC,IAAI,EAAE;IACJjB,OAAO,EAAE;EADL,CAlBmB;EAqBzBkB,QAAQ,EAAE;IACR;IACA;IACAC,KAAK,EAAE,CAHC;IAIRC,MAAM,EAAE,CAJA;IAKRC,OAAO,EAAE,CALD;IAMRC,MAAM,EAAE,CANA;IAORC,QAAQ,EAAE;EAPF;AArBe,CAAZ,CAAf;;AAgCA,eAAe1B,MAAf"}
|
|
@@ -85,12 +85,6 @@ const styles = theme => ({
|
|
|
85
85
|
"$hasSuggestions &": {
|
|
86
86
|
display: "none"
|
|
87
87
|
}
|
|
88
|
-
},
|
|
89
|
-
"@global": {
|
|
90
|
-
"input:-webkit-autofill": {
|
|
91
|
-
"-webkit-box-shadow": `0 0 0px 1000px ${theme.hv.palette.atmosphere.atmo1} inset`,
|
|
92
|
-
"-webkit-text-fill-color": theme.hv.typography.normalText.color
|
|
93
|
-
}
|
|
94
88
|
}
|
|
95
89
|
});
|
|
96
90
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","display","hasSuggestions","inputRoot","inputRootFocused","inputRootDisabled","cursor","inputRootMultiline","padding","input","labelContainer","alignItems","label","paddingBottom","description","error","adornmentsBox","flexDirection","height","justifyContent","marginRight","adornmentButton","backgroundColor","border","margin","icon","width","iconClear","suggestionsContainer","position","suggestionList","inputExtension","hv","spacing","xs","palette","atmosphere","atmo1","boxShadow","inputBorderContainer"
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","display","hasSuggestions","inputRoot","inputRootFocused","inputRootDisabled","cursor","inputRootMultiline","padding","input","labelContainer","alignItems","label","paddingBottom","description","error","adornmentsBox","flexDirection","height","justifyContent","marginRight","adornmentButton","backgroundColor","border","margin","icon","width","iconClear","suggestionsContainer","position","suggestionList","inputExtension","hv","spacing","xs","palette","atmosphere","atmo1","boxShadow","inputBorderContainer"],"sources":["../../../src/Input/styles.js"],"sourcesContent":["import \"focus-within-polyfill\";\n\nconst styles = (theme) => ({\n root: {\n display: \"block\",\n },\n\n hasSuggestions: {},\n\n inputRoot: {\n \"&:hover\": {\n \"& $iconClear\": {\n display: \"block\",\n },\n },\n \"&:focus-within $iconClear\": {\n display: \"block\",\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within $iconClear\": {\n display: \"block\",\n },\n },\n inputRootFocused: {\n \"& $iconClear\": { display: \"block\" },\n },\n inputRootDisabled: {\n cursor: \"not-allowed\",\n },\n inputRootMultiline: {\n padding: 0,\n },\n input: {\n \"&::-ms-clear\": {\n display: \"none\",\n },\n },\n\n labelContainer: {\n display: \"flex\",\n alignItems: \"flex-start\",\n },\n label: {\n paddingBottom: \"6px\",\n display: \"block\",\n },\n description: {},\n error: {},\n\n adornmentsBox: {\n display: \"flex\",\n flexDirection: \"row\",\n height: \"30px\",\n justifyContent: \"center\",\n marginRight: 1,\n },\n adornmentButton: {\n backgroundColor: \"transparent\",\n border: \"none\",\n padding: 0,\n margin: 0,\n cursor: \"pointer\",\n },\n icon: {\n width: \"30px\",\n height: \"30px\",\n },\n iconClear: {\n display: \"none\",\n },\n\n suggestionsContainer: {\n width: \"100%\",\n position: \"relative\",\n },\n suggestionList: {\n // ensure more specificity than .HvSuggestions-root .HvSuggestions-list\n \"$root $suggestionsContainer &\": {\n width: \"100%\",\n },\n },\n\n inputExtension: {\n height: theme.hv.spacing.xs,\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n boxShadow: `0px 8px 0px ${theme.hv.palette.atmosphere.atmo1}, 0px 0px 9px 0px rgba(65,65,65,.12)`,\n },\n\n inputBorderContainer: {\n \"$hasSuggestions &\": {\n display: \"none\",\n },\n },\n});\n\nexport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,CAjEc;EAqEzB2B,oBAAoB,EAAE;IACpBF,KAAK,EAAE,MADa;IAEpBG,QAAQ,EAAE;EAFU,CArEG;EAyEzBC,cAAc,EAAE;IACd;IACA,iCAAiC;MAC/BJ,KAAK,EAAE;IADwB;EAFnB,CAzES;EAgFzBK,cAAc,EAAE;IACdb,MAAM,EAAEnB,KAAK,CAACiC,EAAN,CAASC,OAAT,CAAiBC,EADX;IAEdZ,eAAe,EAAEvB,KAAK,CAACiC,EAAN,CAASG,OAAT,CAAiBC,UAAjB,CAA4BC,KAF/B;IAGdC,SAAS,EAAG,eAAcvC,KAAK,CAACiC,EAAN,CAASG,OAAT,CAAiBC,UAAjB,CAA4BC,KAAM;EAH9C,CAhFS;EAsFzBE,oBAAoB,EAAE;IACpB,qBAAqB;MACnBtC,OAAO,EAAE;IADU;EADD;AAtFG,CAAZ,CAAf;;AA6FA,eAAeH,MAAf"}
|
|
@@ -63,6 +63,21 @@ export interface HvProviderProps {
|
|
|
63
63
|
* Disables the generation of the styles.
|
|
64
64
|
*/
|
|
65
65
|
disableStylesGeneration?: boolean;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Disables the generation of the baseline css styles.
|
|
69
|
+
*
|
|
70
|
+
* This will be the default behavior in the future.
|
|
71
|
+
*
|
|
72
|
+
* The application using UI Kit should be responsible for adding the baseline css styles, by
|
|
73
|
+
* either using the `<HvCssBaseline />` component, using the `<HvScopedCssBaseline />` component,
|
|
74
|
+
* or ensuring that the necessary base styles are applied.
|
|
75
|
+
*
|
|
76
|
+
* Defaults to `false`. Will be removed in the next major release.
|
|
77
|
+
*
|
|
78
|
+
* @see https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main
|
|
79
|
+
*/
|
|
80
|
+
disableCssBaseline?: boolean;
|
|
66
81
|
}
|
|
67
82
|
|
|
68
83
|
export default function HvProvider(props: HvProviderProps): JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _HvCssBaseline;
|
|
2
2
|
|
|
3
3
|
import React, { useMemo } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
@@ -11,8 +11,9 @@ import "focus-within-polyfill";
|
|
|
11
11
|
import "focus-visible";
|
|
12
12
|
import { ThemeProvider as MuiThemeProvider, StylesProvider as MuiStylesProvider } from "@material-ui/core";
|
|
13
13
|
import { createTheme } from "@material-ui/core/styles";
|
|
14
|
-
import { themeBuilder, createGenerateClassName,
|
|
14
|
+
import { themeBuilder, createGenerateClassName, HvCssBaseline, getTheme } from "../theme";
|
|
15
15
|
import ConfigContext from "./context";
|
|
16
|
+
let warnedOnce = false;
|
|
16
17
|
/**
|
|
17
18
|
* Augments the target theme with the differences found in the source theme.
|
|
18
19
|
*
|
|
@@ -54,8 +55,8 @@ const applyCustomTheme = (InputTargetTheme, InputSourceTheme) => {
|
|
|
54
55
|
* <HvProvider/>
|
|
55
56
|
* ```
|
|
56
57
|
*
|
|
57
|
-
* If several `HvProvider`'s are used, either nested or in
|
|
58
|
-
* must be tweaked to avoid CSS classnames
|
|
58
|
+
* If several `HvProvider`'s are used, either nested or in parallel, the `generateClassNameOptions`
|
|
59
|
+
* must be tweaked to avoid CSS classnames collision. Or a custom JSS's class name generator can
|
|
59
60
|
* be provided via the `generateClassName` property.
|
|
60
61
|
*
|
|
61
62
|
* **UI Kit components will not work at all if the `HvProvider` is not configured correctly**,
|
|
@@ -73,10 +74,19 @@ const HvProvider = ({
|
|
|
73
74
|
generateClassName: generateClassNameProp,
|
|
74
75
|
generateClassNameOptions,
|
|
75
76
|
injectStylesFirst = false,
|
|
76
|
-
disableStylesGeneration = false
|
|
77
|
+
disableStylesGeneration = false,
|
|
78
|
+
disableCssBaseline = false
|
|
77
79
|
}) => {
|
|
78
80
|
var _navigator$language, _navigator;
|
|
79
81
|
|
|
82
|
+
if (process.env.NODE_ENV !== "production") {
|
|
83
|
+
if (!warnedOnce && !disableCssBaseline) {
|
|
84
|
+
warnedOnce = true; // eslint-disable-next-line no-console
|
|
85
|
+
|
|
86
|
+
console.warn("UI Kit HvProvider's automatic definition of a css styles baseline will be removed in the next major version.\n" + "You can use the `disableCssBaseline` property to disable it already.\n" + "See https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main");
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
80
90
|
const localeSetting = locale || ((_navigator$language = (_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.language) !== null && _navigator$language !== void 0 ? _navigator$language : "en-US");
|
|
81
91
|
const rawUiKitTheme = getTheme(uiKitTheme);
|
|
82
92
|
const customTheme = applyCustomTheme(themeBuilder(rawUiKitTheme), theme);
|
|
@@ -91,7 +101,7 @@ const HvProvider = ({
|
|
|
91
101
|
disableGeneration: disableStylesGeneration
|
|
92
102
|
}, /*#__PURE__*/React.createElement(MuiThemeProvider, {
|
|
93
103
|
theme: customTheme
|
|
94
|
-
},
|
|
104
|
+
}, !disableCssBaseline && (_HvCssBaseline || (_HvCssBaseline = /*#__PURE__*/React.createElement(HvCssBaseline, null))), /*#__PURE__*/React.createElement(ConfigContext.Provider, {
|
|
95
105
|
value: pConfig
|
|
96
106
|
}, children)));
|
|
97
107
|
};
|
|
@@ -169,7 +179,22 @@ process.env.NODE_ENV !== "production" ? HvProvider.propTypes = {
|
|
|
169
179
|
/**
|
|
170
180
|
* Disables the generation of the styles.
|
|
171
181
|
*/
|
|
172
|
-
disableStylesGeneration: PropTypes.bool
|
|
182
|
+
disableStylesGeneration: PropTypes.bool,
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Disables the generation of the baseline css styles.
|
|
186
|
+
*
|
|
187
|
+
* This will be the default behavior in the future.
|
|
188
|
+
*
|
|
189
|
+
* The application using UI Kit should be responsible for adding the baseline css styles, by
|
|
190
|
+
* either using the `<HvCssBaseline />` component, using the `<HvScopedCssBaseline />` component,
|
|
191
|
+
* or ensuring that the necessary base styles are applied.
|
|
192
|
+
*
|
|
193
|
+
* Defaults to `false`. Will be removed in the next major release.
|
|
194
|
+
*
|
|
195
|
+
* @see https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main
|
|
196
|
+
*/
|
|
197
|
+
disableCssBaseline: PropTypes.bool
|
|
173
198
|
} : void 0;
|
|
174
199
|
export default HvProvider;
|
|
175
200
|
//# sourceMappingURL=Provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","names":["React","useMemo","PropTypes","set","merge","isEmpty","cloneDeep","diff","ThemeProvider","MuiThemeProvider","StylesProvider","MuiStylesProvider","createTheme","themeBuilder","createGenerateClassName","CssBaseline","getTheme","ConfigContext","applyCustomTheme","InputTargetTheme","InputSourceTheme","muiDefaultTheme","targetTheme","sourceTheme","deleteDifference","observableDiff","difference","partialCustomTheme","path","rhs","kind","HvProvider","children","uiKitTheme","theme","changeTheme","locale","generateClassName","generateClassNameProp","generateClassNameOptions","injectStylesFirst","disableStylesGeneration","localeSetting","navigator","language","rawUiKitTheme","customTheme","pConfig","propTypes","node","isRequired","oneOf","instanceOf","Object","func","string","shape","disableGlobal","bool","productionPrefix","seed"],"sources":["../../../src/Provider/Provider.js"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport set from \"lodash/set\";\nimport merge from \"lodash/merge\";\nimport isEmpty from \"lodash/isEmpty\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport diff from \"deep-diff\";\n\nimport \"focus-within-polyfill\";\nimport \"focus-visible\";\n\nimport {\n ThemeProvider as MuiThemeProvider,\n StylesProvider as MuiStylesProvider,\n} from \"@material-ui/core\";\nimport { createTheme } from \"@material-ui/core/styles\";\n\nimport { themeBuilder, createGenerateClassName, CssBaseline, getTheme } from \"../theme\";\n\nimport ConfigContext from \"./context\";\n\n/**\n * Augments the target theme with the differences found in the source theme.\n *\n * @param {Object} InputTargetTheme - A material UI Theme to be changed.\n * @param {Object} InputSourceTheme - A material UI Theme to apply on top.\n * @returns {Object} - A new modified material UI theme.\n */\nconst applyCustomTheme = (InputTargetTheme, InputSourceTheme) => {\n const muiDefaultTheme = createTheme();\n const targetTheme = cloneDeep(InputTargetTheme);\n const sourceTheme = cloneDeep(InputSourceTheme);\n const deleteDifference = \"D\";\n if (!isEmpty(targetTheme) && !isEmpty(sourceTheme)) {\n diff.observableDiff(muiDefaultTheme, sourceTheme, (difference) => {\n const partialCustomTheme = set({}, difference.path, difference.rhs);\n if (difference.kind !== deleteDifference) {\n // Do not include the differences of type \"delete\"\n merge(targetTheme, partialCustomTheme);\n }\n });\n return targetTheme;\n }\n return targetTheme;\n};\n\n/**\n * This component makes cross-component properties, like the active `theme` and `locale`,\n * available down the React tree thanks to React context.\n *\n * This component should preferably be used at **the root of your component tree** and\n * be unique in the App in most cases.\n *\n * ```jsx\n * <HvProvider>\n * <MyApp />\n * <HvProvider/>\n * ```\n *\n * If several `HvProvider`'s are used, either nested or in paralel, the `generateClassNameOptions`\n * must be tweaked to avoid CSS classnames colision. Or a custom JSS's class name generator can\n * be provided via the `generateClassName` property.\n *\n * **UI Kit components will not work at all if the `HvProvider` is not configured correctly**,\n * as they will not be able to access the properties of the active theme..\n *\n */\nconst HvProvider = ({\n children,\n\n uiKitTheme = \"dawn\",\n theme = null,\n changeTheme = () => {},\n\n locale,\n\n generateClassName: generateClassNameProp,\n generateClassNameOptions,\n injectStylesFirst = false,\n disableStylesGeneration = false,\n}) => {\n const localeSetting = locale || (navigator?.language ?? \"en-US\");\n\n const rawUiKitTheme = getTheme(uiKitTheme);\n const customTheme = applyCustomTheme(themeBuilder(rawUiKitTheme), theme);\n\n const generateClassName =\n generateClassNameProp || createGenerateClassName(generateClassNameOptions);\n\n const pConfig = useMemo(\n () => ({ changeTheme, locale: localeSetting }),\n [changeTheme, localeSetting]\n );\n\n return (\n <MuiStylesProvider\n generateClassName={generateClassName}\n injectFirst={injectStylesFirst}\n disableGeneration={disableStylesGeneration}\n >\n <MuiThemeProvider theme={customTheme}>\n <CssBaseline />\n <ConfigContext.Provider value={pConfig}>{children}</ConfigContext.Provider>\n </MuiThemeProvider>\n </MuiStylesProvider>\n );\n};\n\nHvProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node.isRequired,\n\n /**\n * The Design System base theme in use. Defaults to `\"dawn\"`.\n */\n uiKitTheme: PropTypes.oneOf([\"dawn\", \"wicked\"]),\n /**\n * The UI Kit theme object to be applied on top of the base theme.\n */\n theme: PropTypes.instanceOf(Object),\n /**\n * Function stored in the provider's context to allow runtime switching of the active theme.\n * The implementation is up to each App.\n */\n changeTheme: PropTypes.func,\n\n /**\n * The locale to be used.\n * Defaults to the browser's configured locale or \"en-US\" if not available.\n */\n locale: PropTypes.string,\n\n /**\n * Custom JSS's class name generator.\n */\n generateClassName: PropTypes.func,\n /**\n * Built-in JSS's class name generator options.\n * Ignored if a custom `generateClassName` is provided.\n *\n * `disableGlobal`: Disable the generation of deterministic class names. Defaults to `false`.\n *\n * `productionPrefix`: The string used to prefix the class names in production. Defaults to `\"jss-uikit\"`.\n *\n * `seed`: The string used to uniquely identify the generator. Defaults to `\"\"`.\n * It can be used to avoid class name collisions when using multiple generators in the same document.\n */\n generateClassNameOptions: PropTypes.shape({\n /**\n * Disable the generation of deterministic class names. Defaults to `false`.\n */\n disableGlobal: PropTypes.bool,\n /**\n * The string used to prefix the class names in production. Defaults to `\"jss-uikit\"`.\n */\n productionPrefix: PropTypes.string,\n /**\n * The string used to uniquely identify the generator. Defaults to `\"\"`.\n * It can be used to avoid class name collisions when using multiple generators in the same document.\n */\n seed: PropTypes.string,\n }),\n /**\n * Injects the generated stylesheets at the top of the `<head>` element of the page.\n * This can ease the override of UI Kit components styles.\n *\n * By default, the styles are injected last in the `<head>` element of the page.\n */\n injectStylesFirst: PropTypes.bool,\n /**\n * Disables the generation of the styles.\n */\n disableStylesGeneration: PropTypes.bool,\n};\n\nexport default HvProvider;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,OAAhB,QAA+B,OAA/B;A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AAE/B,SAAS,CAACiD,KAAV,CAAgB,CAAC,MAAD,EAAS,QAAT,CAAhB,CATS;;EAUrB;AACF;AACA;EACEjB,KAAK,EAAEhC,SAAS,CAACkD,UAAV,CAAqBC,MAArB,CAbc;;EAcrB;AACF;AACA;AACA;EACElB,WAAW,EAAEjC,SAAS,CAACoD,IAlBF;;EAoBrB;AACF;AACA;AACA;EACElB,MAAM,EAAElC,SAAS,CAACqD,MAxBG;;EA0BrB;AACF;AACA;EACElB,iBAAiB,EAAEnC,SAAS,CAACoD,IA7BR;;EA8BrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEf,wBAAwB,EAAErC,SAAS,CAACsD,KAAV,CAAgB;IACxC;AACJ;AACA;IACIC,aAAa,EAAEvD,SAAS,CAACwD,IAJe;;IAKxC;AACJ;AACA;IACIC,gBAAgB,EAAEzD,SAAS,CAACqD,MARY;;IASxC;AACJ;AACA;AACA;IACIK,IAAI,EAAE1D,SAAS,CAACqD;EAbwB,CAAhB,CAzCL;;EAwDrB;AACF;AACA;AACA;AACA;AACA;EACEf,iBAAiB,EAAEtC,SAAS,CAACwD,IA9DR;;EA+DrB;AACF;AACA;EACEjB,uBAAuB,EAAEvC,SAAS,CAACwD;AAlEd,CAAvB;AAqEA,eAAe3B,UAAf"}
|
|
1
|
+
{"version":3,"file":"Provider.js","names":["React","useMemo","PropTypes","set","merge","isEmpty","cloneDeep","diff","ThemeProvider","MuiThemeProvider","StylesProvider","MuiStylesProvider","createTheme","themeBuilder","createGenerateClassName","HvCssBaseline","getTheme","ConfigContext","warnedOnce","applyCustomTheme","InputTargetTheme","InputSourceTheme","muiDefaultTheme","targetTheme","sourceTheme","deleteDifference","observableDiff","difference","partialCustomTheme","path","rhs","kind","HvProvider","children","uiKitTheme","theme","changeTheme","locale","generateClassName","generateClassNameProp","generateClassNameOptions","injectStylesFirst","disableStylesGeneration","disableCssBaseline","process","env","NODE_ENV","console","warn","localeSetting","navigator","language","rawUiKitTheme","customTheme","pConfig","propTypes","node","isRequired","oneOf","instanceOf","Object","func","string","shape","disableGlobal","bool","productionPrefix","seed"],"sources":["../../../src/Provider/Provider.js"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport set from \"lodash/set\";\nimport merge from \"lodash/merge\";\nimport isEmpty from \"lodash/isEmpty\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport diff from \"deep-diff\";\n\nimport \"focus-within-polyfill\";\nimport \"focus-visible\";\n\nimport {\n ThemeProvider as MuiThemeProvider,\n StylesProvider as MuiStylesProvider,\n} from \"@material-ui/core\";\nimport { createTheme } from \"@material-ui/core/styles\";\n\nimport { themeBuilder, createGenerateClassName, HvCssBaseline, getTheme } from \"../theme\";\n\nimport ConfigContext from \"./context\";\n\nlet warnedOnce = false;\n\n/**\n * Augments the target theme with the differences found in the source theme.\n *\n * @param {Object} InputTargetTheme - A material UI Theme to be changed.\n * @param {Object} InputSourceTheme - A material UI Theme to apply on top.\n * @returns {Object} - A new modified material UI theme.\n */\nconst applyCustomTheme = (InputTargetTheme, InputSourceTheme) => {\n const muiDefaultTheme = createTheme();\n const targetTheme = cloneDeep(InputTargetTheme);\n const sourceTheme = cloneDeep(InputSourceTheme);\n const deleteDifference = \"D\";\n if (!isEmpty(targetTheme) && !isEmpty(sourceTheme)) {\n diff.observableDiff(muiDefaultTheme, sourceTheme, (difference) => {\n const partialCustomTheme = set({}, difference.path, difference.rhs);\n if (difference.kind !== deleteDifference) {\n // Do not include the differences of type \"delete\"\n merge(targetTheme, partialCustomTheme);\n }\n });\n return targetTheme;\n }\n return targetTheme;\n};\n\n/**\n * This component makes cross-component properties, like the active `theme` and `locale`,\n * available down the React tree thanks to React context.\n *\n * This component should preferably be used at **the root of your component tree** and\n * be unique in the App in most cases.\n *\n * ```jsx\n * <HvProvider>\n * <MyApp />\n * <HvProvider/>\n * ```\n *\n * If several `HvProvider`'s are used, either nested or in parallel, the `generateClassNameOptions`\n * must be tweaked to avoid CSS classnames collision. Or a custom JSS's class name generator can\n * be provided via the `generateClassName` property.\n *\n * **UI Kit components will not work at all if the `HvProvider` is not configured correctly**,\n * as they will not be able to access the properties of the active theme..\n *\n */\nconst HvProvider = ({\n children,\n\n uiKitTheme = \"dawn\",\n theme = null,\n changeTheme = () => {},\n\n locale,\n\n generateClassName: generateClassNameProp,\n generateClassNameOptions,\n injectStylesFirst = false,\n disableStylesGeneration = false,\n\n disableCssBaseline = false,\n}) => {\n if (process.env.NODE_ENV !== \"production\") {\n if (!warnedOnce && !disableCssBaseline) {\n warnedOnce = true;\n // eslint-disable-next-line no-console\n console.warn(\n \"UI Kit HvProvider's automatic definition of a css styles baseline will be removed in the next major version.\\n\" +\n \"You can use the `disableCssBaseline` property to disable it already.\\n\" +\n \"See https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main\"\n );\n }\n }\n\n const localeSetting = locale || (navigator?.language ?? \"en-US\");\n\n const rawUiKitTheme = getTheme(uiKitTheme);\n const customTheme = applyCustomTheme(themeBuilder(rawUiKitTheme), theme);\n\n const generateClassName =\n generateClassNameProp || createGenerateClassName(generateClassNameOptions);\n\n const pConfig = useMemo(\n () => ({ changeTheme, locale: localeSetting }),\n [changeTheme, localeSetting]\n );\n\n return (\n <MuiStylesProvider\n generateClassName={generateClassName}\n injectFirst={injectStylesFirst}\n disableGeneration={disableStylesGeneration}\n >\n <MuiThemeProvider theme={customTheme}>\n {!disableCssBaseline && <HvCssBaseline />}\n <ConfigContext.Provider value={pConfig}>{children}</ConfigContext.Provider>\n </MuiThemeProvider>\n </MuiStylesProvider>\n );\n};\n\nHvProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node.isRequired,\n\n /**\n * The Design System base theme in use. Defaults to `\"dawn\"`.\n */\n uiKitTheme: PropTypes.oneOf([\"dawn\", \"wicked\"]),\n /**\n * The UI Kit theme object to be applied on top of the base theme.\n */\n theme: PropTypes.instanceOf(Object),\n /**\n * Function stored in the provider's context to allow runtime switching of the active theme.\n * The implementation is up to each App.\n */\n changeTheme: PropTypes.func,\n\n /**\n * The locale to be used.\n * Defaults to the browser's configured locale or \"en-US\" if not available.\n */\n locale: PropTypes.string,\n\n /**\n * Custom JSS's class name generator.\n */\n generateClassName: PropTypes.func,\n /**\n * Built-in JSS's class name generator options.\n * Ignored if a custom `generateClassName` is provided.\n *\n * `disableGlobal`: Disable the generation of deterministic class names. Defaults to `false`.\n *\n * `productionPrefix`: The string used to prefix the class names in production. Defaults to `\"jss-uikit\"`.\n *\n * `seed`: The string used to uniquely identify the generator. Defaults to `\"\"`.\n * It can be used to avoid class name collisions when using multiple generators in the same document.\n */\n generateClassNameOptions: PropTypes.shape({\n /**\n * Disable the generation of deterministic class names. Defaults to `false`.\n */\n disableGlobal: PropTypes.bool,\n /**\n * The string used to prefix the class names in production. Defaults to `\"jss-uikit\"`.\n */\n productionPrefix: PropTypes.string,\n /**\n * The string used to uniquely identify the generator. Defaults to `\"\"`.\n * It can be used to avoid class name collisions when using multiple generators in the same document.\n */\n seed: PropTypes.string,\n }),\n /**\n * Injects the generated stylesheets at the top of the `<head>` element of the page.\n * This can ease the override of UI Kit components styles.\n *\n * By default, the styles are injected last in the `<head>` element of the page.\n */\n injectStylesFirst: PropTypes.bool,\n /**\n * Disables the generation of the styles.\n */\n disableStylesGeneration: PropTypes.bool,\n\n /**\n * Disables the generation of the baseline css styles.\n *\n * This will be the default behavior in the future.\n *\n * The application using UI Kit should be responsible for adding the baseline css styles, by\n * either using the `<HvCssBaseline />` component, using the `<HvScopedCssBaseline />` component,\n * or ensuring that the necessary base styles are applied.\n *\n * Defaults to `false`. Will be removed in the next major release.\n *\n * @see https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main\n */\n disableCssBaseline: PropTypes.bool,\n};\n\nexport default HvProvider;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,OAAhB,QAA+B,OAA/B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC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 export interface NavigationData {
|
|
|
18
18
|
* Data subset.
|
|
19
19
|
*/
|
|
20
20
|
data?: NavigationData[];
|
|
21
|
+
/**
|
|
22
|
+
* if `true` the item is disabled and is not interactive.
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* if `true` the item doesn't have a selected state.
|
|
27
|
+
*/
|
|
28
|
+
selectable?: boolean;
|
|
21
29
|
/**
|
|
22
30
|
* Any other properties.
|
|
23
31
|
*/
|
|
@@ -18,7 +18,8 @@ const createListHierarchy = (items, id, classes) => items.map(item => {
|
|
|
18
18
|
label: itemLabel,
|
|
19
19
|
icon,
|
|
20
20
|
data: children,
|
|
21
|
-
selectable
|
|
21
|
+
selectable,
|
|
22
|
+
disabled
|
|
22
23
|
} = item;
|
|
23
24
|
const ItemText = wrapperTooltip(true, itemLabel, itemLabel);
|
|
24
25
|
return /*#__PURE__*/React.createElement(TreeViewItem, {
|
|
@@ -29,7 +30,8 @@ const createListHierarchy = (items, id, classes) => items.map(item => {
|
|
|
29
30
|
label: /*#__PURE__*/React.createElement(ItemText, null),
|
|
30
31
|
icon: icon,
|
|
31
32
|
payload: item,
|
|
32
|
-
selectable: selectable
|
|
33
|
+
selectable: selectable,
|
|
34
|
+
disabled: disabled
|
|
33
35
|
}, children ? createListHierarchy(children, id, classes) : undefined);
|
|
34
36
|
});
|
|
35
37
|
|