chop-logic-components 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { UTFIconNames } from '../../../../../../../../src/assets/icons/utf-icons';
1
+ import { Icon } from '../../../../../../../../src/enums/icon';
2
2
  import { default as React, MouseEventHandler } from 'react';
3
3
 
4
4
  export type ChopLogicButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
@@ -6,7 +6,7 @@ export type ChopLogicButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>
6
6
  onClick?: MouseEventHandler<HTMLButtonElement> | (() => void);
7
7
  view?: 'primary' | 'secondary' | 'danger';
8
8
  disabled?: boolean;
9
- icon?: UTFIconNames;
9
+ icon?: Icon;
10
10
  };
11
11
  declare const Button: React.FC<ChopLogicButtonProps>;
12
12
  export default Button;
@@ -1,3 +1,4 @@
1
1
  export { default as ChopLogicButton } from './button/Button';
2
2
  export { default as ChopLogicTextInput } from './inputs/text/TextInput';
3
3
  export { default as ChopLogicSelect } from './inputs/select/Select';
4
+ export { default as ChopLogicCheckbox } from './inputs/checkbox/Checkbox';
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+
3
+ export type ChopLogicCheckboxProps = React.InputHTMLAttributes<HTMLInputElement> & {
4
+ id: string;
5
+ name: string;
6
+ label: string;
7
+ isLabelHidden?: boolean;
8
+ };
9
+ declare const Checkbox: React.FC<ChopLogicCheckboxProps>;
10
+ export default Checkbox;
@@ -0,0 +1,7 @@
1
+ import { default as Example } from './Example';
2
+ import { Meta, StoryObj } from '@storybook/react';
3
+
4
+ declare const meta: Meta<typeof Example>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof Example>;
7
+ export declare const Default: Story;
@@ -0,0 +1,5 @@
1
+ import { ChopLogicCheckboxProps } from '../Checkbox';
2
+ import { default as React } from 'react';
3
+
4
+ declare const Example: React.FC<ChopLogicCheckboxProps>;
5
+ export default Example;
@@ -1,3 +1,4 @@
1
+
1
2
  export type ChopLogicSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
2
3
  id: string;
3
4
  name: string;
@@ -5,6 +5,7 @@ type ChopLogicLabelProps = {
5
5
  required: boolean;
6
6
  inputId: string;
7
7
  className?: string;
8
+ isTextHidden?: boolean;
8
9
  };
9
10
  declare const ChopLogicLabel: React.FC<PropsWithChildren<ChopLogicLabelProps>>;
10
11
  export default ChopLogicLabel;
