@vchasno/ui-kit 0.4.23 → 0.4.25

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/BodyPortal/BodyPortal.d.ts +8 -0
  3. package/dist/components/BodyPortal/BodyPortal.js +2 -0
  4. package/dist/components/BodyPortal/BodyPortal.js.map +1 -0
  5. package/dist/components/Button/Button.d.ts +2 -2
  6. package/dist/components/Button/Button.js +1 -1
  7. package/dist/components/Button/Button.js.map +1 -1
  8. package/dist/components/Checkbox/Checkbox.d.ts +2 -2
  9. package/dist/components/Checkbox/Checkbox.js +1 -1
  10. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  11. package/dist/components/Datepicker/DatePicker.d.ts +2 -2
  12. package/dist/components/Datepicker/DatePicker.js +1 -1
  13. package/dist/components/Datepicker/DatePicker.js.map +1 -1
  14. package/dist/components/FullScreenModal/FullScreenModal.d.ts +12 -0
  15. package/dist/components/FullScreenModal/FullScreenModal.js +2 -0
  16. package/dist/components/FullScreenModal/FullScreenModal.js.map +1 -0
  17. package/dist/components/FullScreenModal/useLockBodyScroll.js +2 -0
  18. package/dist/components/FullScreenModal/useLockBodyScroll.js.map +1 -0
  19. package/dist/components/Input/Input.d.ts +2 -2
  20. package/dist/components/Input/Input.js +1 -1
  21. package/dist/components/Input/Input.js.map +1 -1
  22. package/dist/components/MaskInput/MaskInput.js +1 -1
  23. package/dist/components/MaskInput/MaskInput.js.map +1 -1
  24. package/dist/components/PasswordInput/PasswordInput.js +1 -1
  25. package/dist/components/PasswordInput/PasswordInput.js.map +1 -1
  26. package/dist/components/ScrollableBox/ScrollableBox.d.ts +13 -0
  27. package/dist/components/ScrollableBox/ScrollableBox.js +2 -0
  28. package/dist/components/ScrollableBox/ScrollableBox.js.map +1 -0
  29. package/dist/components/ScrollableBox/useElementScrollable.d.ts +5 -0
  30. package/dist/components/ScrollableBox/useElementScrollable.js +2 -0
  31. package/dist/components/ScrollableBox/useElementScrollable.js.map +1 -0
  32. package/dist/components/Select/AsyncSelect.d.ts +3 -3
  33. package/dist/components/Select/AsyncSelect.js +1 -1
  34. package/dist/components/Select/AsyncSelect.js.map +1 -1
  35. package/dist/components/Select/Select.d.ts +2 -2
  36. package/dist/components/Select/Select.js +1 -1
  37. package/dist/components/Select/Select.js.map +1 -1
  38. package/dist/components/Select/SelectCreatable.d.ts +2 -2
  39. package/dist/components/Select/SelectCreatable.js +1 -1
  40. package/dist/components/Select/SelectCreatable.js.map +1 -1
  41. package/dist/components/Text/Text.d.ts +2 -2
  42. package/dist/components/Text/Text.js +1 -1
  43. package/dist/components/Text/Text.js.map +1 -1
  44. package/dist/components/TextAreaInput/TextAreaInput.js +1 -1
  45. package/dist/components/TextAreaInput/TextAreaInput.js.map +1 -1
  46. package/dist/components/TextInput/TextInput.js +1 -1
  47. package/dist/components/TextInput/TextInput.js.map +1 -1
  48. package/dist/components/types.d.ts +5 -1
  49. package/dist/css/_animations.css +18 -0
  50. package/dist/css/_theme.css +9 -0
  51. package/dist/css/vchasno-ui.css +1 -1
  52. package/dist/index.d.ts +4 -0
  53. package/dist/index.js +1 -1
  54. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.25] - 2024-11-22
11
+
12
+ ## Added
13
+
14
+ - Add FullScreenModal component (based on BodyPortal and ScrollableBox)
15
+
16
+ ## [0.4.24] - 2024-11-21
17
+
18
+ ## Added
19
+
20
+ - Add pulse animation for Inputs and Button components
21
+ - Add BodyPortal component
22
+ - Add ScrollableBox component
23
+
10
24
  ## [0.4.23] - 2024-11-05
11
25
 
12
26
  ## Fixed
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+
3
+ interface BodyPortalProps {
4
+ children: React.ReactNode;
5
+ }
6
+ declare const BodyPortal: React.FC<BodyPortalProps>;
7
+
8
+ export { type BodyPortalProps, BodyPortal as default };
@@ -0,0 +1,2 @@
1
+ import"react";import{createPortal as r}from"react-dom";var o=function(o){return /*#__PURE__*/r(o.children,document.body)};export{o as default};
2
+ //# sourceMappingURL=BodyPortal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BodyPortal.js","sources":["../../../src/components/BodyPortal/BodyPortal.tsx"],"sourcesContent":["import React from 'react';\nimport { createPortal } from 'react-dom';\n\nexport interface BodyPortalProps {\n children: React.ReactNode;\n}\n\nconst BodyPortal: React.FC<BodyPortalProps> = ({ children }) =>\n createPortal(children, document.body);\n\nexport default BodyPortal;\n"],"names":["BodyPortal","param","createPortal","children","document","body"],"mappings":"uDAOA,IAAMA,EAAwC,SAAAC,CAAA,sBAC1CC,EAD6CC,EAAAA,QAAAA,CACtBC,SAASC,IAAI"}
@@ -1,5 +1,5 @@
1
1
  import React, { ButtonHTMLAttributes } from 'react';
2
- import { Sizable, LoadingFeedback, DataQa } from '../types.js';
2
+ import { Sizable, LoadingFeedback, DataQa, WithPulseAnimation } from '../types.js';
3
3
 
4
4
  /**
5
5
  * @deprecated - it will be removed in the next major version
@@ -10,7 +10,7 @@ type ButtonThemeLight = 'light';
10
10
  */
11
11
  type ButtonThemeTransparent = 'transparent';
12
12
  type ButtonTheme = 'primary' | 'secondary' | 'danger' | 'pink';
