forstok-ui-lib 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +19 -4
- package/dist/index.js +78 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +88 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { HTMLAttributes, ReactNode, AnchorHTMLAttributes, MouseEvent, Dispatch, SetStateAction, KeyboardEvent, FocusEvent, InputHTMLAttributes, ChangeEvent } from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode, AnchorHTMLAttributes, MouseEvent, Dispatch, SetStateAction, KeyboardEvent, FocusEvent, InputHTMLAttributes, ChangeEvent, PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
4
|
type TText = HTMLAttributes<HTMLSpanElement> & {
|
|
5
5
|
children: ReactNode;
|
|
@@ -28,7 +28,7 @@ type TEnterEvent = (e: KeyboardEvent<HTMLInputElement | HTMLElement> | FocusEven
|
|
|
28
28
|
type TKeyboadEvent = (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
29
29
|
type TState<T> = Dispatch<SetStateAction<T>>;
|
|
30
30
|
|
|
31
|
-
type TInput = InputHTMLAttributes<HTMLInputElement> & {
|
|
31
|
+
type TInput$1 = InputHTMLAttributes<HTMLInputElement> & {
|
|
32
32
|
mode?: string;
|
|
33
33
|
$isError?: boolean;
|
|
34
34
|
$iconLeft?: boolean;
|
|
@@ -44,6 +44,21 @@ type TInput = InputHTMLAttributes<HTMLInputElement> & {
|
|
|
44
44
|
evEnter?: TEnterEvent;
|
|
45
45
|
evKeyUp?: TKeyboadEvent;
|
|
46
46
|
};
|
|
47
|
-
declare const InputComponent: ({ mode, $isError, $iconLeft, $iconRight, reset, setReset, isForceUpdate, setForceUpdate, evChange, evBlur, isField, evChangeCustom, evEnter, evKeyUp, ...props }: TInput) => react_jsx_runtime.JSX.Element;
|
|
47
|
+
declare const InputComponent: ({ mode, $isError, $iconLeft, $iconRight, reset, setReset, isForceUpdate, setForceUpdate, evChange, evBlur, isField, evChangeCustom, evEnter, evKeyUp, ...props }: TInput$1) => react_jsx_runtime.JSX.Element;
|
|
48
|
+
|
|
49
|
+
type TInput = InputHTMLAttributes<HTMLInputElement> & {
|
|
50
|
+
evChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
51
|
+
$flow?: string;
|
|
52
|
+
extendKey?: string | null;
|
|
53
|
+
extendClass?: string;
|
|
54
|
+
reset?: boolean;
|
|
55
|
+
setReset?: TState<boolean>;
|
|
56
|
+
isForceUpdate?: boolean;
|
|
57
|
+
setForceUpdate?: (value: boolean) => void | TState<boolean>;
|
|
58
|
+
$isError?: boolean;
|
|
59
|
+
$iconRight?: boolean;
|
|
60
|
+
'data-qa-id'?: string;
|
|
61
|
+
};
|
|
62
|
+
declare const CheckboxComponent: ({ id, name, children, $flow, extendKey, extendClass, reset, setReset, isForceUpdate, setForceUpdate, evChange, $isError, $iconRight, ...props }: PropsWithChildren<TInput>) => react_jsx_runtime.JSX.Element;
|
|
48
63
|
|
|
49
|
-
export { InputComponent, LinkComponent, TextComponent };
|
|
64
|
+
export { CheckboxComponent, InputComponent, LinkComponent, TextComponent };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("react"),r=require("styled-components");function
|
|
1
|
+
"use strict";var e=require("react"),r=require("styled-components");function t(e){return e&&e.__esModule?e:{default:e}}var n=t(e),o=t(r);function a(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var i,l={exports:{}},c={};var s,p,d={};
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.development.js
|
|
@@ -7,20 +7,20 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/function
|
|
10
|
+
*/function u(){return s||(s=1,"production"!==process.env.NODE_ENV&&function(){function e(r){if(null==r)return null;if("function"==typeof r)return r.$$typeof===A?null:r.displayName||r.name||null;if("string"==typeof r)return r;switch(r){case j:return"Fragment";case _:return"Portal";case C:return"Profiler";case S:return"StrictMode";case N:return"Suspense";case F:return"SuspenseList"}if("object"==typeof r)switch("number"==typeof r.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case R:return(r.displayName||"Context")+".Provider";case O:return(r._context.displayName||"Context")+".Consumer";case E:var t=r.render;return(r=r.displayName)||(r=""!==(r=t.displayName||t.name||"")?"ForwardRef("+r+")":"ForwardRef"),r;case D:return null!==(t=r.displayName||null)?t:e(r.type)||"Memo";case P:t=r._payload,r=r._init;try{return e(r(t))}catch(e){}}return null}function r(e){return""+e}function t(e){try{r(e);var t=!1}catch(e){t=!0}if(t){var n=(t=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),r(e)}}function o(){}function a(e){if(void 0===q)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);q=r&&r[1]||"",V=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+q+e+V}function i(e,r){if(!e||H)return"";var t=J.get(e);if(void 0!==t)return t;H=!0,t=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var n;n=L.H,L.H=null,function(){if(0===M){y=console.log,h=console.info,g=console.warn,m=console.error,b=console.group,w=console.groupCollapsed,x=console.groupEnd;var e={configurable:!0,enumerable:!0,value:o,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}();try{var i={DetermineComponentFrameRoot:function(){try{if(r){var t=function(){throw Error()};if(Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var n=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){n=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){n=e}(t=e())&&"function"==typeof t.catch&&t.catch((function(){}))}}catch(e){if(e&&n&&"string"==typeof e.stack)return[e.stack,n.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=i.DetermineComponentFrameRoot(),s=c[0],p=c[1];if(s&&p){var d=s.split("\n"),u=p.split("\n");for(c=l=0;l<d.length&&!d[l].includes("DetermineComponentFrameRoot");)l++;for(;c<u.length&&!u[c].includes("DetermineComponentFrameRoot");)c++;if(l===d.length||c===u.length)for(l=d.length-1,c=u.length-1;1<=l&&0<=c&&d[l]!==u[c];)c--;for(;1<=l&&0<=c;l--,c--)if(d[l]!==u[c]){if(1!==l||1!==c)do{if(l--,0>--c||d[l]!==u[c]){var f="\n"+d[l].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),"function"==typeof e&&J.set(e,f),f}}while(1<=l&&0<=c);break}}}finally{H=!1,L.H=n,function(){if(0==--M){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:y}),info:I({},e,{value:h}),warn:I({},e,{value:g}),error:I({},e,{value:m}),group:I({},e,{value:b}),groupCollapsed:I({},e,{value:w}),groupEnd:I({},e,{value:x})})}0>M&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=t}return d=(d=e?e.displayName||e.name:"")?a(d):"","function"==typeof e&&J.set(e,d),d}function l(e){if(null==e)return"";if("function"==typeof e){var r=e.prototype;return i(e,!(!r||!r.isReactComponent))}if("string"==typeof e)return a(e);switch(e){case N:return a("Suspense");case F:return a("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case E:return e=i(e.render,!1);case D:return l(e.type);case P:r=e._payload,e=e._init;try{return l(e(r))}catch(e){}}return""}function c(){var e=L.A;return null===e?null:e.getOwner()}function s(){var r=e(this.type);return Y[r]||(Y[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(r=this.props.ref)?r:null}function p(r,n,o,a,i,l){if("string"==typeof r||"function"==typeof r||r===j||r===C||r===S||r===N||r===F||r===T||"object"==typeof r&&null!==r&&(r.$$typeof===P||r.$$typeof===D||r.$$typeof===R||r.$$typeof===O||r.$$typeof===E||r.$$typeof===B||void 0!==r.getModuleId)){var p=n.children;if(void 0!==p)if(a)if(K(p)){for(a=0;a<p.length;a++)u(p[a],r);Object.freeze&&Object.freeze(p)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(p,r)}else p="",(void 0===r||"object"==typeof r&&null!==r&&0===Object.keys(r).length)&&(p+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),null===r?a="null":K(r)?a="array":void 0!==r&&r.$$typeof===$?(a="<"+(e(r.type)||"Unknown")+" />",p=" Did you accidentally export a JSX literal instead of a component?"):a=typeof r,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",a,p);if(z.call(n,"key")){p=e(r);var d=Object.keys(n).filter((function(e){return"key"!==e}));a=0<d.length?"{key: someKey, "+d.join(": ..., ")+": ...}":"{key: someKey}",G[p+a]||(d=0<d.length?"{"+d.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',a,p,d,p),G[p+a]=!0)}if(p=null,void 0!==o&&(t(o),p=""+o),function(e){if(z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return void 0!==e.key}(n)&&(t(n.key),p=""+n.key),"key"in n)for(var f in o={},n)"key"!==f&&(o[f]=n[f]);else o=n;return p&&function(e,r){function t(){W||(W=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(o,"function"==typeof r?r.displayName||r.name||"Unknown":r),function(e,r,t,n,o,a){return t=a.ref,e={$$typeof:$,type:e,key:r,props:a,_owner:o},null!==(void 0!==t?t:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:s}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(r,p,l,0,c(),o)}function u(e,r){if("object"==typeof e&&e&&e.$$typeof!==X)if(K(e))for(var t=0;t<e.length;t++){var n=e[t];f(n)&&v(n,r)}else if(f(e))e._store&&(e._store.validated=1);else if(null===e||"object"!=typeof e?t=null:t="function"==typeof(t=U&&e[U]||e["@@iterator"])?t:null,"function"==typeof t&&t!==e.entries&&(t=t.call(e))!==e)for(;!(e=t.next()).done;)f(e.value)&&v(e.value,r)}function f(e){return"object"==typeof e&&null!==e&&e.$$typeof===$}function v(r,t){if(r._store&&!r._store.validated&&null==r.key&&(r._store.validated=1,t=function(r){var t="",n=c();return n&&(n=e(n.type))&&(t="\n\nCheck the render method of `"+n+"`."),t||(r=e(r))&&(t="\n\nCheck the top-level render call using <"+r+">."),t}(t),!Q[t])){Q[t]=!0;var n="";r&&null!=r._owner&&r._owner!==c()&&(n=null,"number"==typeof r._owner.tag?n=e(r._owner.type):"string"==typeof r._owner.name&&(n=r._owner.name),n=" It was passed a child from "+n+".");var o=L.getCurrentStack;L.getCurrentStack=function(){var e=l(r.type);return o&&(e+=o()||""),e},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',t,n),L.getCurrentStack=o}}var y,h,g,m,b,w,x,k=n.default,$=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),R=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),U=Symbol.iterator,A=Symbol.for("react.client.reference"),L=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,I=Object.assign,B=Symbol.for("react.client.reference"),K=Array.isArray,M=0;o.__reactDisabledLog=!0;var q,V,W,H=!1,J=new("function"==typeof WeakMap?WeakMap:Map),X=Symbol.for("react.client.reference"),Y={},G={},Q={};d.Fragment=j,d.jsx=function(e,r,t,n,o){return p(e,r,t,!1,0,o)},d.jsxs=function(e,r,t,n,o){return p(e,r,t,!0,0,o)}}()),d}var f=(p||(p=1,"production"===process.env.NODE_ENV?l.exports=function(){if(i)return c;i=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function t(r,t,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in n={},t)"key"!==a&&(n[a]=t[a]);else n=t;return t=n.ref,{$$typeof:e,type:r,key:o,ref:void 0!==t?t:null,props:n}}return c.Fragment=r,c.jsx=t,c.jsxs=t,c}():l.exports=u()),l.exports);const v=r.css`
|
|
11
11
|
overflow: hidden;
|
|
12
12
|
text-overflow: ellipsis;
|
|
13
13
|
white-space: nowrap;
|
|
14
14
|
display: block;
|
|
15
15
|
max-width: 100%;
|
|
16
16
|
width: auto;
|
|
17
|
-
`,
|
|
17
|
+
`,y=o.default.span`
|
|
18
18
|
display: grid;
|
|
19
19
|
i {
|
|
20
20
|
display: inline-block;
|
|
21
21
|
margin-left: 5px;
|
|
22
22
|
}
|
|
23
|
-
${({$color:e,$elipsis:r})=>{let
|
|
23
|
+
${({$color:e,$elipsis:r})=>{let t="";return"mute"===e?t+="\n color: var(--mt-clr);\n ":"blue"===e?t+="\n color: var(--pri-clr-lnk__hvr);\n ":"green"===e?t+="\n color: green;\n ":"red"===e?t+="\n color: var(--sta-clr);\n ":"grey"===e||"darkgrey"===e?t+="\n color: var(--mt-clr);\n ":"supergrey"===e?t+="\n color: #929291;\n ":"orange"===e?t+="\n color: orange;\n ":"black"===e?t+="\n color: #000000;\n ":"lightgreen"===e?t+="\n color: #21BA45;\n ":"mate"===e?t+="\n color: #495057;\n ":"initial"===e&&(t+="\n color: var(--pri-clr);\n "),r&&(t+=v),t}}
|
|
24
24
|
`;r.css`
|
|
25
25
|
list-style: none;
|
|
26
26
|
padding: 0;
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
display: block;
|
|
35
35
|
max-width: 100%;
|
|
36
36
|
width: auto;
|
|
37
|
-
`;const
|
|
37
|
+
`;const h=r.css`
|
|
38
38
|
display: -webkit-box !important;
|
|
39
39
|
-webkit-line-clamp: 2;
|
|
40
40
|
-webkit-box-orient: vertical;
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
font-weight: 600;
|
|
73
73
|
font-size: 13px;
|
|
74
74
|
text-transform: capitalize;
|
|
75
|
-
`;const
|
|
75
|
+
`;const g=r.css`
|
|
76
76
|
color: var(--pri-clr-lnk);
|
|
77
77
|
&,
|
|
78
78
|
&:hover {
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
&:hover {
|
|
82
82
|
color: var(--pri-clr-lnk__hvr);
|
|
83
83
|
}
|
|
84
|
-
`,
|
|
84
|
+
`,m=r.css`
|
|
85
85
|
color: var(--pri-clr-lnk);
|
|
86
86
|
&,
|
|
87
87
|
&:hover {
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
&:hover {
|
|
91
91
|
color: var(--sec-clr-lnk__hvr);
|
|
92
92
|
}
|
|
93
|
-
`,
|
|
93
|
+
`,b=r.css`
|
|
94
94
|
position: relative;
|
|
95
95
|
display: inline-grid;
|
|
96
96
|
padding: 0 16px;
|
|
@@ -104,9 +104,9 @@
|
|
|
104
104
|
&:hover {
|
|
105
105
|
text-decoration: none;
|
|
106
106
|
}
|
|
107
|
-
`,w=({mode:e,$elipsis:r,$activated:
|
|
107
|
+
`,w=({mode:e,$elipsis:r,$activated:t,$shadow:n,disabled:o})=>{let a="";return"clear"===e?a+=g:"clearR"===e?a+=m:"blue"===e?a+="\n &, &:hover {\n color: var(--pri-clr-lnk__hvr);\n text-decoration: none;\n }\n ":"trans"===e?a+=b+"\n height: auto;\n padding: 0;\n opacity: 1;\n &, \n &:hover { \n color: var(--pri-clr-lnk__hvr);\n text-decoration: none;\n } \n &:hover {\n opacity: .9; \n }\n ":"hover"===e?a+=b+"\n height: auto;\n width: max-content;\n padding: 3px 6px;\n position: relative;\n left: -6px;\n color: initial;\n grid-gap: 4px;\n &:hover { \n border-radius: var(--ter-rd);\n box-shadow: 1px 1px var(--pri-clr-ln);\n background-color: var(--mt-clr-bg__fc);\n text-decoration: none;\n }\n ":"whiteB"===e?a+=b+"\n color: var(--ter-clr);\n background-color: var(--cl-clr-bg);\n border: 1px solid var(--sec-clr-ln);\n &, \n &:hover { \n background-color: var(--cl-clr-bg__hvr);\n } \n ":"redB"===e?a+=b+"\n color: var(--act-clr);\n background-color: var(--act-clr-bg);\n &:hover {\n background-color: var(--act-clr-bg__hvr);\n } \n ":"greyB"===e&&(a+=b+"\n color: var(--act-clr);\n background-color: var(--mt-clr-bg__fc);\n &:hover {\n background-color: var(--cl-clr-bg__hvr);\n } \n "),t&&(a+="\n color: var(--sta-clr);\n font-weight: 400;\n ","clear"!==e&&"clearR"!==e||(a+="\n color: var(--pri-clr-lnk__act);\n font-weight: 600;\n ")),r&&(a+=`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n max-width: 100%;\n width: auto;\n ${h}\n `),n&&(a+="\n box-shadow: var(--act-shd-bx);\n "),o&&(a+="\n color: #A9A9A9;\n opacity: 0.7;\n pointer-events: none;\n "),a},x=o.default.a`
|
|
108
108
|
${w}
|
|
109
|
-
`,
|
|
109
|
+
`,k=o.default.span`
|
|
110
110
|
cursor:pointer;
|
|
111
111
|
${w}
|
|
112
112
|
`,$=r.css`
|
|
@@ -120,6 +120,72 @@
|
|
|
120
120
|
width: 55px;
|
|
121
121
|
text-align: center;
|
|
122
122
|
}
|
|
123
|
-
${({width:e,height:r,$iconLeft:
|
|
124
|
-
|
|
123
|
+
${({width:e,height:r,$iconLeft:t,$iconRight:n,$isError:o,mode:a,type:i})=>{let l="";return t&&(l+=" \n padding-left: 35px; \n "),n&&(l+=" \n padding-right: 35px; \n "),o&&(l+=" \n border:1px solid var(--err-clr-ln) !important; \n "),r&&(l+=` \n height: ${r}px\n max-height: ${r}px\n `),"search"===a&&(l+=' \n background-color: transparent;\n &, &:not([type="submit"]):focus, &:active, &:active:focus {\n border: 1px solid transparent !important;\n outline: none !important;\n box-shadow: none !important;\n }\n ',t&&(l+=" \n padding-left: 39px; \n ")),"transaction"===a&&(l+="\n padding-left: 45px;\n "),e&&(l+=` \n width: ${e}px \n `),"submit"===i&&(l+=$),l}}
|
|
124
|
+
`,j=r=>{var t,{mode:n,$isError:o,$iconLeft:i,$iconRight:l,reset:c,setReset:s,isForceUpdate:p,setForceUpdate:d,evChange:u,evBlur:v,isField:y,evChangeCustom:h,evEnter:g,evKeyUp:m}=r,b=a(r,["mode","$isError","$iconLeft","$iconRight","reset","setReset","isForceUpdate","setForceUpdate","evChange","evBlur","isField","evChangeCustom","evEnter","evKeyUp"]);const{type:w,name:x,defaultValue:k,defaultChecked:$}=b,j=null!==(t=null==k?void 0:k.toString())&&void 0!==t?t:"",[S,C]=e.useState(j),[O,R]=e.useState($||!1);e.useEffect((()=>{var e;if(p){const r=null!==(e=null==k?void 0:k.toString())&&void 0!==e?e:"";C(r),R($||!1),d&&d(!1)}c&&(C(""),R(!1),s&&s(!1))}),[p,d,c,s,k,$,R,n]);const E=e=>{const r=e.target.value;C(r)};let N=Object.assign({},b);delete N.defaultValue,delete N.defaultChecked;const F=f.jsx(_,Object.assign({mode:n,$isError:o,$iconLeft:i,$iconRight:l,checked:O,value:S,onChange:e=>{E(e),u&&u(e)},onBlur:e=>{E(e),(e=>{if(v&&v(e),y&&g&&g(e),y&&x){const r="number"===w?parseInt(e.target.value):e.target.value.trim();h&&h(x,r)}})(e)},onKeyUp:e=>{m&&m(e),(e=>{"Enter"===e.key&&(e.preventDefault(),y&&g&&g(e))})(e)}},"number"===w&&{onKeyPress:e=>("number"===w&&(isNaN(Number(e.key))||void 0===e.key||""===e.key)&&e.preventDefault(),!0)},"number"===w&&{onPaste:e=>{const r=(e.clipboardData||window.clipboardData).getData("text").replace(/[^0-9]/g,"");e.preventDefault(),document.execCommand("insertText",!1,r)}},"number"===w&&{onFocus:e=>e.target.addEventListener("wheel",(function(e){e.preventDefault()}),{passive:!1})},"number"===w&&{min:"0"},N));return F},S=r.css`
|
|
125
|
+
position: absolute;
|
|
126
|
+
opacity: 0;
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
height: 0;
|
|
129
|
+
width: 0;
|
|
130
|
+
`,C=r.css`
|
|
131
|
+
padding-right: 18px;
|
|
132
|
+
i {
|
|
133
|
+
position: absolute;
|
|
134
|
+
right: 8px;
|
|
135
|
+
top: 50%;
|
|
136
|
+
margin-top: -10px;
|
|
137
|
+
}
|
|
138
|
+
`,O=o.default.span`
|
|
139
|
+
position: absolute;
|
|
140
|
+
left: 0;
|
|
141
|
+
height: 14px;
|
|
142
|
+
width: 14px;
|
|
143
|
+
background-color: var(--cl-clr-bg);
|
|
144
|
+
border: 1px solid var(--ck-clr-ln);
|
|
145
|
+
border-radius: var(--ter-rd);
|
|
146
|
+
&:after {
|
|
147
|
+
content: "";
|
|
148
|
+
position: absolute;
|
|
149
|
+
display: none;
|
|
150
|
+
left: -1px;
|
|
151
|
+
top: -1px;
|
|
152
|
+
width: 16px;
|
|
153
|
+
height: 16px;
|
|
154
|
+
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 5c-.28 0-.53.11-.71.29L7 9.59l-2.29-2.3a1.003 1.003 0 00-1.42 1.42l3 3c.18.18.43.29.71.29s.53-.11.71-.29l5-5A1.003 1.003 0 0012 5z' fill='%23fff'/%3E%3C/svg%3E");
|
|
155
|
+
border-radius: var(--ter-rd);
|
|
156
|
+
}
|
|
157
|
+
${({$isError:e})=>{let r="";return e&&(r+=" \n border:1px solid #fc5c64; \n "),r}}
|
|
158
|
+
`,R=o.default.label`
|
|
159
|
+
grid-gap: 6px;
|
|
160
|
+
position: relative;
|
|
161
|
+
cursor: pointer;
|
|
162
|
+
user-select: none;
|
|
163
|
+
align-items: center;
|
|
164
|
+
padding-left: 24px;
|
|
165
|
+
> input {
|
|
166
|
+
${S}
|
|
167
|
+
}
|
|
168
|
+
input:checked ~ span,
|
|
169
|
+
input.checked ~ span {
|
|
170
|
+
background-color: var(--ck-clr-bg__act);
|
|
171
|
+
border: 0;
|
|
172
|
+
}
|
|
173
|
+
input:checked ~ span:after,
|
|
174
|
+
input.checked ~ span:after {
|
|
175
|
+
display: grid;
|
|
176
|
+
}
|
|
177
|
+
@media (min-width: 425px) {
|
|
178
|
+
padding-left: 24px;
|
|
179
|
+
}
|
|
180
|
+
${({$flow:e,$iconRight:r,disabled:t})=>{let n="";if(t&&(n+="\n cursor: default; \n "),"column"===e)n+="\n display: inline-grid; \n grid-auto-flow: column;\n ";else n+="\n display: grid; \n grid-auto-flow: row;\n ";return r&&(n+=C),n}}
|
|
181
|
+
`;o.default.input`
|
|
182
|
+
&:disabled {
|
|
183
|
+
cursor: default;
|
|
184
|
+
& + span {
|
|
185
|
+
background-color: var(--mt-clr-bg);
|
|
186
|
+
border-color: var(--pri-clr-ln);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
${S}
|
|
190
|
+
`;exports.CheckboxComponent=r=>{var{id:t,name:n,children:o,$flow:i,extendKey:l,extendClass:c,reset:s,setReset:p,isForceUpdate:d,setForceUpdate:u,evChange:v,$isError:y,$iconRight:h}=r,g=a(r,["id","name","children","$flow","extendKey","extendClass","reset","setReset","isForceUpdate","setForceUpdate","evChange","$isError","$iconRight"]);const{disabled:m,defaultChecked:b}=g,[w,x]=e.useState(b||!1),k=e.useRef(null);e.useEffect((()=>{d&&(x(b||!1),u&&u(!1)),s&&(x(!1),p&&p(!1))}),[s,p,d,u,b]);return delete Object.assign({},g).defaultChecked,f.jsxs(R,{$flow:i,$iconRight:h,ref:k,htmlFor:t,disabled:m||!1,children:[o,f.jsx(j,Object.assign({id:t,type:"checkbox",checked:w,name:n,evChange:e=>{x(e.target.checked),v&&v(e)}},c&&{className:c},""!==l&&{"data-key":l},g)),f.jsx(O,Object.assign({$isError:y},g["data-qa-id"]&&{"data-qa-id":g["data-qa-id"]}))]})},exports.InputComponent=j,exports.LinkComponent=e=>{var{children:r,mode:t,$activated:n=!1,href:o,$elipsis:i=!1,$shadow:l=!1,disabled:c=!1}=e,s=a(e,["children","mode","$activated","href","$elipsis","$shadow","disabled"]);const{onClick:p}=s;return o?f.jsx(x,Object.assign({className:"_refLink",mode:t,$activated:n,$elipsis:i,$shadow:l,disabled:c,href:o},s,{children:r})):f.jsx(k,Object.assign({className:"_refLink",mode:t,$activated:n,$elipsis:i,$shadow:l,disabled:c,onClick:p},s,{children:r}))},exports.TextComponent=e=>{var{children:r,$color:t,$elipsis:n=!0}=e,o=a(e,["children","$color","$elipsis"]);return f.jsx(y,Object.assign({$elipsis:!!n,$color:t},o,{children:r}))};
|
|
125
191
|
//# sourceMappingURL=index.js.map
|