@@ -0,0 +1,47 @@
1
+ export declare enum Icon {
2
+ CheckMark = "chop-icon__check",
3
+ Home = "chop-icon__home",
4
+ Menu = "chop-icon__menu",
5
+ Enlarge = "chop-icon__enlarge2",
6
+ Shrink = "chop-icon__shrink2",
7
+ Settings = "chop-icon__cog",
8
+ Delete = "chop-icon__bin2",
9
+ Up = "chop-icon__circle-up",
10
+ Down = "chop-icon__circle-down",
11
+ Right = "chop-icon__circle-right",
12
+ Left = "chop-icon__circle-left",
13
+ Sound = "chop-icon__volume-medium",
14
+ NoSound = "chop-icon__volume-mute2",
15
+ LightMode = "chop-icon__sun",
16
+ DarkMode = "chop-icon__contrast",
17
+ Cancel = "chop-icon__close",
18
+ Sidebar = "chop-icon__magic-wand",
19
+ Telegram = "chop-icon__telegram",
20
+ Github = "chop-icon__github",
21
+ Mail = "chop-icon__mail4",
22
+ Propositions = "chop-icon__cube",
23
+ Resolution = "chop-icon__libreoffice",
24
+ Predicates = "chop-icon__cubes",
25
+ TruthTables = "chop-icon__delicious",
26
+ Syllogisms = "chop-icon__dice",
27
+ English = "chop-icon__english-lang",
28
+ Russian = "chop-icon__russian-lang",
29
+ Required = "chop-icon__fire",
30
+ Checked = "chop-icon__checkbox-checked",
31
+ Unchecked = "chop-icon__checkbox-unchecked",
32
+ Info = "chop-icon__exclamation-triangle",
33
+ LinkedIn = "chop-icon__linkedin-square",
34
+ File = "chop-icon__file-empty",
35
+ Files = "chop-icon__files-empty",
36
+ Facebook = "chop-icon__facebook2",
37
+ CaretUp = "chop-icon__caret-up",
38
+ CaretDown = "chop-icon__caret-down",
39
+ SavePDF = "chop-icon__file-pdf",
40
+ ExportXML = "chop-icon__download",
41
+ ImportXML = "chop-icon__upload",
42
+ Copy = "chop-icon__copy",
43
+ Paste = "chop-icon__paste",
44
+ Cut = "chop-icon__scissors",
45
+ Reset = "chop-icon__trash",
46
+ Clear = "chop-icon__cross"
47
+ }
@@ -0,0 +1 @@
1
+ export { Icon as ChopIcon } from './icon';
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react");var ve={exports:{}},K={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react");var _e={exports:{}},J={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Le;function gr(){if(Le)return K;Le=1;var a=N,u=Symbol.for("react.element"),o=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,d=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function b(y,v,C){var c,x={},R=null,g=null;C!==void 0&&(R=""+C),v.key!==void 0&&(R=""+v.key),v.ref!==void 0&&(g=v.ref);for(c in v)l.call(v,c)&&!m.hasOwnProperty(c)&&(x[c]=v[c]);if(y&&y.defaultProps)for(c in v=y.defaultProps,v)x[c]===void 0&&(x[c]=v[c]);return{$$typeof:u,type:y,key:R,ref:g,props:x,_owner:d.current}}return K.Fragment=o,K.jsx=b,K.jsxs=b,K}var J={};/**
9
+ */var Ye;function Er(){if(Ye)return J;Ye=1;var t=N,f=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,b={key:!0,ref:!0,__self:!0,__source:!0};function _(m,d,y){var c,R={},C=null,g=null;y!==void 0&&(C=""+y),d.key!==void 0&&(C=""+d.key),d.ref!==void 0&&(g=d.ref);for(c in d)s.call(d,c)&&!b.hasOwnProperty(c)&&(R[c]=d[c]);if(m&&m.defaultProps)for(c in d=m.defaultProps,d)R[c]===void 0&&(R[c]=d[c]);return{$$typeof:f,type:m,key:C,ref:g,props:R,_owner:l.current}}return J.Fragment=o,J.jsx=_,J.jsxs=_,J}var G={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,18 +14,18 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var We;function Er(){return We||(We=1,process.env.NODE_ENV!=="production"&&function(){var a=N,u=Symbol.for("react.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),y=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),T=Symbol.iterator,M="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=T&&e[T]||e[M];return typeof r=="function"?r:null}var S=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ee("error",e,t)}}function ee(e,r,t){{var n=S.ReactDebugCurrentFrame,f=n.getStackAddendum();f!==""&&(r+="%s",t=t.concat([f]));var p=t.map(function(s){return String(s)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var re=!1,G=!1,te=!1,Ue=!1,Be=!1,pe;pe=Symbol.for("react.module.reference");function qe(e){return!!(typeof e=="string"||typeof e=="function"||e===l||e===m||Be||e===d||e===C||e===c||Ue||e===g||re||G||te||typeof e=="object"&&e!==null&&(e.$$typeof===R||e.$$typeof===x||e.$$typeof===b||e.$$typeof===y||e.$$typeof===v||e.$$typeof===pe||e.getModuleId!==void 0))}function Ke(e,r,t){var n=e.displayName;if(n)return n;var f=r.displayName||r.name||"";return f!==""?t+"("+f+")":t}function be(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case l:return"Fragment";case o:return"Portal";case m:return"Profiler";case d:return"StrictMode";case C:return"Suspense";case c:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case y:var r=e;return be(r)+".Consumer";case b:var t=e;return be(t._context)+".Provider";case v:return Ke(e,e.render,"ForwardRef");case x:var n=e.displayName||null;return n!==null?n:P(e.type)||"Memo";case R:{var f=e,p=f._payload,s=f._init;try{return P(s(p))}catch{return null}}}return null}var F=Object.assign,U=0,_e,me,he,ye,ge,Ee,we;function xe(){}xe.__reactDisabledLog=!0;function Je(){{if(U===0){_e=console.log,me=console.info,he=console.warn,ye=console.error,ge=console.group,Ee=console.groupCollapsed,we=console.groupEnd;var e={configurable:!0,enumerable:!0,value:xe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}U++}}function Ge(){{if(U--,U===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:_e}),info:F({},e,{value:me}),warn:F({},e,{value:he}),error:F({},e,{value:ye}),group:F({},e,{value:ge}),groupCollapsed:F({},e,{value:Ee}),groupEnd:F({},e,{value:we})})}U<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ne=S.ReactCurrentDispatcher,ae;function z(e,r,t){{if(ae===void 0)try{throw Error()}catch(f){var n=f.stack.trim().match(/\n( *(at )?)/);ae=n&&n[1]||""}return`
18
- `+ae+e}}var oe=!1,X;{var ze=typeof WeakMap=="function"?WeakMap:Map;X=new ze}function Re(e,r){if(!e||oe)return"";{var t=X.get(e);if(t!==void 0)return t}var n;oe=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=ne.current,ne.current=null,Je();try{if(r){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(O){n=O}Reflect.construct(e,[],s)}else{try{s.call()}catch(O){n=O}e.call(s.prototype)}}else{try{throw Error()}catch(O){n=O}e()}}catch(O){if(O&&n&&typeof O.stack=="string"){for(var i=O.stack.split(`
19
- `),j=n.stack.split(`
20
- `),h=i.length-1,w=j.length-1;h>=1&&w>=0&&i[h]!==j[w];)w--;for(;h>=1&&w>=0;h--,w--)if(i[h]!==j[w]){if(h!==1||w!==1)do if(h--,w--,w<0||i[h]!==j[w]){var k=`
21
- `+i[h].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&X.set(e,k),k}while(h>=1&&w>=0);break}}}finally{oe=!1,ne.current=p,Ge(),Error.prepareStackTrace=f}var Y=e?e.displayName||e.name:"",A=Y?z(Y):"";return typeof e=="function"&&X.set(e,A),A}function Xe(e,r,t){return Re(e,!1)}function He(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function H(e,r,t){if(e==null)return"";if(typeof e=="function")return Re(e,He(e));if(typeof e=="string")return z(e);switch(e){case C:return z("Suspense");case c:return z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return Xe(e.render);case x:return H(e.type,r,t);case R:{var n=e,f=n._payload,p=n._init;try{return H(p(f),r,t)}catch{}}}return""}var B=Object.prototype.hasOwnProperty,Ce={},je=S.ReactDebugCurrentFrame;function Q(e){if(e){var r=e._owner,t=H(e.type,e._source,r?r.type:null);je.setExtraStackFrame(t)}else je.setExtraStackFrame(null)}function Qe(e,r,t,n,f){{var p=Function.call.bind(B);for(var s in e)if(p(e,s)){var i=void 0;try{if(typeof e[s]!="function"){var j=Error((n||"React class")+": "+t+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw j.name="Invariant Violation",j}i=e[s](r,s,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(h){i=h}i&&!(i instanceof Error)&&(Q(f),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,s,typeof i),Q(null)),i instanceof Error&&!(i.message in Ce)&&(Ce[i.message]=!0,Q(f),E("Failed %s type: %s",t,i.message),Q(null))}}}var Ze=Array.isArray;function ie(e){return Ze(e)}function er(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function rr(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function Oe(e){if(rr(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",er(e)),Te(e)}var q=S.ReactCurrentOwner,tr={key:!0,ref:!0,__self:!0,__source:!0},Se,ke,se;se={};function nr(e){if(B.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ar(e){if(B.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function or(e,r){if(typeof e.ref=="string"&&q.current&&r&&q.current.stateNode!==r){var t=P(q.current.type);se[t]||(E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',P(q.current.type),e.ref),se[t]=!0)}}function ir(e,r){{var t=function(){Se||(Se=!0,E("%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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function sr(e,r){{var t=function(){ke||(ke=!0,E("%s: `ref` 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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var cr=function(e,r,t,n,f,p,s){var i={$$typeof:u,type:e,key:r,ref:t,props:s,_owner:p};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function lr(e,r,t,n,f){{var p,s={},i=null,j=null;t!==void 0&&(Oe(t),i=""+t),ar(r)&&(Oe(r.key),i=""+r.key),nr(r)&&(j=r.ref,or(r,f));for(p in r)B.call(r,p)&&!tr.hasOwnProperty(p)&&(s[p]=r[p]);if(e&&e.defaultProps){var h=e.defaultProps;for(p in h)s[p]===void 0&&(s[p]=h[p])}if(i||j){var w=typeof e=="function"?e.displayName||e.name||"Unknown":e;i&&ir(s,w),j&&sr(s,w)}return cr(e,i,j,f,n,q.current,s)}}var ce=S.ReactCurrentOwner,Pe=S.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,t=H(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var le;le=!1;function ue(e){return typeof e=="object"&&e!==null&&e.$$typeof===u}function De(){{if(ce.current){var e=P(ce.current.type);if(e)return`
17
+ */var Ue;function xr(){return Ue||(Ue=1,process.env.NODE_ENV!=="production"&&function(){var t=N,f=Symbol.for("react.element"),o=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),m=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),k=Symbol.iterator,$="@@iterator";function Y(e){if(e===null||typeof e!="object")return null;var r=k&&e[k]||e[$];return typeof r=="function"?r:null}var T=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];re("error",e,n)}}function re(e,r,n){{var a=T.ReactDebugCurrentFrame,p=a.getStackAddendum();p!==""&&(r+="%s",n=n.concat([p]));var v=n.map(function(u){return String(u)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var te=!1,X=!1,ne=!1,qe=!1,Ke=!1,he;he=Symbol.for("react.module.reference");function Ie(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===b||Ke||e===l||e===y||e===c||qe||e===g||te||X||ne||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===R||e.$$typeof===_||e.$$typeof===m||e.$$typeof===d||e.$$typeof===he||e.getModuleId!==void 0))}function Je(e,r,n){var a=e.displayName;if(a)return a;var p=r.displayName||r.name||"";return p!==""?n+"("+p+")":n}function be(e){return e.displayName||"Context"}function D(e){if(e==null)return null;if(typeof e.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case s:return"Fragment";case o:return"Portal";case b:return"Profiler";case l:return"StrictMode";case y:return"Suspense";case c:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case m:var r=e;return be(r)+".Consumer";case _:var n=e;return be(n._context)+".Provider";case d:return Je(e,e.render,"ForwardRef");case R:var a=e.displayName||null;return a!==null?a:D(e.type)||"Memo";case C:{var p=e,v=p._payload,u=p._init;try{return D(u(v))}catch{return null}}}return null}var A=Object.assign,q=0,me,ge,ye,Ee,xe,we,Re;function Ce(){}Ce.__reactDisabledLog=!0;function Ge(){{if(q===0){me=console.log,ge=console.info,ye=console.warn,Ee=console.error,xe=console.group,we=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ce,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}q++}}function Xe(){{if(q--,q===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:me}),info:A({},e,{value:ge}),warn:A({},e,{value:ye}),error:A({},e,{value:Ee}),group:A({},e,{value:xe}),groupCollapsed:A({},e,{value:we}),groupEnd:A({},e,{value:Re})})}q<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ae=T.ReactCurrentDispatcher,oe;function z(e,r,n){{if(oe===void 0)try{throw Error()}catch(p){var a=p.stack.trim().match(/\n( *(at )?)/);oe=a&&a[1]||""}return`
18
+ `+oe+e}}var ie=!1,H;{var ze=typeof WeakMap=="function"?WeakMap:Map;H=new ze}function ke(e,r){if(!e||ie)return"";{var n=H.get(e);if(n!==void 0)return n}var a;ie=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=ae.current,ae.current=null,Ge();try{if(r){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(S){a=S}Reflect.construct(e,[],u)}else{try{u.call()}catch(S){a=S}e.call(u.prototype)}}else{try{throw Error()}catch(S){a=S}e()}}catch(S){if(S&&a&&typeof S.stack=="string"){for(var i=S.stack.split(`
19
+ `),j=a.stack.split(`
20
+ `),E=i.length-1,w=j.length-1;E>=1&&w>=0&&i[E]!==j[w];)w--;for(;E>=1&&w>=0;E--,w--)if(i[E]!==j[w]){if(E!==1||w!==1)do if(E--,w--,w<0||i[E]!==j[w]){var O=`
21
+ `+i[E].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,O),O}while(E>=1&&w>=0);break}}}finally{ie=!1,ae.current=v,Xe(),Error.prepareStackTrace=p}var V=e?e.displayName||e.name:"",L=V?z(V):"";return typeof e=="function"&&H.set(e,L),L}function He(e,r,n){return ke(e,!1)}function Ze(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Z(e,r,n){if(e==null)return"";if(typeof e=="function")return ke(e,Ze(e));if(typeof e=="string")return z(e);switch(e){case y:return z("Suspense");case c:return z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return He(e.render);case R:return Z(e.type,r,n);case C:{var a=e,p=a._payload,v=a._init;try{return Z(v(p),r,n)}catch{}}}return""}var K=Object.prototype.hasOwnProperty,je={},Se=T.ReactDebugCurrentFrame;function Q(e){if(e){var r=e._owner,n=Z(e.type,e._source,r?r.type:null);Se.setExtraStackFrame(n)}else Se.setExtraStackFrame(null)}function Qe(e,r,n,a,p){{var v=Function.call.bind(K);for(var u in e)if(v(e,u)){var i=void 0;try{if(typeof e[u]!="function"){var j=Error((a||"React class")+": "+n+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw j.name="Invariant Violation",j}i=e[u](r,u,a,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){i=E}i&&!(i instanceof Error)&&(Q(p),x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",a||"React class",n,u,typeof i),Q(null)),i instanceof Error&&!(i.message in je)&&(je[i.message]=!0,Q(p),x("Failed %s type: %s",n,i.message),Q(null))}}}var er=Array.isArray;function se(e){return er(e)}function rr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function tr(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function Oe(e){if(tr(e))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",rr(e)),Te(e)}var I=T.ReactCurrentOwner,nr={key:!0,ref:!0,__self:!0,__source:!0},Pe,De,ce;ce={};function ar(e){if(K.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function or(e){if(K.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function ir(e,r){if(typeof e.ref=="string"&&I.current&&r&&I.current.stateNode!==r){var n=D(I.current.type);ce[n]||(x('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',D(I.current.type),e.ref),ce[n]=!0)}}function sr(e,r){{var n=function(){Pe||(Pe=!0,x("%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://reactjs.org/link/special-props)",r))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function cr(e,r){{var n=function(){De||(De=!0,x("%s: `ref` 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://reactjs.org/link/special-props)",r))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var lr=function(e,r,n,a,p,v,u){var i={$$typeof:f,type:e,key:r,ref:n,props:u,_owner:v};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function ur(e,r,n,a,p){{var v,u={},i=null,j=null;n!==void 0&&(Oe(n),i=""+n),or(r)&&(Oe(r.key),i=""+r.key),ar(r)&&(j=r.ref,ir(r,p));for(v in r)K.call(r,v)&&!nr.hasOwnProperty(v)&&(u[v]=r[v]);if(e&&e.defaultProps){var E=e.defaultProps;for(v in E)u[v]===void 0&&(u[v]=E[v])}if(i||j){var w=typeof e=="function"?e.displayName||e.name||"Unknown":e;i&&sr(u,w),j&&cr(u,w)}return lr(e,i,j,p,a,I.current,u)}}var le=T.ReactCurrentOwner,Fe=T.ReactDebugCurrentFrame;function U(e){if(e){var r=e._owner,n=Z(e.type,e._source,r?r.type:null);Fe.setExtraStackFrame(n)}else Fe.setExtraStackFrame(null)}var ue;ue=!1;function fe(e){return typeof e=="object"&&e!==null&&e.$$typeof===f}function Ne(){{if(le.current){var e=D(le.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function ur(e){return""}var Ie={};function fr(e){{var r=De();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
23
+ Check the render method of \``+e+"`."}return""}}function fr(e){return""}var $e={};function dr(e){{var r=Ne();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
24
24
 
25
- Check the top-level render call using <`+t+">.")}return r}}function Fe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=fr(r);if(Ie[t])return;Ie[t]=!0;var n="";e&&e._owner&&e._owner!==ce.current&&(n=" It was passed a child from "+P(e._owner.type)+"."),W(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),W(null)}}function Ae(e,r){{if(typeof e!="object")return;if(ie(e))for(var t=0;t<e.length;t++){var n=e[t];ue(n)&&Fe(n,r)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var f=L(e);if(typeof f=="function"&&f!==e.entries)for(var p=f.call(e),s;!(s=p.next()).done;)ue(s.value)&&Fe(s.value,r)}}}function dr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===v||r.$$typeof===x))t=r.propTypes;else return;if(t){var n=P(r);Qe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!le){le=!0;var f=P(r);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",f||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){W(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),W(null);break}}e.ref!==null&&(W(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}var $e={};function Ne(e,r,t,n,f,p){{var s=qe(e);if(!s){var i="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var j=ur();j?i+=j:i+=De();var h;e===null?h="null":ie(e)?h="array":e!==void 0&&e.$$typeof===u?(h="<"+(P(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):h=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",h,i)}var w=lr(e,r,t,f,p);if(w==null)return w;if(s){var k=r.children;if(k!==void 0)if(n)if(ie(k)){for(var Y=0;Y<k.length;Y++)Ae(k[Y],e);Object.freeze&&Object.freeze(k)}else E("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 Ae(k,e)}if(B.call(r,"key")){var A=P(e),O=Object.keys(r).filter(function(yr){return yr!=="key"}),fe=O.length>0?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}";if(!$e[A+fe]){var hr=O.length>0?"{"+O.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+n+">.")}return r}}function Ae(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=dr(r);if($e[n])return;$e[n]=!0;var a="";e&&e._owner&&e._owner!==le.current&&(a=" It was passed a child from "+D(e._owner.type)+"."),U(e),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,a),U(null)}}function Le(e,r){{if(typeof e!="object")return;if(se(e))for(var n=0;n<e.length;n++){var a=e[n];fe(a)&&Ae(a,r)}else if(fe(e))e._store&&(e._store.validated=!0);else if(e){var p=Y(e);if(typeof p=="function"&&p!==e.entries)for(var v=p.call(e),u;!(u=v.next()).done;)fe(u.value)&&Ae(u.value,r)}}}function pr(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===d||r.$$typeof===R))n=r.propTypes;else return;if(n){var a=D(r);Qe(n,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!ue){ue=!0;var p=D(r);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _r(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var a=r[n];if(a!=="children"&&a!=="key"){U(e),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),U(null);break}}e.ref!==null&&(U(e),x("Invalid attribute `ref` supplied to `React.Fragment`."),U(null))}}var Me={};function We(e,r,n,a,p,v){{var u=Ie(e);if(!u){var i="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var j=fr();j?i+=j:i+=Ne();var E;e===null?E="null":se(e)?E="array":e!==void 0&&e.$$typeof===f?(E="<"+(D(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,i)}var w=ur(e,r,n,p,v);if(w==null)return w;if(u){var O=r.children;if(O!==void 0)if(a)if(se(O)){for(var V=0;V<O.length;V++)Le(O[V],e);Object.freeze&&Object.freeze(O)}else x("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 Le(O,e)}if(K.call(r,"key")){var L=D(e),S=Object.keys(r).filter(function(yr){return yr!=="key"}),de=S.length>0?"{key: someKey, "+S.join(": ..., ")+": ...}":"{key: someKey}";if(!Me[L+de]){var gr=S.length>0?"{"+S.join(": ..., ")+": ...}":"{}";x(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,fe,A,hr,A),$e[A+fe]=!0}}return e===l?vr(w):dr(w),w}}function pr(e,r,t){return Ne(e,r,t,!0)}function br(e,r,t){return Ne(e,r,t,!1)}var _r=br,mr=pr;J.Fragment=l,J.jsx=_r,J.jsxs=mr}()),J}process.env.NODE_ENV==="production"?ve.exports=gr():ve.exports=Er();var _=ve.exports;const wr="_button_rrb70_1",xr="_text_rrb70_21",Rr="_primary_rrb70_26",Cr="_danger_rrb70_27",jr="_secondary_rrb70_50",Tr="_disabled_rrb70_66",V={button:wr,text:xr,primary:Rr,danger:Cr,secondary:jr,disabled:Tr};function I(a){return a.map(o=>{if(typeof o=="string")return o.trim();if(typeof o=="object"){const l=[];for(const d in o)o[d]&&l.push(d.trim());return l.join(" ")}}).filter(o=>!!o).join(" ")}const Z={CheckMark:"✓",Ballot:"✗",ClockwiseTop:"↷",ClockwiseOpen:"↻",Pencil:"✎",Rightwards:"⇨",Leftwards:"⇦",Upwards:"⇧",Downwards:"⇩",Copyright:"©",Warning:"⚠",Question:"�",Envelope:"✉",Hart:"♥",Scissors:"✂",Star:"★"},Or=({disabled:a,onClick:u,text:o="Ok",type:l="button",view:d="primary",icon:m,...b})=>{const y=I([V.button,b==null?void 0:b.className,{[V.primary]:d==="primary",[V.secondary]:d==="secondary",[V.danger]:d==="danger",[V.disabled]:!!a}]);return _.jsxs("button",{type:l,className:y,onClick:a?void 0:u,disabled:a,...b,children:[m&&_.jsx("span",{children:`${Z[m]}`}),_.jsx("span",{className:V.text,children:o})]})},Sr="_container_b5mrn_1",kr="_wrapper_b5mrn_7",Pr="_input_b5mrn_21",Dr="_invalid_b5mrn_27",Ir="_error_b5mrn_47",Fr="_disabled_b5mrn_51",$={container:Sr,wrapper:kr,input:Pr,invalid:Dr,error:Ir,disabled:Fr},Ar="_label_195p3_1",$r="_required_195p3_10",Ye={label:Ar,required:$r},Me=({label:a,required:u,inputId:o,className:l})=>_.jsxs("label",{htmlFor:o,className:I([Ye.label,l]),children:[a,u&&_.jsx("abbr",{title:"required",className:Ye.required,children:"*"})]}),Nr="_message_1ly5l_1",Lr="_visible_1ly5l_8",Ve={message:Nr,visible:Lr},Wr=({errorId:a,message:u="Invalid input",className:o,visible:l=!1})=>_.jsx("span",{id:a,className:I([Ve.message,o,{[Ve.visible]:l}]),children:u}),Yr=({id:a,name:u,label:o,disabled:l,placeholder:d="Type here...",valid:m=!0,required:b=!1,errorMessage:y,defaultValue:v,onChange:C,...c})=>{const[x,R]=N.useState(typeof v=="string"?v:""),g=`${a}_error`,T=I([$.container,c==null?void 0:c.className]),M=I([$.wrapper,{[$.disabled]:!!l,[$.invalid]:!m}]),L=S=>{const{value:E=""}=S.target;R(E),C&&C(S)};return _.jsxs("div",{className:T,children:[_.jsxs("div",{className:M,children:[_.jsx(Me,{label:o,required:b,inputId:a,className:$.label}),_.jsx("input",{id:a,name:u,type:"text",className:$.input,disabled:l,placeholder:d,required:b,"aria-invalid":!m,"aria-errormessage":g,value:x,onChange:L,...c})]}),_.jsx(Wr,{errorId:g,message:y,className:$.error,visible:!m})]})},Vr="_wrapper_w3i6b_1",Mr="_combobox_w3i6b_17",Ur="_combobox_label_w3i6b_41",Br="_dropdown_w3i6b_46",qr="_dropdown_opened_w3i6b_67",Kr="_option_w3i6b_72",Jr="_active_w3i6b_80",Gr="_disabled_w3i6b_89",D={wrapper:Vr,combobox:Mr,combobox_label:Ur,dropdown:Br,dropdown_opened:qr,option:Kr,active:Jr,disabled:Gr},zr=({ref:a,onClickOutsideHandler:u,dependentRef:o})=>{N.useEffect(()=>{const l=d=>{const m=(a==null?void 0:a.current)&&!a.current.contains(d.target),b=o!=null&&o.current?!o.current.contains(d.target):!0;m&&b&&u()};return document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l)}},[a,o,u])},Xr=({isOpened:a,onClick:u,comboboxId:o,dropdownId:l,selected:d,name:m,placeholder:b,disabled:y,required:v})=>_.jsxs("button",{type:"button",name:m,value:d==null?void 0:d.id,role:"combobox","aria-haspopup":"listbox","aria-label":"Select one of the options","aria-expanded":a,"aria-controls":l,id:o,className:D.combobox,onClick:u,disabled:y,"aria-required":v,children:[_.jsx("span",{className:D.combobox_label,children:(d==null?void 0:d.label)??b}),_.jsx("span",{children:a?Z.Upwards:Z.Downwards})]});function de(a){const u=document.getElementById(a);u&&u.focus()}const Hr=({value:a,isSelected:u,onSelect:o})=>{const{id:l,label:d}=a,m=I([D.option]),b=y=>v=>{switch(v.key){case" ":case"SpaceBar":case"Enter":v.preventDefault(),o(y);break}};return _.jsxs("li",{id:l,role:"option",className:m,"aria-selected":u,tabIndex:0,onKeyDown:b(l),onClick:()=>o(l),children:[_.jsx("span",{children:d}),u&&_.jsx("span",{children:Z.CheckMark})]})},Qr=({values:a,isOpened:u,onClose:o,onSelect:l,dropdownId:d,comboboxId:m,selected:b})=>{const y=I([D.dropdown,{[D.dropdown_opened]:u}]),v=c=>{l(c),o(),de(m)},C=c=>{let x="";a.forEach(g=>{document.getElementById(g.id)===document.activeElement&&(x=g.id)});const R=a.findIndex(g=>g.id===x);switch(c.key){case"Escape":c.preventDefault(),o();break;case"ArrowUp":{c.preventDefault();const g=R-1>=0?R-1:a.length-1,T=a[g];T&&de(T.id);break}case"ArrowDown":case"Tab":{c.preventDefault();const g=R===a.length-1?0:R+1,T=a[g];T&&de(T.id);break}}};return _.jsx("ul",{className:y,role:"listbox",id:d,tabIndex:-1,onKeyDown:C,children:a.map(c=>_.jsx(Hr,{value:c,onSelect:()=>v(c.id),isSelected:c.id===(b==null?void 0:b.id)},c.id))})},Zr=({id:a,values:u,onSelect:o,name:l,label:d,required:m=!1,placeholder:b="Not selected",disabled:y=!1,...v})=>{const[C,c]=N.useState(!1),[x,R]=N.useState(),g=`${a}_combobox`,T=`${a}_dropdown`,M=I([D.wrapper,v==null?void 0:v.className,{[D.disabled]:y}]),L=N.useRef(null),S=()=>c(!1),E=()=>c(!C),ee=re=>{const G=u.find(te=>te.id===re);R(G),o==null||o(G)};return zr({ref:L,onClickOutsideHandler:S}),_.jsxs("div",{className:M,ref:L,children:[_.jsx(Me,{label:d,required:m,inputId:g,className:D.label}),_.jsx(Xr,{name:l,isOpened:C,comboboxId:g,dropdownId:T,onClick:E,selected:x,placeholder:b,disabled:y,required:m}),_.jsx(Qr,{values:u,selected:x,isOpened:C,onClose:S,dropdownId:T,comboboxId:g,onSelect:ee})]})};exports.ChopLogicButton=Or;exports.ChopLogicSelect=Zr;exports.ChopLogicTextInput=Yr;
30
+ <%s key={someKey} {...props} />`,de,L,gr,L),Me[L+de]=!0}}return e===s?_r(w):pr(w),w}}function vr(e,r,n){return We(e,r,n,!0)}function hr(e,r,n){return We(e,r,n,!1)}var br=hr,mr=vr;G.Fragment=s,G.jsx=br,G.jsxs=mr}()),G}process.env.NODE_ENV==="production"?_e.exports=Er():_e.exports=xr();var h=_e.exports;const wr="_button_rrb70_1",Rr="_text_rrb70_21",Cr="_primary_rrb70_26",kr="_danger_rrb70_27",jr="_secondary_rrb70_50",Sr="_disabled_rrb70_66",B={button:wr,text:Rr,primary:Cr,danger:kr,secondary:jr,disabled:Sr};function P(t){return t.map(o=>{if(typeof o=="string")return o.trim();if(typeof o=="object"){const s=[];for(const l in o)o[l]&&s.push(l.trim());return s.join(" ")}}).filter(o=>!!o).join(" ")}const Tr=({disabled:t,onClick:f,text:o="Ok",type:s="button",view:l="primary",icon:b,..._})=>{const m=P([B.button,_==null?void 0:_.className,{[B.primary]:l==="primary",[B.secondary]:l==="secondary",[B.danger]:l==="danger",[B.disabled]:!!t}]);return h.jsxs("button",{type:s,className:m,onClick:t?void 0:f,disabled:t,..._,children:[b&&h.jsx("span",{className:b,"aria-hidden":"true"}),h.jsx("span",{className:B.text,children:o})]})},Or="_container_b5mrn_1",Pr="_wrapper_b5mrn_7",Dr="_input_b5mrn_21",Fr="_invalid_b5mrn_27",Nr="_error_b5mrn_47",$r="_disabled_b5mrn_51",M={container:Or,wrapper:Pr,input:Dr,invalid:Fr,error:Nr,disabled:$r},Ar="_label_195p3_1",Lr="_required_195p3_10",Ve={label:Ar,required:Lr},ve=({label:t,required:f,inputId:o,className:s,isTextHidden:l=!1})=>h.jsxs("label",{htmlFor:o,className:P([Ve.label,s]),children:[!l&&h.jsx("span",{children:t}),f&&h.jsx("abbr",{title:"required",className:Ve.required,children:"*"})]}),Mr="_message_1ly5l_1",Wr="_visible_1ly5l_8",Be={message:Mr,visible:Wr},Yr=({errorId:t,message:f="Invalid input",className:o,visible:s=!1})=>h.jsx("span",{id:t,className:P([Be.message,o,{[Be.visible]:s}]),children:f}),Ur=({id:t,name:f,label:o,disabled:s,placeholder:l="Type here...",valid:b=!0,required:_=!1,errorMessage:m,defaultValue:d,onChange:y,...c})=>{const[R,C]=N.useState(typeof d=="string"?d:""),g=`${t}_error`,k=P([M.container,c==null?void 0:c.className]),$=P([M.wrapper,{[M.disabled]:!!s,[M.invalid]:!b}]),Y=T=>{const{value:x=""}=T.target;C(x),y&&y(T)};return h.jsxs("div",{className:k,children:[h.jsxs("div",{className:$,children:[h.jsx(ve,{label:o,required:_,inputId:t,className:M.label}),h.jsx("input",{id:t,name:f,type:"text",className:M.input,disabled:s,placeholder:l,required:_,"aria-invalid":!b,"aria-errormessage":g,value:R,onChange:Y,...c})]}),h.jsx(Yr,{errorId:g,message:m,className:M.error,visible:!b})]})},Vr="_wrapper_gevmw_1",Br="_combobox_gevmw_17",qr="_combobox_label_gevmw_42",Kr="_dropdown_gevmw_47",Ir="_dropdown_opened_gevmw_68",Jr="_option_gevmw_73",Gr="_active_gevmw_82",Xr="_disabled_gevmw_91",zr="_icon_gevmw_97",F={wrapper:Vr,combobox:Br,combobox_label:qr,dropdown:Kr,dropdown_opened:Ir,option:Jr,active:Gr,disabled:Xr,icon:zr},Hr=({ref:t,onClickOutsideHandler:f,dependentRef:o})=>{N.useEffect(()=>{const s=l=>{const b=(t==null?void 0:t.current)&&!t.current.contains(l.target),_=o!=null&&o.current?!o.current.contains(l.target):!0;b&&_&&f()};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[t,o,f])};var W=(t=>(t.CheckMark="chop-icon__check",t.Home="chop-icon__home",t.Menu="chop-icon__menu",t.Enlarge="chop-icon__enlarge2",t.Shrink="chop-icon__shrink2",t.Settings="chop-icon__cog",t.Delete="chop-icon__bin2",t.Up="chop-icon__circle-up",t.Down="chop-icon__circle-down",t.Right="chop-icon__circle-right",t.Left="chop-icon__circle-left",t.Sound="chop-icon__volume-medium",t.NoSound="chop-icon__volume-mute2",t.LightMode="chop-icon__sun",t.DarkMode="chop-icon__contrast",t.Cancel="chop-icon__close",t.Sidebar="chop-icon__magic-wand",t.Telegram="chop-icon__telegram",t.Github="chop-icon__github",t.Mail="chop-icon__mail4",t.Propositions="chop-icon__cube",t.Resolution="chop-icon__libreoffice",t.Predicates="chop-icon__cubes",t.TruthTables="chop-icon__delicious",t.Syllogisms="chop-icon__dice",t.English="chop-icon__english-lang",t.Russian="chop-icon__russian-lang",t.Required="chop-icon__fire",t.Checked="chop-icon__checkbox-checked",t.Unchecked="chop-icon__checkbox-unchecked",t.Info="chop-icon__exclamation-triangle",t.LinkedIn="chop-icon__linkedin-square",t.File="chop-icon__file-empty",t.Files="chop-icon__files-empty",t.Facebook="chop-icon__facebook2",t.CaretUp="chop-icon__caret-up",t.CaretDown="chop-icon__caret-down",t.SavePDF="chop-icon__file-pdf",t.ExportXML="chop-icon__download",t.ImportXML="chop-icon__upload",t.Copy="chop-icon__copy",t.Paste="chop-icon__paste",t.Cut="chop-icon__scissors",t.Reset="chop-icon__trash",t.Clear="chop-icon__cross",t))(W||{});const Zr=({isOpened:t,onClick:f,comboboxId:o,dropdownId:s,selected:l,name:b,placeholder:_,disabled:m,required:d})=>{const y=P([F.icon,{[W.CaretUp]:t,[W.CaretDown]:!t}]);return h.jsxs("button",{type:"button",name:b,value:l==null?void 0:l.id,role:"combobox","aria-haspopup":"listbox","aria-label":"Select one of the options","aria-expanded":t,"aria-controls":s,id:o,className:F.combobox,onClick:f,disabled:m,"aria-required":d,children:[h.jsx("span",{className:F.combobox_label,children:(l==null?void 0:l.label)??_}),h.jsx("span",{className:y,"aria-hidden":"true"})]})};function pe(t){const f=document.getElementById(t);f&&f.focus()}const Qr=({value:t,isSelected:f,onSelect:o})=>{const{id:s,label:l}=t,b=P([F.icon,W.CheckMark]),_=m=>d=>{switch(d.key){case" ":case"SpaceBar":case"Enter":d.preventDefault(),o(m);break}};return h.jsxs("li",{id:s,role:"option",className:F.option,"aria-selected":f,tabIndex:0,onKeyDown:_(s),onClick:()=>o(s),children:[h.jsx("span",{children:l}),f&&h.jsx("span",{className:b,"aria-hidden":"true"})]})},et=({values:t,isOpened:f,onClose:o,onSelect:s,dropdownId:l,comboboxId:b,selected:_})=>{const m=P([F.dropdown,{[F.dropdown_opened]:f}]),d=c=>{s(c),o(),pe(b)},y=c=>{let R="";t.forEach(g=>{document.getElementById(g.id)===document.activeElement&&(R=g.id)});const C=t.findIndex(g=>g.id===R);switch(c.key){case"Escape":c.preventDefault(),o();break;case"ArrowUp":{c.preventDefault();const g=C-1>=0?C-1:t.length-1,k=t[g];k&&pe(k.id);break}case"ArrowDown":case"Tab":{c.preventDefault();const g=C===t.length-1?0:C+1,k=t[g];k&&pe(k.id);break}}};return h.jsx("ul",{className:m,role:"listbox",id:l,tabIndex:-1,onKeyDown:y,children:t.map(c=>h.jsx(Qr,{value:c,onSelect:()=>d(c.id),isSelected:c.id===(_==null?void 0:_.id)},c.id))})},rt=({id:t,values:f,onSelect:o,name:s,label:l,required:b=!1,placeholder:_="Not selected",disabled:m=!1,...d})=>{const[y,c]=N.useState(!1),[R,C]=N.useState(),g=`${t}_combobox`,k=`${t}_dropdown`,$=P([F.wrapper,d==null?void 0:d.className,{[F.disabled]:m}]),Y=N.useRef(null),T=()=>c(!1),x=()=>c(!y),re=te=>{const X=f.find(ne=>ne.id===te);C(X),o==null||o(X)};return Hr({ref:Y,onClickOutsideHandler:T}),h.jsxs("div",{className:$,ref:Y,children:[h.jsx(ve,{label:l,required:b,inputId:g,className:F.label}),h.jsx(Zr,{name:s,isOpened:y,comboboxId:g,dropdownId:k,onClick:x,selected:R,placeholder:_,disabled:m,required:b}),h.jsx(et,{values:f,selected:R,isOpened:y,onClose:T,dropdownId:k,comboboxId:g,onSelect:re})]})},tt="_wrapper_1ab48_1",nt="_input_1ab48_9",at="_label_1ab48_23",ot="_disabled_1ab48_38",ee={wrapper:tt,input:nt,label:at,disabled:ot},it=({id:t,name:f,label:o,disabled:s,required:l=!1,onChange:b,isLabelHidden:_,className:m,...d})=>{const[y,c]=N.useState(!1),R=P([ee.wrapper,m,{[ee.disabled]:!!s}]),C=P([ee.label,{[W.Checked]:y,[W.Unchecked]:!y}]),g=k=>{if(s)return;const $=k.target.checked;c($),b&&b(k)};return h.jsxs("div",{className:R,children:[h.jsx("input",{id:t,name:f,type:"checkbox",className:ee.input,disabled:s,required:l,checked:y,onChange:g,"aria-label":_?o:void 0,...d}),h.jsx(ve,{label:o,required:l,inputId:t,className:C,isTextHidden:_})]})};exports.ChopIcon=W;exports.ChopLogicButton=Tr;exports.ChopLogicCheckbox=it;exports.ChopLogicSelect=rt;exports.ChopLogicTextInput=Ur;
31
31
  //# sourceMappingURL=index.cjs.js.map