13
- interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Partial<Sizable & LoadingFeedback & DataQa> {
13
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Partial<Sizable & LoadingFeedback & DataQa & WithPulseAnimation> {
14
14
  className?: string;
15
15
  theme?: ButtonTheme | ButtonThemeLight | ButtonThemeTransparent;
16
16
  /**
@@ -1,2 +1,2 @@
1
- import e from"react";import t from"classnames";import r from"../Spinner/Spinner.js";var n=/*#__PURE__*/e.forwardRef(function(n,o){var a=n.theme,i=n.type,l=n.size,c=n.outline,u=n.loading,s=void 0!==u&&u,d=n.wide,p=n.suppressPadding,f=n.className,m=n.dataQa,b=n.children,y=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(n,["theme","type","size","outline","loading","wide","suppressPadding","className","dataQa","children"]);return /*#__PURE__*/e.createElement("button",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({"data-qa":m,ref:o,type:void 0===i?"button":i,className:t("vchasno-ui-button","--".concat(void 0===a?"primary":a),"--".concat(void 0===l?"md":l),{"--outline":void 0!==c&&c,"--wide":void 0!==d&&d,"--loading":s,"--suppress-padding":void 0!==p&&p},f)},y),b,s&&/*#__PURE__*/e.createElement(r,{height:"1rem"}))});n.displayName="Button";export{n as default};
1
+ import e from"react";import t from"classnames";import r from"../Spinner/Spinner.js";var n=/*#__PURE__*/e.forwardRef(function(n,o){var a=n.theme,i=n.type,l=n.size,u=n.outline,c=n.loading,s=void 0!==c&&c,p=n.wide,d=n.suppressPadding,f=n.className,m=n.dataQa,b=n.children,y=n.pulse,v=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(n,["theme","type","size","outline","loading","wide","suppressPadding","className","dataQa","children","pulse"]);return /*#__PURE__*/e.createElement("button",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({"data-qa":m,ref:o,type:void 0===i?"button":i,className:t("vchasno-ui-button","--".concat(void 0===a?"primary":a),"--".concat(void 0===l?"md":l),{"vchasno-ui-pulse-animation":y,"--outline":void 0!==u&&u,"--wide":void 0!==p&&p,"--loading":s,"--suppress-padding":void 0!==d&&d},f)},v),b,s&&/*#__PURE__*/e.createElement(r,{height:"1rem"}))});n.displayName="Button";export{n as default};
2
2
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import React, { ButtonHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport Spinner from '../Spinner';\nimport { DataQa, LoadingFeedback, Sizable } from '../types';\n\nimport './Button.global.css';\n\n/**\n * @deprecated - it will be removed in the next major version\n */\ntype ButtonThemeLight = 'light';\n/**\n * @deprecated - it will be removed in the next major version\n */\ntype ButtonThemeTransparent = 'transparent';\n\ntype ButtonTheme = 'primary' | 'secondary' | 'danger' | 'pink'; // KEP specific;\nexport interface ButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n Partial<Sizable & LoadingFeedback & DataQa> {\n className?: string;\n theme?: ButtonTheme | ButtonThemeLight | ButtonThemeTransparent;\n /**\n * @deprecated - it will be removed in the next major version\n */\n outline?: boolean;\n wide?: boolean;\n suppressPadding?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n theme = 'primary',\n type = 'button',\n size = 'md',\n outline = false,\n loading = false,\n wide = false,\n suppressPadding = false,\n className,\n dataQa,\n children,\n ...rest\n },\n ref,\n ) => {\n return (\n <button\n data-qa={dataQa}\n ref={ref}\n type={type}\n className={cn(\n 'vchasno-ui-button',\n `--${theme}`,\n `--${size}`,\n {\n '--outline': outline,\n '--wide': wide,\n '--loading': loading,\n '--suppress-padding': suppressPadding,\n },\n className,\n )}\n {...rest}\n >\n {children}\n {loading && <Spinner height=\"1rem\" />}\n </button>\n );\n },\n);\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["Button","React","forwardRef","ref","theme","type","_param_size","_param","size","_param_outline","outline","loading","wide","_param_suppressPadding","suppressPadding","className","dataQa","children","rest","button","data-qa","_param_type","cn","concat","_param_wide","Spinner","height","displayName"],"mappings":"oFAgCA,IAAMA,EAASC,WAAAA,EAAAA,EAAMC,UAAU,CAC3B,SAcIC,CAAAA,CAAAA,CAAAA,UAZIC,KAAAA,CACAC,EAAAA,EAAAA,IAAAA,CAAOC,EAAAC,EACPC,KAAOC,EAAAF,EACPG,OAAAA,CACAC,EAAAA,EAAAA,OAAAA,CAAAA,cACAC,EAAAA,EAAAA,EAAAA,IAAAA,CAAOC,EAAAN,EACPO,eAAAA,CACAC,EAAAA,EAAAA,SACAC,CAAAA,EAAAA,EAAAA,MACAC,CAAAA,EAAAA,EAAAA,QACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAVHd,QACAC,OACAG,OACAE,UACAC,UACAC,OACAE,kBACAC,YACAC,SACAC,aAKJ,OAAA,WAAA,EACIhB,EAACkB,aAAAA,CAAAA,SAAAA,iaAAAA,CACGC,UAASJ,EACTb,IAAKA,EACLE,KAjBGgB,AAAA,KAAA,IAAAA,EAAA,SAAAA,EAkBHN,UAAWO,EACP,oBACA,KAAWC,OArBnBnB,AAAAA,KAAAA,IAAAA,EAAQ,UACRC,GAqBS,KAASkB,MAAA,CApBXjB,AAAA,KAAA,IAAAA,EAAA,KAAAA,GAqBC,CACI,YArBZI,AAAAA,KAAAA,IAAAA,GACAC,EAqBY,SApBLa,AAAA,KAAA,IAAAA,GAAAA,EAqBK,YAAab,EACb,qBArBZG,AAAAA,KAAAA,IAAAA,GACAC,CAsBQA,EAAAA,IAEAG,GAEHD,EACAN,gBAAWV,EAACwB,aAAAA,CAAAA,EAAAA,CAAQC,OAAO,SAGxC,EAGJ1B,CAAAA,EAAO2B,WAAW,CAAG"}
1
+ {"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import React, { ButtonHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport Spinner from '../Spinner';\nimport { DataQa, LoadingFeedback, Sizable, WithPulseAnimation } from '../types';\n\nimport './Button.global.css';\n\n/**\n * @deprecated - it will be removed in the next major version\n */\ntype ButtonThemeLight = 'light';\n/**\n * @deprecated - it will be removed in the next major version\n */\ntype ButtonThemeTransparent = 'transparent';\n\ntype ButtonTheme = 'primary' | 'secondary' | 'danger' | 'pink'; // KEP specific;\nexport interface ButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n Partial<Sizable & LoadingFeedback & DataQa & WithPulseAnimation> {\n className?: string;\n theme?: ButtonTheme | ButtonThemeLight | ButtonThemeTransparent;\n /**\n * @deprecated - it will be removed in the next major version\n */\n outline?: boolean;\n wide?: boolean;\n suppressPadding?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n theme = 'primary',\n type = 'button',\n size = 'md',\n outline = false,\n loading = false,\n wide = false,\n suppressPadding = false,\n className,\n dataQa,\n children,\n pulse,\n ...rest\n },\n ref,\n ) => {\n return (\n <button\n data-qa={dataQa}\n ref={ref}\n type={type}\n className={cn(\n 'vchasno-ui-button',\n `--${theme}`,\n `--${size}`,\n {\n 'vchasno-ui-pulse-animation': pulse,\n '--outline': outline,\n '--wide': wide,\n '--loading': loading,\n '--suppress-padding': suppressPadding,\n },\n className,\n )}\n {...rest}\n >\n {children}\n {loading && <Spinner height=\"1rem\" />}\n </button>\n );\n },\n);\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["Button","React","forwardRef","ref","theme","type","_param_size","_param","size","outline","_param_loading","loading","wide","_param_suppressPadding","suppressPadding","className","dataQa","children","pulse","rest","button","data-qa","_param_type","cn","concat","_param_outline","_param_wide","Spinner","height","displayName"],"mappings":"oFAgCA,IAAMA,EAASC,WAAAA,EAAAA,EAAMC,UAAU,CAC3B,SAeIC,CAAAA,CAAAA,CAAAA,UAbIC,KAAAA,CACAC,EAAAA,EAAAA,IAAAA,CAAOC,EAAAC,EACPC,IAAAA,CACAC,EAAAA,EAAAA,OAAAA,CAAUC,EAAAH,EACVI,OAAAA,CAAAA,EAAAA,AAAAA,KAAAA,IAAAA,GACAC,EAAAA,EAAAA,EAAAA,IAAAA,CAAOC,EAAAN,EACPO,eAAAA,CACAC,EAAAA,EAAAA,SACAC,CAAAA,EAAAA,EAAAA,MACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAXHf,QACAC,OACAG,OACAC,UACAE,UACAC,OACAE,kBACAC,YACAC,SACAC,WACAC,UAKJ,OAAA,WAAA,EACIjB,EAACmB,aAAAA,CAAAA,SAAAA,iaAAAA,CACGC,UAASL,EACTb,IAAKA,EACLE,KAlBGiB,AAAA,KAAA,IAAAA,EAAA,SAAAA,EAmBHP,UAAWQ,EACP,oBACA,KAAWC,OAtBnBpB,AAAAA,KAAAA,IAAAA,EAAQ,UACRC,GAsBS,KAASmB,MAAA,CArBlBhB,AAAAA,KAAAA,IAAAA,EAAO,KACPC,GAqBQ,CACI,6BAA8BS,EAC9B,YAvBFO,AAAA,KAAA,IAAAA,GAAAA,EAwBE,SAtBLC,AAAA,KAAA,IAAAA,GAAAA,EAuBK,YAAaf,EACb,qBAvBZG,AAAAA,KAAAA,IAAAA,GACAC,CAwBQA,EAAAA,IAEAI,GAEHF,EACAN,gBAAWV,EAAC0B,aAAAA,CAAAA,EAAAA,CAAQC,OAAO,SAGxC,EAGJ5B,CAAAA,EAAO6B,WAAW,CAAG"}
@@ -1,7 +1,7 @@
1
1
  import React, { InputHTMLAttributes } from 'react';
2
- import { LoadingFeedback, DataQa } from '../types.js';
2
+ import { LoadingFeedback, DataQa, WithPulseAnimation } from '../types.js';
3
3
 
4
- interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement>, Partial<LoadingFeedback & DataQa> {
4
+ interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement>, Partial<LoadingFeedback & DataQa & WithPulseAnimation> {
5
5
  className?: string;
6
6
  label?: string;
7
7
  disabled?: boolean;
@@ -1,2 +1,2 @@
1
- import e from"react";import t from"classnames";import r from"../Spinner/Spinner.js";var a=/*#__PURE__*/e.forwardRef(function(a,n){var l=a.className,o=a.label,c=a.partial,i=a.disabled,s=a.loading,b=a.dataQa,m=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},l=Object.keys(e);for(a=0;a<l.length;a++)r=l[a],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)r=l[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(a,["className","label","partial","disabled","loading","dataQa"]);return /*#__PURE__*/e.createElement("label",{"data-qa":b,className:t("vchasno-ui-checkbox",l,{"--loading":s,"--disabled":i})},/*#__PURE__*/e.createElement("input",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},a=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),a.forEach(function(t){var a;a=r[t],t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a})}return e}({ref:n,type:"checkbox",hidden:!0,disabled:i},m)),/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-checkbox__box"},s&&/*#__PURE__*/e.createElement(r,{height:"90%"}),c?/*#__PURE__*/e.createElement("svg",{className:"vchasno-ui-checkbox__svg",width:"8",height:"2",viewBox:"0 0 8 2",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("rect",{width:"8",height:"2",rx:"1",fill:"currentColor"})):/*#__PURE__*/e.createElement("svg",{className:"vchasno-ui-checkbox__svg",width:"10",height:"7",viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M4 7C3.8 7 3.5 6.9 3.3 6.7L0.3 3.7C-0.1 3.3 -0.1 2.7 0.3 2.3C0.7 1.9 1.3 1.9 1.7 2.3L4 4.6L8.3 0.3C8.7 -0.1 9.3 -0.1 9.7 0.3C10.1 0.7 10.1 1.3 9.7 1.7L4.7 6.7C4.5 6.9 4.3 7 4 7Z",fill:"currentColor"}))),o&&/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-checkbox__label"},o))});a.displayName="Checkbox";export{a as default};
1
+ import e from"react";import t from"classnames";import a from"../Spinner/Spinner.js";var r=/*#__PURE__*/e.forwardRef(function(r,n){var l=r.className,o=r.label,c=r.partial,i=r.disabled,s=r.loading,b=r.dataQa,u=r.pulse,m=function(e,t){if(null==e)return{};var a,r,n=function(e,t){if(null==e)return{};var a,r,n={},l=Object.keys(e);for(r=0;r<l.length;r++)a=l[r],t.indexOf(a)>=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)a=l[r],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}(r,["className","label","partial","disabled","loading","dataQa","pulse"]);return /*#__PURE__*/e.createElement("label",{"data-qa":b,className:t("vchasno-ui-checkbox",l,{"--loading":s,"--disabled":i})},/*#__PURE__*/e.createElement("input",function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{},r=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),r.forEach(function(t){var r;r=a[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({ref:n,type:"checkbox",hidden:!0,disabled:i},m)),/*#__PURE__*/e.createElement("span",{className:t("vchasno-ui-checkbox__box",{"vchasno-ui-pulse-animation":u})},s&&/*#__PURE__*/e.createElement(a,{height:"90%"}),c?/*#__PURE__*/e.createElement("svg",{className:"vchasno-ui-checkbox__svg",width:"8",height:"2",viewBox:"0 0 8 2",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("rect",{width:"8",height:"2",rx:"1",fill:"currentColor"})):/*#__PURE__*/e.createElement("svg",{className:"vchasno-ui-checkbox__svg",width:"10",height:"7",viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M4 7C3.8 7 3.5 6.9 3.3 6.7L0.3 3.7C-0.1 3.3 -0.1 2.7 0.3 2.3C0.7 1.9 1.3 1.9 1.7 2.3L4 4.6L8.3 0.3C8.7 -0.1 9.3 -0.1 9.7 0.3C10.1 0.7 10.1 1.3 9.7 1.7L4.7 6.7C4.5 6.9 4.3 7 4 7Z",fill:"currentColor"}))),o&&/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-checkbox__label"},o))});r.displayName="Checkbox";export{r as default};
2
2
  //# sourceMappingURL=Checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport Spinner from '../Spinner';\nimport type { DataQa, LoadingFeedback } from '../types';\n\nimport './Checkbox.global.css';\n\nexport interface CheckboxProps\n extends InputHTMLAttributes<HTMLInputElement>,\n Partial<LoadingFeedback & DataQa> {\n className?: string;\n label?: string;\n disabled?: boolean;\n partial?: boolean;\n}\n\nconst Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n ({ className, label, partial, disabled, loading, dataQa, ...rest }, ref) => {\n return (\n <label\n data-qa={dataQa}\n className={cn('vchasno-ui-checkbox', className, {\n '--loading': loading,\n '--disabled': disabled,\n })}\n >\n <input ref={ref} type=\"checkbox\" hidden disabled={disabled} {...rest} />\n <span className=\"vchasno-ui-checkbox__box\">\n {loading && <Spinner height=\"90%\" />}\n {partial ? (\n <svg\n className=\"vchasno-ui-checkbox__svg\"\n width=\"8\"\n height=\"2\"\n viewBox=\"0 0 8 2\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect width=\"8\" height=\"2\" rx=\"1\" fill=\"currentColor\" />\n </svg>\n ) : (\n <svg\n className=\"vchasno-ui-checkbox__svg\"\n width=\"10\"\n height=\"7\"\n viewBox=\"0 0 10 7\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4 7C3.8 7 3.5 6.9 3.3 6.7L0.3 3.7C-0.1 3.3 -0.1 2.7 0.3 2.3C0.7 1.9 1.3 1.9 1.7 2.3L4 4.6L8.3 0.3C8.7 -0.1 9.3 -0.1 9.7 0.3C10.1 0.7 10.1 1.3 9.7 1.7L4.7 6.7C4.5 6.9 4.3 7 4 7Z\"\n fill=\"currentColor\"\n />\n </svg>\n )}\n </span>\n {label && <span className=\"vchasno-ui-checkbox__label\">{label}</span>}\n </label>\n );\n },\n);\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["Checkbox","React","forwardRef","ref","className","label","partial","disabled","loading","dataQa","rest","data-qa","cn","input","type","hidden","span","Spinner","height","svg","width","viewBox","fill","xmlns","rect","rx","path","d","displayName"],"mappings":"oFAkBA,IAAMA,EAAWC,WAAAA,EAAAA,EAAMC,UAAU,CAC7B,SAAoEC,CAAAA,CAAAA,CAAAA,MAAjEC,EAAAA,EAAAA,SAAAA,CAAWC,EAAAA,EAAAA,KAAAA,CAAOC,EAAAA,EAAAA,OAAAA,CAASC,IAAAA,QAAUC,CAAAA,EAAAA,EAAAA,OAASC,CAAAA,EAAAA,EAAAA,MAAWC,CAAAA,EAAAA,sXAAAA,EAAAA,CAAzDN,YAAWC,QAAOC,UAASC,WAAUC,UAASC,WAC7C,oBACIR,EAACI,aAAAA,CAAAA,QAAAA,CACGM,UAASF,EACTL,UAAWQ,EAAG,sBAAuBR,EAAW,CAC5C,YAAaI,EACb,aAAcD,CAClB,iBAEAN,EAACY,aAAAA,CAAAA,QAAAA,iaAAAA,CAAMV,IAAKA,EAAKW,KAAK,WAAWC,OAAAA,CAAAA,EAAOR,SAAUA,CAAcG,EAAAA,IAAAA,WAAAA,EAChET,EAACe,aAAAA,CAAAA,OAAAA,CAAKZ,UAAU,0BACXI,EAAAA,GAAW,WAAA,EAAAP,EAACgB,aAAAA,CAAAA,EAAAA,CAAQC,OAAO,KAC3BZ,GAAAA,EAAAA,WAAAA,EACGL,EAACkB,aAAAA,CAAAA,MAAAA,CACGf,UAAU,2BACVgB,MAAM,IACNF,OAAO,IACPG,QAAQ,UACRC,KAAK,OACLC,MAAM,2CAENtB,EAACuB,aAAAA,CAAAA,OAAAA,CAAKJ,MAAM,IAAIF,OAAO,IAAIO,GAAG,IAAIH,KAAK,kBAG3C,WAAA,EAAArB,EAACkB,aAAAA,CAAAA,MAAAA,CACGf,UAAU,2BACVgB,MAAM,KACNF,OAAO,IACPG,QAAQ,WACRC,KAAK,OACLC,MAAM,2CAENtB,EAACyB,aAAAA,CAAAA,OAAAA,CACGC,EAAE,oLACFL,KAAK,cAKpBjB,KAAAA,GAAS,WAAA,EAAAJ,EAACe,aAAAA,CAAAA,OAAAA,CAAKZ,UAAU,4BAA8BC,EAAAA,GAGpE,EAGJL,CAAAA,EAAS4B,WAAW,CAAG"}
1
+ {"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport Spinner from '../Spinner';\nimport type { DataQa, LoadingFeedback, WithPulseAnimation } from '../types';\n\nimport './Checkbox.global.css';\n\nexport interface CheckboxProps\n extends InputHTMLAttributes<HTMLInputElement>,\n Partial<LoadingFeedback & DataQa & WithPulseAnimation> {\n className?: string;\n label?: string;\n disabled?: boolean;\n partial?: boolean;\n}\n\nconst Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n ({ className, label, partial, disabled, loading, dataQa, pulse, ...rest }, ref) => {\n return (\n <label\n data-qa={dataQa}\n className={cn('vchasno-ui-checkbox', className, {\n '--loading': loading,\n '--disabled': disabled,\n })}\n >\n <input ref={ref} type=\"checkbox\" hidden disabled={disabled} {...rest} />\n <span\n className={cn('vchasno-ui-checkbox__box', {\n 'vchasno-ui-pulse-animation': pulse,\n })}\n >\n {loading && <Spinner height=\"90%\" />}\n {partial ? (\n <svg\n className=\"vchasno-ui-checkbox__svg\"\n width=\"8\"\n height=\"2\"\n viewBox=\"0 0 8 2\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect width=\"8\" height=\"2\" rx=\"1\" fill=\"currentColor\" />\n </svg>\n ) : (\n <svg\n className=\"vchasno-ui-checkbox__svg\"\n width=\"10\"\n height=\"7\"\n viewBox=\"0 0 10 7\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4 7C3.8 7 3.5 6.9 3.3 6.7L0.3 3.7C-0.1 3.3 -0.1 2.7 0.3 2.3C0.7 1.9 1.3 1.9 1.7 2.3L4 4.6L8.3 0.3C8.7 -0.1 9.3 -0.1 9.7 0.3C10.1 0.7 10.1 1.3 9.7 1.7L4.7 6.7C4.5 6.9 4.3 7 4 7Z\"\n fill=\"currentColor\"\n />\n </svg>\n )}\n </span>\n {label && <span className=\"vchasno-ui-checkbox__label\">{label}</span>}\n </label>\n );\n },\n);\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["Checkbox","React","forwardRef","ref","className","label","partial","disabled","loading","dataQa","pulse","rest","data-qa","cn","input","type","hidden","span","Spinner","height","svg","width","viewBox","fill","xmlns","rect","rx","path","d","displayName"],"mappings":"oFAkBA,IAAMA,EAAWC,WAAAA,EAAAA,EAAMC,UAAU,CAC7B,SAA2EC,CAAAA,CAAAA,CAAAA,EAAxEC,IAAAA,EAAAA,EAAAA,SAAWC,CAAAA,EAAAA,EAAAA,KAAOC,CAAAA,EAAAA,EAAAA,OAASC,CAAAA,EAAAA,EAAAA,QAAUC,CAAAA,EAAAA,EAAAA,OAASC,CAAAA,EAAAA,EAAAA,MAAQC,CAAAA,EAAAA,EAAAA,KAAUC,CAAAA,EAAAA,sXAAAA,EAAAA,CAAhEP,YAAWC,QAAOC,UAASC,WAAUC,UAASC,SAAQC,UACrD,oBACIT,EAACI,aAAAA,CAAAA,QAAAA,CACGO,UAASH,EACTL,UAAWS,EAAG,sBAAuBT,EAAW,CAC5C,YAAaI,EACb,aAAcD,CAClB,iBAEAN,EAACa,aAAAA,CAAAA,QAAAA,iaAAAA,CAAMX,IAAKA,EAAKY,KAAK,WAAWC,OAAAA,CAAAA,EAAOT,SAAUA,CAAcI,EAAAA,IAAAA,WAAAA,EAChEV,EAACgB,aAAAA,CAAAA,OAAAA,CACGb,UAAWS,EAAG,2BAA4B,CACtC,6BAA8BH,CAClC,EAECF,EAAAA,GAAW,WAAA,EAAAP,EAACiB,aAAAA,CAAAA,EAAAA,CAAQC,OAAO,KAC3Bb,GAAAA,EAAAA,WAAAA,EACGL,EAACmB,aAAAA,CAAAA,MAAAA,CACGhB,UAAU,2BACViB,MAAM,IACNF,OAAO,IACPG,QAAQ,UACRC,KAAK,OACLC,MAAM,2CAENvB,EAACwB,aAAAA,CAAAA,OAAAA,CAAKJ,MAAM,IAAIF,OAAO,IAAIO,GAAG,IAAIH,KAAK,kBAG3C,WAAA,EAAAtB,EAACmB,aAAAA,CAAAA,MAAAA,CACGhB,UAAU,2BACViB,MAAM,KACNF,OAAO,IACPG,QAAQ,WACRC,KAAK,OACLC,MAAM,2CAENvB,EAAC0B,aAAAA,CAAAA,OAAAA,CACGC,EAAE,oLACFL,KAAK,cAKpBlB,KAAAA,GAAS,WAAA,EAAAJ,EAACgB,aAAAA,CAAAA,OAAAA,CAAKb,UAAU,4BAA8BC,EAAAA,GAGpE,EAGJL,CAAAA,EAAS6B,WAAW,CAAG"}
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { ReactDatePickerProps } from 'react-datepicker';
3
3
  import { MaskedInputProps } from 'react-text-mask';
4
- import { LoadingFeedback, WithHint, ErrorFeedback, DataQa, HideEmptyMeta } from '../types.js';
4
+ import { LoadingFeedback, WithHint, ErrorFeedback, DataQa, HideEmptyMeta, WithPulseAnimation } from '../types.js';
5
5
 
6
- interface DatePickerProps extends ReactDatePickerProps, Partial<LoadingFeedback & WithHint & ErrorFeedback & DataQa & HideEmptyMeta> {
6
+ interface DatePickerProps extends ReactDatePickerProps, Partial<LoadingFeedback & WithHint & ErrorFeedback & DataQa & HideEmptyMeta & WithPulseAnimation> {
7
7
  label?: string;
8
8
  className?: string;
9
9
  showMask?: boolean;
@@ -1,2 +1,2 @@
1
- import e from"react";import t from"react-datepicker";import r from"react-text-mask";import a from"classnames";import{uk as o}from"date-fns/locale/uk";import n from"../../icons/clear.js";import l from"../InputMeta/InputMeta.js";import i from"../LabelText/LabelText.js";import c from"../Spinner/Spinner.js";var d=function(){return /*#__PURE__*/e.createElement("svg",{className:"vchasno-ui-date-picker__custom-calendar-icon",width:"20",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 4h1c.6 0 1 .4 1 1v10c0 1.7-1.3 3-3 3H5c-1.7 0-3-1.3-3-3V5c0-.6.4-1 1-1h1V3c0-.6.4-1 1-1s1 .4 1 1v1h8V3c0-.6.4-1 1-1s1 .4 1 1v1zm-1 12c.6 0 1-.4 1-1V6H4v9c0 .6.4 1 1 1h10zM8 9a1 1 0 11-2 0 1 1 0 012 0zm2 1a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0zm-7 5a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0z",fill:"currentColor"}))},m=function(){return /*#__PURE__*/e.createElement("span",{className:"vchasno-ui-date-picker__custom-close-icon"},n)},s=["dd.MM.yyyy","dd-MM-yyyy","dd/MM/yyyy","dd.MM.yy","dd-MM-yy","dd/MM/yy"],p=[/\d/,/\d/,".",/\d/,/\d/,".",/\d/,/\d/,/\d/,/\d/],u=function(n){var u=n.label,f=n.disabled,y=n.required,b=n.loading,h=n.hint,v=n.error,w=n.dateFormat,M=n.className,k=n.timeCaption,g=n.enableTabLoop,E=n.locale,O=n.showMask,j=void 0!==O&&O,x=n.showPopperArrow,P=n.mask,_=n.dataQa,z=n.hideEmptyMeta,N=n.wide,S=function(e,t){if(null==e)return{};var r,a,o=function(e,t){if(null==e)return{};var r,a,o={},n=Object.keys(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(n,["label","disabled","required","loading","hint","error","dateFormat","className","timeCaption","enableTabLoop","locale","showMask","showPopperArrow","mask","dataQa","hideEmptyMeta","wide"]),T=!!S.selected||!!S.value;return /*#__PURE__*/e.createElement("label",{"data-qa":_,className:a("vchasno-ui-date-picker",{"--loading":b,"--required":y,"--disabled":f,"--error":v,"--with-mask":j,"--wide":void 0!==N&&N,"--not-empty":T},M)},/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-date-picker__wrapper"},u&&/*#__PURE__*/e.createElement(i,null,u),/*#__PURE__*/e.createElement(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},a=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),a.forEach(function(t){var a;a=r[t],t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a})}return e}({enableTabLoop:void 0!==g&&g,locale:void 0===E?o:E,timeCaption:void 0===k?"Час":k,disabled:f,placeholderText:" ",showPopperArrow:void 0!==x&&x,className:"vchasno-ui-date-picker__picker",dateFormat:void 0===w?s:w,customInput:j?/*#__PURE__*/e.createElement(r,{inputMode:"text",mask:void 0===P?p:P,showMask:!0}):void 0},S)),b?/*#__PURE__*/e.createElement(c,{height:"18px"}):/*#__PURE__*/e.createElement(d,null),/*#__PURE__*/e.createElement(m,null)),!(void 0!==z&&z)||v||h?/*#__PURE__*/e.createElement(l,{hint:h,error:v}):null)};export{u as default};
1
+ import e from"react";import t from"react-datepicker";import r from"react-text-mask";import a from"classnames";import{uk as o}from"date-fns/locale/uk";import n from"../../icons/clear.js";import l from"../InputMeta/InputMeta.js";import i from"../LabelText/LabelText.js";import c from"../Spinner/Spinner.js";var d=function(){return /*#__PURE__*/e.createElement("svg",{className:"vchasno-ui-date-picker__custom-calendar-icon",width:"20",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 4h1c.6 0 1 .4 1 1v10c0 1.7-1.3 3-3 3H5c-1.7 0-3-1.3-3-3V5c0-.6.4-1 1-1h1V3c0-.6.4-1 1-1s1 .4 1 1v1h8V3c0-.6.4-1 1-1s1 .4 1 1v1zm-1 12c.6 0 1-.4 1-1V6H4v9c0 .6.4 1 1 1h10zM8 9a1 1 0 11-2 0 1 1 0 012 0zm2 1a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0zm-7 5a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0z",fill:"currentColor"}))},s=function(){return /*#__PURE__*/e.createElement("span",{className:"vchasno-ui-date-picker__custom-close-icon"},n)},m=["dd.MM.yyyy","dd-MM-yyyy","dd/MM/yyyy","dd.MM.yy","dd-MM-yy","dd/MM/yy"],p=[/\d/,/\d/,".",/\d/,/\d/,".",/\d/,/\d/,/\d/,/\d/],u=function(n){var u=n.label,f=n.disabled,y=n.required,h=n.loading,v=n.hint,b=n.error,w=n.dateFormat,M=n.className,k=n.timeCaption,g=n.enableTabLoop,E=n.locale,O=n.showMask,j=void 0!==O&&O,x=n.showPopperArrow,P=n.mask,_=n.dataQa,z=n.hideEmptyMeta,N=n.wide,S=n.pulse,T=function(e,t){if(null==e)return{};var r,a,o=function(e,t){if(null==e)return{};var r,a,o={},n=Object.keys(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(n,["label","disabled","required","loading","hint","error","dateFormat","className","timeCaption","enableTabLoop","locale","showMask","showPopperArrow","mask","dataQa","hideEmptyMeta","wide","pulse"]),L=!!T.selected||!!T.value;return /*#__PURE__*/e.createElement("label",{"data-qa":_,className:a("vchasno-ui-date-picker",{"--loading":h,"--required":y,"--disabled":f,"--error":b,"--with-mask":j,"--wide":void 0!==N&&N,"--not-empty":L},M)},/*#__PURE__*/e.createElement("span",{className:a("vchasno-ui-date-picker__wrapper",{"vchasno-ui-pulse-animation":S})},u&&/*#__PURE__*/e.createElement(i,null,u),/*#__PURE__*/e.createElement(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},a=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),a.forEach(function(t){var a;a=r[t],t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a})}return e}({enableTabLoop:void 0!==g&&g,locale:void 0===E?o:E,timeCaption:void 0===k?"Час":k,disabled:f,placeholderText:" ",showPopperArrow:void 0!==x&&x,className:"vchasno-ui-date-picker__picker",dateFormat:void 0===w?m:w,customInput:j?/*#__PURE__*/e.createElement(r,{inputMode:"text",mask:void 0===P?p:P,showMask:!0}):void 0},T)),h?/*#__PURE__*/e.createElement(c,{height:"18px"}):/*#__PURE__*/e.createElement(d,null),/*#__PURE__*/e.createElement(s,null)),!(void 0!==z&&z)||b||v?/*#__PURE__*/e.createElement(l,{hint:v,error:b}):null)};export{u as default};
2
2
  //# sourceMappingURL=DatePicker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.js","sources":["../../../src/components/Datepicker/DatePicker.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactDatePickerProps } from 'react-datepicker';\nimport ReactDatePicker from 'react-datepicker';\nimport MaskedInput, { MaskedInputProps } from 'react-text-mask';\n\nimport cn from 'classnames';\nimport { uk } from 'date-fns/locale/uk';\n\nimport clearRawSvg from '../../icons/clear';\nimport InputMeta from '../InputMeta';\nimport LabelText from '../LabelText';\nimport Spinner from '../Spinner';\nimport { DataQa, ErrorFeedback, HideEmptyMeta, LoadingFeedback, WithHint } from '../types';\n\nimport './DatePicker.global.css';\n\nconst SvgCalendar = () => (\n <svg\n className=\"vchasno-ui-date-picker__custom-calendar-icon\"\n width=\"20\"\n height=\"20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16 4h1c.6 0 1 .4 1 1v10c0 1.7-1.3 3-3 3H5c-1.7 0-3-1.3-3-3V5c0-.6.4-1 1-1h1V3c0-.6.4-1 1-1s1 .4 1 1v1h8V3c0-.6.4-1 1-1s1 .4 1 1v1zm-1 12c.6 0 1-.4 1-1V6H4v9c0 .6.4 1 1 1h10zM8 9a1 1 0 11-2 0 1 1 0 012 0zm2 1a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0zm-7 5a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\n// Вставляємо на місце де має відображатися іконка закриття бібілотеки так як немає API для підміни іконки та її контролю\n// за допомогою :has(.react-datepicker__close-icon) та :has(.react-datepicker__close-icon:hover) контролюємо появу та зміну кольору іконки\nconst CloseSvg = () => (\n <span className=\"vchasno-ui-date-picker__custom-close-icon\">{clearRawSvg}</span>\n);\n\nconst DATE_FORMATS = ['dd.MM.yyyy', 'dd-MM-yyyy', 'dd/MM/yyyy', 'dd.MM.yy', 'dd-MM-yy', 'dd/MM/yy'];\n\nconst defaultMask: MaskedInputProps['mask'] = [\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n /\\d/,\n /\\d/,\n];\n\nexport interface DatePickerProps\n extends ReactDatePickerProps,\n Partial<LoadingFeedback & WithHint & ErrorFeedback & DataQa & HideEmptyMeta> {\n label?: string;\n className?: string;\n showMask?: boolean;\n mask?: MaskedInputProps['mask'];\n onChange: ReactDatePickerProps['onChange'];\n isClearable?: ReactDatePickerProps['isClearable'];\n dateFormat?: ReactDatePickerProps['dateFormat'];\n wide?: boolean;\n}\n\n/**\n * @see <https://reactdatepicker.com/>\n */\nconst DatePicker: React.FC<DatePickerProps> = ({\n label,\n disabled,\n required,\n loading,\n hint,\n error,\n dateFormat = DATE_FORMATS,\n className,\n timeCaption = 'Час',\n enableTabLoop = false,\n locale = uk,\n showMask = false,\n showPopperArrow = false,\n mask = defaultMask,\n dataQa,\n hideEmptyMeta = false,\n wide = false,\n ...rest\n}) => {\n const valueExists = !!rest.selected || !!rest.value;\n\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-date-picker',\n {\n '--loading': loading,\n '--required': required,\n '--disabled': disabled,\n '--error': error,\n '--with-mask': showMask,\n '--wide': wide,\n '--not-empty': valueExists,\n },\n className,\n )}\n >\n <span className=\"vchasno-ui-date-picker__wrapper\">\n {label && <LabelText>{label}</LabelText>}\n <ReactDatePicker\n enableTabLoop={enableTabLoop}\n locale={locale}\n timeCaption={timeCaption}\n disabled={disabled}\n placeholderText=\" \"\n showPopperArrow={showPopperArrow}\n className=\"vchasno-ui-date-picker__picker\"\n dateFormat={dateFormat}\n customInput={\n showMask ? <MaskedInput inputMode=\"text\" mask={mask} showMask /> : undefined\n }\n {...rest}\n />\n {loading ? <Spinner height=\"18px\" /> : <SvgCalendar />}\n <CloseSvg />\n </span>\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n};\n\nexport default DatePicker;\n"],"names":["SvgCalendar","React","svg","className","width","height","fill","xmlns","path","fillRule","clipRule","d","CloseSvg","span","clearRawSvg","DATE_FORMATS","defaultMask","DatePicker","_param","label","disabled","required","loading","hint","error","dateFormat","timeCaption","enableTabLoop","_param_locale","locale","uk","showMask","_param_showMask","_param_showPopperArrow","showPopperArrow","_param_mask","mask","dataQa","hideEmptyMeta","wide","rest","valueExists","selected","value","data-qa","cn","createElement","LabelText","ReactDatePicker","_param_enableTabLoop","placeholderText","customInput","MaskedInput","inputMode","undefined","Spinner","InputMeta"],"mappings":"iTAgBA,IAAMA,EAAc,+BAChBC,EAACC,aAAAA,CAAAA,MAAAA,CACGC,UAAU,+CACVC,MAAM,KACNC,OAAO,KACPC,KAAK,OACLC,MAAM,2CAENN,EAACO,aAAAA,CAAAA,OAAAA,CACGC,SAAS,UACTC,SAAS,UACTC,EAAE,sUACFL,KAAK,mBAOXM,EAAW,+BACbX,EAACY,aAAAA,CAAAA,OAAAA,CAAKV,UAAU,2CAA6CW,EAAAA,IAG3DC,EAAe,CAAC,aAAc,aAAc,aAAc,WAAY,WAAY,WAAW,CAE7FC,EAAwC,CAC1C,KACA,KACA,IACA,KACA,KACA,IACA,KACA,KACA,KACA,KACH,CAkBKC,EAAwC,SAAAC,CAAA,EAC1CC,IAAAA,EAAAA,EAAAA,MACAC,EAAAA,EAAAA,QAAAA,CACAC,IAAAA,QACAC,CAAAA,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,IAAAA,CACAC,EAAAA,EAAAA,KAAAA,CAAAA,EAAAA,EACAC,WACAtB,IAAAA,SACAuB,CAAAA,EAAAA,EAAAA,WAAAA,CACAC,EAAAA,EAAAA,aAAAA,CAAgBC,EAAAV,EAChBW,OAASC,EAAAA,EACTC,SAAAA,EAAWC,AAAA,KAAA,IAAAA,GAAAA,EAAAC,EAAAf,EACXgB,gBAAkBC,EAAAjB,EAClBkB,KACAC,IAAAA,MACAC,CAAAA,EAAAA,EAAAA,aAAAA,CACAC,EAAAA,EAAAA,IAAAA,CACGC,EAAAA,sXAAAA,EAAAA,CAjBHrB,QACAC,WACAC,WACAC,UACAC,OACAC,QACAC,aACAtB,YACAuB,cACAC,gBACAE,SACAE,WACAG,kBACAE,OACAC,SACAC,gBACAC,SAGME,EAAc,CAAC,CAACD,EAAKE,QAAQ,EAAI,CAAC,CAACF,EAAKG,KAAK,CAEnD,oBACI1C,EAACkB,aAAAA,CAAAA,QAAAA,CACGyB,UAASP,EACTlC,UAAW0C,EACP,yBACA,CACI,YAAavB,EACb,aAAcD,EACd,aAAcD,EACd,UAAWI,EACX,cAAeO,EACf,qBAfbS,EAgBa,cAAeC,CAEnBtC,EAAAA,iBAGJF,EAACY,aAAAA,CAAAA,OAAAA,CAAKV,UAAU,mCACXgB,GAAS,WAAA,EAAAlB,EAAA6C,aAAA,CAACC,EAAW5B,KAAAA,gBACtBlB,EAAC+C,aAAAA,CAAAA,EAAAA,iaAAAA,CACGrB,cAhCAsB,AAAA,KAAA,IAAAA,GAAAA,EAiCApB,OAhCPC,AAAAA,KAAAA,IAAAA,EAAAA,EAAAA,EAiCOJ,uBAnCF,MACdC,EAmCgBP,SAAUA,EACV8B,gBAAgB,IAChBhB,gBAlCED,AAAA,KAAA,IAAAA,GAAAA,EAmCF9B,UAAU,iCACVsB,WA1CHV,AAAAA,KAAAA,IAAAA,EAAAA,EAAAA,EA2CGoC,YACIpB,eAAW9B,EAACmD,aAAAA,CAAAA,EAAAA,CAAYC,UAAU,OAAOjB,KArCtDpB,AAAAA,KAAAA,IAAAA,EAAAA,EAAAA,EAqCkEe,SAAAA,CAAAA,CAAcuB,GAAAA,KAAAA,CAEnEd,EAAAA,IAEPlB,EAAU,WAAA,EAAArB,EAACsD,aAAAA,CAAAA,EAAAA,CAAQlD,OAAO,SAAY,WAAA,EAAAJ,EAACD,aAAAA,CAAAA,EAAAA,mBACxCC,gBAACW,EAEJ0B,OAAAA,cAzCTC,CAAAA,GAyC2Bf,GAAUD,eAActB,EAACuD,aAAAA,CAAAA,EAAAA,CAAUjC,KAAMA,EAAMC,MAAOA,IAArC,KAGhD"}
1
+ {"version":3,"file":"DatePicker.js","sources":["../../../src/components/Datepicker/DatePicker.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactDatePickerProps } from 'react-datepicker';\nimport ReactDatePicker from 'react-datepicker';\nimport MaskedInput, { MaskedInputProps } from 'react-text-mask';\n\nimport cn from 'classnames';\nimport { uk } from 'date-fns/locale/uk';\n\nimport clearRawSvg from '../../icons/clear';\nimport InputMeta from '../InputMeta';\nimport LabelText from '../LabelText';\nimport Spinner from '../Spinner';\nimport {\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n LoadingFeedback,\n WithHint,\n WithPulseAnimation,\n} from '../types';\n\nimport './DatePicker.global.css';\n\nconst SvgCalendar = () => (\n <svg\n className=\"vchasno-ui-date-picker__custom-calendar-icon\"\n width=\"20\"\n height=\"20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16 4h1c.6 0 1 .4 1 1v10c0 1.7-1.3 3-3 3H5c-1.7 0-3-1.3-3-3V5c0-.6.4-1 1-1h1V3c0-.6.4-1 1-1s1 .4 1 1v1h8V3c0-.6.4-1 1-1s1 .4 1 1v1zm-1 12c.6 0 1-.4 1-1V6H4v9c0 .6.4 1 1 1h10zM8 9a1 1 0 11-2 0 1 1 0 012 0zm2 1a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0zm-7 5a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\n// Вставляємо на місце де має відображатися іконка закриття бібілотеки так як немає API для підміни іконки та її контролю\n// за допомогою :has(.react-datepicker__close-icon) та :has(.react-datepicker__close-icon:hover) контролюємо появу та зміну кольору іконки\nconst CloseSvg = () => (\n <span className=\"vchasno-ui-date-picker__custom-close-icon\">{clearRawSvg}</span>\n);\n\nconst DATE_FORMATS = ['dd.MM.yyyy', 'dd-MM-yyyy', 'dd/MM/yyyy', 'dd.MM.yy', 'dd-MM-yy', 'dd/MM/yy'];\n\nconst defaultMask: MaskedInputProps['mask'] = [\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n /\\d/,\n /\\d/,\n];\n\nexport interface DatePickerProps\n extends ReactDatePickerProps,\n Partial<\n LoadingFeedback & WithHint & ErrorFeedback & DataQa & HideEmptyMeta & WithPulseAnimation\n > {\n label?: string;\n className?: string;\n showMask?: boolean;\n mask?: MaskedInputProps['mask'];\n onChange: ReactDatePickerProps['onChange'];\n isClearable?: ReactDatePickerProps['isClearable'];\n dateFormat?: ReactDatePickerProps['dateFormat'];\n wide?: boolean;\n}\n\n/**\n * @see <https://reactdatepicker.com/>\n */\nconst DatePicker: React.FC<DatePickerProps> = ({\n label,\n disabled,\n required,\n loading,\n hint,\n error,\n dateFormat = DATE_FORMATS,\n className,\n timeCaption = 'Час',\n enableTabLoop = false,\n locale = uk,\n showMask = false,\n showPopperArrow = false,\n mask = defaultMask,\n dataQa,\n hideEmptyMeta = false,\n wide = false,\n pulse,\n ...rest\n}) => {\n const valueExists = !!rest.selected || !!rest.value;\n\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-date-picker',\n {\n '--loading': loading,\n '--required': required,\n '--disabled': disabled,\n '--error': error,\n '--with-mask': showMask,\n '--wide': wide,\n '--not-empty': valueExists,\n },\n className,\n )}\n >\n <span\n className={cn('vchasno-ui-date-picker__wrapper', {\n 'vchasno-ui-pulse-animation': pulse,\n })}\n >\n {label && <LabelText>{label}</LabelText>}\n <ReactDatePicker\n enableTabLoop={enableTabLoop}\n locale={locale}\n timeCaption={timeCaption}\n disabled={disabled}\n placeholderText=\" \"\n showPopperArrow={showPopperArrow}\n className=\"vchasno-ui-date-picker__picker\"\n dateFormat={dateFormat}\n customInput={\n showMask ? <MaskedInput inputMode=\"text\" mask={mask} showMask /> : undefined\n }\n {...rest}\n />\n {loading ? <Spinner height=\"18px\" /> : <SvgCalendar />}\n <CloseSvg />\n </span>\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n};\n\nexport default DatePicker;\n"],"names":["SvgCalendar","React","svg","className","width","height","fill","xmlns","path","fillRule","clipRule","d","CloseSvg","span","clearRawSvg","DATE_FORMATS","defaultMask","DatePicker","_param","label","disabled","required","loading","hint","error","dateFormat","timeCaption","enableTabLoop","locale","showMask","showPopperArrow","mask","dataQa","hideEmptyMeta","_param_wide","wide","pulse","rest","valueExists","selected","value","data-qa","cn","createElement","LabelText","ReactDatePicker","uk","placeholderText","customInput","MaskedInput","inputMode","undefined","Spinner","_param_hideEmptyMeta","InputMeta"],"mappings":"iTAuBA,IAAMA,EAAc,+BAChBC,EAACC,aAAAA,CAAAA,MAAAA,CACGC,UAAU,+CACVC,MAAM,KACNC,OAAO,KACPC,KAAK,OACLC,MAAM,2CAENN,EAACO,aAAAA,CAAAA,OAAAA,CACGC,SAAS,UACTC,SAAS,UACTC,EAAE,sUACFL,KAAK,mBAOXM,EAAW,+BACbX,EAACY,aAAAA,CAAAA,OAAAA,CAAKV,UAAU,2CAA6CW,EAAAA,IAG3DC,EAAe,CAAC,aAAc,aAAc,aAAc,WAAY,WAAY,WAAW,CAE7FC,EAAwC,CAC1C,KACA,KACA,IACA,KACA,KACA,IACA,KACA,KACA,KACA,KACH,CAoBKC,EAAwC,SAAAC,CAAA,EAC1CC,IAAAA,EAAAA,EAAAA,MACAC,EAAAA,EAAAA,QAAAA,CACAC,IAAAA,QACAC,CAAAA,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,IAAAA,CACAC,IAAAA,KACAC,CAAAA,EAAAA,EAAAA,UAAAA,CACAtB,EAAAA,EAAAA,cACAuB,WAAAA,KACAC,aAAAA,KACAC,MAAAA,KACAC,QAAAA,CAAAA,EAAAA,AAAAA,KAAAA,IAAAA,SACAC,eAAAA,KACAC,IAAAA,CACAC,EAAAA,EAAAA,MAAAA,CAAAA,EAAAA,EACAC,cAAgBC,EAAAhB,EAChBiB,KACAC,IAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAlBHlB,QACAC,WACAC,WACAC,UACAC,OACAC,QACAC,aACAtB,YACAuB,cACAC,gBACAC,SACAC,WACAC,kBACAC,OACAC,SACAC,gBACAE,OACAC,UAGME,EAAc,CAAC,CAACD,EAAKE,QAAQ,EAAI,CAAC,CAACF,EAAKG,KAAK,CAEnD,oBACIvC,EAACkB,aAAAA,CAAAA,QAAAA,CACGsB,UAAST,EACT7B,UAAWuC,EACP,yBACA,CACI,YAAapB,EACb,aAAcD,EACd,aAAcD,EACd,UAAWI,EACX,cAAeK,EACf,SAjBTK,AAAA,KAAA,IAAAA,GAAAA,EAkBS,cAAeI,CAEnBnC,EAAAA,iBAGJF,EAACY,aAAAA,CAAAA,OAAAA,CACGV,UAAWuC,EAAG,kCAAmC,CAC7C,6BAA8BN,CAClC,IAECjB,GAAS,WAAA,EAAAlB,EAAA0C,aAAA,CAACC,EAAWzB,KAAAA,gBACtBlB,EAAC4C,aAAAA,CAAAA,EAAAA,iaAAAA,CACGlB,cArChBA,AAAAA,KAAAA,IAAAA,KAsCgBC,OArChBA,AAAAA,KAAAA,IAAAA,EAASkB,IAsCOpB,YAxChBA,AAAAA,KAAAA,IAAAA,EAAc,QAyCEN,SAAUA,EACV2B,gBAAgB,IAChBjB,gBAvChBA,AAAAA,KAAAA,IAAAA,KAwCgB3B,UAAU,iCACVsB,sBA/CHV,EACbZ,EA+CgB6C,YACInB,eAAW5B,EAACgD,aAAAA,CAAAA,EAAAA,CAAYC,UAAU,OAAOnB,KA1C7DA,AAAAA,KAAAA,IAAAA,EAAOf,IA0CkEa,SAAAA,CAAAA,CAAcsB,GAAAA,KAAAA,CAEnEd,EAAAA,IAEPf,EAAU,WAAA,EAAArB,EAACmD,aAAAA,CAAAA,EAAAA,CAAQ/C,OAAO,SAAY,WAAA,EAAAJ,EAACD,aAAAA,CAAAA,EAAAA,mBACxCC,gBAACW,EAEJqB,OAAAA,CA/COoB,CAAAA,AAAA,KAAA,IAAAA,GAAAA,CAAA,GA+CW7B,GAAUD,eAActB,EAACqD,aAAAA,CAAAA,EAAAA,CAAU/B,KAAMA,EAAMC,MAAOA,IAArC,KAGhD"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+
3
+ interface FullScreenModalProps {
4
+ className?: string;
5
+ headerClassName?: string;
6
+ contentClassName?: string;
7
+ headerChildren?: React.ReactNode;
8
+ showAnimation?: boolean;
9
+ }
10
+ declare const FullScreenModal: React.FC<FullScreenModalProps>;
11
+
12
+ export { type FullScreenModalProps, FullScreenModal as default };
@@ -0,0 +1,2 @@
1
+ import e from"react";import a from"classnames";import l from"../BodyPortal/BodyPortal.js";import r from"../ScrollableBox/ScrollableBox.js";import{useLockBodyScroll as o}from"./useLockBodyScroll.js";var c=function(c){var s=c.children,n=c.headerChildren,t=c.className,m=c.headerClassName,i=c.contentClassName,d=c.showAnimation;return o(),/*#__PURE__*/e.createElement(l,null,/*#__PURE__*/e.createElement("div",{className:a("vchasno-ui-full-screen-modal",t,{"vchasno-ui-full-screen-modal--animation":d})},/*#__PURE__*/e.createElement("header",{className:a("vchasno-ui-full-screen-modal__header",m)},n),/*#__PURE__*/e.createElement(r,{scrollHeight:"calc(100vh - var(--header-height))",className:a("vchasno-ui-full-screen-modal__content",i)},s)))};export{c as default};
2
+ //# sourceMappingURL=FullScreenModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FullScreenModal.js","sources":["../../../src/components/FullScreenModal/FullScreenModal.tsx"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport BodyPortal from '../BodyPortal';\nimport ScrollableBox from '../ScrollableBox';\nimport { useLockBodyScroll } from './useLockBodyScroll';\n\nimport './FullScreenModal.global.css';\n\nexport interface FullScreenModalProps {\n className?: string;\n headerClassName?: string;\n contentClassName?: string;\n headerChildren?: React.ReactNode;\n showAnimation?: boolean;\n}\nconst FullScreenModal: React.FC<FullScreenModalProps> = ({\n children,\n headerChildren,\n className,\n headerClassName,\n contentClassName,\n showAnimation,\n}) => {\n useLockBodyScroll();\n\n return (\n <BodyPortal>\n <div\n className={cn('vchasno-ui-full-screen-modal', className, {\n 'vchasno-ui-full-screen-modal--animation': showAnimation,\n })}\n >\n <header className={cn('vchasno-ui-full-screen-modal__header', headerClassName)}>\n {headerChildren}\n </header>\n <ScrollableBox\n scrollHeight=\"calc(100vh - var(--header-height))\"\n className={cn('vchasno-ui-full-screen-modal__content', contentClassName)}\n >\n {children}\n </ScrollableBox>\n </div>\n </BodyPortal>\n );\n};\n\nexport default FullScreenModal;\n"],"names":["FullScreenModal","param","children","headerChildren","className","headerClassName","contentClassName","showAnimation","useLockBodyScroll","React","createElement","BodyPortal","div","cn","header","ScrollableBox","scrollHeight"],"mappings":"sMAiBA,IAAMA,EAAkD,SAAAC,CAAA,MACpDC,EAAAA,EAAAA,QAAAA,CACAC,IAAAA,cACAC,CAAAA,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,eAAAA,CACAC,EAAAA,EAAAA,gBAAAA,CACAC,EAAAA,EAAAA,aAAAA,CAIA,OAFAC,IAGI,WAAA,EAAAC,EAAAC,aAAA,CAACC,oBACGF,EAACG,aAAAA,CAAAA,MAAAA,CACGR,UAAWS,EAAG,+BAAgCT,EAAW,CACrD,0CAA2CG,CAC/C,iBAEAE,EAACK,aAAAA,CAAAA,SAAAA,CAAOV,UAAWS,EAAG,uCAAwCR,EACzDF,EAAAA,GAAAA,WAAAA,EAELM,EAACM,aAAAA,CAAAA,EAAAA,CACGC,aAAa,qCACbZ,UAAWS,EAAG,wCAAyCP,EAEtDJ,EAAAA,IAKrB"}
@@ -0,0 +1,2 @@
1
+ import{useEffect as o}from"react";var n=function(){o(function(){return document.body.classList.add("vchasno-ui-overflow-hidden"),function(){document.body.classList.remove("vchasno-ui-overflow-hidden")}},[])};export{n as useLockBodyScroll};
2
+ //# sourceMappingURL=useLockBodyScroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLockBodyScroll.js","sources":["../../../src/components/FullScreenModal/useLockBodyScroll.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nexport const useLockBodyScroll = () => {\n useEffect(() => {\n document.body.classList.add('vchasno-ui-overflow-hidden');\n\n return () => {\n document.body.classList.remove('vchasno-ui-overflow-hidden');\n };\n }, []);\n};\n"],"names":["useLockBodyScroll","useEffect","document","body","classList","add","remove"],"mappings":"sCAEaA,EAAoB,WAC7BC,EAAU,WAGN,OAFAC,SAASC,IAAI,CAACC,SAAS,CAACC,GAAG,CAAC,8BAErB,WACHH,SAASC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAC,6BACnC,CACJ,EAAG,EAAE,CACT"}
@@ -1,7 +1,7 @@
1
1
  import React, { InputHTMLAttributes } from 'react';
2
- import { WithLabel, WithHint, LoadingFeedback, ErrorFeedback, DataQa, HideEmptyMeta, ClearControl } from '../types.js';
2
+ import { WithLabel, WithHint, LoadingFeedback, ErrorFeedback, DataQa, HideEmptyMeta, ClearControl, WithPulseAnimation } from '../types.js';
3
3
 
4
- interface InputProps extends Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback & DataQa & HideEmptyMeta & ClearControl> {
4
+ interface InputProps extends Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback & DataQa & HideEmptyMeta & ClearControl & WithPulseAnimation> {
5
5
  className?: string;
6
6
  disabled?: boolean;
7
7
  required?: boolean;
@@ -1,2 +1,2 @@
1
- import e from"react";import t from"classnames";import r from"../../icons/clear.js";import a from"../InputMeta/InputMeta.js";import n from"../LabelText/LabelText.js";import l from"../Spinner/Spinner.js";var i=function(i){var o=i.className,c=i.disabled,s=i.startElement,m=i.endElement,p=i.error,u=i.label,b=i.hint,d=i.wide,f=i.required,h=i.loading,v=i.labelProps,E=i.hideEmptyMeta,y=i.dataQa,_=i.isClearable,j=i.onClear,w=i.children;return /*#__PURE__*/e.createElement("label",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},a=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),a.forEach(function(t){var a;a=r[t],t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a})}return e}({"data-qa":y,className:t("vchasno-ui-input",{"--required":f,"--disabled":c,"--wide":d,"--error":p},o)},v),/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-input__wrapper"},s&&/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-input__wrapper__start-element"},s),w,u&&/*#__PURE__*/e.createElement(n,null,u),/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-input__feedback"},h&&/*#__PURE__*/e.createElement(l,{height:"100%"}),!h&&_&&/*#__PURE__*/e.createElement("span",{role:"button",onClick:j,className:"vchasno-ui-input__clear-btn"},r)),m),!(void 0!==E&&E)||p||b?/*#__PURE__*/e.createElement(a,{error:p,hint:b}):null)};i.displayName="Input";export{i as default};
1
+ import e from"react";import t from"classnames";import a from"../../icons/clear.js";import r from"../InputMeta/InputMeta.js";import n from"../LabelText/LabelText.js";import l from"../Spinner/Spinner.js";var i=function(i){var o=i.className,s=i.disabled,c=i.startElement,m=i.endElement,p=i.error,u=i.label,b=i.hint,d=i.wide,f=i.required,h=i.loading,v=i.labelProps,E=i.hideEmptyMeta,y=i.dataQa,_=i.isClearable,j=i.onClear,w=i.pulse,O=i.children;return /*#__PURE__*/e.createElement("label",function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{},r=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),r.forEach(function(t){var r;r=a[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-qa":y,className:t("vchasno-ui-input",{"--required":f,"--disabled":s,"--wide":d,"--error":p},o)},v),/*#__PURE__*/e.createElement("span",{className:t("vchasno-ui-input__wrapper",{"vchasno-ui-pulse-animation":w})},c&&/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-input__wrapper__start-element"},c),O,u&&/*#__PURE__*/e.createElement(n,null,u),/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-input__feedback"},h&&/*#__PURE__*/e.createElement(l,{height:"100%"}),!h&&_&&/*#__PURE__*/e.createElement("span",{role:"button",onClick:j,className:"vchasno-ui-input__clear-btn"},a)),m),!(void 0!==E&&E)||p||b?/*#__PURE__*/e.createElement(r,{error:p,hint:b}):null)};i.displayName="Input";export{i as default};
2
2
  //# sourceMappingURL=Input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport clearRawSvg from '../../icons/clear';\nimport InputMeta from '../InputMeta';\nimport LabelText from '../LabelText';\nimport Spinner from '../Spinner';\nimport {\n ClearControl,\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n LoadingFeedback,\n WithHint,\n WithLabel,\n} from '../types';\n\nimport './Input.global.css';\n\nexport interface InputProps\n extends Partial<\n WithLabel &\n WithHint &\n LoadingFeedback &\n ErrorFeedback &\n DataQa &\n HideEmptyMeta &\n ClearControl\n > {\n className?: string;\n disabled?: boolean;\n required?: boolean;\n wide?: boolean;\n startElement?: string | React.ReactElement;\n endElement?: string | React.ReactElement;\n labelProps?: InputHTMLAttributes<HTMLLabelElement>;\n children: React.ReactHTMLElement<HTMLInputElement> | React.ReactElement | JSX.Element[];\n onClear?: VoidFunction;\n}\n\nconst Input: React.FC<InputProps> = ({\n className,\n disabled,\n startElement,\n endElement,\n error,\n label,\n hint,\n wide,\n required,\n loading,\n labelProps,\n hideEmptyMeta = false,\n dataQa,\n isClearable,\n onClear,\n children,\n}) => {\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-input',\n {\n '--required': required,\n '--disabled': disabled,\n '--wide': wide,\n '--error': error,\n },\n className,\n )}\n {...labelProps}\n >\n <span className=\"vchasno-ui-input__wrapper\">\n {startElement && (\n <span className=\"vchasno-ui-input__wrapper__start-element\">{startElement}</span>\n )}\n {children}\n {label && <LabelText>{label}</LabelText>}\n <span className=\"vchasno-ui-input__feedback\">\n {loading && <Spinner height=\"100%\" />}\n {!loading && isClearable && (\n <span\n role=\"button\"\n onClick={onClear}\n className=\"vchasno-ui-input__clear-btn\"\n >\n {clearRawSvg}\n </span>\n )}\n </span>\n {endElement}\n </span>\n {hideEmptyMeta && !error && !hint ? null : <InputMeta error={error} hint={hint} />}\n </label>\n );\n};\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"names":["Input","param","className","disabled","startElement","endElement","error","label","hint","wide","required","loading","labelProps","hideEmptyMeta","dataQa","isClearable","onClear","children","React","data-qa","cn","span","LabelText","Spinner","height","role","onClick","clearRawSvg","InputMeta","displayName"],"mappings":"0MAyCA,IAAMA,EAA8B,SAAAC,CAAA,EAChCC,IAAAA,EAAAA,EAAAA,SACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,YACAC,CAAAA,EAAAA,EAAAA,UACAC,CAAAA,EAAAA,EAAAA,KACAC,CAAAA,EAAAA,EAAAA,KACAC,CAAAA,EAAAA,EAAAA,KACAC,EAAAA,EAAAA,IAAAA,CACAC,EAAAA,EAAAA,QAAAA,CACAC,EAAAA,EAAAA,OAAAA,CACAC,EAAAA,EAAAA,UAAAA,CAAAA,EAAAA,EACAC,aAAAA,CACAC,EAAAA,EAAAA,MACAC,CAAAA,EAAAA,EAAAA,WACAC,CAAAA,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,QAAAA,CAEA,OAAA,WAAA,EACIC,EAACX,aAAAA,CAAAA,QAAAA,iaAAAA,CACGY,UAASL,EACTZ,UAAWkB,EACP,mBACA,CACI,aAAcV,EACd,aAAcP,EACd,SAAUM,EACV,UAAWH,CAEfJ,EAAAA,EAEAU,EAAAA,GAAAA,WAAAA,EAEJM,EAACG,aAAAA,CAAAA,OAAAA,CAAKnB,UAAU,2BACXE,EAAAA,GACG,WAAA,EAAAc,EAACG,aAAAA,CAAAA,OAAAA,CAAKnB,UAAU,0CAA4CE,EAAAA,GAE/Da,EACAV,GAAAA,WAAAA,EAASW,EAACI,aAAAA,CAAAA,EAAAA,KAAWf,gBACtBW,EAACG,aAAAA,CAAAA,OAAAA,CAAKnB,UAAU,4BACXS,EAAAA,GAAW,WAAA,EAAAO,EAACK,aAAAA,CAAAA,EAAAA,CAAQC,OAAO,SAC3B,CAACb,GAAWI,GACT,WAAA,EAAAG,EAACG,aAAAA,CAAAA,OAAAA,CACGI,KAAK,SACLC,QAASV,EACTd,UAAU,6BAETyB,EAAAA,IAIZtB,GAEJQ,CAzCTA,CAAAA,AAAAA,KAAAA,IAAAA,GACAC,CAAAA,GAwC2BR,GAAUE,eAAcU,EAACU,aAAAA,CAAAA,EAAAA,CAAUtB,MAAOA,EAAOE,KAAMA,IAAtC,KAGhD,CAEAR,CAAAA,EAAM6B,WAAW,CAAG"}
1
+ {"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport clearRawSvg from '../../icons/clear';\nimport InputMeta from '../InputMeta';\nimport LabelText from '../LabelText';\nimport Spinner from '../Spinner';\nimport {\n ClearControl,\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n LoadingFeedback,\n WithHint,\n WithLabel,\n WithPulseAnimation,\n} from '../types';\n\nimport './Input.global.css';\n\nexport interface InputProps\n extends Partial<\n WithLabel &\n WithHint &\n LoadingFeedback &\n ErrorFeedback &\n DataQa &\n HideEmptyMeta &\n ClearControl &\n WithPulseAnimation\n > {\n className?: string;\n disabled?: boolean;\n required?: boolean;\n wide?: boolean;\n startElement?: string | React.ReactElement;\n endElement?: string | React.ReactElement;\n labelProps?: InputHTMLAttributes<HTMLLabelElement>;\n children: React.ReactHTMLElement<HTMLInputElement> | React.ReactElement | JSX.Element[];\n onClear?: VoidFunction;\n}\n\nconst Input: React.FC<InputProps> = ({\n className,\n disabled,\n startElement,\n endElement,\n error,\n label,\n hint,\n wide,\n required,\n loading,\n labelProps,\n hideEmptyMeta = false,\n dataQa,\n isClearable,\n onClear,\n pulse,\n children,\n}) => {\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-input',\n {\n '--required': required,\n '--disabled': disabled,\n '--wide': wide,\n '--error': error,\n },\n className,\n )}\n {...labelProps}\n >\n <span\n className={cn('vchasno-ui-input__wrapper', {\n 'vchasno-ui-pulse-animation': pulse,\n })}\n >\n {startElement && (\n <span className=\"vchasno-ui-input__wrapper__start-element\">{startElement}</span>\n )}\n {children}\n {label && <LabelText>{label}</LabelText>}\n <span className=\"vchasno-ui-input__feedback\">\n {loading && <Spinner height=\"100%\" />}\n {!loading && isClearable && (\n <span\n role=\"button\"\n onClick={onClear}\n className=\"vchasno-ui-input__clear-btn\"\n >\n {clearRawSvg}\n </span>\n )}\n </span>\n {endElement}\n </span>\n {hideEmptyMeta && !error && !hint ? null : <InputMeta error={error} hint={hint} />}\n </label>\n );\n};\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"names":["Input","param","className","disabled","startElement","endElement","error","label","hint","wide","required","loading","labelProps","hideEmptyMeta","dataQa","isClearable","onClear","pulse","children","React","data-qa","cn","span","LabelText","Spinner","height","role","onClick","clearRawSvg","InputMeta","displayName"],"mappings":"0MA2CA,IAAMA,EAA8B,SAAAC,CAAA,EAChCC,IAAAA,EAAAA,EAAAA,SACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,aACAC,EAAAA,EAAAA,UAAAA,CACAC,EAAAA,EAAAA,KAAAA,CACAC,EAAAA,EAAAA,KAAAA,CACAC,EAAAA,EAAAA,IAAAA,CACAC,IAAAA,IACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,OACAC,CAAAA,EAAAA,EAAAA,UACAC,CAAAA,EAAAA,EAAAA,aAAAA,CACAC,EAAAA,EAAAA,MACAC,CAAAA,EAAAA,EAAAA,WACAC,CAAAA,EAAAA,EAAAA,OACAC,CAAAA,EAAAA,EAAAA,MACAC,EAAAA,EAAAA,QAAAA,CAEA,OAAA,WAAA,EACIC,EAACZ,aAAAA,CAAAA,QAAAA,iaAAAA,CACGa,UAASN,EACTZ,UAAWmB,EACP,mBACA,CACI,aAAcX,EACd,aAAcP,EACd,SAAUM,EACV,UAAWH,CAEfJ,EAAAA,EAEAU,EAAAA,GAAAA,WAAAA,EAEJO,EAACG,aAAAA,CAAAA,OAAAA,CACGpB,UAAWmB,EAAG,4BAA6B,CACvC,6BAA8BJ,CAClC,EAECb,EAAAA,GACG,WAAA,EAAAe,EAACG,aAAAA,CAAAA,OAAAA,CAAKpB,UAAU,0CAA4CE,EAAAA,GAE/Dc,EACAX,GAAAA,WAAAA,EAASY,EAACI,aAAAA,CAAAA,EAAAA,KAAWhB,gBACtBY,EAACG,aAAAA,CAAAA,OAAAA,CAAKpB,UAAU,4BACXS,EAAAA,GAAW,WAAA,EAAAQ,EAACK,aAAAA,CAAAA,EAAAA,CAAQC,OAAO,SAC3B,CAACd,GAAWI,GACT,WAAA,EAAAI,EAACG,aAAAA,CAAAA,OAAAA,CACGI,KAAK,SACLC,QAASX,EACTd,UAAU,6BAET0B,EAAAA,IAIZvB,GAEJQ,cA7CTC,CAAAA,GA6C2BR,GAAUE,eAAcW,EAACU,aAAAA,CAAAA,EAAAA,CAAUvB,MAAOA,EAAOE,KAAMA,IAAtC,KAGhD,CAEAR,CAAAA,EAAM8B,WAAW,CAAG"}
@@ -1,2 +1,2 @@
1
- import e from"react";import t from"react-text-mask";import r from"classnames";import n from"../Input/Input.js";var a=function(a){var o,l,i=a.className,s=a.disabled,c=a.startElement,p=a.endElement,b=a.error,u=a.label,m=a.hint,d=a.wide,f=a.required,O=a.loading,y=a.inputClassName,j=a.labelProps,g=a.hideEmptyMeta,P=a.dataQa,w=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(a,["className","disabled","startElement","endElement","error","label","hint","wide","required","loading","inputClassName","labelProps","hideEmptyMeta","dataQa"]);return /*#__PURE__*/e.createElement(n,{dataQa:P,required:f,wide:d,hideEmptyMeta:void 0!==g&&g,className:i,loading:O,disabled:s,label:u,error:b,hint:m,endElement:p,labelProps:j,startElement:c},/*#__PURE__*/e.createElement(t,(o=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},w),l=l={required:f,disabled:s,className:r("vchasno-ui-mask-input",y)},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(l)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(l)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(l,e))}),o)))};export{a as default};
1
+ import e from"react";import t from"react-text-mask";import r from"classnames";import n from"../Input/Input.js";var a=function(a){var l,o,i=a.className,s=a.disabled,c=a.startElement,p=a.endElement,u=a.error,b=a.label,m=a.hint,d=a.wide,f=a.required,O=a.loading,y=a.inputClassName,j=a.labelProps,g=a.hideEmptyMeta,P=a.dataQa,w=a.pulse,E=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(a,["className","disabled","startElement","endElement","error","label","hint","wide","required","loading","inputClassName","labelProps","hideEmptyMeta","dataQa","pulse"]);return /*#__PURE__*/e.createElement(n,{pulse:w,dataQa:P,required:f,wide:d,hideEmptyMeta:void 0!==g&&g,className:i,loading:O,disabled:s,label:b,error:u,hint:m,endElement:p,labelProps:j,startElement:c},/*#__PURE__*/e.createElement(t,(l=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},E),o=o={required:f,disabled:s,className:r("vchasno-ui-mask-input",y)},Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(l,e,Object.getOwnPropertyDescriptor(o,e))}),l)))};export{a as default};
2
2
  //# sourceMappingURL=MaskInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MaskInput.js","sources":["../../../src/components/MaskInput/MaskInput.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\nimport MaskedInput, { MaskedInputProps } from 'react-text-mask';\n\nimport cn from 'classnames';\n\nimport Input, { InputProps } from '../Input';\nimport { DataQa } from '../types';\n\nimport './MaskInput.global.css';\n\nexport interface MaskInputProps extends MaskedInputProps, Omit<InputProps, 'children'>, DataQa {\n inputClassName?: string;\n labelProps?: InputHTMLAttributes<HTMLLabelElement>;\n}\n\nconst MaskInput: React.FC<MaskInputProps> = ({\n className,\n disabled,\n startElement,\n endElement,\n error,\n label,\n hint,\n wide,\n required,\n loading,\n inputClassName,\n labelProps,\n hideEmptyMeta = false,\n dataQa,\n ...rest\n}) => {\n return (\n <Input\n dataQa={dataQa}\n required={required}\n wide={wide}\n hideEmptyMeta={hideEmptyMeta}\n className={className}\n loading={loading}\n disabled={disabled}\n label={label}\n error={error}\n hint={hint}\n endElement={endElement}\n labelProps={labelProps}\n startElement={startElement}\n >\n <MaskedInput\n {...rest}\n required={required}\n disabled={disabled}\n className={cn('vchasno-ui-mask-input', inputClassName)}\n />\n </Input>\n );\n};\n\nexport default MaskInput;\n"],"names":["MaskInput","_param","className","disabled","startElement","endElement","error","label","hint","wide","required","loading","inputClassName","labelProps","hideEmptyMeta","dataQa","rest","React","Input","createElement","MaskedInput","cn"],"mappings":"+GAeA,IAAMA,EAAsC,SAAAC,CAAA,UACxCC,EAAAA,EAAAA,SAAAA,CACAC,EAAAA,EAAAA,QAAAA,CACAC,EAAAA,EAAAA,YAAAA,CACAC,EAAAA,EAAAA,UAAAA,CACAC,EAAAA,EAAAA,KAAAA,CACAC,EAAAA,EAAAA,KAAAA,CACAC,EAAAA,EAAAA,IAAAA,CACAC,EAAAA,EAAAA,IAAAA,CACAC,EAAAA,EAAAA,QAAAA,CACAC,EAAAA,EAAAA,OAAAA,CACAC,EAAAA,EAAAA,cAAAA,CACAC,EAAAA,EAAAA,UAAAA,CAAAA,EAAAA,EACAC,aAAAA,CACAC,EAAAA,EAAAA,MACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAdHd,YACAC,WACAC,eACAC,aACAC,QACAC,QACAC,OACAC,OACAC,WACAC,UACAC,iBACAC,aACAC,gBACAC,WAGA,oBACIE,EAACC,aAAAA,CAAAA,EAAAA,CACGH,OAAQA,EACRL,SAAUA,EACVD,KAAMA,EACNK,cATRA,AAAAA,KAAAA,IAAAA,GACAC,EASQb,UAAWA,EACXS,QAASA,EACTR,SAAUA,EACVI,MAAOA,EACPD,MAAOA,EACPE,KAAMA,EACNH,WAAYA,EACZQ,WAAYA,EACZT,aAAcA,CAEd,EAAA,WAAA,EAAAa,EAAAE,aAAA,CAACC,KACOJ,iaAAAA,CAAAA,EAAAA,OAAAA,CACJN,SAAUA,EACVP,SAAUA,EACVD,UAAWmB,EAAG,wBAAyBT,iVAIvD"}
