@hitachivantara/uikit-react-core 3.72.1 → 3.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AssetInventory/ListView/ListViewCell/ListViewCell.d.ts +2 -27
- package/dist/AssetInventory/ListView/ListViewRow/ListViewRow.d.ts +2 -27
- package/dist/Banner/Banner.d.ts +3 -2
- package/dist/Banner/Banner.js +2 -2
- package/dist/Banner/Banner.js.map +1 -1
- package/dist/Banner/{BannerWrapper → BannerContent}/ActionContainer/ActionContainer.js +0 -0
- package/dist/Banner/{BannerWrapper → BannerContent}/ActionContainer/ActionContainer.js.map +1 -1
- package/dist/Banner/{BannerWrapper → BannerContent}/ActionContainer/index.js +0 -0
- package/dist/Banner/{BannerWrapper → BannerContent}/ActionContainer/index.js.map +1 -1
- package/dist/Banner/{BannerWrapper → BannerContent}/ActionContainer/styles.js +0 -0
- package/dist/Banner/{BannerWrapper → BannerContent}/ActionContainer/styles.js.map +1 -1
- package/dist/Banner/BannerContent/BannerContent.d.ts +41 -0
- package/dist/Banner/{BannerWrapper/BannerContentWrapper.js → BannerContent/BannerContent.js} +5 -5
- package/dist/Banner/BannerContent/BannerContent.js.map +1 -0
- package/dist/Banner/{BannerWrapper → BannerContent}/MessageContainer/MessageContainer.js +0 -0
- package/dist/Banner/{BannerWrapper → BannerContent}/MessageContainer/MessageContainer.js.map +1 -1
- package/dist/Banner/{BannerWrapper → BannerContent}/MessageContainer/index.js +0 -0
- package/dist/Banner/{BannerWrapper → BannerContent}/MessageContainer/index.js.map +1 -1
- package/dist/Banner/{BannerWrapper → BannerContent}/MessageContainer/styles.js +0 -0
- package/dist/Banner/{BannerWrapper → BannerContent}/MessageContainer/styles.js.map +1 -1
- package/dist/Banner/BannerContent/index.d.ts +2 -0
- package/dist/Banner/{BannerWrapper → BannerContent}/index.js +2 -2
- package/dist/Banner/BannerContent/index.js.map +1 -0
- package/dist/Banner/{BannerWrapper → BannerContent}/styles.js +0 -0
- package/dist/Banner/{BannerWrapper → BannerContent}/styles.js.map +1 -1
- package/dist/Banner/index.d.ts +3 -0
- package/dist/Banner/index.js +2 -2
- package/dist/Banner/index.js.map +1 -1
- package/dist/BaseSwitch/BaseSwitch.d.ts +1 -1
- package/dist/BaseSwitch/BaseSwitch.js +6 -1
- package/dist/BaseSwitch/BaseSwitch.js.map +1 -1
- package/dist/BaseSwitch/styles.js +5 -1
- package/dist/BaseSwitch/styles.js.map +1 -1
- package/dist/ScrollTo/useScrollTo.js +2 -1
- package/dist/ScrollTo/useScrollTo.js.map +1 -1
- package/dist/ScrollTo/utils.js +39 -6
- package/dist/ScrollTo/utils.js.map +1 -1
- package/dist/legacy/AssetInventory/ListView/ListViewCell/ListViewCell.d.ts +2 -27
- package/dist/legacy/AssetInventory/ListView/ListViewRow/ListViewRow.d.ts +2 -27
- package/dist/legacy/Banner/Banner.d.ts +3 -2
- package/dist/legacy/Banner/Banner.js +2 -2
- package/dist/legacy/Banner/Banner.js.map +1 -1
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/ActionContainer/ActionContainer.js +0 -0
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/ActionContainer/ActionContainer.js.map +1 -1
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/ActionContainer/index.js +0 -0
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/ActionContainer/index.js.map +1 -1
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/ActionContainer/styles.js +0 -0
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/ActionContainer/styles.js.map +1 -1
- package/dist/legacy/Banner/BannerContent/BannerContent.d.ts +41 -0
- package/dist/legacy/Banner/{BannerWrapper/BannerContentWrapper.js → BannerContent/BannerContent.js} +5 -5
- package/dist/legacy/Banner/BannerContent/BannerContent.js.map +1 -0
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/MessageContainer/MessageContainer.js +0 -0
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/MessageContainer/MessageContainer.js.map +1 -1
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/MessageContainer/index.js +0 -0
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/MessageContainer/index.js.map +1 -1
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/MessageContainer/styles.js +0 -0
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/MessageContainer/styles.js.map +1 -1
- package/dist/legacy/Banner/BannerContent/index.d.ts +2 -0
- package/dist/legacy/Banner/BannerContent/index.js +2 -0
- package/dist/legacy/Banner/BannerContent/index.js.map +1 -0
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/styles.js +0 -0
- package/dist/legacy/Banner/{BannerWrapper → BannerContent}/styles.js.map +1 -1
- package/dist/legacy/Banner/index.d.ts +3 -0
- package/dist/legacy/Banner/index.js +1 -1
- package/dist/legacy/Banner/index.js.map +1 -1
- package/dist/legacy/BaseSwitch/BaseSwitch.d.ts +1 -1
- package/dist/legacy/BaseSwitch/BaseSwitch.js +6 -1
- package/dist/legacy/BaseSwitch/BaseSwitch.js.map +1 -1
- package/dist/legacy/BaseSwitch/styles.js +5 -1
- package/dist/legacy/BaseSwitch/styles.js.map +1 -1
- package/dist/legacy/ScrollTo/useScrollTo.js +2 -1
- package/dist/legacy/ScrollTo/useScrollTo.js.map +1 -1
- package/dist/legacy/ScrollTo/utils.js +35 -5
- package/dist/legacy/ScrollTo/utils.js.map +1 -1
- package/dist/modern/AssetInventory/ListView/ListViewCell/ListViewCell.d.ts +2 -27
- package/dist/modern/AssetInventory/ListView/ListViewRow/ListViewRow.d.ts +2 -27
- package/dist/modern/Banner/Banner.d.ts +3 -2
- package/dist/modern/Banner/Banner.js +2 -2
- package/dist/modern/Banner/Banner.js.map +1 -1
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/ActionContainer/ActionContainer.js +0 -0
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/ActionContainer/ActionContainer.js.map +1 -1
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/ActionContainer/index.js +0 -0
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/ActionContainer/index.js.map +1 -1
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/ActionContainer/styles.js +0 -0
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/ActionContainer/styles.js.map +1 -1
- package/dist/modern/Banner/BannerContent/BannerContent.d.ts +41 -0
- package/dist/modern/Banner/{BannerWrapper/BannerContentWrapper.js → BannerContent/BannerContent.js} +5 -5
- package/dist/modern/Banner/BannerContent/BannerContent.js.map +1 -0
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/MessageContainer/MessageContainer.js +0 -0
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/MessageContainer/MessageContainer.js.map +1 -1
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/MessageContainer/index.js +0 -0
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/MessageContainer/index.js.map +1 -1
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/MessageContainer/styles.js +0 -0
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/MessageContainer/styles.js.map +1 -1
- package/dist/modern/Banner/BannerContent/index.d.ts +2 -0
- package/dist/modern/Banner/BannerContent/index.js +2 -0
- package/dist/modern/Banner/BannerContent/index.js.map +1 -0
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/styles.js +0 -0
- package/dist/modern/Banner/{BannerWrapper → BannerContent}/styles.js.map +1 -1
- package/dist/modern/Banner/index.d.ts +3 -0
- package/dist/modern/Banner/index.js +1 -1
- package/dist/modern/Banner/index.js.map +1 -1
- package/dist/modern/BaseSwitch/BaseSwitch.d.ts +1 -1
- package/dist/modern/BaseSwitch/BaseSwitch.js +6 -1
- package/dist/modern/BaseSwitch/BaseSwitch.js.map +1 -1
- package/dist/modern/BaseSwitch/styles.js +5 -1
- package/dist/modern/BaseSwitch/styles.js.map +1 -1
- package/dist/modern/ScrollTo/useScrollTo.js +2 -2
- package/dist/modern/ScrollTo/useScrollTo.js.map +1 -1
- package/dist/modern/ScrollTo/utils.js +32 -6
- package/dist/modern/ScrollTo/utils.js.map +1 -1
- package/package.json +2 -2
- package/dist/Banner/BannerWrapper/BannerContentWrapper.js.map +0 -1
- package/dist/Banner/BannerWrapper/index.js.map +0 -1
- package/dist/legacy/Banner/BannerWrapper/BannerContentWrapper.js.map +0 -1
- package/dist/legacy/Banner/BannerWrapper/index.js +0 -2
- package/dist/legacy/Banner/BannerWrapper/index.js.map +0 -1
- package/dist/modern/Banner/BannerWrapper/BannerContentWrapper.js.map +0 -1
- package/dist/modern/Banner/BannerWrapper/index.js +0 -2
- package/dist/modern/Banner/BannerWrapper/index.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StandardProps } from "@material-ui/core";
|
|
3
|
+
import { HvAtmosphereColorKeys, HvSemanticColorKeys } from "../../..";
|
|
3
4
|
|
|
4
5
|
export type HvListViewCellClassKey = "root" | "semanticBar";
|
|
5
6
|
|
|
@@ -17,33 +18,7 @@ export interface HvListViewCellProps
|
|
|
17
18
|
/**
|
|
18
19
|
* The border color of the cell. Must be one of palette semantic colors.
|
|
19
20
|
*/
|
|
20
|
-
semantic?:
|
|
21
|
-
| "sema0"
|
|
22
|
-
| "sema1"
|
|
23
|
-
| "sema2"
|
|
24
|
-
| "sema3"
|
|
25
|
-
| "sema4"
|
|
26
|
-
| "sema5"
|
|
27
|
-
| "sema6"
|
|
28
|
-
| "sema7"
|
|
29
|
-
| "sema8"
|
|
30
|
-
| "sema9"
|
|
31
|
-
| "sema10"
|
|
32
|
-
| "sema11"
|
|
33
|
-
| "sema12"
|
|
34
|
-
| "sema13"
|
|
35
|
-
| "sema14"
|
|
36
|
-
| "sema15"
|
|
37
|
-
| "sema16"
|
|
38
|
-
| "sema17"
|
|
39
|
-
| "sema18"
|
|
40
|
-
| "sema19"
|
|
41
|
-
| "atmo1"
|
|
42
|
-
| "atmo2"
|
|
43
|
-
| "atmo3"
|
|
44
|
-
| "atmo4"
|
|
45
|
-
| "atmo5"
|
|
46
|
-
| "atmo6";
|
|
21
|
+
semantic?: "sema0" | HvSemanticColorKeys | HvAtmosphereColorKeys;
|
|
47
22
|
}
|
|
48
23
|
|
|
49
24
|
export default function HvListViewCell(props: HvListViewCellProps): JSX.Element | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StandardProps } from "@material-ui/core";
|
|
3
3
|
import { ListViewConfiguration } from "..";
|
|
4
|
-
import { HvCheckBoxProps } from "../../..";
|
|
4
|
+
import { HvAtmosphereColorKeys, HvCheckBoxProps, HvSemanticColorKeys } from "../../..";
|
|
5
5
|
|
|
6
6
|
export type HvListViewRowClassKey = "root";
|
|
7
7
|
|
|
@@ -29,32 +29,7 @@ export interface HvListViewRowProps
|
|
|
29
29
|
/**
|
|
30
30
|
* The border to the right of the checkbox
|
|
31
31
|
*/
|
|
32
|
-
semantic?:
|
|
33
|
-
| "sema1"
|
|
34
|
-
| "sema2"
|
|
35
|
-
| "sema3"
|
|
36
|
-
| "sema4"
|
|
37
|
-
| "sema5"
|
|
38
|
-
| "sema6"
|
|
39
|
-
| "sema7"
|
|
40
|
-
| "sema8"
|
|
41
|
-
| "sema9"
|
|
42
|
-
| "sema10"
|
|
43
|
-
| "sema11"
|
|
44
|
-
| "sema12"
|
|
45
|
-
| "sema13"
|
|
46
|
-
| "sema14"
|
|
47
|
-
| "sema15"
|
|
48
|
-
| "sema16"
|
|
49
|
-
| "sema17"
|
|
50
|
-
| "sema18"
|
|
51
|
-
| "sema19"
|
|
52
|
-
| "atmo1"
|
|
53
|
-
| "atmo2"
|
|
54
|
-
| "atmo3"
|
|
55
|
-
| "atmo4"
|
|
56
|
-
| "atmo5"
|
|
57
|
-
| "atmo6";
|
|
32
|
+
semantic?: HvSemanticColorKeys | HvAtmosphereColorKeys;
|
|
58
33
|
}
|
|
59
34
|
|
|
60
35
|
export default function HvListViewRow(props: HvListViewRowProps): JSX.Element | null;
|
package/dist/Banner/Banner.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { StandardProps, SnackbarProps
|
|
2
|
+
import { StandardProps, SnackbarProps } from "@material-ui/core";
|
|
3
3
|
import { HvActionsGenericCommonProps } from "../ActionsGeneric";
|
|
4
|
+
import { HvBannerContentProps } from "./BannerContent";
|
|
4
5
|
|
|
5
6
|
export type TransitionDirectionProp = "up" | "down" | "left" | "right";
|
|
6
7
|
|
|
@@ -55,7 +56,7 @@ export interface HvBannerProps
|
|
|
55
56
|
/**
|
|
56
57
|
* Props to pass down to the Banner Wrapper.
|
|
57
58
|
*/
|
|
58
|
-
bannerContentProps?:
|
|
59
|
+
bannerContentProps?: Partial<HvBannerContentProps>;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
export default function HvBanner(props: HvBannerProps): JSX.Element | null;
|
package/dist/Banner/Banner.js
CHANGED
|
@@ -35,7 +35,7 @@ var _capitalize = _interopRequireDefault(require("lodash/capitalize"));
|
|
|
35
35
|
|
|
36
36
|
var _utils = require("../utils");
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _BannerContent = _interopRequireDefault(require("./BannerContent"));
|
|
39
39
|
|
|
40
40
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
41
41
|
|
|
@@ -105,7 +105,7 @@ var HvBanner = function HvBanner(props) {
|
|
|
105
105
|
TransitionComponent: SlideTransition,
|
|
106
106
|
open: open,
|
|
107
107
|
transitionDuration: transitionDuration
|
|
108
|
-
}, others), /*#__PURE__*/_react.default.createElement(
|
|
108
|
+
}, others), /*#__PURE__*/_react.default.createElement(_BannerContent.default, (0, _extends2.default)({
|
|
109
109
|
id: (0, _utils.setId)(id, "content"),
|
|
110
110
|
content: label,
|
|
111
111
|
variant: variant,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.js","names":["HvBanner","props","id","classes","className","open","onClose","anchorOrigin","variant","transitionDuration","transitionDirection","showIcon","customIcon","actions","actionsCallback","actionsPosition","label","offset","bannerContentProps","others","anchorOriginOffset","anchorOriginTop","top","anchorOriginBottom","bottom","anchorOriginBanner","horizontal","vertical","SlideTransition","useCallback","properties","capitalize","root","rootClosed","anchorOriginTopCenter","anchorOriginBottomCenter","setId","propTypes","PropTypes","string","shape","isRequired","bool","func","node","oneOf","oneOfType","arrayOf","icon","disabled","number","instanceOf","Object","withStyles","styles","name"],"sources":["../../src/Banner/Banner.js"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport PropTypes, { oneOfType } from \"prop-types\";\nimport { Slide, Snackbar, withStyles } from \"@material-ui/core\";\nimport capitalize from \"lodash/capitalize\";\nimport { setId } from \"../utils\";\nimport HvBannerContentWrapper from \"./BannerWrapper\";\nimport styles from \"./styles\";\n\n/**\n * A Banner displays an important and succinct message. It can also provide actions for the user to address, or dismiss.\n * It requires a user action, for it to be dismissed. Banners should appear at the top of the screen, below a top app bar.\n */\nconst HvBanner = (props) => {\n const {\n id,\n classes,\n className,\n open,\n onClose,\n anchorOrigin = \"top\",\n variant = \"default\",\n transitionDuration = 300,\n transitionDirection = \"down\",\n showIcon = false,\n customIcon,\n actions,\n actionsCallback,\n actionsPosition = \"auto\",\n label,\n offset = 60,\n bannerContentProps,\n ...others\n } = props;\n\n const anchorOriginOffset = {\n anchorOriginTop: {\n top: `${offset || 0}px`,\n },\n anchorOriginBottom: {\n bottom: `${offset || 0}px`,\n },\n };\n\n const anchorOriginBanner = { horizontal: \"center\", vertical: anchorOrigin };\n\n const SlideTransition = useCallback(\n (properties) => <Slide {...properties} direction={transitionDirection} />,\n [transitionDirection]\n );\n\n return (\n <Snackbar\n style={anchorOriginOffset[`anchorOrigin${capitalize(anchorOrigin)}`]}\n className={className}\n id={id}\n classes={{\n root: open ? classes.root : classes.rootClosed,\n anchorOriginTopCenter: classes.anchorOriginTopCenter,\n anchorOriginBottomCenter: classes.anchorOriginBottomCenter,\n }}\n anchorOrigin={anchorOriginBanner}\n TransitionComponent={SlideTransition}\n open={open}\n transitionDuration={transitionDuration}\n {...others}\n >\n <HvBannerContentWrapper\n id={setId(id, \"content\")}\n content={label}\n variant={variant}\n customIcon={customIcon}\n showIcon={showIcon}\n actions={actions}\n actionsCallback={actionsCallback}\n actionsPosition={actionsPosition}\n onClose={onClose}\n {...bannerContentProps}\n />\n </Snackbar>\n );\n};\n\nHvBanner.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\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 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 component root class when the component is closed.\n */\n rootClosed: PropTypes.string,\n /**\n * Styles applied to the component when define as top.\n */\n anchorOriginTopCenter: PropTypes.string,\n /**\n * Styles applied to the component when define as bottom.\n */\n anchorOriginBottomCenter: PropTypes.string,\n }).isRequired,\n /**\n * If true, Snackbar is open.\n */\n open: PropTypes.bool.isRequired,\n /**\n * Callback fired when the component requests to be closed. Typically onClose is used to set state in the parent component, which is used to control the Snackbar open prop. The reason parameter can optionally be used to control the response to onClose, for example ignoring clickaway.\n */\n onClose: PropTypes.func,\n /**\n * The message to display.\n */\n label: PropTypes.node,\n /**\n * The anchor of the Snackbar.\n */\n anchorOrigin: PropTypes.oneOf([\"top\", \"bottom\"]),\n /**\n * Variant of the snackbar.\n */\n variant: PropTypes.oneOf([\"success\", \"warning\", \"error\", \"info\", \"default\"]),\n /**\n * Custom icon to replace the variant default.\n */\n customIcon: PropTypes.node,\n /**\n * Controls if the associated icon to the variant should be shown.\n */\n showIcon: PropTypes.bool,\n /**\n * Actions to display on the right side.\n */\n actions: oneOfType([\n PropTypes.node,\n PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n icon: PropTypes.func,\n disabled: PropTypes.bool,\n })\n ),\n ]),\n /**\n * The callback function ran when an action is triggered, receiving `action` as param\n */\n actionsCallback: PropTypes.func,\n /**\n * The position property of the header.\n */\n actionsPosition: PropTypes.PropTypes.oneOf([\"auto\", \"inline\", \"bottom-right\"]),\n /**\n * How much the transition animation last in milliseconds, if 0 no animation is played.\n */\n transitionDuration: PropTypes.number,\n /**\n * Direction of slide transition.\n */\n transitionDirection: PropTypes.oneOf([\"up\", \"down\", \"left\", \"right\"]),\n /**\n * Offset from top/bottom of the page, in px. Defaults to 60px.\n */\n offset: PropTypes.number,\n /**\n * Props to pass down to the Banner Wrapper. An object `actionProps` can be included to be passed as others to actions.\n */\n bannerContentProps: PropTypes.instanceOf(Object),\n};\n\nexport default withStyles(styles, { name: \"HvBanner\" })(HvBanner);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA;AACA;AACA;AACA;AACA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAW;EAC1B,IACEC,EADF,GAmBID,KAnBJ,CACEC,EADF;EAAA,IAEEC,OAFF,GAmBIF,KAnBJ,CAEEE,OAFF;EAAA,IAGEC,SAHF,GAmBIH,KAnBJ,CAGEG,SAHF;EAAA,IAIEC,IAJF,GAmBIJ,KAnBJ,CAIEI,IAJF;EAAA,IAKEC,OALF,GAmBIL,KAnBJ,CAKEK,OALF;EAAA,0BAmBIL,KAnBJ,CAMEM,YANF;EAAA,IAMEA,YANF,oCAMiB,KANjB;EAAA,qBAmBIN,KAnBJ,CAOEO,OAPF;EAAA,IAOEA,OAPF,+BAOY,SAPZ;EAAA,4BAmBIP,KAnBJ,CAQEQ,kBARF;EAAA,IAQEA,kBARF,sCAQuB,GARvB;EAAA,4BAmBIR,KAnBJ,CASES,mBATF;EAAA,IASEA,mBATF,sCASwB,MATxB;EAAA,sBAmBIT,KAnBJ,CAUEU,QAVF;EAAA,IAUEA,QAVF,gCAUa,KAVb;EAAA,IAWE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AAAC,gBAAA,EAAWC,eAAX,EAAmB;EAAEC,IAAI,EAAE;AAAR,CAAnB,EAAyCvD,QAAzC,C"}
|
|
1
|
+
{"version":3,"file":"Banner.js","names":["HvBanner","props","id","classes","className","open","onClose","anchorOrigin","variant","transitionDuration","transitionDirection","showIcon","customIcon","actions","actionsCallback","actionsPosition","label","offset","bannerContentProps","others","anchorOriginOffset","anchorOriginTop","top","anchorOriginBottom","bottom","anchorOriginBanner","horizontal","vertical","SlideTransition","useCallback","properties","capitalize","root","rootClosed","anchorOriginTopCenter","anchorOriginBottomCenter","setId","propTypes","PropTypes","string","shape","isRequired","bool","func","node","oneOf","oneOfType","arrayOf","icon","disabled","number","instanceOf","Object","withStyles","styles","name"],"sources":["../../src/Banner/Banner.js"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport PropTypes, { oneOfType } from \"prop-types\";\nimport { Slide, Snackbar, withStyles } from \"@material-ui/core\";\nimport capitalize from \"lodash/capitalize\";\nimport { setId } from \"../utils\";\nimport HvBannerContent from \"./BannerContent\";\nimport styles from \"./styles\";\n\n/**\n * A Banner displays an important and succinct message. It can also provide actions for the user to address, or dismiss.\n * It requires a user action, for it to be dismissed. Banners should appear at the top of the screen, below a top app bar.\n */\nconst HvBanner = (props) => {\n const {\n id,\n classes,\n className,\n open,\n onClose,\n anchorOrigin = \"top\",\n variant = \"default\",\n transitionDuration = 300,\n transitionDirection = \"down\",\n showIcon = false,\n customIcon,\n actions,\n actionsCallback,\n actionsPosition = \"auto\",\n label,\n offset = 60,\n bannerContentProps,\n ...others\n } = props;\n\n const anchorOriginOffset = {\n anchorOriginTop: {\n top: `${offset || 0}px`,\n },\n anchorOriginBottom: {\n bottom: `${offset || 0}px`,\n },\n };\n\n const anchorOriginBanner = { horizontal: \"center\", vertical: anchorOrigin };\n\n const SlideTransition = useCallback(\n (properties) => <Slide {...properties} direction={transitionDirection} />,\n [transitionDirection]\n );\n\n return (\n <Snackbar\n style={anchorOriginOffset[`anchorOrigin${capitalize(anchorOrigin)}`]}\n className={className}\n id={id}\n classes={{\n root: open ? classes.root : classes.rootClosed,\n anchorOriginTopCenter: classes.anchorOriginTopCenter,\n anchorOriginBottomCenter: classes.anchorOriginBottomCenter,\n }}\n anchorOrigin={anchorOriginBanner}\n TransitionComponent={SlideTransition}\n open={open}\n transitionDuration={transitionDuration}\n {...others}\n >\n <HvBannerContent\n id={setId(id, \"content\")}\n content={label}\n variant={variant}\n customIcon={customIcon}\n showIcon={showIcon}\n actions={actions}\n actionsCallback={actionsCallback}\n actionsPosition={actionsPosition}\n onClose={onClose}\n {...bannerContentProps}\n />\n </Snackbar>\n );\n};\n\nHvBanner.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\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 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 component root class when the component is closed.\n */\n rootClosed: PropTypes.string,\n /**\n * Styles applied to the component when define as top.\n */\n anchorOriginTopCenter: PropTypes.string,\n /**\n * Styles applied to the component when define as bottom.\n */\n anchorOriginBottomCenter: PropTypes.string,\n }).isRequired,\n /**\n * If true, Snackbar is open.\n */\n open: PropTypes.bool.isRequired,\n /**\n * Callback fired when the component requests to be closed. Typically onClose is used to set state in the parent component, which is used to control the Snackbar open prop. The reason parameter can optionally be used to control the response to onClose, for example ignoring clickaway.\n */\n onClose: PropTypes.func,\n /**\n * The message to display.\n */\n label: PropTypes.node,\n /**\n * The anchor of the Snackbar.\n */\n anchorOrigin: PropTypes.oneOf([\"top\", \"bottom\"]),\n /**\n * Variant of the snackbar.\n */\n variant: PropTypes.oneOf([\"success\", \"warning\", \"error\", \"info\", \"default\"]),\n /**\n * Custom icon to replace the variant default.\n */\n customIcon: PropTypes.node,\n /**\n * Controls if the associated icon to the variant should be shown.\n */\n showIcon: PropTypes.bool,\n /**\n * Actions to display on the right side.\n */\n actions: oneOfType([\n PropTypes.node,\n PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n icon: PropTypes.func,\n disabled: PropTypes.bool,\n })\n ),\n ]),\n /**\n * The callback function ran when an action is triggered, receiving `action` as param\n */\n actionsCallback: PropTypes.func,\n /**\n * The position property of the header.\n */\n actionsPosition: PropTypes.PropTypes.oneOf([\"auto\", \"inline\", \"bottom-right\"]),\n /**\n * How much the transition animation last in milliseconds, if 0 no animation is played.\n */\n transitionDuration: PropTypes.number,\n /**\n * Direction of slide transition.\n */\n transitionDirection: PropTypes.oneOf([\"up\", \"down\", \"left\", \"right\"]),\n /**\n * Offset from top/bottom of the page, in px. Defaults to 60px.\n */\n offset: PropTypes.number,\n /**\n * Props to pass down to the Banner Wrapper. An object `actionProps` can be included to be passed as others to actions.\n */\n bannerContentProps: PropTypes.instanceOf(Object),\n};\n\nexport default withStyles(styles, { name: \"HvBanner\" })(HvBanner);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA;AACA;AACA;AACA;AACA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAW;EAC1B,IACEC,EADF,GAmBID,KAnBJ,CACEC,EADF;EAAA,IAEEC,OAFF,GAmBIF,KAnBJ,CAEEE,OAFF;EAAA,IAGEC,SAHF,GAmBIH,KAnBJ,CAGEG,SAHF;EAAA,IAIEC,IAJF,GAmBIJ,KAnBJ,CAIEI,IAJF;EAAA,IAKEC,OALF,GAmBIL,KAnBJ,CAKEK,OALF;EAAA,0BAmBIL,KAnBJ,CAMEM,YANF;EAAA,IAMEA,YANF,oCAMiB,KANjB;EAAA,qBAmBIN,KAnBJ,CAOEO,OAPF;EAAA,IAOEA,OAPF,+BAOY,SAPZ;EAAA,4BAmBIP,KAnBJ,CAQEQ,kBARF;EAAA,IAQEA,kBARF,sCAQuB,GARvB;EAAA,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5B,MAAM,EAAEqB,kBAAA,CAAUY,MA3FC;;EA4FnB;AACF;AACA;EACEhC,kBAAkB,EAAEoB,kBAAA,CAAUa,UAAV,CAAqBC,MAArB;AA/FD,CAArB;;eAkGe,IAAAC,gBAAA,EAAWC,eAAX,EAAmB;EAAEC,IAAI,EAAE;AAAR,CAAnB,EAAyCvD,QAAzC,C"}
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionContainer.js","names":["ActionContainer","id","classes","onClose","action","actionCallback","others","actionContainer","closeAction","iconContainer","actionsInnerContainer","propTypes","PropTypes","string","instanceOf","Object","func","oneOfType","node","arrayOf","shape","isRequired","label","icon","disabled","bool","withStyles","styles","name"],"sources":["../../../../src/Banner/
|
|
1
|
+
{"version":3,"file":"ActionContainer.js","names":["ActionContainer","id","classes","onClose","action","actionCallback","others","actionContainer","closeAction","iconContainer","actionsInnerContainer","propTypes","PropTypes","string","instanceOf","Object","func","oneOfType","node","arrayOf","shape","isRequired","label","icon","disabled","bool","withStyles","styles","name"],"sources":["../../../../src/Banner/BannerContent/ActionContainer/ActionContainer.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes, { oneOfType } from \"prop-types\";\nimport { withStyles } from \"@material-ui/core\";\nimport { Close } from \"@hitachivantara/uikit-react-icons\";\nimport ActionsGeneric from \"../../../ActionsGeneric\";\nimport HvButton from \"../../../Button\";\nimport styles from \"./styles\";\n\nconst ActionContainer = ({ id, classes, onClose, action, actionCallback, ...others }) => {\n return (\n <div className={classes.actionContainer}>\n <HvButton\n icon\n className={classes.closeAction}\n category=\"semantic\"\n aria-label=\"Close\"\n onClick={onClose}\n tabIndex={0}\n {...others}\n >\n <Close iconSize=\"XS\" className={classes.iconContainer} color=\"base2\" />\n </HvButton>\n {action && (\n <div className={classes.actionsInnerContainer}>\n <ActionsGeneric\n id={id}\n category=\"semantic\"\n actions={action}\n actionsCallback={actionCallback}\n />\n </div>\n )}\n </div>\n );\n};\n\nActionContainer.propTypes = {\n /**\n * Identifier.\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied to the button.\n */\n classes: PropTypes.instanceOf(Object),\n /**\n * onClose function.\n */\n onClose: PropTypes.func,\n /**\n * Actions to display.\n */\n action: oneOfType([\n PropTypes.node,\n PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n icon: PropTypes.func,\n disabled: PropTypes.bool,\n })\n ),\n ]),\n /**\n * The callback function ran when an action is triggered, receiving `action` as param\n */\n actionCallback: PropTypes.func,\n};\n\nexport default withStyles(styles, { name: \"HvActionContainer\" })(ActionContainer);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,OAAiE;EAAA,IAA9DC,EAA8D,QAA9DA,EAA8D;EAAA,IAA1DC,OAA0D,QAA1DA,OAA0D;EAAA,IAAjDC,OAAiD,QAAjDA,OAAiD;EAAA,IAAxCC,MAAwC,QAAxCA,MAAwC;EAAA,IAAhCC,cAAgC,QAAhCA,cAAgC;EAAA,IAAbC,MAAa;EACvF,oBACE;IAAK,SAAS,EAAEJ,OAAO,CAACK;EAAxB,gBACE,6BAAC,eAAD;IACE,IAAI,MADN;IAEE,SAAS,EAAEL,OAAO,CAACM,WAFrB;IAGE,QAAQ,EAAC,UAHX;IAIE,cAAW,OAJb;IAKE,OAAO,EAAEL,OALX;IAME,QAAQ,EAAE;EANZ,GAOMG,MAPN,gBASE,6BAAC,sBAAD;IAAO,QAAQ,EAAC,IAAhB;IAAqB,SAAS,EAAEJ,OAAO,CAACO,aAAxC;IAAuD,KAAK,EAAC;EAA7D,EATF,CADF,EAYGL,MAAM,iBACL;IAAK,SAAS,EAAEF,OAAO,CAACQ;EAAxB,gBACE,6BAAC,uBAAD;IACE,EAAE,EAAET,EADN;IAEE,QAAQ,EAAC,UAFX;IAGE,OAAO,EAAEG,MAHX;IAIE,eAAe,EAAEC;EAJnB,EADF,CAbJ,CADF;AAyBD,CA1BD;;AA4BA,wCAAAL,eAAe,CAACW,SAAhB,GAA4B;EAC1B;AACF;AACA;EACEV,EAAE,EAAEW,kBAAA,CAAUC,MAJY;;EAK1B;AACF;AACA;EACEX,OAAO,EAAEU,kBAAA,CAAUE,UAAV,CAAqBC,MAArB,CARiB;;EAS1B;AACF;AACA;EACEZ,OAAO,EAAES,kBAAA,CAAUI,IAZO;;EAa1B;AACF;AACA;EACEZ,MAAM,EAAE,IAAAa,oBAAA,EAAU,CAChBL,kBAAA,CAAUM,IADM,EAEhBN,kBAAA,CAAUO,OAAV,CACEP,kBAAA,CAAUQ,KAAV,CAAgB;IACdnB,EAAE,EAAEW,kBAAA,CAAUC,MAAV,CAAiBQ,UADP;IAEdC,KAAK,EAAEV,kBAAA,CAAUC,MAAV,CAAiBQ,UAFV;IAGdE,IAAI,EAAEX,kBAAA,CAAUI,IAHF;IAIdQ,QAAQ,EAAEZ,kBAAA,CAAUa;EAJN,CAAhB,CADF,CAFgB,CAAV,CAhBkB;;EA2B1B;AACF;AACA;EACEpB,cAAc,EAAEO,kBAAA,CAAUI;AA9BA,CAA5B;;eAiCe,IAAAU,gBAAA,EAAWC,eAAX,EAAmB;EAAEC,IAAI,EAAE;AAAR,CAAnB,EAAkD5B,eAAlD,C"}
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/Banner/
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/Banner/BannerContent/ActionContainer/index.js"],"sourcesContent":["export { default } from \"./ActionContainer\";\n"],"mappings":";;;;;;;;;;;;;;AAAA"}
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","actionContainer","display","flexDirection","height","justifyContent","actionsInnerContainer","marginTop","closeAction","alignSelf","cursor","backgroundColor","fade","hv","palette","base","base1","outlineStyles","iconContainer","width"],"sources":["../../../../src/Banner/
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","actionContainer","display","flexDirection","height","justifyContent","actionsInnerContainer","marginTop","closeAction","alignSelf","cursor","backgroundColor","fade","hv","palette","base","base1","outlineStyles","iconContainer","width"],"sources":["../../../../src/Banner/BannerContent/ActionContainer/styles.js"],"sourcesContent":["import fade from \"../../../utils/hexToRgbA\";\nimport { outlineStyles } from \"../../../Focus/styles\";\n\nconst styles = (theme) => ({\n actionContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n height: \"100%\",\n justifyContent: \"space-between\",\n },\n actionsInnerContainer: {\n flexDirection: \"row\",\n marginTop: \"8px\", // avoid overlap with close button outline focus ring\n },\n closeAction: {\n alignSelf: \"flex-end\",\n cursor: \"pointer\",\n \"&:hover\": {\n backgroundColor: fade(theme.hv.palette.base.base1, 0.3),\n },\n \"&:focus\": {\n ...outlineStyles,\n },\n },\n iconContainer: {\n width: \"32px\",\n height: \"32px\",\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;EAAA,OAAY;IACzBC,eAAe,EAAE;MACfC,OAAO,EAAE,MADM;MAEfC,aAAa,EAAE,QAFA;MAGfC,MAAM,EAAE,MAHO;MAIfC,cAAc,EAAE;IAJD,CADQ;IAOzBC,qBAAqB,EAAE;MACrBH,aAAa,EAAE,KADM;MAErBI,SAAS,EAAE,KAFU,CAEH;;IAFG,CAPE;IAWzBC,WAAW,EAAE;MACXC,SAAS,EAAE,UADA;MAEXC,MAAM,EAAE,SAFG;MAGX,WAAW;QACTC,eAAe,EAAE,IAAAC,kBAAA,EAAKZ,KAAK,CAACa,EAAN,CAASC,OAAT,CAAiBC,IAAjB,CAAsBC,KAA3B,EAAkC,GAAlC;MADR,CAHA;MAMX,6BACKC,qBADL;IANW,CAXY;IAqBzBC,aAAa,EAAE;MACbC,KAAK,EAAE,MADM;MAEbf,MAAM,EAAE;IAFK;EArBU,CAAZ;AAAA,CAAf;;eA2BeL,M"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StandardProps, SnackbarContentProps } from "@material-ui/core";
|
|
3
|
+
import {
|
|
4
|
+
ActionsPositionProp,
|
|
5
|
+
HvActionsGenericCommonProps,
|
|
6
|
+
HvButtonProps,
|
|
7
|
+
NotificationsCommonProps,
|
|
8
|
+
SemanticVariantTypes,
|
|
9
|
+
} from "../..";
|
|
10
|
+
|
|
11
|
+
export type HvBannerContentClassKey =
|
|
12
|
+
| "root"
|
|
13
|
+
| "message"
|
|
14
|
+
| "action"
|
|
15
|
+
| "baseVariant"
|
|
16
|
+
| "outContainer"
|
|
17
|
+
| SemanticVariantTypes;
|
|
18
|
+
|
|
19
|
+
export interface HvBannerContentProps
|
|
20
|
+
extends StandardProps<SnackbarContentProps, HvBannerContentClassKey, "variant">,
|
|
21
|
+
HvActionsGenericCommonProps,
|
|
22
|
+
Pick<NotificationsCommonProps, "showIcon" | "customIcon" | "variant"> {
|
|
23
|
+
/**
|
|
24
|
+
* The position property of the header.
|
|
25
|
+
*/
|
|
26
|
+
actionsPosition?: ActionsPositionProp;
|
|
27
|
+
/**
|
|
28
|
+
* The message to display.
|
|
29
|
+
*/
|
|
30
|
+
content?: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* onClose function.
|
|
33
|
+
*/
|
|
34
|
+
onClose?: HvButtonProps["onClick"];
|
|
35
|
+
/**
|
|
36
|
+
* The props to pass down to the Action Container.
|
|
37
|
+
*/
|
|
38
|
+
actionProps?: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default function HvBannerContent(props: HvBannerContentProps): JSX.Element | null;
|
package/dist/Banner/{BannerWrapper/BannerContentWrapper.js → BannerContent/BannerContent.js}
RENAMED
|
@@ -47,7 +47,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
47
47
|
|
|
48
48
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var HvBannerContent = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
51
51
|
var id = props.id,
|
|
52
52
|
classes = props.classes,
|
|
53
53
|
_props$showIcon = props.showIcon,
|
|
@@ -99,7 +99,7 @@ var HvBannerContentWrapper = /*#__PURE__*/_react.default.forwardRef(function (pr
|
|
|
99
99
|
}, others)));
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
-
process.env.NODE_ENV !== "production" ?
|
|
102
|
+
process.env.NODE_ENV !== "production" ? HvBannerContent.propTypes = {
|
|
103
103
|
/**
|
|
104
104
|
* Identifier.
|
|
105
105
|
*/
|
|
@@ -162,8 +162,8 @@ process.env.NODE_ENV !== "production" ? HvBannerContentWrapper.propTypes = {
|
|
|
162
162
|
} : void 0;
|
|
163
163
|
|
|
164
164
|
var _default = (0, _core.withStyles)(_styles.default, {
|
|
165
|
-
name: "
|
|
166
|
-
})(
|
|
165
|
+
name: "HvBannerContent"
|
|
166
|
+
})(HvBannerContent);
|
|
167
167
|
|
|
168
168
|
exports.default = _default;
|
|
169
|
-
//# sourceMappingURL=
|
|
169
|
+
//# sourceMappingURL=BannerContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerContent.js","names":["HvBannerContent","React","forwardRef","props","ref","id","classes","showIcon","customIcon","variant","onClose","actions","actionsCallback","actionsPosition","content","actionProps","others","icon","iconVariant","effectiveActionsPosition","outContainer","root","message","action","clsx","baseVariant","actionsOnMessage","actionsOnMessageCallback","actionCallback","propTypes","PropTypes","string","instanceOf","Object","node","oneOf","bool","func","oneOfType","arrayOf","shape","isRequired","label","disabled","withStyles","styles","name"],"sources":["../../../src/Banner/BannerContent/BannerContent.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes, { oneOfType } from \"prop-types\";\nimport clsx from \"clsx\";\nimport { SnackbarContent, withStyles } from \"@material-ui/core\";\nimport iconVariant from \"../../utils/iconVariant\";\nimport MessageContainer from \"./MessageContainer\";\nimport ActionContainer from \"./ActionContainer\";\nimport styles from \"./styles\";\n\nconst HvBannerContent = React.forwardRef((props, ref) => {\n const {\n id,\n classes,\n showIcon = false,\n customIcon,\n variant = \"default\",\n onClose,\n actions,\n actionsCallback,\n actionsPosition = \"auto\",\n content,\n actionProps,\n ...others\n } = props;\n\n const icon = customIcon || (showIcon && iconVariant(variant, \"base2\"));\n\n // default to inline\n // this might try to be more intelligent in the future,\n // taking into account the content length, available space,\n // number of actions, etc..\n const effectiveActionsPosition = actionsPosition === \"auto\" ? \"inline\" : actionsPosition;\n\n return (\n <div className={classes.outContainer}>\n <SnackbarContent\n ref={ref}\n id={id}\n classes={{\n root: classes.root,\n message: classes.message,\n action: classes.action,\n }}\n className={clsx(classes[variant], classes.baseVariant)}\n message={\n <MessageContainer\n id={id}\n icon={icon}\n {...(effectiveActionsPosition === \"inline\" && {\n actionsOnMessage: actions,\n actionsOnMessageCallback: actionsCallback,\n })}\n message={content}\n />\n }\n action={\n <ActionContainer\n id={id}\n onClose={onClose}\n {...(effectiveActionsPosition === \"bottom-right\" && {\n action: actions,\n actionCallback: actionsCallback,\n })}\n {...actionProps}\n />\n }\n {...others}\n />\n </div>\n );\n});\n\nHvBannerContent.propTypes = {\n /**\n * Identifier.\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes: PropTypes.instanceOf(Object),\n /**\n * The message to display.\n */\n content: PropTypes.node,\n /**\n * Variant of the snackbar.\n */\n variant: PropTypes.oneOf([\"success\", \"warning\", \"error\", \"info\", \"default\"]),\n /**\n * Controls if the associated icon to the variant should be shown.\n */\n showIcon: PropTypes.bool,\n /**\n * Custom icon to replace the variant default.\n */\n customIcon: PropTypes.node,\n /**\n * onClose function.\n */\n onClose: PropTypes.func,\n /**\n * Actions to display on the right side.\n */\n actions: oneOfType([\n PropTypes.node,\n PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n icon: PropTypes.func,\n disabled: PropTypes.bool,\n })\n ),\n ]),\n /**\n * The callback function ran when an action is triggered, receiving `action` as param\n */\n actionsCallback: PropTypes.func,\n /**\n * The position property of the header.\n */\n actionsPosition: PropTypes.PropTypes.oneOf([\"auto\", \"inline\", \"bottom-right\"]),\n /**\n * The props to pass down to the Action Container.\n */\n actionProps: PropTypes.instanceOf(Object),\n};\n\nexport default withStyles(styles, { name: \"HvBannerContent\" })(HvBannerContent);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,IAAMA,eAAe,gBAAGC,cAAA,CAAMC,UAAN,CAAiB,UAACC,KAAD,EAAQC,GAAR,EAAgB;EACvD,IACEC,EADF,GAaIF,KAbJ,CACEE,EADF;EAAA,IAEEC,OAFF,GAaIH,KAbJ,CAEEG,OAFF;EAAA,sBAaIH,KAbJ,CAGEI,QAHF;EAAA,IAGEA,QAHF,gCAGa,KAHb;EAAA,IAIEC,UAJF,GAaIL,KAbJ,CAIEK,UAJF;EAAA,qBAaIL,KAbJ,CAKEM,OALF;E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,kBAAA,CAAUA,SAAV,CAAoBK,KAApB,CAA0B,CAAC,MAAD,EAAS,QAAT,EAAmB,cAAnB,CAA1B,CAlDS;;EAmD1B;AACF;AACA;EACEpB,WAAW,EAAEe,kBAAA,CAAUE,UAAV,CAAqBC,MAArB;AAtDa,CAA5B;;eAyDe,IAAAW,gBAAA,EAAWC,eAAX,EAAmB;EAAEC,IAAI,EAAE;AAAR,CAAnB,EAAgD9C,eAAhD,C"}
|
|
File without changes
|
package/dist/Banner/{BannerWrapper → BannerContent}/MessageContainer/MessageContainer.js.map
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageContainer.js","names":["MessageContainer","id","classes","icon","actionsOnMessage","actionsOnMessageCallback","message","iconContainer","setId","actionMessageContainer","propTypes","PropTypes","string","instanceOf","Object","node","oneOfType","arrayOf","shape","isRequired","label","func","disabled","bool","withStyles","styles","name"],"sources":["../../../../src/Banner/
|
|
1
|
+
{"version":3,"file":"MessageContainer.js","names":["MessageContainer","id","classes","icon","actionsOnMessage","actionsOnMessageCallback","message","iconContainer","setId","actionMessageContainer","propTypes","PropTypes","string","instanceOf","Object","node","oneOfType","arrayOf","shape","isRequired","label","func","disabled","bool","withStyles","styles","name"],"sources":["../../../../src/Banner/BannerContent/MessageContainer/MessageContainer.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes, { oneOfType } from \"prop-types\";\nimport { withStyles } from \"@material-ui/core\";\nimport HvTypography from \"../../../Typography\";\nimport ActionsGeneric from \"../../../ActionsGeneric\";\nimport { setId } from \"../../../utils\";\nimport styles from \"./styles\";\n\nconst MessageContainer = ({\n id,\n classes,\n icon,\n actionsOnMessage,\n actionsOnMessageCallback,\n message,\n}) => (\n <>\n {icon && <div className={classes.iconContainer}>{icon}</div>}\n <HvTypography id={setId(id, \"message-text\")} className={classes.message}>\n {message}\n </HvTypography>\n {actionsOnMessage && (\n <div id={setId(id, \"message-actions\")} className={classes.actionMessageContainer}>\n <ActionsGeneric\n id={id}\n category=\"semantic\"\n actions={actionsOnMessage}\n actionsCallback={actionsOnMessageCallback}\n />\n </div>\n )}\n </>\n);\n\nMessageContainer.propTypes = {\n /**\n * Identifier.\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied to the button.\n */\n classes: PropTypes.instanceOf(Object),\n /**\n * Icon to be presented.\n */\n icon: PropTypes.node,\n /**\n * The message to display.\n */\n message: PropTypes.node,\n /**\n * Actions to display on message.\n */\n actionsOnMessage: oneOfType([\n PropTypes.node,\n PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n icon: PropTypes.func,\n disabled: PropTypes.bool,\n })\n ),\n ]),\n /**\n * The callback function ran when an action is triggered, receiving `actionsOnMessage` as param\n */\n actionsOnMessageCallback: PropTypes.func,\n};\n\nexport default withStyles(styles, { name: \"HvMessageContainer\" })(MessageContainer);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB;EAAA,IACvBC,EADuB,QACvBA,EADuB;EAAA,IAEvBC,OAFuB,QAEvBA,OAFuB;EAAA,IAGvBC,IAHuB,QAGvBA,IAHuB;EAAA,IAIvBC,gBAJuB,QAIvBA,gBAJuB;EAAA,IAKvBC,wBALuB,QAKvBA,wBALuB;EAAA,IAMvBC,OANuB,QAMvBA,OANuB;EAAA,oBAQvB,4DACGH,IAAI,iBAAI;IAAK,SAAS,EAAED,OAAO,CAACK;EAAxB,GAAwCJ,IAAxC,CADX,eAEE,6BAAC,mBAAD;IAAc,EAAE,EAAE,IAAAK,YAAA,EAAMP,EAAN,EAAU,cAAV,CAAlB;IAA6C,SAAS,EAAEC,OAAO,CAACI;EAAhE,GACGA,OADH,CAFF,EAKGF,gBAAgB,iBACf;IAAK,EAAE,EAAE,IAAAI,YAAA,EAAMP,EAAN,EAAU,iBAAV,CAAT;IAAuC,SAAS,EAAEC,OAAO,CAACO;EAA1D,gBACE,6BAAC,uBAAD;IACE,EAAE,EAAER,EADN;IAEE,QAAQ,EAAC,UAFX;IAGE,OAAO,EAAEG,gBAHX;IAIE,eAAe,EAAEC;EAJnB,EADF,CANJ,CARuB;AAAA,CAAzB;;AA0BA,wCAAAL,gBAAgB,CAACU,SAAjB,GAA6B;EAC3B;AACF;AACA;EACET,EAAE,EAAEU,kBAAA,CAAUC,MAJa;;EAK3B;AACF;AACA;EACEV,OAAO,EAAES,kBAAA,CAAUE,UAAV,CAAqBC,MAArB,CARkB;;EAS3B;AACF;AACA;EACEX,IAAI,EAAEQ,kBAAA,CAAUI,IAZW;;EAa3B;AACF;AACA;EACET,OAAO,EAAEK,kBAAA,CAAUI,IAhBQ;;EAiB3B;AACF;AACA;EACEX,gBAAgB,EAAE,IAAAY,oBAAA,EAAU,CAC1BL,kBAAA,CAAUI,IADgB,EAE1BJ,kBAAA,CAAUM,OAAV,CACEN,kBAAA,CAAUO,KAAV,CAAgB;IACdjB,EAAE,EAAEU,kBAAA,CAAUC,MAAV,CAAiBO,UADP;IAEdC,KAAK,EAAET,kBAAA,CAAUC,MAAV,CAAiBO,UAFV;IAGdhB,IAAI,EAAEQ,kBAAA,CAAUU,IAHF;IAIdC,QAAQ,EAAEX,kBAAA,CAAUY;EAJN,CAAhB,CADF,CAF0B,CAAV,CApBS;;EA+B3B;AACF;AACA;EACElB,wBAAwB,EAAEM,kBAAA,CAAUU;AAlCT,CAA7B;;eAqCe,IAAAG,gBAAA,EAAWC,eAAX,EAAmB;EAAEC,IAAI,EAAE;AAAR,CAAnB,EAAmD1B,gBAAnD,C"}
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/Banner/
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/Banner/BannerContent/MessageContainer/index.js"],"sourcesContent":["export { default } from \"./MessageContainer\";\n"],"mappings":";;;;;;;;;;;;;;AAAA"}
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","message","color","hv","palette","base","base2","wordBreak","maxWidth","overflow","marginRight","iconContainer","spacing","xs","marginLeft","actionMessageContainer","flex"],"sources":["../../../../src/Banner/
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","message","color","hv","palette","base","base2","wordBreak","maxWidth","overflow","marginRight","iconContainer","spacing","xs","marginLeft","actionMessageContainer","flex"],"sources":["../../../../src/Banner/BannerContent/MessageContainer/styles.js"],"sourcesContent":["const styles = (theme) => ({\n message: {\n color: theme.hv.palette.base.base2,\n wordBreak: \"break-word\",\n maxWidth: \"700px\",\n overflow: \"hidden\",\n marginRight: 10,\n },\n iconContainer: {\n marginRight: theme.hv.spacing.xs,\n marginLeft: -theme.hv.spacing.xs,\n },\n actionMessageContainer: {\n flex: \"0 0 auto\",\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;;AAAA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;EAAA,OAAY;IACzBC,OAAO,EAAE;MACPC,KAAK,EAAEF,KAAK,CAACG,EAAN,CAASC,OAAT,CAAiBC,IAAjB,CAAsBC,KADtB;MAEPC,SAAS,EAAE,YAFJ;MAGPC,QAAQ,EAAE,OAHH;MAIPC,QAAQ,EAAE,QAJH;MAKPC,WAAW,EAAE;IALN,CADgB;IAQzBC,aAAa,EAAE;MACbD,WAAW,EAAEV,KAAK,CAACG,EAAN,CAASS,OAAT,CAAiBC,EADjB;MAEbC,UAAU,EAAE,CAACd,KAAK,CAACG,EAAN,CAASS,OAAT,CAAiBC;IAFjB,CARU;IAYzBE,sBAAsB,EAAE;MACtBC,IAAI,EAAE;IADgB;EAZC,CAAZ;AAAA,CAAf;;eAiBejB,M"}
|
|
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
Object.defineProperty(exports, "default", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
|
-
return
|
|
11
|
+
return _BannerContent.default;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _BannerContent = _interopRequireDefault(require("./BannerContent"));
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/Banner/BannerContent/index.js"],"sourcesContent":["export { default } from \"./BannerContent\";\n"],"mappings":";;;;;;;;;;;;;;AAAA"}
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","minWidth","position","display","flexWrap","message","alignItems","padding","hvSpacing","paddingLeft","hv","spacing","sm","action","marginRight","flex","placeSelf","baseVariant","success","backgroundColor","palette","semantic","sema8","warning","sema20","error","sema9","default","sema7","outContainer","width"],"sources":["../../../src/Banner/
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","minWidth","position","display","flexWrap","message","alignItems","padding","hvSpacing","paddingLeft","hv","spacing","sm","action","marginRight","flex","placeSelf","baseVariant","success","backgroundColor","palette","semantic","sema8","warning","sema20","error","sema9","default","sema7","outContainer","width"],"sources":["../../../src/Banner/BannerContent/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n minWidth: \"100%\",\n position: \"relative\",\n display: \"flex\",\n flexWrap: \"nowrap\",\n },\n message: {\n display: \"flex\",\n alignItems: \"center\",\n padding: theme.hvSpacing(\"xs\", 0),\n paddingLeft: theme.hv.spacing.sm,\n },\n action: {\n padding: theme.hvSpacing(\"xs\"),\n marginRight: 0,\n flex: \"0 0 auto\",\n placeSelf: \"stretch\",\n },\n baseVariant: {\n padding: 0,\n },\n success: {\n backgroundColor: theme.hv.palette.semantic.sema8,\n },\n warning: {\n backgroundColor: theme.hv.palette.semantic.sema20,\n },\n error: {\n backgroundColor: theme.hv.palette.semantic.sema9,\n },\n default: {\n backgroundColor: theme.hv.palette.semantic.sema7,\n },\n outContainer: {\n width: \"100%\",\n position: \"relative\",\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;;AAAA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;EAAA,OAAY;IACzBC,IAAI,EAAE;MACJC,QAAQ,EAAE,MADN;MAEJC,QAAQ,EAAE,UAFN;MAGJC,OAAO,EAAE,MAHL;MAIJC,QAAQ,EAAE;IAJN,CADmB;IAOzBC,OAAO,EAAE;MACPF,OAAO,EAAE,MADF;MAEPG,UAAU,EAAE,QAFL;MAGPC,OAAO,EAAER,KAAK,CAACS,SAAN,CAAgB,IAAhB,EAAsB,CAAtB,CAHF;MAIPC,WAAW,EAAEV,KAAK,CAACW,EAAN,CAASC,OAAT,CAAiBC;IAJvB,CAPgB;IAazBC,MAAM,EAAE;MACNN,OAAO,EAAER,KAAK,CAACS,SAAN,CAAgB,IAAhB,CADH;MAENM,WAAW,EAAE,CAFP;MAGNC,IAAI,EAAE,UAHA;MAINC,SAAS,EAAE;IAJL,CAbiB;IAmBzBC,WAAW,EAAE;MACXV,OAAO,EAAE;IADE,CAnBY;IAsBzBW,OAAO,EAAE;MACPC,eAAe,EAAEpB,KAAK,CAACW,EAAN,CAASU,OAAT,CAAiBC,QAAjB,CAA0BC;IADpC,CAtBgB;IAyBzBC,OAAO,EAAE;MACPJ,eAAe,EAAEpB,KAAK,CAACW,EAAN,CAASU,OAAT,CAAiBC,QAAjB,CAA0BG;IADpC,CAzBgB;IA4BzBC,KAAK,EAAE;MACLN,eAAe,EAAEpB,KAAK,CAACW,EAAN,CAASU,OAAT,CAAiBC,QAAjB,CAA0BK;IADtC,CA5BkB;IA+BzBC,OAAO,EAAE;MACPR,eAAe,EAAEpB,KAAK,CAACW,EAAN,CAASU,OAAT,CAAiBC,QAAjB,CAA0BO;IADpC,CA/BgB;IAkCzBC,YAAY,EAAE;MACZC,KAAK,EAAE,MADK;MAEZ5B,QAAQ,EAAE;IAFE;EAlCW,CAAZ;AAAA,CAAf;;eAwCeJ,M"}
|
package/dist/Banner/index.d.ts
CHANGED
package/dist/Banner/index.js
CHANGED
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
Object.defineProperty(exports, "HvBannerContent", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
|
-
return
|
|
11
|
+
return _BannerContent.default;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "default", {
|
|
@@ -20,5 +20,5 @@ Object.defineProperty(exports, "default", {
|
|
|
20
20
|
|
|
21
21
|
var _Banner = _interopRequireDefault(require("./Banner"));
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _BannerContent = _interopRequireDefault(require("./BannerContent"));
|
|
24
24
|
//# sourceMappingURL=index.js.map
|
package/dist/Banner/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/Banner/index.js"],"sourcesContent":["export { default } from \"./Banner\";\nexport { default as HvBannerContent } from \"./
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/Banner/index.js"],"sourcesContent":["export { default } from \"./Banner\";\nexport { default as HvBannerContent } from \"./BannerContent\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;AACA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StandardProps, SwitchProps } from "@material-ui/core";
|
|
2
2
|
|
|
3
|
-
export type HvBaseSwitchClassKey = "root" | "disabled";
|
|
3
|
+
export type HvBaseSwitchClassKey = "root" | "disabled" | "readOnly";
|
|
4
4
|
|
|
5
5
|
export interface HvBaseSwitchProps
|
|
6
6
|
extends StandardProps<SwitchProps, HvBaseSwitchClassKey, "onChange"> {
|
|
@@ -95,7 +95,7 @@ var HvBaseSwitch = function HvBaseSwitch(props) {
|
|
|
95
95
|
return /*#__PURE__*/_react.default.createElement(_core.Switch, (0, _extends2.default)({
|
|
96
96
|
id: id,
|
|
97
97
|
name: name,
|
|
98
|
-
className: (0, _clsx.default)(className, classes.root, disabled && classes.disabled, focusVisible && classes.focusVisible),
|
|
98
|
+
className: (0, _clsx.default)(className, classes.root, disabled && classes.disabled, readOnly && classes.readOnly, focusVisible && classes.focusVisible),
|
|
99
99
|
color: "default",
|
|
100
100
|
disabled: disabled,
|
|
101
101
|
required: required,
|
|
@@ -139,6 +139,11 @@ process.env.NODE_ENV !== "production" ? HvBaseSwitch.propTypes = {
|
|
|
139
139
|
*/
|
|
140
140
|
disabled: _propTypes.default.string,
|
|
141
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Styles applied to the switch when it is in read only mode.
|
|
144
|
+
*/
|
|
145
|
+
readOnly: _propTypes.default.string,
|
|
146
|
+
|
|
142
147
|
/**
|
|
143
148
|
* Styles applied to the internal Switch component's root class.
|
|
144
149
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSwitch.js","names":["HvBaseSwitch","props","classes","className","id","name","value","required","readOnly","disabled","checked","defaultChecked","onChange","inputProps","onFocusVisible","onBlur","others","useState","focusVisible","setFocusVisible","onFocusVisibleCallback","useCallback","evt","onBlurCallback","onLocalChange","target","clsx","root","switch","switchBase","track","thumb","propTypes","PropTypes","string","shape","isRequired","any","bool","func","instanceOf","Object","withStyles","styles"],"sources":["../../src/BaseSwitch/BaseSwitch.js"],"sourcesContent":["import React, { useState, useCallback } from \"react\";\n\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { Switch, withStyles } from \"@material-ui/core\";\n\nimport styles from \"./styles\";\n\n/**\n * A Switch is <b>binary</b> and work as a digital on/off button.\n *\n * The Base Switch is a building block of the Switch form element. Don't use unless\n * implementing a custom use case not covered by the Switch form element.\n */\nconst HvBaseSwitch = (props) => {\n const {\n classes,\n className,\n\n id,\n name,\n value = \"on\",\n\n required = false,\n readOnly = false,\n disabled = false,\n\n checked,\n defaultChecked,\n\n onChange,\n\n inputProps,\n\n onFocusVisible,\n onBlur,\n\n ...others\n } = props;\n\n const [focusVisible, setFocusVisible] = useState(false);\n\n const onFocusVisibleCallback = useCallback(\n (evt) => {\n setFocusVisible(true);\n onFocusVisible?.(evt);\n },\n [onFocusVisible]\n );\n\n const onBlurCallback = useCallback(\n (evt) => {\n setFocusVisible(false);\n onBlur?.(evt);\n },\n [onBlur]\n );\n\n const onLocalChange = useCallback(\n (evt) => {\n if (readOnly) {\n return;\n }\n\n onChange?.(evt, evt.target.checked, value);\n },\n [onChange, readOnly, value]\n );\n\n return (\n <Switch\n id={id}\n name={name}\n className={clsx(className, classes.root, {\n [classes.disabled]: disabled,\n [classes.focusVisible]: focusVisible,\n })}\n color=\"default\"\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n disableRipple\n onChange={onLocalChange}\n value={value}\n checked={checked}\n defaultChecked={defaultChecked}\n classes={{\n root: classes.switch,\n switchBase: classes.switchBase,\n checked: classes.checked,\n track: classes.track,\n thumb: classes.thumb,\n disabled: classes.disabled,\n }}\n inputProps={inputProps}\n onFocusVisible={onFocusVisibleCallback}\n onBlur={onBlurCallback}\n {...others}\n />\n );\n};\n\nHvBaseSwitch.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied to the switch.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the switch when it is disabled.\n */\n disabled: PropTypes.string,\n /**\n * Styles applied to the internal Switch component's root class.\n */\n switch: PropTypes.string,\n /**\n * Styles applied to the internal SwitchBase component's root class.\n */\n switchBase: PropTypes.string,\n /**\n * Pseudo-class applied to the internal SwitchBase component's checked class.\n */\n checked: PropTypes.string,\n /**\n * Styles applied to the track element.\n */\n track: PropTypes.string,\n /**\n * Styles used to create the thumb passed to the internal SwitchBase component icon prop.\n */\n thumb: PropTypes.string,\n /**\n * Class applied to the root element if keyboard focused.\n */\n focusVisible: PropTypes.string,\n }).isRequired,\n\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n\n /**\n * The input name.\n */\n name: PropTypes.string,\n /**\n * The value of the input.\n *\n * Is up to the application's logic when to consider the submission of this value.\n * Generally it should be used only when the switch is neither unchecked nor indeterminate.\n *\n * The default value is \"on\".\n */\n // eslint-disable-next-line react/forbid-prop-types\n value: PropTypes.any,\n\n /**\n * Indicates that user input is required.\n */\n required: PropTypes.bool,\n /**\n * Indicates that the input is not editable.\n */\n readOnly: PropTypes.bool,\n /**\n * Indicates that the input is disabled.\n */\n disabled: PropTypes.bool,\n\n /**\n * If `true` the switch is selected, if set to `false` the switch is not selected.\n *\n * When defined the switch state becomes controlled.\n */\n checked: PropTypes.bool,\n /**\n * When uncontrolled, defines the initial checked state.\n */\n defaultChecked: PropTypes.bool,\n\n /**\n * The callback fired when the switch is pressed.\n */\n onChange: PropTypes.func,\n\n /**\n * Properties passed on to the input element.\n */\n inputProps: PropTypes.instanceOf(Object),\n\n /**\n * Callback fired when the component is focused with a keyboard.\n * We trigger a `onFocus` callback too.\n */\n onFocusVisible: PropTypes.func,\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n};\n\nexport default withStyles(styles, { name: \"HvBaseSwitch\" })(HvBaseSwitch);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AAEA;;AAEA;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAW;EAC9B,IACEC,OADF,GAuBID,KAvBJ,CACEC,OADF;EAAA,IAEEC,SAFF,GAuBIF,KAvBJ,CAEEE,SAFF;EAAA,IAIEC,EAJF,GAuBIH,KAvBJ,CAIEG,EAJF;EAAA,IAKEC,IALF,GAuBIJ,KAvBJ,CAKEI,IALF;EAAA,mBAuBIJ,KAvBJ,CAMEK,KANF;EAAA,IAMEA,KANF,6BAMU,IANV;EAAA,sBAuBIL,KA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CAACG,MAAJ,CAAWf,OAAnB,EAA4BJ,KAA5B,CAAR;EACD,CAPmB,EAQpB,CAACM,QAAD,EAAWJ,QAAX,EAAqBF,KAArB,CARoB,CAAtB;EAWA,oBACE,6BAAC,YAAD;IACE,EAAE,EAAEF,EADN;IAEE,IAAI,EAAEC,IAFR;IAGE,SAAS,EAAE,IAAAqB,aAAA,EAAKvB,SAAL,EAAgBD,OAAO,CAACyB,IAAxB,EACWlB,QADX,IACRP,OAAO,CAACO,QADA,
|
|
1
|
+
{"version":3,"file":"BaseSwitch.js","names":["HvBaseSwitch","props","classes","className","id","name","value","required","readOnly","disabled","checked","defaultChecked","onChange","inputProps","onFocusVisible","onBlur","others","useState","focusVisible","setFocusVisible","onFocusVisibleCallback","useCallback","evt","onBlurCallback","onLocalChange","target","clsx","root","switch","switchBase","track","thumb","propTypes","PropTypes","string","shape","isRequired","any","bool","func","instanceOf","Object","withStyles","styles"],"sources":["../../src/BaseSwitch/BaseSwitch.js"],"sourcesContent":["import React, { useState, useCallback } from \"react\";\n\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { Switch, withStyles } from \"@material-ui/core\";\n\nimport styles from \"./styles\";\n\n/**\n * A Switch is <b>binary</b> and work as a digital on/off button.\n *\n * The Base Switch is a building block of the Switch form element. Don't use unless\n * implementing a custom use case not covered by the Switch form element.\n */\nconst HvBaseSwitch = (props) => {\n const {\n classes,\n className,\n\n id,\n name,\n value = \"on\",\n\n required = false,\n readOnly = false,\n disabled = false,\n\n checked,\n defaultChecked,\n\n onChange,\n\n inputProps,\n\n onFocusVisible,\n onBlur,\n\n ...others\n } = props;\n\n const [focusVisible, setFocusVisible] = useState(false);\n\n const onFocusVisibleCallback = useCallback(\n (evt) => {\n setFocusVisible(true);\n onFocusVisible?.(evt);\n },\n [onFocusVisible]\n );\n\n const onBlurCallback = useCallback(\n (evt) => {\n setFocusVisible(false);\n onBlur?.(evt);\n },\n [onBlur]\n );\n\n const onLocalChange = useCallback(\n (evt) => {\n if (readOnly) {\n return;\n }\n\n onChange?.(evt, evt.target.checked, value);\n },\n [onChange, readOnly, value]\n );\n\n return (\n <Switch\n id={id}\n name={name}\n className={clsx(className, classes.root, {\n [classes.disabled]: disabled,\n [classes.readOnly]: readOnly,\n [classes.focusVisible]: focusVisible,\n })}\n color=\"default\"\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n disableRipple\n onChange={onLocalChange}\n value={value}\n checked={checked}\n defaultChecked={defaultChecked}\n classes={{\n root: classes.switch,\n switchBase: classes.switchBase,\n checked: classes.checked,\n track: classes.track,\n thumb: classes.thumb,\n disabled: classes.disabled,\n }}\n inputProps={inputProps}\n onFocusVisible={onFocusVisibleCallback}\n onBlur={onBlurCallback}\n {...others}\n />\n );\n};\n\nHvBaseSwitch.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied to the switch.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the switch when it is disabled.\n */\n disabled: PropTypes.string,\n /**\n * Styles applied to the switch when it is in read only mode.\n */\n readOnly: PropTypes.string,\n /**\n * Styles applied to the internal Switch component's root class.\n */\n switch: PropTypes.string,\n /**\n * Styles applied to the internal SwitchBase component's root class.\n */\n switchBase: PropTypes.string,\n /**\n * Pseudo-class applied to the internal SwitchBase component's checked class.\n */\n checked: PropTypes.string,\n /**\n * Styles applied to the track element.\n */\n track: PropTypes.string,\n /**\n * Styles used to create the thumb passed to the internal SwitchBase component icon prop.\n */\n thumb: PropTypes.string,\n /**\n * Class applied to the root element if keyboard focused.\n */\n focusVisible: PropTypes.string,\n }).isRequired,\n\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n\n /**\n * The input name.\n */\n name: PropTypes.string,\n /**\n * The value of the input.\n *\n * Is up to the application's logic when to consider the submission of this value.\n * Generally it should be used only when the switch is neither unchecked nor indeterminate.\n *\n * The default value is \"on\".\n */\n // eslint-disable-next-line react/forbid-prop-types\n value: PropTypes.any,\n\n /**\n * Indicates that user input is required.\n */\n required: PropTypes.bool,\n /**\n * Indicates that the input is not editable.\n */\n readOnly: PropTypes.bool,\n /**\n * Indicates that the input is disabled.\n */\n disabled: PropTypes.bool,\n\n /**\n * If `true` the switch is selected, if set to `false` the switch is not selected.\n *\n * When defined the switch state becomes controlled.\n */\n checked: PropTypes.bool,\n /**\n * When uncontrolled, defines the initial checked state.\n */\n defaultChecked: PropTypes.bool,\n\n /**\n * The callback fired when the switch is pressed.\n */\n onChange: PropTypes.func,\n\n /**\n * Properties passed on to the input element.\n */\n inputProps: PropTypes.instanceOf(Object),\n\n /**\n * Callback fired when the component is focused with a keyboard.\n * We trigger a `onFocus` callback too.\n */\n onFocusVisible: PropTypes.func,\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n};\n\nexport default withStyles(styles, { name: \"HvBaseSwitch\" })(HvBaseSwitch);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AAEA;;AAEA;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAW;EAC9B,IACEC,OADF,GAuBID,KAvBJ,CACEC,OADF;EAAA,IAEEC,SAFF,GAuBIF,KAvBJ,CAEEE,SAFF;EAAA,IAIEC,EAJF,GAuBIH,KAvBJ,CAIEG,EAJF;EAAA,IAKEC,IALF,GAuBIJ,KAvBJ,CAKEI,IALF;EAAA,mBAuBIJ,KAvBJ,CAMEK,KANF;EAAA,IAMEA,KANF,6BAMU,IANV;EAAA,sBAuBIL,KAvBJ,CAQEM,QARF;EAAA,IAQEA,QARF,gCAQa,KARb;EAAA,sBAuBIN,KAvBJ,CASEO,QATF;EAAA,IASEA,QATF,gCASa,KATb;EAAA,sBAuBIP,KAvBJ,CAUEQ,QAVF;EAAA,IAUEA,QAVF,gCAUa,KAVb;EAAA,IAYEC,OA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CL,YAA7C,C"}
|
|
@@ -46,7 +46,10 @@ var styles = function styles(theme) {
|
|
|
46
46
|
switch: {
|
|
47
47
|
padding: 0,
|
|
48
48
|
width: switchWidth,
|
|
49
|
-
height: 16
|
|
49
|
+
height: 16,
|
|
50
|
+
"&$readOnly $switchBase": {
|
|
51
|
+
cursor: "default"
|
|
52
|
+
}
|
|
50
53
|
},
|
|
51
54
|
switchBase: {
|
|
52
55
|
width: switchWidth,
|
|
@@ -97,6 +100,7 @@ var styles = function styles(theme) {
|
|
|
97
100
|
opacity: 1
|
|
98
101
|
}
|
|
99
102
|
},
|
|
103
|
+
readOnly: {},
|
|
100
104
|
focusVisible: _objectSpread({
|
|
101
105
|
borderRadius: "8px"
|
|
102
106
|
}, _styles.outlineStyles)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["switchWidth","thumbPosition","position","left","width","height","styles","theme","root","padding","cursor","switch","switchBase","backgroundColor","transform","opacity","hv","palette","accent","acce1","track","borderRadius","border","atmosphere","atmo2","thumb","atmo1","marginLeft","marginTop","checked","disabled","atmo3","atmo5","focusVisible","outlineStyles"],"sources":["../../src/BaseSwitch/styles.js"],"sourcesContent":["import { outlineStyles } from \"../Focus/styles\";\n\nconst switchWidth = 32;\n\nconst thumbPosition = {\n position: \"relative\",\n left: -9,\n width: 12,\n height: 12,\n};\n\nconst styles = (theme) => ({\n root: {\n padding: 0,\n cursor: \"pointer\",\n },\n\n switch: {\n padding: 0,\n width: switchWidth,\n height: 16,\n },\n\n switchBase: {\n width: switchWidth,\n height: 16,\n padding: 0,\n\n // increase CSS specificity\n \"&:hover\": {\n backgroundColor: \"transparent\",\n },\n \"&$checked\": {\n transform: \"translateX(16px)\",\n \"& + $track\": {\n opacity: 1,\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n \"&:hover\": {\n backgroundColor: \"transparent\",\n },\n },\n },\n\n track: {\n opacity: 1,\n borderRadius: 15,\n left: 17,\n height: 16,\n border: `solid 1px ${theme.hv.palette.accent.acce1}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo2,\n },\n\n thumb: {\n ...thumbPosition,\n border: `solid 1px ${theme.hv.palette.accent.acce1}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n marginLeft: 2,\n marginTop: 0,\n },\n\n checked: {},\n\n disabled: {\n cursor: \"not-allowed\",\n\n \"& $switch\": {\n cursor: \"not-allowed\",\n },\n\n \"& $thumb\": {\n backgroundColor: `${theme.hv.palette.atmosphere.atmo3}`,\n border: `solid 1px ${theme.hv.palette.atmosphere.atmo5}`,\n },\n\n \"& $switchBase + $track\": {\n backgroundColor: `${theme.hv.palette.atmosphere.atmo3}`,\n border: `solid 1px ${theme.hv.palette.atmosphere.atmo5}`,\n opacity: 1,\n },\n },\n\n focusVisible: {\n borderRadius: \"8px\",\n ...outlineStyles,\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAEA,IAAMA,WAAW,GAAG,EAApB;AAEA,IAAMC,aAAa,GAAG;EACpBC,QAAQ,EAAE,UADU;EAEpBC,IAAI,EAAE,CAAC,CAFa;EAGpBC,KAAK,EAAE,EAHa;EAIpBC,MAAM,EAAE;AAJY,CAAtB;;AAOA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;EAAA,OAAY;IACzBC,IAAI,EAAE;MACJC,OAAO,EAAE,CADL;MAEJC,MAAM,EAAE;IAFJ,CADmB;IAMzBC,MAAM,EAAE;MACNF,OAAO,EAAE,CADH;MAENL,KAAK,EAAEJ,WAFD;MAGNK,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"styles.js","names":["switchWidth","thumbPosition","position","left","width","height","styles","theme","root","padding","cursor","switch","switchBase","backgroundColor","transform","opacity","hv","palette","accent","acce1","track","borderRadius","border","atmosphere","atmo2","thumb","atmo1","marginLeft","marginTop","checked","disabled","atmo3","atmo5","readOnly","focusVisible","outlineStyles"],"sources":["../../src/BaseSwitch/styles.js"],"sourcesContent":["import { outlineStyles } from \"../Focus/styles\";\n\nconst switchWidth = 32;\n\nconst thumbPosition = {\n position: \"relative\",\n left: -9,\n width: 12,\n height: 12,\n};\n\nconst styles = (theme) => ({\n root: {\n padding: 0,\n cursor: \"pointer\",\n },\n\n switch: {\n padding: 0,\n width: switchWidth,\n height: 16,\n\n \"&$readOnly $switchBase\": {\n cursor: \"default\",\n },\n },\n\n switchBase: {\n width: switchWidth,\n height: 16,\n padding: 0,\n\n // increase CSS specificity\n \"&:hover\": {\n backgroundColor: \"transparent\",\n },\n \"&$checked\": {\n transform: \"translateX(16px)\",\n \"& + $track\": {\n opacity: 1,\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n \"&:hover\": {\n backgroundColor: \"transparent\",\n },\n },\n },\n\n track: {\n opacity: 1,\n borderRadius: 15,\n left: 17,\n height: 16,\n border: `solid 1px ${theme.hv.palette.accent.acce1}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo2,\n },\n\n thumb: {\n ...thumbPosition,\n border: `solid 1px ${theme.hv.palette.accent.acce1}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n marginLeft: 2,\n marginTop: 0,\n },\n\n checked: {},\n\n disabled: {\n cursor: \"not-allowed\",\n\n \"& $switch\": {\n cursor: \"not-allowed\",\n },\n\n \"& $thumb\": {\n backgroundColor: `${theme.hv.palette.atmosphere.atmo3}`,\n border: `solid 1px ${theme.hv.palette.atmosphere.atmo5}`,\n },\n\n \"& $switchBase + $track\": {\n backgroundColor: `${theme.hv.palette.atmosphere.atmo3}`,\n border: `solid 1px ${theme.hv.palette.atmosphere.atmo5}`,\n opacity: 1,\n },\n },\n\n readOnly: {},\n\n focusVisible: {\n borderRadius: \"8px\",\n ...outlineStyles,\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAEA,IAAMA,WAAW,GAAG,EAApB;AAEA,IAAMC,aAAa,GAAG;EACpBC,QAAQ,E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;MAIHC,UAAU,EAAE,CAJT;MAKHC,SAAS,EAAE;IALR,EA9CoB;IAsDzBC,OAAO,EAAE,EAtDgB;IAwDzBC,QAAQ,EAAE;MACRpB,MAAM,EAAE,aADA;MAGR,aAAa;QACXA,MAAM,EAAE;MADG,CAHL;MAOR,YAAY;QACVG,eAAe,YAAKN,KAAK,CAACS,EAAN,CAASC,OAAT,CAAiBM,UAAjB,CAA4BQ,KAAjC,CADL;QAEVT,MAAM,sBAAef,KAAK,CAACS,EAAN,CAASC,OAAT,CAAiBM,UAAjB,CAA4BS,KAA3C;MAFI,CAPJ;MAYR,0BAA0B;QACxBnB,eAAe,YAAKN,KAAK,CAACS,EAAN,CAASC,OAAT,CAAiBM,UAAjB,CAA4BQ,KAAjC,CADS;QAExBT,MAAM,sBAAef,KAAK,CAACS,EAAN,CAASC,OAAT,CAAiBM,UAAjB,CAA4BS,KAA3C,CAFkB;QAGxBjB,OAAO,EAAE;MAHe;IAZlB,CAxDe;IA2EzBkB,QAAQ,EAAE,EA3Ee;IA6EzBC,YAAY;MACVb,YAAY,EAAE;IADJ,GAEPc,qBAFO;EA7Ea,CAAZ;AAAA,CAAf;;eAmFe7B,M"}
|
|
@@ -28,6 +28,7 @@ var useScrollTo = function useScrollTo() {
|
|
|
28
28
|
var offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
29
29
|
var options = arguments.length > 4 ? arguments[4] : undefined;
|
|
30
30
|
var onChange = arguments.length > 5 ? arguments[5] : undefined;
|
|
31
|
+
var direction = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : "column";
|
|
31
32
|
var RETRY_MAX = 5;
|
|
32
33
|
|
|
33
34
|
var _useState = (0, _react.useState)(selectedIndexProp),
|
|
@@ -148,7 +149,7 @@ var useScrollTo = function useScrollTo() {
|
|
|
148
149
|
var ele = document.getElementById(id);
|
|
149
150
|
|
|
150
151
|
if (ele) {
|
|
151
|
-
(0, _utils.scrollElement)(ele, scrollEle.current, option.offset || offset);
|
|
152
|
+
(0, _utils.scrollElement)(ele, scrollEle.current, option.offset || offset, direction);
|
|
152
153
|
}
|
|
153
154
|
|
|
154
155
|
if (href) {
|