chop-logic-components 0.0.2 → 0.1.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.
@@ -0,0 +1,20 @@
1
+ export declare enum UTFIcon {
2
+ CheckMark = 0,
3
+ Ballot = 1,
4
+ ClockwiseTop = 2,
5
+ ClockwiseOpen = 3,
6
+ Pencil = 4,
7
+ Rightwards = 5,
8
+ Leftwards = 6,
9
+ Upwards = 7,
10
+ Downwards = 8,
11
+ Copyright = 9,
12
+ Warning = 10,
13
+ Question = 11,
14
+ Envelope = 12,
15
+ Hart = 13,
16
+ Scissors = 14,
17
+ Star = 15
18
+ }
19
+ export type UTFIconNames = keyof typeof UTFIcon;
20
+ export declare const UTF_ICONS: Record<UTFIconNames, string>;
@@ -1,9 +1,12 @@
1
+ import { UTFIconNames } from '../../../../../../../../src/assets/icons/utf-icons';
1
2
  import { default as React, MouseEventHandler } from 'react';
2
3
 
3
- export type ChopLogicButtonProps = {
4
+ export type ChopLogicButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
4
5
  text?: string;
6
+ onClick?: MouseEventHandler<HTMLButtonElement> | (() => void);
7
+ view?: 'primary' | 'secondary' | 'danger';
5
8
  disabled?: boolean;
6
- onClick?: MouseEventHandler<HTMLButtonElement>;
9
+ icon?: UTFIconNames;
7
10
  };
8
11
  declare const Button: React.FC<ChopLogicButtonProps>;
9
12
  export default Button;
@@ -0,0 +1,7 @@
1
+ import { default as ExampleButton } from './Example';
2
+ import { Meta, StoryObj } from '@storybook/react';
3
+
4
+ declare const meta: Meta<typeof ExampleButton>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof ExampleButton>;
7
+ export declare const Primary: Story;
@@ -0,0 +1,5 @@
1
+ import { ChopLogicButtonProps } from '../Button';
2
+ import { default as React } from 'react';
3
+
4
+ declare const ExampleButton: React.FC<ChopLogicButtonProps>;
5
+ export default ExampleButton;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,2 @@
1
1
  export { default as ChopLogicButton } from './button/Button';