1
+ {"version":3,"file":"MaskInput.js","sources":["../../../src/components/MaskInput/MaskInput.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\nimport MaskedInput, { MaskedInputProps } from 'react-text-mask';\n\nimport cn from 'classnames';\n\nimport Input, { InputProps } from '../Input';\nimport { DataQa } from '../types';\n\nimport './MaskInput.global.css';\n\nexport interface MaskInputProps extends MaskedInputProps, Omit<InputProps, 'children'>, DataQa {\n inputClassName?: string;\n labelProps?: InputHTMLAttributes<HTMLLabelElement>;\n}\n\nconst MaskInput: React.FC<MaskInputProps> = ({\n className,\n disabled,\n startElement,\n endElement,\n error,\n label,\n hint,\n wide,\n required,\n loading,\n inputClassName,\n labelProps,\n hideEmptyMeta = false,\n dataQa,\n pulse,\n ...rest\n}) => {\n return (\n <Input\n pulse={pulse}\n dataQa={dataQa}\n required={required}\n wide={wide}\n hideEmptyMeta={hideEmptyMeta}\n className={className}\n loading={loading}\n disabled={disabled}\n label={label}\n error={error}\n hint={hint}\n endElement={endElement}\n labelProps={labelProps}\n startElement={startElement}\n >\n <MaskedInput\n {...rest}\n required={required}\n disabled={disabled}\n className={cn('vchasno-ui-mask-input', inputClassName)}\n />\n </Input>\n );\n};\n\nexport default MaskInput;\n"],"names":["MaskInput","_param","className","disabled","startElement","endElement","error","label","hint","wide","required","loading","inputClassName","labelProps","hideEmptyMeta","dataQa","pulse","rest","React","Input","_param_hideEmptyMeta","createElement","MaskedInput","cn"],"mappings":"+GAeA,IAAMA,EAAsC,SAAAC,CAAA,EACxCC,QAAAA,EAAAA,EAAAA,SACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,YACAC,CAAAA,EAAAA,EAAAA,UACAC,CAAAA,EAAAA,EAAAA,KACAC,CAAAA,EAAAA,EAAAA,KACAC,CAAAA,EAAAA,EAAAA,IACAC,CAAAA,EAAAA,EAAAA,IACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,OACAC,CAAAA,EAAAA,EAAAA,cACAC,CAAAA,EAAAA,EAAAA,UACAC,CAAAA,EAAAA,EAAAA,aAAAA,CACAC,EAAAA,EAAAA,MAAAA,CACAC,IAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAfHf,YACAC,WACAC,eACAC,aACAC,QACAC,QACAC,OACAC,OACAC,WACAC,UACAC,iBACAC,aACAC,gBACAC,SACAC,UAGA,oBACIE,EAACC,aAAAA,CAAAA,EAAAA,CACGH,MAAOA,EACPD,OAAQA,EACRL,SAAUA,EACVD,KAAMA,EACNK,cAXQM,AAAA,KAAA,IAAAA,GAAAA,EAYRlB,UAAWA,EACXS,QAASA,EACTR,SAAUA,EACVI,MAAOA,EACPD,MAAOA,EACPE,KAAMA,EACNH,WAAYA,EACZQ,WAAYA,EACZT,aAAcA,CAEd,EAAA,WAAA,EAAAc,EAAAG,aAAA,CAACC,KACOL,iaAAAA,CAAAA,EAAAA,OAAAA,CACJP,SAAUA,EACVP,SAAUA,EACVD,UAAWqB,EAAG,wBAAyBX,iVAIvD"}
@@ -1,2 +1,2 @@
1
- import e from"react";import t from"classnames";import r from"../BlackTooltip/BlackTooltip.js";import n from"../Input/Input.js";function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var o=/*#__PURE__*/e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("g",{id:"icons/eye"},/*#__PURE__*/e.createElement("path",{d:"M10 13C11.6569 13 13 11.6569 13 10C13 8.34315 11.6569 7 10 7C8.34315 7 7 8.34315 7 10C7 11.6569 8.34315 13 10 13Z",fill:"currentColor"}),/*#__PURE__*/e.createElement("path",{d:"M18.9 9.5C18.7 9.3 15.5 4 10 4C4.50002 4 1.30002 9.3 1.10002 9.5C1.00002 9.8 1.00002 10.2 1.10002 10.5C1.30002 10.7 4.50002 16 10 16C15.5 16 18.7 10.7 18.9 10.5C19 10.2 19 9.8 18.9 9.5ZM10 14C6.60002 14 4.10002 11.2 3.20002 10C4.10002 8.8 6.50002 6 10 6C13.4 6 15.9 8.8 16.8 10C15.9 11.2 13.5 14 10 14Z",fill:"currentColor"}))),l=/*#__PURE__*/e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M18.9004 9.49968C18.8004 9.39968 17.6004 7.49968 15.5004 5.89968L16.7004 4.69968C17.1004 4.29968 17.1004 3.69968 16.7004 3.29968C16.3004 2.89968 15.7004 2.89968 15.3004 3.29968L13.7004 4.89968C12.6004 4.29968 11.4004 3.99968 10.0004 3.99968C4.50039 3.99968 1.30039 9.29968 1.10039 9.49968C1.00039 9.79968 1.00039 10.1997 1.10039 10.4997C1.20039 10.5997 2.40039 12.4997 4.50039 14.0997L3.30039 15.2997C2.90039 15.6997 2.90039 16.2997 3.30039 16.6997C3.50039 16.8997 3.70039 16.9997 4.00039 16.9997C4.30039 16.9997 4.50039 16.8997 4.70039 16.6997L6.30039 15.0997C7.40039 15.6997 8.60039 15.9997 10.0004 15.9997C15.5004 15.9997 18.7004 10.6997 18.9004 10.4997C19.0004 10.1997 19.0004 9.79968 18.9004 9.49968ZM3.20039 9.99968C4.10039 8.79968 6.50039 5.99968 10.0004 5.99968C10.8004 5.99968 11.5004 6.19968 12.2004 6.39968L11.3004 7.29968C10.9004 7.09968 10.5004 6.99968 10.0004 6.99968C8.30039 6.99968 7.00039 8.29968 7.00039 9.99968C7.00039 10.4997 7.10039 10.8997 7.30039 11.2997L5.90039 12.5997C4.60039 11.7997 3.70039 10.5997 3.20039 9.99968ZM10.0004 13.9997C9.20039 13.9997 8.50039 13.7997 7.80039 13.5997L8.70039 12.6997C9.10039 12.8997 9.50039 12.9997 10.0004 12.9997C11.7004 12.9997 13.0004 11.6997 13.0004 9.99968C13.0004 9.49968 12.9004 9.09968 12.7004 8.69968L14.1004 7.29968C15.4004 8.19968 16.3004 9.29968 16.8004 9.89968C15.9004 11.1997 13.5004 13.9997 10.0004 13.9997Z",fill:"currentColor"})),i=/*#__PURE__*/e.forwardRef(function(i,s){var u,c=i.className,d=i.disabled,p=i.startElement,f=i.error,m=i.label,C=i.hint,h=i.wide,w=i.required,y=i.loading,b=i.inputClassName,v=i.labelProps,g=i.hideEmptyMeta,P=i.dataQa,E=i.showPassword,O=i.showPasswordTooltip,j=i.hidePasswordTooltip,I=i.placeholder,x=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(i,["className","disabled","startElement","error","label","hint","wide","required","loading","inputClassName","labelProps","hideEmptyMeta","dataQa","showPassword","showPasswordTooltip","hidePasswordTooltip","placeholder"]),M=function(e){if(Array.isArray(e))return e}(u=e.useState(E))||function(e,t){var r,n,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],l=!0,i=!1;try{for(a=a.call(e);!(l=(r=a.next()).done)&&(o.push(r.value),2!==o.length);l=!0);}catch(e){i=!0,n=e}finally{try{l||null==a.return||a.return()}finally{if(i)throw n}}return o}}(u,2)||function(e,t){if(e){if("string"==typeof e)return a(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,2)}}(u,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),S=M[0],L=M[1];return /*#__PURE__*/e.createElement(n,{dataQa:P,required:w,wide:h,className:c,loading:y,disabled:d,label:m,error:f,hint:C,endElement:/*#__PURE__*/e.createElement(r,{key:"tooltip",disableInteractive:!0,title:S?j:O},/*#__PURE__*/e.createElement("span",{role:"button",tabIndex:0,className:t("vchasno-ui-PasswordInput__eye",{"vchasno-ui-PasswordInput__eye--active":S}),onClick:function(){d||L(function(e){return!e})}},S?o:l)),startElement:p,labelProps:v,hideEmptyMeta:g},/*#__PURE__*/e.createElement("input",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({type:S?"text":"password",disabled:d,className:t("vchasno-ui-PasswordInput",{"vchasno-ui-PasswordInput--type-password":!S},b),required:w,ref:s,placeholder:void 0===I?" ":I},x)))});i.displayName="PasswordInput";export{i as default};
1
+ import e from"react";import t from"classnames";import r from"../BlackTooltip/BlackTooltip.js";import n from"../Input/Input.js";function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var o=/*#__PURE__*/e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("g",{id:"icons/eye"},/*#__PURE__*/e.createElement("path",{d:"M10 13C11.6569 13 13 11.6569 13 10C13 8.34315 11.6569 7 10 7C8.34315 7 7 8.34315 7 10C7 11.6569 8.34315 13 10 13Z",fill:"currentColor"}),/*#__PURE__*/e.createElement("path",{d:"M18.9 9.5C18.7 9.3 15.5 4 10 4C4.50002 4 1.30002 9.3 1.10002 9.5C1.00002 9.8 1.00002 10.2 1.10002 10.5C1.30002 10.7 4.50002 16 10 16C15.5 16 18.7 10.7 18.9 10.5C19 10.2 19 9.8 18.9 9.5ZM10 14C6.60002 14 4.10002 11.2 3.20002 10C4.10002 8.8 6.50002 6 10 6C13.4 6 15.9 8.8 16.8 10C15.9 11.2 13.5 14 10 14Z",fill:"currentColor"}))),l=/*#__PURE__*/e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M18.9004 9.49968C18.8004 9.39968 17.6004 7.49968 15.5004 5.89968L16.7004 4.69968C17.1004 4.29968 17.1004 3.69968 16.7004 3.29968C16.3004 2.89968 15.7004 2.89968 15.3004 3.29968L13.7004 4.89968C12.6004 4.29968 11.4004 3.99968 10.0004 3.99968C4.50039 3.99968 1.30039 9.29968 1.10039 9.49968C1.00039 9.79968 1.00039 10.1997 1.10039 10.4997C1.20039 10.5997 2.40039 12.4997 4.50039 14.0997L3.30039 15.2997C2.90039 15.6997 2.90039 16.2997 3.30039 16.6997C3.50039 16.8997 3.70039 16.9997 4.00039 16.9997C4.30039 16.9997 4.50039 16.8997 4.70039 16.6997L6.30039 15.0997C7.40039 15.6997 8.60039 15.9997 10.0004 15.9997C15.5004 15.9997 18.7004 10.6997 18.9004 10.4997C19.0004 10.1997 19.0004 9.79968 18.9004 9.49968ZM3.20039 9.99968C4.10039 8.79968 6.50039 5.99968 10.0004 5.99968C10.8004 5.99968 11.5004 6.19968 12.2004 6.39968L11.3004 7.29968C10.9004 7.09968 10.5004 6.99968 10.0004 6.99968C8.30039 6.99968 7.00039 8.29968 7.00039 9.99968C7.00039 10.4997 7.10039 10.8997 7.30039 11.2997L5.90039 12.5997C4.60039 11.7997 3.70039 10.5997 3.20039 9.99968ZM10.0004 13.9997C9.20039 13.9997 8.50039 13.7997 7.80039 13.5997L8.70039 12.6997C9.10039 12.8997 9.50039 12.9997 10.0004 12.9997C11.7004 12.9997 13.0004 11.6997 13.0004 9.99968C13.0004 9.49968 12.9004 9.09968 12.7004 8.69968L14.1004 7.29968C15.4004 8.19968 16.3004 9.29968 16.8004 9.89968C15.9004 11.1997 13.5004 13.9997 10.0004 13.9997Z",fill:"currentColor"})),i=/*#__PURE__*/e.forwardRef(function(i,s){var u,c=i.className,d=i.disabled,p=i.startElement,f=i.error,m=i.label,C=i.hint,h=i.wide,w=i.required,y=i.loading,b=i.inputClassName,v=i.labelProps,g=i.hideEmptyMeta,P=i.dataQa,E=i.showPassword,O=i.showPasswordTooltip,j=i.hidePasswordTooltip,I=i.pulse,x=i.placeholder,M=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(i,["className","disabled","startElement","error","label","hint","wide","required","loading","inputClassName","labelProps","hideEmptyMeta","dataQa","showPassword","showPasswordTooltip","hidePasswordTooltip","pulse","placeholder"]),S=function(e){if(Array.isArray(e))return e}(u=e.useState(E))||function(e,t){var r,n,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],l=!0,i=!1;try{for(a=a.call(e);!(l=(r=a.next()).done)&&(o.push(r.value),2!==o.length);l=!0);}catch(e){i=!0,n=e}finally{try{l||null==a.return||a.return()}finally{if(i)throw n}}return o}}(u,2)||function(e,t){if(e){if("string"==typeof e)return a(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,2)}}(u,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),L=S[0],N=S[1];return /*#__PURE__*/e.createElement(n,{pulse:I,dataQa:P,required:w,wide:h,className:c,loading:y,disabled:d,label:m,error:f,hint:C,endElement:/*#__PURE__*/e.createElement(r,{key:"tooltip",disableInteractive:!0,title:L?j:O},/*#__PURE__*/e.createElement("span",{role:"button",tabIndex:0,className:t("vchasno-ui-PasswordInput__eye",{"vchasno-ui-PasswordInput__eye--active":L}),onClick:function(){d||N(function(e){return!e})}},L?o:l)),startElement:p,labelProps:v,hideEmptyMeta:g},/*#__PURE__*/e.createElement("input",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({type:L?"text":"password",disabled:d,className:t("vchasno-ui-PasswordInput",{"vchasno-ui-PasswordInput--type-password":!L},b),required:w,ref:s,placeholder:void 0===x?" ":x},M)))});i.displayName="PasswordInput";export{i as default};
2
2
  //# sourceMappingURL=PasswordInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordInput.js","sources":["../../../src/components/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport BlackTooltip from '../BlackTooltip';\nimport type { InputProps } from '../Input';\nimport Input from '../Input';\nimport { DataQa } from '../types';\n\nimport './PasswordInput.global.css';\n\nexport interface PasswordInputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>,\n Omit<InputProps, 'children' | 'endElement'>,\n DataQa {\n inputClassName?: string;\n labelProps?: InputHTMLAttributes<HTMLLabelElement>;\n showPassword?: boolean;\n showPasswordTooltip?: string;\n hidePasswordTooltip?: string;\n}\n\nconst eyeIcon = (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"icons/eye\">\n <path\n d=\"M10 13C11.6569 13 13 11.6569 13 10C13 8.34315 11.6569 7 10 7C8.34315 7 7 8.34315 7 10C7 11.6569 8.34315 13 10 13Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M18.9 9.5C18.7 9.3 15.5 4 10 4C4.50002 4 1.30002 9.3 1.10002 9.5C1.00002 9.8 1.00002 10.2 1.10002 10.5C1.30002 10.7 4.50002 16 10 16C15.5 16 18.7 10.7 18.9 10.5C19 10.2 19 9.8 18.9 9.5ZM10 14C6.60002 14 4.10002 11.2 3.20002 10C4.10002 8.8 6.50002 6 10 6C13.4 6 15.9 8.8 16.8 10C15.9 11.2 13.5 14 10 14Z\"\n fill=\"currentColor\"\n />\n </g>\n </svg>\n);\n\nconst eyeSlashIcon = (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M18.9004 9.49968C18.8004 9.39968 17.6004 7.49968 15.5004 5.89968L16.7004 4.69968C17.1004 4.29968 17.1004 3.69968 16.7004 3.29968C16.3004 2.89968 15.7004 2.89968 15.3004 3.29968L13.7004 4.89968C12.6004 4.29968 11.4004 3.99968 10.0004 3.99968C4.50039 3.99968 1.30039 9.29968 1.10039 9.49968C1.00039 9.79968 1.00039 10.1997 1.10039 10.4997C1.20039 10.5997 2.40039 12.4997 4.50039 14.0997L3.30039 15.2997C2.90039 15.6997 2.90039 16.2997 3.30039 16.6997C3.50039 16.8997 3.70039 16.9997 4.00039 16.9997C4.30039 16.9997 4.50039 16.8997 4.70039 16.6997L6.30039 15.0997C7.40039 15.6997 8.60039 15.9997 10.0004 15.9997C15.5004 15.9997 18.7004 10.6997 18.9004 10.4997C19.0004 10.1997 19.0004 9.79968 18.9004 9.49968ZM3.20039 9.99968C4.10039 8.79968 6.50039 5.99968 10.0004 5.99968C10.8004 5.99968 11.5004 6.19968 12.2004 6.39968L11.3004 7.29968C10.9004 7.09968 10.5004 6.99968 10.0004 6.99968C8.30039 6.99968 7.00039 8.29968 7.00039 9.99968C7.00039 10.4997 7.10039 10.8997 7.30039 11.2997L5.90039 12.5997C4.60039 11.7997 3.70039 10.5997 3.20039 9.99968ZM10.0004 13.9997C9.20039 13.9997 8.50039 13.7997 7.80039 13.5997L8.70039 12.6997C9.10039 12.8997 9.50039 12.9997 10.0004 12.9997C11.7004 12.9997 13.0004 11.6997 13.0004 9.99968C13.0004 9.49968 12.9004 9.09968 12.7004 8.69968L14.1004 7.29968C15.4004 8.19968 16.3004 9.29968 16.8004 9.89968C15.9004 11.1997 13.5004 13.9997 10.0004 13.9997Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nconst PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(\n (\n {\n className,\n disabled,\n startElement,\n error,\n label,\n hint,\n wide,\n required,\n loading,\n inputClassName,\n labelProps,\n hideEmptyMeta,\n dataQa,\n showPassword,\n showPasswordTooltip,\n hidePasswordTooltip,\n placeholder = ' ', //need \"space\" for correct label working\n ...rest\n },\n ref,\n ) => {\n const [isShowPassword, setIsShowPassword] = React.useState(showPassword);\n\n return (\n <Input\n dataQa={dataQa}\n required={required}\n wide={wide}\n className={className}\n loading={loading}\n disabled={disabled}\n label={label}\n error={error}\n hint={hint}\n endElement={\n <BlackTooltip\n key=\"tooltip\"\n disableInteractive\n title={isShowPassword ? hidePasswordTooltip : showPasswordTooltip}\n >\n <span\n role=\"button\"\n tabIndex={0}\n className={cn('vchasno-ui-PasswordInput__eye', {\n 'vchasno-ui-PasswordInput__eye--active': isShowPassword,\n })}\n onClick={() => {\n if (disabled) {\n return;\n }\n setIsShowPassword((prev) => !prev);\n }}\n >\n {isShowPassword ? eyeIcon : eyeSlashIcon}\n </span>\n </BlackTooltip>\n }\n startElement={startElement}\n labelProps={labelProps}\n hideEmptyMeta={hideEmptyMeta}\n >\n <input\n type={isShowPassword ? 'text' : 'password'}\n disabled={disabled}\n className={cn(\n 'vchasno-ui-PasswordInput',\n {\n 'vchasno-ui-PasswordInput--type-password': !isShowPassword,\n },\n inputClassName,\n )}\n required={required}\n ref={ref}\n placeholder={placeholder}\n {...rest}\n />\n </Input>\n );\n },\n);\n\nPasswordInput.displayName = 'PasswordInput';\n\nexport default PasswordInput;\n"],"names":["eyeIcon","React","svg","width","height","viewBox","fill","xmlns","g","id","path","d","eyeSlashIcon","PasswordInput","forwardRef","ref","className","disabled","startElement","error","label","hint","wide","required","loading","inputClassName","labelProps","hideEmptyMeta","dataQa","showPassword","showPasswordTooltip","hidePasswordTooltip","placeholder","rest","useState","isShowPassword","setIsShowPassword","Input","endElement","BlackTooltip","key","disableInteractive","title","span","role","tabIndex","cn","onClick","prev","input","type","displayName"],"mappings":"qOAsBA,IAAMA,EACF,WAAA,EAAAC,EAACC,aAAAA,CAAAA,MAAAA,CAAIC,MAAM,KAAKC,OAAO,KAAKC,QAAQ,YAAYC,KAAK,OAAOC,MAAM,2CAC9DN,EAACO,aAAAA,CAAAA,IAAAA,CAAEC,GAAG,0BACFR,EAACS,aAAAA,CAAAA,OAAAA,CACGC,EAAE,oHACFL,KAAK,iBAET,WAAA,EAAAL,EAACS,aAAAA,CAAAA,OAAAA,CACGC,EAAE,iTACFL,KAAK,mBAMfM,EACF,WAAA,EAAAX,EAACC,aAAAA,CAAAA,MAAAA,CAAIC,MAAM,KAAKC,OAAO,KAAKC,QAAQ,YAAYC,KAAK,OAAOC,MAAM,2CAC9DN,EAACS,aAAAA,CAAAA,OAAAA,CACGC,EAAE,s2CACFL,KAAK,kBAKXO,EAAgBZ,WAAAA,EAAAA,EAAMa,UAAU,CAClC,SAqBIC,CAAAA,CAAAA,CAAAA,EAnBIC,MAAAA,EAAAA,EAAAA,SACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,aACAC,EAAAA,EAAAA,KAAAA,CACAC,EAAAA,EAAAA,KAAAA,CACAC,EAAAA,EAAAA,IAAAA,CACAC,EAAAA,EAAAA,IAAAA,CACAC,IAAAA,QACAC,CAAAA,EAAAA,EAAAA,OACAC,CAAAA,EAAAA,EAAAA,cACAC,CAAAA,EAAAA,EAAAA,UACAC,CAAAA,EAAAA,EAAAA,cACAC,EAAAA,EAAAA,MAAAA,CACAC,EAAAA,EAAAA,YAAAA,CACAC,IAAAA,mBACAC,CAAAA,EAAAA,EAAAA,mBACAC,CAAAA,EAAAA,EAAAA,WAAAA,CACGC,EAAAA,sXAAAA,EAAAA,CAjBHjB,YACAC,WACAC,eACAC,QACAC,QACAC,OACAC,OACAC,WACAC,UACAC,iBACAC,aACAC,gBACAC,SACAC,eACAC,sBACAC,sBACAC,gBAKwC/B,8CAAAA,EAAMiC,QAAQ,CAACL,sMAApDM,oHAAAA,yDAAAA,0OAAAA,OAAAA,gLAAAA,EAAqClC,KAArBmC,EAAqBnC,CAAAA,CAAAA,EAAAA,CAE5C,oBACIA,EAACoC,aAAAA,CAAAA,EAAAA,CACGT,OAAQA,EACRL,SAAUA,EACVD,KAAMA,EACNN,UAAWA,EACXQ,QAASA,EACTP,SAAUA,EACVG,MAAOA,EACPD,MAAOA,EACPE,KAAMA,EACNiB,WACI,WAAA,EAAArC,EAACsC,aAAAA,CAAAA,EAAAA,CACGC,IAAI,UACJC,mBAAAA,CAAAA,EACAC,MAAOP,EAAiBJ,EAAsBD,gBAE9C7B,EAAC0C,aAAAA,CAAAA,OAAAA,CACGC,KAAK,SACLC,SAAU,EACV7B,UAAW8B,EAAG,gCAAiC,CAC3C,wCAAyCX,CAC7C,GACAY,QAAS,WACD9B,GAGJmB,EAAkB,SAACY,CAAAA,QAAS,CAACA,GACjC,CAECb,EAAAA,EAAiBnC,EAAUY,IAIxCM,aAAcA,EACdQ,WAAYA,EACZC,cAAeA,gBAEf1B,EAACgD,aAAAA,CAAAA,QAAAA,iaAAAA,CACGC,KAAMf,EAAiB,OAAS,WAChClB,SAAUA,EACVD,UAAW8B,EACP,2BACA,CACI,0CAA2C,CAACX,CAEhDV,EAAAA,GAEJF,SAAUA,EACVR,IAAKA,EACLiB,uBAzDM,IACXC,CAyDSA,EAAAA,IAIpB,EAGJpB,CAAAA,EAAcsC,WAAW,CAAG"}
