chop-logic-components 0.1.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.
Files changed (28) hide show
  1. package/dist/components/button/Button.d.ts +2 -2
  2. package/dist/components/index.d.ts +2 -0
  3. package/dist/components/inputs/checkbox/Checkbox.d.ts +10 -0
  4. package/dist/components/inputs/checkbox/__docs__/Checkbox.stories.d.ts +7 -0
  5. package/dist/components/inputs/checkbox/__docs__/Example.d.ts +5 -0
  6. package/dist/components/inputs/checkbox/__tests__/Checkbox.test.d.ts +1 -0
  7. package/dist/components/inputs/select/Select.d.ts +15 -0
  8. package/dist/components/inputs/select/__docs__/Example.d.ts +5 -0
  9. package/dist/components/inputs/select/__docs__/Select.stories.d.ts +7 -0
  10. package/dist/components/inputs/select/__tests__/Select.test.d.ts +1 -0
  11. package/dist/components/inputs/select/elements/Combobox.d.ts +15 -0
  12. package/dist/components/inputs/select/elements/Dropdown.d.ts +13 -0
  13. package/dist/components/inputs/select/elements/Option.d.ts +9 -0
  14. package/dist/components/{inputs → misc}/label/Label.d.ts +1 -0
  15. package/dist/enums/icon.d.ts +47 -0
  16. package/dist/enums/index.d.ts +1 -0
  17. package/dist/index.cjs.js +10 -10
  18. package/dist/index.cjs.js.map +1 -1
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.es.js +601 -409
  21. package/dist/index.es.js.map +1 -1
  22. package/dist/style.css +1 -1
  23. package/dist/utils/__tests__/use-click-outside.test.d.ts +1 -0
  24. package/dist/utils/move-focus-on-element-by-id.d.ts +1 -0
  25. package/dist/utils/use-click-outside.d.ts +12 -0
  26. package/package.json +12 -11
  27. package/dist/assets/icons/utf-icons.d.ts +0 -20
  28. /package/dist/components/{inputs → misc}/error-message/ErrorMessage.d.ts +0 -0
@@ -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,2 +1,4 @@
1
1
  export { default as ChopLogicButton } from './button/Button';