2
+ export { default as ChopLogicTextInput } from './inputs/text/TextInput';
@@ -0,0 +1,10 @@
1
+ import { default as React, PropsWithChildren } from 'react';
2
+
3
+ type ChopLogicErrorMessageProps = {
4
+ errorId: string;
5
+ visible?: boolean;
6
+ message?: string;
7
+ className?: string;
8
+ };
9
+ declare const ChopLogicErrorMessage: React.FC<PropsWithChildren<ChopLogicErrorMessageProps>>;
10
+ export default ChopLogicErrorMessage;
@@ -0,0 +1,10 @@
1
+ import { default as React, PropsWithChildren } from 'react';
2
+
3
+ type ChopLogicLabelProps = {
4
+ label: string;
5
+ required: boolean;
6
+ inputId: string;
7
+ className?: string;
8
+ };
9
+ declare const ChopLogicLabel: React.FC<PropsWithChildren<ChopLogicLabelProps>>;
10
+ export default ChopLogicLabel;
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+
3
+ export type ChopLogicTextInputProps = React.InputHTMLAttributes<HTMLInputElement> & {
4
+ id: string;
5
+ name: string;
6
+ label: string;
7
+ valid?: boolean;
8
+ errorMessage?: string;
9
+ };
10
+ declare const TextInput: React.FC<ChopLogicTextInputProps>;
11
+ export default TextInput;
@@ -0,0 +1,5 @@
1
+ import { ChopLogicTextInputProps } from '../TextInput';
2
+ import { default as React } from 'react';
3
+
4
+ declare const Example: React.FC<ChopLogicTextInputProps>;
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;
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ce=require("react");var Z={exports:{}},A={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("react");var ie={exports:{}},Y={};/**
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 Oe;function fr(){if(Oe)return A;Oe=1;var w=Ce,_=Symbol.for("react.element"),j=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,W=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$={key:!0,ref:!0,__self:!0,__source:!0};function x(E,c,O){var p,y={},R=null,Y=null;O!==void 0&&(R=""+O),c.key!==void 0&&(R=""+c.key),c.ref!==void 0&&(Y=c.ref);for(p in c)h.call(c,p)&&!$.hasOwnProperty(p)&&(y[p]=c[p]);if(E&&E.defaultProps)for(p in c=E.defaultProps,c)y[p]===void 0&&(y[p]=c[p]);return{$$typeof:_,type:E,key:R,ref:Y,props:y,_owner:W.current}}return A.Fragment=j,A.jsx=x,A.jsxs=x,A}var I={};/**
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={};/**
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 Se;function cr(){return Se||(Se=1,process.env.NODE_ENV!=="production"&&function(){var w=Ce,_=Symbol.for("react.element"),j=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),E=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),Q=Symbol.iterator,Pe="@@iterator";function we(e){if(e===null||typeof e!="object")return null;var r=Q&&e[Q]||e[Pe];return typeof r=="function"?r:null}var S=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];je("error",e,t)}}function je(e,r,t){{var n=S.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var xe=!1,ke=!1,De=!1,Fe=!1,Ae=!1,ee;ee=Symbol.for("react.module.reference");function Ie(e){return!!(typeof e=="string"||typeof e=="function"||e===h||e===$||Ae||e===W||e===O||e===p||Fe||e===Y||xe||ke||De||typeof e=="object"&&e!==null&&(e.$$typeof===R||e.$$typeof===y||e.$$typeof===x||e.$$typeof===E||e.$$typeof===c||e.$$typeof===ee||e.getModuleId!==void 0))}function We(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function re(e){return e.displayName||"Context"}function g(e){if(e==null)return null;if(typeof e.tag=="number"&&f("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 h:return"Fragment";case j:return"Portal";case $:return"Profiler";case W:return"StrictMode";case O:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case E:var r=e;return re(r)+".Consumer";case x:var t=e;return re(t._context)+".Provider";case c:return We(e,e.render,"ForwardRef");case y:var n=e.displayName||null;return n!==null?n:g(e.type)||"Memo";case R:{var i=e,u=i._payload,o=i._init;try{return g(o(u))}catch{return null}}}return null}var m=Object.assign,k=0,te,ne,ae,oe,ie,ue,se;function le(){}le.__reactDisabledLog=!0;function $e(){{if(k===0){te=console.log,ne=console.info,ae=console.warn,oe=console.error,ie=console.group,ue=console.groupCollapsed,se=console.groupEnd;var e={configurable:!0,enumerable:!0,value:le,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}k++}}function Ye(){{if(k--,k===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:m({},e,{value:te}),info:m({},e,{value:ne}),warn:m({},e,{value:ae}),error:m({},e,{value:oe}),group:m({},e,{value:ie}),groupCollapsed:m({},e,{value:ue}),groupEnd:m({},e,{value:se})})}k<0&&f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var N=S.ReactCurrentDispatcher,B;function L(e,r,t){{if(B===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);B=n&&n[1]||""}return`
18
- `+B+e}}var q=!1,M;{var Le=typeof WeakMap=="function"?WeakMap:Map;M=new Le}function fe(e,r){if(!e||q)return"";{var t=M.get(e);if(t!==void 0)return t}var n;q=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=N.current,N.current=null,$e();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(v){n=v}Reflect.construct(e,[],o)}else{try{o.call()}catch(v){n=v}e.call(o.prototype)}}else{try{throw Error()}catch(v){n=v}e()}}catch(v){if(v&&n&&typeof v.stack=="string"){for(var a=v.stack.split(`
19
- `),d=n.stack.split(`
20
- `),s=a.length-1,l=d.length-1;s>=1&&l>=0&&a[s]!==d[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==d[l]){if(s!==1||l!==1)do if(s--,l--,l<0||a[s]!==d[l]){var b=`
21
- `+a[s].replace(" at new "," at ");return e.displayName&&b.includes("<anonymous>")&&(b=b.replace("<anonymous>",e.displayName)),typeof e=="function"&&M.set(e,b),b}while(s>=1&&l>=0);break}}}finally{q=!1,N.current=u,Ye(),Error.prepareStackTrace=i}var P=e?e.displayName||e.name:"",T=P?L(P):"";return typeof e=="function"&&M.set(e,T),T}function Me(e,r,t){return fe(e,!1)}function Ve(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function V(e,r,t){if(e==null)return"";if(typeof e=="function")return fe(e,Ve(e));if(typeof e=="string")return L(e);switch(e){case O:return L("Suspense");case p:return L("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return Me(e.render);case y:return V(e.type,r,t);case R:{var n=e,i=n._payload,u=n._init;try{return V(u(i),r,t)}catch{}}}return""}var D=Object.prototype.hasOwnProperty,ce={},de=S.ReactDebugCurrentFrame;function U(e){if(e){var r=e._owner,t=V(e.type,e._source,r?r.type:null);de.setExtraStackFrame(t)}else de.setExtraStackFrame(null)}function Ue(e,r,t,n,i){{var u=Function.call.bind(D);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var d=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(U(i),f("%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,o,typeof a),U(null)),a instanceof Error&&!(a.message in ce)&&(ce[a.message]=!0,U(i),f("Failed %s type: %s",t,a.message),U(null))}}}var Ne=Array.isArray;function J(e){return Ne(e)}function Be(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function qe(e){try{return ve(e),!1}catch{return!0}}function ve(e){return""+e}function pe(e){if(qe(e))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Be(e)),ve(e)}var F=S.ReactCurrentOwner,Je={key:!0,ref:!0,__self:!0,__source:!0},be,ge,K;K={};function Ke(e){if(D.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ge(e){if(D.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function ze(e,r){if(typeof e.ref=="string"&&F.current&&r&&F.current.stateNode!==r){var t=g(F.current.type);K[t]||(f('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',g(F.current.type),e.ref),K[t]=!0)}}function Xe(e,r){{var t=function(){be||(be=!0,f("%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 He(e,r){{var t=function(){ge||(ge=!0,f("%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 Ze=function(e,r,t,n,i,u,o){var a={$$typeof:_,type:e,key:r,ref:t,props:o,_owner:u};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:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function Qe(e,r,t,n,i){{var u,o={},a=null,d=null;t!==void 0&&(pe(t),a=""+t),Ge(r)&&(pe(r.key),a=""+r.key),Ke(r)&&(d=r.ref,ze(r,i));for(u in r)D.call(r,u)&&!Je.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)o[u]===void 0&&(o[u]=s[u])}if(a||d){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&Xe(o,l),d&&He(o,l)}return Ze(e,a,d,i,n,F.current,o)}}var G=S.ReactCurrentOwner,ye=S.ReactDebugCurrentFrame;function C(e){if(e){var r=e._owner,t=V(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}var z;z=!1;function X(e){return typeof e=="object"&&e!==null&&e.$$typeof===_}function he(){{if(G.current){var e=g(G.current.type);if(e)return`
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`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function er(e){return""}var _e={};function rr(e){{var r=he();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
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=`
24
24
 
25
- Check the top-level render call using <`+t+">.")}return r}}function Ee(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=rr(r);if(_e[t])return;_e[t]=!0;var n="";e&&e._owner&&e._owner!==G.current&&(n=" It was passed a child from "+g(e._owner.type)+"."),C(e),f('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),C(null)}}function Re(e,r){{if(typeof e!="object")return;if(J(e))for(var t=0;t<e.length;t++){var n=e[t];X(n)&&Ee(n,r)}else if(X(e))e._store&&(e._store.validated=!0);else if(e){var i=we(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)X(o.value)&&Ee(o.value,r)}}}function tr(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===c||r.$$typeof===y))t=r.propTypes;else return;if(t){var n=g(r);Ue(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!z){z=!0;var i=g(r);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function nr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){C(e),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),C(null);break}}e.ref!==null&&(C(e),f("Invalid attribute `ref` supplied to `React.Fragment`."),C(null))}}var me={};function Te(e,r,t,n,i,u){{var o=Ie(e);if(!o){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 d=er();d?a+=d:a+=he();var s;e===null?s="null":J(e)?s="array":e!==void 0&&e.$$typeof===_?(s="<"+(g(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var l=Qe(e,r,t,i,u);if(l==null)return l;if(o){var b=r.children;if(b!==void 0)if(n)if(J(b)){for(var P=0;P<b.length;P++)Re(b[P],e);Object.freeze&&Object.freeze(b)}else f("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 Re(b,e)}if(D.call(r,"key")){var T=g(e),v=Object.keys(r).filter(function(lr){return lr!=="key"}),H=v.length>0?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}";if(!me[T+H]){var sr=v.length>0?"{"+v.join(": ..., ")+": ...}":"{}";f(`A props object containing a "key" prop is being spread into JSX:
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:
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} />`,H,T,sr,T),me[T+H]=!0}}return e===h?nr(l):tr(l),l}}function ar(e,r,t){return Te(e,r,t,!0)}function or(e,r,t){return Te(e,r,t,!1)}var ir=or,ur=ar;I.Fragment=h,I.jsx=ir,I.jsxs=ur}()),I}process.env.NODE_ENV==="production"?Z.exports=fr():Z.exports=cr();var dr=Z.exports;const vr="_button_2ac9k_1",pr={button:vr},br=({disabled:w,text:_,onClick:j,...h})=>dr.jsx("button",{type:"button",className:pr.button,onClick:j,disabled:w,...h,children:_});exports.ChopLogicButton=br;
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;
31
31
  //# sourceMappingURL=index.cjs.js.map