@hitachivantara/uikit-react-core 4.0.4 → 4.1.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.
@@ -73,8 +73,7 @@ var HvWarningText = function HvWarningText(props) {
73
73
  children: [!disableAdornment && localAdornment, /*#__PURE__*/(0, _jsxRuntime.jsx)(_.HvTypography, _objectSpread(_objectSpread({
74
74
  id: localId,
75
75
  className: (0, _clsx.default)(classes.warningText, !disableGutter && classes.topGutter, hideText && classes.hideText),
76
- "aria-live": "polite",
77
- "aria-atomic": "true",
76
+ role: "status",
78
77
  "aria-relevant": "additions text"
79
78
  }, others), {}, {
80
79
  children: showWarning && content
@@ -1 +1 @@
1
- {"version":3,"file":"WarningText.js","names":["HvWarningText","props","children","adornment","isVisible","classes","className","id","disabled","disableGutter","disableBorder","disableAdornment","hideText","others","useContext","HvFormElementContext","elementId","elementStatus","elementDisabled","localDisabled","localVisible","isNil","localId","setId","showWarning","content","localAdornment","defaultIcon","clsx","root","show","topBorder","warningText","topGutter","formElementType","propTypes","PropTypes","string","node","shape","isRequired","bool","withStyles","styles","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 \"@mui/styles\";\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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAE9B;AACA;AACA;AACA,IAAMA,aAAa,GAAG,SAAhBA,aAAa,CAAIC,KAAK,EAAK;EAC/B,IACEC,QAAQ,GAYND,KAAK,CAZPC,QAAQ;IACRC,SAAS,GAWPF,KAAK,CAXPE,SAAS;IACTC,SAAS,GAUPH,KAAK,CAVPG,SAAS;IACTC,OAAO,GASLJ,KAAK,CATPI,OAAO;IACPC,SAAS,GAQPL,KAAK,CARPK,SAAS;IACTC,EAAE,GAOAN,KAAK,CAPPM,EAAE;IACFC,QAAQ,GAMNP,KAAK,CANPO,QAAQ;IAAA,uBAMNP,KAAK,CALPQ,aAAa;IAAbA,aAAa,qCAAG,KAAK;IAAA,uBAKnBR,KAAK,CAJPS,aAAa;IAAbA,aAAa,qCAAG,KAAK;IAAA,wBAInBT,KAAK,CAHPU,gBAAgB;IAAhBA,gBAAgB,sCAAG,KAAK;IAAA,kBAGtBV,KAAK,CAFPW,QAAQ;IAARA,QAAQ,gCAAG,KAAK;IACbC,MAAM,0CACPZ,KAAK;EAET,kBAAsD,IAAAa,iBAAU,EAACC,iCAAoB,CAAC;IAA9EC,SAAS,eAATA,SAAS;IAAEC,aAAa,eAAbA,aAAa;IAAEC,eAAe,eAAfA,eAAe;EACjD,IAAMC,aAAa,GAAGX,QAAQ,IAAIU,eAAe;EACjD,IAAME,YAAY,GAAG,CAAC,IAAAC,cAAK,EAACjB,SAAS,CAAC,GAAGA,SAAS,GAAGa,aAAa,KAAK,SAAS;EAChF,IAAMK,OAAO,GAAGf,EAAE,aAAFA,EAAE,cAAFA,EAAE,GAAI,IAAAgB,YAAK,EAACP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AACC,MAAM;IAC7B;AACJ;AACA;IACIL,WAAW,EAAEI,kBAAS,CAACC,MAAM;IAC7B;AACJ;AACA;IACIP,IAAI,EAAEM,kBAAS,CAACC,MAAM;IACtB;AACJ;AACA;IACIJ,SAAS,EAAEG,kBAAS,CAACC,MAAM;IAC3B;AACJ;AACA;IACIN,SAAS,EAAEK,kBAAS,CAACC,MAAM;IAC3B;AACJ;AACA;AACA;IACIzB,QAAQ,EAAEwB,kBAAS,CAACC;EACtB,CAAC,CAAC,CAACG,UAAU;EACb;AACF;AACA;EACErC,SAAS,EAAEiC,kBAAS,CAACE,IAAI;EACzB;AACF;AACA;EACElC,SAAS,EAAEgC,kBAAS,CAACK,IAAI;EACzB;AACF;AACA;EACEjC,QAAQ,EAAE4B,kBAAS,CAACK,IAAI;EACxB;AACF;AACA;EACEhC,aAAa,EAAE2B,kBAAS,CAACK,IAAI;EAC7B;AACF;AACA;EACE/B,aAAa,EAAE0B,kBAAS,CAACK,IAAI;EAC7B;AACF;AACA;EACE9B,gBAAgB,EAAEyB,kBAAS,CAACK,IAAI;EAChC;AACF;AACA;EACE7B,QAAQ,EAAEwB,kBAAS,CAACK;AACtB,CAAC;AAAC,eAEa,IAAAC,kBAAU,EAACC,gBAAM,EAAE;EAAEC,IAAI,EAAE;AAAgB,CAAC,CAAC,CAAC5C,aAAa,CAAC;AAAA"}
1
+ {"version":3,"file":"WarningText.js","names":["HvWarningText","props","children","adornment","isVisible","classes","className","id","disabled","disableGutter","disableBorder","disableAdornment","hideText","others","useContext","HvFormElementContext","elementId","elementStatus","elementDisabled","localDisabled","localVisible","isNil","localId","setId","showWarning","content","localAdornment","defaultIcon","clsx","root","show","topBorder","warningText","topGutter","formElementType","propTypes","PropTypes","string","node","shape","isRequired","bool","withStyles","styles","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 \"@mui/styles\";\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 role=\"status\"\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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAE9B;AACA;AACA;AACA,IAAMA,aAAa,GAAG,SAAhBA,aAAa,CAAIC,KAAK,EAAK;EAC/B,IACEC,QAAQ,GAYND,KAAK,CAZPC,QAAQ;IACRC,SAAS,GAWPF,KAAK,CAXPE,SAAS;IACTC,SAAS,GAUPH,KAAK,CAVPG,SAAS;IACTC,OAAO,GASLJ,KAAK,CATPI,OAAO;IACPC,SAAS,GAQPL,KAAK,CARPK,SAAS;IACTC,EAAE,GAOAN,KAAK,CAPPM,EAAE;IACFC,QAAQ,GAMNP,KAAK,CANPO,QAAQ;IAAA,uBAMNP,KAAK,CALPQ,aAAa;IAAbA,aAAa,qCAAG,KAAK;IAAA,uBAKnBR,KAAK,CAJPS,aAAa;IAAbA,aAAa,qCAAG,KAAK;IAAA,wBAInBT,KAAK,CAHPU,gBAAgB;IAAhBA,gBAAgB,sCAAG,KAAK;IAAA,kBAGtBV,KAAK,CAFPW,QAAQ;IAARA,QAAQ,gCAAG,KAAK;IACbC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var HvWarningText = function HvWarningText(props) {
61
61
  children: [!disableAdornment && localAdornment, /*#__PURE__*/_jsx(HvTypography, _objectSpread(_objectSpread({
62
62
  id: localId,
63
63
  className: clsx(classes.warningText, !disableGutter && classes.topGutter, hideText && classes.hideText),
64
- "aria-live": "polite",
65
- "aria-atomic": "true",
64
+ role: "status",
66
65
  "aria-relevant": "additions text"
67
66
  }, others), {}, {
68
67
  children: showWarning && content
@@ -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 \"@mui/styles\";\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":";;;;;;;;;;;;A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,SAAS,CAACwC,MAAM;IACtB;AACJ;AACA;IACIR,WAAW,EAAEhC,SAAS,CAACwC,MAAM;IAC7B;AACJ;AACA;IACIJ,WAAW,EAAEpC,SAAS,CAACwC,MAAM;IAC7B;AACJ;AACA;IACIN,IAAI,EAAElC,SAAS,CAACwC,MAAM;IACtB;AACJ;AACA;IACIH,SAAS,EAAErC,SAAS,CAACwC,MAAM;IAC3B;AACJ;AACA;IACIL,SAAS,EAAEnC,SAAS,CAACwC,MAAM;IAC3B;AACJ;AACA;AACA;IACInB,QAAQ,EAAErB,SAAS,CAACwC;EACtB,CAAC,CAAC,CAACG,UAAU;EACb;AACF;AACA;EACE/B,SAAS,EAAEZ,SAAS,CAACyC,IAAI;EACzB;AACF;AACA;EACE5B,SAAS,EAAEb,SAAS,CAAC4C,IAAI;EACzB;AACF;AACA;EACE3B,QAAQ,EAAEjB,SAAS,CAAC4C,IAAI;EACxB;AACF;AACA;EACE1B,aAAa,EAAElB,SAAS,CAAC4C,IAAI;EAC7B;AACF;AACA;EACEzB,aAAa,EAAEnB,SAAS,CAAC4C,IAAI;EAC7B;AACF;AACA;EACExB,gBAAgB,EAAEpB,SAAS,CAAC4C,IAAI;EAChC;AACF;AACA;EACEvB,QAAQ,EAAErB,SAAS,CAAC4C;AACtB,CAAC;AAED,eAAexC,UAAU,CAACI,MAAM,EAAE;EAAEqC,IAAI,EAAE;AAAgB,CAAC,CAAC,CAACpC,aAAa,CAAC"}
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 \"@mui/styles\";\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 role=\"status\"\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,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,KAAK,MAAM,cAAc;AAChC,SAASC,IAAI,QAAQ,mCAAmC;AACxD,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,YAAY,QAAQ,OAAO;AACpC,SAASC,KAAK,QAAQ,aAAa;AACnC,OAAOC,MAAM,MAAM,UAAU;;AAE7B;AACA;AACA;AAFA;AAAA;AAGA,IAAMC,aAAa,GAAG,SAAhBA,aAAa,CAAIC,KAAK,EAAK;EAC/B,IACEC,QAAQ,GAYND,KAAK,CAZPC,QAAQ;IACRC,SAAS,GAWPF,KAAK,CAXPE,SAAS;IACTC,SAAS,GAUPH,KAAK,CAVPG,SAAS;IACTC,OAAO,GASLJ,KAAK,CATPI,OAAO;IACPC,SAAS,GAQPL,KAAK,CARPK,SAAS;IACTC,EAAE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AAa,EAAEnB,SAAS,CAAC4C,IAAI;EAC7B;AACF;AACA;EACExB,gBAAgB,EAAEpB,SAAS,CAAC4C,IAAI;EAChC;AACF;AACA;EACEvB,QAAQ,EAAErB,SAAS,CAAC4C;AACtB,CAAC;AAED,eAAexC,UAAU,CAACI,MAAM,EAAE;EAAEqC,IAAI,EAAE;AAAgB,CAAC,CAAC,CAACpC,aAAa,CAAC"}
@@ -53,8 +53,7 @@ const HvWarningText = props => {
53
53
  children: [!disableAdornment && localAdornment, /*#__PURE__*/_jsx(HvTypography, _objectSpread(_objectSpread({
54
54
  id: localId,
55
55
  className: clsx(classes.warningText, !disableGutter && classes.topGutter, hideText && classes.hideText),
56
- "aria-live": "polite",
57
- "aria-atomic": "true",
56
+ role: "status",
58
57
  "aria-relevant": "additions text"
59
58
  }, others), {}, {
60
59
  children: showWarning && content
@@ -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 \"@mui/styles\";\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,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,KAAK,MAAM,cAAc;AAChC,SAASC,IAAI,QAAQ,mCAAmC;AACxD,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,YAAY,QAAQ,OAAO;AACpC,SAASC,KAAK,QAAQ,aAAa;AACnC,OAAOC,MAAM,MAAM,UAAU;;AAE7B;AACA;AACA;AAFA;AAAA;AAGA,MAAMC,aAAa,GAAIC,KAAK,IAAK;EAC/B,MAAM;MACJC,QAAQ;MACRC,SAAS;MACTC,SAAS;MACTC,OAAO;MACPC,SAAS;MACTC,EAAE;MACFC,QAAQ;MACRC,aAAa,GAAG,KAAK;MACrBC,aAAa,GAAG,KAAK;MACrBC,gBAAgB,GAAG,KAAK;MACxBC,QAAQ,GAAG;IAEb,CAAC,GAAGX,KAAK;IADJY,MAAM,4BACPZ,KAAK;EAET,MAAM;IAAEa,SAAS;IAAEC,aAAa;IAAEC;EAAgB,CAAC,GAAG1B,UAAU,CAACM,oBAAoB,CAAC;EACtF,MAAMqB,aAAa,GAAGT,QAAQ,IAAIQ,eAAe;EACjD,MAAME,YAAY,GAAG,CAACzB,KAAK,CAACW,SAAS,CAAC,GAAGA,SAAS,GAAGW,aAAa,KAAK,SAAS;EAChF,MAAMI,OAAO,GAAGZ,EAAE,aAAFA,EAAE,cAAFA,EAAE,GAAIT,KAAK,CAACgB,SAAS,EA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ACIJ,WAAW,EAAEpC,SAAS,CAACwC,MAAM;IAC7B;AACJ;AACA;IACIN,IAAI,EAAElC,SAAS,CAACwC,MAAM;IACtB;AACJ;AACA;IACIH,SAAS,EAAErC,SAAS,CAACwC,MAAM;IAC3B;AACJ;AACA;IACIL,SAAS,EAAEnC,SAAS,CAACwC,MAAM;IAC3B;AACJ;AACA;AACA;IACInB,QAAQ,EAAErB,SAAS,CAACwC;EACtB,CAAC,CAAC,CAACG,UAAU;EACb;AACF;AACA;EACE/B,SAAS,EAAEZ,SAAS,CAACyC,IAAI;EACzB;AACF;AACA;EACE5B,SAAS,EAAEb,SAAS,CAAC4C,IAAI;EACzB;AACF;AACA;EACE3B,QAAQ,EAAEjB,SAAS,CAAC4C,IAAI;EACxB;AACF;AACA;EACE1B,aAAa,EAAElB,SAAS,CAAC4C,IAAI;EAC7B;AACF;AACA;EACEzB,aAAa,EAAEnB,SAAS,CAAC4C,IAAI;EAC7B;AACF;AACA;EACExB,gBAAgB,EAAEpB,SAAS,CAAC4C,IAAI;EAChC;AACF;AACA;EACEvB,QAAQ,EAAErB,SAAS,CAAC4C;AACtB,CAAC;AAED,eAAexC,UAAU,CAACI,MAAM,EAAE;EAAEqC,IAAI,EAAE;AAAgB,CAAC,CAAC,CAACpC,aAAa,CAAC"}
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 \"@mui/styles\";\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 role=\"status\"\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,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,KAAK,MAAM,cAAc;AAChC,SAASC,IAAI,QAAQ,mCAAmC;AACxD,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,YAAY,QAAQ,OAAO;AACpC,SAASC,KAAK,QAAQ,aAAa;AACnC,OAAOC,MAAM,MAAM,UAAU;;AAE7B;AACA;AACA;AAFA;AAAA;AAGA,MAAMC,aAAa,GAAIC,KAAK,IAAK;EAC/B,MAAM;MACJC,QAAQ;MACRC,SAAS;MACTC,SAAS;MACTC,OAAO;MACPC,SAAS;MACTC,EAAE;MACFC,QAAQ;MACRC,aAAa,GAAG,KAAK;MACrBC,aAAa,GAAG,KAAK;MACrBC,gBAAgB,GAAG,KAAK;MACxBC,QAAQ,GAAG;IAEb,CAAC,GAAGX,KAAK;IADJY,MAAM,4BACPZ,KAAK;EAET,MAAM;IAAEa,SAAS;IAAEC,aAAa;IAAEC;EAAgB,CAAC,GAAG1B,UAAU,CAACM,oBAAoB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AE,EAAEhB,SAAS,CAACwC,MAAM;EACpB;AACF;AACA;EACE1B,OAAO,EAAEd,SAAS,CAAC0C,KAAK,CAAC;IACvB;AACJ;AACA;IACIT,IAAI,EAAEjC,SAAS,CAACwC,MAAM;IACtB;AACJ;AACA;IACIR,WAAW,EAAEhC,SAAS,CAACwC,MAAM;IAC7B;AACJ;AACA;IACIJ,WAAW,EAAEpC,SAAS,CAACwC,MAAM;IAC7B;AACJ;AACA;IACIN,IAAI,EAAElC,SAAS,CAACwC,MAAM;IACtB;AACJ;AACA;IACIH,SAAS,EAAErC,SAAS,CAACwC,MAAM;IAC3B;AACJ;AACA;IACIL,SAAS,EAAEnC,SAAS,CAACwC,MAAM;IAC3B;AACJ;AACA;AACA;IACInB,QAAQ,EAAErB,SAAS,CAACwC;EACtB,CAAC,CAAC,CAACG,UAAU;EACb;AACF;AACA;EACE/B,SAAS,EAAEZ,SAAS,CAACyC,IAAI;EACzB;AACF;AACA;EACE5B,SAAS,EAAEb,SAAS,CAAC4C,IAAI;EACzB;AACF;AACA;EACE3B,QAAQ,EAAEjB,SAAS,CAAC4C,IAAI;EACxB;AACF;AACA;EACE1B,aAAa,EAAElB,SAAS,CAAC4C,IAAI;EAC7B;AACF;AACA;EACEzB,aAAa,EAAEnB,SAAS,CAAC4C,IAAI;EAC7B;AACF;AACA;EACExB,gBAAgB,EAAEpB,SAAS,CAAC4C,IAAI;EAChC;AACF;AACA;EACEvB,QAAQ,EAAErB,SAAS,CAAC4C;AACtB,CAAC;AAED,eAAexC,UAAU,CAACI,MAAM,EAAE;EAAEqC,IAAI,EAAE;AAAgB,CAAC,CAAC,CAACpC,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-core",
3
- "version": "4.0.4",
3
+ "version": "4.1.0",
4
4
  "description": "A collection of React components for the Hitachi Vantara's Design System.",
5
5
  "homepage": "https://github.com/lumada-design/hv-uikit-react",
6
6
  "license": "Apache-2.0",
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "1861d424d32437aa1a9cbda0c17c706f65d0e853"
86
+ "gitHead": "73337338eb03a7fa1f4f6ef819c2bf0c086aab31"
87
87
  }