2
2
  export { default as ChopLogicTextInput } from './inputs/text/TextInput';
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;
@@ -0,0 +1,15 @@
1
+
2
+ export type ChopLogicSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
3
+ id: string;
4
+ name: string;
5
+ label: string;
6
+ values: SelectValue[];
7
+ onSelect?: (value?: SelectValue) => void;
8
+ placeholder?: string;
9
+ };
10
+ export type SelectValue = {
11
+ id: string;
12
+ label: string;
13
+ };
14
+ declare const ChopLogicSelect: React.FC<ChopLogicSelectProps>;
15
+ export default ChopLogicSelect;
@@ -0,0 +1,5 @@
1
+ import { ChopLogicSelectProps } from '../Select';
2
+ import { default as React } from 'react';
3
+
4
+ declare const Example: React.FC<ChopLogicSelectProps>;
5
+ export default Example;
@@ -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,15 @@
1
+ import { SelectValue } from '../Select';
2
+
3
+ type SelectComboboxProps = {
4
+ isOpened: boolean;
5
+ disabled: boolean;
6
+ required: boolean;
7
+ onClick: () => void;
8
+ comboboxId: string;
9
+ dropdownId: string;
10
+ selected?: SelectValue;
11
+ placeholder?: string;
12
+ name: string;
13
+ };
14
+ declare const SelectCombobox: React.FC<SelectComboboxProps>;
15
+ export default SelectCombobox;
@@ -0,0 +1,13 @@
1
+ import { SelectValue } from '../Select';
2
+
3
+ type SelectDropdownProps = {
4
+ values: SelectValue[];
5
+ isOpened: boolean;
6
+ dropdownId: string;
7
+ comboboxId: string;
8
+ onClose: () => void;
9
+ selected?: SelectValue;
10
+ onSelect: (id: string) => void;
11
+ };
12
+ declare const SelectDropdown: React.FC<SelectDropdownProps>;
13
+ export default SelectDropdown;
@@ -0,0 +1,9 @@
1
+ import { SelectValue } from '../Select';
2
+
3
+ type SelectOptionProps = {
4
+ value: SelectValue;
5
+ isSelected: boolean;
6
+ onSelect: (id: string) => void;
7
+ };
8
+ declare const SelectOption: React.FC<SelectOptionProps>;
9
+ export default SelectOption;
@@ -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 oe=require("react");var ie={exports:{}},Y={};/**
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 ke;function br(){if(ke)return Y;ke=1;var _=oe,g=Symbol.for("react.element"),c=Symbol.for("react.fragment"),f=Object.prototype.hasOwnProperty,h=_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,R={key:!0,ref:!0,__self:!0,__source:!0};function m(T,d,O){var v,C={},S=null,P=null;O!==void 0&&(S=""+O),d.key!==void 0&&(S=""+d.key),d.ref!==void 0&&(P=d.ref);for(v in d)f.call(d,v)&&!R.hasOwnProperty(v)&&(C[v]=d[v]);if(T&&T.defaultProps)for(v in d=T.defaultProps,d)C[v]===void 0&&(C[v]=d[v]);return{$$typeof:g,type:T,key:S,ref:P,props:C,_owner:h.current}}return Y.Fragment=c,Y.jsx=m,Y.jsxs=m,Y}var q={};/**
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 De;function gr(){return De||(De=1,process.env.NODE_ENV!=="production"&&function(){var _=oe,g=Symbol.for("react.element"),c=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),T=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),U=Symbol.iterator,G="@@iterator";function z(e){if(e===null||typeof e!="object")return null;var r=U&&e[U]||e[G];return typeof r=="function"?r:null}var x=_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ie("error",e,t)}}function Ie(e,r,t){{var n=x.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var s=t.map(function(i){return String(i)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var $e=!1,Ne=!1,We=!1,Le=!1,Ye=!1,se;se=Symbol.for("react.module.reference");function qe(e){return!!(typeof e=="string"||typeof e=="function"||e===f||e===R||Ye||e===h||e===O||e===v||Le||e===P||$e||Ne||We||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===C||e.$$typeof===m||e.$$typeof===T||e.$$typeof===d||e.$$typeof===se||e.getModuleId!==void 0))}function Me(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function ue(e){return e.displayName||"Context"}function j(e){if(e==null)return null;if(typeof e.tag=="number"&&p("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 f:return"Fragment";case c:return"Portal";case R:return"Profiler";case h:return"StrictMode";case O:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case T:var r=e;return ue(r)+".Consumer";case m:var t=e;return ue(t._context)+".Provider";case d:return Me(e,e.render,"ForwardRef");case C:var n=e.displayName||null;return n!==null?n:j(e.type)||"Memo";case S:{var o=e,s=o._payload,i=o._init;try{return j(i(s))}catch{return null}}}return null}var k=Object.assign,N=0,le,ce,fe,de,ve,pe,_e;function be(){}be.__reactDisabledLog=!0;function Ue(){{if(N===0){le=console.log,ce=console.info,fe=console.warn,de=console.error,ve=console.group,pe=console.groupCollapsed,_e=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}}function Ve(){{if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:le}),info:k({},e,{value:ce}),warn:k({},e,{value:fe}),error:k({},e,{value:de}),group:k({},e,{value:ve}),groupCollapsed:k({},e,{value:pe}),groupEnd:k({},e,{value:_e})})}N<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var X=x.ReactCurrentDispatcher,H;function V(e,r,t){{if(H===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);H=n&&n[1]||""}return`
18
- `+H+e}}var Q=!1,B;{var Be=typeof WeakMap=="function"?WeakMap:Map;B=new Be}function ge(e,r){if(!e||Q)return"";{var t=B.get(e);if(t!==void 0)return t}var n;Q=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=X.current,X.current=null,Ue();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(y){n=y}Reflect.construct(e,[],i)}else{try{i.call()}catch(y){n=y}e.call(i.prototype)}}else{try{throw Error()}catch(y){n=y}e()}}catch(y){if(y&&n&&typeof y.stack=="string"){for(var a=y.stack.split(`
19
- `),b=n.stack.split(`
20
- `),u=a.length-1,l=b.length-1;u>=1&&l>=0&&a[u]!==b[l];)l--;for(;u>=1&&l>=0;u--,l--)if(a[u]!==b[l]){if(u!==1||l!==1)do if(u--,l--,l<0||a[u]!==b[l]){var E=`
21
- `+a[u].replace(" at new "," at ");return e.displayName&&E.includes("<anonymous>")&&(E=E.replace("<anonymous>",e.displayName)),typeof e=="function"&&B.set(e,E),E}while(u>=1&&l>=0);break}}}finally{Q=!1,X.current=s,Ve(),Error.prepareStackTrace=o}var I=e?e.displayName||e.name:"",D=I?V(I):"";return typeof e=="function"&&B.set(e,D),D}function Je(e,r,t){return ge(e,!1)}function Ke(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function J(e,r,t){if(e==null)return"";if(typeof e=="function")return ge(e,Ke(e));if(typeof e=="string")return V(e);switch(e){case O:return V("Suspense");case v:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Je(e.render);case C:return J(e.type,r,t);case S:{var n=e,o=n._payload,s=n._init;try{return J(s(o),r,t)}catch{}}}return""}var W=Object.prototype.hasOwnProperty,ye={},he=x.ReactDebugCurrentFrame;function K(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);he.setExtraStackFrame(t)}else he.setExtraStackFrame(null)}function Ge(e,r,t,n,o){{var s=Function.call.bind(W);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var b=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw b.name="Invariant Violation",b}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){a=u}a&&!(a instanceof Error)&&(K(o),p("%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,i,typeof a),K(null)),a instanceof Error&&!(a.message in ye)&&(ye[a.message]=!0,K(o),p("Failed %s type: %s",t,a.message),K(null))}}}var ze=Array.isArray;function Z(e){return ze(e)}function Xe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function He(e){try{return me(e),!1}catch{return!0}}function me(e){return""+e}function Ee(e){if(He(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Xe(e)),me(e)}var L=x.ReactCurrentOwner,Qe={key:!0,ref:!0,__self:!0,__source:!0},Re,Te,ee;ee={};function Ze(e){if(W.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function er(e){if(W.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function rr(e,r){if(typeof e.ref=="string"&&L.current&&r&&L.current.stateNode!==r){var t=j(L.current.type);ee[t]||(p('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',j(L.current.type),e.ref),ee[t]=!0)}}function tr(e,r){{var t=function(){Re||(Re=!0,p("%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 nr(e,r){{var t=function(){Te||(Te=!0,p("%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 ar=function(e,r,t,n,o,s,i){var a={$$typeof:g,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ir(e,r,t,n,o){{var s,i={},a=null,b=null;t!==void 0&&(Ee(t),a=""+t),er(r)&&(Ee(r.key),a=""+r.key),Ze(r)&&(b=r.ref,rr(r,o));for(s in r)W.call(r,s)&&!Qe.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var u=e.defaultProps;for(s in u)i[s]===void 0&&(i[s]=u[s])}if(a||b){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&tr(i,l),b&&nr(i,l)}return ar(e,a,b,o,n,L.current,i)}}var re=x.ReactCurrentOwner,Ce=x.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);Ce.setExtraStackFrame(t)}else Ce.setExtraStackFrame(null)}var te;te=!1;function ne(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}function we(){{if(re.current){var e=j(re.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 or(e){return""}var je={};function sr(e){{var r=we();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 Oe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=sr(r);if(je[t])return;je[t]=!0;var n="";e&&e._owner&&e._owner!==re.current&&(n=" It was passed a child from "+j(e._owner.type)+"."),A(e),p('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),A(null)}}function Se(e,r){{if(typeof e!="object")return;if(Z(e))for(var t=0;t<e.length;t++){var n=e[t];ne(n)&&Oe(n,r)}else if(ne(e))e._store&&(e._store.validated=!0);else if(e){var o=z(e);if(typeof o=="function"&&o!==e.entries)for(var s=o.call(e),i;!(i=s.next()).done;)ne(i.value)&&Oe(i.value,r)}}}function ur(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===d||r.$$typeof===C))t=r.propTypes;else return;if(t){var n=j(r);Ge(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!te){te=!0;var o=j(r);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function lr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),p("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var xe={};function Pe(e,r,t,n,o,s){{var i=qe(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 b=or();b?a+=b:a+=we();var u;e===null?u="null":Z(e)?u="array":e!==void 0&&e.$$typeof===g?(u="<"+(j(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,a)}var l=ir(e,r,t,o,s);if(l==null)return l;if(i){var E=r.children;if(E!==void 0)if(n)if(Z(E)){for(var I=0;I<E.length;I++)Se(E[I],e);Object.freeze&&Object.freeze(E)}else p("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 Se(E,e)}if(W.call(r,"key")){var D=j(e),y=Object.keys(r).filter(function(_r){return _r!=="key"}),ae=y.length>0?"{key: someKey, "+y.join(": ..., ")+": ...}":"{key: someKey}";if(!xe[D+ae]){var pr=y.length>0?"{"+y.join(": ..., ")+": ...}":"{}";p(`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} />`,ae,D,pr,D),xe[D+ae]=!0}}return e===f?lr(l):ur(l),l}}function cr(e,r,t){return Pe(e,r,t,!0)}function fr(e,r,t){return Pe(e,r,t,!1)}var dr=fr,vr=cr;q.Fragment=f,q.jsx=dr,q.jsxs=vr}()),q}process.env.NODE_ENV==="production"?ie.exports=br():ie.exports=gr();var w=ie.exports;const yr="_button_dfbbq_1",hr="_primary_dfbbq_20",mr="_danger_dfbbq_21",Er="_secondary_dfbbq_44",Rr="_text_dfbbq_51",Tr="_disabled_dfbbq_60",$={button:yr,primary:hr,danger:mr,secondary:Er,text:Rr,disabled:Tr};function M(_){return _.map(c=>{if(typeof c=="string")return c.trim();if(typeof c=="object"){const f=[];for(const h in c)c[h]&&f.push(h.trim());return f.join(" ")}}).filter(c=>!!c).join(" ")}const Cr={CheckMark:"✓",Ballot:"✗",ClockwiseTop:"↷",ClockwiseOpen:"↻",Pencil:"✎",Rightwards:"⇨",Leftwards:"⇦",Upwards:"⇧",Downwards:"⇩",Copyright:"©",Warning:"⚠",Question:"�",Envelope:"✉",Hart:"♥",Scissors:"✂",Star:"★"},wr=({disabled:_,onClick:g,text:c="Ok",type:f="button",view:h="primary",icon:R,...m})=>{const T=M([$.button,m==null?void 0:m.className,{[$.primary]:h==="primary",[$.secondary]:h==="secondary",[$.danger]:h==="danger",[$.disabled]:!!_}]);return w.jsxs("button",{type:f,className:T,onClick:_?void 0:g,disabled:_,...m,children:[R&&w.jsx("span",{children:`${Cr[R]}`}),w.jsx("span",{className:$.text,children:c})]})},jr="_container_icou8_1",Or="_wrapper_icou8_7",Sr="_input_icou8_21",xr="_invalid_icou8_28",Pr="_error_icou8_48",kr="_disabled_icou8_52",F={container:jr,wrapper:Or,input:Sr,invalid:xr,error:Pr,disabled:kr},Dr="_label_1tf8i_1",Fr="_required_1tf8i_9",Fe={label:Dr,required:Fr},Ar=({label:_,required:g,inputId:c,className:f})=>w.jsxs("label",{htmlFor:c,className:M([Fe.label,f]),children:[_,g&&w.jsx("abbr",{title:"required",className:Fe.required,children:"*"})]}),Ir="_message_1ly5l_1",$r="_visible_1ly5l_8",Ae={message:Ir,visible:$r},Nr=({errorId:_,message:g="Invalid input",className:c,visible:f=!1})=>w.jsx("span",{id:_,className:M([Ae.message,c,{[Ae.visible]:f}]),children:g}),Wr=({id:_,name:g,label:c,disabled:f,placeholder:h="Type here...",valid:R=!0,required:m=!1,errorMessage:T,defaultValue:d,onChange:O,...v})=>{const[C,S]=oe.useState(typeof d=="string"?d:""),P=`${_}_error`,U=M([F.container,v==null?void 0:v.className]),G=M([F.wrapper,{[F.disabled]:!!f,[F.invalid]:!R}]),z=x=>{const{value:p=""}=x.target;S(p),O&&O(x)};return w.jsxs("div",{className:U,children:[w.jsxs("div",{className:G,children:[w.jsx(Ar,{label:c,required:m,inputId:_,className:F.label}),w.jsx("input",{id:_,name:g,type:"text",className:F.input,disabled:f,placeholder:h,required:m,"aria-invalid":!R,"aria-errormessage":P,value:C,onChange:z,...v})]}),w.jsx(Nr,{errorId:P,message:T,className:F.error,visible:!R})]})};exports.ChopLogicButton=wr;exports.ChopLogicTextInput=Wr;
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