1
+ {"version":3,"file":"PasswordInput.js","sources":["../../../src/components/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport BlackTooltip from '../BlackTooltip';\nimport type { InputProps } from '../Input';\nimport Input from '../Input';\nimport { DataQa } from '../types';\n\nimport './PasswordInput.global.css';\n\nexport interface PasswordInputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>,\n Omit<InputProps, 'children' | 'endElement'>,\n DataQa {\n inputClassName?: string;\n labelProps?: InputHTMLAttributes<HTMLLabelElement>;\n showPassword?: boolean;\n showPasswordTooltip?: string;\n hidePasswordTooltip?: string;\n}\n\nconst eyeIcon = (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"icons/eye\">\n <path\n d=\"M10 13C11.6569 13 13 11.6569 13 10C13 8.34315 11.6569 7 10 7C8.34315 7 7 8.34315 7 10C7 11.6569 8.34315 13 10 13Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M18.9 9.5C18.7 9.3 15.5 4 10 4C4.50002 4 1.30002 9.3 1.10002 9.5C1.00002 9.8 1.00002 10.2 1.10002 10.5C1.30002 10.7 4.50002 16 10 16C15.5 16 18.7 10.7 18.9 10.5C19 10.2 19 9.8 18.9 9.5ZM10 14C6.60002 14 4.10002 11.2 3.20002 10C4.10002 8.8 6.50002 6 10 6C13.4 6 15.9 8.8 16.8 10C15.9 11.2 13.5 14 10 14Z\"\n fill=\"currentColor\"\n />\n </g>\n </svg>\n);\n\nconst eyeSlashIcon = (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M18.9004 9.49968C18.8004 9.39968 17.6004 7.49968 15.5004 5.89968L16.7004 4.69968C17.1004 4.29968 17.1004 3.69968 16.7004 3.29968C16.3004 2.89968 15.7004 2.89968 15.3004 3.29968L13.7004 4.89968C12.6004 4.29968 11.4004 3.99968 10.0004 3.99968C4.50039 3.99968 1.30039 9.29968 1.10039 9.49968C1.00039 9.79968 1.00039 10.1997 1.10039 10.4997C1.20039 10.5997 2.40039 12.4997 4.50039 14.0997L3.30039 15.2997C2.90039 15.6997 2.90039 16.2997 3.30039 16.6997C3.50039 16.8997 3.70039 16.9997 4.00039 16.9997C4.30039 16.9997 4.50039 16.8997 4.70039 16.6997L6.30039 15.0997C7.40039 15.6997 8.60039 15.9997 10.0004 15.9997C15.5004 15.9997 18.7004 10.6997 18.9004 10.4997C19.0004 10.1997 19.0004 9.79968 18.9004 9.49968ZM3.20039 9.99968C4.10039 8.79968 6.50039 5.99968 10.0004 5.99968C10.8004 5.99968 11.5004 6.19968 12.2004 6.39968L11.3004 7.29968C10.9004 7.09968 10.5004 6.99968 10.0004 6.99968C8.30039 6.99968 7.00039 8.29968 7.00039 9.99968C7.00039 10.4997 7.10039 10.8997 7.30039 11.2997L5.90039 12.5997C4.60039 11.7997 3.70039 10.5997 3.20039 9.99968ZM10.0004 13.9997C9.20039 13.9997 8.50039 13.7997 7.80039 13.5997L8.70039 12.6997C9.10039 12.8997 9.50039 12.9997 10.0004 12.9997C11.7004 12.9997 13.0004 11.6997 13.0004 9.99968C13.0004 9.49968 12.9004 9.09968 12.7004 8.69968L14.1004 7.29968C15.4004 8.19968 16.3004 9.29968 16.8004 9.89968C15.9004 11.1997 13.5004 13.9997 10.0004 13.9997Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nconst PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(\n (\n {\n className,\n disabled,\n startElement,\n error,\n label,\n hint,\n wide,\n required,\n loading,\n inputClassName,\n labelProps,\n hideEmptyMeta,\n dataQa,\n showPassword,\n showPasswordTooltip,\n hidePasswordTooltip,\n pulse,\n placeholder = ' ', //need \"space\" for correct label working\n ...rest\n },\n ref,\n ) => {\n const [isShowPassword, setIsShowPassword] = React.useState(showPassword);\n\n return (\n <Input\n pulse={pulse}\n dataQa={dataQa}\n required={required}\n wide={wide}\n className={className}\n loading={loading}\n disabled={disabled}\n label={label}\n error={error}\n hint={hint}\n endElement={\n <BlackTooltip\n key=\"tooltip\"\n disableInteractive\n title={isShowPassword ? hidePasswordTooltip : showPasswordTooltip}\n >\n <span\n role=\"button\"\n tabIndex={0}\n className={cn('vchasno-ui-PasswordInput__eye', {\n 'vchasno-ui-PasswordInput__eye--active': isShowPassword,\n })}\n onClick={() => {\n if (disabled) {\n return;\n }\n setIsShowPassword((prev) => !prev);\n }}\n >\n {isShowPassword ? eyeIcon : eyeSlashIcon}\n </span>\n </BlackTooltip>\n }\n startElement={startElement}\n labelProps={labelProps}\n hideEmptyMeta={hideEmptyMeta}\n >\n <input\n type={isShowPassword ? 'text' : 'password'}\n disabled={disabled}\n className={cn(\n 'vchasno-ui-PasswordInput',\n {\n 'vchasno-ui-PasswordInput--type-password': !isShowPassword,\n },\n inputClassName,\n )}\n required={required}\n ref={ref}\n placeholder={placeholder}\n {...rest}\n />\n </Input>\n );\n },\n);\n\nPasswordInput.displayName = 'PasswordInput';\n\nexport default PasswordInput;\n"],"names":["eyeIcon","React","svg","width","height","viewBox","fill","xmlns","g","id","path","d","eyeSlashIcon","PasswordInput","forwardRef","ref","className","disabled","startElement","error","label","hint","wide","required","loading","inputClassName","labelProps","hideEmptyMeta","dataQa","showPassword","showPasswordTooltip","hidePasswordTooltip","pulse","placeholder","rest","useState","isShowPassword","setIsShowPassword","Input","endElement","BlackTooltip","key","disableInteractive","title","span","role","tabIndex","cn","onClick","prev","input","type","displayName"],"mappings":"qOAsBA,IAAMA,EACF,WAAA,EAAAC,EAACC,aAAAA,CAAAA,MAAAA,CAAIC,MAAM,KAAKC,OAAO,KAAKC,QAAQ,YAAYC,KAAK,OAAOC,MAAM,2CAC9DN,EAACO,aAAAA,CAAAA,IAAAA,CAAEC,GAAG,0BACFR,EAACS,aAAAA,CAAAA,OAAAA,CACGC,EAAE,oHACFL,KAAK,iBAET,WAAA,EAAAL,EAACS,aAAAA,CAAAA,OAAAA,CACGC,EAAE,iTACFL,KAAK,mBAMfM,EACF,WAAA,EAAAX,EAACC,aAAAA,CAAAA,MAAAA,CAAIC,MAAM,KAAKC,OAAO,KAAKC,QAAQ,YAAYC,KAAK,OAAOC,MAAM,2CAC9DN,EAACS,aAAAA,CAAAA,OAAAA,CACGC,EAAE,s2CACFL,KAAK,kBAKXO,EAAgBZ,WAAAA,EAAAA,EAAMa,UAAU,CAClC,SAsBIC,CAAAA,CAAAA,CAAAA,EApBIC,MAAAA,EAAAA,EAAAA,SACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,aACAC,EAAAA,EAAAA,KAAAA,CACAC,EAAAA,EAAAA,KAAAA,CACAC,IAAAA,IACAC,CAAAA,EAAAA,EAAAA,IACAC,CAAAA,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,OAAAA,CACAC,EAAAA,EAAAA,cAAAA,CACAC,IAAAA,UACAC,CAAAA,EAAAA,EAAAA,aACAC,CAAAA,EAAAA,EAAAA,OACAC,EAAAA,EAAAA,YAAAA,CACAC,EAAAA,EAAAA,mBAAAA,CACAC,IAAAA,mBACAC,CAAAA,EAAAA,EAAAA,KACAC,CAAAA,EAAAA,EAAAA,WAAAA,CACGC,EAAAA,sXAAAA,EAAAA,CAlBHlB,YACAC,WACAC,eACAC,QACAC,QACAC,OACAC,OACAC,WACAC,UACAC,iBACAC,aACAC,gBACAC,SACAC,eACAC,sBACAC,sBACAC,QACAC,gBAKwChC,8CAAAA,EAAMkC,QAAQ,CAACN,sMAApDO,oHAAAA,yDAAAA,0OAAAA,OAAAA,gLAAAA,EAAqCnC,KAArBoC,EAAqBpC,CAAAA,CAAAA,EAAAA,CAE5C,oBACIA,EAACqC,aAAAA,CAAAA,EAAAA,CACGN,MAAOA,EACPJ,OAAQA,EACRL,SAAUA,EACVD,KAAMA,EACNN,UAAWA,EACXQ,QAASA,EACTP,SAAUA,EACVG,MAAOA,EACPD,MAAOA,EACPE,KAAMA,EACNkB,WACI,WAAA,EAAAtC,EAACuC,aAAAA,CAAAA,EAAAA,CACGC,IAAI,UACJC,mBAAAA,CAAAA,EACAC,MAAOP,EAAiBL,EAAsBD,gBAE9C7B,EAAC2C,aAAAA,CAAAA,OAAAA,CACGC,KAAK,SACLC,SAAU,EACV9B,UAAW+B,EAAG,gCAAiC,CAC3C,wCAAyCX,CAC7C,GACAY,QAAS,WACD/B,GAGJoB,EAAkB,SAACY,CAAAA,QAAS,CAACA,GACjC,CAECb,EAAAA,EAAiBpC,EAAUY,IAIxCM,aAAcA,EACdQ,WAAYA,EACZC,cAAeA,gBAEf1B,EAACiD,aAAAA,CAAAA,QAAAA,iaAAAA,CACGC,KAAMf,EAAiB,OAAS,WAChCnB,SAAUA,EACVD,UAAW+B,EACP,2BACA,CACI,0CAA2C,CAACX,CAEhDX,EAAAA,GAEJF,SAAUA,EACVR,IAAKA,EACLkB,uBA1DM,IACXC,CA0DSA,EAAAA,IAIpB,EAGJrB,CAAAA,EAAcuC,WAAW,CAAG"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+
3
+ interface ScrollableBoxProps {
4
+ className?: string;
5
+ contentClassName?: string;
6
+ scrollHeight: React.CSSProperties['maxHeight'];
7
+ hideScroll?: boolean;
8
+ shadow?: 'vertical';
9
+ onScrollableChange?: (isScrollable: boolean) => void;
10
+ }
11
+ declare const ScrollableBox: React.FC<React.PropsWithChildren<ScrollableBoxProps>>;
12
+
13
+ export { type ScrollableBoxProps, ScrollableBox as default };
@@ -0,0 +1,2 @@
1
+ import l,{useRef as e,useEffect as a}from"react";import r from"classnames";import{useElementScrollable as o}from"./useElementScrollable.js";var c=function(c){var s=c.className,t=c.contentClassName,n=c.scrollHeight,i=c.hideScroll,m=c.children,v=c.shadow,d=c.onScrollableChange,u=e(d);u.current=d;var h=e(null),f=o(h,"vertical");return a(function(){var l;null===(l=u.current)||void 0===l||l.call(u,f)},[f]),/*#__PURE__*/l.createElement("div",{style:{maxHeight:n},ref:h,className:r("vchasno-ui-scrollable-box",{"--v-shadows":f&&"vertical"===v,"--is-scrollable":f,"--hide-scroll":void 0!==i&&i},s)},/*#__PURE__*/l.createElement("div",{className:t},m))};export{c as default};
2
+ //# sourceMappingURL=ScrollableBox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrollableBox.js","sources":["../../../src/components/ScrollableBox/ScrollableBox.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\n\nimport cn from 'classnames';\n\nimport { useElementScrollable } from './useElementScrollable';\n\nimport './ScrollableBox.global.css';\n\nexport interface ScrollableBoxProps {\n className?: string;\n contentClassName?: string;\n scrollHeight: React.CSSProperties['maxHeight'];\n hideScroll?: boolean;\n shadow?: 'vertical';\n onScrollableChange?: (isScrollable: boolean) => void;\n}\n\nconst ScrollableBox: React.FC<React.PropsWithChildren<ScrollableBoxProps>> = ({\n className,\n contentClassName,\n scrollHeight,\n hideScroll = false,\n children,\n shadow,\n onScrollableChange,\n}) => {\n const onScrollableChangeRef = useRef(onScrollableChange);\n onScrollableChangeRef.current = onScrollableChange;\n\n const rootRef = useRef<HTMLDivElement>(null);\n const isScrollable = useElementScrollable(rootRef, 'vertical');\n\n useEffect(() => {\n onScrollableChangeRef.current?.(isScrollable);\n }, [isScrollable]);\n\n const style = {\n maxHeight: scrollHeight,\n } as React.CSSProperties;\n\n return (\n <div\n style={style}\n ref={rootRef}\n className={cn(\n 'vchasno-ui-scrollable-box',\n {\n '--v-shadows': isScrollable && shadow === 'vertical',\n '--is-scrollable': isScrollable,\n '--hide-scroll': hideScroll,\n },\n className,\n )}\n >\n <div className={contentClassName}>{children}</div>\n </div>\n );\n};\n\nexport default ScrollableBox;\n"],"names":["ScrollableBox","param","className","contentClassName","scrollHeight","hideScroll","children","shadow","onScrollableChange","onScrollableChangeRef","useRef","current","rootRef","isScrollable","useElementScrollable","useEffect","React","div","style","maxHeight","ref","cn","_param_hideScroll"],"mappings":"4IAiBA,IAAMA,EAAuE,SAAAC,CAAA,EACzEC,IAAAA,EAAAA,EAAAA,SACAC,CAAAA,EAAAA,EAAAA,gBACAC,CAAAA,EAAAA,EAAAA,YACAC,CAAAA,EAAAA,EAAAA,UAAAA,CACAC,EAAAA,EAAAA,QAAAA,CACAC,EAAAA,EAAAA,MAAAA,CACAC,EAAAA,EAAAA,kBAAAA,CAEMC,EAAwBC,EAAOF,EACrCC,CAAAA,EAAsBE,OAAO,CAAGH,EAEhC,IAAMI,EAAUF,EAAuB,MACjCG,EAAeC,EAAqBF,EAAS,mBAEnDG,EAAU,WACNN,IAAAA,CAAAA,AAAAA,QAAAA,CAAAA,EAAAA,EAAsBE,OAAO,GAA7BF,AAAAA,KAAAA,IAAAA,GAAAA,OAAAA,EAAgCI,IACjC,CAACA,EAAa,eAObG,EAACC,aAAAA,CAAAA,MAAAA,CACGC,MANM,CACVC,UAAWf,CACf,EAKQgB,IAAKR,EACLV,UAAWmB,EACP,4BACA,CACI,cAAeR,GAAgBN,AAAW,aAAXA,EAC/B,kBAAmBM,EACnB,gBA5BHS,AAAA,KAAA,IAAAA,GAAAA,CA8BDpB,EAAAA,iBAGJc,EAACC,aAAAA,CAAAA,MAAAA,CAAIf,UAAWC,CAAmBG,EAAAA,GAG/C"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+
3
+ declare const useElementScrollable: (ref: React.RefObject<HTMLElement>, direction: "horizontal" | "vertical") => boolean;
4
+
5
+ export { useElementScrollable };
@@ -0,0 +1,2 @@
1
+ import{useState as r,useEffect as t}from"react";function n(r,t){(null==t||t>r.length)&&(t=r.length);for(var n=0,e=Array(t);n<t;n++)e[n]=r[n];return e}var e=function(e,o){var i,l=function(r){if(Array.isArray(r))return r}(i=r(!1))||function(r,t){var n,e,o=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=o){var i=[],l=!0,u=!1;try{for(o=o.call(r);!(l=(n=o.next()).done)&&(i.push(n.value),2!==i.length);l=!0);}catch(r){u=!0,e=r}finally{try{l||null==o.return||o.return()}finally{if(u)throw e}}return i}}(i,2)||function(r,t){if(r){if("string"==typeof r)return n(r,2);var e=Object.prototype.toString.call(r).slice(8,-1);if("Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return n(r,2)}}(i,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=l[0],a=l[1];return t(function(){var r=e.current;if(!r)return function(){return null};var t=function(){a("horizontal"===o?r.scrollWidth>r.clientWidth:r.scrollHeight>r.clientHeight)};if(t(),window.ResizeObserver){var n=new ResizeObserver(t);return n.observe(r),function(){n.disconnect()}}var i=new MutationObserver(t);return i.observe(r,{childList:!0}),function(){i.disconnect()}},[o,e]),u};export{e as useElementScrollable};
2
+ //# sourceMappingURL=useElementScrollable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useElementScrollable.js","sources":["../../../src/components/ScrollableBox/useElementScrollable.ts"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nconst detectScrollable = (\n element: HTMLElement,\n direction: 'horizontal' | 'vertical',\n) => {\n if (direction === 'horizontal') {\n return element.scrollWidth > element.clientWidth;\n }\n return element.scrollHeight > element.clientHeight;\n};\n\nexport const useElementScrollable = (\n ref: React.RefObject<HTMLElement>,\n direction: 'horizontal' | 'vertical',\n) => {\n const [isScrollable, setIsScrollable] = useState(false);\n\n useEffect(() => {\n const root = ref.current;\n\n if (!root) {\n return () => null;\n }\n\n const mutationHandler = () => {\n setIsScrollable(detectScrollable(root, direction));\n };\n\n mutationHandler();\n\n if (window.ResizeObserver) {\n const resizeObserver = new ResizeObserver(mutationHandler);\n resizeObserver.observe(root);\n\n return () => {\n resizeObserver.disconnect();\n };\n }\n\n // for 11th IE\n const mutationObserver = new MutationObserver(mutationHandler);\n mutationObserver.observe(root, {\n childList: true,\n });\n\n return () => {\n mutationObserver.disconnect();\n };\n }, [direction, ref]);\n\n return isScrollable;\n};\n"],"names":["useElementScrollable","ref","direction","useState","isScrollable","setIsScrollable","useEffect","root","current","mutationHandler","element","scrollWidth","clientWidth","scrollHeight","clientHeight","window","ResizeObserver","resizeObserver","observe","disconnect","mutationObserver","MutationObserver","childList"],"mappings":"sJAYO,IAAMA,EAAuB,SAChCC,CACAC,CAAAA,CAAAA,EAEA,MAAwCC,8CAAAA,EAAS,CAAA,sMAA1CC,oHAAAA,yDAAAA,0OAAAA,OAAAA,gLAAAA,EAAiCD,KAAnBE,EAAmBF,CAAAA,CAAAA,EAAAA,CAmCxC,OAjCAG,EAAU,WACN,IAAMC,EAAON,EAAIO,OAAO,CAExB,GAAI,CAACD,EACD,OAAO,WAAM,OAAA,MAGjB,IAAME,EAAkB,WACpBJ,EApBJH,AAAc,eAoB6BA,EAnBpCQ,AAmB8BH,EAnBtBI,WAAW,CAAGD,AAmBQH,EAnBAK,WAAW,CAE7CF,AAiBkCH,EAjB1BM,YAAY,CAAGH,AAiBWH,EAjBHO,YAAY,CAkB9C,EAIA,GAFAL,IAEIM,OAAOC,cAAc,CAAE,CACvB,IAAMC,EAAiB,IAAID,eAAeP,GAG1C,OAFAQ,EAAeC,OAAO,CAACX,GAEhB,WACHU,EAAeE,UAAU,EAC7B,CACJ,CAGA,IAAMC,EAAmB,IAAIC,iBAAiBZ,GAK9C,OAJAW,EAAiBF,OAAO,CAACX,EAAM,CAC3Be,UAAW,CAAA,CACf,GAEO,WACHF,EAAiBD,UAAU,EAC/B,GACD,CAACjB,EAAWD,EAAI,EAEZG,CACX"}
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
+ import { GroupBase } from 'react-select';
2
3
  import { AsyncProps } from 'react-select/async';
3
- import { WithLabel, WithHint, ErrorFeedback, DataQa, HideEmptyMeta } from '../types.js';
4
+ import { WithLabel, WithHint, ErrorFeedback, DataQa, HideEmptyMeta, WithPulseAnimation } from '../types.js';
4
5
  import { Option } from './types.js';
5
- import { GroupBase } from 'react-select';
6
6
 
7
- interface AsyncSelectProps extends AsyncProps<Option, false | true, GroupBase<Option>>, Partial<WithLabel & WithHint & ErrorFeedback & DataQa & HideEmptyMeta> {
7
+ interface AsyncSelectProps extends AsyncProps<Option, false | true, GroupBase<Option>>, Partial<WithLabel & WithHint & ErrorFeedback & DataQa & HideEmptyMeta & WithPulseAnimation> {
8
8
  wide?: boolean;
9
9
  }
10
10
  declare const AsyncSelect: React.FC<AsyncSelectProps>;
@@ -1,2 +1,2 @@
1
- import e from"react";import t from"react-select/async";import r from"classnames";import o from"../InputMeta/InputMeta.js";import n from"./Label.js";import a from"./customComponents.js";import s from"./defaultProps.js";import{composeStyles as l}from"./utils.js";function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}var c=function(c){var p,u,m=c.className,d=c.label,f=c.hint,b=c.wide,O=c.required,y=c.isDisabled,g=c.menuPlacement,j=c.noOptionsMessage,v=void 0===j?s.noOptionsMessageDefault:j,P=c.loadingMessage,h=void 0===P?s.loadingMessageDefault:P,M=c.placeholder,w=c.components,S=c.error,D=void 0===S?"":S,E=c.dataQa,q=c.closeMenuOnSelect,x=c.hideEmptyMeta,N=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(c,["className","label","hint","wide","required","isDisabled","menuPlacement","noOptionsMessage","loadingMessage","placeholder","components","error","dataQa","closeMenuOnSelect","hideEmptyMeta"]);return /*#__PURE__*/e.createElement("label",{"data-qa":E,className:r("vchasno-ui-select",{"--required":O,"--disabled":y,"--wide":b,"--error":D},m)},d&&/*#__PURE__*/e.createElement(n,{label:d}),/*#__PURE__*/e.createElement(t,(p=i({required:O,components:i({},a,void 0===w?{}:w),closeMenuOnSelect:void 0===q||q,classNamePrefix:"vchasno-ui-select",menuPlacement:void 0===g?"auto":g,isDisabled:y,noOptionsMessage:v,loadingMessage:h,placeholder:void 0===M?" ":M},N),u=u={styles:i({},l,N.styles)},Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(u)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r.push.apply(r,o)}return r})(Object(u)).forEach(function(e){Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(u,e))}),p)),!(void 0!==x&&x)||D||f?/*#__PURE__*/e.createElement(o,{hint:f,error:D}):null)};export{c as default};
1
+ import e from"react";import t from"react-select/async";import r from"classnames";import o from"../InputMeta/InputMeta.js";import n from"./Label.js";import a from"./customComponents.js";import s from"./defaultProps.js";import{composeStyles as l}from"./utils.js";function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}var c=function(c){var p,u,m=c.className,d=c.label,f=c.hint,b=c.wide,O=c.required,y=c.isDisabled,g=c.menuPlacement,j=c.noOptionsMessage,v=void 0===j?s.noOptionsMessageDefault:j,P=c.loadingMessage,h=void 0===P?s.loadingMessageDefault:P,M=c.placeholder,w=c.components,S=c.error,D=void 0===S?"":S,E=c.dataQa,q=c.closeMenuOnSelect,x=c.hideEmptyMeta,N=c.pulse,k=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(c,["className","label","hint","wide","required","isDisabled","menuPlacement","noOptionsMessage","loadingMessage","placeholder","components","error","dataQa","closeMenuOnSelect","hideEmptyMeta","pulse"]);return /*#__PURE__*/e.createElement("label",{"data-qa":E,className:r("vchasno-ui-select",{"--pulse":N,"--required":O,"--disabled":y,"--wide":b,"--error":D},m)},d&&/*#__PURE__*/e.createElement(n,{label:d}),/*#__PURE__*/e.createElement(t,(p=i({required:O,components:i({},a,void 0===w?{}:w),closeMenuOnSelect:void 0===q||q,classNamePrefix:"vchasno-ui-select",menuPlacement:void 0===g?"auto":g,isDisabled:y,noOptionsMessage:v,loadingMessage:h,placeholder:void 0===M?" ":M},k),u=u={styles:i({},l,k.styles)},Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(u)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r.push.apply(r,o)}return r})(Object(u)).forEach(function(e){Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(u,e))}),p)),!(void 0!==x&&x)||D||f?/*#__PURE__*/e.createElement(o,{hint:f,error:D}):null)};export{c as default};
2
2
  //# sourceMappingURL=AsyncSelect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AsyncSelect.js","sources":["../../../src/components/Select/AsyncSelect.tsx"],"sourcesContent":["import React from 'react';\nimport ReactAsyncSelect, { AsyncProps as ReactAsyncSelectProps } from 'react-select/async'; \n\nimport cn from 'classnames';\n\nimport InputMeta from '../InputMeta';\nimport {\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n WithHint,\n WithLabel,\n} from '../types';\nimport Label from './Label';\nimport { SelectCreatableProps } from './SelectCreatable';\nimport CustomComponents from './customComponents';\nimport defaultProps from './defaultProps';\nimport { Option } from './types';\nimport { composeStyles } from './utils';\n\nimport './Select.global.css';\nimport { GroupBase } from 'react-select';\n\nexport interface AsyncSelectProps\n extends ReactAsyncSelectProps<Option, false | true, GroupBase<Option>>,\n Partial<WithLabel & WithHint & ErrorFeedback & DataQa & HideEmptyMeta> {\n wide?: boolean;\n}\n\nconst AsyncSelect: React.FC<AsyncSelectProps> = ({\n className,\n label,\n hint,\n wide,\n required,\n isDisabled,\n menuPlacement = 'auto',\n noOptionsMessage = defaultProps.noOptionsMessageDefault,\n loadingMessage = defaultProps.loadingMessageDefault,\n placeholder = ' ', //need \"space\" for correct label working\n components = {},\n error = '',\n dataQa,\n closeMenuOnSelect = true,\n hideEmptyMeta = false,\n ...rest\n}) => {\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-select',\n {\n '--required': required,\n '--disabled': isDisabled,\n '--wide': wide,\n '--error': error,\n },\n className,\n )}\n >\n {label && <Label label={label} />}\n <ReactAsyncSelect\n required={required}\n components={{\n ...(CustomComponents as SelectCreatableProps['components']),\n ...components,\n }}\n closeMenuOnSelect={closeMenuOnSelect}\n classNamePrefix=\"vchasno-ui-select\"\n menuPlacement={menuPlacement}\n isDisabled={isDisabled}\n noOptionsMessage={noOptionsMessage}\n loadingMessage={loadingMessage}\n placeholder={placeholder}\n {...rest}\n styles={\n {\n ...composeStyles,\n ...rest.styles,\n } as never\n }\n />\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n};\n\nexport default AsyncSelect;\n"],"names":["AsyncSelect","_param","className","label","hint","wide","required","isDisabled","menuPlacement","_param_noOptionsMessage","noOptionsMessage","defaultProps","noOptionsMessageDefault","loadingMessage","loadingMessageDefault","placeholder","components","_param_error","error","dataQa","closeMenuOnSelect","hideEmptyMeta","rest","React","data-qa","cn","Label","ReactAsyncSelect","_object_spread","CustomComponents","_param_components","classNamePrefix","_param_menuPlacement","styles","composeStyles","InputMeta"],"mappings":"uqBA6BA,IAAMA,EAA0C,SAAAC,CAAA,EAC5CC,QAAAA,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,KAAAA,CACAC,IAAAA,IACAC,CAAAA,EAAAA,EAAAA,KACAC,EAAAA,EAAAA,QAAAA,CACAC,EAAAA,EAAAA,UAAAA,CAAAA,EAAAA,EACAC,cAAgBC,EAAAR,EAChBS,iBAAAA,EAAmBC,AAAAA,KAAAA,IAAAA,EAAAA,EAAaC,uBAAuB,CACvDC,EAAAA,EAAAA,EAAAA,cAAAA,CAAAA,EAAiBF,AAAAA,KAAAA,IAAAA,EAAAA,EAAaG,qBAAqB,CACnDC,EAAAA,EAAAA,EAAAA,WAAAA,CACAC,EAAAA,EAAAA,UAAAA,CAAcC,EAAAhB,EACdiB,MAAAA,EAAQD,AAAA,KAAA,IAAAA,EAAA,GAAAA,EACRE,IAAAA,MACAC,CAAAA,EAAAA,EAAAA,iBAAAA,CACAC,EAAAA,EAAAA,aAAAA,CACGC,EAAAA,sXAAAA,EAAAA,CAfHpB,YACAC,QACAC,OACAC,OACAC,WACAC,aACAC,gBACAE,mBACAG,iBACAE,cACAC,aACAE,QACAC,SACAC,oBACAC,kBAGA,oBACIE,EAACpB,aAAAA,CAAAA,QAAAA,CACGqB,UAASL,EACTjB,UAAWuB,EACP,oBACA,CACI,aAAcnB,EACd,aAAcC,EACd,SAAUF,EACV,UAAWa,CAEfhB,EAAAA,EAGHC,EAAAA,GAAS,WAAA,EAAAoB,EAACG,aAAAA,CAAAA,EAAAA,CAAMvB,MAAOA,IACxB,WAAA,EAAAoB,EAACI,aAAAA,CAAAA,KAAAA,EAAAA,CACGrB,SAAUA,EACVU,WAAYY,KACJC,aAzBP,CAAC,EAAAC,GA4BFV,8BAxBZC,EAyBYU,gBAAgB,oBAChBvB,cAlCIwB,AAAA,KAAA,IAAAA,EAAA,OAAAA,EAmCJzB,WAAYA,EACZG,iBAAkBA,EAClBG,eAAgBA,EAChBE,uBAnCE,IACdC,CAmCgBM,EAAAA,OAAAA,CACJW,OACIL,EAAA,CAAA,EACOM,EACAZ,EAAKW,MAAM,CAIzBZ,+UAAAA,cAtCNC,IAsCwBJ,GAAUd,EAAc,WAAA,EAAAmB,EAACY,aAAAA,CAAAA,EAAAA,CAAU/B,KAAMA,EAAMc,MAAOA,IAArC,KAGhD"}
