@widergy/energy-ui 3.186.1 → 3.187.1

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/CHANGELOG.md CHANGED
@@ -1,9 +1,31 @@
1
- ## [3.186.1](https://github.com/widergy/energy-ui/compare/v3.186.0...v3.186.1) (2026-09-15)
1
+ ## [3.187.1](https://github.com/widergy/energy-ui/compare/v3.187.0...v3.187.1) (2026-09-17)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * [CX-99999] size sidebar submenu from its content height ([#862](https://github.com/widergy/energy-ui/issues/862)) ([a8df1a3](https://github.com/widergy/energy-ui/commit/a8df1a3e54e5d05f546a01b8f622a8031e619c88))
6
+ * minor datepicker visual fix ([#866](https://github.com/widergy/energy-ui/issues/866)) ([3a99556](https://github.com/widergy/energy-ui/commit/3a99556a1cc25f2521b80800734582c09b930e9d))
7
+
8
+ # [3.187.0](https://github.com/widergy/energy-ui/compare/v3.186.1...v3.187.0) (2026-09-16)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * [WDS] status message showBanner default ([#865](https://github.com/widergy/energy-ui/issues/865)) ([8807eb3](https://github.com/widergy/energy-ui/commit/8807eb32faf74848252c0d0334571fbde6c280f6))
14
+
15
+
16
+ ### Features
17
+
18
+ * [CFE-93] Adding custom styles to UTAction ([#863](https://github.com/widergy/energy-ui/issues/863)) ([c2a2869](https://github.com/widergy/energy-ui/commit/c2a2869310dee6e587c6b1c3d2f0a98cd5901d6b))
19
+
20
+ ## [3.186.1](https://github.com/widergy/energy-ui/compare/v3.186.0...v3.186.1) (2026-09-15)
21
+
22
+ ### Correcciones
23
+
24
+ * Se corrigió un espacio en blanco que aparecía debajo de los submenús de la barra lateral. El tamaño ahora se ajusta correctamente al contenido visible. [#862](https://github.com/widergy/Energy-UI/pull/862) [CX-99999](https://widergy.atlassian.net/browse/CX-99999)
25
+
26
+ ### Novedades y Mejoras
27
+
28
+ * Mejoras internas de la plataforma. [`2d2f265`](https://github.com/widergy/Energy-UI/commit/2d2f265)
7
29
 
8
30
  # [3.186.0](https://github.com/widergy/energy-ui/compare/v3.185.0...v3.186.0) (2026-09-11)
9
31
 
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_REDIRECTION_ICON=void 0;const DEFAULT_REDIRECTION_ICON=exports.DEFAULT_REDIRECTION_ICON="IconChevronRight";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_REDIRECTION_ICON=exports.DEFAULT_ACTION_VARIANT=exports.DEFAULT_ACTION_COLOR_THEME=void 0;var _constants=require("../../../UTButton/constants");const DEFAULT_REDIRECTION_ICON=exports.DEFAULT_REDIRECTION_ICON="IconChevronRight",DEFAULT_ACTION_COLOR_THEME=exports.DEFAULT_ACTION_COLOR_THEME="primary",DEFAULT_ACTION_VARIANT=exports.DEFAULT_ACTION_VARIANT=_constants.VARIANTS_NAMES.text;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=_interopRequireWildcard(require("react")),_propTypes=require("prop-types"),_Divider=_interopRequireDefault(require("@material-ui/core/Divider")),_UTButton=_interopRequireDefault(require("../../../UTButton")),_constants=require("../../constants"),_constants2=require("./constants"),_stylesModule=_interopRequireDefault(require("./styles.module.scss"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var o=new WeakMap,r=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var n,a,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(n=t?r:o){if(n.has(e))return n.get(e);n.set(e,s)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((a=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?n(s,t,a):s[t]=e[t]);return s})(e,t)}const BottomActions=e=>{let{actions:t=[],bottomActionsVariant:o,size:r}=e;const n=t.length>2?_constants.ACTION_TYPES.REDIRECTION:o||_constants.ACTION_TYPES.DEFAULT;return _react.default.createElement("div",{className:_stylesModule.default.actionsContainer},t.map((e,o)=>{let{colorTheme:a="primary",dataTestId:s,disabled:l,Icon:i,label:c,loading:u,onClick:p}=e;return _react.default.createElement(_react.Fragment,{key:c},_react.default.createElement(_UTButton.default,{classNames:{childrenContainer:"".concat(n===_constants.ACTION_TYPES.REDIRECTION&&_stylesModule.default.redirectionChildrenContainer," "),root:"".concat(_stylesModule.default.actionButton," ").concat(n===_constants.ACTION_TYPES.REDIRECTION&&_stylesModule.default.fullWidth," ").concat(r===_constants.SIZES.MEDIUM&&_stylesModule.default.mediumPadding),text:"".concat(n===_constants.ACTION_TYPES.REDIRECTION?_stylesModule.default.redirectionText:_stylesModule.default.defaultText)},colorTheme:a,dataTestId:s,disabled:l,Icon:n===_constants.ACTION_TYPES.REDIRECTION?i||_constants2.DEFAULT_REDIRECTION_ICON:i,iconPlacement:n===_constants.ACTION_TYPES.REDIRECTION?"right":"left",loading:u,onClick:p,size:"large",variant:"text"},c),t.length>1&&o<t.length-1&&_react.default.createElement(_Divider.default,{className:_stylesModule.default.divider}))}))};BottomActions.propTypes={actions:(0,_propTypes.arrayOf)((0,_propTypes.shape)({colorTheme:_propTypes.string,dataTestId:_propTypes.string,disabled:_propTypes.bool,Icon:(0,_propTypes.oneOfType)([_propTypes.elementType,_propTypes.string]),label:_propTypes.string,loading:_propTypes.bool,onClick:_propTypes.func})),bottomActionsVariant:_propTypes.string,size:_propTypes.string};var _default=exports.default=(0,_react.memo)(BottomActions);
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=_interopRequireWildcard(require("react")),_propTypes=require("prop-types"),_Divider=_interopRequireDefault(require("@material-ui/core/Divider")),_UTButton=_interopRequireDefault(require("../../../UTButton")),_constants=require("../../../UTButton/constants"),_constants2=require("../../constants"),_constants3=require("./constants"),_utils=require("./utils"),_stylesModule=_interopRequireDefault(require("./styles.module.scss"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap,o=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var n,s,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(n=t?o:r){if(n.has(e))return n.get(e);n.set(e,a)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((s=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(s.get||s.set)?n(a,t,s):a[t]=e[t]);return a})(e,t)}const BottomActions=e=>{let{actions:t=[],bottomActionsVariant:r,size:o}=e;const n=t.length>2?_constants2.ACTION_TYPES.REDIRECTION:r||_constants2.ACTION_TYPES.DEFAULT,s=(0,_utils.getActionClassNames)({size:o,type:n});return _react.default.createElement("div",{className:_stylesModule.default.actionsContainer},t.map((e,r)=>{let{colorTheme:o=_constants3.DEFAULT_ACTION_COLOR_THEME,dataTestId:a,disabled:i,Icon:l,label:p,loading:_,onClick:c,variant:u=_constants3.DEFAULT_ACTION_VARIANT}=e;return _react.default.createElement(_react.Fragment,{key:p},_react.default.createElement(_UTButton.default,{classNames:s,colorTheme:o,dataTestId:a,disabled:i,Icon:n===_constants2.ACTION_TYPES.REDIRECTION?l||_constants3.DEFAULT_REDIRECTION_ICON:l,iconPlacement:n===_constants2.ACTION_TYPES.REDIRECTION?"right":"left",loading:_,onClick:c,size:"large",variant:u},p),t.length>1&&r<t.length-1&&_react.default.createElement(_Divider.default,{className:_stylesModule.default.divider}))}))};BottomActions.propTypes={actions:(0,_propTypes.arrayOf)((0,_propTypes.shape)({colorTheme:_propTypes.string,dataTestId:_propTypes.string,disabled:_propTypes.bool,Icon:(0,_propTypes.oneOfType)([_propTypes.elementType,_propTypes.string]),label:_propTypes.string,loading:_propTypes.bool,onClick:_propTypes.func,variant:(0,_propTypes.oneOf)(Object.values(_constants.VARIANTS_NAMES))})),bottomActionsVariant:_propTypes.string,size:_propTypes.string};var _default=exports.default=(0,_react.memo)(BottomActions);
@@ -6,6 +6,7 @@ $default-border-color: #e7e7e7;
6
6
  }
7
7
 
8
8
  .actionButton {
9
+ border-radius: 0;
9
10
  flex: 1;
10
11
  width: 100%;
11
12
 
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getActionClassNames=void 0;var _constants=require("../../constants"),_stylesModule=_interopRequireDefault(require("./styles.module.scss"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const joinClassNames=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter(Boolean).join(" ")},getActionClassNames=e=>{let{size:t,type:s}=e;const l=s===_constants.ACTION_TYPES.REDIRECTION;return{childrenContainer:joinClassNames(l&&_stylesModule.default.redirectionChildrenContainer),root:joinClassNames(_stylesModule.default.actionButton,l&&_stylesModule.default.fullWidth,t===_constants.SIZES.MEDIUM&&_stylesModule.default.mediumPadding),text:l?_stylesModule.default.redirectionText:_stylesModule.default.defaultText}};exports.getActionClassNames=getActionClassNames;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=_interopRequireWildcard(require("react")),_propTypes=require("prop-types"),_array=require("@widergy/web-utils/lib/array"),_object=require("@widergy/web-utils/lib/object"),_UTTouchableWithoutFeedback=_interopRequireDefault(require("../UTTouchableWithoutFeedback")),_BottomActions=_interopRequireDefault(require("./components/BottomActions")),_AdditionalMessage=_interopRequireDefault(require("./components/AdditionalMessage")),_Header=_interopRequireDefault(require("./components/Header")),_constants=require("./constants"),_stylesModule=_interopRequireDefault(require("./styles.module.scss"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var s=new WeakMap,o=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var r,n,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(r=t?o:s){if(r.has(e))return r.get(e);r.set(e,a)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((n=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(n.get||n.set)?r(a,t,n):a[t]=e[t]);return a})(e,t)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var o in s)({}).hasOwnProperty.call(s,o)&&(e[o]=s[o])}return e},_extends.apply(null,arguments)}const UTActionCard=e=>{let{additionalMessage:t,adornment:s,BackgroundImage:o,bottomActions:r,bottomActionsVariant:n,children:a,classNames:p={},description:i,descriptionProps:c={},headerActions:_,headerActionsProps:l={variant:_constants.HEADER_ACTIONS_VARIANTS.DEFAULT},hideHeader:d=!1,mainAction:T,size:u=_constants.SIZES.MEDIUM,status:y,statusAlignment:f,statusLabel:g,testIds:E={},title:A,titleProps:m={},withBodyPadding:b=!0}=e;const[h,P]=(0,_react.useState)(!0),{backgroundDataTestId:S,containerDataTestId:I,statusDataTestId:C}=E;return _react.default.createElement("div",{className:"".concat(_stylesModule.default.cardContainer," ").concat(p.container)},_react.default.createElement(_UTTouchableWithoutFeedback.default,{className:"".concat(_stylesModule.default.innerContainer," ").concat(p.innerContainer," ").concat(T?"".concat(_stylesModule.default.withMainAction," ").concat(h&&"".concat(_stylesModule.default.mainActionHover," ").concat(p.mainActionHover)):_stylesModule.default.withoutMainAction),dataTestId:I,onClick:()=>null==T?void 0:T()},o&&_react.default.createElement(o,{className:"".concat(_stylesModule.default.backgroundImage," ").concat(p.backgroundImage),"data-testid":S}),_react.default.createElement("div",{className:"".concat(_stylesModule.default.headerAndChildrenContainer," ").concat(p.headerAndChildrenContainer)},!d&&_react.default.createElement(_Header.default,{adornment:s,classNames:p,description:i,descriptionProps:c,headerActions:_,headerActionsProps:l,mainAction:T,setMainActionHoverVisible:P,size:u,status:y,statusAlignment:f,statusDataTestId:C,statusLabel:g,title:A,titleProps:m}),a&&_react.default.createElement("div",{className:"".concat(d?_stylesModule.default.withoutHeader:""," ").concat(b?_stylesModule.default["bodyPadding-".concat(u)]:_stylesModule.default["withoutBodyPadding-".concat(u)])},a))),!(0,_object.objectIsEmpty)(t)&&_react.default.createElement(_AdditionalMessage.default,_extends({},t,{size:u})),!(0,_array.isEmpty)(r)&&_react.default.createElement(_BottomActions.default,{actions:r,bottomActionsVariant:n,size:u}))};UTActionCard.propTypes={additionalMessage:(0,_propTypes.shape)({Icon:_propTypes.elementType,iconProps:(0,_propTypes.shape)({colorTheme:_propTypes.string,size:_propTypes.string}),labelProps:(0,_propTypes.shape)({colorTheme:_propTypes.string,variant:_propTypes.string}),message:_propTypes.string}),adornment:(0,_propTypes.shape)({alignment:(0,_propTypes.oneOf)([_constants.PLACE_SELF_TYPES.CENTER,_constants.PLACE_SELF_TYPES.END,_constants.PLACE_SELF_TYPES.START]),position:_propTypes.string,props:_propTypes.object,type:_propTypes.string}),BackgroundImage:_propTypes.elementType,bottomActions:(0,_propTypes.arrayOf)((0,_propTypes.shape)({colorTheme:_propTypes.string,disabled:_propTypes.bool,Icon:_propTypes.elementType,label:_propTypes.string,loading:_propTypes.bool,onClick:_propTypes.func})),bottomActionsVariant:(0,_propTypes.oneOf)([_constants.ACTION_TYPES.DEFAULT,_constants.ACTION_TYPES.REDIRECTION]),classNames:(0,_propTypes.objectOf)(_propTypes.string),description:_propTypes.string,descriptionProps:(0,_propTypes.shape)({colorTheme:_propTypes.string,variant:_propTypes.string}),headerActions:(0,_propTypes.arrayOf)((0,_propTypes.shape)({Icon:(0,_propTypes.oneOfType)([_propTypes.elementType,_propTypes.string]),iconProps:_propTypes.string,id:(0,_propTypes.oneOfType)([_propTypes.number,_propTypes.string]),label:_propTypes.string,loading:_propTypes.bool,onClick:_propTypes.func})),headerActionsProps:(0,_propTypes.shape)({alignment:(0,_propTypes.oneOf)([_constants.PLACE_SELF_TYPES.CENTER,_constants.PLACE_SELF_TYPES.END,_constants.PLACE_SELF_TYPES.START]),buttonGroupProps:(0,_propTypes.shape)({colorTheme:_propTypes.string,shape:_propTypes.string,size:_propTypes.string}),variant:(0,_propTypes.oneOf)([_constants.HEADER_ACTIONS_VARIANTS.DEFAULT,_constants.HEADER_ACTIONS_VARIANTS.BUTTON_GROUP])}),hideHeader:_propTypes.bool,mainAction:_propTypes.func,size:(0,_propTypes.oneOf)([_constants.SIZES.MEDIUM,_constants.SIZES.SMALL]),status:_propTypes.string,statusLabel:_propTypes.string,statusAlignment:(0,_propTypes.oneOf)([_constants.PLACE_SELF_TYPES.CENTER,_constants.PLACE_SELF_TYPES.END,_constants.PLACE_SELF_TYPES.START]),testIds:(0,_propTypes.shape)({backgroundDataTestId:_propTypes.string,containerDataTestId:_propTypes.string,statusDataTestId:_propTypes.string}),title:_propTypes.string,titleProps:(0,_propTypes.shape)({variant:_propTypes.string,weight:_propTypes.string}),withBodyPadding:_propTypes.bool};var _default=exports.default=(0,_react.memo)(UTActionCard);
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=_interopRequireWildcard(require("react")),_propTypes=require("prop-types"),_array=require("@widergy/web-utils/lib/array"),_object=require("@widergy/web-utils/lib/object"),_UTTouchableWithoutFeedback=_interopRequireDefault(require("../UTTouchableWithoutFeedback")),_constants=require("../UTButton/constants"),_BottomActions=_interopRequireDefault(require("./components/BottomActions")),_AdditionalMessage=_interopRequireDefault(require("./components/AdditionalMessage")),_Header=_interopRequireDefault(require("./components/Header")),_constants2=require("./constants"),_stylesModule=_interopRequireDefault(require("./styles.module.scss"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var s=new WeakMap,o=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var r,n,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(r=t?o:s){if(r.has(e))return r.get(e);r.set(e,a)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((n=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(n.get||n.set)?r(a,t,n):a[t]=e[t]);return a})(e,t)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var o in s)({}).hasOwnProperty.call(s,o)&&(e[o]=s[o])}return e},_extends.apply(null,arguments)}const UTActionCard=e=>{let{additionalMessage:t,adornment:s,BackgroundImage:o,bottomActions:r,bottomActionsVariant:n,children:a,classNames:p={},description:i,descriptionProps:c={},headerActions:_,headerActionsProps:l={variant:_constants2.HEADER_ACTIONS_VARIANTS.DEFAULT},hideHeader:d=!1,mainAction:T,size:u=_constants2.SIZES.MEDIUM,status:y,statusAlignment:f,statusLabel:A,testIds:E={},title:g,titleProps:m={},withBodyPadding:b=!0}=e;const[h,P]=(0,_react.useState)(!0),{backgroundDataTestId:S,containerDataTestId:I,statusDataTestId:C}=E;return _react.default.createElement("div",{className:"".concat(_stylesModule.default.cardContainer," ").concat(p.container)},_react.default.createElement(_UTTouchableWithoutFeedback.default,{className:"".concat(_stylesModule.default.innerContainer," ").concat(p.innerContainer," ").concat(T?"".concat(_stylesModule.default.withMainAction," ").concat(h&&"".concat(_stylesModule.default.mainActionHover," ").concat(p.mainActionHover)):_stylesModule.default.withoutMainAction),dataTestId:I,onClick:()=>null==T?void 0:T()},o&&_react.default.createElement(o,{className:"".concat(_stylesModule.default.backgroundImage," ").concat(p.backgroundImage),"data-testid":S}),_react.default.createElement("div",{className:"".concat(_stylesModule.default.headerAndChildrenContainer," ").concat(p.headerAndChildrenContainer)},!d&&_react.default.createElement(_Header.default,{adornment:s,classNames:p,description:i,descriptionProps:c,headerActions:_,headerActionsProps:l,mainAction:T,setMainActionHoverVisible:P,size:u,status:y,statusAlignment:f,statusDataTestId:C,statusLabel:A,title:g,titleProps:m}),a&&_react.default.createElement("div",{className:"".concat(d?_stylesModule.default.withoutHeader:""," ").concat(b?_stylesModule.default["bodyPadding-".concat(u)]:_stylesModule.default["withoutBodyPadding-".concat(u)])},a))),!(0,_object.objectIsEmpty)(t)&&_react.default.createElement(_AdditionalMessage.default,_extends({},t,{size:u})),!(0,_array.isEmpty)(r)&&_react.default.createElement(_BottomActions.default,{actions:r,bottomActionsVariant:n,size:u}))};UTActionCard.propTypes={additionalMessage:(0,_propTypes.shape)({Icon:_propTypes.elementType,iconProps:(0,_propTypes.shape)({colorTheme:_propTypes.string,size:_propTypes.string}),labelProps:(0,_propTypes.shape)({colorTheme:_propTypes.string,variant:_propTypes.string}),message:_propTypes.string}),adornment:(0,_propTypes.shape)({alignment:(0,_propTypes.oneOf)([_constants2.PLACE_SELF_TYPES.CENTER,_constants2.PLACE_SELF_TYPES.END,_constants2.PLACE_SELF_TYPES.START]),position:_propTypes.string,props:_propTypes.object,type:_propTypes.string}),BackgroundImage:_propTypes.elementType,bottomActions:(0,_propTypes.arrayOf)((0,_propTypes.shape)({colorTheme:_propTypes.string,disabled:_propTypes.bool,Icon:_propTypes.elementType,label:_propTypes.string,loading:_propTypes.bool,onClick:_propTypes.func,variant:(0,_propTypes.oneOf)(Object.values(_constants.VARIANTS_NAMES))})),bottomActionsVariant:(0,_propTypes.oneOf)([_constants2.ACTION_TYPES.DEFAULT,_constants2.ACTION_TYPES.REDIRECTION]),classNames:(0,_propTypes.objectOf)(_propTypes.string),description:_propTypes.string,descriptionProps:(0,_propTypes.shape)({colorTheme:_propTypes.string,variant:_propTypes.string}),headerActions:(0,_propTypes.arrayOf)((0,_propTypes.shape)({Icon:(0,_propTypes.oneOfType)([_propTypes.elementType,_propTypes.string]),iconProps:_propTypes.string,id:(0,_propTypes.oneOfType)([_propTypes.number,_propTypes.string]),label:_propTypes.string,loading:_propTypes.bool,onClick:_propTypes.func})),headerActionsProps:(0,_propTypes.shape)({alignment:(0,_propTypes.oneOf)([_constants2.PLACE_SELF_TYPES.CENTER,_constants2.PLACE_SELF_TYPES.END,_constants2.PLACE_SELF_TYPES.START]),buttonGroupProps:(0,_propTypes.shape)({colorTheme:_propTypes.string,shape:_propTypes.string,size:_propTypes.string}),variant:(0,_propTypes.oneOf)([_constants2.HEADER_ACTIONS_VARIANTS.DEFAULT,_constants2.HEADER_ACTIONS_VARIANTS.BUTTON_GROUP])}),hideHeader:_propTypes.bool,mainAction:_propTypes.func,size:(0,_propTypes.oneOf)([_constants2.SIZES.MEDIUM,_constants2.SIZES.SMALL]),status:_propTypes.string,statusLabel:_propTypes.string,statusAlignment:(0,_propTypes.oneOf)([_constants2.PLACE_SELF_TYPES.CENTER,_constants2.PLACE_SELF_TYPES.END,_constants2.PLACE_SELF_TYPES.START]),testIds:(0,_propTypes.shape)({backgroundDataTestId:_propTypes.string,containerDataTestId:_propTypes.string,statusDataTestId:_propTypes.string}),title:_propTypes.string,titleProps:(0,_propTypes.shape)({variant:_propTypes.string,weight:_propTypes.string}),withBodyPadding:_propTypes.bool};var _default=exports.default=(0,_react.memo)(UTActionCard);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=_interopRequireWildcard(require("react")),_Popover=_interopRequireDefault(require("@material-ui/core/Popover")),_dayjs=_interopRequireDefault(require("dayjs")),_customParseFormat=_interopRequireDefault(require("dayjs/plugin/customParseFormat")),_propTypes=require("prop-types"),_UTBaseInputField=_interopRequireDefault(require("../../../UTBaseInputField")),_UTButton=_interopRequireDefault(require("../../../UTButton")),_UTFieldLabel=_interopRequireDefault(require("../../../UTFieldLabel")),_UTLabel=_interopRequireDefault(require("../../../UTLabel")),_UTValidation=_interopRequireDefault(require("../../../UTValidation")),_constants=require("../../../UTBaseInputField/constants"),_Calendar=_interopRequireDefault(require("./components/Calendar")),_stylesModule=_interopRequireDefault(require("./styles.module.scss")),_constants2=require("./constants"),_utils=require("./utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var a=new WeakMap,r=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var n,l,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(n=t?r:a){if(n.has(e))return n.get(e);n.set(e,s)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((l=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(l.get||l.set)?n(s,t,l):s[t]=e[t]);return s})(e,t)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},_extends.apply(null,arguments)}_dayjs.default.extend(_customParseFormat.default);const CALENDAR_PAPER_PROPS={className:_stylesModule.default.calendarPaper,onMouseDown:e=>e.preventDefault()},UTDatePicker=e=>{let{classNames:t={},CustomIcon:a,dataTestId:r,disabled:n,error:l="",helpText:s,onChange:o=()=>{},placeholder:i,popoverProps:u,range:c,readOnly:_=!1,required:d,size:p=_constants2.DEFAULT_PROPS.size,title:f,value:T="",variant:m=_constants2.DEFAULT_PROPS.variant}=e;const{maxDate:y,minDate:v}=c||{},[P,U]=(0,_react.useState)(null),[E,D]=(0,_react.useState)(!1),[A,g]=(0,_react.useState)(""),[L,O]=(0,_react.useState)(!1),[h,M]=(0,_react.useState)(!1),q=(0,_react.useRef)(null),R=(0,_react.useRef)(null);(0,_react.useEffect)(()=>{D(!1),g(""),M(!1),!T&&null!=P&&P.isValid()?U(null):(0,_utils.dateMatchesFormat)(T,_constants2.OUTPUT_LABEL_MASK)?U((0,_dayjs.default)(T,_constants2.OUTPUT_LABEL_MASK)):U(null)},[T]);const S=()=>{var e;n||_||(O(!0),null===(e=R.current)||void 0===e||e.focus())},b=E?A:null!=P&&P.isValid()?P.format(_constants2.OUTPUT_LABEL_MASK):"",F=!!l||h,B=null==P?void 0:P.isValid(),x=i||_constants2.DEFAULT_PLACEHOLDER,j=F&&!n,I=(B||E)&&!n&&!_,C=!_&&!n,N=l||(h?_constants2.TYPING_ERROR_MESSAGE:""),k="picker"===m,w=j?[{name:_constants.COMPONENT_KEYS.ICON,props:{showOnlyOnError:!0}}]:[],K={colorTheme:F?"error":L?"primary":"gray",Icon:a||"IconCalendarEvent"},V=C?_react.default.createElement("div",{className:_stylesModule.default.endAdornments},_react.default.createElement(_UTButton.default,_extends({},I?{colorTheme:"dark",Icon:"IconX"}:K,{classNames:{root:_stylesModule.default.calendarButton},onClick:I?e=>{e.stopPropagation(),U(null),D(!1),g(""),M(!1),o("")}:S,size:"small",variant:"text"}))):void 0;return _react.default.createElement(_react.default.Fragment,null,_react.default.createElement("div",{className:_stylesModule.default.root},f&&_react.default.createElement(_UTFieldLabel.default,{className:null==t?void 0:t.upperTitle,required:d,withMarkdown:!0},f),_react.default.createElement("div",{ref:q},_react.default.createElement(_UTBaseInputField.default,{alwaysShowPlaceholder:!0,classNames:t,dataTestId:r,inputRef:R,disabled:n,error:F,readOnly:_,inputSize:"sm"===p?"small":void 0,variant:k?"transparent":void 0,leftAdornments:w,maxLength:10,muiProps:{InputProps:{endAdornment:V},onChange:e=>{var t,a;const r=(e=>{const t=e.replace(/\D/g,"").slice(0,8);return t.length<=2?t:t.length<=4?"".concat(t.slice(0,2),"/").concat(t.slice(2)):"".concat(t.slice(0,2),"/").concat(t.slice(2,4),"/").concat(t.slice(4))})(E?e.target.value:null!==(t=null===(a=e.nativeEvent)||void 0===a?void 0:a.data)&&void 0!==t?t:"");g(r),D(!0);if(8===r.replace(/\D/g,"").length){const e=(0,_utils.dateMatchesFormat)(r,_constants2.OUTPUT_LABEL_MASK)&&(0,_dayjs.default)(r,_constants2.OUTPUT_LABEL_MASK).isValid();M(!e),e&&U((0,_dayjs.default)(r,_constants2.OUTPUT_LABEL_MASK))}else M(!1)},fullWidth:!0},onBlur:e=>{var t;if((null===(t=q.current)||void 0===t||!t.contains(e.relatedTarget))&&(O(!1),M(!1),E)){if(D(!1),g(""),!A)return U(null),void o("");if((0,_utils.dateMatchesFormat)(A,_constants2.OUTPUT_LABEL_MASK)){const e=(0,_dayjs.default)(A,_constants2.OUTPUT_LABEL_MASK);if(e.isValid()){const t=(0,_utils.getFinalDate)({date:e,maxDate:y,minDate:v});return U(t),void o(t.format(_constants2.OUTPUT_LABEL_MASK))}}U(null),o("")}},onFocus:S,placeholder:x,value:b})),s&&_react.default.createElement(_UTLabel.default,{colorTheme:"gray",variant:"small",withMarkdown:!0},s),"select"===m&&N&&_react.default.createElement(_UTValidation.default,{dataTestId:r?"".concat(r,".errorMessage"):void 0,validationData:[{items:[{status:"error",text:N}]}]})),_react.default.createElement(_Popover.default,_extends({anchorEl:q.current,anchorOrigin:{horizontal:"left",vertical:"bottom"},disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0,onClose:()=>{O(!1),M(!1),E&&(D(!1),g(""),T&&(0,_utils.dateMatchesFormat)(T,_constants2.OUTPUT_LABEL_MASK)?U((0,_dayjs.default)(T,_constants2.OUTPUT_LABEL_MASK)):U(null))},open:L,PaperProps:CALENDAR_PAPER_PROPS,transformOrigin:{horizontal:"left",vertical:"top"}},u),_react.default.createElement(_Calendar.default,{maxDate:y,minDate:v,onDaySelect:e=>{const t=(0,_utils.getFinalDate)({date:e,maxDate:y,minDate:v});U(t),D(!1),g(""),M(!1),t.isValid()?o(t.format(_constants2.OUTPUT_LABEL_MASK)):o(""),O(!1)},pickedDate:P})))};UTDatePicker.propTypes={classNames:_propTypes.object,CustomIcon:_propTypes.elementType,dataTestId:_propTypes.string,disabled:_propTypes.bool,error:_propTypes.string,helpText:_propTypes.string,onChange:_propTypes.func,placeholder:_propTypes.string,popoverProps:_propTypes.object,range:(0,_propTypes.shape)({maxDate:_propTypes.string,minDate:_propTypes.string}),readOnly:_propTypes.bool,required:_propTypes.bool,size:_propTypes.string,title:_propTypes.string,value:_propTypes.string,variant:(0,_propTypes.oneOf)(["select","picker"])};var _default=exports.default=UTDatePicker;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=_interopRequireWildcard(require("react")),_Popover=_interopRequireDefault(require("@material-ui/core/Popover")),_dayjs=_interopRequireDefault(require("dayjs")),_customParseFormat=_interopRequireDefault(require("dayjs/plugin/customParseFormat")),_propTypes=require("prop-types"),_UTBaseInputField=_interopRequireDefault(require("../../../UTBaseInputField")),_UTButton=_interopRequireDefault(require("../../../UTButton")),_UTFieldLabel=_interopRequireDefault(require("../../../UTFieldLabel")),_UTLabel=_interopRequireDefault(require("../../../UTLabel")),_UTValidation=_interopRequireDefault(require("../../../UTValidation")),_constants=require("../../../UTBaseInputField/constants"),_Calendar=_interopRequireDefault(require("./components/Calendar")),_stylesModule=_interopRequireDefault(require("./styles.module.scss")),_constants2=require("./constants"),_utils=require("./utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var a=new WeakMap,r=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var n,l,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(n=t?r:a){if(n.has(e))return n.get(e);n.set(e,s)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((l=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(l.get||l.set)?n(s,t,l):s[t]=e[t]);return s})(e,t)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},_extends.apply(null,arguments)}_dayjs.default.extend(_customParseFormat.default);const CALENDAR_PAPER_PROPS={className:_stylesModule.default.calendarPaper,onMouseDown:e=>e.preventDefault()},UTDatePicker=e=>{let{classNames:t={},CustomIcon:a,dataTestId:r,disabled:n,error:l="",helpText:s,onChange:o=()=>{},placeholder:i,popoverProps:u,range:c,readOnly:_=!1,required:d,size:p=_constants2.DEFAULT_PROPS.size,title:f,value:T="",variant:m=_constants2.DEFAULT_PROPS.variant}=e;const{maxDate:y,minDate:v}=c||{},[P,U]=(0,_react.useState)(null),[E,D]=(0,_react.useState)(!1),[A,g]=(0,_react.useState)(""),[L,O]=(0,_react.useState)(!1),[h,M]=(0,_react.useState)(!1),q=(0,_react.useRef)(null),R=(0,_react.useRef)(null);(0,_react.useEffect)(()=>{D(!1),g(""),M(!1),!T&&null!=P&&P.isValid()?U(null):(0,_utils.dateMatchesFormat)(T,_constants2.OUTPUT_LABEL_MASK)?U((0,_dayjs.default)(T,_constants2.OUTPUT_LABEL_MASK)):U(null)},[T]);const S=()=>{var e;n||_||(O(!0),null===(e=R.current)||void 0===e||e.focus())},b=E?A:null!=P&&P.isValid()?P.format(_constants2.OUTPUT_LABEL_MASK):"",F=!!l||h,B=null==P?void 0:P.isValid(),x=i||_constants2.DEFAULT_PLACEHOLDER,j=F&&!n,I=(B||E)&&!n&&!_,C=l||(h?_constants2.TYPING_ERROR_MESSAGE:""),N="picker"===m,k=j?[{name:_constants.COMPONENT_KEYS.ICON,props:{showOnlyOnError:!0}}]:[],w={colorTheme:F?"error":L?"primary":"gray",Icon:a||"IconCalendarEvent"},K=_?void 0:_react.default.createElement("div",{className:_stylesModule.default.endAdornments},_react.default.createElement(_UTButton.default,_extends({},I?{colorTheme:"dark",Icon:"IconX"}:w,{classNames:{root:_stylesModule.default.calendarButton},disabled:n,onClick:I?e=>{e.stopPropagation(),U(null),D(!1),g(""),M(!1),o("")}:S,size:"small",variant:"text"})));return _react.default.createElement(_react.default.Fragment,null,_react.default.createElement("div",{className:_stylesModule.default.root},f&&_react.default.createElement(_UTFieldLabel.default,{className:null==t?void 0:t.upperTitle,required:d,withMarkdown:!0},f),_react.default.createElement("div",{ref:q},_react.default.createElement(_UTBaseInputField.default,{alwaysShowPlaceholder:!0,classNames:t,dataTestId:r,inputRef:R,disabled:n,error:F,readOnly:_,inputSize:"sm"===p?"small":void 0,variant:N?"transparent":void 0,leftAdornments:k,maxLength:10,muiProps:{InputProps:{endAdornment:K},onChange:e=>{var t,a;const r=(e=>{const t=e.replace(/\D/g,"").slice(0,8);return t.length<=2?t:t.length<=4?"".concat(t.slice(0,2),"/").concat(t.slice(2)):"".concat(t.slice(0,2),"/").concat(t.slice(2,4),"/").concat(t.slice(4))})(E?e.target.value:null!==(t=null===(a=e.nativeEvent)||void 0===a?void 0:a.data)&&void 0!==t?t:"");g(r),D(!0);if(8===r.replace(/\D/g,"").length){const e=(0,_utils.dateMatchesFormat)(r,_constants2.OUTPUT_LABEL_MASK)&&(0,_dayjs.default)(r,_constants2.OUTPUT_LABEL_MASK).isValid();M(!e),e&&U((0,_dayjs.default)(r,_constants2.OUTPUT_LABEL_MASK))}else M(!1)},fullWidth:!0},onBlur:e=>{var t;if((null===(t=q.current)||void 0===t||!t.contains(e.relatedTarget))&&(O(!1),M(!1),E)){if(D(!1),g(""),!A)return U(null),void o("");if((0,_utils.dateMatchesFormat)(A,_constants2.OUTPUT_LABEL_MASK)){const e=(0,_dayjs.default)(A,_constants2.OUTPUT_LABEL_MASK);if(e.isValid()){const t=(0,_utils.getFinalDate)({date:e,maxDate:y,minDate:v});return U(t),void o(t.format(_constants2.OUTPUT_LABEL_MASK))}}U(null),o("")}},onFocus:S,placeholder:x,value:b})),s&&_react.default.createElement(_UTLabel.default,{colorTheme:"gray",variant:"small",withMarkdown:!0},s),"select"===m&&C&&_react.default.createElement(_UTValidation.default,{dataTestId:r?"".concat(r,".errorMessage"):void 0,validationData:[{items:[{status:"error",text:C}]}]})),_react.default.createElement(_Popover.default,_extends({anchorEl:q.current,anchorOrigin:{horizontal:"left",vertical:"bottom"},disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0,onClose:()=>{O(!1),M(!1),E&&(D(!1),g(""),T&&(0,_utils.dateMatchesFormat)(T,_constants2.OUTPUT_LABEL_MASK)?U((0,_dayjs.default)(T,_constants2.OUTPUT_LABEL_MASK)):U(null))},open:L,PaperProps:CALENDAR_PAPER_PROPS,transformOrigin:{horizontal:"left",vertical:"top"}},u),_react.default.createElement(_Calendar.default,{maxDate:y,minDate:v,onDaySelect:e=>{const t=(0,_utils.getFinalDate)({date:e,maxDate:y,minDate:v});U(t),D(!1),g(""),M(!1),t.isValid()?o(t.format(_constants2.OUTPUT_LABEL_MASK)):o(""),O(!1)},pickedDate:P})))};UTDatePicker.propTypes={classNames:_propTypes.object,CustomIcon:_propTypes.elementType,dataTestId:_propTypes.string,disabled:_propTypes.bool,error:_propTypes.string,helpText:_propTypes.string,onChange:_propTypes.func,placeholder:_propTypes.string,popoverProps:_propTypes.object,range:(0,_propTypes.shape)({maxDate:_propTypes.string,minDate:_propTypes.string}),readOnly:_propTypes.bool,required:_propTypes.bool,size:_propTypes.string,title:_propTypes.string,value:_propTypes.string,variant:(0,_propTypes.oneOf)(["select","picker"])};var _default=exports.default=UTDatePicker;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.retrieveStyle=void 0;var _constants=require("./constants");const getIconBackgroundColor=(t,n)=>{var o,l,i,e,d,a,s,E,v,_,c,O,r;return{[_constants.COLOR_THEMES.ACCENT]:(null===(o=n.Palette)||void 0===o||null===(o=o.actions)||void 0===o?void 0:o.accent["01"])||(null===(l=n.Palette)||void 0===l?void 0:l.accent["01"]),[_constants.COLOR_THEMES.DEFAULT]:null===(i=n.Palette)||void 0===i?void 0:i.light["03"],[_constants.COLOR_THEMES.ERROR]:null===(e=n.Palette)||void 0===e?void 0:e.error["01"],[_constants.COLOR_THEMES.GRADIENT]:"light",[_constants.COLOR_THEMES.GRAY]:null===(d=n.Palette)||void 0===d?void 0:d.light["03"],[_constants.COLOR_THEMES.IDENTITY_1]:null===(a=n.Palette)||void 0===a||null===(a=a.identitySolid)||void 0===a?void 0:a["01"],[_constants.COLOR_THEMES.IDENTITY_2]:null===(s=n.Palette)||void 0===s||null===(s=s.identitySolid)||void 0===s?void 0:s["02"],[_constants.COLOR_THEMES.IDENTITY_3]:null===(E=n.Palette)||void 0===E||null===(E=E.identitySolid)||void 0===E?void 0:E["03"],[_constants.COLOR_THEMES.IDENTITY_4]:null===(v=n.Palette)||void 0===v||null===(v=v.identitySolid)||void 0===v?void 0:v["04"],[_constants.COLOR_THEMES.INFO]:null===(_=n.Palette)||void 0===_?void 0:_.information["02"],[_constants.COLOR_THEMES.NEGATIVE]:null===(c=n.Palette)||void 0===c?void 0:c.light["01"],[_constants.COLOR_THEMES.SUCCESS]:null===(O=n.Palette)||void 0===O?void 0:O.success["02"],[_constants.COLOR_THEMES.WARNING]:null===(r=n.Palette)||void 0===r?void 0:r.warning["02"]}[t]},getBannerBackgroundColor=(t,n)=>{var o,l,i,e,d,a,s,E,v,_,c,O,r;return{[_constants.COLOR_THEMES.ACCENT]:(null===(o=n.Palette)||void 0===o||null===(o=o.actions)||void 0===o?void 0:o.accent["03"])||(null===(l=n.Palette)||void 0===l?void 0:l.accent["03"]),[_constants.COLOR_THEMES.DEFAULT]:null===(i=n.Palette)||void 0===i?void 0:i.gray["05"],[_constants.COLOR_THEMES.ERROR]:null===(e=n.Palette)||void 0===e?void 0:e.error["03"],[_constants.COLOR_THEMES.GRADIENT]:null,[_constants.COLOR_THEMES.GRAY]:null===(d=n.Palette)||void 0===d?void 0:d.gray["03"],[_constants.COLOR_THEMES.IDENTITY_1]:null===(a=n.Palette)||void 0===a||null===(a=a.identitySolid)||void 0===a?void 0:a["01"],[_constants.COLOR_THEMES.IDENTITY_2]:null===(s=n.Palette)||void 0===s||null===(s=s.identitySolid)||void 0===s?void 0:s["02"],[_constants.COLOR_THEMES.IDENTITY_3]:null===(E=n.Palette)||void 0===E||null===(E=E.identitySolid)||void 0===E?void 0:E["03"],[_constants.COLOR_THEMES.IDENTITY_4]:null===(v=n.Palette)||void 0===v||null===(v=v.identitySolid)||void 0===v?void 0:v["04"],[_constants.COLOR_THEMES.INFO]:null===(_=n.Palette)||void 0===_?void 0:_.information["03"],[_constants.COLOR_THEMES.NEGATIVE]:null===(c=n.Palette)||void 0===c?void 0:c.light["01"],[_constants.COLOR_THEMES.SUCCESS]:null===(O=n.Palette)||void 0===O?void 0:O.success["03"],[_constants.COLOR_THEMES.WARNING]:null===(r=n.Palette)||void 0===r?void 0:r.warning["03"]}[t]},getFlagBackgroundColor=(t,n)=>{var o,l,i,e,d,a,s,E,v,_,c,O,r;return{[_constants.COLOR_THEMES.ACCENT]:(null===(o=n.Palette)||void 0===o||null===(o=o.actions)||void 0===o?void 0:o.accent["03"])||(null===(l=n.Palette)||void 0===l?void 0:l.accent["03"]),[_constants.COLOR_THEMES.DEFAULT]:null===(i=n.Palette)||void 0===i?void 0:i.gray["03"],[_constants.COLOR_THEMES.ERROR]:null===(e=n.Palette)||void 0===e?void 0:e.error["03"],[_constants.COLOR_THEMES.GRADIENT]:null,[_constants.COLOR_THEMES.GRAY]:null===(d=n.Palette)||void 0===d?void 0:d.gray["03"],[_constants.COLOR_THEMES.IDENTITY_1]:null===(a=n.Palette)||void 0===a||null===(a=a.identitySolid)||void 0===a?void 0:a["01"],[_constants.COLOR_THEMES.IDENTITY_2]:null===(s=n.Palette)||void 0===s||null===(s=s.identitySolid)||void 0===s?void 0:s["02"],[_constants.COLOR_THEMES.IDENTITY_3]:null===(E=n.Palette)||void 0===E||null===(E=E.identitySolid)||void 0===E?void 0:E["03"],[_constants.COLOR_THEMES.IDENTITY_4]:null===(v=n.Palette)||void 0===v||null===(v=v.identitySolid)||void 0===v?void 0:v["04"],[_constants.COLOR_THEMES.INFO]:null===(_=n.Palette)||void 0===_?void 0:_.information["03"],[_constants.COLOR_THEMES.NEGATIVE]:null===(c=n.Palette)||void 0===c?void 0:c.negative["03"],[_constants.COLOR_THEMES.SUCCESS]:null===(O=n.Palette)||void 0===O?void 0:O.success["03"],[_constants.COLOR_THEMES.WARNING]:null===(r=n.Palette)||void 0===r?void 0:r.warning["03"]}[t]},retrieveStyle=t=>{var n,o;let{showBanner:l=!0,theme:i,colorTheme:e=_constants.COLOR_THEMES.DEFAULT,flagColor:d,iconBackgroundColor:a,iconProps:s={}}=t;const E="linear-gradient(45deg, ".concat(null===(n=i.Palette)||void 0===n||null===(n=n.identityGradient)||void 0===n?void 0:n["01"]," 0%, ").concat(null===(o=i.Palette)||void 0===o||null===(o=o.identityGradient)||void 0===o?void 0:o["02"]," 100%);"),{size:v=40}=s;return{iconContainer:{alignItems:"center",background:e!==_constants.COLOR_THEMES.GRADIENT||l?"":E,backgroundColor:a||getIconBackgroundColor(e,i),borderRadius:100,display:"flex",height:1.85*v,justifyContent:"center",width:1.85*v},banner:{alignItems:"center",background:e===_constants.COLOR_THEMES.GRADIENT&&l?E:"",backgroundColor:l?getBannerBackgroundColor(e,i):"transparent",display:"flex",justifyContent:"center",padding:"12px 0",width:"100%"},flag:{background:e===_constants.COLOR_THEMES.GRADIENT?E:"",backgroundColor:d||getFlagBackgroundColor(e,i),height:"var(--UT-statusMessage-flag-height, 8px)",width:"100%"}}};exports.retrieveStyle=retrieveStyle;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.retrieveStyle=void 0;var _constants=require("./constants");const getIconBackgroundColor=(t,n)=>{var o,l,i,e,d,a,s,E,v,_,c,O,r;return{[_constants.COLOR_THEMES.ACCENT]:(null===(o=n.Palette)||void 0===o||null===(o=o.actions)||void 0===o?void 0:o.accent["01"])||(null===(l=n.Palette)||void 0===l?void 0:l.accent["01"]),[_constants.COLOR_THEMES.DEFAULT]:null===(i=n.Palette)||void 0===i?void 0:i.light["03"],[_constants.COLOR_THEMES.ERROR]:null===(e=n.Palette)||void 0===e?void 0:e.error["01"],[_constants.COLOR_THEMES.GRADIENT]:"light",[_constants.COLOR_THEMES.GRAY]:null===(d=n.Palette)||void 0===d?void 0:d.light["03"],[_constants.COLOR_THEMES.IDENTITY_1]:null===(a=n.Palette)||void 0===a||null===(a=a.identitySolid)||void 0===a?void 0:a["01"],[_constants.COLOR_THEMES.IDENTITY_2]:null===(s=n.Palette)||void 0===s||null===(s=s.identitySolid)||void 0===s?void 0:s["02"],[_constants.COLOR_THEMES.IDENTITY_3]:null===(E=n.Palette)||void 0===E||null===(E=E.identitySolid)||void 0===E?void 0:E["03"],[_constants.COLOR_THEMES.IDENTITY_4]:null===(v=n.Palette)||void 0===v||null===(v=v.identitySolid)||void 0===v?void 0:v["04"],[_constants.COLOR_THEMES.INFO]:null===(_=n.Palette)||void 0===_?void 0:_.information["02"],[_constants.COLOR_THEMES.NEGATIVE]:null===(c=n.Palette)||void 0===c?void 0:c.light["01"],[_constants.COLOR_THEMES.SUCCESS]:null===(O=n.Palette)||void 0===O?void 0:O.success["02"],[_constants.COLOR_THEMES.WARNING]:null===(r=n.Palette)||void 0===r?void 0:r.warning["02"]}[t]},getBannerBackgroundColor=(t,n)=>{var o,l,i,e,d,a,s,E,v,_,c,O,r;return{[_constants.COLOR_THEMES.ACCENT]:(null===(o=n.Palette)||void 0===o||null===(o=o.actions)||void 0===o?void 0:o.accent["03"])||(null===(l=n.Palette)||void 0===l?void 0:l.accent["03"]),[_constants.COLOR_THEMES.DEFAULT]:null===(i=n.Palette)||void 0===i?void 0:i.gray["05"],[_constants.COLOR_THEMES.ERROR]:null===(e=n.Palette)||void 0===e?void 0:e.error["03"],[_constants.COLOR_THEMES.GRADIENT]:null,[_constants.COLOR_THEMES.GRAY]:null===(d=n.Palette)||void 0===d?void 0:d.gray["03"],[_constants.COLOR_THEMES.IDENTITY_1]:null===(a=n.Palette)||void 0===a||null===(a=a.identitySolid)||void 0===a?void 0:a["01"],[_constants.COLOR_THEMES.IDENTITY_2]:null===(s=n.Palette)||void 0===s||null===(s=s.identitySolid)||void 0===s?void 0:s["02"],[_constants.COLOR_THEMES.IDENTITY_3]:null===(E=n.Palette)||void 0===E||null===(E=E.identitySolid)||void 0===E?void 0:E["03"],[_constants.COLOR_THEMES.IDENTITY_4]:null===(v=n.Palette)||void 0===v||null===(v=v.identitySolid)||void 0===v?void 0:v["04"],[_constants.COLOR_THEMES.INFO]:null===(_=n.Palette)||void 0===_?void 0:_.information["03"],[_constants.COLOR_THEMES.NEGATIVE]:null===(c=n.Palette)||void 0===c?void 0:c.light["01"],[_constants.COLOR_THEMES.SUCCESS]:null===(O=n.Palette)||void 0===O?void 0:O.success["03"],[_constants.COLOR_THEMES.WARNING]:null===(r=n.Palette)||void 0===r?void 0:r.warning["03"]}[t]},getFlagBackgroundColor=(t,n)=>{var o,l,i,e,d,a,s,E,v,_,c,O,r;return{[_constants.COLOR_THEMES.ACCENT]:(null===(o=n.Palette)||void 0===o||null===(o=o.actions)||void 0===o?void 0:o.accent["03"])||(null===(l=n.Palette)||void 0===l?void 0:l.accent["03"]),[_constants.COLOR_THEMES.DEFAULT]:null===(i=n.Palette)||void 0===i?void 0:i.gray["03"],[_constants.COLOR_THEMES.ERROR]:null===(e=n.Palette)||void 0===e?void 0:e.error["03"],[_constants.COLOR_THEMES.GRADIENT]:null,[_constants.COLOR_THEMES.GRAY]:null===(d=n.Palette)||void 0===d?void 0:d.gray["03"],[_constants.COLOR_THEMES.IDENTITY_1]:null===(a=n.Palette)||void 0===a||null===(a=a.identitySolid)||void 0===a?void 0:a["01"],[_constants.COLOR_THEMES.IDENTITY_2]:null===(s=n.Palette)||void 0===s||null===(s=s.identitySolid)||void 0===s?void 0:s["02"],[_constants.COLOR_THEMES.IDENTITY_3]:null===(E=n.Palette)||void 0===E||null===(E=E.identitySolid)||void 0===E?void 0:E["03"],[_constants.COLOR_THEMES.IDENTITY_4]:null===(v=n.Palette)||void 0===v||null===(v=v.identitySolid)||void 0===v?void 0:v["04"],[_constants.COLOR_THEMES.INFO]:null===(_=n.Palette)||void 0===_?void 0:_.information["03"],[_constants.COLOR_THEMES.NEGATIVE]:null===(c=n.Palette)||void 0===c?void 0:c.negative["03"],[_constants.COLOR_THEMES.SUCCESS]:null===(O=n.Palette)||void 0===O?void 0:O.success["03"],[_constants.COLOR_THEMES.WARNING]:null===(r=n.Palette)||void 0===r?void 0:r.warning["03"]}[t]},retrieveStyle=t=>{var n,o;let{showBanner:l=!1,theme:i,colorTheme:e=_constants.COLOR_THEMES.DEFAULT,flagColor:d,iconBackgroundColor:a,iconProps:s={}}=t;const E="linear-gradient(45deg, ".concat(null===(n=i.Palette)||void 0===n||null===(n=n.identityGradient)||void 0===n?void 0:n["01"]," 0%, ").concat(null===(o=i.Palette)||void 0===o||null===(o=o.identityGradient)||void 0===o?void 0:o["02"]," 100%);"),{size:v=40}=s;return{iconContainer:{alignItems:"center",background:e!==_constants.COLOR_THEMES.GRADIENT||l?"":E,backgroundColor:a||getIconBackgroundColor(e,i),borderRadius:100,display:"flex",height:1.85*v,justifyContent:"center",width:1.85*v},banner:{alignItems:"center",background:e===_constants.COLOR_THEMES.GRADIENT&&l?E:"",backgroundColor:l?getBannerBackgroundColor(e,i):"transparent",display:"flex",justifyContent:"center",padding:"12px 0",width:"100%"},flag:{background:e===_constants.COLOR_THEMES.GRADIENT?E:"",backgroundColor:d||getFlagBackgroundColor(e,i),height:"var(--UT-statusMessage-flag-height, 8px)",width:"100%"}}};exports.retrieveStyle=retrieveStyle;
@@ -1 +1 @@
1
- export const DEFAULT_REDIRECTION_ICON="IconChevronRight";
1
+ import{VARIANTS_NAMES}from"../../../UTButton/constants";export const DEFAULT_REDIRECTION_ICON="IconChevronRight";export const DEFAULT_ACTION_COLOR_THEME="primary";export const DEFAULT_ACTION_VARIANT=VARIANTS_NAMES.text;
@@ -1 +1 @@
1
- import React,{Fragment,memo}from"react";import{arrayOf,bool,elementType,func,oneOfType,shape,string}from"prop-types";import Divider from"@material-ui/core/Divider";import UTButton from"../../../UTButton";import{ACTION_TYPES,SIZES}from"../../constants";import{DEFAULT_REDIRECTION_ICON}from"./constants";import styles from"./styles.module.scss";const BottomActions=t=>{let{actions:e=[],bottomActionsVariant:o,size:n}=t;const a=e.length>2?ACTION_TYPES.REDIRECTION:o||ACTION_TYPES.DEFAULT;return React.createElement("div",{className:styles.actionsContainer},e.map((t,o)=>{let{colorTheme:r="primary",dataTestId:i,disabled:s,Icon:c,label:l,loading:m,onClick:T}=t;return React.createElement(Fragment,{key:l},React.createElement(UTButton,{classNames:{childrenContainer:"".concat(a===ACTION_TYPES.REDIRECTION&&styles.redirectionChildrenContainer," "),root:"".concat(styles.actionButton," ").concat(a===ACTION_TYPES.REDIRECTION&&styles.fullWidth," ").concat(n===SIZES.MEDIUM&&styles.mediumPadding),text:"".concat(a===ACTION_TYPES.REDIRECTION?styles.redirectionText:styles.defaultText)},colorTheme:r,dataTestId:i,disabled:s,Icon:a===ACTION_TYPES.REDIRECTION?c||DEFAULT_REDIRECTION_ICON:c,iconPlacement:a===ACTION_TYPES.REDIRECTION?"right":"left",loading:m,onClick:T,size:"large",variant:"text"},l),e.length>1&&o<e.length-1&&React.createElement(Divider,{className:styles.divider}))}))};BottomActions.propTypes={actions:arrayOf(shape({colorTheme:string,dataTestId:string,disabled:bool,Icon:oneOfType([elementType,string]),label:string,loading:bool,onClick:func})),bottomActionsVariant:string,size:string};export default memo(BottomActions);
1
+ import React,{Fragment,memo}from"react";import{arrayOf,bool,elementType,func,oneOf,oneOfType,shape,string}from"prop-types";import Divider from"@material-ui/core/Divider";import UTButton from"../../../UTButton";import{VARIANTS_NAMES}from"../../../UTButton/constants";import{ACTION_TYPES}from"../../constants";import{DEFAULT_ACTION_COLOR_THEME,DEFAULT_ACTION_VARIANT,DEFAULT_REDIRECTION_ICON}from"./constants";import{getActionClassNames}from"./utils";import styles from"./styles.module.scss";const BottomActions=t=>{let{actions:e=[],bottomActionsVariant:o,size:a}=t;const n=e.length>2?ACTION_TYPES.REDIRECTION:o||ACTION_TYPES.DEFAULT,s=getActionClassNames({size:a,type:n});return React.createElement("div",{className:styles.actionsContainer},e.map((t,o)=>{let{colorTheme:a=DEFAULT_ACTION_COLOR_THEME,dataTestId:r,disabled:i,Icon:l,label:m,loading:T,onClick:c,variant:A=DEFAULT_ACTION_VARIANT}=t;return React.createElement(Fragment,{key:m},React.createElement(UTButton,{classNames:s,colorTheme:a,dataTestId:r,disabled:i,Icon:n===ACTION_TYPES.REDIRECTION?l||DEFAULT_REDIRECTION_ICON:l,iconPlacement:n===ACTION_TYPES.REDIRECTION?"right":"left",loading:T,onClick:c,size:"large",variant:A},m),e.length>1&&o<e.length-1&&React.createElement(Divider,{className:styles.divider}))}))};BottomActions.propTypes={actions:arrayOf(shape({colorTheme:string,dataTestId:string,disabled:bool,Icon:oneOfType([elementType,string]),label:string,loading:bool,onClick:func,variant:oneOf(Object.values(VARIANTS_NAMES))})),bottomActionsVariant:string,size:string};export default memo(BottomActions);
@@ -6,6 +6,7 @@ $default-border-color: #e7e7e7;
6
6
  }
7
7
 
8
8
  .actionButton {
9
+ border-radius: 0;
9
10
  flex: 1;
10
11
  width: 100%;
11
12
 
@@ -0,0 +1 @@
1
+ import{ACTION_TYPES,SIZES}from"../../constants";import styles from"./styles.module.scss";const joinClassNames=function(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return e.filter(Boolean).join(" ")};export const getActionClassNames=t=>{let{size:e,type:s}=t;const n=s===ACTION_TYPES.REDIRECTION;return{childrenContainer:joinClassNames(n&&styles.redirectionChildrenContainer),root:joinClassNames(styles.actionButton,n&&styles.fullWidth,e===SIZES.MEDIUM&&styles.mediumPadding),text:n?styles.redirectionText:styles.defaultText}};
@@ -1 +1 @@
1
- function _extends(){return _extends=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)({}).hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},_extends.apply(null,arguments)}import React,{memo,useState}from"react";import{arrayOf,bool,elementType,func,number,object,objectOf,oneOf,oneOfType,shape,string}from"prop-types";import{isEmpty}from"@widergy/web-utils/lib/array";import{objectIsEmpty}from"@widergy/web-utils/lib/object";import UTTouchableWithoutFeedback from"../UTTouchableWithoutFeedback";import BottomActions from"./components/BottomActions";import AdditionalMessage from"./components/AdditionalMessage";import Header from"./components/Header";import{ACTION_TYPES,HEADER_ACTIONS_VARIANTS,PLACE_SELF_TYPES,SIZES}from"./constants";import styles from"./styles.module.scss";const UTActionCard=t=>{let{additionalMessage:e,adornment:n,BackgroundImage:a,bottomActions:o,bottomActionsVariant:s,children:i,classNames:r={},description:c,descriptionProps:l={},headerActions:d,headerActionsProps:m={variant:HEADER_ACTIONS_VARIANTS.DEFAULT},hideHeader:E=!1,mainAction:p,size:T=SIZES.MEDIUM,status:A,statusAlignment:g,statusLabel:u,testIds:b={},title:h,titleProps:S={},withBodyPadding:P=!0}=t;const[y,I]=useState(!0),{backgroundDataTestId:_,containerDataTestId:f,statusDataTestId:C}=b;return React.createElement("div",{className:"".concat(styles.cardContainer," ").concat(r.container)},React.createElement(UTTouchableWithoutFeedback,{className:"".concat(styles.innerContainer," ").concat(r.innerContainer," ").concat(p?"".concat(styles.withMainAction," ").concat(y&&"".concat(styles.mainActionHover," ").concat(r.mainActionHover)):styles.withoutMainAction),dataTestId:f,onClick:()=>null==p?void 0:p()},a&&React.createElement(a,{className:"".concat(styles.backgroundImage," ").concat(r.backgroundImage),"data-testid":_}),React.createElement("div",{className:"".concat(styles.headerAndChildrenContainer," ").concat(r.headerAndChildrenContainer)},!E&&React.createElement(Header,{adornment:n,classNames:r,description:c,descriptionProps:l,headerActions:d,headerActionsProps:m,mainAction:p,setMainActionHoverVisible:I,size:T,status:A,statusAlignment:g,statusDataTestId:C,statusLabel:u,title:h,titleProps:S}),i&&React.createElement("div",{className:"".concat(E?styles.withoutHeader:""," ").concat(P?styles["bodyPadding-".concat(T)]:styles["withoutBodyPadding-".concat(T)])},i))),!objectIsEmpty(e)&&React.createElement(AdditionalMessage,_extends({},e,{size:T})),!isEmpty(o)&&React.createElement(BottomActions,{actions:o,bottomActionsVariant:s,size:T}))};UTActionCard.propTypes={additionalMessage:shape({Icon:elementType,iconProps:shape({colorTheme:string,size:string}),labelProps:shape({colorTheme:string,variant:string}),message:string}),adornment:shape({alignment:oneOf([PLACE_SELF_TYPES.CENTER,PLACE_SELF_TYPES.END,PLACE_SELF_TYPES.START]),position:string,props:object,type:string}),BackgroundImage:elementType,bottomActions:arrayOf(shape({colorTheme:string,disabled:bool,Icon:elementType,label:string,loading:bool,onClick:func})),bottomActionsVariant:oneOf([ACTION_TYPES.DEFAULT,ACTION_TYPES.REDIRECTION]),classNames:objectOf(string),description:string,descriptionProps:shape({colorTheme:string,variant:string}),headerActions:arrayOf(shape({Icon:oneOfType([elementType,string]),iconProps:string,id:oneOfType([number,string]),label:string,loading:bool,onClick:func})),headerActionsProps:shape({alignment:oneOf([PLACE_SELF_TYPES.CENTER,PLACE_SELF_TYPES.END,PLACE_SELF_TYPES.START]),buttonGroupProps:shape({colorTheme:string,shape:string,size:string}),variant:oneOf([HEADER_ACTIONS_VARIANTS.DEFAULT,HEADER_ACTIONS_VARIANTS.BUTTON_GROUP])}),hideHeader:bool,mainAction:func,size:oneOf([SIZES.MEDIUM,SIZES.SMALL]),status:string,statusLabel:string,statusAlignment:oneOf([PLACE_SELF_TYPES.CENTER,PLACE_SELF_TYPES.END,PLACE_SELF_TYPES.START]),testIds:shape({backgroundDataTestId:string,containerDataTestId:string,statusDataTestId:string}),title:string,titleProps:shape({variant:string,weight:string}),withBodyPadding:bool};export default memo(UTActionCard);
1
+ function _extends(){return _extends=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)({}).hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},_extends.apply(null,arguments)}import React,{memo,useState}from"react";import{arrayOf,bool,elementType,func,number,object,objectOf,oneOf,oneOfType,shape,string}from"prop-types";import{isEmpty}from"@widergy/web-utils/lib/array";import{objectIsEmpty}from"@widergy/web-utils/lib/object";import UTTouchableWithoutFeedback from"../UTTouchableWithoutFeedback";import{VARIANTS_NAMES}from"../UTButton/constants";import BottomActions from"./components/BottomActions";import AdditionalMessage from"./components/AdditionalMessage";import Header from"./components/Header";import{ACTION_TYPES,HEADER_ACTIONS_VARIANTS,PLACE_SELF_TYPES,SIZES}from"./constants";import styles from"./styles.module.scss";const UTActionCard=t=>{let{additionalMessage:e,adornment:n,BackgroundImage:a,bottomActions:o,bottomActionsVariant:s,children:i,classNames:r={},description:c,descriptionProps:l={},headerActions:d,headerActionsProps:m={variant:HEADER_ACTIONS_VARIANTS.DEFAULT},hideHeader:A=!1,mainAction:E,size:p=SIZES.MEDIUM,status:T,statusAlignment:g,statusLabel:u,testIds:S={},title:b,titleProps:h={},withBodyPadding:P=!0}=t;const[I,y]=useState(!0),{backgroundDataTestId:_,containerDataTestId:f,statusDataTestId:C}=S;return React.createElement("div",{className:"".concat(styles.cardContainer," ").concat(r.container)},React.createElement(UTTouchableWithoutFeedback,{className:"".concat(styles.innerContainer," ").concat(r.innerContainer," ").concat(E?"".concat(styles.withMainAction," ").concat(I&&"".concat(styles.mainActionHover," ").concat(r.mainActionHover)):styles.withoutMainAction),dataTestId:f,onClick:()=>null==E?void 0:E()},a&&React.createElement(a,{className:"".concat(styles.backgroundImage," ").concat(r.backgroundImage),"data-testid":_}),React.createElement("div",{className:"".concat(styles.headerAndChildrenContainer," ").concat(r.headerAndChildrenContainer)},!A&&React.createElement(Header,{adornment:n,classNames:r,description:c,descriptionProps:l,headerActions:d,headerActionsProps:m,mainAction:E,setMainActionHoverVisible:y,size:p,status:T,statusAlignment:g,statusDataTestId:C,statusLabel:u,title:b,titleProps:h}),i&&React.createElement("div",{className:"".concat(A?styles.withoutHeader:""," ").concat(P?styles["bodyPadding-".concat(p)]:styles["withoutBodyPadding-".concat(p)])},i))),!objectIsEmpty(e)&&React.createElement(AdditionalMessage,_extends({},e,{size:p})),!isEmpty(o)&&React.createElement(BottomActions,{actions:o,bottomActionsVariant:s,size:p}))};UTActionCard.propTypes={additionalMessage:shape({Icon:elementType,iconProps:shape({colorTheme:string,size:string}),labelProps:shape({colorTheme:string,variant:string}),message:string}),adornment:shape({alignment:oneOf([PLACE_SELF_TYPES.CENTER,PLACE_SELF_TYPES.END,PLACE_SELF_TYPES.START]),position:string,props:object,type:string}),BackgroundImage:elementType,bottomActions:arrayOf(shape({colorTheme:string,disabled:bool,Icon:elementType,label:string,loading:bool,onClick:func,variant:oneOf(Object.values(VARIANTS_NAMES))})),bottomActionsVariant:oneOf([ACTION_TYPES.DEFAULT,ACTION_TYPES.REDIRECTION]),classNames:objectOf(string),description:string,descriptionProps:shape({colorTheme:string,variant:string}),headerActions:arrayOf(shape({Icon:oneOfType([elementType,string]),iconProps:string,id:oneOfType([number,string]),label:string,loading:bool,onClick:func})),headerActionsProps:shape({alignment:oneOf([PLACE_SELF_TYPES.CENTER,PLACE_SELF_TYPES.END,PLACE_SELF_TYPES.START]),buttonGroupProps:shape({colorTheme:string,shape:string,size:string}),variant:oneOf([HEADER_ACTIONS_VARIANTS.DEFAULT,HEADER_ACTIONS_VARIANTS.BUTTON_GROUP])}),hideHeader:bool,mainAction:func,size:oneOf([SIZES.MEDIUM,SIZES.SMALL]),status:string,statusLabel:string,statusAlignment:oneOf([PLACE_SELF_TYPES.CENTER,PLACE_SELF_TYPES.END,PLACE_SELF_TYPES.START]),testIds:shape({backgroundDataTestId:string,containerDataTestId:string,statusDataTestId:string}),title:string,titleProps:shape({variant:string,weight:string}),withBodyPadding:bool};export default memo(UTActionCard);
@@ -1 +1 @@
1
- function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},_extends.apply(null,arguments)}import React,{useRef,useState,useEffect}from"react";import Popover from"@material-ui/core/Popover";import dayjs from"dayjs";import customParseFormat from"dayjs/plugin/customParseFormat";import{bool,elementType,func,object,shape,string,oneOf}from"prop-types";import UTBaseInputField from"../../../UTBaseInputField";import UTButton from"../../../UTButton";import UTFieldLabel from"../../../UTFieldLabel";import UTLabel from"../../../UTLabel";import UTValidation from"../../../UTValidation";import{COMPONENT_KEYS}from"../../../UTBaseInputField/constants";import Calendar from"./components/Calendar";import styles from"./styles.module.scss";import{DEFAULT_PROPS,DEFAULT_PLACEHOLDER,OUTPUT_LABEL_MASK,TYPING_ERROR_MESSAGE}from"./constants";import{dateMatchesFormat,getFinalDate}from"./utils";dayjs.extend(customParseFormat);const CALENDAR_PAPER_PROPS={className:styles.calendarPaper,onMouseDown:e=>e.preventDefault()},UTDatePicker=e=>{let{classNames:t={},CustomIcon:a,dataTestId:r,disabled:o,error:n="",helpText:l,onChange:s=()=>{},placeholder:i,popoverProps:c,range:d,readOnly:m=!1,required:u,size:p=DEFAULT_PROPS.size,title:T,value:E="",variant:P=DEFAULT_PROPS.variant}=e;const{maxDate:U,minDate:f}=d||{},[_,A]=useState(null),[v,L]=useState(!1),[O,g]=useState(""),[R,h]=useState(!1),[S,D]=useState(!1),y=useRef(null),F=useRef(null);useEffect(()=>{L(!1),g(""),D(!1),!E&&null!=_&&_.isValid()?A(null):dateMatchesFormat(E,OUTPUT_LABEL_MASK)?A(dayjs(E,OUTPUT_LABEL_MASK)):A(null)},[E]);const M=()=>{var e;o||m||(h(!0),null===(e=F.current)||void 0===e||e.focus())},b=v?O:null!=_&&_.isValid()?_.format(OUTPUT_LABEL_MASK):"",B=!!n||S,C=null==_?void 0:_.isValid(),I=i||DEFAULT_PLACEHOLDER,x=(C||v)&&!o&&!m,N=!m&&!o,K=n||(S?TYPING_ERROR_MESSAGE:""),j="picker"===P,k=B&&!o?[{name:COMPONENT_KEYS.ICON,props:{showOnlyOnError:!0}}]:[],w={colorTheme:B?"error":R?"primary":"gray",Icon:a||"IconCalendarEvent"},V=N?React.createElement("div",{className:styles.endAdornments},React.createElement(UTButton,_extends({},x?{colorTheme:"dark",Icon:"IconX"}:w,{classNames:{root:styles.calendarButton},onClick:x?e=>{e.stopPropagation(),A(null),L(!1),g(""),D(!1),s("")}:M,size:"small",variant:"text"}))):void 0;return React.createElement(React.Fragment,null,React.createElement("div",{className:styles.root},T&&React.createElement(UTFieldLabel,{className:null==t?void 0:t.upperTitle,required:u,withMarkdown:!0},T),React.createElement("div",{ref:y},React.createElement(UTBaseInputField,{alwaysShowPlaceholder:!0,classNames:t,dataTestId:r,inputRef:F,disabled:o,error:B,readOnly:m,inputSize:"sm"===p?"small":void 0,variant:j?"transparent":void 0,leftAdornments:k,maxLength:10,muiProps:{InputProps:{endAdornment:V},onChange:e=>{var t,a;const r=(e=>{const t=e.replace(/\D/g,"").slice(0,8);return t.length<=2?t:t.length<=4?"".concat(t.slice(0,2),"/").concat(t.slice(2)):"".concat(t.slice(0,2),"/").concat(t.slice(2,4),"/").concat(t.slice(4))})(v?e.target.value:null!==(t=null===(a=e.nativeEvent)||void 0===a?void 0:a.data)&&void 0!==t?t:"");g(r),L(!0);if(8===r.replace(/\D/g,"").length){const e=dateMatchesFormat(r,OUTPUT_LABEL_MASK)&&dayjs(r,OUTPUT_LABEL_MASK).isValid();D(!e),e&&A(dayjs(r,OUTPUT_LABEL_MASK))}else D(!1)},fullWidth:!0},onBlur:e=>{var t;if((null===(t=y.current)||void 0===t||!t.contains(e.relatedTarget))&&(h(!1),D(!1),v)){if(L(!1),g(""),!O)return A(null),void s("");if(dateMatchesFormat(O,OUTPUT_LABEL_MASK)){const e=dayjs(O,OUTPUT_LABEL_MASK);if(e.isValid()){const t=getFinalDate({date:e,maxDate:U,minDate:f});return A(t),void s(t.format(OUTPUT_LABEL_MASK))}}A(null),s("")}},onFocus:M,placeholder:I,value:b})),l&&React.createElement(UTLabel,{colorTheme:"gray",variant:"small",withMarkdown:!0},l),"select"===P&&K&&React.createElement(UTValidation,{dataTestId:r?"".concat(r,".errorMessage"):void 0,validationData:[{items:[{status:"error",text:K}]}]})),React.createElement(Popover,_extends({anchorEl:y.current,anchorOrigin:{horizontal:"left",vertical:"bottom"},disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0,onClose:()=>{h(!1),D(!1),v&&(L(!1),g(""),E&&dateMatchesFormat(E,OUTPUT_LABEL_MASK)?A(dayjs(E,OUTPUT_LABEL_MASK)):A(null))},open:R,PaperProps:CALENDAR_PAPER_PROPS,transformOrigin:{horizontal:"left",vertical:"top"}},c),React.createElement(Calendar,{maxDate:U,minDate:f,onDaySelect:e=>{const t=getFinalDate({date:e,maxDate:U,minDate:f});A(t),L(!1),g(""),D(!1),t.isValid()?s(t.format(OUTPUT_LABEL_MASK)):s(""),h(!1)},pickedDate:_})))};UTDatePicker.propTypes={classNames:object,CustomIcon:elementType,dataTestId:string,disabled:bool,error:string,helpText:string,onChange:func,placeholder:string,popoverProps:object,range:shape({maxDate:string,minDate:string}),readOnly:bool,required:bool,size:string,title:string,value:string,variant:oneOf(["select","picker"])};export default UTDatePicker;
1
+ function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},_extends.apply(null,arguments)}import React,{useRef,useState,useEffect}from"react";import Popover from"@material-ui/core/Popover";import dayjs from"dayjs";import customParseFormat from"dayjs/plugin/customParseFormat";import{bool,elementType,func,object,shape,string,oneOf}from"prop-types";import UTBaseInputField from"../../../UTBaseInputField";import UTButton from"../../../UTButton";import UTFieldLabel from"../../../UTFieldLabel";import UTLabel from"../../../UTLabel";import UTValidation from"../../../UTValidation";import{COMPONENT_KEYS}from"../../../UTBaseInputField/constants";import Calendar from"./components/Calendar";import styles from"./styles.module.scss";import{DEFAULT_PROPS,DEFAULT_PLACEHOLDER,OUTPUT_LABEL_MASK,TYPING_ERROR_MESSAGE}from"./constants";import{dateMatchesFormat,getFinalDate}from"./utils";dayjs.extend(customParseFormat);const CALENDAR_PAPER_PROPS={className:styles.calendarPaper,onMouseDown:e=>e.preventDefault()},UTDatePicker=e=>{let{classNames:t={},CustomIcon:a,dataTestId:r,disabled:o,error:n="",helpText:l,onChange:s=()=>{},placeholder:i,popoverProps:c,range:d,readOnly:m=!1,required:u,size:p=DEFAULT_PROPS.size,title:T,value:E="",variant:P=DEFAULT_PROPS.variant}=e;const{maxDate:U,minDate:f}=d||{},[_,A]=useState(null),[v,L]=useState(!1),[O,g]=useState(""),[R,h]=useState(!1),[S,D]=useState(!1),y=useRef(null),F=useRef(null);useEffect(()=>{L(!1),g(""),D(!1),!E&&null!=_&&_.isValid()?A(null):dateMatchesFormat(E,OUTPUT_LABEL_MASK)?A(dayjs(E,OUTPUT_LABEL_MASK)):A(null)},[E]);const M=()=>{var e;o||m||(h(!0),null===(e=F.current)||void 0===e||e.focus())},b=v?O:null!=_&&_.isValid()?_.format(OUTPUT_LABEL_MASK):"",B=!!n||S,C=null==_?void 0:_.isValid(),I=i||DEFAULT_PLACEHOLDER,x=(C||v)&&!o&&!m,N=n||(S?TYPING_ERROR_MESSAGE:""),K="picker"===P,j=B&&!o?[{name:COMPONENT_KEYS.ICON,props:{showOnlyOnError:!0}}]:[],k={colorTheme:B?"error":R?"primary":"gray",Icon:a||"IconCalendarEvent"},w=m?void 0:React.createElement("div",{className:styles.endAdornments},React.createElement(UTButton,_extends({},x?{colorTheme:"dark",Icon:"IconX"}:k,{classNames:{root:styles.calendarButton},disabled:o,onClick:x?e=>{e.stopPropagation(),A(null),L(!1),g(""),D(!1),s("")}:M,size:"small",variant:"text"})));return React.createElement(React.Fragment,null,React.createElement("div",{className:styles.root},T&&React.createElement(UTFieldLabel,{className:null==t?void 0:t.upperTitle,required:u,withMarkdown:!0},T),React.createElement("div",{ref:y},React.createElement(UTBaseInputField,{alwaysShowPlaceholder:!0,classNames:t,dataTestId:r,inputRef:F,disabled:o,error:B,readOnly:m,inputSize:"sm"===p?"small":void 0,variant:K?"transparent":void 0,leftAdornments:j,maxLength:10,muiProps:{InputProps:{endAdornment:w},onChange:e=>{var t,a;const r=(e=>{const t=e.replace(/\D/g,"").slice(0,8);return t.length<=2?t:t.length<=4?"".concat(t.slice(0,2),"/").concat(t.slice(2)):"".concat(t.slice(0,2),"/").concat(t.slice(2,4),"/").concat(t.slice(4))})(v?e.target.value:null!==(t=null===(a=e.nativeEvent)||void 0===a?void 0:a.data)&&void 0!==t?t:"");g(r),L(!0);if(8===r.replace(/\D/g,"").length){const e=dateMatchesFormat(r,OUTPUT_LABEL_MASK)&&dayjs(r,OUTPUT_LABEL_MASK).isValid();D(!e),e&&A(dayjs(r,OUTPUT_LABEL_MASK))}else D(!1)},fullWidth:!0},onBlur:e=>{var t;if((null===(t=y.current)||void 0===t||!t.contains(e.relatedTarget))&&(h(!1),D(!1),v)){if(L(!1),g(""),!O)return A(null),void s("");if(dateMatchesFormat(O,OUTPUT_LABEL_MASK)){const e=dayjs(O,OUTPUT_LABEL_MASK);if(e.isValid()){const t=getFinalDate({date:e,maxDate:U,minDate:f});return A(t),void s(t.format(OUTPUT_LABEL_MASK))}}A(null),s("")}},onFocus:M,placeholder:I,value:b})),l&&React.createElement(UTLabel,{colorTheme:"gray",variant:"small",withMarkdown:!0},l),"select"===P&&N&&React.createElement(UTValidation,{dataTestId:r?"".concat(r,".errorMessage"):void 0,validationData:[{items:[{status:"error",text:N}]}]})),React.createElement(Popover,_extends({anchorEl:y.current,anchorOrigin:{horizontal:"left",vertical:"bottom"},disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0,onClose:()=>{h(!1),D(!1),v&&(L(!1),g(""),E&&dateMatchesFormat(E,OUTPUT_LABEL_MASK)?A(dayjs(E,OUTPUT_LABEL_MASK)):A(null))},open:R,PaperProps:CALENDAR_PAPER_PROPS,transformOrigin:{horizontal:"left",vertical:"top"}},c),React.createElement(Calendar,{maxDate:U,minDate:f,onDaySelect:e=>{const t=getFinalDate({date:e,maxDate:U,minDate:f});A(t),L(!1),g(""),D(!1),t.isValid()?s(t.format(OUTPUT_LABEL_MASK)):s(""),h(!1)},pickedDate:_})))};UTDatePicker.propTypes={classNames:object,CustomIcon:elementType,dataTestId:string,disabled:bool,error:string,helpText:string,onChange:func,placeholder:string,popoverProps:object,range:shape({maxDate:string,minDate:string}),readOnly:bool,required:bool,size:string,title:string,value:string,variant:oneOf(["select","picker"])};export default UTDatePicker;
@@ -1 +1 @@
1
- import{COLOR_THEMES}from"./constants";const getIconBackgroundColor=(l,i)=>{var o,t,e,n,d,E,a,v,O,T,u,r,C;return{[COLOR_THEMES.ACCENT]:(null===(o=i.Palette)||void 0===o||null===(o=o.actions)||void 0===o?void 0:o.accent["01"])||(null===(t=i.Palette)||void 0===t?void 0:t.accent["01"]),[COLOR_THEMES.DEFAULT]:null===(e=i.Palette)||void 0===e?void 0:e.light["03"],[COLOR_THEMES.ERROR]:null===(n=i.Palette)||void 0===n?void 0:n.error["01"],[COLOR_THEMES.GRADIENT]:"light",[COLOR_THEMES.GRAY]:null===(d=i.Palette)||void 0===d?void 0:d.light["03"],[COLOR_THEMES.IDENTITY_1]:null===(E=i.Palette)||void 0===E||null===(E=E.identitySolid)||void 0===E?void 0:E["01"],[COLOR_THEMES.IDENTITY_2]:null===(a=i.Palette)||void 0===a||null===(a=a.identitySolid)||void 0===a?void 0:a["02"],[COLOR_THEMES.IDENTITY_3]:null===(v=i.Palette)||void 0===v||null===(v=v.identitySolid)||void 0===v?void 0:v["03"],[COLOR_THEMES.IDENTITY_4]:null===(O=i.Palette)||void 0===O||null===(O=O.identitySolid)||void 0===O?void 0:O["04"],[COLOR_THEMES.INFO]:null===(T=i.Palette)||void 0===T?void 0:T.information["02"],[COLOR_THEMES.NEGATIVE]:null===(u=i.Palette)||void 0===u?void 0:u.light["01"],[COLOR_THEMES.SUCCESS]:null===(r=i.Palette)||void 0===r?void 0:r.success["02"],[COLOR_THEMES.WARNING]:null===(C=i.Palette)||void 0===C?void 0:C.warning["02"]}[l]},getBannerBackgroundColor=(l,i)=>{var o,t,e,n,d,E,a,v,O,T,u,r,C;return{[COLOR_THEMES.ACCENT]:(null===(o=i.Palette)||void 0===o||null===(o=o.actions)||void 0===o?void 0:o.accent["03"])||(null===(t=i.Palette)||void 0===t?void 0:t.accent["03"]),[COLOR_THEMES.DEFAULT]:null===(e=i.Palette)||void 0===e?void 0:e.gray["05"],[COLOR_THEMES.ERROR]:null===(n=i.Palette)||void 0===n?void 0:n.error["03"],[COLOR_THEMES.GRADIENT]:null,[COLOR_THEMES.GRAY]:null===(d=i.Palette)||void 0===d?void 0:d.gray["03"],[COLOR_THEMES.IDENTITY_1]:null===(E=i.Palette)||void 0===E||null===(E=E.identitySolid)||void 0===E?void 0:E["01"],[COLOR_THEMES.IDENTITY_2]:null===(a=i.Palette)||void 0===a||null===(a=a.identitySolid)||void 0===a?void 0:a["02"],[COLOR_THEMES.IDENTITY_3]:null===(v=i.Palette)||void 0===v||null===(v=v.identitySolid)||void 0===v?void 0:v["03"],[COLOR_THEMES.IDENTITY_4]:null===(O=i.Palette)||void 0===O||null===(O=O.identitySolid)||void 0===O?void 0:O["04"],[COLOR_THEMES.INFO]:null===(T=i.Palette)||void 0===T?void 0:T.information["03"],[COLOR_THEMES.NEGATIVE]:null===(u=i.Palette)||void 0===u?void 0:u.light["01"],[COLOR_THEMES.SUCCESS]:null===(r=i.Palette)||void 0===r?void 0:r.success["03"],[COLOR_THEMES.WARNING]:null===(C=i.Palette)||void 0===C?void 0:C.warning["03"]}[l]},getFlagBackgroundColor=(l,i)=>{var o,t,e,n,d,E,a,v,O,T,u,r,C;return{[COLOR_THEMES.ACCENT]:(null===(o=i.Palette)||void 0===o||null===(o=o.actions)||void 0===o?void 0:o.accent["03"])||(null===(t=i.Palette)||void 0===t?void 0:t.accent["03"]),[COLOR_THEMES.DEFAULT]:null===(e=i.Palette)||void 0===e?void 0:e.gray["03"],[COLOR_THEMES.ERROR]:null===(n=i.Palette)||void 0===n?void 0:n.error["03"],[COLOR_THEMES.GRADIENT]:null,[COLOR_THEMES.GRAY]:null===(d=i.Palette)||void 0===d?void 0:d.gray["03"],[COLOR_THEMES.IDENTITY_1]:null===(E=i.Palette)||void 0===E||null===(E=E.identitySolid)||void 0===E?void 0:E["01"],[COLOR_THEMES.IDENTITY_2]:null===(a=i.Palette)||void 0===a||null===(a=a.identitySolid)||void 0===a?void 0:a["02"],[COLOR_THEMES.IDENTITY_3]:null===(v=i.Palette)||void 0===v||null===(v=v.identitySolid)||void 0===v?void 0:v["03"],[COLOR_THEMES.IDENTITY_4]:null===(O=i.Palette)||void 0===O||null===(O=O.identitySolid)||void 0===O?void 0:O["04"],[COLOR_THEMES.INFO]:null===(T=i.Palette)||void 0===T?void 0:T.information["03"],[COLOR_THEMES.NEGATIVE]:null===(u=i.Palette)||void 0===u?void 0:u.negative["03"],[COLOR_THEMES.SUCCESS]:null===(r=i.Palette)||void 0===r?void 0:r.success["03"],[COLOR_THEMES.WARNING]:null===(C=i.Palette)||void 0===C?void 0:C.warning["03"]}[l]};export const retrieveStyle=l=>{var i,o;let{showBanner:t=!0,theme:e,colorTheme:n=COLOR_THEMES.DEFAULT,flagColor:d,iconBackgroundColor:E,iconProps:a={}}=l;const v="linear-gradient(45deg, ".concat(null===(i=e.Palette)||void 0===i||null===(i=i.identityGradient)||void 0===i?void 0:i["01"]," 0%, ").concat(null===(o=e.Palette)||void 0===o||null===(o=o.identityGradient)||void 0===o?void 0:o["02"]," 100%);"),{size:O=40}=a;return{iconContainer:{alignItems:"center",background:n!==COLOR_THEMES.GRADIENT||t?"":v,backgroundColor:E||getIconBackgroundColor(n,e),borderRadius:100,display:"flex",height:1.85*O,justifyContent:"center",width:1.85*O},banner:{alignItems:"center",background:n===COLOR_THEMES.GRADIENT&&t?v:"",backgroundColor:t?getBannerBackgroundColor(n,e):"transparent",display:"flex",justifyContent:"center",padding:"12px 0",width:"100%"},flag:{background:n===COLOR_THEMES.GRADIENT?v:"",backgroundColor:d||getFlagBackgroundColor(n,e),height:"var(--UT-statusMessage-flag-height, 8px)",width:"100%"}}};
1
+ import{COLOR_THEMES}from"./constants";const getIconBackgroundColor=(l,i)=>{var o,t,e,n,d,E,a,v,O,T,u,r,C;return{[COLOR_THEMES.ACCENT]:(null===(o=i.Palette)||void 0===o||null===(o=o.actions)||void 0===o?void 0:o.accent["01"])||(null===(t=i.Palette)||void 0===t?void 0:t.accent["01"]),[COLOR_THEMES.DEFAULT]:null===(e=i.Palette)||void 0===e?void 0:e.light["03"],[COLOR_THEMES.ERROR]:null===(n=i.Palette)||void 0===n?void 0:n.error["01"],[COLOR_THEMES.GRADIENT]:"light",[COLOR_THEMES.GRAY]:null===(d=i.Palette)||void 0===d?void 0:d.light["03"],[COLOR_THEMES.IDENTITY_1]:null===(E=i.Palette)||void 0===E||null===(E=E.identitySolid)||void 0===E?void 0:E["01"],[COLOR_THEMES.IDENTITY_2]:null===(a=i.Palette)||void 0===a||null===(a=a.identitySolid)||void 0===a?void 0:a["02"],[COLOR_THEMES.IDENTITY_3]:null===(v=i.Palette)||void 0===v||null===(v=v.identitySolid)||void 0===v?void 0:v["03"],[COLOR_THEMES.IDENTITY_4]:null===(O=i.Palette)||void 0===O||null===(O=O.identitySolid)||void 0===O?void 0:O["04"],[COLOR_THEMES.INFO]:null===(T=i.Palette)||void 0===T?void 0:T.information["02"],[COLOR_THEMES.NEGATIVE]:null===(u=i.Palette)||void 0===u?void 0:u.light["01"],[COLOR_THEMES.SUCCESS]:null===(r=i.Palette)||void 0===r?void 0:r.success["02"],[COLOR_THEMES.WARNING]:null===(C=i.Palette)||void 0===C?void 0:C.warning["02"]}[l]},getBannerBackgroundColor=(l,i)=>{var o,t,e,n,d,E,a,v,O,T,u,r,C;return{[COLOR_THEMES.ACCENT]:(null===(o=i.Palette)||void 0===o||null===(o=o.actions)||void 0===o?void 0:o.accent["03"])||(null===(t=i.Palette)||void 0===t?void 0:t.accent["03"]),[COLOR_THEMES.DEFAULT]:null===(e=i.Palette)||void 0===e?void 0:e.gray["05"],[COLOR_THEMES.ERROR]:null===(n=i.Palette)||void 0===n?void 0:n.error["03"],[COLOR_THEMES.GRADIENT]:null,[COLOR_THEMES.GRAY]:null===(d=i.Palette)||void 0===d?void 0:d.gray["03"],[COLOR_THEMES.IDENTITY_1]:null===(E=i.Palette)||void 0===E||null===(E=E.identitySolid)||void 0===E?void 0:E["01"],[COLOR_THEMES.IDENTITY_2]:null===(a=i.Palette)||void 0===a||null===(a=a.identitySolid)||void 0===a?void 0:a["02"],[COLOR_THEMES.IDENTITY_3]:null===(v=i.Palette)||void 0===v||null===(v=v.identitySolid)||void 0===v?void 0:v["03"],[COLOR_THEMES.IDENTITY_4]:null===(O=i.Palette)||void 0===O||null===(O=O.identitySolid)||void 0===O?void 0:O["04"],[COLOR_THEMES.INFO]:null===(T=i.Palette)||void 0===T?void 0:T.information["03"],[COLOR_THEMES.NEGATIVE]:null===(u=i.Palette)||void 0===u?void 0:u.light["01"],[COLOR_THEMES.SUCCESS]:null===(r=i.Palette)||void 0===r?void 0:r.success["03"],[COLOR_THEMES.WARNING]:null===(C=i.Palette)||void 0===C?void 0:C.warning["03"]}[l]},getFlagBackgroundColor=(l,i)=>{var o,t,e,n,d,E,a,v,O,T,u,r,C;return{[COLOR_THEMES.ACCENT]:(null===(o=i.Palette)||void 0===o||null===(o=o.actions)||void 0===o?void 0:o.accent["03"])||(null===(t=i.Palette)||void 0===t?void 0:t.accent["03"]),[COLOR_THEMES.DEFAULT]:null===(e=i.Palette)||void 0===e?void 0:e.gray["03"],[COLOR_THEMES.ERROR]:null===(n=i.Palette)||void 0===n?void 0:n.error["03"],[COLOR_THEMES.GRADIENT]:null,[COLOR_THEMES.GRAY]:null===(d=i.Palette)||void 0===d?void 0:d.gray["03"],[COLOR_THEMES.IDENTITY_1]:null===(E=i.Palette)||void 0===E||null===(E=E.identitySolid)||void 0===E?void 0:E["01"],[COLOR_THEMES.IDENTITY_2]:null===(a=i.Palette)||void 0===a||null===(a=a.identitySolid)||void 0===a?void 0:a["02"],[COLOR_THEMES.IDENTITY_3]:null===(v=i.Palette)||void 0===v||null===(v=v.identitySolid)||void 0===v?void 0:v["03"],[COLOR_THEMES.IDENTITY_4]:null===(O=i.Palette)||void 0===O||null===(O=O.identitySolid)||void 0===O?void 0:O["04"],[COLOR_THEMES.INFO]:null===(T=i.Palette)||void 0===T?void 0:T.information["03"],[COLOR_THEMES.NEGATIVE]:null===(u=i.Palette)||void 0===u?void 0:u.negative["03"],[COLOR_THEMES.SUCCESS]:null===(r=i.Palette)||void 0===r?void 0:r.success["03"],[COLOR_THEMES.WARNING]:null===(C=i.Palette)||void 0===C?void 0:C.warning["03"]}[l]};export const retrieveStyle=l=>{var i,o;let{showBanner:t=!1,theme:e,colorTheme:n=COLOR_THEMES.DEFAULT,flagColor:d,iconBackgroundColor:E,iconProps:a={}}=l;const v="linear-gradient(45deg, ".concat(null===(i=e.Palette)||void 0===i||null===(i=i.identityGradient)||void 0===i?void 0:i["01"]," 0%, ").concat(null===(o=e.Palette)||void 0===o||null===(o=o.identityGradient)||void 0===o?void 0:o["02"]," 100%);"),{size:O=40}=a;return{iconContainer:{alignItems:"center",background:n!==COLOR_THEMES.GRADIENT||t?"":v,backgroundColor:E||getIconBackgroundColor(n,e),borderRadius:100,display:"flex",height:1.85*O,justifyContent:"center",width:1.85*O},banner:{alignItems:"center",background:n===COLOR_THEMES.GRADIENT&&t?v:"",backgroundColor:t?getBannerBackgroundColor(n,e):"transparent",display:"flex",justifyContent:"center",padding:"12px 0",width:"100%"},flag:{background:n===COLOR_THEMES.GRADIENT?v:"",backgroundColor:d||getFlagBackgroundColor(n,e),height:"var(--UT-statusMessage-flag-height, 8px)",width:"100%"}}};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.186.1",
3
+ "version": "3.187.1",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",