@binamik/components 0.1.2 → 0.1.4

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
- (function(i,s){typeof exports=="object"&&typeof module!="undefined"?s(exports,require("@emotion/react"),require("@emotion/styled"),require("react"),require("framer-motion")):typeof define=="function"&&define.amd?define(["exports","@emotion/react","@emotion/styled","react","framer-motion"],s):(i=typeof globalThis!="undefined"?globalThis:i||self,s(i.BinamikCompoents={},i["emotion-react"],i.styled,i.React,i.framerMotion))})(this,function(i,s,g,c,h){"use strict";var tr=Object.defineProperty,ar=Object.defineProperties;var or=Object.getOwnPropertyDescriptors;var F=Object.getOwnPropertySymbols;var re=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable;var ee=(i,s,g)=>s in i?tr(i,s,{enumerable:!0,configurable:!0,writable:!0,value:g}):i[s]=g,$=(i,s)=>{for(var g in s||(s={}))re.call(s,g)&&ee(i,g,s[g]);if(F)for(var g of F(s))te.call(s,g)&&ee(i,g,s[g]);return i},A=(i,s)=>ar(i,or(s));var N=(i,s)=>{var g={};for(var c in i)re.call(i,c)&&s.indexOf(c)<0&&(g[c]=i[c]);if(i!=null&&F)for(var c of F(i))s.indexOf(c)<0&&te.call(i,c)&&(g[c]=i[c]);return g};function P(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var b=P(g),v=P(c);const ae=s.keyframes`
1
+ (function(T,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("@emotion/react"),require("@emotion/styled"),require("react"),require("framer-motion")):typeof define=="function"&&define.amd?define(["exports","@emotion/react","@emotion/styled","react","framer-motion"],O):(T=typeof globalThis<"u"?globalThis:T||self,O(T.BinamikCompoents={},T["emotion-react"],T.styled,T.React,T.framerMotion))})(this,function(T,O,or,C,j){"use strict";function ge(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var R=ge(or),S=ge(C);const ir=O.keyframes`
2
2
  0% {
3
3
  stroke-dasharray: 1, 200;
4
4
  stroke-dashoffset: 0;
@@ -11,22 +11,22 @@
11
11
  stroke-dasharray: 89, 200;
12
12
  stroke-dashoffset: -124px;
13
13
  }
14
- `,oe=s.keyframes`
14
+ `,lr=O.keyframes`
15
15
  100% {
16
16
  transform: rotate(360deg);
17
17
  }
18
- `,ne=b.default.div`
18
+ `,sr=R.default.div`
19
19
  position: relative;
20
20
  margin: 0 auto;
21
- width: ${({size:e})=>e||"1.5rem"};
21
+ width: ${({size:r})=>r||"1.5rem"};
22
22
 
23
23
  &:before {
24
24
  content: '';
25
25
  display: block;
26
26
  padding-top: 100%;
27
27
  }
28
- `,le=b.default.svg`
29
- animation: ${oe} 2s linear infinite;
28
+ `,cr=R.default.svg`
29
+ animation: ${lr} 2s linear infinite;
30
30
  height: 100%;
31
31
  transform-origin: center center;
32
32
  width: 100%;
@@ -36,31 +36,48 @@
36
36
  left: 0;
37
37
  right: 0;
38
38
  margin: auto;
39
- `,ie=b.default.circle`
39
+ `,ur=R.default.circle`
40
40
  stroke-dasharray: 1, 200;
41
41
  stroke-dashoffset: 0;
42
- animation: ${ae} 1.5s ease-in-out infinite;
42
+ animation: ${ir} 1.5s ease-in-out infinite;
43
43
  stroke-linecap: round;
44
- `;var T={exports:{}},k={};/*
44
+ `;var Q={exports:{}},z={};/*
45
45
  object-assign
46
46
  (c) Sindre Sorhus
47
47
  @license MIT
48
- */var D=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;function de(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function ce(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;var a=Object.getOwnPropertyNames(r).map(function(p){return r[p]});if(a.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(p){n[p]=p}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}ce();/** @license React v17.0.2
48
+ */var ee,be;function me(){if(be)return ee;be=1;var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function c(p){if(p==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(p)}function f(){try{if(!Object.assign)return!1;var p=new String("abc");if(p[5]="de",Object.getOwnPropertyNames(p)[0]==="5")return!1;for(var x={},i=0;i<10;i++)x["_"+String.fromCharCode(i)]=i;var l=Object.getOwnPropertyNames(x).map(function(d){return x[d]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(d){u[d]=d}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ee=f()?Object.assign:function(p,x){for(var i,l=c(p),u,d=1;d<arguments.length;d++){i=Object(arguments[d]);for(var b in i)o.call(i,b)&&(l[b]=i[b]);if(r){u=r(i);for(var E=0;E<u.length;E++)n.call(i,u[E])&&(l[u[E]]=i[u[E]])}}return l},ee}/** @license React v17.0.2
49
49
  * react-jsx-runtime.production.min.js
50
50
  *
51
51
  * Copyright (c) Facebook, Inc. and its affiliates.
52
52
  *
53
53
  * This source code is licensed under the MIT license found in the
54
54
  * LICENSE file in the root directory of this source tree.
55
- */var ue=v.default,M=60103;if(k.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var R=Symbol.for;M=R("react.element"),k.Fragment=R("react.fragment")}var xe=ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,me=Object.prototype.hasOwnProperty,be={key:!0,ref:!0,__self:!0,__source:!0};function I(e,r,t){var a,n={},p=null,u=null;t!==void 0&&(p=""+t),r.key!==void 0&&(p=""+r.key),r.ref!==void 0&&(u=r.ref);for(a in r)me.call(r,a)&&!be.hasOwnProperty(a)&&(n[a]=r[a]);if(e&&e.defaultProps)for(a in r=e.defaultProps,r)n[a]===void 0&&(n[a]=r[a]);return{$$typeof:M,type:e,key:p,ref:u,props:n,_owner:xe.current}}k.jsx=I,k.jsxs=I,T.exports=k;const d=T.exports.jsx,y=T.exports.jsxs,C=T.exports.Fragment,q=({size:e,color:r,thickness:t})=>d(ne,{size:e,children:d(le,{viewBox:"25 25 50 50",children:d(ie,{className:"path",cx:"50",cy:"50",r:"20",fill:"none",stroke:r||"currentColor",opacity:"0.5",strokeWidth:t||5,strokeMiterlimit:"10"})})}),ge=s.keyframes`
55
+ */var ve;function dr(){if(ve)return z;ve=1,me();var r=S.default,o=60103;if(z.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var n=Symbol.for;o=n("react.element"),z.Fragment=n("react.fragment")}var c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};function x(i,l,u){var d,b={},E=null,D=null;u!==void 0&&(E=""+u),l.key!==void 0&&(E=""+l.key),l.ref!==void 0&&(D=l.ref);for(d in l)f.call(l,d)&&!p.hasOwnProperty(d)&&(b[d]=l[d]);if(i&&i.defaultProps)for(d in l=i.defaultProps,l)b[d]===void 0&&(b[d]=l[d]);return{$$typeof:o,type:i,key:E,ref:D,props:b,_owner:c.current}}return z.jsx=x,z.jsxs=x,z}var re={};/** @license React v17.0.2
56
+ * react-jsx-runtime.development.js
57
+ *
58
+ * Copyright (c) Facebook, Inc. and its affiliates.
59
+ *
60
+ * This source code is licensed under the MIT license found in the
61
+ * LICENSE file in the root directory of this source tree.
62
+ */var he;function pr(){return he||(he=1,function(r){process.env.NODE_ENV!=="production"&&function(){var o=S.default,n=me(),c=60103,f=60106;r.Fragment=60107;var p=60108,x=60114,i=60109,l=60110,u=60112,d=60113,b=60120,E=60115,D=60116,M=60121,Se=60122,$e=60117,De=60129,Fe=60131;if(typeof Symbol=="function"&&Symbol.for){var _=Symbol.for;c=_("react.element"),f=_("react.portal"),r.Fragment=_("react.fragment"),p=_("react.strict_mode"),x=_("react.profiler"),i=_("react.provider"),l=_("react.context"),u=_("react.forward_ref"),d=_("react.suspense"),b=_("react.suspense_list"),E=_("react.memo"),D=_("react.lazy"),M=_("react.block"),Se=_("react.server.block"),$e=_("react.fundamental"),_("react.scope"),_("react.opaque.id"),De=_("react.debug_trace_mode"),_("react.offscreen"),Fe=_("react.legacy_hidden")}var Be=typeof Symbol=="function"&&Symbol.iterator,Zr="@@iterator";function Qr(e){if(e===null||typeof e!="object")return null;var t=Be&&e[Be]||e[Zr];return typeof t=="function"?t:null}var W=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function A(e){{for(var t=arguments.length,a=new Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];et("error",e,a)}}function et(e,t,a){{var s=W.ReactDebugCurrentFrame,h=s.getStackAddendum();h!==""&&(t+="%s",a=a.concat([h]));var y=a.map(function(m){return""+m});y.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,y)}}var rt=!1;function tt(e){return!!(typeof e=="string"||typeof e=="function"||e===r.Fragment||e===x||e===De||e===p||e===d||e===b||e===Fe||rt||typeof e=="object"&&e!==null&&(e.$$typeof===D||e.$$typeof===E||e.$$typeof===i||e.$$typeof===l||e.$$typeof===u||e.$$typeof===$e||e.$$typeof===M||e[0]===Se))}function at(e,t,a){var s=t.displayName||t.name||"";return e.displayName||(s!==""?a+"("+s+")":a)}function Ne(e){return e.displayName||"Context"}function F(e){if(e==null)return null;if(typeof e.tag=="number"&&A("Received an unexpected object in getComponentName(). 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 r.Fragment:return"Fragment";case f:return"Portal";case x:return"Profiler";case p:return"StrictMode";case d:return"Suspense";case b:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case l:var t=e;return Ne(t)+".Consumer";case i:var a=e;return Ne(a._context)+".Provider";case u:return at(e,e.render,"ForwardRef");case E:return F(e.type);case M:return F(e._render);case D:{var s=e,h=s._payload,y=s._init;try{return F(y(h))}catch{return null}}}return null}var U=0,Ie,ze,Me,We,Le,Ye,qe;function Ue(){}Ue.__reactDisabledLog=!0;function nt(){{if(U===0){Ie=console.log,ze=console.info,Me=console.warn,We=console.error,Le=console.group,Ye=console.groupCollapsed,qe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ue,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}U++}}function ot(){{if(U--,U===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:n({},e,{value:Ie}),info:n({},e,{value:ze}),warn:n({},e,{value:Me}),error:n({},e,{value:We}),group:n({},e,{value:Le}),groupCollapsed:n({},e,{value:Ye}),groupEnd:n({},e,{value:qe})})}U<0&&A("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var le=W.ReactCurrentDispatcher,se;function K(e,t,a){{if(se===void 0)try{throw Error()}catch(h){var s=h.stack.trim().match(/\n( *(at )?)/);se=s&&s[1]||""}return`
63
+ `+se+e}}var ce=!1,J;{var it=typeof WeakMap=="function"?WeakMap:Map;J=new it}function Ve(e,t){if(!e||ce)return"";{var a=J.get(e);if(a!==void 0)return a}var s;ce=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var y;y=le.current,le.current=null,nt();try{if(t){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(N){s=N}Reflect.construct(e,[],m)}else{try{m.call()}catch(N){s=N}e.call(m.prototype)}}else{try{throw Error()}catch(N){s=N}e()}}catch(N){if(N&&s&&typeof N.stack=="string"){for(var g=N.stack.split(`
64
+ `),P=s.stack.split(`
65
+ `),w=g.length-1,k=P.length-1;w>=1&&k>=0&&g[w]!==P[k];)k--;for(;w>=1&&k>=0;w--,k--)if(g[w]!==P[k]){if(w!==1||k!==1)do if(w--,k--,k<0||g[w]!==P[k]){var B=`
66
+ `+g[w].replace(" at new "," at ");return typeof e=="function"&&J.set(e,B),B}while(w>=1&&k>=0);break}}}finally{ce=!1,le.current=y,ot(),Error.prepareStackTrace=h}var Y=e?e.displayName||e.name:"",nr=Y?K(Y):"";return typeof e=="function"&&J.set(e,nr),nr}function He(e,t,a){return Ve(e,!1)}function lt(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function X(e,t,a){if(e==null)return"";if(typeof e=="function")return Ve(e,lt(e));if(typeof e=="string")return K(e);switch(e){case d:return K("Suspense");case b:return K("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return He(e.render);case E:return X(e.type,t,a);case M:return He(e._render);case D:{var s=e,h=s._payload,y=s._init;try{return X(y(h),t,a)}catch{}}}return""}var Ge={},Ke=W.ReactDebugCurrentFrame;function Z(e){if(e){var t=e._owner,a=X(e.type,e._source,t?t.type:null);Ke.setExtraStackFrame(a)}else Ke.setExtraStackFrame(null)}function st(e,t,a,s,h){{var y=Function.call.bind(Object.prototype.hasOwnProperty);for(var m in e)if(y(e,m)){var g=void 0;try{if(typeof e[m]!="function"){var P=Error((s||"React class")+": "+a+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}g=e[m](t,m,s,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(w){g=w}g&&!(g instanceof Error)&&(Z(h),A("%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).",s||"React class",a,m,typeof g),Z(null)),g instanceof Error&&!(g.message in Ge)&&(Ge[g.message]=!0,Z(h),A("Failed %s type: %s",a,g.message),Z(null))}}}var V=W.ReactCurrentOwner,ue=Object.prototype.hasOwnProperty,ct={key:!0,ref:!0,__self:!0,__source:!0},Je,Xe,de;de={};function ut(e){if(ue.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function dt(e){if(ue.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function pt(e,t){if(typeof e.ref=="string"&&V.current&&t&&V.current.stateNode!==t){var a=F(V.current.type);de[a]||(A('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',F(V.current.type),e.ref),de[a]=!0)}}function ft(e,t){{var a=function(){Je||(Je=!0,A("%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)",t))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function xt(e,t){{var a=function(){Xe||(Xe=!0,A("%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)",t))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var gt=function(e,t,a,s,h,y,m){var g={$$typeof:c,type:e,key:t,ref:a,props:m,_owner:y};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:h}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function bt(e,t,a,s,h){{var y,m={},g=null,P=null;a!==void 0&&(g=""+a),dt(t)&&(g=""+t.key),ut(t)&&(P=t.ref,pt(t,h));for(y in t)ue.call(t,y)&&!ct.hasOwnProperty(y)&&(m[y]=t[y]);if(e&&e.defaultProps){var w=e.defaultProps;for(y in w)m[y]===void 0&&(m[y]=w[y])}if(g||P){var k=typeof e=="function"?e.displayName||e.name||"Unknown":e;g&&ft(m,k),P&&xt(m,k)}return gt(e,g,P,h,s,V.current,m)}}var pe=W.ReactCurrentOwner,Ze=W.ReactDebugCurrentFrame;function L(e){if(e){var t=e._owner,a=X(e.type,e._source,t?t.type:null);Ze.setExtraStackFrame(a)}else Ze.setExtraStackFrame(null)}var fe;fe=!1;function xe(e){return typeof e=="object"&&e!==null&&e.$$typeof===c}function Qe(){{if(pe.current){var e=F(pe.current.type);if(e)return`
67
+
68
+ Check the render method of \``+e+"`."}return""}}function mt(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),a=e.lineNumber;return`
69
+
70
+ Check your code at `+t+":"+a+"."}return""}}var er={};function vt(e){{var t=Qe();if(!t){var a=typeof e=="string"?e:e.displayName||e.name;a&&(t=`
71
+
72
+ Check the top-level render call using <`+a+">.")}return t}}function rr(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=vt(t);if(er[a])return;er[a]=!0;var s="";e&&e._owner&&e._owner!==pe.current&&(s=" It was passed a child from "+F(e._owner.type)+"."),L(e),A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,s),L(null)}}function tr(e,t){{if(typeof e!="object")return;if(Array.isArray(e))for(var a=0;a<e.length;a++){var s=e[a];xe(s)&&rr(s,t)}else if(xe(e))e._store&&(e._store.validated=!0);else if(e){var h=Qr(e);if(typeof h=="function"&&h!==e.entries)for(var y=h.call(e),m;!(m=y.next()).done;)xe(m.value)&&rr(m.value,t)}}}function ht(e){{var t=e.type;if(t==null||typeof t=="string")return;var a;if(typeof t=="function")a=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===u||t.$$typeof===E))a=t.propTypes;else return;if(a){var s=F(t);st(a,e.props,"prop",s,e)}else if(t.PropTypes!==void 0&&!fe){fe=!0;var h=F(t);A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",h||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&A("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function yt(e){{for(var t=Object.keys(e.props),a=0;a<t.length;a++){var s=t[a];if(s!=="children"&&s!=="key"){L(e),A("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),L(null);break}}e.ref!==null&&(L(e),A("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}function ar(e,t,a,s,h,y){{var m=tt(e);if(!m){var g="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(g+=" 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 P=mt(h);P?g+=P:g+=Qe();var w;e===null?w="null":Array.isArray(e)?w="array":e!==void 0&&e.$$typeof===c?(w="<"+(F(e.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):w=typeof e,A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",w,g)}var k=bt(e,t,a,h,y);if(k==null)return k;if(m){var B=t.children;if(B!==void 0)if(s)if(Array.isArray(B)){for(var Y=0;Y<B.length;Y++)tr(B[Y],e);Object.freeze&&Object.freeze(B)}else A("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 tr(B,e)}return e===r.Fragment?yt(k):ht(k),k}}function wt(e,t,a){return ar(e,t,a,!0)}function Et(e,t,a){return ar(e,t,a,!1)}var _t=Et,kt=wt;r.jsx=_t,r.jsxs=kt}()}(re)),re}process.env.NODE_ENV==="production"?Q.exports=dr():Q.exports=pr();var te=Q.exports;const v=te.jsx,$=te.jsxs,q=te.Fragment,ye=({size:r,color:o,thickness:n})=>v(sr,{size:r,children:v(cr,{viewBox:"25 25 50 50",children:v(ur,{className:"path",cx:"50",cy:"50",r:"20",fill:"none",stroke:o||"currentColor",opacity:"0.5",strokeWidth:n||5,strokeMiterlimit:"10"})})}),fr=O.keyframes`
56
73
  100% {
57
74
  opacity: 0.5;
58
75
  }
59
- `,fe=b.default.button`
76
+ `,xr=R.default.button`
60
77
  --button-hover-brightness: 0.88;
61
78
 
62
79
  position: relative;
63
- padding: ${({isLoading:e,hasLoadingText:r})=>e&&r?"0.75em 1.125em 0.75em 2.5em":"0.75em 1.25em"};
80
+ padding: ${({isLoading:r,hasLoadingText:o})=>r&&o?"0.75em 1.125em 0.75em 2.5em":"0.75em 1.25em"};
64
81
  border-radius: 30px;
65
82
  border: 0;
66
83
 
@@ -74,7 +91,7 @@ object-assign
74
91
  cursor: pointer;
75
92
 
76
93
  .button__text_wrapper {
77
- animation: ${({isLoading:e})=>e?ge:"none"} 0.75s infinite
94
+ animation: ${({isLoading:r})=>r?fr:"none"} 0.75s infinite
78
95
  alternate;
79
96
  }
80
97
 
@@ -121,20 +138,20 @@ object-assign
121
138
  content: '';
122
139
  display: block;
123
140
 
124
- width: ${({isLoading:e,hasLoadingText:r})=>e&&r?"2em":"0"};
141
+ width: ${({isLoading:r,hasLoadingText:o})=>r&&o?"2em":"0"};
125
142
  }
126
143
 
127
144
  .button__spinner_wrapper {
128
145
  margin: -0.5em 0;
129
- display: ${({isLoading:e})=>e?"block":"none"};
130
- ${({hasLoadingText:e})=>e&&s.css`
146
+ display: ${({isLoading:r})=>r?"block":"none"};
147
+ ${({hasLoadingText:r})=>r&&O.css`
131
148
  top: calc(50% + 0.5em);
132
149
  transform: translateY(-50%);
133
150
  position: absolute;
134
151
  left: 0.5rem;
135
152
  `}
136
153
  }
137
- `,he=o=>{var l=o,{disabled:e=!1,isLoading:r=!1,loadingText:t="",outlined:a=!1,className:n="",children:p}=l,u=N(l,["disabled","isLoading","loadingText","outlined","className","children"]);return y(fe,A($({disabled:e||r,isLoading:r,hasLoadingText:!!t,className:`${n} ${a?"button__outline":""}`,type:"button"},u),{children:[d("div",{className:"button__spinner_wrapper",children:d(q,{size:"1.5em"})}),d("span",{className:"button__text_wrapper",children:r?t||"":p})]}))},ve=s.css`
154
+ `,gr=({disabled:r=!1,isLoading:o=!1,loadingText:n="",outlined:c=!1,className:f="",children:p,...x})=>$(xr,{disabled:r||o,isLoading:o,hasLoadingText:!!n,className:`${f} ${c?"button__outline":""}`,type:"button",...x,children:[v("div",{className:"button__spinner_wrapper",children:v(ye,{size:"1.5em"})}),v("span",{className:"button__text_wrapper",children:o?n||"":p})]}),br=O.css`
138
155
  :root {
139
156
  --clr-white: #ffffff;
140
157
  --clr-black: #000000;
@@ -234,7 +251,7 @@ object-assign
234
251
 
235
252
  --bp-tablet: 64rem; // 1024px
236
253
  }
237
- `,ye=s.css`
254
+ `,mr=O.css`
238
255
  html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p,
239
256
  blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em,
240
257
  img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u,
@@ -320,7 +337,7 @@ object-assign
320
337
  background-clip: text;
321
338
  -webkit-background-clip: text;
322
339
  }
323
- `,we=s.css`
340
+ `,vr=O.css`
324
341
  body {
325
342
  line-height: 1;
326
343
  color: #444;
@@ -382,15 +399,15 @@ object-assign
382
399
  .primary_color_txt {
383
400
  color: var(--clr-primary);
384
401
  }
385
- `,ke=(e="normal")=>e==="light"?"rgba(0, 0, 0, 0.05)":e==="normal"?"rgba(0, 0, 0, 0.1)":"rgba(0, 0, 0, 0.2)",Ce=(e="normal")=>e==="light"?"rgba(0, 0, 0, 0.03)":e==="normal"?"rgba(0, 0, 0, 0.07)":"rgba(0, 0, 0, 0.14)",Te=(e="normal")=>e==="light"?"rgba(0, 0, 0, 0.02)":e==="normal"?"rgba(0, 0, 0, 0.06)":"rgba(0, 0, 0, 0.12)",_e={0:"0px 0px 0px 0px",1:"0px 2px 1px -1px",2:"0px 3px 1px -2px",3:"0px 3px 3px -2px",4:"0px 2px 4px -1px",5:"0px 3px 5px -1px",6:"0px 3px 5px -1px",7:"0px 4px 5px -2px",8:"0px 5px 5px -3px",9:"0px 5px 6px -3px",10:"0px 6px 6px -3px",11:"0px 6px 7px -4px",12:"0px 7px 8px -4px",13:"0px 7px 8px -4px",14:"0px 7px 9px -4px",15:"0px 8px 9px -5px",16:"0px 8px 10px -5px",17:"0px 8px 11px -5px",18:"0px 9px 11px -5px",19:"0px 9px 12px -6px",20:"0px 10px 13px -6px",21:"0px 10px 13px -6px",22:"0px 10px 14px -6px",23:"0px 11px 14px -7px",24:"0px 11px 15px -7px"},Ee={0:"0px 0px 0px 0px",1:"0px 1px 1px 0px",2:"0px 2px 2px 0px",3:"0px 3px 4px 0px",4:"0px 4px 5px 0px",5:"0px 5px 8px 0px",6:"0px 6px 10px 0px",7:"0px 7px 10px 1px",8:"0px 8px 10px 1px",9:"0px 9px 12px 1px",10:"0px 10px 14px 1px",11:"0px 11px 15px 1px",12:"0px 12px 17px 2px",13:"0px 13px 19px 2px",14:"0px 14px 21px 2px",15:"0px 15px 22px 2px",16:"0px 16px 24px 2px",17:"0px 17px 26px 2px",18:"0px 18px 28px 2px",19:"0px 19px 29px 2px",20:"0px 20px 31px 3px",21:"0px 21px 33px 3px",22:"0px 22px 35px 3px",23:"0px 23px 36px 3px",24:"0px 24px 38px 3px"},Oe={0:"0px 0px 0px 0px",1:"0px 1px 3px 0px",2:"0px 1px 5px 0px",3:"0px 1px 8px 0px",4:"0px 1px 10px 0px",5:"0px 1px 14px 0px",6:"0px 1px 18px 0px",7:"0px 2px 16px 1px",8:"0px 3px 14px 2px",9:"0px 3px 16px 2px",10:"0px 4px 18px 3px",11:"0px 4px 20px 3px",12:"0px 5px 22px 4px",13:"0px 5px 24px 4px",14:"0px 5px 26px 4px",15:"0px 6px 28px 5px",16:"0px 6px 30px 5px",17:"0px 6px 32px 5px",18:"0px 7px 34px 6px",19:"0px 7px 36px 6px",20:"0px 8px 38px 7px",21:"0px 8px 40px 7px",22:"0px 8px 42px 7px",23:"0px 9px 44px 8px",24:"0px 9px 46px 8px"},L=(e,r="light")=>`box-shadow: ${_e[e]} ${ke(r)},
386
- ${Ee[e]} ${Ce(r)},
387
- ${Oe[e]} ${Te(r)};`,Fe=()=>d(s.Global,{styles:s.css`
402
+ `,hr=(r="normal")=>r==="light"?"rgba(0, 0, 0, 0.05)":r==="normal"?"rgba(0, 0, 0, 0.1)":"rgba(0, 0, 0, 0.2)",yr=(r="normal")=>r==="light"?"rgba(0, 0, 0, 0.03)":r==="normal"?"rgba(0, 0, 0, 0.07)":"rgba(0, 0, 0, 0.14)",wr=(r="normal")=>r==="light"?"rgba(0, 0, 0, 0.02)":r==="normal"?"rgba(0, 0, 0, 0.06)":"rgba(0, 0, 0, 0.12)",Er={0:"0px 0px 0px 0px",1:"0px 2px 1px -1px",2:"0px 3px 1px -2px",3:"0px 3px 3px -2px",4:"0px 2px 4px -1px",5:"0px 3px 5px -1px",6:"0px 3px 5px -1px",7:"0px 4px 5px -2px",8:"0px 5px 5px -3px",9:"0px 5px 6px -3px",10:"0px 6px 6px -3px",11:"0px 6px 7px -4px",12:"0px 7px 8px -4px",13:"0px 7px 8px -4px",14:"0px 7px 9px -4px",15:"0px 8px 9px -5px",16:"0px 8px 10px -5px",17:"0px 8px 11px -5px",18:"0px 9px 11px -5px",19:"0px 9px 12px -6px",20:"0px 10px 13px -6px",21:"0px 10px 13px -6px",22:"0px 10px 14px -6px",23:"0px 11px 14px -7px",24:"0px 11px 15px -7px"},_r={0:"0px 0px 0px 0px",1:"0px 1px 1px 0px",2:"0px 2px 2px 0px",3:"0px 3px 4px 0px",4:"0px 4px 5px 0px",5:"0px 5px 8px 0px",6:"0px 6px 10px 0px",7:"0px 7px 10px 1px",8:"0px 8px 10px 1px",9:"0px 9px 12px 1px",10:"0px 10px 14px 1px",11:"0px 11px 15px 1px",12:"0px 12px 17px 2px",13:"0px 13px 19px 2px",14:"0px 14px 21px 2px",15:"0px 15px 22px 2px",16:"0px 16px 24px 2px",17:"0px 17px 26px 2px",18:"0px 18px 28px 2px",19:"0px 19px 29px 2px",20:"0px 20px 31px 3px",21:"0px 21px 33px 3px",22:"0px 22px 35px 3px",23:"0px 23px 36px 3px",24:"0px 24px 38px 3px"},kr={0:"0px 0px 0px 0px",1:"0px 1px 3px 0px",2:"0px 1px 5px 0px",3:"0px 1px 8px 0px",4:"0px 1px 10px 0px",5:"0px 1px 14px 0px",6:"0px 1px 18px 0px",7:"0px 2px 16px 1px",8:"0px 3px 14px 2px",9:"0px 3px 16px 2px",10:"0px 4px 18px 3px",11:"0px 4px 20px 3px",12:"0px 5px 22px 4px",13:"0px 5px 24px 4px",14:"0px 5px 26px 4px",15:"0px 6px 28px 5px",16:"0px 6px 30px 5px",17:"0px 6px 32px 5px",18:"0px 7px 34px 6px",19:"0px 7px 36px 6px",20:"0px 8px 38px 7px",21:"0px 8px 40px 7px",22:"0px 8px 42px 7px",23:"0px 9px 44px 8px",24:"0px 9px 46px 8px"},we=(r,o="light")=>`box-shadow: ${Er[r]} ${hr(o)},
403
+ ${_r[r]} ${yr(o)},
404
+ ${kr[r]} ${wr(o)};`,Tr=()=>v(O.Global,{styles:O.css`
388
405
  body {
389
406
  overflow: hidden;
390
407
  }
391
- `}),S=480,$e=e=>Math.max(e.mobileBreakpoint,S),Ae={shouldForwardProp(e){return!["columnTemplate","mobileBreakpoint","customCss"].includes(e)}},Se=b.default(h.motion.div,Ae)`
408
+ `}),ae=480,Cr=r=>Math.max(r.mobileBreakpoint,ae),Rr={shouldForwardProp(r){return!["columnTemplate","mobileBreakpoint","customCss"].includes(r)}},Or=R.default(j.motion.div,Rr)`
392
409
  --radius: 0.625rem;
393
- --column-template: ${e=>e.columnTemplate};
410
+ --column-template: ${r=>r.columnTemplate};
394
411
  --table-padding: 1.875rem;
395
412
 
396
413
  --header-row-display: grid;
@@ -433,7 +450,7 @@ object-assign
433
450
  box-sizing: border-box;
434
451
  }
435
452
 
436
- @media (max-width: ${$e}px) {
453
+ @media (max-width: ${Cr}px) {
437
454
  --column-template: 1fr;
438
455
 
439
456
  --header-row-display: none;
@@ -468,8 +485,8 @@ object-assign
468
485
  --cell-padding: 0.8rem 0.65rem;
469
486
  }
470
487
 
471
- ${e=>e.customCss}
472
- `,Be=b.default(h.motion.div)`
488
+ ${r=>r.customCss}
489
+ `,Pr=R.default(j.motion.div)`
473
490
  width: auto;
474
491
  position: relative;
475
492
  border: var(--row-annex-border);
@@ -478,7 +495,7 @@ object-assign
478
495
  padding: var(--row-annex-padding);
479
496
  background-color: rgba(255, 255, 255, 0.6);
480
497
  transition: background-color var(--highlight-transition);
481
- `,W=s.css`
498
+ `,Ee=O.css`
482
499
  display: grid;
483
500
  width: 100%;
484
501
  grid-template-columns: var(--column-template);
@@ -489,7 +506,7 @@ object-assign
489
506
  color: var(--clr-gray3);
490
507
  min-height: 0;
491
508
  min-width: 0;
492
- `,je=b.default(h.motion.li)`
509
+ `,Ar=R.default(j.motion.li)`
493
510
  margin: var(--row-margin);
494
511
  border: var(--row-border);
495
512
  border-radius: var(--radius);
@@ -512,8 +529,8 @@ object-assign
512
529
  &:not(.empty_row):hover {
513
530
  background-color: var(--row-hover-background);
514
531
  }
515
- `,ze=b.default(h.motion.div)`
516
- ${W}
532
+ `,jr=R.default(j.motion.div)`
533
+ ${Ee}
517
534
 
518
535
  max-width: 100%;
519
536
  min-width: 0;
@@ -524,26 +541,26 @@ object-assign
524
541
  &:last-of-type .TableCellWrapper:last-of-type .TableCellRef {
525
542
  border-radius: 0 0 0 var(--radius);
526
543
  }
527
- `,Ne=b.default(h.motion.div)`
528
- ${W}
544
+ `,Sr=R.default(j.motion.div)`
545
+ ${Ee}
529
546
  min-height: 4.375rem;
530
547
  background-color: var(--label-background);
531
548
  font-weight: bold;
532
549
  color: var(--clr-gray3);
533
550
  border-radius: var(--radius);
534
551
  display: var(--header-row-display);
535
- `,Pe=b.default(h.motion.ul)`
552
+ `,$r=R.default(j.motion.ul)`
536
553
  width: 100%;
537
554
  list-style: none;
538
555
  margin: 0;
539
556
  padding: 0;
540
- `,B=s.css`
557
+ `,ne=O.css`
541
558
  padding: var(--cell-padding);
542
559
  height: 100%;
543
560
  display: flex;
544
561
  align-items: center;
545
562
  margin: 0;
546
- `,De=s.css`
563
+ `,Dr=O.css`
547
564
  position: relative;
548
565
 
549
566
  &::before {
@@ -571,12 +588,12 @@ object-assign
571
588
  &:first-of-type::before {
572
589
  border-radius: var(--radius) var(--radius) 0 0;
573
590
  }
574
- `,Me=b.default.div`
575
- ${B}
591
+ `,Fr=R.default.div`
592
+ ${ne}
576
593
 
577
594
  width: 100%;
578
- `,Re=b.default.div`
579
- ${De}
595
+ `,Br=R.default.div`
596
+ ${Dr}
580
597
 
581
598
  min-width: 0;
582
599
 
@@ -596,14 +613,14 @@ object-assign
596
613
  border-radius: var(--radius) 0 0 0;
597
614
  }
598
615
  }
599
- `,Ie=b.default.div`
600
- ${B}
616
+ `,Nr=R.default.div`
617
+ ${ne}
601
618
 
602
619
  display: var(--mobile-ref-display);
603
620
  background-color: var(--label-background);
604
621
  font-weight: bold;
605
622
  color: var(--clr-gray3);
606
- `,qe=s.css`
623
+ `,Ir=O.css`
607
624
  &.sortable,
608
625
  &.sorted-asc,
609
626
  &.sorted-desc {
@@ -658,8 +675,8 @@ object-assign
658
675
  margin-top: 0.2ch;
659
676
  }
660
677
  }
661
- `,Le=b.default.div`
662
- ${B}
678
+ `,zr=R.default.div`
679
+ ${ne}
663
680
  transition: background-color var(--highlight-transition);
664
681
  border-radius: var(--radius);
665
682
 
@@ -667,8 +684,8 @@ object-assign
667
684
  background-color: var(--clr-gray8);
668
685
  }
669
686
 
670
- ${qe}
671
- `,We=b.default(h.motion.button)`
687
+ ${Ir}
688
+ `,Mr=R.default(j.motion.button)`
672
689
  display: var(--mobile-sorting-display);
673
690
  align-items: center;
674
691
  color: var(--clr-gray3);
@@ -703,7 +720,9 @@ object-assign
703
720
  border-width: 0 1px 1px 0;
704
721
  transform: rotate(45deg);
705
722
  margin: 0 0.25rem;
706
- transition: transform 300ms, margin 300ms;
723
+ transition:
724
+ transform 300ms,
725
+ margin 300ms;
707
726
  margin-bottom: 0.25rem;
708
727
  }