1
+ {"version":3,"file":"AsyncSelect.js","sources":["../../../src/components/Select/AsyncSelect.tsx"],"sourcesContent":["import React from 'react';\nimport { GroupBase } from 'react-select';\nimport ReactAsyncSelect, { AsyncProps as ReactAsyncSelectProps } from 'react-select/async';\n\nimport cn from 'classnames';\n\nimport InputMeta from '../InputMeta';\nimport {\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n WithHint,\n WithLabel,\n WithPulseAnimation,\n} from '../types';\nimport Label from './Label';\nimport { SelectCreatableProps } from './SelectCreatable';\nimport CustomComponents from './customComponents';\nimport defaultProps from './defaultProps';\nimport { Option } from './types';\nimport { composeStyles } from './utils';\n\nimport './Select.global.css';\n\nexport interface AsyncSelectProps\n extends ReactAsyncSelectProps<Option, false | true, GroupBase<Option>>,\n Partial<\n WithLabel & WithHint & ErrorFeedback & DataQa & HideEmptyMeta & WithPulseAnimation\n > {\n wide?: boolean;\n}\n\nconst AsyncSelect: React.FC<AsyncSelectProps> = ({\n className,\n label,\n hint,\n wide,\n required,\n isDisabled,\n menuPlacement = 'auto',\n noOptionsMessage = defaultProps.noOptionsMessageDefault,\n loadingMessage = defaultProps.loadingMessageDefault,\n placeholder = ' ', //need \"space\" for correct label working\n components = {},\n error = '',\n dataQa,\n closeMenuOnSelect = true,\n hideEmptyMeta = false,\n pulse,\n ...rest\n}) => {\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-select',\n {\n '--pulse': pulse,\n '--required': required,\n '--disabled': isDisabled,\n '--wide': wide,\n '--error': error,\n },\n className,\n )}\n >\n {label && <Label label={label} />}\n <ReactAsyncSelect\n required={required}\n components={{\n ...(CustomComponents as SelectCreatableProps['components']),\n ...components,\n }}\n closeMenuOnSelect={closeMenuOnSelect}\n classNamePrefix=\"vchasno-ui-select\"\n menuPlacement={menuPlacement}\n isDisabled={isDisabled}\n noOptionsMessage={noOptionsMessage}\n loadingMessage={loadingMessage}\n placeholder={placeholder}\n {...rest}\n styles={\n {\n ...composeStyles,\n ...rest.styles,\n } as never\n }\n />\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n};\n\nexport default AsyncSelect;\n"],"names":["AsyncSelect","_param","className","label","hint","wide","required","isDisabled","menuPlacement","noOptionsMessage","defaultProps","noOptionsMessageDefault","loadingMessage","loadingMessageDefault","_param_loadingMessage","_param_placeholder","placeholder","_param_components","components","error","dataQa","closeMenuOnSelect","_param_hideEmptyMeta","hideEmptyMeta","pulse","rest","React","data-qa","cn","Label","ReactAsyncSelect","_object_spread","CustomComponents","_param_closeMenuOnSelect","classNamePrefix","styles","composeStyles","InputMeta"],"mappings":"uqBAgCA,IAAMA,EAA0C,SAAAC,CAAA,EAC5CC,QAAAA,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,KAAAA,CACAC,IAAAA,IACAC,CAAAA,EAAAA,EAAAA,KACAC,EAAAA,EAAAA,QAAAA,CACAC,IAAAA,UACAC,CAAAA,EAAAA,EAAAA,aAAAA,CACAC,EAAAA,EAAAA,gBAAAA,CAAAA,aAAmBC,EAAaC,uBAAuB,OACvDC,cAAAA,CAAAA,EAAAA,AAAAA,KAAAA,IAAAA,EAAiBF,EAAaG,qBAAqB,CAAAC,EAAAC,EAAAd,EACnDe,YAAcC,EAAAhB,EACdiB,eACAC,KAAAA,CAAAA,EAAAA,AAAAA,KAAAA,IAAAA,EAAQ,KACRC,EAAAA,EAAAA,MAAAA,CAAAA,EAAAA,EACAC,kBAAoBC,EAAArB,EACpBsB,cACAC,IAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAhBHvB,YACAC,QACAC,OACAC,OACAC,WACAC,aACAC,gBACAC,mBACAG,iBACAI,cACAE,aACAC,QACAC,SACAC,oBACAE,gBACAC,UAGA,oBACIE,EAACvB,aAAAA,CAAAA,QAAAA,CACGwB,UAASP,EACTlB,UAAW0B,EACP,oBACA,CACI,UAAWJ,EACX,aAAclB,EACd,aAAcC,EACd,SAAUF,EACV,UAAWc,CAEfjB,EAAAA,EAGHC,EAAAA,GAAS,WAAA,EAAAuB,EAACG,aAAAA,CAAAA,EAAAA,CAAM1B,MAAOA,IACxB,WAAA,EAAAuB,EAACI,aAAAA,CAAAA,KAAAA,EAAAA,CACGxB,SAAUA,EACVY,WAAYa,KACJC,EA3BPf,AAAA,KAAA,IAAAA,EAAA,MA8BDI,kBA3BQY,AAAA,KAAA,IAAAA,GAAAA,EA4BRC,gBAAgB,oBAChB1B,yBApCI,OAChBC,EAoCYF,WAAYA,EACZE,iBAAkBA,EAClBG,eAAgBA,EAChBI,YArCED,AAAA,KAAA,IAAAA,EAAA,IAAAA,CAsCEU,EAAAA,OAAAA,CACJU,OACIJ,EAAA,CAAA,EACOK,EACAX,EAAKU,MAAM,CAIzBZ,+UAAAA,CAzCOD,CAAAA,AAAA,KAAA,IAAAA,GAAAA,CAAA,GAyCWH,GAAUf,EAAc,WAAA,EAAAsB,EAACW,aAAAA,CAAAA,EAAAA,CAAUjC,KAAMA,EAAMe,MAAOA,IAArC,KAGhD"}