709
728
 
@@ -716,7 +735,7 @@ object-assign
716
735
  }
717
736
  }
718
737
  }
719
- `,He=b.default(h.motion.div)`
738
+ `,Wr=R.default(j.motion.div)`
720
739
  position: absolute;
721
740
  top: 2.5rem;
722
741
  right: 0;
@@ -733,8 +752,8 @@ object-assign
733
752
  overflow: auto;
734
753
  max-height: calc(100vh - 5rem);
735
754
  transform-origin: top right;
736
- ${L(8)}
737
- `,Ue=b.default.button`
755
+ ${we(8)}
756
+ `,Lr=R.default.button`
738
757
  background-color: var(--clr-white);
739
758
  padding: 0.5rem;
740
759
  border-radius: var(--radius);
@@ -756,7 +775,7 @@ object-assign
756
775
  &:hover {
757
776
  background-color: var(--clr-gray8);
758
777
  }
759
- `,Ge=b.default(h.motion.button)`
778
+ `,Yr=R.default(j.motion.button)`
760
779
  position: fixed;
761
780
  inset: 0;
762
781
  z-index: 10;
@@ -764,6 +783,6 @@ object-assign
764
783
  height: 100%;
765
784
  background-color: transparent;
766
785
  cursor: default;
767
- `,_=`
786
+ `,H=`
768
787
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
769
- `,H=(e=[])=>e.map(({width:t})=>(t==null?void 0:t.replace(/\s/g,""))||"1fr").join(" "),Ve=({columns:e=[],children:r=[],mobileBreakpoint:t=900})=>{t<S&&console.warn(`Table: mobileBreakpoint (${t}) is too small. The minimum of ${S} will be used instead.${_}`),H(e).split(" ").map((o,l)=>({value:o,idx:l})).filter(o=>!CSS.supports("grid-template-columns",o.value)).forEach(o=>{const l=o.value.replace(/"/g,'\\"');console.warn(`Table: Invalid width value "${l}" on columnsWidths[${o.idx}].${_}`)});const p=r.map((o,l)=>({value:o,idx:l})).filter(o=>{var l,x,f,m;return v.default.isValidElement(o.value)&&(((x=(l=o.value)==null?void 0:l.type)==null?void 0:x.displayName)==="TableRow"||((m=(f=o.value)==null?void 0:f.type)==null?void 0:m.displayName)==="EmptyRow")});p.forEach(o=>{var x,f,m,O,Z;const l=(m=(f=(x=o.value)==null?void 0:x.props)==null?void 0:f.children)==null?void 0:m.filter(rr=>rr!==void 0).length;v.default.isValidElement(o.value)&&((Z=(O=o.value)==null?void 0:O.type)==null?void 0:Z.displayName)!=="EmptyRow"&&l!==e.length&&console.warn(`Table: children[${o.idx}] length (${l}) should be equal to labels length (${e.length}).${_}`)}),r.map((o,l)=>({value:o,idx:l})).filter(o=>!p.some(l=>l.idx===o.idx)).forEach(o=>{console.warn(`Table: children[${o.idx}] is not a TableRow. See TableRow component.${_}`)})},U=e=>e!=="asc"?"asc":"desc",Ke=({column:e,onSort:r})=>{const{sortedColumn:t,sortedOrder:a=""}=E(),n=c.useMemo(()=>t===e.name?a:"",[e.name,t,a]),p=c.useCallback(()=>{!e.sortable||r(U(n))},[e.sortable,r,n]);return d(Le,{className:["TableHeader",n?`sorted-${n}`:"",e.sortable?"sortable":""].join(" "),onClick:p,role:e.sortable?"button":void 0,children:e.label})};var G={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},V=v.default.createContext&&v.default.createContext(G),w=globalThis&&globalThis.__assign||function(){return w=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w.apply(this,arguments)},Ye=globalThis&&globalThis.__rest||function(e,r){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++)r.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(t[a[n]]=e[a[n]]);return t};function K(e){return e&&e.map(function(r,t){return v.default.createElement(r.tag,w({key:t},r.attr),K(r.child))})}function j(e){return function(r){return v.default.createElement(Je,w({attr:w({},e.attr)},r),K(e.child))}}function Je(e){var r=function(t){var a=e.attr,n=e.size,p=e.title,u=Ye(e,["attr","size","title"]),o=n||t.size||"1em",l;return t.className&&(l=t.className),e.className&&(l=(l?l+" ":"")+e.className),v.default.createElement("svg",w({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,a,u,{className:l,style:w(w({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),p&&v.default.createElement("title",null,p),e.children)};return V!==void 0?v.default.createElement(V.Consumer,null,function(t){return r(t)}):r(G)}function Qe(e){return j({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7 20h2V8h3L8 4 4 8h3zm13-4h-3V4h-2v12h-3l4 4z"}}]})(e)}function Y(e){return j({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m6 20 4-4H7V4H5v12H2zm5-12h9v2h-9zm0 4h7v2h-7zm0-8h11v2H11zm0 12h5v2h-5z"}}]})(e)}function J(e){return j({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 9h9v2h-9zm0 4h7v2h-7zm0-8h11v2H11zm0 12h5v2h-5zm-6 3h2V8h3L6 4 2 8h3z"}}]})(e)}const Xe=({onSortingChange:e})=>{const{columns:r=[],sortedOrder:t="",sortedColumn:a=""}=E(),n=c.useMemo(()=>r.filter(({sortable:m})=>m),[r]),p=c.useMemo(()=>{var m;return((m=r.find(({name:O})=>O===a))==null?void 0:m.label)||""},[r,a]),u=c.useMemo(()=>n.length,[n]),[o,l]=c.useState(!1),x=c.useCallback(()=>{u&&l(m=>!m)},[u]);c.useEffect(()=>{u&&l(!1)},[u]);const f=c.useCallback(m=>()=>{l(!1),e(m)(U(a===m.name?t:""))},[e,a,t]);return u||p&&t?y(C,{children:[y(We,{className:[u?"sortable":"",o?"open":""].join(" "),onClick:x,disabled:!u,type:"button",layout:!0,children:[u&&(!p||!t)?y(C,{children:[d(Qe,{}),d("p",{children:"Ordenar"})]}):null,p&&t?y(C,{children:[t==="asc"?d(Y,{}):d(J,{}),d("p",{children:p})]}):null]}),d(h.AnimatePresence,{children:o?y(C,{children:[d(Ge,{onClick:x,type:"button"}),d(He,{initial:{transform:"scale(0)",opacity:0},animate:{transform:"scale(1)",opacity:1},exit:{transform:"scale(0)",opacity:0},transition:{type:"tween"},children:n.map(m=>y(Ue,{onClick:f(m),children:[d("p",{children:m.label}),m.name===a?t==="desc"?d(Y,{size:"1.25rem"}):d(J,{size:"1.25rem"}):null]},m.key))})]}):null})]}):null},Ze=e=>{},Q=c.createContext({}),er=({columns:e=[],children:r,customCss:t,sorting:a,onSortingChange:n=Ze,mobileBreakpoint:p=900})=>{const u=c.useCallback(x=>f=>{!(x!=null&&x.sortable)||n({column:x.name,order:f})},[n]);c.useEffect(()=>{const x=r.flat().filter(Boolean);Ve({columns:e,children:x,mobileBreakpoint:p})},[r,e,p]);const o=c.useMemo(()=>H(e),[e]),l=c.useMemo(()=>e.map((x,f)=>A($({},x),{index:f,key:`${x.name}-${f}`})),[e]);return d(Q.Provider,{value:{columns:l,sortedOrder:a==null?void 0:a.order,sortedColumn:a==null?void 0:a.column},children:y(Se,{columnTemplate:o,customCss:t,mobileBreakpoint:p,layout:!0,children:[d(Xe,{onSortingChange:u}),d(Ne,{layout:!0,children:l.map(x=>d(Ke,{column:x,onSort:u(x)},x.key))}),d(Pe,{children:r.map((x,f)=>d(c.Fragment,{children:x},f))})]})})};function E(){const e=c.useContext(Q);if(!e)throw new Error("useTable and TableRow must be used within a Table");return e}const z=n=>{var p=n,{children:e,className:r,annex:t}=p,a=N(p,["children","className","annex"]);const{columns:u=[]}=E(),o=c.useMemo(()=>`table-row-${Math.random().toString(16).slice(2)}`,[]);return d(C,{children:y(je,A($({layout:!0,className:r},a),{children:[d(ze,{id:o,layoutId:o,className:"TableRow",children:u.map(l=>y(Re,{className:`TableCellWrapper column-${l.index}`,children:[d(Ie,{className:`TableCellRef column-${l.index}`,children:l.label}),d(Me,{className:`TableCell column-${l.index}`,children:e[l.index]||null})]},l.key))}),d(h.AnimatePresence,{children:t?d(Be,{layoutId:`${o}-annex`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,height:0,padding:0,margin:0,overflow:"hidden"},transition:{type:"tween"},"aria-details":o,className:"TableRowAnnex",children:t},"annex"):null})]}))})};z.displayName="TableRow";const X=()=>{const{columns:e=[]}=E();return d(z,{className:"empty_row",children:Array(e.length).fill(null)})};X.displayName="EmptyRow",i.Button=he,i.EmptyRow=X,i.PreventScroll=Fe,i.Spinner=q,i.Table=er,i.TableRow=z,i.binamikCssReset=ye,i.binamikGlobalStyles=we,i.binamikTheme=ve,i.depth=L,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
788
+ `,_e=(r=[])=>r.map(({width:n})=>(n==null?void 0:n.replace(/\s/g,""))||"1fr").join(" "),qr=({columns:r=[],children:o=[],mobileBreakpoint:n=900})=>{n<ae&&console.warn(`Table: mobileBreakpoint (${n}) is too small. The minimum of ${ae} will be used instead.${H}`),_e(r).split(" ").map((i,l)=>({value:i,idx:l})).filter(i=>!CSS.supports("grid-template-columns",i.value)).forEach(i=>{const l=i.value.replace(/"/g,'\\"');console.warn(`Table: Invalid width value "${l}" on columnsWidths[${i.idx}].${H}`)});const p=o.map((i,l)=>({value:i,idx:l})).filter(i=>{var l,u,d,b;return S.default.isValidElement(i.value)&&(((u=(l=i.value)==null?void 0:l.type)==null?void 0:u.displayName)==="TableRow"||((b=(d=i.value)==null?void 0:d.type)==null?void 0:b.displayName)==="EmptyRow")});p.forEach(i=>{var u,d,b,E,D;const l=(b=(d=(u=i.value)==null?void 0:u.props)==null?void 0:d.children)==null?void 0:b.filter(M=>M!==void 0).length;S.default.isValidElement(i.value)&&((D=(E=i.value)==null?void 0:E.type)==null?void 0:D.displayName)!=="EmptyRow"&&l!==r.length&&console.warn(`Table: children[${i.idx}] length (${l}) should be equal to labels length (${r.length}).${H}`)}),o.map((i,l)=>({value:i,idx:l})).filter(i=>!p.some(l=>l.idx===i.idx)).forEach(i=>{console.warn(`Table: children[${i.idx}] is not a TableRow. See TableRow component.${H}`)})},ke=r=>r!=="asc"?"asc":"desc",Ur=({column:r,onSort:o})=>{const{sortedColumn:n,sortedOrder:c=""}=G(),f=C.useMemo(()=>n===r.name?c:"",[r.name,n,c]),p=C.useCallback(()=>{r.sortable&&o(ke(f))},[r.sortable,o,f]);return v(zr,{className:["TableHeader",f?`sorted-${f}`:"",r.sortable?"sortable":""].join(" "),onClick:p,role:r.sortable?"button":void 0,children:r.label})};var Te={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ce=S.default.createContext&&S.default.createContext(Te),I=globalThis&&globalThis.__assign||function(){return I=Object.assign||function(r){for(var o,n=1,c=arguments.length;n<c;n++){o=arguments[n];for(var f in o)Object.prototype.hasOwnProperty.call(o,f)&&(r[f]=o[f])}return r},I.apply(this,arguments)},Vr=globalThis&&globalThis.__rest||function(r,o){var n={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&o.indexOf(c)<0&&(n[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,c=Object.getOwnPropertySymbols(r);f<c.length;f++)o.indexOf(c[f])<0&&Object.prototype.propertyIsEnumerable.call(r,c[f])&&(n[c[f]]=r[c[f]]);return n};function Re(r){return r&&r.map(function(o,n){return S.default.createElement(o.tag,I({key:n},o.attr),Re(o.child))})}function oe(r){return function(o){return S.default.createElement(Hr,I({attr:I({},r.attr)},o),Re(r.child))}}function Hr(r){var o=function(n){var c=r.attr,f=r.size,p=r.title,x=Vr(r,["attr","size","title"]),i=f||n.size||"1em",l;return n.className&&(l=n.className),r.className&&(l=(l?l+" ":"")+r.className),S.default.createElement("svg",I({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,c,x,{className:l,style:I(I({color:r.color||n.color},n.style),r.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),p&&S.default.createElement("title",null,p),r.children)};return Ce!==void 0?S.default.createElement(Ce.Consumer,null,function(n){return o(n)}):o(Te)}function Gr(r){return oe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7 20h2V8h3L8 4 4 8h3zm13-4h-3V4h-2v12h-3l4 4z"}}]})(r)}function Oe(r){return oe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m6 20 4-4H7V4H5v12H2zm5-12h9v2h-9zm0 4h7v2h-7zm0-8h11v2H11zm0 12h5v2h-5z"}}]})(r)}function Pe(r){return oe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 9h9v2h-9zm0 4h7v2h-7zm0-8h11v2H11zm0 12h5v2h-5zm-6 3h2V8h3L6 4 2 8h3z"}}]})(r)}const Kr=({onSortingChange:r})=>{const{columns:o=[],sortedOrder:n="",sortedColumn:c=""}=G(),f=C.useMemo(()=>o.filter(({sortable:b})=>b),[o]),p=C.useMemo(()=>{var b;return((b=o.find(({name:E})=>E===c))==null?void 0:b.label)||""},[o,c]),x=C.useMemo(()=>f.length,[f]),[i,l]=C.useState(!1),u=C.useCallback(()=>{x&&l(b=>!b)},[x]);C.useEffect(()=>{x&&l(!1)},[x]);const d=C.useCallback(b=>()=>{l(!1),r(b)(ke(c===b.name?n:""))},[r,c,n]);return x||p&&n?$(q,{children:[$(Mr,{className:[x?"sortable":"",i?"open":""].join(" "),onClick:u,disabled:!x,type:"button",layout:!0,children:[x&&(!p||!n)?$(q,{children:[v(Gr,{}),v("p",{children:"Ordenar"})]}):null,p&&n?$(q,{children:[n==="asc"?v(Oe,{}):v(Pe,{}),v("p",{children:p})]}):null]}),v(j.AnimatePresence,{children:i?$(q,{children:[v(Yr,{onClick:u,type:"button"}),v(Wr,{initial:{transform:"scale(0)",opacity:0},animate:{transform:"scale(1)",opacity:1},exit:{transform:"scale(0)",opacity:0},transition:{type:"tween"},children:f.map(b=>$(Lr,{onClick:d(b),children:[v("p",{children:b.label}),b.name===c?n==="desc"?v(Oe,{size:"1.25rem"}):v(Pe,{size:"1.25rem"}):null]},b.key))})]}):null})]}):null},Jr=r=>{},Ae=C.createContext({}),Xr=({columns:r=[],children:o,customCss:n,sorting:c,onSortingChange:f=Jr,mobileBreakpoint:p=900})=>{const x=C.useCallback(u=>d=>{u!=null&&u.sortable&&f({column:u.name,order:d})},[f]);C.useEffect(()=>{const u=o.flat().filter(Boolean);qr({columns:r,children:u,mobileBreakpoint:p})},[o,r,p]);const i=C.useMemo(()=>_e(r),[r]),l=C.useMemo(()=>r.map((u,d)=>({...u,index:d,key:`${u.name}-${d}`})),[r]);return v(Ae.Provider,{value:{columns:l,sortedOrder:c==null?void 0:c.order,sortedColumn:c==null?void 0:c.column},children:$(Or,{columnTemplate:i,customCss:n,mobileBreakpoint:p,layout:!0,children:[v(Kr,{onSortingChange:x}),v(Sr,{layout:!0,children:l.map(u=>v(Ur,{column:u,onSort:x(u)},u.key))}),v($r,{children:o.map((u,d)=>v(C.Fragment,{children:u},d))})]})})};function G(){const r=C.useContext(Ae);if(!r)throw new Error("useTable and TableRow must be used within a Table");return r}const ie=({children:r,className:o,annex:n,...c})=>{const{columns:f=[]}=G(),p=C.useMemo(()=>`table-row-${Math.random().toString(16).slice(2)}`,[]);return v(q,{children:$(Ar,{layout:!0,className:o,...c,children:[v(jr,{id:p,layoutId:p,className:"TableRow",children:f.map(x=>$(Br,{className:`TableCellWrapper column-${x.index}`,children:[v(Nr,{className:`TableCellRef column-${x.index}`,children:x.label}),v(Fr,{className:`TableCell column-${x.index}`,children:r[x.index]||null})]},x.key))}),v(j.AnimatePresence,{children:n?v(Pr,{layoutId:`${p}-annex`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,height:0,padding:0,margin:0,overflow:"hidden"},transition:{type:"tween"},"aria-details":p,className:"TableRowAnnex",children:n},"annex"):null})]})})};ie.displayName="TableRow";const je=()=>{const{columns:r=[]}=G();return v(ie,{className:"empty_row",children:Array(r.length).fill(null)})};je.displayName="EmptyRow",T.Button=gr,T.EmptyRow=je,T.PreventScroll=Tr,T.Spinner=ye,T.Table=Xr,T.TableRow=ie,T.binamikCssReset=mr,T.binamikGlobalStyles=vr,T.binamikTheme=br,T.depth=we,Object.defineProperty(T,"__esModule",{value:!0})});
package/package.json CHANGED
@@ -1,34 +1,34 @@
1
1
  {
2
2
  "name": "@binamik/components",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
7
7
  "build:local": "tsc && vite build && node buildLocal.js prebuild && yarn pack && node buildLocal.js postbuild",
8
8
  "preview": "vite preview",
9
- "storybook": "start-storybook -p 6006",
10
- "build-storybook": "build-storybook",
9
+ "storybook": "storybook dev -p 6006",
10
+ "build-storybook": "storybook build",
11
11
  "lint": "eslint . --ext .ts,.tsx",
12
12
  "lint:fix": "eslint . --ext .ts,.tsx --fix",
13
13
  "test": "jest",
14
14
  "test:coverage": "jest --coverage"
15
15
  },
16
- "dependencies": {},
17
16
  "devDependencies": {
18
17
  "@babel/core": "^7.18.2",
19
18
  "@babel/preset-env": "^7.18.2",
20
19
  "@babel/preset-react": "^7.17.12",
21
20
  "@babel/preset-typescript": "^7.17.12",
21
+ "@chromatic-com/storybook": "^1",
22
22
  "@emotion/react": "^11.9.0",
23
23
  "@emotion/styled": "^11.8.1",
24
- "@storybook/addon-actions": "^6.5.0-beta.5",
25
- "@storybook/addon-essentials": "^6.5.0-beta.5",
26
- "@storybook/addon-interactions": "^6.5.0-beta.5",
27
- "@storybook/addon-links": "^6.5.0-beta.5",
28
- "@storybook/builder-vite": "^0.1.33",
24
+ "@storybook/addon-actions": "^8.2.9",
25
+ "@storybook/addon-essentials": "^8.2.9",
26
+ "@storybook/addon-interactions": "^8.2.9",
27
+ "@storybook/addon-links": "^8.2.9",
29
28
  "@storybook/preset-scss": "^1.0.3",
30
- "@storybook/react": "^6.5.0-beta.5",
31
- "@storybook/testing-library": "^0.0.11",
29
+ "@storybook/react": "^8.2.9",
30
+ "@storybook/react-vite": "^8.2.9",
31
+ "@storybook/test": "^8.2.9",
32
32
  "@testing-library/jest-dom": "^5.16.4",
33
33
  "@types/jest": "^28.1.1",
34
34
  "@types/node": "^17.0.31",
@@ -45,7 +45,7 @@
45
45
  "eslint-plugin-import": "^2.26.0",
46
46
  "eslint-plugin-n": "^15.2.1",
47
47
  "eslint-plugin-node": "^11.1.0",
48
- "eslint-plugin-prettier": "^4.0.0",
48
+ "eslint-plugin-prettier": "5.0.0",
49
49
  "eslint-plugin-promise": "^6.0.0",
50
50
  "eslint-plugin-react": "^7.30.0",
51
51
  "eslint-plugin-react-hooks": "^4.5.0",
@@ -57,15 +57,16 @@
57
57
  "react": "17.0.2",
58
58
  "react-dom": "17.0.2",
59
59
  "react-icons": "^4.4.0",
60
+ "storybook": "^8.2.9",
60
61
  "ts-jest": "^28.0.4",
61
62
  "typescript": "^4.6.3",
62
- "vite": "^2.9.7",
63
+ "vite": "^4.5.3",
63
64
  "vite-plugin-dts": "^1.1.1"
64
65
  },
65
66
  "peerDependencies": {
66
67
  "@emotion/react": ">=11.9.0",
67
68
  "@emotion/styled": ">=11.8.1",
68
- "framer-motion": ">=6.2.0",
69
+ "framer-motion": ">=6.3.10",
69
70
  "react": ">=17.0.2",
70
71
  "react-dom": ">=17.0.2",
71
72
  "react-icons": ">=4.3.0"